|
| 1 | +(ns varity.vcf-to-hgvs-bench |
| 2 | + (:require [cljam.io.sequence :as cseq] |
| 3 | + [libra.bench :refer :all] |
| 4 | + [libra.criterium :as c] |
| 5 | + [varity.ref-gene :as rg] |
| 6 | + [varity.vcf-to-hgvs :as v2h] |
| 7 | + [varity.t-common :refer :all])) |
| 8 | + |
| 9 | +(def variants |
| 10 | + [{:chr "chr7", :pos 55191822, :ref "T", :alt "G"} |
| 11 | + {:chr "chr1", :pos 247815239, :ref "AAGG", :alt "A"} |
| 12 | + {:chr "chr2", :pos 26254257, :ref "G", :alt "GACT"} |
| 13 | + {:chr "chr3", :pos 122740443, :ref "G", :alt "GAGA"} |
| 14 | + {:chr "chr2", :pos 47445589, :ref "CTTACTGAT", :alt "CCC"} |
| 15 | + {:chr "chr1", :pos 11796319, :ref "C", :alt "CGGCGGC"} |
| 16 | + {:chr "chr1", :pos 69567, :ref "A", :alt "AT"} |
| 17 | + {:chr "chr2", :pos 189011772, :ref "T", :alt "C"}]) |
| 18 | + |
| 19 | +(defbench ^:slow vcf-variant->protein-hgvs-bench |
| 20 | + (prepare-cavia!) |
| 21 | + (let [rgidx (rg/index (rg/load-ref-genes test-ref-gene-file))] |
| 22 | + (with-open [seq-rdr (cseq/reader test-ref-seq-file)] |
| 23 | + (is (c/quick-bench (doseq [v variants] |
| 24 | + (doall (v2h/vcf-variant->protein-hgvs v seq-rdr rgidx)))))))) |
0 commit comments