#!/usr/bin/perl use strict; use warnings; my ($outputDir,$tumor)=@ARGV; die "useage:perl $0 output_dir tumor" unless @ARGV==2; ##somatic snv my @somatic; open SOMATIC,"${outputDir}/mutation/${tumor}.snp.indel.Somatic.annoall.hg19_multianno_filtered.txt"; open SOUT,">${outputDir}/report/${tumor}.snp.indel.Somatic.annoall.hg19_multianno_filtered.txt"; my $head=; chomp $head; my @head=split("\t",$head); while(){ chomp; my @line=split("\t"); my($dp,$vd,$af,$vfr)=(split(":",$line[-2]))[2,4,5,-1]; $vfr=join(",",(split(",",$vfr))[-2,-1]); # $af=($af*100).'%'; push @somatic,join("\t", (@line[0..5,10],$af,$dp,$vd,$vfr,@line[102,6..101,103..107])); } if(@somatic){ print SOUT join("\t", (@head[0..5,10],"mutant_frequency","total_reads","mutant_reads","strand_bias",@head[102,6..101,103..107]))."\n"; print SOUT join("\n",@somatic); } ##germline snv my @germline; open GERMLINE,"${outputDir}/mutation/${tumor}.snp.indel.Germline.anno.hg19_multianno_filtered.txt"; open GOUT,">${outputDir}/report/${tumor}.snp.indel.Germline.anno.hg19_multianno_filtered.txt"; my $ghead=; chomp $ghead; my @ghead=split("\t",$ghead); while(){ chomp; my @line=split("\t"); my($dp,$vd,$af,$vfr)=(split(":",$line[-2]))[2,4,5,-1]; $vfr=join(",",(split(",",$vfr))[-2,-1]); # $af=($af*100).'%'; push @germline,join("\t", (@line[0..5,10],$af,$dp,$vd,$vfr,@line[102,6..101,103..106])); } if(@germline){ print GOUT join("\t", (@ghead[0..5,10],"mutant_frequency","total_reads","mutant_reads","strand_bias",@ghead[102,6..101,103..106]))."\n"; print GOUT join("\n",@germline); } ##hotspot snv my @hot; if(-s "${outputDir}/mutation/hotspot/${tumor}.hotspot.snp.indel.anno.hg19_multianno_filter.txt"){ open HOT,"${outputDir}/mutation/hotspot/${tumor}.hotspot.snp.indel.anno.hg19_multianno_filter.txt"; open HOUT,">${outputDir}/report/${tumor}.hotspot.snp.indel.filter.anno.hg19_multianno.txt"; my $hhead=; chomp $hhead; my @hhead=split("\t",$hhead); while(){ chomp; my @line=split("\t"); my($dp,$vd,$af,$vf,$vr)=(split(":",$line[-1]))[3,5,6,-2,-1]; my $vfr=join(",",($vf,$vr)); push @hot,join("\t", (@line[0..4,9],$af,$dp,$vd,$vfr,@line[5..8,10..22])); } if(@hot){ print HOUT join("\t", (@hhead[0..4,9],"mutant_frequency","total_reads","mutant_reads","strand_bias",@hhead[5..8,10..22]))."\n"; print HOUT join("\n",@hot); } }else{ system"touch ${outputDir}/report/${tumor}.hotspot.snp.indel.filter.anno.hg19_multianno.txt"; }