File tree Expand file tree Collapse file tree 3 files changed +84
-1
lines changed
modules/nf-core/hifitrimmer/filterbam Expand file tree Collapse file tree 3 files changed +84
-1
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,8 @@ process HIFITRIMMER_FILTERBAM {
2424 def args = task. ext. args ?: ' '
2525 def args2 = task. ext. args2 ?: ' '
2626 def suffix = args. contains(' -f' ) ? " fastq.gz" : " fasta.gz"
27- def input_convert = ! input. name. endsWith(' bam' ) ? " <(samtools import ${ input} ${ args2} -@ ${ task.cpus} )" : input
27+ def input_convert = input. name. endsWith(' cram' ) ? " <(samtools view ${ input} -u ${ args2} -@ ${ task.cpus} )" :
28+ ! input. name. endsWith(' bam' ) ? " <(samtools import ${ input} ${ args2} -@ ${ task.cpus} )" : input
2829 """
2930 hifi_trimmer filter_bam \\
3031 -t ${ task.cpus} \\
Original file line number Diff line number Diff line change @@ -93,6 +93,33 @@ nextflow_process {
9393 }
9494 }
9595
96+ test("hifi_trimmer filter_bam test - input cram") {
97+
98+ when {
99+ params {
100+ filter_bam_args = ""
101+ }
102+ process {
103+ """
104+ input[0] = Channel.of(
105+ [
106+ [ id:'test_cram' ], // meta map
107+ file(params.modules_testdata_base_path + '/genomics/eukaryotes/Pipistrellus_nathusii/genome/test.cram', checkIfExists: true),
108+ file(params.modules_testdata_base_path + '/delete_me/hifitrimmer/test.bed.gz', checkIfExists: true)
109+ ]
110+ )
111+ """
112+ }
113+ }
114+
115+ then {
116+ assertAll(
117+ { assert process.success },
118+ { assert snapshot(process.out).match() }
119+ )
120+ }
121+ }
122+
96123 test("hifi_trimmer test - stub") {
97124
98125 options "-stub"
Original file line number Diff line number Diff line change 109109 },
110110 " timestamp" : " 2026-02-24T13:46:51.777255966"
111111 },
112+ " hifi_trimmer filter_bam test - input cram" : {
113+ " content" : [
114+ {
115+ " 0" : [
116+ [
117+ {
118+ " id" : " test_cram"
119+ },
120+ " test_cram.fasta.gz:md5,80f9c060bfc39f9d12a8e70c112d05cc"
121+ ]
122+ ],
123+ " 1" : [
124+ [
125+ " HIFITRIMMER_FILTERBAM" ,
126+ " hifi_trimmer" ,
127+ " 2.2.0"
128+ ]
129+ ],
130+ " 2" : [
131+ [
132+ " HIFITRIMMER_FILTERBAM" ,
133+ " samtools" ,
134+ " 1.23"
135+ ]
136+ ],
137+ " filtered" : [
138+ [
139+ {
140+ " id" : " test_cram"
141+ },
142+ " test_cram.fasta.gz:md5,80f9c060bfc39f9d12a8e70c112d05cc"
143+ ]
144+ ],
145+ " versions_hifitrimmer" : [
146+ [
147+ " HIFITRIMMER_FILTERBAM" ,
148+ " hifi_trimmer" ,
149+ " 2.2.0"
150+ ]
151+ ],
152+ " versions_samtools" : [
153+ [
154+ " HIFITRIMMER_FILTERBAM" ,
155+ " samtools" ,
156+ " 1.23"
157+ ]
158+ ]
159+ }
160+ ],
161+ " meta" : {
162+ " nf-test" : " 0.9.3" ,
163+ " nextflow" : " 25.10.2"
164+ },
165+ " timestamp" : " 2026-03-25T10:14:23.060029898"
166+ },
112167 " hifi_trimmer test - stub" : {
113168 " content" : [
114169 {
You can’t perform that action at this time.
0 commit comments