Skip to content

Commit

Permalink
Add missing test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
athos committed Aug 2, 2024
1 parent cd66f85 commit c2ea942
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions test/cljam/io/cram/encode/alignment_stats_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,15 @@
{:ri 0, :start 51, :end 150}
{:ri 1, :start 51, :end 150}
{:ri 1, :start 151, :end 300}
{:ri 2, :start 51, :end 150}
{:ri 2, :start 200, :end 300}
{:ri -1, :start 0, :end 0}
{:ri -1, :start 0, :end 0}]]
(run! (fn [{:keys [ri start end]}]
(stats/update-span! builder ri start end))
records)
(is (= {0 {:start 1, :span 150}
1 {:start 51, :span 250}
2 {:start 51, :span 250}
-1 {:start 0, :span 1}}
(stats/build-spans builder)))))
6 changes: 5 additions & 1 deletion test/cljam/io/cram/encode/record_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@
{:rname "ref", :pos 5, :cigar "2S3M",:seq "CCTGT", :qual "##AAC"}
{:rname "ref", :pos 10, :cigar "5M", :seq "GATAA", :qual "CCCFF"}
{:rname "ref", :pos 15, :cigar "1M1I1M1D2M", :seq "GAAAG", :qual "EBBFF"}
{:rname "*", :pos 0, :cigar "*", :seq "CTGTG", :qual "AEEEE"}])]
{:rname "*", :pos 0, :cigar "*", :seq "CTGTG", :qual "AEEEE"}
{:rname "*", :pos 10, :cigar "*", :seq "*", :qual "*"}])]
(record/preprocess-slice-records test-seq-resolver rname->idx subst-mat records)
(is (= [{:rname "ref", :pos 1, :cigar "5M", :seq "AGAAT", :qual "HFHHH"
::record/flag 0x03, ::record/ref-index 0, ::record/end 5
Expand All @@ -92,6 +93,9 @@
{:code :deletion, :pos 4, :len 1}]}
{:rname "*", :pos 0, :cigar "*", :seq "CTGTG", :qual "AEEEE"
::record/flag 0x03, ::record/ref-index -1, ::record/end 0
::record/features []}
{:rname "*", :pos 10, :cigar "*", :seq "*", :qual "*"
::record/flag 0x0b, ::record/ref-index -1, ::record/end 10
::record/features []}]
(walk/prewalk #(if (.isArray (class %)) (vec %) %)
records)))))
Expand Down

0 comments on commit c2ea942

Please sign in to comment.