Skip to content

Commit

Permalink
Fix issue #56
Browse files Browse the repository at this point in the history
  • Loading branch information
jamaliki committed Nov 27, 2023
1 parent d76933c commit 04f83e5
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 5 deletions.
10 changes: 9 additions & 1 deletion model_angelo/apps/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,15 @@ def main(parsed_args):
gnn_infer_args.write_hmm_profiles = False
gnn_infer_args.refine = False

gnn_infer_args.aggressive_pruning = True
if i == total_gnn_rounds - 1:
if parsed_args.config_path is None:
gnn_infer_args.aggressive_pruning = True
else:
gnn_infer_args.aggressive_pruning = config["gnn_infer_args"][
"aggressive_pruning"
]
else:
gnn_infer_args.aggressive_pruning = False

logger.info(
f"GNN model refinement round {i + 1} with args: {gnn_infer_args}"
Expand Down
11 changes: 9 additions & 2 deletions model_angelo/apps/build_no_seq.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,14 @@ def main(parsed_args):
gnn_infer_args.refine = False

if i == total_gnn_rounds - 1:
gnn_infer_args.aggressive_pruning = True
if parsed_args.config_path is None:
gnn_infer_args.aggressive_pruning = True
else:
gnn_infer_args.aggressive_pruning = config["gnn_infer_args"][
"aggressive_pruning"
]
else:
gnn_infer_args.aggressive_pruning = False

logger.info(
f"GNN model refinement round {i + 1} with args: {gnn_infer_args}"
Expand Down Expand Up @@ -225,7 +232,7 @@ def main(parsed_args):
print(
f"The HMM profiles are available in the directory: {hmm_profiles_dst}\n"
f"They are named according to the chains found in {raw_file_dst}\n"
f"For example, chain A's profile is in {os.path.join(hmm_profiles_dst, 'A.hmm')}"
f"For example, chain A's profile is in {os.path.join(hmm_profiles_dst, 'A_u.hmm')}"
)
print(
f"You can use model_angelo hmm_search to search these HMM profiles against a database"
Expand Down
1 change: 1 addition & 0 deletions model_angelo/apps/hmm_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ def main(parsed_args):

os.makedirs(parsed_args.output_dir, exist_ok=True)

hmms = [(k.split("_")[0], v) for k, v in hmms]
pruned_hmms = [k for k in hmms if k[1].alphabet == alphabet]

try:
Expand Down
9 changes: 7 additions & 2 deletions model_angelo/apps/refine.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,12 @@ def main(parsed_args):
gnn_infer_args.write_hmm_profiles = parsed_args.write_hmm_profiles
gnn_infer_args.refine = True

gnn_infer_args.aggressive_pruning = True
if parsed_args.config_path is None:
gnn_infer_args.aggressive_pruning = True
else:
gnn_infer_args.aggressive_pruning = config["gnn_infer_args"][
"aggressive_pruning"
]

logger.info(f"GNN model refinement round with args: {gnn_infer_args}")
gnn_output = gnn_infer(gnn_infer_args)
Expand Down Expand Up @@ -217,7 +222,7 @@ def main(parsed_args):
print(
f"The HMM profiles are available in the directory: {hmm_profiles_dst}\n"
f"They are named according to the chains found in {file_dst}\n"
f"For example, chain A's profile is in {os.path.join(hmm_profiles_dst, 'A.hmm')}"
f"For example, chain A's profile is in {os.path.join(hmm_profiles_dst, 'A_u.hmm')}"
)
print(
f"You can use model_angelo hmm_search to search these HMM profiles against a database"
Expand Down

0 comments on commit 04f83e5

Please sign in to comment.