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

Added AdamContext.referenceLengthFromCigar #263

Merged
merged 1 commit into from Jun 9, 2014

Conversation

Projects
None yet
3 participants
@tdanford
Contributor

tdanford commented Jun 8, 2014

Adds a new method which has some utility (for some of our code):

ADAMContext.referenceLengthFromCigar, which calculates the 'length along the reference sequence' of an alignment record from its Cigar string. This is useful because the 'rec.start + referenceLengthFromCigar(rec.cigar)' is a natural 'end' value which can be used to calculate whether an ADAMRecord overlaps a given region along the reference.

From this, we can calculate overlap queries on ADAMRecords without having to go through the (somewhat cumbersome) ReferenceMapping framework.

Thoughts? Does this duplicate code that's already somewhere else in ADAM? Also, I'm not parsing the Cigar strings using Picard but rather defining my own quick-and-dirty regex for them, I don't know how people feel about that.

@AmplabJenkins

This comment has been minimized.

Show comment
Hide comment
@AmplabJenkins

AmplabJenkins Jun 8, 2014

All automated tests passed.
Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/ADAM-prb/358/

AmplabJenkins commented Jun 8, 2014

All automated tests passed.
Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/ADAM-prb/358/

@fnothaft

This comment has been minimized.

Show comment
Hide comment
@fnothaft

fnothaft Jun 8, 2014

Member

Looks good, but I think this'd be a better fit in RichADAMRecord, or in a Util class.

Member

fnothaft commented Jun 8, 2014

Looks good, but I think this'd be a better fit in RichADAMRecord, or in a Util class.

@tdanford

This comment has been minimized.

Show comment
Hide comment
@tdanford

tdanford Jun 8, 2014

Contributor

Good call, I'll move it.

Contributor

tdanford commented Jun 8, 2014

Good call, I'll move it.

@tdanford

This comment has been minimized.

Show comment
Hide comment
@tdanford

tdanford Jun 9, 2014

Contributor

I fixed those two issues, Frank -- moved it to RichADAMRecord, and fixed the spelling mistake :-)

Contributor

tdanford commented Jun 9, 2014

I fixed those two issues, Frank -- moved it to RichADAMRecord, and fixed the spelling mistake :-)

@fnothaft

This comment has been minimized.

Show comment
Hide comment
@fnothaft

fnothaft Jun 9, 2014

Member

Can you rebase this? Also, do you still want to change the imports in ADAMContext?

Member

fnothaft commented Jun 9, 2014

Can you rebase this? Also, do you still want to change the imports in ADAMContext?

@AmplabJenkins

This comment has been minimized.

Show comment
Hide comment
@AmplabJenkins

AmplabJenkins Jun 9, 2014

All automated tests passed.
Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/ADAM-prb/360/

AmplabJenkins commented Jun 9, 2014

All automated tests passed.
Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/ADAM-prb/360/

@AmplabJenkins

This comment has been minimized.

Show comment
Hide comment
@AmplabJenkins

AmplabJenkins Jun 9, 2014

All automated tests passed.
Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/ADAM-prb/361/

AmplabJenkins commented Jun 9, 2014

All automated tests passed.
Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/ADAM-prb/361/

@fnothaft

This comment has been minimized.

Show comment
Hide comment
@fnothaft

fnothaft Jun 9, 2014

Member

@tdanford can you remove the changes to ADAMContext? Then, I'll merge.

Member

fnothaft commented Jun 9, 2014

@tdanford can you remove the changes to ADAMContext? Then, I'll merge.

Adding RichADAMRecord.referenceLengthFromCigar
The new referenceLengthFromCigar method (and its associated ADAMRecord method, 'referenceLength')
is an implementation of a method which counts the length of an aligned read against the reference
sequence. This is useful because rec.start + rec.referenceLength is a logical "end" coordinate
to be used for testing overlap of an ADAMRecord against a reference range.
@tdanford

This comment has been minimized.

Show comment
Hide comment
@tdanford

tdanford Jun 9, 2014

Contributor

@fnothaft Done. I don't think the Jenkins build has kicked off yet though...

Contributor

tdanford commented Jun 9, 2014

@fnothaft Done. I don't think the Jenkins build has kicked off yet though...

@fnothaft

This comment has been minimized.

Show comment
Hide comment
@fnothaft

fnothaft Jun 9, 2014

Member

Thanks @tdanford! I will wait for the build and merge if it is clean.

Member

fnothaft commented Jun 9, 2014

Thanks @tdanford! I will wait for the build and merge if it is clean.

@AmplabJenkins

This comment has been minimized.

Show comment
Hide comment
@AmplabJenkins

AmplabJenkins Jun 9, 2014

All automated tests passed.
Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/ADAM-prb/363/

AmplabJenkins commented Jun 9, 2014

All automated tests passed.
Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/ADAM-prb/363/

fnothaft added a commit that referenced this pull request Jun 9, 2014

Merge pull request #263 from genomebridge/tdanford/referenceLengthFro…
…mCigar

Added AdamContext.referenceLengthFromCigar

@fnothaft fnothaft merged commit 12ab6fc into bigdatagenomics:master Jun 9, 2014

1 check passed

default Merged build finished.
Details
@fnothaft

This comment has been minimized.

Show comment
Hide comment
@fnothaft

fnothaft Jun 9, 2014

Member

Merged! Thanks @tdanford!

Member

fnothaft commented Jun 9, 2014

Merged! Thanks @tdanford!

@tdanford tdanford deleted the broadinstitute:tdanford/referenceLengthFromCigar branch Jun 9, 2014

@tdanford

This comment has been minimized.

Show comment
Hide comment
@tdanford

tdanford Jun 9, 2014

Contributor

Thanks, Frank!

Contributor

tdanford commented Jun 9, 2014

Thanks, Frank!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment