Skip to content
Snippets Groups Projects
Unverified Commit 94e54514 authored by Ruben Vorderman's avatar Ruben Vorderman Committed by GitHub
Browse files

Merge pull request #173 from biowdl/BIOWDL-387

Add bedtools intersect and text to file task.
parents d8f269b9 18093a4e
No related branches found
No related tags found
No related merge requests found
...@@ -11,6 +11,10 @@ that users understand how the changes affect the new version. ...@@ -11,6 +11,10 @@ that users understand how the changes affect the new version.
version 2.2.0-dev version 2.2.0-dev
--------------------------- ---------------------------
+ Add common.TextToFile task.
+ Add bedtools.Intersect.
+ Add `-o pipefail` to bedtools.MergeBedFiles to prevent errors in BED files
from going unnoticed.
+ Centrifuge: Fix -1/-U options for single end data. + Centrifuge: Fix -1/-U options for single end data.
+ Add bedtools.Complement, bedtools.Merge, and add a task to combine multiple + Add bedtools.Complement, bedtools.Merge, and add a task to combine multiple
bed files called bedtools.MergeBedFiles. This task combines bedtools merge bed files called bedtools.MergeBedFiles. This task combines bedtools merge
......
...@@ -102,6 +102,7 @@ task MergeBedFiles { ...@@ -102,6 +102,7 @@ task MergeBedFiles {
# A sorted bed is needed for bedtools merge # A sorted bed is needed for bedtools merge
command { command {
set -e -o pipefail
cat ~{sep=" " bedFiles} | bedtools sort | bedtools merge > ~{outputBed} cat ~{sep=" " bedFiles} | bedtools sort | bedtools merge > ~{outputBed}
} }
...@@ -163,3 +164,49 @@ task Sort { ...@@ -163,3 +164,49 @@ task Sort {
docker: dockerImage docker: dockerImage
} }
} }
task Intersect {
input {
File regionsA
File regionsB
# Giving a faidx file will set the sorted option.
File? faidx
String outputBed = "intersect.bed"
String dockerImage = "quay.io/biocontainers/bedtools:2.23.0--hdbcaa40_3"
}
Boolean sorted = defined(faidx)
command {
set -e
~{"cut -f1,2 " + faidx} ~{true="> sorted.genome" false ="" sorted}
bedtools intersect \
-a ~{regionsA} \
-b ~{regionsB} \
~{true="-sorted" false="" sorted} \
~{true="-g sorted.genome" false="" sorted} \
> ~{outputBed}
}
output {
File intersectedBed = outputBed
}
runtime {
docker: dockerImage
}
parameter_meta {
faidx: {description: "The fasta index (.fai) file that is used to create the genome file required for sorted output. Implies sorted option.",
category: "common"}
regionsA: {description: "Region file a to intersect",
category: "required"}
regionsB: {description: "Region file b to intersect",
category: "required"}
outputBed: {description: "The path to write the output to",
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"
}
}
}
...@@ -158,6 +158,34 @@ task StringArrayMd5 { ...@@ -158,6 +158,34 @@ task StringArrayMd5 {
} }
} }
task TextToFile {
input {
String text
String outputFile = "out.txt"
String dockerImage = "debian@sha256:f05c05a218b7a4a5fe979045b1c8e2a9ec3524e5611ebfdd0ef5b8040f9008fa"
}
command <<<
echo $'~{text}' > ~{outputFile}
>>>
output {
File out = outputFile
}
parameter_meta {
text: {description: "The text to print", category: "required"}
outputFile: {description: "The name of the output 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"}
}
runtime {
memory: "1G"
docker: dockerImage
}
}
task YamlToJson { task YamlToJson {
input { input {
File yaml File yaml
......
...@@ -342,8 +342,10 @@ task HaplotypeCallerGvcf { ...@@ -342,8 +342,10 @@ task HaplotypeCallerGvcf {
parameter_meta { parameter_meta {
inputBams: {description: "The BAM files on which to perform variant calling.", category: "required"} inputBams: {description: "The BAM files on which to perform variant calling.", category: "required"}
inputBamsIndex: {description: "The indexes for the input BAM files.", category: "required"} inputBamsIndex: {description: "The indexes for the input BAM files.", category: "required"}
intervalList: {description: "Bed files or interval lists describing the regions to operate on.", category: "required"} intervalList: {description: "Bed files or interval lists describing the regions to operate on.", category: "common"}
excludeIntervalList: {description: "Bed files or interval lists describing the regions to NOT operate on.", category: "common"}
gvcfPath: {description: "The location to write the output GVCF to.", category: "required"} gvcfPath: {description: "The location to write the output GVCF to.", category: "required"}
ploidy: {description: "The ploidy with which the variants should be called.", category: "common"}
referenceFasta: {description: "The reference fasta file which was also used for mapping.", referenceFasta: {description: "The reference fasta file which was also used for mapping.",
category: "required"} category: "required"}
referenceFastaDict: {description: "The sequence dictionary associated with the reference fasta file.", referenceFastaDict: {description: "The sequence dictionary associated with the reference fasta file.",
......
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