Skip to content
Snippets Groups Projects
bwa.wdl 455 B
Newer Older
pjvan_thof's avatar
pjvan_thof committed
task BwaMem {
Peter van 't Hof's avatar
Peter van 't Hof committed
    String? preCommand
pjvan_thof's avatar
pjvan_thof committed
    File inputR1
    File? inputR2
    String referenceFasta
    String outputPath
    String? readgroup

    command {
        set -e -o pipefail
        mkdir -p $(dirname ${outputPath})
Peter van 't Hof's avatar
Peter van 't Hof committed
        ${preCommand}
pjvan_thof's avatar
pjvan_thof committed
        bwa mem ${"-R '" + readgroup + "'"} \
        ${referenceFasta} ${inputR1} ${inputR2} | samtools sort --output-fmt BAM - > ${outputPath}
    }

    output {
        File bamFile = outputPath
    }
}