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

samtools to 1.0

parent 6b79eb1d
No related branches found
No related tags found
1 merge request!34Move all files to version 1.0
task Index { version 1.0
String? preCommand
File bamFilePath
String? bamIndexPath
task Index {
input {
String? preCommand
File bamFilePath
String? bamIndexPath
}
command { command {
set -e -o pipefail set -e -o pipefail
${preCommand} ~{preCommand}
samtools index ${bamFilePath} ${bamIndexPath} samtools index ~{bamFilePath} ~{bamIndexPath}
} }
output { output {
...@@ -15,14 +18,15 @@ task Index { ...@@ -15,14 +18,15 @@ task Index {
} }
task Merge { task Merge {
String? preCommand input {
Array[File]+ bamFiles String? preCommand
String outputBamPath Array[File]+ bamFiles
String outputBamPath
}
command { command {
set -e -o pipefail set -e -o pipefail
${preCommand} ~{preCommand}
samtools merge ${outputBamPath} ${sep=' ' bamFiles} samtools merge ~{outputBamPath} ~{sep=' ' bamFiles}
} }
output { output {
...@@ -31,14 +35,16 @@ task Merge { ...@@ -31,14 +35,16 @@ task Merge {
} }
task Markdup { task Markdup {
String? preCommand input {
File inputBam String? preCommand
String outputBamPath File inputBam
String outputBamPath
}
command { command {
set -e -o pipefail set -e -o pipefail
${preCommand} ~{preCommand}
samtools markdup ${inputBam} ${outputBamPath} samtools markdup ~{inputBam} ~{outputBamPath}
} }
output { output {
...@@ -47,15 +53,17 @@ task Markdup { ...@@ -47,15 +53,17 @@ task Markdup {
} }
task Flagstat { task Flagstat {
String? preCommand input {
File inputBam String? preCommand
String outputPath File inputBam
String outputPath
}
command { command {
set -e -o pipefail set -e -o pipefail
${preCommand} ~{preCommand}
mkdir -p $(dirname ${outputPath}) mkdir -p $(dirname ~{outputPath})
samtools flagstat ${inputBam} > ${outputPath} samtools flagstat ~{inputBam} > ~{outputPath}
} }
output { output {
...@@ -64,35 +72,37 @@ task Flagstat { ...@@ -64,35 +72,37 @@ task Flagstat {
} }
task fastq { task fastq {
String? preCommand input {
File inputBam String? preCommand
String outputRead1 File inputBam
String? outputRead2 String outputRead1
String? outputRead0 String? outputRead2
Int? includeFilter String? outputRead0
Int? excludeFilter Int? includeFilter
Int? excludeSpecificFilter Int? excludeFilter
Boolean? appendReadNumber Int? excludeSpecificFilter
Boolean? outputQuality Boolean? appendReadNumber
Int? compressionLevel Boolean? outputQuality
Int? threads Int? compressionLevel
Int? memory Int? threads
Int totalThreads = select_first([threads, 1]) Int? memory
Int totalThreads = select_first([threads, 1])
}
command { command {
${preCommand} ~{preCommand}
samtools fastq \ samtools fastq \
${true="-1" false="-s" defined(outputRead2)} ${outputRead1} \ ~{true="-1" false="-s" defined(outputRead2)} ~{outputRead1} \
${"-2 " + outputRead2} \ ~{"-2 " + outputRead2} \
${"-0 " + outputRead0} \ ~{"-0 " + outputRead0} \
${"-f " + includeFilter} \ ~{"-f " + includeFilter} \
${"-F " + excludeFilter} \ ~{"-F " + excludeFilter} \
${"-G " + excludeSpecificFilter} \ ~{"-G " + excludeSpecificFilter} \
${true="-N" false="-n" appendReadNumber} \ ~{true="-N" false="-n" appendReadNumber} \
${true="-O" false="" outputQuality} \ ~{true="-O" false="" outputQuality} \
${"-c " + compressionLevel} \ ~{"-c " + compressionLevel} \
${"--threads " + totalThreads} \ ~{"--threads " + totalThreads} \
${inputBam} ~{inputBam}
} }
output { output {
File read1 = outputRead1 File read1 = outputRead1
...@@ -116,31 +126,33 @@ task fastq { ...@@ -116,31 +126,33 @@ task fastq {
} }
task view { task view {
String? preCommand input {
File inFile String? preCommand
File? referenceFasta File inFile
String outputFileName File? referenceFasta
Boolean? outputBam String outputFileName
Boolean? uncompressedBamOutput Boolean? outputBam
Int? includeFilter Boolean? uncompressedBamOutput
Int? excludeFilter Int? includeFilter
Int? excludeSpecificFilter Int? excludeFilter
Int? threads Int? excludeSpecificFilter
Int? memory Int? threads
Int? memory
}
command { command {
set -e -o pipefail set -e -o pipefail
${preCommand} ~{preCommand}
samtools view \ samtools view \
${"-T " + referenceFasta} \ ~{"-T " + referenceFasta} \
${"-o " + outputFileName} \ ~{"-o " + outputFileName} \
${true="-b " false="" outputBam} \ ~{true="-b " false="" outputBam} \
${true="-u " false="" uncompressedBamOutput} \ ~{true="-u " false="" uncompressedBamOutput} \
${"-f " + includeFilter} \ ~{"-f " + includeFilter} \
${"-F " + excludeFilter} \ ~{"-F " + excludeFilter} \
${"-G " + excludeSpecificFilter} \ ~{"-G " + excludeSpecificFilter} \
${"--threads " + threads - 1} \ ~{"--threads " + threads - 1} \
${inFile} ~{inFile}
} }
output { output {
......
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