diff --git a/src/bundles/match_maker/bundle_info.xml b/src/bundles/match_maker/bundle_info.xml index aaf2187a92..7f05cd2b1f 100644 --- a/src/bundles/match_maker/bundle_info.xml +++ b/src/bundles/match_maker/bundle_info.xml @@ -1,4 +1,4 @@ - diff --git a/src/bundles/match_maker/src/match.py b/src/bundles/match_maker/src/match.py index c75fabd417..10c82705c3 100644 --- a/src/bundles/match_maker/src/match.py +++ b/src/bundles/match_maker/src/match.py @@ -697,6 +697,10 @@ def cmd_match(session, match_atoms, to=None, pairing=defaults["chain_pairing"], # 'to' only needed to sidestep problem with adjacent atom specs... ref_atoms = to + # Ignore child structures (e.g. altlocs, rotamers) of parent structures + match_atoms = _remove_child_models(match_atoms) + ref_atoms = _remove_child_models(ref_atoms) + from chimerax import sim_matrices if matrix not in sim_matrices.matrices(session.logger): raise UserError("No such matrix name: %s" % str(matrix)) @@ -809,6 +813,15 @@ def check_domain_matching(chains, sel_residues): chains = new_chains return chains +def _remove_child_models(atoms): + structures = atoms.structures.unique() + main_structures = set(structures) + for s in structures: + for c in s.all_models(): + if c is not s: + main_structures.discard(c) + return atoms.filter([s in main_structures for s in atoms.structures]) + _registered = False def register_command(logger): global _registered