Skip to content
Snippets Groups Projects
Commit 27f54c49 authored by pjvan_thof's avatar pjvan_thof
Browse files

Added picard as a non jar command

parent c0bbdd8c
No related branches found
No related tags found
No related merge requests found
...@@ -2,17 +2,22 @@ task ScatterIntervalList { ...@@ -2,17 +2,22 @@ task ScatterIntervalList {
String? preCommand String? preCommand
File interval_list File interval_list
Int scatter_count Int scatter_count
String picard_jar String? picardJar
Float? memory Float? memory
Float? memoryMultiplier Float? memoryMultiplier
Int mem = ceil(select_first([memory, 4.0])) Int mem = ceil(select_first([memory, 4.0]))
String toolCommand = if defined(picardJar)
then "java -Xmx" + mem + "G -jar " + picardJar
else "gatk -Xmx" + mem + "G"
command { command {
set -e -o pipefail set -e -o pipefail
${preCommand} ${preCommand}
mkdir scatter_list mkdir scatter_list
java -Xmx${mem}G -jar ${picard_jar} \ ${toolCommand} \
IntervalListTools \ IntervalListTools \
SCATTER_COUNT=${scatter_count} \ SCATTER_COUNT=${scatter_count} \
SUBDIVISION_MODE=BALANCING_WITHOUT_INTERVAL_SUBDIVISION_WITH_OVERFLOW \ SUBDIVISION_MODE=BALANCING_WITHOUT_INTERVAL_SUBDIVISION_WITH_OVERFLOW \
...@@ -38,17 +43,21 @@ task GatherBamFiles { ...@@ -38,17 +43,21 @@ task GatherBamFiles {
Array[File]+ input_bams Array[File]+ input_bams
String output_bam_path String output_bam_path
Int? compression_level Int? compression_level
String picard_jar String? picardJar
Float? memory Float? memory
Float? memoryMultiplier Float? memoryMultiplier
Int mem = ceil(select_first([memory, 4.0])) Int mem = ceil(select_first([memory, 4.0]))
String toolCommand = if defined(picardJar)
then "java -Xmx" + mem + "G -jar " + picardJar
else "gatk -Xmx" + mem + "G"
command { command {
set -e -o pipefail set -e -o pipefail
${preCommand} ${preCommand}
java ${"-Dsamjdk.compression_level=" + compression_level} \ ${toolCommand} \
-Xmx${mem}G -jar ${picard_jar} \
GatherBamFiles \ GatherBamFiles \
INPUT=${sep=' INPUT=' input_bams} \ INPUT=${sep=' INPUT=' input_bams} \
OUTPUT=${output_bam_path} \ OUTPUT=${output_bam_path} \
...@@ -74,7 +83,7 @@ task MarkDuplicates { ...@@ -74,7 +83,7 @@ task MarkDuplicates {
String output_bam_path String output_bam_path
String metrics_path String metrics_path
Int? compression_level Int? compression_level
String picard_jar String? picardJar
Float? memory Float? memory
Float? memoryMultiplier Float? memoryMultiplier
...@@ -88,12 +97,16 @@ task MarkDuplicates { ...@@ -88,12 +97,16 @@ task MarkDuplicates {
# This works because the output of BWA is query-grouped and therefore, so is the output of MergeBamAlignment. # This works because the output of BWA is query-grouped and therefore, so is the output of MergeBamAlignment.
# While query-grouped isn't actually query-sorted, it's good enough for MarkDuplicates with ASSUME_SORT_ORDER="queryname" # While query-grouped isn't actually query-sorted, it's good enough for MarkDuplicates with ASSUME_SORT_ORDER="queryname"
Int mem = ceil(select_first([memory, 4.0])) Int mem = ceil(select_first([memory, 4.0]))
String toolCommand = if defined(picardJar)
then "java -Xmx" + mem + "G -jar " + picardJar
else "gatk -Xmx" + mem + "G"
command { command {
set -e -o pipefail set -e -o pipefail
${preCommand} ${preCommand}
mkdir -p $(dirname ${output_bam_path}) mkdir -p $(dirname ${output_bam_path})
java ${"-Dsamjdk.compression_level=" + compression_level} \ ${toolCommand} \
-Xmx${mem}G -jar ${picard_jar} \
MarkDuplicates \ MarkDuplicates \
INPUT=${sep=' INPUT=' input_bams} \ INPUT=${sep=' INPUT=' input_bams} \
OUTPUT=${output_bam_path} \ OUTPUT=${output_bam_path} \
...@@ -124,7 +137,7 @@ task MergeVCFs { ...@@ -124,7 +137,7 @@ task MergeVCFs {
Array[File] inputVCFsIndexes Array[File] inputVCFsIndexes
String outputVCFpath String outputVCFpath
Int? compressionLevel Int? compressionLevel
String picardJar String? picardJar
Float? memory Float? memory
Float? memoryMultiplier Float? memoryMultiplier
...@@ -132,11 +145,15 @@ task MergeVCFs { ...@@ -132,11 +145,15 @@ task MergeVCFs {
# Using MergeVcfs instead of GatherVcfs so we can create indices # Using MergeVcfs instead of GatherVcfs so we can create indices
# See https://github.com/broadinstitute/picard/issues/789 for relevant GatherVcfs ticket # See https://github.com/broadinstitute/picard/issues/789 for relevant GatherVcfs ticket
Int mem = ceil(select_first([memory, 4.0])) Int mem = ceil(select_first([memory, 4.0]))
String toolCommand = if defined(picardJar)
then "java -Xmx" + mem + "G -jar " + picardJar
else "gatk -Xmx" + mem + "G"
command { command {
set -e -o pipefail set -e -o pipefail
${preCommand} ${preCommand}
java ${"-Dsamjdk.compression_level=" + compressionLevel} \ ${toolCommand} \
-Xmx${mem}G -jar ${picardJar} \
MergeVcfs \ MergeVcfs \
INPUT=${sep=' INPUT=' inputVCFs} \ INPUT=${sep=' INPUT=' inputVCFs} \
OUTPUT=${outputVCFpath} OUTPUT=${outputVCFpath}
...@@ -158,17 +175,19 @@ task SamToFastq { ...@@ -158,17 +175,19 @@ task SamToFastq {
String outputRead1 String outputRead1
String? outputRead2 String? outputRead2
String? outputUnpaired String? outputUnpaired
String picard_jar String? picardJar
Float? memory Float? memory
Float? memoryMultiplier Float? memoryMultiplier
Int mem = ceil(select_first([memory, 16.0])) # High memory default to avoid crashes. Int mem = ceil(select_first([memory, 16.0])) # High memory default to avoid crashes.
String toolCommand = if defined(picardJar)
then "java -Xmx" + mem + "G -jar " + picardJar
else "gatk -Xmx" + mem + "G"
command { command {
set -e -o pipefail set -e -o pipefail
${preCommand} ${preCommand}
java \ ${toolCommand} \
-Xmx${mem}G \
-jar ${picard_jar} \
SamToFastq \ SamToFastq \
I=${inputBam} \ I=${inputBam} \
${"FASTQ=" + outputRead1} \ ${"FASTQ=" + outputRead1} \
......
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