前言:在構(gòu)建ceRNA 網(wǎng)絡(luò)時(shí),需要計(jì)算lncRNA 與 蛋白編碼gene (pc gene) 間的表達(dá)相關(guān)性,一般采用皮爾遜相關(guān)系數(shù)。具體如何做呢?
- 首先獲得lncRNA 的表達(dá)矩陣
假設(shè)有5個(gè)lncRNA,在100個(gè)樣本中的表達(dá)量矩陣:
> head(lncRNA)
lncRNA1 lncRNA2 lncRNA3 lncRNA4 lncRNA5
sam1 7.80 5.81 6.40 6.11 4.87
sam2 1.47 1.75 2.49 2.20 2.02
sam3 0.00 0.00 1.28 0.00 0.00
sam4 0.00 0.00 1.74 0.00 0.00
sam5 1.83 0.99 0.72 0.69 0.50
sam6 0.00 4.04 0.00 0.00 0.00
> dim(lncRNA)
[1] 100 5
2.獲得mRNA的表達(dá)矩陣
4個(gè)基因在100個(gè)樣本的表達(dá)量矩陣:
> head(gene)
gene 1 gene 2 gene 3 gene 4
sam1 7.66 7.19 7.30 6.98
sam2 1.34 0.29 1.77 1.61
sam3 0.00 0.00 0.00 0.00
sam4 0.14 0.41 0.56 0.77
sam5 0.50 0.48 0.73 0.27
sam6 0.00 0.00 0.00 0.00
> dim(gene)
[1] 100 4
3.計(jì)算lncRNA 與gene 的表達(dá)相關(guān)性
使用cor()函數(shù)進(jìn)行皮爾森相關(guān)系數(shù)計(jì)算,就是這么簡(jiǎn)單:
> cor_matrix <- cor(lncRNA,gene,metho="pearson")
> cor_matrix
gene 1 gene 2 gene 3 gene 4
lncRNA1 0.116393943 0.082464228 0.070419800 0.08509885
lncRNA2 -0.001455028 -0.004848818 0.008653588 -0.01047322
lncRNA3 0.027655655 0.019760497 0.029196236 0.00464662
lncRNA4 -0.016414621 -0.024633893 -0.012498862 -0.03835430
lncRNA5 -0.018116788 -0.018668500 -0.013198682 -0.03287980
> pheatmap(cor_matrix)

Pearson相關(guān)系數(shù)結(jié)果