dviraran / SingleR

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

SingleR.DrawHeatmap Error message #71

Open shokohirosue opened 5 years ago

shokohirosue commented 5 years ago

Hi,

I tried to run the function SingleR.DrawHeatmap(singler$singler[[1]]$SingleR.single.main, top.n = Inf, clusters = levels(singler$meta.data$clusters)) and it gave me the error message

Error in hclust(d, method = method) : 
  NA/NaN/Inf in foreign function call (arg 11)

I checked singler$singler[[1]]$SingleR.single.main$scores and it does not contain any of NA/NaN/Inf.

I tried running pheatmap directly on this matrix pheatmap(singler$singler[[1]]$SingleR.single.main$scores) and it produces a heatmap without error.

Do you have any idea why this could be?

Thank you so much for your help.

Kind regards, Shoko Hirosue

dviraran commented 5 years ago

Hi,

Why are you using clusters = levels(singler$meta.data$clusters))? this should be singler$meta.data$clusters$cl. Try running it without clusters at all. Also, not a good idea to use top.n = Inf, this will be impossible to read.

Best, Dvir

shokohirosue commented 5 years ago

Dear Dvir,

Thank you for your reply.

It gives me the same error without all those arguments. I adopted top.n argument from SingleR Supplementary Information 2 example using the link from this page (https://github.com/dviraran/SingleR).

Thank you very much.

Best regards, Shoko

dviraran commented 5 years ago

I really don't know. The error is produced by pheatmap in trying to cluster the data. You can try following the code of this SIngleR.DrawHeatmap and figure out what is causing it to fail.

Right, if you use main types than inf is fine.