From dfa2efbcf593845e2bd3fe1066e12c90c59f1d6c Mon Sep 17 00:00:00 2001 From: asivache Date: Tue, 23 Jun 2009 22:52:40 +0000 Subject: [PATCH] not crashing when refseq annotation track is not requested is a nice added feature git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@1079 348d0f76-0448-11de-a6fe-93d51630548a --- .../gatk/walkers/indels/IndelGenotyperWalker.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/java/src/org/broadinstitute/sting/playground/gatk/walkers/indels/IndelGenotyperWalker.java b/java/src/org/broadinstitute/sting/playground/gatk/walkers/indels/IndelGenotyperWalker.java index ff40a6c50..819fcd670 100644 --- a/java/src/org/broadinstitute/sting/playground/gatk/walkers/indels/IndelGenotyperWalker.java +++ b/java/src/org/broadinstitute/sting/playground/gatk/walkers/indels/IndelGenotyperWalker.java @@ -316,7 +316,7 @@ public class IndelGenotyperWalker extends ReadWalker { } location.setStart(pos); location.setStop(pos); // retrieve annotation data - rodRefSeq annotation = refseqIterator.seekForward(location); + rodRefSeq annotation = (refseqIterator == null ? null : refseqIterator.seekForward(location)); int total_variant_count = 0; int max_variant_count = 0; @@ -334,7 +334,7 @@ public class IndelGenotyperWalker extends ReadWalker { } if ( (double)total_variant_count > minFraction * cov && (double) max_variant_count > minConsensusFraction*total_variant_count ) { - String annotationString = getAnnotationString(annotation); + String annotationString = (refseqIterator == null ? "" : getAnnotationString(annotation)); String message = refName+"\t"+(pos-1)+"\t"+(event_length > 0 ? pos-1+event_length : pos-1)+ "\t"+(event_length>0? "-":"+")+indelString +":"+total_variant_count+"/"+cov; @@ -413,7 +413,7 @@ public class IndelGenotyperWalker extends ReadWalker { continue; // too dirty } location.setStart(pos); location.setStop(pos); // retrieve annotation data - rodRefSeq annotation = refseqIterator.seekForward(location); + rodRefSeq annotation = (refseqIterator == null ? null : refseqIterator.seekForward(location)); int total_variant_count_tumor = 0; @@ -433,7 +433,7 @@ public class IndelGenotyperWalker extends ReadWalker { if ( (double)total_variant_count_tumor > minFraction * tumor_cov && (double) max_variant_count_tumor > minConsensusFraction*total_variant_count_tumor ) { - String annotationString = getAnnotationString(annotation); + String annotationString = ( refseqIterator == null ? "": getAnnotationString(annotation)); long leftpos = pos; long rightpos = pos+event_length_tumor-1;