Skip to content

Commit

Permalink
disambiguate output filenames of prepared covalent ligand
Browse files Browse the repository at this point in the history
in CLI script, when there are multiple connect_patterns or target res
  • Loading branch information
rwxayheee committed Dec 11, 2024
1 parent b96ea25 commit 4af879a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion meeko/cli/mk_prepare_ligand.py
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,7 @@ def main():
is_after_first = True

if is_covalent:
connect_pattern = 1
for cov_lig in covalent_builder.process(
mol, args.tether_smarts, args.tether_smarts_indices
):
Expand All @@ -672,7 +673,6 @@ def main():
)
chain, res, num = cov_lig.res_id
suffixes = output.get_suffixes(molsetups)
print(f"{suffixes=}")
for molsetup, suffix in zip(molsetups, suffixes):
pdbqt_string, success, error_msg = PDBQTWriterLegacy.write_string(
molsetup,
Expand All @@ -686,11 +686,13 @@ def main():
)
)
name = molsetup.name
output.output_filename = molsetup.name + f"_{connect_pattern}_{chain}_{res}_{num}.pdbqt"
output(pdbqt_string, name, (cov_lig.label, suffix))
else:
nr_failures += 1
this_mol_had_failure = True
print(error_msg, file=sys.stderr)
connect_pattern += 1

else:
try:
Expand Down

0 comments on commit 4af879a

Please sign in to comment.