Mercurial > repos > plus91-technologies-pvt-ltd > softsearch
view 2.4/script/Merge_Soft.pl @ 13:e3609c8714fb draft
Uploaded
author | plus91-technologies-pvt-ltd |
---|---|
date | Fri, 30 May 2014 03:37:55 -0400 |
parents | |
children |
line wrap: on
line source
#!/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;