Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed error in RealignmentEngine due to inclusive vs exclusive ends #6404

Merged
merged 1 commit into from
Jan 21, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,11 @@ public static List<List<BwaMemAlignment>> findJointAlignments(List<List<BwaMemAl
return new ArrayList<>(commonAlignments);
}

// note the conversion from exclusive end (BWAMemAlignment) to inclusive end (SimpleInterval) (subtract 1 from the end)
// combined with the conversion from 0-based to 1-based contigs (add 1 to start and end)
// which has the net result of adding 1 to the start and leaving the end alone
private static SimpleInterval convertToInterval(final BwaMemAlignment alignment) {
return new SimpleInterval(Integer.toString(alignment.getRefId()), alignment.getRefStart(), alignment.getRefEnd());
return new SimpleInterval(Integer.toString(alignment.getRefId()), alignment.getRefStart() + 1, alignment.getRefEnd());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@davidbenjamin Are we sure that the contig is correct? I think alignment.getRefId() is likely to be 0 indexed, which means that you'll start with contig 0 when you want contig 1. And obviously it doesn't work for non-numbered contigs. I think what you need to be doing here is looking it up from bwaMemIndex.getReferenceContigNames().

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh. I see, it's using the same method to generate the overlap detectors, so that's ok.

}

private static Strand getStrand(final BwaMemAlignment alignment) {
Expand Down