Skip to content
Snippets Groups Projects
Commit a5d69668 authored by Ruben Vorderman's avatar Ruben Vorderman
Browse files

added bwa index and samtools fastq

parent b3545b27
No related branches found
No related tags found
2 merge requests!9Changes for virus assembly pipeline,!10Extra tasks required for assembly.
......@@ -3,6 +3,7 @@ task BwaMem {
File inputR1
File? inputR2
String referenceFasta
Array[File] indexFiles # These indexFiles need to be added, otherwise cromwell will not find them.
String outputPath
String? readgroup
......@@ -26,3 +27,36 @@ task BwaMem {
memory: if defined(memory) then memory else 8
}
}
task index {
File fasta
String? preCommand
String? constructionAlgorithm
Int? blockSize
String? outputDir
String fastaFilename = basename(fasta)
command {
set -e -o pipefail
${"mkdir -p " + outputDir}
${preCommand}
ln -sf ${fasta} ${outputDir + "/"}${fastaFilename}
bwa index \
${"-a " + constructionAlgorithm} \
${"-b" + blockSize} \
${outputDir + "/"}${fastaFilename}
}
output {
File indexBase = if (defined(outputDir)) then select_first([outputDir]) + "/" + fastaFilename else fastaFilename
File indexedFasta = indexBase
Array[File] indexFiles = [indexBase + ".bwt",indexBase + ".pac",indexBase + ".sa",indexBase + ".amb",indexBase + ".ann"]
}
parameter_meta {
fasta: "Fasta file to be indexed"
constructionAlgorithm: "-a STR BWT construction algorithm: bwtsw, is or rb2 [auto]"
blockSize: "-b INT block size for the bwtsw algorithm (effective with -a bwtsw) [10000000]"
outputDir: "index will be created in this output directory"
}
}
......@@ -97,6 +97,11 @@ task fastq {
${"--threads " + totalThreads} \
}
output {
File read1 = outputRead1
File? read2 = outputRead2
File? read0 = outputRead0
}
runtime {
cpu: totalThreads
memory: select_first([memory, 1])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment