def make_salmon_index(args): print("salmon ref index is not detected, now creating...") os.makedirs("/local_volume/tmp_fa/", exist_ok=True) subprocess.run([ "wget", "--quite", "--quota=0", "-O", "/local_volume/tmp_fa/salmon_ref.fa.gz", args.salmon_ref_dl ]) subprocess.run(["gunzip", "/local_volume/tmp_fa/salmon_ref.fa.gz"]) salmon_index_cmd = Command("salmon index") salmon_index_cmd_params = { "-t": "/local_volume/tmp_fa/salmon_ref.fa", "-i": "/local_volume/salmon_ref_index" } salmon_index_cmd.parse_params_dict(salmon_index_cmd_params) salmon_index_cmd.run() shutil.rmtree("/local_volume/tmp_fa")
from function import Command, update_params import argparse parser = argparse.ArgumentParser() parser.add_argument("--fastqc", nargs="*") args = parser.parse_args() fastqc_dict = {"-o": "test", "-t": "2", "-k": "7", "": "FILENAME"} fastqc_command = Command("fastqc") fastqc_command.parse_params_dict(fastqc_dict) print(fastqc_command) update_fastqc_params = args.fastqc updated_dict = update_params(fastqc_dict, update_fastqc_params) fastqc_command.parse_params_dict(updated_dict) print(updated_dict)