Mercurial > repos > miller-lab > snp_analysis_conversion
comparison vcf2pgSnp.pl @ 3:edf12470a1a6 default tip
Bugfix from Belinda, in vcf2pgSnp.pl
author | Cathy Riemer <cathy+hg@bx.psu.edu> |
---|---|
date | Thu, 19 Mar 2015 12:06:34 -0400 |
parents | 35c20b109be5 |
children |
comparison
equal
deleted
inserted
replaced
2:35c20b109be5 | 3:edf12470a1a6 |
---|---|
11 my $endCol; | 11 my $endCol; |
12 if (@ARGV && scalar @ARGV == 2) { | 12 if (@ARGV && scalar @ARGV == 2) { |
13 $stCol = shift @ARGV; | 13 $stCol = shift @ARGV; |
14 $in = shift @ARGV; | 14 $in = shift @ARGV; |
15 if ($stCol eq 'all') { $stCol = 10; } | 15 if ($stCol eq 'all') { $stCol = 10; } |
16 else { $endCol = $stCol; } | 16 else { $endCol = $stCol - 1; } #want 0 based column number |
17 $stCol--; #go from 1 based to zero based column number | 17 $stCol--; #go from 1 based to zero based column number |
18 if ($stCol < 9) { | 18 if ($stCol < 9) { |
19 print "ERROR genotype fields don't start until column 10\n"; | 19 print "ERROR genotype fields don't start until column 10\n"; |
20 exit; | 20 exit; |
21 } | 21 } |
22 }elsif (@ARGV && scalar @ARGV == 1) { | 22 }elsif (@ARGV && scalar @ARGV == 1) { |
23 $in = shift @ARGV; | 23 $in = shift @ARGV; |
24 }elsif (@ARGV) { | 24 }else { |
25 print "usage: vcf2pgSnp.pl [indColNum default=all] file.vcf > file.pgSnp\n"; | 25 print "usage: vcf2pgSnp.pl [indColNum default=all] file.vcf > file.pgSnp\n"; |
26 exit; | 26 exit; |
27 } | 27 } |
28 | 28 |
29 open(FH, $in) or die "Couldn't open $in, $!\n"; | 29 open(FH, $in) or die "Couldn't open $in, $!\n"; |