* added some error checking for read groups

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@442 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
kcibul 2009-04-16 03:22:49 +00:00
parent 56f6847456
commit 7e05b43f40
1 changed files with 10 additions and 1 deletions

View File

@ -9,6 +9,8 @@ import org.broadinstitute.sting.gatk.walkers.LocusWalker;
import org.broadinstitute.sting.utils.Utils;
import org.broadinstitute.sting.utils.cmdLine.Argument;
import net.sf.samtools.SAMRecord;
import net.sf.samtools.SAMFileHeader;
import net.sf.samtools.SAMReadGroupRecord;
import java.util.List;
import java.util.Formatter;
@ -78,7 +80,14 @@ public class SomaticCoverageWalker extends LocusWalker<Integer, Integer> {
}
String rg = (String) read.getAttribute("RG");
String sample = read.getHeader().getReadGroup(rg).getSample();
SAMFileHeader header = read.getHeader();
SAMReadGroupRecord readGroup = header.getReadGroup(rg);
if (readGroup == null) {
err.println("WARNING: read " + read.getReadName() + " belongs to read group " + rg + " which isn't in the header!");
continue;
}
String sample = readGroup.getSample();