Skip to content

Commit

Permalink
Filter out altloc/rotamer models [#16568]
Browse files Browse the repository at this point in the history
  • Loading branch information
e-pettersen committed Jan 29, 2025
1 parent 5d354ae commit 640e1ed
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/bundles/match_maker/bundle_info.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<BundleInfo name="ChimeraX-MatchMaker" version="2.1.6"
<BundleInfo name="ChimeraX-MatchMaker" version="2.1.7"
package="chimerax.match_maker"
minSessionVersion="1" maxSessionVersion="1">

Expand Down
13 changes: 13 additions & 0 deletions src/bundles/match_maker/src/match.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 640e1ed

Please sign in to comment.