Skip to content

Commit 8e60298

Browse files
committed
use default python
1 parent 631be05 commit 8e60298

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

utils.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
JAVA_XMX = "-Xmx"
1414
DEFAULT_JAVA = os.path.realpath(os.path.join(MY_DIR, "opt",
1515
"jdk1.8.0_131", "bin", "java"))
16+
DEFAULT_PYTHON = os.path.realpath(os.path.join(MY_DIR, "opt", "miniconda2", "bin", "python"))
1617
COMBINE_KEEP_ALL_DUPLICATE = 1
1718
COMBINE_KEEP_FIRST_DUPLICATE = 2
1819
COMBINE_KEEP_NO_DUPLICATE = 3
@@ -25,6 +26,14 @@ def get_java(java = "java"):
2526
return DEFAULT_JAVA
2627
return java
2728

29+
def get_python(python = "python"):
30+
'''
31+
return default python if it exists
32+
'''
33+
if os.path.isfile(DEFAULT_PYTHON):
34+
return DEFAULT_PYTHON
35+
return python
36+
2837
def count_variants(vcf):
2938
'''
3039
count number of variants

varsim_somatic.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ def varsim_somatic_main():
5252
main_parser.add_argument("--keep_temp", action="store_true", help="Keep temporary files")
5353
main_parser.add_argument("--java_max_mem", metavar="XMX", help="max java memory", default="10g", type = str)
5454
main_parser.add_argument("--java", metavar="PATH", help="path to java", default="java", type = str)
55+
main_parser.add_argument("--python", metavar="PATH", help="path to python", default="python", type = str)
5556
main_parser.add_argument('--version', action='version', version=get_version())
5657

5758

@@ -178,7 +179,8 @@ def varsim_somatic_main():
178179
elif args.simulator == "art" and args.art_options:
179180
other_varsim_opts += ["--art_options", args.art_options]
180181

181-
varsim_command = ["python", os.path.realpath(VARSIM_PY),
182+
args.python = utils.get_python(args.python)
183+
varsim_command = [args.python, os.path.realpath(VARSIM_PY),
182184
"--out_dir", str(os.path.realpath(args.out_dir)),
183185
"--work_dir", str(os.path.realpath(args.work_dir)),
184186
"--log_dir", str(os.path.realpath(os.path.join(args.log_dir, "varsim"))),

0 commit comments

Comments
 (0)