Skip to content
Snippets Groups Projects
Commit 9ca8d3c4 authored by pjvan_thof's avatar pjvan_thof
Browse files

all biopet tools now also usable with conda

parent 27f54c49
No related branches found
No related tags found
No related merge requests found
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
task BaseCounter { task BaseCounter {
String? preCommand String? preCommand
File toolJar String? toolJar
File bam File bam
File bamIndex File bamIndex
File refFlat File refFlat
...@@ -12,13 +12,17 @@ task BaseCounter { ...@@ -12,13 +12,17 @@ task BaseCounter {
Float? memory Float? memory
Float? memoryMultiplier Float? memoryMultiplier
Int mem = ceil(select_first([memory, 12.0])) Int mem = ceil(select_first([memory, 4.0]))
String toolCommand = if defined(toolJar)
then "java -Xmx" + mem + "G -jar " +toolJar
else "biopet-basecounter -Xmx" + mem + "G"
command { command {
set -e -o pipefail set -e -o pipefail
mkdir -p ${outputDir} mkdir -p ${outputDir}
${preCommand} ${preCommand}
java -Xmx${mem}G -jar ${toolJar} \ ${toolCommand} \
-b ${bam} \ -b ${bam} \
-r ${refFlat} \ -r ${refFlat} \
-o ${outputDir} \ -o ${outputDir} \
...@@ -67,8 +71,8 @@ task BaseCounter { ...@@ -67,8 +71,8 @@ task BaseCounter {
} }
} }
task extractAdaptersFastqc { task ExtractAdaptersFastqc {
File? toolJar String? toolJar
File inputFile File inputFile
String outputDir String outputDir
String? adapterOutputFilePath = outputDir + "/adapter.list" String? adapterOutputFilePath = outputDir + "/adapter.list"
...@@ -118,14 +122,22 @@ task FastqSplitter { ...@@ -118,14 +122,22 @@ task FastqSplitter {
String? preCommand String? preCommand
File inputFastq File inputFastq
Array[String] outputPaths Array[String] outputPaths
String toolJar String? toolJar
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-fastqsplitter -Xmx" + mem + "G"
command { command {
set -e -o pipefail set -e -o pipefail
${preCommand} ${preCommand}
mkdir -p $(dirname ${sep=') $(dirname ' outputPaths}) mkdir -p $(dirname ${sep=') $(dirname ' outputPaths})
if [ ${length(outputPaths)} -gt 1 ]; then if [ ${length(outputPaths)} -gt 1 ]; then
java -jar ${toolJar} \ ${toolCommand} \
-I ${inputFastq} \ -I ${inputFastq} \
-o ${sep=' -o ' outputPaths} -o ${sep=' -o ' outputPaths}
else else
...@@ -136,6 +148,10 @@ task FastqSplitter { ...@@ -136,6 +148,10 @@ task FastqSplitter {
output { output {
Array[File] chunks = outputPaths Array[File] chunks = outputPaths
} }
runtime {
memory: ceil(mem * select_first([memoryMultiplier, 2.5]))
}
} }
task FastqSync { task FastqSync {
...@@ -146,13 +162,21 @@ task FastqSync { ...@@ -146,13 +162,21 @@ task FastqSync {
File in2 File in2
String out1path String out1path
String out2path String out2path
File toolJar String? toolJar
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-fastqsync -Xmx" + mem + "G"
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 ${toolJar} \ ${toolCommand} \
--in1 ${in1} \ --in1 ${in1} \
--in2 ${in2} \ --in2 ${in2} \
--ref1 ${ref1} \ --ref1 ${ref1} \
...@@ -165,10 +189,14 @@ task FastqSync { ...@@ -165,10 +189,14 @@ task FastqSync {
File out1 = out1path File out1 = out1path
File out2 = out2path File out2 = out2path
} }
runtime {
memory: ceil(mem * select_first([memoryMultiplier, 2.5]))
}
} }
task SampleConfig { task SampleConfig {
File? toolJar String? toolJar
String? preCommand String? preCommand
Array[File]+ inputFiles Array[File]+ inputFiles
String keyFilePath String keyFilePath
...@@ -216,7 +244,7 @@ task ScatterRegions { ...@@ -216,7 +244,7 @@ task ScatterRegions {
File refFasta File refFasta
File refDict File refDict
String outputDirPath String outputDirPath
File toolJar String? toolJar
Int? scatterSize Int? scatterSize
File? regions File? regions
...@@ -224,11 +252,15 @@ task ScatterRegions { ...@@ -224,11 +252,15 @@ task ScatterRegions {
Float? memoryMultiplier Float? memoryMultiplier
Int mem = ceil(select_first([memory, 4.0])) Int mem = ceil(select_first([memory, 4.0]))
String toolCommand = if defined(toolJar)
then "java -Xmx" + mem + "G -jar " +toolJar
else "biopet-scatterregions -Xmx" + mem + "G"
command { command {
set -e -o pipefail set -e -o pipefail
${preCommand} ${preCommand}
mkdir -p ${outputDirPath} mkdir -p ${outputDirPath}
java -Xmx${mem}G -jar ${toolJar} \ ${toolCommand} \
-R ${refFasta} \ -R ${refFasta} \
-o ${outputDirPath} \ -o ${outputDirPath} \
${"-s " + scatterSize} \ ${"-s " + scatterSize} \
......
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