broadinstitute / infercnv

Inferring CNV from Single-Cell RNA-Seq
Other
566 stars 166 forks source link

does not work with new R 4.2.0 #425

Closed morchalabi closed 2 years ago

morchalabi commented 2 years ago

it fails at step 15 saying coercion to integer created NAs

GeorgescuC commented 2 years ago

Hi @morchalabi ,

Unfortunately from looking into it, this seems to be an issue coming from the Leiden package and/or some of its dependencies (such as igraph). I get the same warnings when running the following minimal Leiden example:

library(leiden)

adjacency_matrix <- rbind(cbind(matrix(round(rbinom(400, 1, 0.8)), 20, 20),
                                matrix(round(rbinom(400, 1, 0.3)), 20, 20), 
                                matrix(round(rbinom(400, 1, 0.1)), 20, 20)),
                          cbind(matrix(round(rbinom(400, 1, 0.3)), 20, 20), 
                                matrix(round(rbinom(400, 1, 0.8)), 20, 20), 
                                matrix(round(rbinom(400, 1, 0.2)), 20, 20)),
                          cbind(matrix(round(rbinom(400, 1, 0.3)), 20, 20), 
                                matrix(round(rbinom(400, 1, 0.1)), 20, 20), 
                                matrix(round(rbinom(400, 1, 0.9)), 20, 20)))

leiden(adjacency_matrix)

The warnings existed for some time, but it seems like in R 4.2 they get converted to errors. The workaround for now is to simply add a suppressWarnings() around the infercnv::run() call.

Regards, Christophe.

morchalabi commented 2 years ago

thank you, appreciate it.