dviraran / SingleR

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

Error in nn.d^2 : non-numeric argument to binary operator #113

Open MMriran opened 5 years ago

MMriran commented 5 years ago

Dear sir, it is a great work that you designed singleR, moreover,I just upgraded to SingleR from bioconductor. And,after I ran SingleR with your "Using the built-in references" part code,there was an error"Error in nn.d^2 : non-numeric argument to binary operator"

library(SingleR) hpca.se <- HumanPrimaryCellAtlasData() hpca.se library(scRNAseq) hESCs <- LaMannoBrainData('human-es') hESCs <- hESCs[,1:100] library(scater) common <- intersect(rownames(hESCs), rownames(hpca.se)) hpca.se <- hpca.se[common,] hESCs <- hESCs[common,] hESCs <- logNormCounts(hESCs) pred.hpca <- SingleR(test = hESCs, ref = hpca.se, labels = hpca.se$label.main)

so how can i solve this problem? Best wishes!

Yours sincerely, CHEN

MediciPrime commented 5 years ago

I have the same problem, just updated yesterday and today SingleR is running into that error. I am literally running the code from part 2 of the vignette and having the same problem. Please fix this @dviraran , the bioconductor version was working great before the update.

MediciPrime commented 5 years ago

Hi @MMriran I figured out the problem. You need to downgrade your version of BiocNeighbors from 1.3.5 to 1.3.3. Some updates were pushed onto it last weekend that have bugs in them.

Use code below to downgrade your BiocNeighbors Package: devtools::install_github("LTLA/BiocNeighbors", ref="be43721")

Once its installed restart your R session and assuming you installed SingleR using Bioconductor, it should all work fine from there.

MMriran commented 5 years ago

hi@MediciPrime,thank you!!!! however,after I ran the codedevtools::install_github("LTLA/BiocNeighbors", ref="be43721") there was another error “_### ERROR: failed to lock directory 'C:/Program Files/R/R-3.6.1/library' for modifying Try removing 'C:/Program Files/R/R-3.6.1/library/00LOCK-BiocNeighbors' Error: Failed to install 'BiocNeighbors' from GitHub: (converted from warning) installation of package ‘C:/Users/Administrator/AppData/Local/Temp/RtmpGiADOX/file44b02c823554/BiocNeighbors1.3.3.tar.gz’ had non-zero exit status ”.

dviraran commented 5 years ago

Hi,

Yes, this is a problem because of a change in BiocNeighbors, and will be fixed with the next build of bioC devel. We are working on fixing this.

In the future, to get faster response, strongly suggest raising issues in https://github.com/LTLA/SingleR

Best, Dvir

MMriran commented 5 years ago

Yes!thant you for your reply! @dviraran

MediciPrime commented 5 years ago

@MMriran the alternative approach to downgrading BiocNeighbors would be to upgrade SingleR. Since BiocNeighbors 1.3.5 is made to run on the newest version of SingleR which hasn't been uploaded to Bioconductor.

I would run the following command: devtools::install_github("LTLA/SingleR", ref="0c10e16")

For your error above I would try doing what the error suggests, "Try removing C:/Program Files/R/R-3.6.1/library/00LOCK-BiocNeighbors" although I am not positive on how to solve it.

Goodluck!