Question: Correlation between two expression matrices in blood and tumor
0
gravatar for Palgrave
3.2 years ago by
Palgrave20
Singapore
Palgrave20 wrote:

I have three gene expression matrices, one from blood one from tumor and one from normal adjacent tissue. I would like to correlate the expression of all rows (genes) in blood and tumor. The matrices are ordered so that they contain the same samples (colnames) and same genes (rownames). What is the best way to do this in R?

My aim is to to check of some of the genes that are highly expressed in blood are also up-regulated in the tumor samples. Since I only have one data set from blood I cannot make a differentially expression analysis on blood alone.

rna-seq R • 1.2k views
ADD COMMENTlink modified 3.2 years ago by Devon Ryan89k • written 3.2 years ago by Palgrave20
1
gravatar for Jean-Karim Heriche
3.2 years ago by
EMBL Heidelberg, Germany
Jean-Karim Heriche18k wrote:

Quick answer, there's probably a better way without a loop:

for(i in 1:nrow(blood)){   
  cor(blood[i,], tumor[i,])   
}
ADD COMMENTlink modified 3.2 years ago • written 3.2 years ago by Jean-Karim Heriche18k

does it work with data frames? My output is empty...

 

ADD REPLYlink written 3.2 years ago by Palgrave20
0
gravatar for Devon Ryan
3.2 years ago by
Devon Ryan89k
Freiburg, Germany
Devon Ryan89k wrote:

You can just correlate everything with:

m = cor(cbind(blood, tumor))

That makes a nice matrix that you could also make a heatmap out of.

ADD COMMENTlink written 3.2 years ago by Devon Ryan89k

I have have performed log2 cpm normalization on the two matrices before correlating them. Shoul I perform scaling as well?

ADD REPLYlink written 3.2 years ago by Palgrave20

Did you normalize the values before getting the log2(cpm)? log2(cpm) itself is not a robust normalization. I would suggest that you use edgeR/DESeq2/etc. to get properly normalized values to make the CPMs out of (edgeR has a cpm() function, I think).

ADD REPLYlink written 3.2 years ago by Devon Ryan89k

I used cpm function in limma, so it should be ok.

ADD REPLYlink written 3.2 years ago by Palgrave20

As long as you had all of the samples from all of the groups together, then yes. Then you don't need further normalization.

ADD REPLYlink written 3.2 years ago by Devon Ryan89k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1364 users visited in the last hour