乡下人产国偷v产偷v自拍,国产午夜片在线观看,婷婷成人亚洲综合国产麻豆,久久综合给合久久狠狠狠9

  • <output id="e9wm2"></output>
    <s id="e9wm2"><nobr id="e9wm2"><ins id="e9wm2"></ins></nobr></s>

    • 分享

      從基因名到GO注釋一步到位

       健明 2021-07-14
      大部分的生物學(xué)高通量數(shù)據(jù)處理后都是得到基因集,不管是上調(diào)下調(diào)表達基因集,還是共表達的模塊基因集,都是需要注釋到生物學(xué)功能數(shù)據(jù)庫來看基因集的意義,最常見的是GO/KEGG數(shù)據(jù)庫啦,還有很多其它在MsigDB的,比如reactome和biocarta數(shù)據(jù)庫等等。
      這樣分析起來就很麻煩,尤其是GO數(shù)據(jù)庫,還有 BP,CC,MF的區(qū)別,這個時候推薦使用Y叔的神器,使用
      library(ggplot2)
      library(stringr)
      library(clusterProfiler)
      # 我這里演示的是brown_down_gene,是WGCNA的一個模塊,基因集
      # 因為表達矩陣是symbol,所以需要轉(zhuǎn)為ENTREZID,才能走clusterProfiler的函數(shù)。
      gene.df <- bitr(brown_down_gene$symbol, fromType="SYMBOL",
                      toType="ENTREZID"
                      OrgDb = "org.Hs.eg.db")
      go <- enrichGO(gene = gene.df$ENTREZID, OrgDb = "org.Hs.eg.db", ont="all")
      barplot(go, split="ONTOLOGY")+ facet_grid(ONTOLOGY~., scale="free")
      會得到如下所示的圖,當然,理解起來需要耗費一點功夫,如果你是第一次看到的話!不僅僅是要理解GO數(shù)據(jù)庫,以及BP,MF,CC的分類系統(tǒng),超幾何分布檢驗,不同的閾值過濾,篩選指標等等。
       
      因為上面的代碼并沒有修改默認的統(tǒng)計學(xué)指標篩選參數(shù),如果你的基因確實沒有規(guī)則,有可能拿不到結(jié)果哦!這個時候可以設(shè)置:pvalueCutoff = 0.9, qvalueCutoff =0.9 甚至為1,來不做篩選。而且基因集的大小也是被限制了。

      如果你想分開計算上下調(diào)基因的GO數(shù)據(jù)庫注釋

      而且還想保留富集分析結(jié)果到csv文件,代碼如下:
      library(ggplot2)
      library(stringr)
      library(clusterProfiler)
      # 通過前面的差異分析,我們拿到了  gene_up 和 gene_down 這兩個基因集
      # 后面的分析,只需要  gene_up 和 gene_down  這兩個變量即可
      go_up <- enrichGO(gene_up, 
                          OrgDb = "org.Hs.eg.db"
                          ont="all",
                          pvalueCutoff = 0.9,
                          qvalueCutoff =0.9)
      go_up=DOSE::setReadable(go_up, OrgDb='org.Hs.eg.db',keyType='ENTREZID')
      write.csv(go_up@result,paste0(pro,'_go_down.up.csv'))
      barplot(go_up, split="ONTOLOGY",font.size =10)+ 
        facet_grid(ONTOLOGY~., scale="free") + 
        scale_x_discrete(labels=function(x) str_wrap(x, width=50))+
        ggsave(paste0(pro,'gene_up_GO_all_barplot.png')) 


      go_down <- enrichGO(gene_down, 
                          OrgDb = "org.Hs.eg.db"
                          ont="all",
                          pvalueCutoff = 0.9,
                          qvalueCutoff =0.9)
      go_down=DOSE::setReadable(go_down, OrgDb='org.Hs.eg.db',keyType='ENTREZID')
      write.csv(go_down@result,paste0(pro,'_go_down.up.csv'))
      barplot(go_down, split="ONTOLOGY",font.size =10)+ 
        facet_grid(ONTOLOGY~., scale="free") + 
        scale_x_discrete(labels=function(x) str_wrap(x, width=50))+
        ggsave(paste0(pro,'gene_down_GO_all_barplot.png')) 
      其實就是兩個獨立的基因集,獨立的走enrichGO流程啦!

      多組基因集的KEGG數(shù)據(jù)庫富集

      有趣的是,如果你是多組基因,不僅僅是上下調(diào),甚至可以走compareCluster流程,不過Y叔的這個函數(shù)總是喜歡在線獲取KEGG數(shù)據(jù)庫的最新信息,這一點對很多人來說,考驗網(wǎng)速:
      # 這里需要制作一個 DEG 的數(shù)據(jù)框,其中有兩列ENTREZID,是基因id,和new是分組信息
      xx.formula <- compareCluster(ENTREZID~new, data=DEG, fun='enrichKEGG')
      dotplot(xx.formula, x=~GeneRatio) + facet_grid(~new)

      如果是多組基因集走GO數(shù)據(jù)庫富集

      如下,構(gòu)建一個數(shù)據(jù)框,list_de_gene_clusters, 含有兩列信息:
      list_de_gene_clusters <- split(de_gene_clusters$ENTREZID, 
                                     de_gene_clusters$cluster)


      # Run full GO enrichment test
      formula_res <- compareCluster(
        ENTREZID~cluster, 
        data=de_gene_clusters, 
        fun="enrichGO"
        OrgDb="org.Mm.eg.db",
        ont           = "BP",
        pAdjustMethod = "BH",
        pvalueCutoff  = 0.01,
        qvalueCutoff  = 0.05
      )

      # Run GO enrichment test and merge terms 
      # that are close to each other to remove result redundancy
      lineage1_ego <- simplify(
        formula_res, 
        cutoff=0.5
        by="p.adjust"
        select_fun=min
      )

      感興趣的可以把這個結(jié)果跟3個出名的網(wǎng)頁工具進行比較

      • https://amp.pharm./Enrichr/
      • http://www./
      • https://biit.cs./gprofiler

      另外,強推Y叔clusterProfiler的一些可視化方法

      可視化方法函數(shù)列表:
      • barplot
      • cnetplot
      • dotplot
      • emapplot
      • gseaplot
      • goplot
      • upsetplot
      好幾個都是以前沒有介紹過的,有趣的是我準備瀏覽這些可視化函數(shù)的幫助文檔的時候,看到了這樣的話:
      重點來了,Y叔特意為其包寫了一本書來介紹其用法。Please go to https://yulab-smu./clusterProfiler-book/ for the full vignette.

        轉(zhuǎn)藏 分享 獻花(0

        0條評論

        發(fā)表

        請遵守用戶 評論公約

        類似文章 更多