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

Change Some to Option to check for unmapped reads #225

Merged
merged 1 commit into from
Apr 24, 2014

Conversation

arahuja
Copy link
Contributor

@arahuja 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
Copy link

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
Copy link
Member

Choose a reason for hiding this comment

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

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
Copy link
Member

+1

@AmplabJenkins
Copy link

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
Change Some to Option to check for unmapped reads
@fnothaft fnothaft merged commit 513ca32 into bigdatagenomics:master Apr 24, 2014
@fnothaft
Copy link
Member

Merged! Thanks @arahuja.

@arahuja arahuja deleted the refpos-null branch April 28, 2014 15:57
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.

4 participants