Skip to content

Commit

Permalink
use arguments from cli to override config, before
Browse files Browse the repository at this point in the history
preparator = MoleculePreparation.from_config(config); minor edits to help msg
  • Loading branch information
rwxayheee committed Dec 5, 2024
1 parent 2bfa6a2 commit c7f0fb4
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions meeko/cli/mk_prepare_ligand.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def cmd_lineparser():
io_group.add_argument(
"--charge_from_prop",
nargs="*",
help="set atom partial charges from the input file. The default is PartialCharge for SDF and _TriposPartialCharge for MOL2 unless overriden by a user defined property name. ",
help="set atom partial charges from an RDKit atom property based on the input file. The default is 'PartialCharge' for SDF and '_TriposPartialCharge' for MOL2 unless overriden by a user defined property name. ",
)
io_group.add_argument(
"-o",
Expand Down Expand Up @@ -555,19 +555,20 @@ def main():
)
nr_failures = 0
is_after_first = False
preparator = MoleculePreparation.from_config(config)

if args.charge_from_prop is not None:
if args.charge_model != "read":
print('--charge_from_prop must be used with --charge_model "read"')
sys.exit(1)

preparator.charge_model = "read"
config["charge_model"] = "read"
if args.charge_from_prop:
preparator.charge_atom_prop = args.charge_from_prop[0]
config["charge_atom_prop"] = args.charge_from_prop[0]
else:
if ext=="mol2":
preparator.charge_atom_prop = "_TriposPartialCharge"
config["charge_atom_prop"] = "_TriposPartialCharge"

preparator = MoleculePreparation.from_config(config)

for mol in mol_supplier:
if is_after_first and output.is_multimol == False:
Expand Down

0 comments on commit c7f0fb4

Please sign in to comment.