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

Improve performance of reading BAM files. #22

Merged
merged 2 commits into from
Jan 25, 2017

Conversation

alumi
Copy link
Member

@alumi alumi commented Jan 25, 2017

This PR improves performance of reading alignments from a BAM file.

Decoding 4-bit encoded sequences takes approximately 70% of time during reading BAM.
I modified to use static byte-to-chars table to make decoding about 30x faster, therefore entire cljam view command got about 3x faster.

I also modified project.clj to update dependencies.

After this modification, the largest bottleneck will be decoding optional fields which is about 4x slower than decoding a sequence.

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.

Good improvement. I've added a trivial comment.

(let [nibble-table "=ACMGRSVTWYHKDBN"]
(->> (for [i nibble-table j nibble-table] [i j])
(apply concat)
clojure.string/join)))
Copy link
Member

Choose a reason for hiding this comment

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

clojure.string/join -> cstr/join

@alumi alumi force-pushed the feature/optimize-decoding-bam branch from 08a7bb3 to f93a84a Compare January 25, 2017 07:51
@alumi
Copy link
Member Author

alumi commented Jan 25, 2017

Thank you for the comment. I've fixed it and rebased.

@totakke totakke merged commit f93a84a into master Jan 25, 2017
totakke added a commit that referenced this pull request Jan 25, 2017
Improve performance of reading BAM files.
@totakke
Copy link
Member

totakke commented Jan 25, 2017

Thanks. This improvement has just been merged 👍

@alumi alumi deleted the feature/optimize-decoding-bam branch January 25, 2017 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants