Merge pull request #135 from drpatelh/bwa

Update indices syntax for BWA index and mem modules
This commit is contained in:
Maxime Garcia 2021-02-12 12:45:38 +01:00 committed by GitHub
commit 27be87ac72
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 17 additions and 20 deletions

View file

@ -22,13 +22,14 @@ process BWA_INDEX {
path fasta
output:
path "${fasta}.*" , emit: index
path "bwa" , emit: index
path "*.version.txt", emit: version
script:
def software = getSoftwareName(task.process)
"""
bwa index $options.args $fasta
mkdir bwa
bwa index $options.args $fasta -p bwa/${fasta.baseName}
echo \$(bwa 2>&1) | sed 's/^.*Version: //; s/Contact:.*\$//' > ${software}.version.txt
"""
}

View file

@ -21,7 +21,6 @@ process BWA_MEM {
input:
tuple val(meta), path(reads)
path index
path fasta
output:
tuple val(meta), path("*.bam"), emit: bam
@ -32,13 +31,15 @@ process BWA_MEM {
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
def read_group = meta.read_group ? "-R ${meta.read_group}" : ""
"""
INDEX=`find -L ./ -name "*.amb" | sed 's/.amb//'`
bwa mem \\
$options.args \\
$read_group \\
-t $task.cpus \\
$fasta \\
\$INDEX \\
$reads \\
| samtools view $options.args2 -@ $task.cpus -bS -o ${prefix}.bam -
| samtools view $options.args2 -@ $task.cpus -bhS -o ${prefix}.bam -
echo \$(bwa 2>&1) | sed 's/^.*Version: //; s/Contact:.*\$//' > ${software}.version.txt
"""

View file

@ -51,10 +51,7 @@ input:
- index:
type: file
description: BWA genome index files
pattern: "*.{amb,ann,bwt,pac,sa}"
- fasta:
type: file
description: Input genome fasta file
pattern: "Directory containing BWA index *.{amb,ann,bwt,pac,sa}"
output:
- bam:
type: file

View file

@ -4,11 +4,11 @@
- bwa
- bwa_index
files:
- path: output/bwa/NC_010473.fa.amb
- path: output/bwa/bwa/NC_010473.amb
md5sum: 942a990ae872f1c0b8d72dda2db405d5
- path: output/bwa/NC_010473.fa.bwt
- path: output/bwa/bwa/NC_010473.bwt
md5sum: 7301b52e2ecb893d429a49fa692447ae
- path: output/bwa/NC_010473.fa.pac
- path: output/bwa/bwa/NC_010473.pac
md5sum: 4d5e6fc45bbc968f7f859e9ca2cc89ad
- path: output/bwa/NC_010473.fa.sa
- path: output/bwa/bwa/NC_010473.sa
md5sum: a47dcc92e750e2f16fbd979b8ff9538e

View file

@ -15,8 +15,7 @@ workflow test_bwa_mem_single_end {
BWA_MEM (
input,
file("${launchDir}/tests/data/index/E_coli/bwa/NC_010473.fa.{amb,ann,bwt,pac,sa}", checkIfExists: true),
file("${launchDir}/tests/data/fasta/E_coli/NC_010473.fa", checkIfExists: true)
file("${launchDir}/tests/data/index/E_coli/bwa/", checkIfExists: true)
)
}
@ -32,7 +31,6 @@ workflow test_bwa_mem_paired_end {
BWA_MEM (
input,
file("${launchDir}/tests/data/index/E_coli/bwa/NC_010473.fa.{amb,ann,bwt,pac,sa}", checkIfExists: true),
file("${launchDir}/tests/data/fasta/E_coli/NC_010473.fa", checkIfExists: true)
file("${launchDir}/tests/data/index/E_coli/bwa/", checkIfExists: true)
)
}

View file

@ -6,7 +6,7 @@
- bwa_mem_single_end
files:
- path: output/bwa/test.bam
md5sum: 3ee21210bac387e0335008146e4728bc
md5sum: 52e81e5bd523d0b27fe533b21a0d80f5
- name: bwa mem paired-end
command: nextflow run ./tests/software/bwa/mem -entry test_bwa_mem_paired_end -c tests/config/nextflow.config
@ -16,4 +16,4 @@
- bwa_mem_paired_end
files:
- path: output/bwa/test.bam
md5sum: 510d8acc6448c07cdacce8e64ec0904c
md5sum: 86d82fdb68ed384c656cfc62a253052f