47 lines
1.7 KiB
Perl
Executable File
47 lines
1.7 KiB
Perl
Executable File
#!/usr/bin/perl
|
|
use strict;
|
|
use warnings;
|
|
|
|
my ($codes_dir,$name,$output_dir,$project)=@ARGV;
|
|
die "useage:perl $0 codes_dir name output_dir project" unless @ARGV==4;
|
|
my $snp="$output_dir/mutation/${name}.snp.Somatic.vcf.hg19_multianno.txt";
|
|
my $indel="$output_dir/mutation/${name}.indel.Somatic.vcf.hg19_multianno.txt";
|
|
|
|
open DRUG,"$codes_dir/info.txt";
|
|
<DRUG>;
|
|
my @genes;
|
|
while (<DRUG>){
|
|
chomp;
|
|
my @line=split(/\t/,$_);
|
|
if ($line[0] eq $project){
|
|
@genes=split(/\//,$line[2]);
|
|
}
|
|
}
|
|
|
|
&pick_somatic($snp,"$output_dir/report/${name}.snp.Somatic.txt");
|
|
&pick_somatic($indel,"$output_dir/report/${name}.indel.Somatic.txt");
|
|
|
|
sub pick_somatic{
|
|
my ($in,$out)=@_;
|
|
open IN,"$in";
|
|
open OUT,">$out";
|
|
my $head=<IN>;
|
|
chomp $head;
|
|
print OUT join("\t",(split(/\t/,$head))[0..9]),"\tFreq","\tDP4","\tpredict_benign(MutationTaster/FATHMM/MetaSVM)\t",join("\t",(split(/\t/,$head))[10,11,16..20,23,28,32]),"\tSTR","\n";
|
|
while (<IN>){
|
|
chomp;
|
|
my @line=split(/\t/,$_);
|
|
next unless(grep{$line[6] eq $_}@genes);
|
|
next if ($line[11] !~/COS/ or $line[5]!~/exonic|splicing/ or $line[5]=~/ncRNA/ or $line[8] eq "synonymous SNV" or $line[17]>=0.01 or $line[18]>=0.01 or $line[19]>=0.01 or $line[20]>=0.01 or $line[23]>=0.01 or $line[28]>=0.01 or $line[32]>=0.01);
|
|
my @var=split(/;/,$line[9]);
|
|
my ($freq,$dp4)=(split(/:/,$line[-2]))[-2,-1];
|
|
my $predict_benign=0;
|
|
$predict_benign++ if ($line[50] eq "N" or $line[50] eq "P");
|
|
$predict_benign++ if $line[56] eq "T";
|
|
$predict_benign++ if $line[64] eq "T";
|
|
next if $predict_benign==3;
|
|
print OUT join("\t",@line[0..9],$freq,$dp4,$predict_benign,@line[10,11,16..20,23,28,32,$#line]),"\n";
|
|
}
|
|
}
|
|
|