R包——maftools可视化神器

参考:http://bioconductor.org/packages/release/bioc/vignettes/maftools/inst/doc/maftools.html


目录

 

介绍

准备

格式转换

 总体分析框架

maftools安装

正式处理

#读入annovar文件转换为maf——annovarToMaf

Description

Usage

Arguments

 #读入maf文件——read.maf

Description

Usage

Arguments

 绘制maf文件的摘要——plotmafSummary

Description

Usage

Arguments

 #绘制瀑布图——oncoplots

Description

Usage

Arguments

#绘制箱线图—— titv

Description

Usage

Arguments

#绘制棒棒图——lollipopPlot


介绍

With advances in Cancer Genomics, Mutation Annotation Format (MAF) is being widely accepted and used to store somatic variants detected. The Cancer Genome Atlas Project has sequenced over 30 different cancers with sample size of each cancer type being over 200. Resulting data consisting of somatic variants are stored in the form of Mutation Annotation Format. This package attempts to summarize, analyze, annotate and visualize MAF files in an efficient manner from either TCGA sources or any in-house studies as long as the data is in MAF format.

随着癌症基因组学的进步,突变注释格式(MAF)被广泛接受并用于存储检测到的体细胞变体。 癌症基因组图谱项目对30多种不同的癌症进行了测序,每种癌症类型的样本量超过200种。由体细胞变体组成的结果数据以MAF格式形式存储。 只要数据采用MAF格式,该软件包就会尝试从TCGA源或任何内部研究中有效地汇总,分析,注释和可视化MAF文件。


准备

使用前要先将文件转换为maf格式,对于VCF格式文件,可以使用vcf2maf进行格式转换

maf文件包含的内容:

  • Mandatory fields: Hugo_Symbol, Chromosome, Start_Position, End_Position, Reference_Allele, Tumor_Seq_Allele2, Variant_Classification, Variant_Type and Tumor_Sample_Barcode.

  • Recommended optional fields: non MAF specific fields containing VAF (Variant Allele Frequecy) and amino acid change information.

格式转换

#将突变结果进行注释,得到txt文件
for i in *.somatic.anno;do perl ~/software/Desktop/annovar/table_annovar.pl $sra_file /home/yang.zou/database/humandb_new/ -buildver hg19 -out variants --otherinfo -remove -protocol ensGene -operation g -nastring NA -outfile;done

#然后将所有.hg19_multianno.txt文件添加一列填入文件名前缀并将所有txt文件拼接成一个文件,提取出含有外显子的信息
for i in *.hg19_multianno.txt;do sed '1d' $i | sed "s/$/${i%%.*}/" >> all_annovar;done 
grep -P "\texonic\t" all_annovar > all_annovar2

#格式转换
perl to-maftools.pl all_annovar2         #将文件转换为maf格式 
#to-maftools.pl
use strict;
use warnings;

open (FA,"all_annovar2");
open (FB,">all_annovar3");

print FB "Chr\tStart\tEnd\tRef\tAlt\tFunc.ensGene\tGene.ensGene\tGeneDetail.ensGene\tExonicFunc.ensGene\tAAChange.ensGene\tTumor_Sample_Barcode\n";
while (<FA>){
        chomp;
        my @l=split /\t/,$_;
        print FB $l[0],"\t",$l[1],"\t",$l[2],"\t",$l[3],"\t",$l[4],"\t",$l[5],"\t",$l[6],"\t",$l[7],"\t",$l[8],"\t",$l[9],"\t",$l[10],"\n";
}

 总体分析框架


 

maftools安装

source("http://bioconductor.org/biocLite.R")
biocLite("maftools")

library(maftools)

注:安装过程特别麻烦,按了好几天,R版本要求3.3以上,也不要使用最新版本,可能有的包新版本还没同步。我使用的是:

version.string R version 3.4.1 (2017-06-30)

 

正式处理

#读入annovar文件转换为maf——annovarToMaf

#read maf
var.annovar.maf = annovarToMaf(annovar = "all_annovar3", Center = 'NA', refBuild = 'hg19', tsbCol = 'Tumor_Sample_Barcode', table = 'ensGene',sep = "\t")
write.table(x=var.annovar.maf,file="var_annovar_maf",quote= F,sep="\t",row.names=F)

annovarToMaf函数说明

Description

Converts variant annotations from Annovar into a basic MAF.将annovar格式转换为maf格式

Usage

annovarToMaf(annovar, Center = NULL, refBuild = "hg19", tsbCol = NULL,
  table = "refGene", basename = NULL, sep = "\t", MAFobj = FALSE,
  sampleAnno = NULL)
  • 7
    点赞
  • 27
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
数据可视化是数据科学领域中重要的一环,它通过图表、图形和其他可视化工具将数据呈现出来,以便能够更好地理解和分析数据。 首先,数据可视化可以帮助我们更好地理解数据。通过将数据可视化成图表或图像,我们可以直观地看到数据的分布、趋势和模式。这些可视化结果可以让我们更容易地发现数据中的有意义的信息,并且帮助我们深入理解数据所传达的含义。 其次,数据可视化还可以帮助我们发现数据中的异常值。通过对数据进行可视化,我们可以快速地发现与众不同的数据点或异常模式。这些异常值可能是我们的数据收集过程中的错误,或者是数据背后隐藏的重要信息。通过识别和处理这些异常值,我们可以提高数据质量和分析的准确性。 此外,数据可视化也有助于数据的传达和沟通。在现实世界中,不同背景的人对于数据的理解能力和统计分析的能力有所差异。数据可视化可以帮助我们以更直观的方式向其他人传达数据,使得他们更容易理解和接受数据的分析结果。通过合适的图表和图形,我们可以有效地解释数据背后的趋势和关系,并与其他人进行更有意义的讨论和决策。 综上所述,数据可视化在数据科学中起着重要的作用。它不仅帮助我们更好地理解和分析数据,发现异常值,还能够向他人有效传达和沟通数据。因此,在进行数据科学工作时,数据可视化是必不可少的一项技能和工具。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值