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
This commit is contained in:
asivache 2009-10-15 18:11:32 +00:00
parent b9544d3f89
commit 7d7ff09f54
1 changed files with 3 additions and 1 deletions

View File

@ -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...