pipeline/script/hotspot.hvl.pl

41 lines
772 B
Perl
Raw Normal View History

2023-08-25 10:06:31 +08:00
#!/usr/bin/perl
#use strict;
#use warnings;
die "usage:perl $0 outputDir tumor" if @ARGV!=2;
my (${outputDir},${tumor})=@ARGV;
open L,"${outputDir}/mutation/hotspot/${tumor}.hotspot.L.snp.indel.vcf";
open H,"${outputDir}/mutation/hotspot/${tumor}.hotspot.H.snp.indel.vcf";
my %high;
my %low;
my @head;
while(<L>){
if(/^#/){
push @head,$_;
}else{
my @line=split;
$low{"$line[0]_$line[1]"}=$_;
}
}
while(<H>){
unless(/^#/){
my @line=split;
$high{"$line[0]_$line[1]"}=$_;
}
}
my @content;
foreach my $key(keys %low){
if(not exists $high{$key}){
push @content,$low{$key};
}
}
if (@content){
open OUT,">${outputDir}/mutation/hotspot/${tumor}.hotspot.snp.indel.vcf";
print OUT @head;
print OUT @content;
}