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:
parent
4ea38bbfe8
commit
ce55ba98f4
|
|
@ -177,7 +177,7 @@ public class ReferenceContext {
|
||||||
* @return The base at the given locus from the reference.
|
* @return The base at the given locus from the reference.
|
||||||
*/
|
*/
|
||||||
public byte getBase() {
|
public byte getBase() {
|
||||||
return getBases()[(int)(locus.getStart() - window.getStart())];
|
return getBases()[(locus.getStart() - window.getStart())];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ public class LeftAlignIndels extends ReadWalker<Integer, Integer> {
|
||||||
|
|
||||||
public Integer map(ReferenceContext ref, GATKSAMRecord read, ReadMetaDataTracker metaDataTracker) {
|
public Integer map(ReferenceContext ref, GATKSAMRecord read, ReadMetaDataTracker metaDataTracker) {
|
||||||
// we can not deal with screwy records
|
// we can not deal with screwy records
|
||||||
if ( read.getCigar().numCigarElements() == 0 ) {
|
if ( read.getReadUnmappedFlag() || read.getCigar().numCigarElements() == 0 ) {
|
||||||
emit(read);
|
emit(read);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue