Another check to deal with bad reads (BWA output throws bad exceptions)

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@298 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
ebanks 2009-04-06 04:58:22 +00:00
parent 3f75fc4e83
commit d1c5e986d5
1 changed files with 4 additions and 1 deletions

View File

@ -130,7 +130,10 @@ public class GenomeLoc implements Comparable<GenomeLoc> {
}
public static GenomeLoc genomicLocationOf(final SAMRecord read) {
return new GenomeLoc(read.getReferenceName(), read.getAlignmentStart(), read.getAlignmentEnd());
String contig = read.getReferenceName();
if (read.getReadUnmappedFlag())
contig = null;
return new GenomeLoc(contig, read.getAlignmentStart(), read.getAlignmentEnd());
}
// --------------------------------------------------------------------------------------------------------------