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

[ADAM-369] Improve debug output for indel realigner #369

Merged
merged 1 commit into from
Sep 16, 2014

Conversation

fnothaft
Copy link
Member

@fnothaft fnothaft commented Sep 8, 2014

Addresses bug reported on mailing list with output in this gist.

The indel realigner was trying to read the MD tag on a read that did not have an MD tag attached. To address this, I've:

  • Made the indel realigner check to see if MD tags are attached before trying to recreate the reference; if the MD tag is not attached to a read, we print a warning message to the log and don't use this read to try to recreate the reference
  • Added enhanced debugging to the reference recreation process; if the reference cannot be recreated because of a gap, we note that the user should check to ensure that MD tags are attached to a read.

(r.mdTag.get.getReference(r), r.getStart.toLong to r.getEnd)
val readRefs = reads.flatMap((r: RichAlignmentRecord) => {
if (r.mdTag.isDefined) {
Some((r.mdTag.get.getReference(r), r.getStart.toLong to r.getEnd))
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't this doing a get and then re-wrapping the tuple in an option? Maybe:

mdTag.map( tag => (tag, r.getStart.toLong to r.getEnd))

instead of the isDefined + get

Copy link
Member Author

Choose a reason for hiding this comment

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

I print a warning and log some data in the else clause. If I didn't have the else clause, I would agree. I think I could change this to a fold, but I'm not sure if that'd be much cleaner.

@fnothaft fnothaft force-pushed the realigner-md-tag-msg branch 2 times, most recently from 01294d7 to ee81694 Compare September 10, 2014 22:50
@fnothaft
Copy link
Member Author

This is rebased on master.

@fnothaft fnothaft added this to the 0.14.0 milestone Sep 13, 2014
@tdanford
Copy link
Contributor

Can you rebase again, @fnothaft ?

@fnothaft
Copy link
Member Author

Rebased.

@tdanford
Copy link
Contributor

LGTM, thanks @fnothaft!

tdanford added a commit that referenced this pull request Sep 16, 2014
[ADAM-369] Improve debug output for indel realigner
@tdanford tdanford merged commit cb7eadc into bigdatagenomics:master Sep 16, 2014
@fnothaft fnothaft deleted the realigner-md-tag-msg branch September 16, 2014 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants