Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It can't work when I source the function in the other .R file. #23

Open
EularTang opened this issue May 10, 2019 · 0 comments
Open

It can't work when I source the function in the other .R file. #23

EularTang opened this issue May 10, 2019 · 0 comments

Comments

@EularTang
Copy link

Hi,
Thanks for your great job!But I encountered trouble in using the package 'docstring'.
When I code the own function in the another .R file and source it, The function docstring will report an error and will not display any help files.Details are as follows:

source('/home/tangchen/vde/ls.R')
docstring(define_sce)
Error in docstring_to_roxygen(fun, fun_name = fun_name, default_title = default_title): This function doesn't have any detectable docstring
Traceback:


1. docstring(define_sce)

2. docstring_to_roxygen(fun, fun_name = fun_name, default_title = default_title)

3. stop("This function doesn't have any detectable docstring")

But if I input my own function in console, everything will be OK.The words following the #' can be showed.
So what should I do to be able to use your function normally when I source the another R file?

define_sce=function(df,coldata=TRUE){
#' Compute similarity [/home/tangchen/code/scRNA_code/scmap_lung.R]
#' define our database
  if (coldata==TRUE){
      coldata=data.frame(cell=colnames(df),cell_type1=colnames(df))
  }
  e <- SingleCellExperiment(assays = list(normcounts = as.matrix(df)), colData = coldata)
  logcounts(e) <- log2(normcounts(e) + 1)    
  rowData(e)$feature_symbol <- rownames(e)    
  isSpike(e, "ERCC") <- grepl("^ERCC-", rownames(e))    
  e <- e[!duplicated(rownames(e)), ] 
  return(e)
}

docstring(define_sce)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant