]> git.donarmstrong.com Git - samtools.git/commitdiff
Print an error for pileups in simple format
authorPetr Danecek <pd3@sanger.ac.uk>
Fri, 12 Feb 2010 09:52:37 +0000 (09:52 +0000)
committerPetr Danecek <pd3@sanger.ac.uk>
Fri, 12 Feb 2010 09:52:37 +0000 (09:52 +0000)
misc/sam2vcf.pl

index c2644f53d1210669c04bbbdb02559b0b966259cc..e722e74e46ecdd91148cbadb5cae9e510c77949c 100755 (executable)
@@ -117,7 +117,12 @@ sub do_pileup_to_vcf
     while (my $line=<$fh_in>)
     {
         chomp($line);
-        my ($chr,$pos,$ref,$cons,$cons_qual,$snp_qual,$rms_qual,$depth,@items) = split(/\t/,$line);
+        my (@items) = split(/\t/,$line);
+        if ( scalar @items<8 ) 
+        { 
+            error("\nToo few columns, does not look like output of 'samtools pileup -c': $line\n"); 
+        }
+        my ($chr,$pos,$ref,$cons,$cons_qual,$snp_qual,$rms_qual,$depth) = @items;
 
         my ($alt,$gt);
         if ( $ref eq '*' )