an attempt to bail out when unmapped reads are reached at the end of the file(s). still testing...
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@973 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
030efc468f
commit
39dcd4f11f
|
|
@ -77,6 +77,12 @@ public class IndelGenotyperWalker extends ReadWalker<Integer,Integer> {
|
|||
@Override
|
||||
public Integer map(char[] ref, SAMRecord read) {
|
||||
|
||||
if ( read.getReadUnmappedFlag() && read.getReferenceIndex() == SAMRecord.NO_ALIGNMENT_REFERENCE_INDEX &&
|
||||
read.getAlignmentStart() == SAMRecord.NO_ALIGNMENT_START ) {
|
||||
System.out.println("I think I reached unmapped reads at the end of the file(s) and I am done...");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ( read.getReadUnmappedFlag() ||
|
||||
read.getDuplicateReadFlag() ||
|
||||
read.getNotPrimaryAlignmentFlag() ||
|
||||
|
|
@ -264,6 +270,10 @@ public class IndelGenotyperWalker extends ReadWalker<Integer,Integer> {
|
|||
|
||||
@Override
|
||||
public Integer reduce(Integer value, Integer sum) {
|
||||
if ( value == -1 ) {
|
||||
onTraversalDone(sum);
|
||||
System.exit(1);
|
||||
}
|
||||
sum += value;
|
||||
return sum;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue