Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
67 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
(ns cljam.algo.bam-indexer-bench | ||
(:require [libra.bench :refer :all] | ||
[libra.criterium :as c] | ||
[cljam.test-common :as tcommon] | ||
[cljam.algo.bam-indexer :as bai])) | ||
|
||
(defbench create-index-medium-bench | ||
(tcommon/with-before-after {:before (tcommon/prepare-cache!) | ||
:after (tcommon/clean-cache!)} | ||
(are [n] (c/quick-bench (bai/create-index tcommon/medium-bam-file | ||
(str tcommon/temp-dir "/out-" n ".bai") | ||
:n-threads n)) | ||
1 | ||
2 | ||
4))) | ||
|
||
;; BAM-indexing benchmark equivalent to being used in the SCfBM paper, | ||
;; https://doi.org/10.1186/s13029-016-0058-6. | ||
;; Note that it requires stupendous time and CPU resources. | ||
(when-let [bam (System/getenv "SCFBM_BENCH_BAM")] | ||
(tcommon/with-before-after {:before (tcommon/prepare-cache!) | ||
:after (tcommon/clean-cache!)} | ||
(defbench create-index-scfbm-bench | ||
(are [n] (dur 10 (bai/create-index bam | ||
(str tcommon/temp-dir "/out-" n ".bai") | ||
:n-threads n)) | ||
1 | ||
2 | ||
3 | ||
4 | ||
6 | ||
8 | ||
12)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
(ns cljam.algo.depth-bench | ||
(:require [libra.bench :refer :all] | ||
[libra.criterium :as c] | ||
[cljam.test-common :as tcommon] | ||
[cljam.algo.depth :as depth] | ||
[cljam.io.sam :as sam])) | ||
|
||
(defbench depth-medium-bench | ||
(are [n] (c/quick-bench (with-open [rdr (sam/reader tcommon/medium-bam-file)] | ||
(depth/depth rdr {:chr "chr1" :start 1000000 :end 9999999} {:n-threads n}))) | ||
1 | ||
2 | ||
4)) | ||
|
||
;; Simple pileup benchmark equivalent to being used in the SCfBM paper, | ||
;; https://doi.org/10.1186/s13029-016-0058-6. | ||
;; Note that it requires stupendous time and CPU/RAM resources. | ||
(when-let [bam (System/getenv "SCFBM_BENCH_BAM")] | ||
(defbench lazy-depth-scfbm-bench | ||
(are [n] (dur 10 (with-open [rdr (sam/reader bam)] | ||
(dorun (depth/lazy-depth rdr {:chr "1"} {:n-threads n})))) | ||
1 | ||
2 | ||
3 | ||
4 | ||
6 | ||
8 | ||
12))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters