Skip to content
Snippets Groups Projects
Commit cb97a60c authored by Cats's avatar Cats
Browse files

Merge branch 'master' into BIOWDL-25

parents 01f15d00 c966b68a
No related branches found
No related tags found
1 merge request!17Caching related changes
...@@ -12,8 +12,8 @@ task BaseCounter { ...@@ -12,8 +12,8 @@ task BaseCounter {
Float? memory Float? memory
Float? memoryMultiplier Float? memoryMultiplier
Int mem = ceil(select_first([memory, 12.0])) Int mem = ceil(select_first([memory, 12.0]))
command { command {
set -e -o pipefail set -e -o pipefail
mkdir -p ${outputDir} mkdir -p ${outputDir}
...@@ -67,6 +67,53 @@ task BaseCounter { ...@@ -67,6 +67,53 @@ task BaseCounter {
} }
} }
task extractAdaptersFastqc {
File? toolJar
File inputFile
String outputDir
String? adapterOutputFilePath = outputDir + "/adapter.list"
String? contamsOutputFilePath = outputDir + "/contaminations.list"
Boolean? skipContams
File? knownContamFile
File? knownAdapterFile
Float? adapterCutoff
Boolean? outputAsFasta
Float? memory
Float? memoryMultiplier
Int mem = ceil(select_first([memory, 4.0]))
String toolCommand = if defined(toolJar)
then "java -Xmx" + mem + "G -jar " +toolJar
else "biopet-extractadaptersfastqc -Xmx" + mem + "G"
command {
set -e
mkdir -p ${outputDir}
${toolCommand} \
--inputFile ${inputFile} \
${"--adapterOutputFile " + adapterOutputFilePath } \
${"--contamsOutputFile " + contamsOutputFilePath } \
${"--knownContamFile " + knownContamFile} \
${"--knownAdapterFile " + knownAdapterFile} \
${"--adapterCutoff " + adapterCutoff} \
${true="--skipContams" false="" skipContams} \
${true="--outputAsFasta" false="" outputAsFasta}
}
output {
File adapterOutputFile = select_first([adapterOutputFilePath])
File contamsOutputFile = select_first([contamsOutputFilePath])
Array[String] adapterList = read_lines(select_first([adapterOutputFilePath]))
Array[String] contamsList = read_lines(select_first([contamsOutputFilePath]))
}
runtime {
memory: ceil(mem * select_first([memoryMultiplier, 2.5]))
}
}
task FastqSplitter { task FastqSplitter {
String? preCommand String? preCommand
File inputFastq File inputFastq
...@@ -99,12 +146,13 @@ task FastqSync { ...@@ -99,12 +146,13 @@ task FastqSync {
File in2 File in2
String out1path String out1path
String out2path String out2path
File tool_jar File toolJar
command { command {
set -e -o pipefail set -e -o pipefail
${preCommand} ${preCommand}
mkdir -p $(dirname ${out1path}) $(dirname ${out2path}) mkdir -p $(dirname ${out1path}) $(dirname ${out2path})
java -jar ${tool_jar} \ java -jar ${toolJar} \
--in1 ${in1} \ --in1 ${in1} \
--in2 ${in2} \ --in2 ${in2} \
--ref1 ${ref1} \ --ref1 ${ref1} \
...@@ -112,6 +160,7 @@ task FastqSync { ...@@ -112,6 +160,7 @@ task FastqSync {
--out1 ${out1path} \ --out1 ${out1path} \
--out2 ${out2path} --out2 ${out2path}
} }
output { output {
File out1 = out1path File out1 = out1path
File out2 = out2path File out2 = out2path
...@@ -120,7 +169,7 @@ task FastqSync { ...@@ -120,7 +169,7 @@ task FastqSync {
task SampleConfig { task SampleConfig {
String? preCommand String? preCommand
String tool_jar File toolJar
Array[File]+ inputFiles Array[File]+ inputFiles
String keyFilePath String keyFilePath
String? sample String? sample
...@@ -131,13 +180,13 @@ task SampleConfig { ...@@ -131,13 +180,13 @@ task SampleConfig {
Float? memory Float? memory
Float? memoryMultiplier Float? memoryMultiplier
Int mem = ceil(select_first([memory, 4.0])) Int mem = ceil(select_first([memory, 4.0]))
command { command {
set -e -o pipefail set -e -o pipefail
${preCommand} ${preCommand}
mkdir -p . ${"$(dirname " + jsonOutputPath + ")"} ${"$(dirname " + tsvOutputPath + ")"} mkdir -p . ${"$(dirname " + jsonOutputPath + ")"} ${"$(dirname " + tsvOutputPath + ")"}
java -Xmx${mem}G -jar ${tool_jar} \ java -Xmx${mem}G -jar ${toolJar} \
-i ${sep="-i " inputFiles} \ -i ${sep="-i " inputFiles} \
${"--sample " + sample} \ ${"--sample " + sample} \
${"--library " + library} \ ${"--library " + library} \
...@@ -160,23 +209,23 @@ task SampleConfig { ...@@ -160,23 +209,23 @@ task SampleConfig {
task ScatterRegions { task ScatterRegions {
String? preCommand String? preCommand
File ref_fasta File refFasta
File ref_dict File refDict
String outputDirPath String outputDirPath
String tool_jar File toolJar
Int? scatterSize Int? scatterSize
File? regions File? regions
Float? memory Float? memory
Float? memoryMultiplier Float? memoryMultiplier
Int mem = ceil(select_first([memory, 4.0])) Int mem = ceil(select_first([memory, 4.0]))
command { command {
set -e -o pipefail set -e -o pipefail
${preCommand} ${preCommand}
mkdir -p ${outputDirPath} mkdir -p ${outputDirPath}
java -Xmx${mem}G -jar ${tool_jar} \ java -Xmx${mem}G -jar ${toolJar} \
-R ${ref_fasta} \ -R ${refFasta} \
-o ${outputDirPath} \ -o ${outputDirPath} \
${"-s " + scatterSize} \ ${"-s " + scatterSize} \
${"-L " + regions} ${"-L " + regions}
......
# Copyright Sequencing Analysis Support Core - Leiden University Medical Center 2018 # Copyright Sequencing Analysis Support Core - Leiden University Medical Center 2018
# #
# Tasks from centrifuge # Tasks from centrifuge
task build { task Build {
File conversionTable File conversionTable
File taxonomyTree File taxonomyTree
File inputFasta File inputFasta
...@@ -22,9 +21,10 @@ task build { ...@@ -22,9 +21,10 @@ task build {
File? nameTable File? nameTable
File? sizeTable File? sizeTable
Int? seed Int? seed
Int? kmerCount
Int? threads Int? threads
Int? memory Int? memory
Int? kmerCount
command { command {
set -e -o pipefail set -e -o pipefail
...@@ -56,25 +56,28 @@ task build { ...@@ -56,25 +56,28 @@ task build {
} }
} }
task classify { task Classify {
String outputDir String outputDir
Boolean? compressOutput = true Boolean? compressOutput = true
String? preCommand String? preCommand
String indexPrefix String indexPrefix
File? unpairedReads Array[File]? unpairedReads
File read1 Array[File]+ read1
File? read2 Array[File]? read2
Boolean? fastaInput Boolean? fastaInput
# Variables for handling output # Variables for handling output
String outputFileName = outputDir + "/centrifuge.out" String outputFilePath = outputDir + "/centrifuge.out"
String reportFileName = outputDir + "/centrifuge_report.tsv" String reportFilePath = outputDir + "/centrifuge_report.tsv"
String finalOutputName = if (compressOutput == true) then outputFileName + ".gz" else outputFileName String finalOutputPath = if (compressOutput == true)
String? metFileName # If this is specified, the report file is empty then outputFilePath + ".gz"
else outputFilePath
String? metFilePath # If this is specified, the report file is empty
Int? assignments Int? assignments
Int? minHitLen Int? minHitLen
Int? minTotalLen Int? minTotalLen
Array[String]? hostTaxIds Array[String]? hostTaxIds
Array[String]? excludeTaxIds Array[String]? excludeTaxIds
Int? threads Int? threads
Int? memory Int? memory
...@@ -86,22 +89,22 @@ task classify { ...@@ -86,22 +89,22 @@ task classify {
${"-p " + threads} \ ${"-p " + threads} \
${"-x " + indexPrefix} \ ${"-x " + indexPrefix} \
${true="-f" false="" fastaInput} \ ${true="-f" false="" fastaInput} \
${true="-k " false="" defined(assignments)} ${assignments} \ ${true="-k" false="" defined(assignments)} ${assignments} \
${true="-1 " false="-U " defined(read2)} ${read1} \ ${true="-1" false="-U" defined(read2)} ${sep=',' read1} \
${"-2 " + read2} \ ${true="-2" false="" defined(read2)} ${sep=',' read2} \
${"-U " + unpairedReads} \ ${true="-U" false="" defined(unpairedReads)} ${sep=',' unpairedReads} \
${"--report-file " + reportFileName} \ ${"--report-file " + reportFilePath} \
${"--min-hitlen " + minHitLen} \ ${"--min-hitlen " + minHitLen} \
${"--min-totallen " + minTotalLen} \ ${"--min-totallen " + minTotalLen} \
${"--met-file " + metFileName} \ ${"--met-file " + metFilePath} \
${true="--host-taxids " false="" defined(hostTaxIds)} ${sep=',' hostTaxIds} \ ${true="--host-taxids " false="" defined(hostTaxIds)} ${sep=',' hostTaxIds} \
${true="--exclude-taxids " false="" defined(excludeTaxIds)} ${sep=',' excludeTaxIds} \ ${true="--exclude-taxids " false="" defined(excludeTaxIds)} ${sep=',' excludeTaxIds} \
${true="| gzip -c >" false="-S" compressOutput} ${finalOutputName} ${true="| gzip -c >" false="-S" compressOutput} ${finalOutputPath}
} }
output { output {
File classifiedReads = finalOutputName File classifiedReads = finalOutputPath
File reportFile = reportFileName File reportFile = reportFilePath
} }
runtime { runtime {
...@@ -110,7 +113,7 @@ task classify { ...@@ -110,7 +113,7 @@ task classify {
} }
} }
task download { task Download {
String libraryPath String libraryPath
Array[String]? domain Array[String]? domain
String? executable = "centrifuge-download" String? executable = "centrifuge-download"
...@@ -153,10 +156,11 @@ task download { ...@@ -153,10 +156,11 @@ task download {
} }
} }
task downloadTaxonomy { task DownloadTaxonomy {
String centrifugeTaxonomyDir String centrifugeTaxonomyDir
String? executable = "centrifuge-download" String? executable = "centrifuge-download"
String? preCommand String? preCommand
command { command {
set -e -o pipefail set -e -o pipefail
${preCommand} ${preCommand}
...@@ -164,23 +168,28 @@ task downloadTaxonomy { ...@@ -164,23 +168,28 @@ task downloadTaxonomy {
-o ${centrifugeTaxonomyDir} \ -o ${centrifugeTaxonomyDir} \
taxonomy taxonomy
} }
output { output {
File taxonomyTree = centrifugeTaxonomyDir + "/nodes.dmp" File taxonomyTree = centrifugeTaxonomyDir + "/nodes.dmp"
File nameTable = centrifugeTaxonomyDir + "/names.dmp" File nameTable = centrifugeTaxonomyDir + "/names.dmp"
} }
} }
task kreport { task Kreport {
String? preCommand String? preCommand
File centrifugeOut File centrifugeOut
Boolean inputIsCompressed Boolean inputIsCompressed
String kreportFileName=sub(centrifugeOut, "\\.out$|\\.out\\.gz$", "\\.kreport") String outputDir
String? suffix = "kreport"
String? prefix = "centrifuge"
String kreportFilePath = outputDir + "/" + prefix + "." + suffix
String indexPrefix String indexPrefix
Boolean? onlyUnique Boolean? onlyUnique
Boolean? showZeros Boolean? showZeros
Boolean? isCountTable Boolean? isCountTable
Int? minScore Int? minScore
Int? minLength Int? minLength
Int? cores Int? cores
Int? memory Int? memory
...@@ -196,11 +205,11 @@ task kreport { ...@@ -196,11 +205,11 @@ task kreport {
${"--min-length " + minLength} \ ${"--min-length " + minLength} \
${true="<(zcat" false="" inputIsCompressed} ${centrifugeOut}\ ${true="<(zcat" false="" inputIsCompressed} ${centrifugeOut}\
${true=")" false="" inputIsCompressed} \ ${true=")" false="" inputIsCompressed} \
> ${kreportFileName} > ${kreportFilePath}
} }
output { output {
File kreport = kreportFileName File kreport = kreportFilePath
} }
runtime { runtime {
......
...@@ -55,48 +55,6 @@ task fastqc { ...@@ -55,48 +55,6 @@ task fastqc {
} }
} }
task extractAdapters {
File extractAdaptersFastqcJar
File inputFile
String outputDir
String? adapterOutputFilePath = outputDir + "/adapter.list"
String? contamsOutputFilePath = outputDir + "/contaminations.list"
Boolean? skipContams
File? knownContamFile
File? knownAdapterFile
Float? adapterCutoff
Boolean? outputAsFasta
Float? memory
Float? memoryMultiplier
Int mem = ceil(select_first([memory, 4.0]))
command {
set -e
mkdir -p ${outputDir}
java -Xmx${mem}G -jar ${extractAdaptersFastqcJar} \
--inputFile ${inputFile} \
${"--adapterOutputFile " + adapterOutputFilePath } \
${"--contamsOutputFile " + contamsOutputFilePath } \
${"--knownContamFile " + knownContamFile} \
${"--knownAdapterFile " + knownAdapterFile} \
${"--adapterCutoff " + adapterCutoff} \
${true="--skipContams" false="" skipContams} \
${true="--outputAsFasta" false="" outputAsFasta}
}
output {
File adapterOutputFile = select_first([adapterOutputFilePath])
File contamsOutputFile = select_first([contamsOutputFilePath])
Array[String] adapterList = read_lines(select_first([adapterOutputFilePath]))
Array[String] contamsList = read_lines(select_first([contamsOutputFilePath]))
}
runtime {
memory: ceil(mem * select_first([memoryMultiplier, 2.5]))
}
}
task getConfiguration { task getConfiguration {
String? preCommand String? preCommand
String? fastqcDirFile = "fastqcDir.txt" String? fastqcDirFile = "fastqcDir.txt"
......
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