当前位置:   article > 正文

批量生存分析 提取生存正相关基因 生存负相关基因 survival_genes_split 生存分析得到的显著性基因 高低表达与生存期的关系 0=高表达生存预期差;1=高表达生存预期好s_正相关和负相关 wgcna 0和1

正相关和负相关 wgcna 0和1
  1. TCGA学习笔记13-对所有差异表达基因进行生存分析
  2. https://uteric.github.io/TCGA/TCGA13Survival/
  3. load("G:/r/duqiang_IPF/surval_analysis_3_independent_dataset_IPF_pval_filtered/surval_genes_filtered_log_rank_p.RData")
  4. getwd()
  5. dir.create("G:/r/duqiang_IPF/survival_genes_high_low_association")
  6. setwd("G:/r/duqiang_IPF/survival_genes_high_low_association")
  7. load("G:/r/duqiang_IPF/surval_analysis_3_independent_dataset_IPF/combined_data_for_surval.RDdata")
  8. table(complete.cases(rownames(expr.freibrug.IPF)))
  9. ## 批量生存分析 使用 logrank test 方法 批量生存分析 并获得正负相关基因 高低表达情况
  10. getwd()
  11. ## 批量生存分析 使用 logrank test 方法
  12. phe=phe_final_3
  13. head(phe)[1:3,1:19]
  14. mySurv=with(phe,Surv(time, event))
  15. head(mySurv)
  16. log_rank_p=list()
  17. s <- vector() # 定义变量s,放surv,即生存预期
  18. s
  19. for (eachgene in colnames(phe)[5:ncol(phe)] ) {
  20. data.survdiff=survdiff(mySurv~phe[,eachgene],data=phe)
  21. p.val = 1 - pchisq(data.survdiff$chisq, length(data.survdiff$n) - 1)
  22. log_rank_p[[eachgene]]=p.val
  23. s[eachgene]<-ifelse(data.survdiff$obs[1]/data.survdiff$n[[1]] >
  24. data.survdiff$obs[2]/data.survdiff$n[[2]],
  25. 0,1) # 0=高表达生存预期差;1=高表达生存预期好,;
  26. }
  27. 1 >
  28. 3
  29. head(s)
  30. table(s)
  31. head(s[s==0])
  32. str(s)
  33. #table(names(s))
  34. head(names(s))
  35. names(s)
  36. length(log_rank_p)
  37. head(names(log_rank_p))
  38. table(log_rank_p<0.01)
  39. head(log_rank_p)
  40. log_rank_p=unlist(log_rank_p)
  41. log_rank_p=sort(log_rank_p)
  42. head(log_rank_p)
  43. log_rank_p[1000]
  44. table(log_rank_p<0.005)
  45. boxplot(log_rank_p)
  46. phe$H6PD=ifelse(exprSet['H6PD',]>median(exprSet['H6PD',]),'high','low')
  47. table(phe$H6PD)
  48. ggsurvplot(survfit(Surv(time, event)~MRVI1, data=phe), conf.int=F, pval=TRUE)
  49. ggsurvplot(survfit(Surv(time, event)~ACER3, data=phe), conf.int=F, pval=TRUE)
  50. ggsurvplot(survfit(Surv(time, event)~MMP12, data=phe), conf.int=F, pval=TRUE)
  51. ggsurvplot(survfit(Surv(time, event)~SPP1, data=phe), conf.int=F, pval=TRUE)
  52. ggsurvplot(survfit(Surv(time, event)~GPNMB, data=phe), conf.int=F, pval=TRUE)
  53. ggsurvplot(survfit(Surv(time, event)~CSF1, data=phe), conf.int=F, pval=TRUE)
  54. ggsurvplot(survfit(Surv(time, event)~PDGFRA, data=phe), conf.int=F, pval=TRUE)
  55. ggsurvplot(survfit(Surv(time, event)~BMP6, data=phe), conf.int=F, pval=TRUE)
  56. ggsurvplot(survfit(Surv(time, event)~IBSP, data=phe), conf.int=F, pval=TRUE)
  57. ggsurvplot(survfit(Surv(time, event)~S100A14, data=phe), conf.int=F, pval=TRUE)
  58. ggsurvplot(survfit(Surv(time, event)~STAB1, data=phe), conf.int=F, pval=TRUE)
  59. ggsurvplot(survfit(Surv(time, event)~LOC284751, data=phe), conf.int=F, pval=TRUE)
  60. ggsurvplot(survfit(Surv(time, event)~ANKRD22, data=phe), conf.int=F, pval=TRUE)
  61. ggsurvplot(survfit(Surv(time, event)~AMICA1, data=phe), conf.int=F, pval=TRUE)
  62. ggsurvplot(survfit(Surv(time, event)~FLJ43903, data=phe), conf.int=F, pval=TRUE)
  63. ggsurvplot(survfit(Surv(time, event)~RANBP3L, data=phe), conf.int=F, pval=TRUE)
  64. intersect(names( s[s==1] ),
  65. names( log_rank_p[log_rank_p<0.01] ))
  66. getwd()
  67. #save(s,log_rank_p,file ="G:/r/duqiang_IPF/survival_genes_high_low_association/survival_genes_split.RData" )
  68. load("G:/r/duqiang_IPF/survival_genes_high_low_association/survival_genes_split.RData")

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/凡人多烦事01/article/detail/132199
推荐阅读
相关标签
  

闽ICP备14008679号