From 4fdc68bf661509cf45935eaab093becf677ba2ca Mon Sep 17 00:00:00 2001 From: Shogo Ohta Date: Wed, 10 Apr 2024 14:45:46 +0900 Subject: [PATCH] Add missing tests for CRAM reader --- test/cljam/io/util_test.clj | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/cljam/io/util_test.clj b/test/cljam/io/util_test.clj index b09684df..250c6bf3 100644 --- a/test/cljam/io/util_test.clj +++ b/test/cljam/io/util_test.clj @@ -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 @@ -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] @@ -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 @@ -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)