Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. > head(expr_mat)
  2.  
  3. Tarca_025_P1C01 Tarca_027_P1C03 Tarca_028_P1C04 Tarca_029_P1C05
  4. 100033426_at 7.969054 5.717904 5.533932 9.563440
  5. 100033427_at 10.798265 8.210226 8.346338 11.853010
  6. 100033428_at 2.107169 2.159903 2.183112 2.356944
  7. 100033430_at 2.465297 1.996229 2.188106 2.126542
  8. 100033431_at 5.629301 4.196539 4.016405 7.648581
  9. 100033432_at 3.245348 2.628399 2.272071 4.652379
  10. 100033433_at 2.338819 2.025551 2.253913 3.830992
  11.  
  12. > head(pheno)
  13. SampleID GA Batch Set Train Platform
  14. Tarca_001_P1A01 Tarca_001_P1A01 11.0 1 PRB_HTA 1 HTA20
  15. Tarca_013_P1B01 Tarca_013_P1B01 15.3 1 PRB_HTA 1 HTA20
  16. Tarca_025_P1C01 Tarca_025_P1C01 21.7 1 PRB_HTA 1 HTA20
  17. Tarca_037_P1D01 Tarca_037_P1D01 26.7 1 PRB_HTA 1 HTA20
  18. Tarca_049_P1E01 Tarca_049_P1E01 31.3 1 PRB_HTA 1 HTA20
  19. Tarca_061_P1F01 Tarca_061_P1F01 32.1 1 PRB_HTA 1 HTA20
  20.  
  21.  
  22.  
  23. corr_mat <- cor(eset_HTA20, pheno$GA, method = "pearson")
  24.  
  25. # filter genes based on correlation value
  26. ncor <- base::ncol(corr_mat)
  27. cmat <- base::col(corr_mat)
  28. ind <- base::order(-cmat, corr_mat, decreasing = TRUE) - (ncor*cmat-ncor)
  29. dim(ind) <- dim(corr_mat)
  30. base::colnames(ind) <- base::colnames(corr_mat)
  31. out <- base::cbind(ID=c(col(ind)), ID2=c(ind))
  32. base::as.data.frame(cbind(out, cor=corr_mat[out]))
  33. final_df <- base::as.data.frame(cbind(out, cor=corr_mat[out]))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement