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 decoding of long CIGAR ops in BAM #173

Merged
merged 1 commit into from Jul 31, 2019
Merged

Fix decoding of long CIGAR ops in BAM #173

merged 1 commit into from Jul 31, 2019

Conversation

alumi
Copy link
Member

@alumi alumi commented Jul 30, 2019

Problem

cljam.io.bam fails to decode alignments with CIGAR operations longer than 134217728

Cause

A CIGAR is stored as an array of op_len<<4|op in uint32_t[n_cigar_op].
Thus op_len can be as long as 28bit 0x0FFFFFFF but it is not handled properly due to type promotion from int to long.

Changes

Use Integer/toUnsignedLong to get a positive long value.

Tests

  • lein check 🆗
  • lein test :all 🆗
  • lein cloverage 🆗
  • lein eastwood 🆗

@alumi alumi added the bug label Jul 30, 2019
@alumi alumi requested a review from a team July 30, 2019 08:30
@ghost ghost requested review from athos and r6eve and removed request for a team July 30, 2019 08:31
@codecov
Copy link

codecov bot commented Jul 30, 2019

Codecov Report

Merging #173 into master will not change coverage.
The diff coverage is 0%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master    #173   +/-   ##
======================================
  Coverage    86.9%   86.9%           
======================================
  Files          73      73           
  Lines        5683    5683           
  Branches      482     482           
======================================
  Hits         4939    4939           
  Misses        262     262           
  Partials      482     482
Impacted Files Coverage Δ
src/cljam/io/sam/util/cigar.clj 74.02% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update de2e3ba...b7427e7. Read the comment docs.

Copy link
Contributor

@r6eve r6eve left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Member

@athos athos left a comment

Choose a reason for hiding this comment

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

LGTM 👍 Good catch!

@athos athos merged commit 725c592 into master Jul 31, 2019
@athos athos deleted the fix/bam-cigar branch July 31, 2019 03:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants