omnideconv / immunedeconv

A unified interface to immune deconvolution methods (CIBERSORT, EPIC, quanTIseq, TIMER, xCell, MCPcounter) and mouse deconvolution methods
https://omnideconv.org/immunedeconv/index.html
Other
463 stars 102 forks source link

Cibersort deconvolute error #86

Open RichardCorbett opened 2 years ago

RichardCorbett commented 2 years ago

Hi folks,

I have a simple column of TPMs that works well with MCP, TIMER, EPIC, all from within immunedeconv.

My TPMs are in a matrix with the following format:

head hgnc_tpm.csv 
HGNC TPM
TSPAN6 1.75
TNMD 0.00
DPM1 10.86
SCYL3 1.12
C1orf112 2.69
FGR 0.05
CFH 5.03
FUCA2 2.55
GCLC 1.29
...

My basic script:

#load the matrix of samples and assign row names
TPMs = read.csv(TPM_file, sep=" ", header=TRUE)
TPMs = TPMs %>% 
    arrange(HGNC) %>%
    remove_rownames %>% 
    column_to_rownames(var="HGNC")
res = deconvolute(TPMs, "cibersort")
knitr::kable(res, digits=2)

When I try and run cibersort I get the following output:

Command error: Loading required package: EPIC

Attaching package: ‘dplyr’

The following objects are masked from ‘package:stats’:

  filter, lag

The following objects are masked from ‘package:base’:

  intersect, setdiff, setequal, union

Running cibersort Error in order(rownames(Y)) : argument 1 is not a vector Calls: deconvolute ... deconvolute_cibersort -> eval -> eval -> -> order In addition: Warning message: The path argument of write_tsv() is deprecated as of readr 1.4.0. Please use the file argument instead. This warning is displayed once every 8 hours. Call lifecycle::last_warnings() to see where this warning was generated. Execution halted

sessioninfo() output:

R version 4.1.0 (2021-05-18) Platform: x86_64-conda-linux-gnu (64-bit) Running under: Debian GNU/Linux 10 (buster)

Matrix products: default BLAS/LAPACK: /usr/local/lib/libopenblasp-r0.3.15.so

locale: [1] LC_CTYPE=C.UTF-8 LC_NUMERIC=C LC_TIME=C.UTF-8
[4] LC_COLLATE=C.UTF-8 LC_MONETARY=C.UTF-8 LC_MESSAGES=C.UTF-8
[7] LC_PAPER=C.UTF-8 LC_NAME=C LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C

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

other attached packages: [1] dplyr_1.0.6 tidyr_1.1.3 tibble_3.1.2 immunedeconv_2.0.3 [5] EPIC_1.1.0

loaded via a namespace (and not attached): [1] locfit_1.5-9.4 Rcpp_1.0.6 lattice_0.20-44
[4] png_0.1-7 Biostrings_2.60.0 utf8_1.2.1
[7] cellranger_1.1.0 R6_2.5.0 GenomeInfoDb_1.28.0
[10] stats4_4.1.0 RSQLite_2.2.5 sva_3.40.0
[13] httr_1.4.2 pillar_1.6.1 zlibbioc_1.38.0
[16] rlang_0.4.11 readxl_1.3.1 rstudioapi_0.13
[19] annotate_1.70.0 limSolve_1.5.6 blob_1.2.1
[22] S4Vectors_0.30.0 Matrix_1.3-4 preprocessCore_1.54.0 [25] splines_4.1.0 BiocParallel_1.26.0 readr_1.4.0
[28] RCurl_1.98-1.3 bit_4.0.4 compiler_4.1.0
[31] pkgconfig_2.0.3 BiocGenerics_0.38.0 mgcv_1.8-36
[34] tidyselect_1.1.1 KEGGREST_1.32.0 GenomeInfoDbData_1.2.6 [37] lpSolve_5.6.15 edgeR_3.34.0 quadprog_1.5-8
[40] IRanges_2.26.0 matrixStats_0.59.0 XML_3.99-0.6
[43] fansi_0.4.2 crayon_1.4.1 MASS_7.3-54
[46] bitops_1.0-7 grid_4.1.0 nlme_3.1-152
[49] xtable_1.8-4 lifecycle_1.0.0 DBI_1.1.1
[52] magrittr_2.0.1 stringi_1.6.2 cachem_1.0.5
[55] XVector_0.32.0 genefilter_1.74.0 testit_0.13
[58] limma_3.48.0 ellipsis_0.3.2 generics_0.1.0
[61] vctrs_0.3.8 data.tree_1.0.0 tools_4.1.0
[64] bit64_4.0.5 Biobase_2.52.0 glue_1.4.2
[67] purrr_0.3.4 hms_1.1.0 parallel_4.1.0
[70] fastmap_1.1.0 survival_3.2-11 AnnotationDbi_1.54.0
[73] memoise_2.0.0

Currently I am running this on patient data that I can't share, but if there isn't anything obvious with what I posted above I can try and create some pretend results to see if it will still crash.

grst commented 2 years ago

Thanks for the bug report! I wonder if the issue is that it's a single sample. For testing purposes, could you give it a try to include the same sample twice into your TPM matrix?

RichardCorbett commented 2 years ago

Thanks for the suggestion.
I did the analysis using two identical columns of TPM values and seem to have gotten around the error:

Output:

"","cell_type","TPM","TPM2"
"1","B cell naive",0,0
"2","B cell memory",0.134434268121404,0.134434268121404
"3","B cell plasma",0,0
"4","T cell CD8+",0,0
...
grst commented 2 years ago

Thanks for testing! Let's keep this open, this is certainly a bug that needs to be fixed!