forked from oist/optinist
-
Notifications
You must be signed in to change notification settings - Fork 3
/
run_cluster.py
35 lines (27 loc) · 962 Bytes
/
run_cluster.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import argparse
import os
import shutil
from snakemake import snakemake
from studio.app.common.core.utils.filepath_creater import join_filepath
from studio.app.dir_path import DIRPATH
def main(args):
# copy config file
if args.config is not None:
shutil.copyfile(
args.config,
join_filepath([DIRPATH.STUDIO_DIR, DIRPATH.SNAKEMAKE_CONFIG_YML]),
)
snakemake(
DIRPATH.SNAKEMAKE_FILEPATH,
forceall=args.forceall,
cores=args.cores,
use_conda=args.use_conda,
workdir=f"{os.path.dirname(DIRPATH.STUDIO_DIR)}",
)
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="optinist")
parser.add_argument("--cores", type=int, default=2)
parser.add_argument("--forceall", action="store_true")
parser.add_argument("--use_conda", action="store_true")
parser.add_argument("--config", type=str, default=None)
main(parser.parse_args())