So... there currently isn't an option in ISOLDE to do this via the command line. But it's pretty easy to add. Unfortunately I just missed adding it into the ISOLDE 1.11 release, but you can add it to your session by putting the below code in a file called something like "isolde_restr_ss_cmd.py" and opening that in ChimeraX:

```
def restrain_ss(session, residues, ss_type):
    from chimerax.atomic import Residue
    structures = residues.unique_structures
    for s in structures:
        sresidues = s.residues.intersect(residues)
        strands = sresidues[sresidues.ss_types==Residue.SS_STRAND]
        helices = sresidues[sresidues.ss_types==Residue.SS_HELIX]
        from chimerax.isolde.restraints.restraint_utils import restrain_secondary_structure
        if ss_type == 'current':
            restrain_secondary_structure(session, strands, 'strand')
            restrain_secondary_structure(session, helices, 'helix')
        if ss_type == 'strand':
            restrain_secondary_structure(session, sresidues, 'strand')
        if ss_type == 'helix':
            restrain_secondary_structure(session, sresidues, 'helix')

from chimerax.core.commands import CmdDesc, register, EnumOf
from chimerax.atomic import ResiduesArg


desc = CmdDesc(
    synopsis='Add backbone distance and torsion restraints to restrain residues to idealised secondary structure geometry',
    required=[
        ('residues', ResiduesArg),
        ('ss_type', EnumOf(('strand', 'helix', 'current')))
    ],
)
register('isolde restrain ss', desc, restrain_ss, logger=session.logger)
```

This adds the command "isolde restrain ss {sel} {strand|helix|current}". The "strand" option will restrain everything in the selection to beta-strand (including restraining H-bonds to adjacent strands in a sheet if they're also part of the selection); "helix" will restrain it all to helix; "current" will restrain each residue to its currently-assigned type. Obviously you want to be very careful with the first two in particular (results will be fun but extremely "interesting" if you accidentally restrain the entire structure to helix!). 

Hope this helps,
Tristan

On Wed, Feb 25, 2026 at 3:56 PM Dan Richman via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Hi Michel, I thought of a quick answer, though forgive me that I'm not Tristan. Have you tried first running the ChimeraX dssp command to assign the secondary structure, and next, choosing one of the secondary structure restraints buttons in the ISOLDE GUI's Restraints tab?


--
Dan Richman, PhD   (he/him/his)
Research Associate, James Berger Lab
Dept of Biophysics and Biophysical Chemistry
Johns Hopkins University School of Medicine
mobile: 201-669-0967

From: michel.thepaut--- via ChimeraX-users <chimerax-users@cgl.ucsf.edu>
Sent: Wednesday, February 25, 2026 6:15 AM
To: chimerax-users@cgl.ucsf.edu <chimerax-users@cgl.ucsf.edu>
Subject: [chimerax-users] Re: ISOLDE and secondary structure restraints
 

      External Email - Use Caution



Dear Tristan,
I have a similar question then I exhume that topic...

As I'm dealing with a ~1500 residues protein that I want to make dance in a density. Then as it is large I would like to use command lines to assign secondary structure to known helices and B-sheets instead of clicking on each residues to say this is an helix and this is a sheet.
Is there a way to say to Isolde  something like: 20 to 30 is an helix, 50 to 56 is a parallel sheet, ..., 1452 to 1460 is and helix. Please place your tensors and angles and lets dance?...

Thank you for your answer.
Michel
_______________________________________________
ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu
To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu
Archives: https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmail.cgl.ucsf.edu%2Fmailman%2Farchives%2Flist%2Fchimerax-users%40cgl.ucsf.edu%2F&data=05%7C02%7Cd.e.richman%40jhu.edu%7C86c14a4715a841a3908a08de7482066f%7C9fa4f438b1e6473b803f86f8aedf0dec%7C0%7C0%7C639076299049509513%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=ktoCJWIvzmm8TE5Q7X8oNRleEyaGvE7iM6z9fWpzDXQ%3D&reserved=0
_______________________________________________
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/

Altos Labs UK Limited | England | Company reg 13484917  
Registered address: 3rd Floor 1 Ashley Road, Altrincham, Cheshire, United Kingdom, WA14 2DT