Open masaver opened 4 years ago
Hi Mathias,
there must be something weird with your data. Did you make sure the data is not log-transformed?
To further narrow this down:
Best, Gregor
I run TIMER on one sample.
> head(tpm_mat2)
TPM
TSPAN6 24.51
TNMD 0.00
DPM1 22.63
SCYL3 5.47
C1orf112 2.68
FGR 3.16
> res_timer = deconvolute(tpm_mat2, "timer",indications=c("SKCM"))
>>> Running timer
## Enter batch mode
## Loading immune gene expression
[1] "Outlier genes: ALB HP MT-ATP8 MT-CO3 MT-ND3"
## Removing the batch effect of /tmp/RtmpYxDzKw/file2ab9f21c6d71ec
Found2batches
Note: one batch has only one sample, setting mean.only=TRUE
Adjusting for0covariate(s) or covariate level(s)
Standardizing Data across genes
Fitting L/S model and finding priors
Finding parametric adjustments
Adjusting the Data
Error in `colnames<-`(`*tmp*`, value = colnames(gene_expression_matrix)) :
attempt to set 'colnames' on an object with less than two dimensions
Hi @plsysu,
thanks for reporting! I suspect TIMER has a problem when running with only one sample :thinking:
To verify, could you please check:
Cheers, Gregor
Hi @grst,
Yes, It's TIMER's problem.
> head(tpm_mat2)
TPM TPM2
TSPAN6 24.51 24.51
TNMD 0.00 0.00
DPM1 22.63 22.63
SCYL3 5.47 5.47
C1orf112 2.68 2.68
FGR 3.16 3.16
> res_timer = deconvolute(as.matrix(tpm_mat2), "timer",indications=c("SKCM","SKCM"))
>>> Running timer
## Enter batch mode
## Loading immune gene expression
[1] "Outlier genes: ALB HP MT-ATP8 MT-CO3 MT-ND3"
## Removing the batch effect of /tmp/RtmpbSz66r/file2c347b760d1e6
Found2batches
Adjusting for0covariate(s) or covariate level(s)
Standardizing Data across genes
Fitting L/S model and finding priors
Finding parametric adjustments
Error in while (change > conv) { : missing value where TRUE/FALSE needed
> tpm_mat2$TPM2 <- tpm_mat2$TPM2+1
> head(tpm_mat2)
TPM TPM2
TSPAN6 24.51 25.51
TNMD 0.00 1.00
DPM1 22.63 23.63
SCYL3 5.47 6.47
C1orf112 2.68 3.68
FGR 3.16 4.16
> res_timer = deconvolute(as.matrix(tpm_mat2), "timer",indications=c("SKCM","SKCM"))
>>> Running timer
## Enter batch mode
## Loading immune gene expression
[1] "Outlier genes: ALB HP MT-ATP8 MT-CO3 MT-ND3"
## Removing the batch effect of /tmp/RtmpbSz66r/file2c347b291646e4
Found2batches
Adjusting for0covariate(s) or covariate level(s)
Standardizing Data across genes
Fitting L/S model and finding priors
Finding parametric adjustments
Adjusting the Data
> res_timer
# A tibble: 6 x 3
cell_type TPM TPM2
<chr> <dbl> <dbl>
1 B cell 0.105 0.107
2 T cell CD4+ 0.115 0.117
3 T cell CD8+ 0.207 0.209
4 Neutrophil 0.117 0.119
5 Macrophage 0.0473 0.0486
6 Myeloid dendritic cell 0.493 0.495
> set_cibersort_binary("/CIBERSORT/CIBERSORT_v1.03.R")
> set_cibersort_mat("/CIBERSORT/LM22.txt")
>
>
>
> res_cibersort = deconvolute(tpm_mat, "cibersort")
>>> Running cibersort
Error in (function (sig_matrix, mixture_file, perm = 0, QN = TRUE) :
unused arguments (absolute = FALSE, abs_method = "sig.score")
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.
> res_cibersort = deconvolute(tpm_mat2, "cibersort")
>>> Running cibersort
Error in (function (sig_matrix, mixture_file, perm = 0, QN = TRUE) :
unused arguments (absolute = FALSE, abs_method = "sig.score")
> deconvolute(tpm_mat, "xcell")
>>> Running xcell
Error in if (dim(expr)[1] < 5000) { : argument is of length zero
> res_xcell = deconvolute(tpm_mat2, "xcell")
>>> Running xcell
Warning message:
In .local(expr, gset.idx.list, ...) :
10789 genes with constant expression values throuhgout the samples.
> res_xcell
# A tibble: 39 x 3
cell_type TPM TPM2
<chr> <dbl> <dbl>
1 Myeloid dendritic cell activated 0 0
2 B cell 0 0
3 T cell CD4+ memory 0 0
4 T cell CD4+ naive 0 0
5 T cell CD4+ (non-regulatory) 0 0
6 T cell CD4+ central memory 0 0
7 T cell CD4+ effector memory 0 0
8 T cell CD8+ naive 0 0
9 T cell CD8+ 0 0
10 T cell CD8+ central memory 0 0
# … with 29 more rows
Hi @plsysu,
thanks a lot for your detailed analysis. I'll try to fix that!
Regarding xcell being all-zero: xCell is really good at avoiding false-positive "background-predictions", while TIMER is really bad at it (see our paper, so it could actually be the case that there are none (or very few) immune cells present. Would you expect immune cells in your sample?
Hi @grst,
This sample is obtained from a melanoma patient of a public data downloaded from SRA. It is expected to contain immune cells.
This paper is very helpful, it explained the problem I have met.
In particular, xCell uses the variability
among the samples for a linear transformation of the output score.
TIMER uses COMBAT (Johnson et al., 2007) to merge the input
samples with reference profiles. This is particularly problematic
with small datasets and hampers comparability and interpretability
of the score. Moreover, xCell does not detect any signal when ran
with few non-heterogeneous samples (Aran, 2018).
In particular, there is some warnings when running Xcell:
Warning message:
In .local(expr, gset.idx.list, ...) :
10789genes with constant expression values throuhgout the samples.
It seems that all genes were filtered due to low variance accross samples by GSVA R package. Because there are only two samples, variance accross samples can not be estimated properly.
Good point, I should have remembered hat one! I will add a warning message when running xCell with few samples.
yi tuo da bian
Hi everyone,
I'm trying to run the TIMER deconvolution method on a set of lung normal & tumor RNAseq data, using the following line:
res_timer = deconvolute( tpm , "timer" , indications = rep( "luad" , 116 ) )
However i get the following error:
If i use the code to run TIMER, on two different datasets, the methods works fine.
Any idea of why this error is happening ?
Thanks in advance.
Best,
-Mathias