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

Allow +Inf and -Inf Float values when reading VCF #1512

Closed
heuermh opened this Issue May 3, 2017 · 3 comments

Comments

Projects
2 participants
@heuermh
Member

heuermh commented May 3, 2017

Per the VCF 4.3 specification,

Float (32-bit, formatted to match the regular expression
^[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?$, NaN, or +/-Inf)

From what I can tell, Scala float parsing delegates to the implementation in java, which uses

...
"[+-]?(" + // Optional sign character
"NaN|" +           // "NaN" string
"Infinity|" +      // "Infinity" string
...

Thus we may need to special case +Inf and -Inf. Reported by @tangxuan_twitter on Gitter.

@heuermh heuermh changed the title from Allow `+Inf` and `-Inf` Float values when reading VCF to Allow +Inf and -Inf Float values when reading VCF May 3, 2017

@fnothaft

This comment has been minimized.

Show comment
Hide comment
@fnothaft

fnothaft Jun 22, 2017

Member

@heuermh This is an upstream issue in htsjdk, no?

Member

fnothaft commented Jun 22, 2017

@heuermh This is an upstream issue in htsjdk, no?

@heuermh

This comment has been minimized.

Show comment
Hide comment
@heuermh

heuermh Jun 22, 2017

Member

In Scala number format parsing actually. I couldn't see a simple fix so I left it here.

Member

heuermh commented Jun 22, 2017

In Scala number format parsing actually. I couldn't see a simple fix so I left it here.

@fnothaft

This comment has been minimized.

Show comment
Hide comment
@fnothaft

fnothaft Jun 22, 2017

Member

Oh, that's right. htsjdk just gives us Strings, that we then have to make sense of. LOVE IT.

Member

fnothaft commented Jun 22, 2017

Oh, that's right. htsjdk just gives us Strings, that we then have to make sense of. LOVE IT.

fnothaft added a commit to fnothaft/adam that referenced this issue Sep 13, 2017

fnothaft added a commit to fnothaft/adam that referenced this issue Oct 8, 2017

@heuermh heuermh closed this in #1721 Oct 9, 2017

heuermh added a commit that referenced this issue Oct 9, 2017

[ADAM-1512] Support VCFs with +Inf/-Inf float values.
* [ADAM-1512] Support VCFs with +Inf/-Inf float values.

Resolves #1512.

* fix inf float values, add test file

@heuermh heuermh added this to the 0.23.0 milestone Dec 7, 2017

@heuermh heuermh added this to Completed in Release 0.23.0 Jan 4, 2018

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