broadinstitute / infercnv

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

Error in FUN(left, right) #341

Closed shift900 closed 2 years ago

shift900 commented 3 years ago

Hi everyone,

I'm trying to run CNV, but I'm getting the following error :

Error in FUN(left, right) : non-numeric argument to binary operator

Here is my traceback :

> traceback() 6: eval(f) 5: eval(f) 4: Ops.data.frame(genomic_position[2], genomic_position[3]) 3: which(genomic_position[2] + genomic_position[3] == 0) 2: .order_reduce(data = raw.data, genomic_position = gene_order) 1: CreateInfercnvObject(raw_counts_matrix = G, annotations_file = D, gene_order_file = gene_order, ref_group_names = NULL)

I guess there is something wrong with my gene_order_file, but it looks as it is in the example. Here is a piece of my gene_order_file:

image

And sessioninfo() `R version 4.0.5 (2021-03-31) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 19042)

Matrix products: default

locale: [1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252

attached base packages: [1] parallel stats4 stats graphics grDevices utils datasets methods
[9] base

other attached packages: [1] celldex_1.0.0 scran_1.18.7
[3] SingleR_1.4.1 SeuratObject_4.0.2
[5] Seurat_4.0.2 infercnv_1.6.0
[7] SingleCellExperiment_1.12.0 SummarizedExperiment_1.20.0 [9] Biobase_2.50.0 GenomicRanges_1.42.0
[11] GenomeInfoDb_1.26.7 IRanges_2.24.1
[13] S4Vectors_0.28.1 BiocGenerics_0.36.1
[15] MatrixGenerics_1.2.1 matrixStats_0.59.0 `

GeorgescuC commented 3 years ago

Hi @shift900 ,

If the format you sent is that of the object already loaded in R as it seems to be, the issue should be that rather than having column V1, the gene names should be set as row names. If you are reading the data from a file with read.table(), you can use row.names=1 to do that, or if you just provide the path to the file itself, infercnv should read it properly.

Regards, Christophe.