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

Change Some to Option to check for unmapped reads #225

Merged
merged 1 commit into from Apr 24, 2014

Conversation

Projects
None yet
4 participants
@arahuja
Contributor

arahuja commented Apr 23, 2014

The current implementation of mappedPositionCheck throws a NullPointerException if the contig, start, position or contigname are defined. Instead it will now return None as the reference position

@nealsid

This comment has been minimized.

Show comment
Hide comment
@nealsid

nealsid Apr 23, 2014

Contributor

Nice catch - thanks

Contributor

nealsid commented Apr 23, 2014

Nice catch - thanks

record.getReadMapped && (contig.isDefined && Some(contig.get.getContigName).isDefined) && start.isDefined
val contig = Option(record.getContig)
val start = Option(record.getStart)
record.getReadMapped && (contig.isDefined && Option(contig.get.getContigName).isDefined) && start.isDefined

This comment has been minimized.

@fnothaft

fnothaft Apr 23, 2014

Member

I know this is Scalic (what is the Scala equivalent of pythonic?), but wouldn't it be more efficient to just directly check vs. null? I think Options are more useful when used functionally (e.g., a foreach, flatmap, etc).

@fnothaft

fnothaft Apr 23, 2014

Member

I know this is Scalic (what is the Scala equivalent of pythonic?), but wouldn't it be more efficient to just directly check vs. null? I think Options are more useful when used functionally (e.g., a foreach, flatmap, etc).

@fnothaft

This comment has been minimized.

Show comment
Hide comment
@fnothaft
Member

fnothaft commented Apr 23, 2014

+1

@AmplabJenkins

This comment has been minimized.

Show comment
Hide comment
@AmplabJenkins

AmplabJenkins Apr 23, 2014

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

AmplabJenkins commented Apr 23, 2014

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

fnothaft added a commit that referenced this pull request Apr 24, 2014

Merge pull request #225 from hammerlab/refpos-null
Change Some to Option to check for unmapped reads

@fnothaft fnothaft merged commit 513ca32 into bigdatagenomics:master Apr 24, 2014

1 check passed

default Merged build finished.
Details
@fnothaft

This comment has been minimized.

Show comment
Hide comment
@fnothaft

fnothaft Apr 24, 2014

Member

Merged! Thanks @arahuja.

Member

fnothaft commented Apr 24, 2014

Merged! Thanks @arahuja.

@arahuja arahuja deleted the hammerlab:refpos-null branch Apr 28, 2014

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