From 7d7ff09f5427820cb71e60c839c42e2cb462c3f6 Mon Sep 17 00:00:00 2001 From: asivache Date: Thu, 15 Oct 2009 18:11:32 +0000 Subject: [PATCH] throw an exception if read has no associated read group git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@1855 348d0f76-0448-11de-a6fe-93d51630548a --- .../broadinstitute/sting/gatk/filters/PlatformUnitFilter.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/java/src/org/broadinstitute/sting/gatk/filters/PlatformUnitFilter.java b/java/src/org/broadinstitute/sting/gatk/filters/PlatformUnitFilter.java index 9acb1116c..c3f81aa22 100644 --- a/java/src/org/broadinstitute/sting/gatk/filters/PlatformUnitFilter.java +++ b/java/src/org/broadinstitute/sting/gatk/filters/PlatformUnitFilter.java @@ -7,6 +7,8 @@ import net.sf.samtools.SAMReadGroupRecord; import java.util.Set; import java.util.HashSet; +import org.broadinstitute.sting.utils.StingException; + /** * Created by IntelliJ IDEA. * User: asivache @@ -27,7 +29,7 @@ public class PlatformUnitFilter implements SamRecordFilter { if ( pu_attr == null ) { // no platform unit in the record, go get from read group SAMReadGroupRecord rgr = samRecord.getReadGroup(); - + if ( rgr == null ) throw new StingException("Read " + samRecord.getReadName() +" has NO associated read group record"); pu_attr = rgr.getAttribute("PU") ; } if ( pu_attr == null ) return false; // could not get PU, forget about the filtering...