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 wrong padding of last bases in 2bit writer #127

Merged
merged 2 commits into from
Dec 21, 2017

Conversation

alumi
Copy link
Member

@alumi alumi commented Dec 20, 2017

Summary

Fix a bug that the last 1~3 bases were wrongly padded in the 2bit writer.

Problem

When sequence length is not a multiple of 4, last 1~3 bases are not correctly written.

Cause

In 2bit writer, every 4 bases are packed into a single byte.
The last bases will be packed from MSB and padded with 2r00.
But there was a bug in padding calculation.

Changes

Fix the padding.

Affects

2bit writer.

Tests

  • lein test :all 🆗

@alumi alumi added the bug label Dec 20, 2017
@alumi alumi requested a review from totakke December 20, 2017 14:22
@codecov
Copy link

codecov bot commented Dec 20, 2017

Codecov Report

Merging #127 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #127   +/-   ##
=======================================
  Coverage   84.82%   84.82%           
=======================================
  Files          62       62           
  Lines        4197     4197           
  Branches      415      415           
=======================================
  Hits         3560     3560           
  Misses        222      222           
  Partials      415      415
Impacted Files Coverage Δ
src/cljam/io/twobit/writer.clj 78.9% <100%> (ø) ⬆️

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 8485cad...73f30de. Read the comment docs.

Copy link
Member

@totakke totakke left a comment

Choose a reason for hiding this comment

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

LGTM

@totakke totakke merged commit 71baed5 into master Dec 21, 2017
@totakke totakke deleted the fix/twobit-writer-last-bases branch December 21, 2017 02:32
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.

2 participants