Skip to content

Commit

Permalink
Merge pull request #12 from CCBR/sort-index
Browse files Browse the repository at this point in the history
output index from samtools sort
  • Loading branch information
kelly-sovacool authored Oct 19, 2023
2 parents fe697a4 + 48ad268 commit 4d14377
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
- new modules:
- bwa/index
- bwa/mem
- also runs samtools sort & outputs index in bai format.
- cutadapt
- khmer/uniquekmers
10 changes: 6 additions & 4 deletions modules/CCBR/bwa/mem/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ process BWA_MEM {
tuple val(meta_idx), path(index_files)

output:
tuple val(meta), path("*.bam"), emit: bam
path "versions.yml" , emit: versions
tuple val(meta), path("*.bam"), path("*.bai"), emit: bam
path "versions.yml" , emit: versions

when:
task.ext.when == null || task.ext.when
Expand All @@ -31,7 +31,9 @@ process BWA_MEM {
-@ ${task.cpus} \\
-m 2G \\
-T \$TMP \\
\$TMP/align.bam > ${prefix}.bam
--write-index \\
-o ${prefix}.bam##idx##${prefix}.bam.bai \\
\$TMP/align.bam
cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand All @@ -42,6 +44,6 @@ process BWA_MEM {

stub:
"""
touch ${meta.id}.bam versions.yml
touch ${meta.id}.bam ${meta.id}.bam.bai versions.yml
"""
}
4 changes: 4 additions & 0 deletions modules/CCBR/bwa/mem/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ output:
type: file
description: Output BAM file containing read alignments
pattern: "*.{bam}"
- bai:
type: file
description: Output BAI index file
pattern: "*.{bai}"
- versions:
type: file
description: File containing software versions
Expand Down
16 changes: 14 additions & 2 deletions tests/modules/CCBR/bwa/mem/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,18 @@
- path: output/bwa/bwa/genome.sa
md5sum: ab3952cabf026b48cd3eb5bccbb636d1
- path: output/bwa/test.bam
md5sum: fe5a30103b245d81a8d37d6144794f56
md5sum: 0f7b7413436295bcd839fec262eabb18
- path: output/bwa/test.bam.bai
- path: output/bwa/versions.yml

- name: bwa mem test_bwa_mem_single_end stub
command: nextflow run ./tests/modules/CCBR/bwa/mem -entry test_bwa_mem_single_end -c ./tests/config/nextflow.config -stub
tags:
- bwa/mem
- bwa
files:
- path: output/bwa/test.bam
- path: output/bwa/test.bam.bai
- path: output/bwa/versions.yml

- name: bwa mem test_bwa_mem_paired_end
Expand All @@ -35,5 +46,6 @@
- path: output/bwa/bwa/genome.sa
md5sum: ab3952cabf026b48cd3eb5bccbb636d1
- path: output/bwa/test.bam
md5sum: 06b8e7424d97add946ddb07e55f12962
md5sum: ae4a49f2dd6a487d75f99c9d3b42858b
- path: output/bwa/test.bam.bai
- path: output/bwa/versions.yml

0 comments on commit 4d14377

Please sign in to comment.