
The situation for cartoon display is more complicated and there may not be a good solution. The cartoon path is computed as a spline along the backbone atoms, and may look very bad if there is a huge discontinuity in the backbone atom positions. The typical solution in this case is to reimage the simulation to keep bonded entities together as they cross the periodic boundary, which I understand is something you don’t want to do. So here is some code to suppress the cross-box parts of a cartoon, though I have no idea if the result will look okay or not. too_long = 10.0 from chimerax.atomic import all_atomic_structures, concatenate for s in all_atomic_structures(session): bonds = s.bonds long_bonds = bonds.filter(bonds.lengths > too_long) atoms1, atoms2 = long_bonds.atoms atoms = atoms1.merge(atoms2) long_residues = atoms.unique_residues s.residues.ribbon_displays = True long_residues.ribbon_displays = False Hope this helps. —Eric
On Mar 25, 2024, at 5:26 PM, qz.chen--- via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Thank you, this is very helpful. I've been trying to adjust the settings for the cartoon display on my own, but I've found that the cartoon display is an attribute of residues and does not have a 'length' attribute. Is there a simple method for this, or does it require computing the distances through code? _______________________________________________ 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/