On Apr 29, 2025, at 1:00 AM, Enrico Martinez <jmsstarlight@gmail.com> wrote:Hi Eric !Sorry I forgot to copy the executing line. Basically, this script just compare chain IDs and remove unmatched cases which is abit trivialchains1 = {chain.chain_id for chain in m1.chains}chains2 = {chain.chain_id for chain in m2.chains}unmatched = chains1 - chains2In my next version I tried to use matchmaker to compare the structures and remove unmatched chains using the rmsd threshold > 5 A (I calculate rmsd usingreturn np.sqrt(np.mean(np.sum(diff * diff, axis=1)))I tested it using several pdb pairs but it always entirely removes the second model ..Many thanks in advance !Enrico<match_delete.py>Il giorno lun 28 apr 2025 alle ore 21:17 Eric Pettersen <pett@cgl.ucsf.edu> ha scritto:Hi Enrico,Your script seems to define a function without actually calling it. You would need a “delete_unmatched_chains(session)” at the end of the script for it to actually do anything.--EricEric PettersenUCSF Computer Graphics LabOn Apr 26, 2025, at 1:57 AM, Enrico Martinez via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:_______________________________________________Dear ChimeraX Users,
I am trying to perform a morphing between two cryo-EM structures of the same complex, where one structure has twice the number of chains as the other (PDBs 3J9K and 8Y6Q). However, the larger structure causes an error during morphing.
I have attempted to write a script that aligns the two structures and deletes the unmatched chains from the larger structure. Unfortunately, the script is not working as expected.
from chimerax.core.commands import rundef delete_unmatched_chains(session):# Get models #1 and #2if m1 is None or m2 is None:returnchains1 = {chain.chain_id for chain in m1.chains}chains2 = {chain.chain_id for chain in m2.chains}unmatched = chains1 - chains2if unmatched:chain_ids = ",".join(unmatched)# Deleting unmatched chainsrun(session, f"delete /{chain_ids}")else:Could you please help me or alternatively propose another solution? Any suggestions would be greatly appreciated.Thank you in advance !
Enrico
ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu
To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu
Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/