Skip to content

Commit

Permalink
began argument parsing for new training pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
chg60 committed Sep 6, 2021
1 parent 0dacbd3 commit c97ca41
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
21 changes: 17 additions & 4 deletions src/depht_utils/pipelines/train_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,26 @@
import pathlib


def parse_args():
def parse_args(unparsed_args=None):
p = argparse.ArgumentParser(description=__doc__)
return p.parse_args()
p.add_argument("-b", "--bact-dir", type=pathlib.Path,
help="path to directory containing bacterial file(s) for "
"training")
p.add_argument("-p", "--phage-dir", type=pathlib.Path,
help="path to directory containing phage file(s) for "
"training")
p.add_argument("-n", "--model-name", type=str,
help="name for the new model (e.g. 'Streptomyces')")

if unparsed_args:
return p.parse_args(unparsed_args)
else:
return p.parse_args()

def main():
pass

def main(unparsed_args=None):
args = parse_args(unparsed_args)
print(args)


if __name__ == "__main__":
Expand Down
6 changes: 4 additions & 2 deletions src/depht_utils/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
from depht_utils.pipelines import (
annotate_gene_clusters, benchmark_output, build_reference_db,
build_functions_db, curate_functions, index_functions, phamerate,
pull_sequences, screen_conserved_phams, train_prophage_model)
pull_sequences, screen_conserved_phams, train_prophage_model, train_model)

# GLOBAL VARIABLES
# -----------------------------------------------------------------------------
PIPELINES = [
"annotate_gene_clusters", "benchmark_output", "build_reference_db",
"build_functions_db", "curate_functions", "index_functions",
"phamerate", "pull_sequences", "screen_conserved_phams",
"train_prophage_model"]
"train_prophage_model", "train_model"]


def main(unparsed_args):
Expand Down Expand Up @@ -40,6 +40,8 @@ def main(unparsed_args):
screen_conserved_phams.main(unparsed_args[1:])
elif args.pipeline == "train_prophage_model":
train_prophage_model.main(unparsed_args[1:])
elif args.pipeline == "train_model":
train_model.main(unparsed_args[1:])
else:
raise NotImplementedError(
f"Prophicient Utility pipeline '{args.build_reference_db}' "
Expand Down

0 comments on commit c97ca41

Please sign in to comment.