-
Notifications
You must be signed in to change notification settings - Fork 12
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
Extract depth algorithm and improve performance. #91
Conversation
Codecov Report
@@ Coverage Diff @@
## master #91 +/- ##
==========================================
+ Coverage 82.71% 82.93% +0.22%
==========================================
Files 60 60
Lines 4107 4161 +54
Branches 437 452 +15
==========================================
+ Hits 3397 3451 +54
+ Misses 273 258 -15
- Partials 437 452 +15
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome improvement. Almost good. Please just remove unused vars.
src/cljam/algo/depth.clj
Outdated
[bam-reader {:keys [chr start end] :or {start 1 end Long/MAX_VALUE}} | ||
& [{:keys [step unchecked? n-threads] :or {step default-step unchecked? false n-threads 1}}]] | ||
{:pre [chr start end (pos? start) (pos? end) (<= start end)]} | ||
(when-let [{:keys [len] :as r} (sam-util/ref-by-name (sam/read-refs bam-reader) chr)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r
is never used.
src/cljam/algo/pileup.clj
Outdated
"Returns a position of first alignment in left-right, or nil." | ||
[bam-reader region] | ||
(plp/first-pos bam-reader region)) | ||
|
||
(def ^:private default-pileup-option |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default-pileup-option
is no longer needed.
Thank you for reviewing! I've just removed the unused vars. |
Thanks |
Changes
cljam.algo.pileup.pileup/pileup
function tocljam.algo.depth/lazy-depth
.cljam.algo.depth/depth
optimized for performance.Benchmark
Computing depth for
chr1:1-248956422
BAM file containing about 3500000 alignments in the region.Environment
Results
The eager version is >10x faster.