Mercurial > repos > plus91-technologies-pvt-ltd > softsearch
view 2.4/src/Extract_nSC.pl @ 16:8eb7d93f7e58 draft
Uploaded
author | plus91-technologies-pvt-ltd |
---|---|
date | Sat, 31 May 2014 11:23:36 -0400 |
parents | e3609c8714fb |
children |
line wrap: on
line source
#!/usr/bin/perl -w use Getopt::Long; #Initialize values my (@queries,@HEADER,$samples,@HEADER_OUT,$end,$samp); GetOptions ("query|q=s" => \$queries); if(!$queries){die "Usage: FORMAT_extract.pl <VCF> -query nSC \n\n";} open (VCF,"$ARGV[0]") or die "Usage: <VCF>"; while (<VCF>) { if($_=~/^##/){print;next} chomp; @line=split(/\t/,$_); if($line[0]=~/^#CH/){ print join ("\t",@line,$queries)."\n"; next} @FORMAT=split(/:/,$line[8]); @SAMPLE=split(/:/,$line[9]); for($i=0;$i<@FORMAT;$i++){ if($FORMAT[$i] =~/^$queries$/){print join ("\t",@line,$SAMPLE[$i])."\n";next} } } close VCF;