LuyiTian / scPipe

a pipeline for single cell RNA-seq data analysis
69 stars 24 forks source link

No such file or directory error in `create_sce_by_dir` #110

Closed zhewa closed 5 years ago

zhewa commented 5 years ago

Hi,

I encountered this "No such file or directory" error when running the create_sce_by_dir function. This happens if I specify a non-existing outdir in the preceding sc_demultiplex step.

Error in file(file, "rt") : cannot open the connection
In addition: Warning message:
In file(file, "rt") :
  cannot open file './test/stat/cell_stat.csv': No such file or directory

Here outdir = "./test". Strangely this error disappears after I re-run the sc_demultiplex and sc_gene_counting functions and run create_sce_by_dir again using the same parameters. My guess is it has something to do with the order of folder creation in these functions and it's probably due to these few lines of code in file wrapper_scPipeCPP.R (function sc_demultiplex, lines 273-277): https://github.com/LuyiTian/scPipe/blob/800b6ad4bd2298b975a6a4a60ebb8d6fe4c14f60/R/wrapper_scPipeCPP.R#L273-L277

The code chunk that generated this error is as follows:

sc_demultiplex(assigned_bams,
    outdir = "./test",
    bcfile,
    has_UMI = TRUE,
    nthreads = 1)
sc_gene_counting("./test", bcfile, UMI_cor = 1) # UMI_cor = 0 not implemented
sce = create_sce_by_dir("./test")
LuyiTian commented 5 years ago

It is recommended to use the absolute path in scPipe. We will update the documentation to highlight that.