Skip to content

Commit

Permalink
Add missing tests for CRAM reader
Browse files Browse the repository at this point in the history
  • Loading branch information
athos committed Apr 24, 2024
1 parent be82cb6 commit 4fdc68b
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/cljam/io/util_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
dedupe-before-bam-file
dedupe-after-bam-file
test-bai-file
test-cram-file
test-fa-file
test-fa-bz2-file
test-fa-dict-file
Expand Down Expand Up @@ -56,6 +57,7 @@
test-bigwig-bedgraph-file
test-bigwig-non-leaf-blocks-file]]
[cljam.io.bed :as bed]
[cljam.io.cram :as cram]
[cljam.io.fastq :as fastq]
[cljam.io.sam :as sam]
[cljam.io.sequence :as cseq]
Expand Down Expand Up @@ -154,6 +156,7 @@
normalize-after-bam-file :bam
opts-bam-file :bam
test-bai-file :bai
test-cram-file :cram
test-fa-file :fasta
test-fa-bz2-file :fasta
test-fa-dict-file :sam
Expand Down Expand Up @@ -228,6 +231,23 @@
(is (true? (io-util/bam-reader? cloned))))
(with-open [r (sam/reader test-sam-file)]
(is (thrown? Exception (sam/reader r)))))
(testing "cram reader"
(with-open [r (cram/reader test-cram-file)]
(are [?pred ?expected] (= (?pred r) ?expected)
io-util/alignment-reader? true
io-util/sam-reader? false
io-util/bam-reader? false
io-util/cram-reader? true
io-util/variant-reader? false
io-util/vcf-reader? false
io-util/bcf-reader? false
io-util/sequence-reader? false
io-util/fasta-reader? false
io-util/twobit-reader? false
io-util/fastq-reader? false
io-util/bed-reader? false
io-util/wig-reader? false
io-util/bigwig-reader? false)))
(testing "vcf reader"
(with-open [r (vcf/reader test-vcf-v4_3-file)]
(are [?pred ?expected] (= (?pred r) ?expected)
Expand Down

0 comments on commit 4fdc68b

Please sign in to comment.