dviraran / SingleR

SingleR: Single-cell RNA-seq cell types Recognition (legacy version)
GNU General Public License v3.0
263 stars 98 forks source link

names attribute must be same length as vector #68

Open mbassalbioinformatics opened 5 years ago

mbassalbioinformatics commented 5 years ago

Hi im trying to run singleR over a subset of full dataset, splitting to 10,000 cell chunks . When running i get the errors

Error in names(labels) <- t(colnames(sc_data)) : 'names' attribute [10000] must be the same length as the vector [9997] In addition: Warning messages: 1: In UseMethod("depth") : no applicable method for 'depth' applied to an object of class "NULL" 2: In selectChildren(pids[!fin], -1) : cannot wait for child 36981 as it does not exist 3: In parallel::mccollect(...) : 1 parallel job did not deliver a result 4: In selectChildren(pids[!fin], -1) : cannot wait for child 11014 as it does not exist 5: In parallel::mccollect(...) : 1 parallel job did not deliver a result

SingleR will run for a couple of steps then stop [1] 1 [1] "Dimensions of counts data: 21124x10000" [1] "Annotating data with Immgen..." [1] "Variable genes method: de" [1] "Number of DE genes:3597" [1] "Number of cells: 10000" [1] "Fine-tuning round on top cell types (using 10 CPU cores):" |====| 100%, Elapsed 05:52:00 [1] "Number of DE genes:3597" [1] "Number of clusters: 10" [1] "Fine-tuning round on top cell types (using 10 CPU cores):" |=====| 100%, Elapsed 00:22 [1] "Annotating data with Immgen (Main types)..." [1] "Number of DE genes:2231" [1] "Number of cells: 10000" Error in names(labels) <- t(colnames(sc_data)) : 'names' attribute [10000] must be the same length as the vector [9997]

Im using the exact same code as in http://comphealth.ucsf.edu/SingleR/SingleR.MCA.html and have used the exact same code for multiple datasets but for this 1 instance something keeps failing and the annotation is being trimmed by 3 names for some reason.

Any suggestions? Ive tried re-installing to the latest version of SingleR but still the problem persists. Thanks

chlee-tabin commented 5 years ago

Looks like there is a bug in the cor.stable function inside the SingleR package. I created a pull request to avoid this error.

dviraran commented 5 years ago

The issue is probably the use of min.genes=200, thats the only place where I can think that there is filtering of cells. Just set it to 0 and it should work.