Don't try to left align indels in unmapped reads (which for some reason can still have CIGARs) because the ref context is null.

This commit is contained in:
Eric Banks 2012-08-29 15:01:11 -04:00
parent 4ea38bbfe8
commit ce55ba98f4
2 changed files with 2 additions and 2 deletions

View File

@ -177,7 +177,7 @@ public class ReferenceContext {
* @return The base at the given locus from the reference.
*/
public byte getBase() {
return getBases()[(int)(locus.getStart() - window.getStart())];
return getBases()[(locus.getStart() - window.getStart())];
}
/**

View File

@ -82,7 +82,7 @@ public class LeftAlignIndels extends ReadWalker<Integer, Integer> {
public Integer map(ReferenceContext ref, GATKSAMRecord read, ReadMetaDataTracker metaDataTracker) {
// we can not deal with screwy records
if ( read.getCigar().numCigarElements() == 0 ) {
if ( read.getReadUnmappedFlag() || read.getCigar().numCigarElements() == 0 ) {
emit(read);
return 0;
}