khodosevichlab / CRMetrics

Summarization of CellRanger count metrics.
5 stars 0 forks source link

Cannot read in count matrices #4

Closed HenriettaHolze closed 2 years ago

HenriettaHolze commented 2 years ago

When trying to read count matrices with the code in inspiration.Rmd I get an error. I tried

> pagoda2::read.10x.matrices("/data/PD-MSA_lentiform_nucleus/counts_premrna/CTRL_037/outs/filtered_feature_bc_matrix")

And get 

reading 1 dataset(s) Error in file(file, "rt") : cannot open the connection In addition: Warning message: In file(file, "rt") : cannot open file '/data/PD-MSA_lentiform_nucleus/counts_premrna/CTRL_037/outs/filtered_feature_bc_matrix/features.tsv': No such file or directory

HenriettaHolze commented 2 years ago

@rrydbirk can you help with this? pagoda is expecting a features.tsv file that isn't there.

HenriettaHolze commented 2 years ago

Should we use the raw_feature_bc_matrix/ or filtered_feature_bc_matrix/? I can only read the raw files.

HenriettaHolze commented 2 years ago

This works but I think it's a hack? option V2 looks for the genes file and not the features file.

cmsFiltered <- samples %>% 
  lapply(function(x) {
    paste0("/data/PD-MSA_lentiform_nucleus/counts_premrna/",x,"/outs/filtered_feature_bc_matrix")
  }) %>%
  plapply(pagoda2::read.10x.matrices, n.cores = 6, version = "V2")
rrydbirk commented 2 years ago

Yeah, they updated that function since I used it last time. Actually, you can just use this since it's already multithreaded.

cms <- dir(path="/data/PD-MSA_lentiform_nucleus/counts_premrna/") %>% lapply(function(p) paste0("/data/PD-MSA_lentiform_nucleus/counts_premrna/",p,"/outs/filtered_feature_bc_matrix")) %>% setNames(dir("/data/PD-MSA_lentiform_nucleus/counts_premrna/")) %>% .[-grep("FAIL",.)] %>% pagoda2::read.10x.matrices(n.cores = 10, version = "V2")

rrydbirk commented 2 years ago

Sorry, Github doesn't pass indentations