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

add intersect bed task

parent 2f091247
No related branches found
No related tags found
No related merge requests found
......@@ -164,3 +164,49 @@ task Sort {
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"
}
}
}
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