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

Fix float reader for specific environments such as IcedTea. #185

Merged
merged 1 commit into from
Jan 8, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/cljam/io/bcf/reader.clj
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@
(case (bit-and 0xFFFF i) 0x8000 nil 0x8001 :eov i))
3 (let [i (lsb/read-int r)]
(case (bit-and 0xFFFFFFFF i) 0x80000000 nil 0x80000001 :eov i))
5 (let [i (lsb/read-float r)]
(case (Float/floatToRawIntBits i) 0x7F800001 nil 0x7F800002 :eov i))
5 (let [i (lsb/read-int r)]
(case (bit-and 0xFFFFFFFF i) 0x7F800001 nil 0x7F800002 :eov (Float/intBitsToFloat i)))
7 (lsb/read-byte r)))

(defn- bytes->strs
Expand Down Expand Up @@ -163,7 +163,7 @@
(let [chrom-id (lsb/read-int shared)
pos (inc (lsb/read-int shared))
rlen (lsb/read-int shared)
qual (lsb/read-float shared)
qual (lsb/read-int shared)
n-allele-info (lsb/read-int shared)
n-allele (unsigned-bit-shift-right n-allele-info 16)
n-info (bit-and n-allele-info 0xFFFF)
Expand All @@ -179,7 +179,7 @@
{:chr chrom-id
:pos pos
:ref-length rlen
:qual (when-not (= (Float/floatToRawIntBits qual) 0x7F800001) qual)
:qual (when-not (= qual 0x7F800001) (Float/intBitsToFloat qual))
:id id
:ref (first refseq)
:alt (seq (map first altseq))
Expand Down