Newer
Older
import os
import shutil
ROOTPATH = os.path.dirname(os.path.dirname(workflow.snakefile))
sys.path.insert(0, os.path.join(ROOTPATH, "lib"))
os.environ["PYTHONPATH"] = os.path.join(ROOTPATH, "lib")
def get_threads(rule, default):
cluster_config = snakemake.workflow.cluster_config
if rule in cluster_config and "threads" in cluster_config[rule]:
return cluster_config[rule]["threads"]
if "default" in cluster_config and "threads" in cluster_config["default"]:
return cluster_config["default"]["threads"]
return default
def get_perl5lib():
condaprefix = os.environ["CONDA_PREFIX"]
perllibpath = os.path.join(condaprefix, "lib", "perl5")
return perllibpath