Skip to content
Snippets Groups Projects
Commit ca18e055 authored by JasperBoom's avatar JasperBoom
Browse files

Add Centrifuge specific Krona task.

parent 7ba4c125
No related branches found
No related tags found
No related merge requests found
...@@ -296,45 +296,100 @@ task DownloadTaxonomy { ...@@ -296,45 +296,100 @@ task DownloadTaxonomy {
task Kreport { task Kreport {
input { input {
String? preCommand File centrifugeClassification
File centrifugeOut String outputPrefix
Boolean inputIsCompressed Array[File]+ indexFiles
String outputDir Boolean noLCA = false
String suffix = "kreport" Boolean showZeros = false
String prefix = "centrifuge" Boolean isCountTable = false
String indexPrefix
Boolean? onlyUnique ## removed in 1.0.4 Int? minimumScore
Boolean? showZeros Int? minimumLength
Boolean? isCountTable
Int? minScore
Int? minLength
Int cores = 1
String memory = "4G" String memory = "4G"
String dockerImage = "quay.io/biocontainers/centrifuge:1.0.4_beta--he860b03_3"
} }
String kreportFilePath = outputDir + "/" + prefix + "." + suffix command <<<
command { set -e
set -e -o pipefail mkdir -p "$(dirname ~{outputPrefix})"
~{preCommand} indexBasename="$(basename ~{sub(indexFiles[0], "\.[0-9]\.cf", "")})"
for file in ~{sep=" " indexFiles}
do
ln ${file} $PWD/"$(basename ${file})"
done
centrifuge-kreport \ centrifuge-kreport \
-x ~{indexPrefix} \ -x $PWD/${indexBasename} \
~{true="--only-unique" false="" onlyUnique} \ ~{true="--no-lca" false="" noLCA} \
~{true="--show-zeros" false="" showZeros} \ ~{true="--show-zeros" false="" showZeros} \
~{true="--is-count-table" false="" isCountTable} \ ~{true="--is-count-table" false="" isCountTable} \
~{"--min-score " + minScore} \ ~{"--min-score " + minimumScore} \
~{"--min-length " + minLength} \ ~{"--min-length " + minimumLength} \
~{true="<(zcat" false="" inputIsCompressed} ~{centrifugeOut}\ ~{centrifugeClassification} \
~{true=")" false="" inputIsCompressed} \ > ~{outputPrefix + "_kreport.tsv"}
> ~{kreportFilePath} >>>
output {
File outputKreport = outputPrefix + "_kreport.tsv"
}
runtime {
memory: memory
docker: dockerImage
}
parameter_meta {
# inputs
centrifugeClassification: {description: "File with Centrifuge classification results.", category: "required"}
outputPrefix: {description: "Output directory path + output file prefix.", category: "required"}
indexFiles: {description: "The files of the index for the reference genomes.", category: "required"}
noLCA: {description: "Do not report the LCA of multiple assignments, but report count fractions at the taxa.", category: "advanced"}
showZeros: {description: "Show clades that have zero reads.", category: "advanced"}
isCountTable: {description: "The format of the file is taxID<tab>COUNT.", category: "advanced"}
minimumScore: {description: "Require a minimum score for reads to be counted.", category: "advanced"}
minimumLength: {description: "Require a minimum alignment length to the read.", 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"}
# outputs
outputKreport: {description: "File with kraken style report."}
}
}
task KTimportTaxonomy {
input {
File inputFile
String outputPrefix
String memory = "4G"
String dockerImage = "quay.io/biocontainers/krona:2.7.1--pl526_1"
}
command {
set -e
mkdir -p "$(dirname ~{outputPrefix})"
cat ~{inputFile} | cut -f 1,3 > kronaInput.krona
ktImportTaxonomy kronaInput.krona
cp taxonomy.krona.html ~{outputPrefix + "_krona.html"}
} }
output { output {
File kreport = kreportFilePath File outputKronaPlot = outputPrefix + "_krona.html"
} }
runtime { runtime {
cpu: cores
memory: memory memory: memory
docker: dockerImage
}
parameter_meta {
# inputs
inputFile: {description: "File with Centrifuge classification results.", category: "required"}
outputPrefix: {description: "Output directory path + output file prefix.", category: "required"}
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"}
# outputs
outputKronaPlot: {description: "Krona taxonomy plot html 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