Correlation between two expression matrices in blood and tumor
2
0
Entering edit mode
8.3 years ago
Palgrave ▴ 110

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.

R rna-seq • 2.6k views
ADD COMMENT
1
Entering edit mode
8.3 years ago

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

for(i in 1:nrow(blood)){   
  cor(blood[i,], tumor[i,])   
}
ADD COMMENT
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode
8.3 years ago

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 COMMENT
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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 REPLY
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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 REPLY

Login before adding your answer.

Traffic: 2104 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6