Skip to content

Commit

Permalink
Merge a3a94a4 into 23de91e
Browse files Browse the repository at this point in the history
  • Loading branch information
notestaff committed Mar 20, 2020
2 parents 23de91e + a3a94a4 commit 76ca57f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pipes/WDL/workflows/tasks/tasks_assembly.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ task refine_2x_and_plot {
if [[ ${gatk_jar} == *.tar.bz2 ]]; then
tar -xjvof ${gatk_jar} -C gatk
# find the jar and move it one level up if it is buried in a subdir
find gatk -mindepth 1 -type f -iname '*.jar' | xargs -I__ mv -f "__" gatk/
find gatk -mindepth 2 -type f -iname '*.jar' | xargs -I__ mv -f "__" gatk/
else
ln -s ${gatk_jar} gatk/GenomeAnalysisTK.jar
fi
Expand Down
11 changes: 9 additions & 2 deletions tools/gatk.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import logging
import os
import os.path
import re
import subprocess
import tempfile

Expand Down Expand Up @@ -76,6 +77,11 @@ def version(self):
self._get_tool_version()
return self.tool_version

def version_tuple(self):
version_match = re.match(r'(\d+)\.(\d+)', self.version())
util.misc.chk(version_match, 'Cannot parse GATK version: {}'.format(self.version()))
return tuple(map(int, version_match.groups()))

def _get_tool_version(self):
if self.install_and_get_path().endswith(".jar"):
cmd = [
Expand All @@ -87,7 +93,8 @@ def _get_tool_version(self):
self.install_and_get_path(), '--version'
]

self.tool_version = util.misc.run_and_print(cmd, buffered=False, silent=True).stdout.decode("utf-8").strip()
self.tool_version = util.misc.run_and_print(cmd, buffered=False, silent=True,
stderr=subprocess.DEVNULL).stdout.decode("utf-8").strip()

def ug(self, inBam, refFasta, outVcf, options=None, JVMmemory=None, threads=None):
options = options or ["--min_base_quality_score", 15, "-ploidy", 4]
Expand All @@ -105,7 +112,7 @@ def ug(self, inBam, refFasta, outVcf, options=None, JVMmemory=None, threads=None
'--num_threads', threads,
'-A', 'AlleleBalance',
]
if TOOL_VERSION_TUPLE < (3, 7):
if self.version_tuple() < (3, 7):
opts += ['-stand_call_conf', 0, '-stand_emit_conf', 0] # deprecated in 3.7+

self.execute('UnifiedGenotyper', opts + options, JVMmemory=JVMmemory)
Expand Down

0 comments on commit 76ca57f

Please sign in to comment.