Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

return NAs in the output #4

Closed
YiweiNiu opened this issue Mar 28, 2018 · 6 comments
Closed

return NAs in the output #4

YiweiNiu opened this issue Mar 28, 2018 · 6 comments

Comments

@YiweiNiu
Copy link

Hello,

I'm trying MCPcounter on a RNA-seq dataset. The data was log2(TPM + 1) and already normalized with edgeR.

But I got nothing when I run MCPcounter:

> head(test[,1:3])
                        HS1.T          HS1.T.72         HS1.T.648
WASH7P       0.63380104919836 0.794185147317085 0.954480641249579
AL627309.1 0.0222169840426557 0.335495737927714 0.385655240383999
AL627309.7  0.704619583659401  3.44987164522051  2.89904206987385
AL627309.8   1.80259708466709  4.92177062818067  4.28884088066269
AL627309.2 0.0284149765987027 0.852296560890739  0.51937820779438
AL627309.5  0.088498084557146  1.34811915120593 0.723907865588843

> class(test)
[1] "data.frame"

> ExampleEstimates = MCPcounter.estimate(test, featuresType="HUGO_symbols")
There were 50 or more warnings (use warnings() to see the first 50)

> warnings()
Warning messages:
1: In mean.default(newX[, i], ...) :
  argument is not numeric or logical: returning NA
2: In mean.default(newX[, i], ...) :
  argument is not numeric or logical: returning NA
3: In mean.default(newX[, i], ...) :
  argument is not numeric or logical: returning NA
4: In mean.default(newX[, i], ...) :
  argument is not numeric or logical: returning NA
5: In mean.default(newX[, i], ...) :
  argument is not numeric or logical: returning NA
6: In mean.default(newX[, i], ...) :
  argument is not numeric or logical: returning NA
7: In mean.default(newX[, i], ...) :
  argument is not numeric or logical: returning NA

> head(ExampleEstimates[,1:3])
                      HS1.T HS1.T.72 HS1.T.648
T cells                  NA       NA        NA
CD8 T cells              NA       NA        NA
Cytotoxic lymphocytes    NA       NA        NA
NK cells                 NA       NA        NA
B lineage                NA       NA        NA
Monocytic lineage        NA       NA        NA

> sessionInfo()
R version 3.4.1 (2017-06-30)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 16299)

Matrix products: default

locale:
[1] LC_COLLATE=Chinese (Simplified)_China.936  LC_CTYPE=Chinese (Simplified)_China.936   
[3] LC_MONETARY=Chinese (Simplified)_China.936 LC_NUMERIC=C                              
[5] LC_TIME=Chinese (Simplified)_China.936    

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

other attached packages:
[1] MCPcounter_1.1.0 curl_3.1        

loaded via a namespace (and not attached):
[1] compiler_3.4.1 tools_3.4.1

Do you know how to solve this? Thank you!

Bests,
Yiwei Niu

@ebecht
Copy link
Owner

ebecht commented Mar 29, 2018

Hi Yiwei Niu,

I think your issue could come from a mismatch between the gene symbols MCPcounter uses and the ones that are used as row.names in your expression matrix.

Could you check the output of the following code block?

require(curl)
genes=read.table(curl:::curl("http://raw.githubusercontent.com/ebecht/MCPcounter/master/Signatures/genes.txt"),sep="\t",stringsAsFactors=FALSE,header=TRUE,colClasses="character",check.names=FALSE)
intersect(rownames(test),genes[,"HUGO symbols"])

If it shows NULL this is probably the source of the problem.

The following can help you find genes in the rownames of test that contain the symbols used by MCPcounter:

sapply(genes[,"HUGO symbols"],grep,value=TRUE,x=rownames(test),simplify=FALSE)

@YiweiNiu
Copy link
Author

Thank you for your quick reply! You are right. I prefiltered the expression matrix earlier, but I forgot.

And I have sevral other questions:

  1. I found MCPcounter was designed for studying the immune cells of tumor tissues. Can it be applied to other heterogeneous samples, such as peripheral blood?
  2. The paper of MCPcounter only used data from microarray, can it be used to RNA-seq data? If yes, how to prepare the data?
  3. It seems that MCPcounter.estimate function reads gene signatures from Github, can I use my own gene set?
  4. The main usage of MCPcounter is for comparing across samples, can I compare ascross cell types? For example, compare the ratio of two cell types among several samples.

Any comments or suggestions will be appreciated.

Bests,
Yiwei Niu

@ebecht
Copy link
Owner

ebecht commented Apr 2, 2018

Hello,
To answer your questions:

  1. MCPcounter should work for any human tissue with a caveat: the controls we used - while broad (we used data from the cancer cell line encyclopedia which represent many cell types) may not cover some cell types in certain specific tissues. For blood there should be absolutely no problem.

  2. We applied it to TCGA data (which is RNAseq) and obtained results that were highly consistent with what we observed in independent microarray cohorts. The data should be log2-transformed. I can't really give more specific advice on the best pre-processing methods.

  3. Yes, you can also download the signatures from github and refers to them locally. We may change this to include the gene signatures directly into the package.

  4. No I do not think that this is possible without using some calibration samples first.

Since your issue is fixed I will close this topic but feel free to ask questions if you need to!

@ebecht ebecht closed this as completed Apr 2, 2018
@YiweiNiu
Copy link
Author

YiweiNiu commented Apr 2, 2018

Thank you!

@ebecht ebecht mentioned this issue Jul 27, 2018
@lvdaha
Copy link

lvdaha commented Jan 22, 2019

Hello,dear ebecht
Thank you very much for your excellent MCPcounter package.
But I am a newcomer to R. When I use the MCPcounter package, I don't know how to use the test_for_infiltration function. Especially do not know how to adjust the parameters.
My initial expression matrix is from RNA-seq, the row name is the gene symbol, and the column name is the sample name.
Can you take a step-by-step tutorial on the use of the MCPcounter package, I think that will be of great help to our R beginners.

@Rahulncbs
Copy link

Thank you for your quick reply! You are right. I prefiltered the expression matrix earlier, but I forgot.

And I have sevral other questions:

  1. I found MCPcounter was designed for studying the immune cells of tumor tissues. Can it be applied to other heterogeneous samples, such as peripheral blood?
  2. The paper of MCPcounter only used data from microarray, can it be used to RNA-seq data? If yes, how to prepare the data?
  3. It seems that MCPcounter.estimate function reads gene signatures from Github, can I use my own gene set?
  4. The main usage of MCPcounter is for comparing across samples, can I compare ascross cell types? For example, compare the ratio of two cell types among several samples.

Any comments or suggestions will be appreciated.

Bests,
Yiwei Niu

Hi Yiwei,
Can i get the dataset on which you are trying to run th MCPcounter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants