• 主页
  • 课程

    关于课程

    • 课程归档
    • 成为一名讲师
    • 讲师信息
    同等学历教学

    同等学历教学

    免费
    阅读更多
  • 特色
    • 展示
    • 关于我们
    • 问答
  • 事件
  • 个性化
  • 博客
  • 联系
  • 站点资源
    有任何问题吗?
    (00) 123 456 789
    weinfoadmin@weinformatics.cn
    注册登录
    恒诺新知
    • 主页
    • 课程

      关于课程

      • 课程归档
      • 成为一名讲师
      • 讲师信息
      同等学历教学

      同等学历教学

      免费
      阅读更多
    • 特色
      • 展示
      • 关于我们
      • 问答
    • 事件
    • 个性化
    • 博客
    • 联系
    • 站点资源

      未分类

      • 首页
      • 博客
      • 未分类
      • TCGAbiolinks-Case study n. 4: Elmer pipeline – KIRC

      TCGAbiolinks-Case study n. 4: Elmer pipeline – KIRC

      • 发布者 weinfoauthor
      • 分类 未分类
      • 日期 2020年1月10日
      • 评论 0评论

      开始接触TCGA数据,想学习如何下载、处理、分析这些数据。在目前的常用分析包中选中了R包TCGAbiolinks。 下面就记录过程,实际上本身TCGAbiolinks的官方教程就比较完整,我就按照官方教程学习如何处理然后整合weinfo提供的docker封装环境进行的分析。

      # 1
      library(TCGAbiolinks)
      library(SummarizedExperiment)
      library(ELMER)
      library(parallel)
      
      #-----------------------------------
      # STEP 1: Search, download, prepare |
      #-----------------------------------
      # 1.1 - DNA methylation
      # ----------------------------------
      query.met <- GDCquery(project = "TCGA-KIRC",
                            data.category = "DNA Methylation",
                            platform = "Illumina Human Methylation 450")
      GDCdownload(query.met)
      kirc.met <- GDCprepare(query = query.met,
                             save = TRUE,
                             save.filename = "kircDNAmet.rda",
                             summarizedExperiment = TRUE)
      
      # 2
      # Step 1.2 download expression data
      #-----------------------------------
      # 1.2 - RNA expression
      # ----------------------------------
      query.exp <- GDCquery(project = "TCGA-KIRC",
                            data.category = "Transcriptome Profiling",
                            data.type = "Gene Expression Quantification",
                            workflow.type = "HTSeq - FPKM-UQ")
      GDCdownload(query.exp)
      kirc.exp <- GDCprepare(query = query.exp,
                             save = TRUE,
                             save.filename = "kircExp.rda")
      kirc.exp <- kirc.exp
      
      # 3
      distal.probes <- get.feature.probe(genome = "hg38", met.platform = "450K")
      
      # 4
      library(MultiAssayExperiment)
      mae <- createMAE(exp = kirc.exp,
                       met = kirc.met,
                       save = TRUE,
                       linearize.exp = TRUE,
                       filter.probes = distal.probes,
                       save.filename = "mae_kirc.rda",
                       met.platform = "450K",
                       genome = "hg38",
                       TCGA = TRUE)
      # Remove FFPE samples
      mae <- mae[,!mae$is_ffpe]
      
      # 5
      group.col <- "definition"
      group1 <-  "Primary solid Tumor"
      group2 <- "Solid Tissue Normal"
      direction <- "hypo"
      dir.out <- file.path("kirc",direction)
      dir.create(dir.out, recursive = TRUE)
      #--------------------------------------
      # STEP 3: Analysis                     |
      #--------------------------------------
      # Step 3.1: Get diff methylated probes |
      #--------------------------------------
      sig.diff <- get.diff.meth(data = mae,
                                group.col = group.col,
                                group1 =  group1,
                                group2 = group2,
                                minSubgroupFrac = 0.2,
                                sig.dif = 0.3,
                                diff.dir = direction, # Search for hypomethylated probes in group 1
                                cores = 1,
                                dir.out = dir.out,
                                pvalue = 0.01)
      
      #-------------------------------------------------------------
      # Step 3.2: Identify significant probe-gene pairs            |
      #-------------------------------------------------------------
      # Collect nearby 20 genes for Sig.probes
      
      nearGenes <- GetNearGenes(data = mae,
                                probes = sig.diff$probe,
                                numFlankingGenes = 20)
      
      
      pair <- get.pair(data = mae,
                       group.col = group.col,
                       group1 =  group1,
                       group2 = group2,
                       nearGenes = nearGenes,
                       minSubgroupFrac = 0.4, # % of samples to use in to create groups U/M
                       permu.dir = file.path(dir.out,"permu"),
                       permu.size = 100, # Please set to 100000 to get significant results
                       raw.pvalue  = 0.05,
                       Pe = 0.01, # Please set to 0.001 to get significant results
                       filter.probes = TRUE, # See preAssociationProbeFiltering function
                       filter.percentage = 0.05,
                       filter.portion = 0.3,
                       dir.out = dir.out,
                       cores = 4,
                       label = direction)
      
      # Identify enriched motif for significantly hypomethylated probes which
      # have putative target genes.
      enriched.motif <- get.enriched.motif(data = mae,
                                           probes = pair$Probe,
                                           dir.out = dir.out,
                                           label = direction,
                                           min.incidence = 10,
                                           lower.OR = 1.1)
      TF <- get.TFs(data = mae,
                    group.col = group.col,
                    group1 =  group1,
                    group2 = group2,
                    minSubgroupFrac = 0.4,
                    enriched.motif = enriched.motif,
                    dir.out = dir.out,
                    cores = 4,
                    label = direction)
      
      # 6
      scatter.plot(data = mae,
                   byProbe = list(probe = sig.diff$probe[1], numFlankingGenes = 20),
                   category = "definition",
                   dir.out = "plots",
                   lm = TRUE, # Draw linear regression curve
                   save = TRUE)
      
      # 7
      scatter.plot(data = mae,
                   byTF = list(TF = c("RUNX1","RUNX2","RUNX3"),
                               probe = enriched.motif[[names(enriched.motif)[10]]]),
                   category = "definition",
                   dir.out = "plots",
                   save = TRUE,
                   lm_line = TRUE)
      
      # 8 以下过程并没有运行成功,报错: filename =  "heatmap.pdf")
      # Ordering groups
      # Error in hclust(., method = "average") : 
      #  must have n >= 2 objects to cluster
      heatmapPairs(data = mae,
                   group.col = "definition",
                   group1 = "Primary solid Tumor",
                   annotation.col = c("gender"),
                   group2 = "Solid Tissue Normal",
                   pairs = pair,
                   filename =  "heatmap.pdf")

      请关注“恒诺新知”微信公众号,感谢“R语言“,”数据那些事儿“,”老俊俊的生信笔记“,”冷🈚️思“,“珞珈R”,“生信星球”的支持!

      • 分享:
      weinfoauthor
      weinfoauthor

      1233

      上一篇文章

      TCGA-5.GDC数据整理-后续(含情感体验)
      2020年1月10日

      下一篇文章

      豆豆在UM的第一天
      2020年1月13日

      你可能也喜欢

      2-1675088548
      lncRNA和miRNA生信分析系列讲座免费视频课和课件资源包,干货满满
      30 1月, 2023
      9-1675131201
      如何快速批量修改 Git 提交记录中的用户信息
      26 1月, 2023
      8-1678501786
      肿瘤细胞通过改变CD8+ T细胞中的丙酮酸利用和琥珀酸信号来调控抗肿瘤免疫应答。
      7 12月, 2022

      留言 取消回复

      要发表评论,您必须先登录。

      搜索

      分类

      • R语言
      • TCGA数据挖掘
      • 单细胞RNA-seq测序
      • 在线会议直播预告与回放
      • 数据分析那些事儿分类
      • 未分类
      • 生信星球
      • 老俊俊的生信笔记

      投稿培训

      免费

      alphafold2培训

      免费

      群晖配置培训

      免费

      最新博文

      Nature | 单细胞技术揭示衰老细胞与肌肉再生
      301月2023
      lncRNA和miRNA生信分析系列讲座免费视频课和课件资源包,干货满满
      301月2023
      如何快速批量修改 Git 提交记录中的用户信息
      261月2023
      logo-eduma-the-best-lms-wordpress-theme

      (00) 123 456 789

      weinfoadmin@weinformatics.cn

      恒诺新知

      • 关于我们
      • 博客
      • 联系
      • 成为一名讲师

      链接

      • 课程
      • 事件
      • 展示
      • 问答

      支持

      • 文档
      • 论坛
      • 语言包
      • 发行状态

      推荐

      • iHub汉语代码托管
      • iLAB耗材管理
      • WooCommerce
      • 丁香园论坛

      weinformatics 即 恒诺新知。ICP备案号:粤ICP备19129767号

      • 关于我们
      • 博客
      • 联系
      • 成为一名讲师

      要成为一名讲师吗?

      加入数以千计的演讲者获得100%课时费!

      现在开始

      用你的站点账户登录

      忘记密码?

      还不是会员? 现在注册

      注册新帐户

      已经拥有注册账户? 现在登录

      close
      会员购买 你还没有登录,请先登录
      • ¥99 VIP-1个月
      • ¥199 VIP-半年
      • ¥299 VIP-1年
      在线支付 激活码

      立即支付
      支付宝
      微信支付
      请使用 支付宝 或 微信 扫码支付
      登录
      注册|忘记密码?