Mercurial > repos > plus91-technologies-pvt-ltd > ss_test_tool
diff 2.4/src/Merge_Soft.pl @ 2:ceb6adffc4e2 draft
Uploaded
| author | plus91-technologies-pvt-ltd |
|---|---|
| date | Wed, 04 Jun 2014 08:00:42 -0400 |
| parents | 00b9898b8510 |
| children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/2.4/src/Merge_Soft.pl Wed Jun 04 08:00:42 2014 -0400 @@ -0,0 +1,39 @@ +#!/usr/bin/perl -s +#Merge Softsearch results by chrom +if(!$ARGV[0]){die "Usage: <Sample.1.vcf>\n";} +my ($sample,$cmd); + +#Get basename +$sample="$ARGV[0]"; +$sample=~s/.[0-9(+)].out.vcf//; +$sample=~s/.[0-9(+)].pe.vcf//; + +my $outfile=$sample; +$outfile.="out.vcf"; +if( -e $outfile ){unlink($outfile)} +$cmd="ls $sample\*vcf"; +my @samples=`$cmd`; +print "there are " .scalar(@samples)." samples\n"; + +open (OUT,">$outfile"); +my $i=1; +my $tmp=@samples[$i]; +open(TMP,"$tmp"); +while (<TMP>){ + print OUT if ($_=~/^#/); +} + +open (OUT,">>$outfile"); +my $chr; +for (my $i=0;$i<@samples;$i++){ + my $tmp=@samples[$i]; + open(TMP,"$tmp"); + while (<TMP>){ + unless (($_=~/^chrGL/)||($_=~/^#/)){print OUT $_;} + } + print "Done with $tmp"; + unlink($tmp); + system("rm $tmp"); + close TMP; +} +close OUT;
