bamFile: {description: "The BAM file for which an index should be made.", category: "required"}
outputBamPath: {description: "The location where the BAM file should be written to. The index will appear alongside this link to the BAM file.",
category: "common"}
memory: {description: "The amount of memory needed for the job.", category: "advanced"}
inputBam: {description: "The bam file to process.", category: "required"}
outputRead1: {description: "The location the reads (first reads for pairs, in case of paired-end sequencing) should be written to.", category: "required"}
outputRead2: {description: "The location the second reads from pairs should be written to.", category: "common"}
outputRead0: {description: "The location the unpaired reads should be written to (in case of paired-end sequenicng).", category: "advanced"}
includeFilter: {description: "Include reads with ALL of these flags. Corresponds to `-f`", category: "advanced"}
excludeFilter: {description: "Exclude reads with ONE OR MORE of these flags. Corresponds to `-F`", category: "advanced"}
excludeSpecificFilter: {description: "Exclude reads with ALL of these flags. Corresponds to `-G`", category: "advanced"}
appendReadNumber: {description: "Append /1 and /2 to the read name, or don't. Corresponds to `-n/N`", category: "advanced"}
outputQuality: {description: "Equivalent to samtools fastq's `-O` flag.", category: "advanced"}
threads: {description: "The number of threads to use.", category: "advanced"}
memory: {description: "The amount of memory this job will use.", category: "advanced"}
timeMinutes: {description: "The maximum amount of time the job will run in minutes.", category: "advanced"}
dockerImage: {description: "The docker image used for this task. Changing this may result in errors which the developers may choose not to address.",
category: "advanced"}
}
}
task Merge {
task FilterShortReadsBam {
input {
Array[File]+ bamFiles
String outputBamPath = "merged.bam"
Boolean force = true
Int timeMinutes = 1 + ceil(size(bamFiles, "G") * 2)
File bamFile
String outputPathBam
String memory = "1G"
Int timeMinutes = 1 + ceil(size(bamFile, "G") * 8)
samtools index ~{outputPathBam} ~{outputPathBamIndex}
}
output {
File outputBam = outputBamPath
File outputBamIndex = indexPath
File filteredBam = outputPathBam
File filteredBamIndex = outputPathBamIndex
}
runtime {
docker: dockerImage
memory: memory
time_minutes: timeMinutes
docker: dockerImage
}
parameter_meta {
# inputs
bamFiles: {description: "The BAM files to merge.", category: "required"}
outputBamPath: {description: "The location the merged BAM file should be written to.", category: "common"}
force: {description: "Equivalent to samtools merge's `-f` flag.", category: "advanced"}
bamFile: {description: "The bam file to process.", category: "required"}
outputPathBam: {description: "The filtered bam file.", category: "common"}
memory: {description: "The amount of memory this job will use.", category: "advanced"}
timeMinutes: {description: "The maximum amount of time the job will run in minutes.", category: "advanced"}
dockerImage: {description: "The docker image used for this task. Changing this may result in errors which the developers may choose not to address.",
category: "advanced"}
dockerImage: {description: "The docker image used for this task. Changing this may result in errors which the developers may choose not to address.", category: "advanced"}
sortByName: {description: "Sort the inputBam by read name instead of position.", category: "advanced"}
compressionLevel: {description: "Compression level from 0 (uncompressed) to 9 (best).", category: "advanced"}
memory: {description: "The amount of memory available to the job.", category: "advanced"}
dockerImage: {description: "The docker image used for this task. Changing this may result in errors which the developers may choose not to address.", category: "advanced"}
threads: {description: "The number of additional threads that will be used for this task.", category: "advanced"}
inputBam: {description: "The BAM file for which statistics should be retrieved.", category: "required"}
outputPath: {description: "The location the ouput should be written to.", category: "required"}
memory: {description: "The amount of memory needed for the job.", category: "advanced"}
timeMinutes: {description: "The maximum amount of time the job will run in minutes.", category: "advanced"}
samtools index ~{outputPathBam} ~{outputPathBamIndex}
mkdir -p "$(dirname ~{outputBamPath})"
samtools markdup ~{inputBam} ~{outputBamPath}
}
output {
File filteredBam = outputPathBam
File filteredBamIndex = outputPathBamIndex
File outputBam = outputBamPath
}
runtime {
memory: memory
time_minutes: timeMinutes
docker: dockerImage
time_minutes: timeMinutes
}
parameter_meta {
bamFile: {description: "The bam file to process.", category: "required"}
outputPathBam: {description: "The filtered bam file.", category: "common"}
memory: {description: "The amount of memory this job will use.", category: "advanced"}
# inputs
inputBam: {description: "The BAM file to be processed.", category: "required"}
outputBamPath: {description: "The location of the output BAM file.", category: "required"}
timeMinutes: {description: "The maximum amount of time the job will run in minutes.", category: "advanced"}
dockerImage: {description: "The docker image used for this task. Changing this may result in errors which the developers may choose not to address.", category: "advanced"}
dockerImage: {description: "The docker image used for this task. Changing this may result in errors which the developers may choose not to address.",
category: "advanced"}
}
}
task Flagstat {
task Merge {
input {
File inputBam
String outputPath
Array[File]+ bamFiles
String outputBamPath = "merged.bam"
Boolean force = true
String memory = "1G"
Int timeMinutes = 1 + ceil(size(inputBam, "G"))
Int timeMinutes = 1 + ceil(size(bamFiles, "G") * 2)
inputBam: {description: "The bam file to process.", category: "required"}
outputRead1: {description: "The location the reads (first reads for pairs, in case of paired-end sequencing) should be written to.", category: "required"}
outputRead2: {description: "The location the second reads from pairs should be written to.", category: "common"}
outputRead0: {description: "The location the unpaired reads should be written to (in case of paired-end sequenicng).", category: "advanced"}
includeFilter: {description: "Include reads with ALL of these flags. Corresponds to `-f`", category: "advanced"}
excludeFilter: {description: "Exclude reads with ONE OR MORE of these flags. Corresponds to `-F`", category: "advanced"}
excludeSpecificFilter: {description: "Exclude reads with ALL of these flags. Corresponds to `-G`", category: "advanced"}
appendReadNumber: {description: "Append /1 and /2 to the read name, or don't. Corresponds to `-n/N`", category: "advanced"}
outputQuality: {description: "Equivalent to samtools fastq's `-O` flag.", category: "advanced"}
threads: {description: "The number of threads to use.", category: "advanced"}
memory: {description: "The amount of memory this job will use.", category: "advanced"}
inputBam: {description: "The input SAM file.", category: "required"}
sortByName: {description: "Sort the inputBam by read name instead of position.", category: "advanced"}
compressionLevel: {description: "Compression level from 0 (uncompressed) to 9 (best).", category: "advanced"}
memory: {description: "The amount of memory available to the job.", category: "advanced"}
dockerImage: {description: "The docker image used for this task. Changing this may result in errors which the developers may choose not to address.", category: "advanced"}
threads: {description: "The number of additional threads that will be used for this task.", category: "advanced"}
timeMinutes: {description: "The maximum amount of time the job will run in minutes.", category: "advanced"}
dockerImage: {description: "The docker image used for this task. Changing this may result in errors which the developers may choose not to address.",
samtools index ~{outputPathBam} ~{outputPathBamIndex}
}
output {
File filteredBam = outputPathBam
File filteredBamIndex = outputPathBamIndex
}
runtime {
docker: dockerImage
}
parameter_meta {
bamFile: {description: "The bam file to process.", category: "required"}
outputPathBam: {description: "The filtered bam file.", category: "common"}
dockerImage: {description: "The docker image used for this task. Changing this may result in errors which the developers may choose not to address.", category: "advanced"}