From: Petr Danecek Date: Wed, 14 Apr 2010 15:44:50 +0000 (+0000) Subject: Speedup with -i, no need to query the reference all the time X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=316dda05588353f7640d0713e470f703d7daf338;p=samtools.git Speedup with -i, no need to query the reference all the time --- diff --git a/misc/sam2vcf.pl b/misc/sam2vcf.pl index 38ab64d..874ad5c 100755 --- a/misc/sam2vcf.pl +++ b/misc/sam2vcf.pl @@ -131,7 +131,13 @@ sub do_pileup_to_vcf if ( $ref eq '*' ) { # An indel is involved. - if ( $ignore_indels ) { next; } + if ( $ignore_indels ) + { + $prev_ref = $ref; + $prev_pos = $pos; + $prev_chr = $chr; + next; + } if (!defined $prev_chr || $chr ne $prev_chr || $pos ne $prev_pos) { @@ -171,7 +177,13 @@ sub do_pileup_to_vcf } else { - if ( $ignore_snps ) { next; } + if ( $ignore_snps ) + { + $prev_ref = $ref; + $prev_pos = $pos; + $prev_chr = $chr; + next; + } # SNP ($alt,$gt) = iupac_to_gtype($ref,$cons);