Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- > head(expr_mat)
- Tarca_025_P1C01 Tarca_027_P1C03 Tarca_028_P1C04 Tarca_029_P1C05
- 100033426_at 7.969054 5.717904 5.533932 9.563440
- 100033427_at 10.798265 8.210226 8.346338 11.853010
- 100033428_at 2.107169 2.159903 2.183112 2.356944
- 100033430_at 2.465297 1.996229 2.188106 2.126542
- 100033431_at 5.629301 4.196539 4.016405 7.648581
- 100033432_at 3.245348 2.628399 2.272071 4.652379
- 100033433_at 2.338819 2.025551 2.253913 3.830992
- > head(pheno)
- SampleID GA Batch Set Train Platform
- Tarca_001_P1A01 Tarca_001_P1A01 11.0 1 PRB_HTA 1 HTA20
- Tarca_013_P1B01 Tarca_013_P1B01 15.3 1 PRB_HTA 1 HTA20
- Tarca_025_P1C01 Tarca_025_P1C01 21.7 1 PRB_HTA 1 HTA20
- Tarca_037_P1D01 Tarca_037_P1D01 26.7 1 PRB_HTA 1 HTA20
- Tarca_049_P1E01 Tarca_049_P1E01 31.3 1 PRB_HTA 1 HTA20
- Tarca_061_P1F01 Tarca_061_P1F01 32.1 1 PRB_HTA 1 HTA20
- corr_mat <- cor(eset_HTA20, pheno$GA, method = "pearson")
- # filter genes based on correlation value
- ncor <- base::ncol(corr_mat)
- cmat <- base::col(corr_mat)
- ind <- base::order(-cmat, corr_mat, decreasing = TRUE) - (ncor*cmat-ncor)
- dim(ind) <- dim(corr_mat)
- base::colnames(ind) <- base::colnames(corr_mat)
- out <- base::cbind(ID=c(col(ind)), ID2=c(ind))
- base::as.data.frame(cbind(out, cor=corr_mat[out]))
- final_df <- base::as.data.frame(cbind(out, cor=corr_mat[out]))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement