今天介紹個一款繪制基因棒棒圖的軟件于2020年2月發(fā)表在Bioinformatics雜志上,標題為:《G3viz: an R package to interactively visualize genetic mutation data using a lollipop-diagram》 ,。 G3viz是一個R軟件包 ,,可以直 觀且有效地可視化遺傳突變數(shù)據(jù)能夠幫助研究人員更好地理解基因組數(shù)據(jù)并驗證發(fā)現(xiàn),, 提供了一個易于使用的棒棒糖圖工具,。它使用戶能夠在RStudio或網(wǎng)頁瀏覽器中交互式地可視化遺傳突變的詳細翻譯效應,,而無需掌握任何HTML5/JavaScript技術,。
首先,,還是老習慣,推薦大家去學習官網(wǎng):https://g3viz./g3viz/ 。
前面已經(jīng)介紹了三個軟件:
G3viz 的功能特點包括: 交互式功能:包括縮放,、平移,、工具提示、刷選以及交互式圖例 個性化繪圖:擁有超過50種圖表選項以及35種以上的配色方案 內(nèi)置功能用于檢索蛋白質(zhì)結構域信息以及解析基因異構體 內(nèi)置功能可將遺傳突變類型(即變異分類)映射到突變類別 集成支持通過API從cBioPortal檢索癌癥突變數(shù)據(jù)并進行可視化 安裝一下 ## 使用西湖大學的 Bioconductor鏡像 options(BioC_mirror="https://mirrors./bioconductor" ) options("repos" =c(CRAN="https://mirrors./CRAN/" )) library(devtools)# install from github devtools::install_github("g3viz/g3viz" )
繪圖:小試牛刀 1,、從MAF
文件繪制基因突變棒棒圖 突變注釋格式(MAF)是一種常用的以制表符分隔的文本文件,,用于存儲匯總的突變信息。它可以通過像vcf2maf這樣的工具從VCF文件生成,。MAF文件中變異等位基因的翻譯效應通常在名為Variant_Classification或Mutation_Type的列中(例如,,F(xiàn)rame_Shift_Del,Splice_Site),。在本例中,,TCGA-BRCA研究的體細胞突變數(shù)據(jù)最初是從GDC數(shù)據(jù)門戶網(wǎng)站下載的。
rm(list=ls())# load g3viz package library(g3viz)# System file maf.file <- system.file("extdata" , "TCGA.BRCA.varscan.somatic.maf.gz" , package = "g3viz" ) maf.file# [1] "/usr/local/software/miniconda3/envs/R4.4/lib/R/library/g3viz/extdata/TCGA.BRCA.varscan.somatic.maf.gz" mutation.dat <- readMAF(maf.file) head(mutation.dat) colnames(mutation.dat) str(mutation.dat)
繪圖:
chart.options <- g3Lollipop.theme(theme.name = "default" , title.text = "PIK3CA gene (default theme)" ) g3Lollipop(mutation.dat, gene.symbol = "PIK3CA" , plot.options = chart.options, output.filename = "default_theme" )
2,、從CSV
or TSV
文件繪制基因突變棒棒圖 在這個例子中,,從CSV或TSV文件中讀取遺傳突變數(shù)據(jù),并使用一些可定制的圖表選項進行可視化,。請注意,,這相當于使用了暗色主題的圖表。
# load data mutation.csv <- system.file("extdata" , "ccle.csv" , package = "g3viz" ) mutation.csv# [1] "/usr/local/software/miniconda3/envs/R4.4/lib/R/library/g3viz/extdata/ccle.csv" mutation.dat <- readMAF(mutation.csv, gene.symbol.col = "Hugo_Symbol" , variant.class.col = "Variant_Classification" , protein.change.col = "amino_acid_change" , sep = "," ) # column-separator of csv file # set up chart options plot.options <- g3Lollipop.options( # Chart settings chart.width = 600, chart.type = "pie" , chart.margin = list(left = 30, right = 20, top = 20, bottom = 30), chart.background = "#d3d3d3" , transition.time = 300, # Lollipop track settings lollipop.track.height = 200, lollipop.track.background = "#d3d3d3" , lollipop.pop.min.size = 1, lollipop.pop.max.size = 8, lollipop.pop.info.limit = 5.5, lollipop.pop.info.dy = "0.24em" , lollipop.pop.info.color = "white" , lollipop.line.color = "#a9A9A9" , lollipop.line.width = 3, lollipop.circle.color = "#ffdead" , lollipop.circle.width = 0.4, lollipop.label.ratio = 2, lollipop.label.min.font.size = 12, lollipop.color.scheme = "dark2" , highlight.text.angle = 60, # Domain annotation track settings anno.height = 16, anno.margin = list(top = 0, bottom = 0), anno.background = "#d3d3d3" , anno.bar.fill = "#a9a9a9" , anno.bar.margin = list(top = 4, bottom = 4), domain.color.scheme = "pie5" , domain.margin = list(top = 2, bottom = 2), domain.text.color = "white" , domain.text.font = "italic 8px Serif" , # Y-axis label y.axis.label = "# of TP53 gene mutations" , axis.label.color = "#303030" , axis.label.alignment = "end" , axis.label.font = "italic 12px Serif" , axis.label.dy = "-1.5em" , y.axis.line.color = "#303030" , y.axis.line.width = 0.5, y.axis.line.style = "line" , y.max.range.ratio = 1.1, # Chart title settings title.color = "#303030" , title.text = "TP53 gene (customized chart options)" , title.font = "bold 12px monospace" , title.alignment = "start" , # Chart legend settings legend = TRUE, legend.margin = list(left=20, right = 0, top = 10, bottom = 5), legend.interactive = TRUE, legend.title = "Variant classification" , # Brush selection tool brush = TRUE, brush.selection.background = "#F8F8FF" , brush.selection.opacity = 0.3, brush.border.color = "#a9a9a9" , brush.border.width = 1, brush.handler.color = "#303030" , # tooltip and zoom tooltip = TRUE, zoom = TRUE ) g3Lollipop(mutation.dat, gene.symbol = "TP53" , protein.change.col = "amino_acid_change" , btn.style = "blue" , # blue-style chart download buttons plot.options = plot.options, output.filename = "customized_plot" )
上面這個設置也太多了,,應該都是默認參數(shù):
3,、從cBioPortal
讀取數(shù)據(jù)繪制基因突變棒棒圖 cBioPortal 提供了許多癌癥基因組數(shù)據(jù)集的下載。G3viz 有一種便捷的方式可以直接從該門戶網(wǎng)站檢索數(shù)據(jù),。
在這個例子中,,首先檢索 msk_impact_2017
研究中 TP53
基因的遺傳突變數(shù)據(jù),然后使用內(nèi)置的 cbioportal
主題對數(shù)據(jù)進行可視化,,以模擬cBioPortal
的mutation_mapper
功能,。
# Retrieve mutation data of "msk_impact_2017" from cBioPortal mutation.dat <- getMutationsFromCbioportal("msk_impact_2017" , "TP53" ) mutation.dat# "cbioportal" chart theme plot.options <- g3Lollipop.theme(theme.name = "cbioportal" , title.text = "TP53 gene (cbioportal theme)" , y.axis.label = "# of TP53 Mutations" ) g3Lollipop(mutation.dat, gene.symbol = "TP53" , btn.style = "gray" , # gray-style chart download buttons plot.options = plot.options, output.filename = "cbioportal_theme" )
今天這個軟件還不錯,快去試試看,!
友情宣傳: 生信入門&數(shù)據(jù)挖掘線上直播課2025年1月班
時隔5年,,我們的生信技能樹VIP學徒繼續(xù)招生啦
滿足你生信分析計算需求的低價解決方案