Hi Paul,
If the chains are complete (i.e. the true terminal residues aren’t missing), then you can select the starting and ending resides by their unique characteristics (the C terminus has atom OXT and the N terminus is a primary amine) with this command:

sel backbone & (aliphatic-primary-amine | @oxt) ; sel up

To restrict it to chain A, insert an “/A &” in the selection command.

--Eric

Eric Pettersen
UCSF Computer Graphics Lab


On Nov 25, 2024, at 1:07 PM, Paul Miller via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:

Hi Elaine

No worries. Thanks for trying.

Cheers, Paul

Paul Miller (he/him), PhD
Associate Professor 
Department of Pharmacology
University of Cambridge
Tennis Court Road
Cambridge
CB2 1PD

From: Elaine Meng <meng@cgl.ucsf.edu>
Sent: 25 November 2024 21:04
To: Paul Miller <pm676@cam.ac.uk>
Cc: ChimeraX Users Help <chimerax-users@cgl.ucsf.edu>
Subject: Re: [chimerax-users] Closest distance list between residues/atoms; And selecting first/last residue in a chain
 
Hi Paul,
Yes, "start" and "end" are for use in ranges. Just now I tried ":start-start" but alas, it did not work!

Undoubtedly it could be done with python code, but that is beyond my skill set, sorry.  I couldn't think of any way to do it directly in a command.

Elaine

> On Nov 25, 2024, at 12:56 PM, Paul Miller via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
> 
> Thank you very much, Elaine. I'll take a look at the "contacts" info.
> 
> Regarding the first and last residue, I can see how that works for a residue range, e.g. from residue 45 to the end, but in my particular case, I wish to only show the singular first and last residues in a chain (e.g. I show a chain as Calphas in stick, and the first and last residues at spheres), without any specification or a range, and it doesn't work for that (or I cannot figure out the code from the weblink you sent). Just for feedback. No worries that it cannot do it.
> 
> Cheers, Paul
> 
> Paul Miller (he/him), PhD
> Associate Professor 
> Department of Pharmacology
> University of Cambridge
> Tennis Court Road
> Cambridge
> CB2 1PD
> https://www.phar.cam.ac.uk/research/miller
> From: Elaine Meng <meng@cgl.ucsf.edu>
> Sent: 25 November 2024 17:03
> To: Paul Miller <pm676@cam.ac.uk>
> Cc: chimerax-users@cgl.ucsf.edu <chimerax-users@cgl.ucsf.edu>
> Subject: Re: [chimerax-users] Closest distance list between residues/atoms; And selecting first/last residue in a chain
>  Hi Paul,
> The "Clashes" or "Contacts" tool (or "clashes" or "contacts" commands) all have an option to write output to a file or to the Log.  I believe it is in order of greatest to least VDW overlap, but there is a center-to-center distance column as well that you could then sort by (e.g. if you wrote an output file).  These also have an option to use center-to-center distance as the main criterion and ignore VDW overlap, and that would give results  in order of distance.
> <https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Frbvi.ucsf.edu%2Fchimerax%2Fdocs%2Fuser%2Ftools%2Fclashes.html&data=05%7C02%7Cpm676%40universityofcambridgecloud.onmicrosoft.com%7Cc3ed57ca2390467a639708dd0d94e67a%7C49a50445bdfa4b79ade3547b4f3986e9%7C1%7C0%7C638681655367196309%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=s0mC%2BShRDBxyfmwAVs4fuU81cO2obKWj5oEpYBeliyg%3D&reserved=0>
> <https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Frbvi.ucsf.edu%2Fchimerax%2Fdocs%2Fuser%2Fcommands%2Fclashes.html&data=05%7C02%7Cpm676%40universityofcambridgecloud.onmicrosoft.com%7Cc3ed57ca2390467a639708dd0d94e67a%7C49a50445bdfa4b79ade3547b4f3986e9%7C1%7C0%7C638681655367217581%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=TlC6V4PJjJbKRU9%2B0aGBehOE0XbCJEJIJdnEr9QBews%3D&reserved=0>
> 
> No, the above do not say what kind of interaction is involved.  You would have to use your own chemical knowledge of atom types to tell (and also distinguish them from overly close, unfavorable "clashes" ... although that is what the VDW overlap value is meant to tell you in the first place).
> 
> If you use "H-Bonds" tool (command "hbonds") there are similar output options, except all of the lines are H-bonds.  They also have an option to find only salt bridges (H-bonds that are also salt bridges).
> <https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Frbvi.ucsf.edu%2Fchimerax%2Fdocs%2Fuser%2Ftools%2Fhbonds.html&data=05%7C02%7Cpm676%40universityofcambridgecloud.onmicrosoft.com%7Cc3ed57ca2390467a639708dd0d94e67a%7C49a50445bdfa4b79ade3547b4f3986e9%7C1%7C0%7C638681655367230013%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=st4bhXpn5zZb18WYKUHbmdn4TcG85MZIB%2FwANf1B9GI%3D&reserved=0>
> <https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Frbvi.ucsf.edu%2Fchimerax%2Fdocs%2Fuser%2Fcommands%2Fhbonds.html&data=05%7C02%7Cpm676%40universityofcambridgecloud.onmicrosoft.com%7Cc3ed57ca2390467a639708dd0d94e67a%7C49a50445bdfa4b79ade3547b4f3986e9%7C1%7C0%7C638681655367247579%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=oXRoba6jY%2FfvHQPAGOKm7QMTKgFwHIk9UyznYPcFBJc%3D&reserved=0>
> 
> For start/end, you can use the words "start" and "end" as explained in the atomspec documentation:
> <https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Frbvi.ucsf.edu%2Fchimerax%2Fdocs%2Fuser%2Fcommands%2Fatomspec.html%23lists&data=05%7C02%7Cpm676%40universityofcambridgecloud.onmicrosoft.com%7Cc3ed57ca2390467a639708dd0d94e67a%7C49a50445bdfa4b79ade3547b4f3986e9%7C1%7C0%7C638681655367260506%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=IyrXYG5X1wy7DLlSo4w83HRYHpOwUa1Rw1U6z%2FcStOI%3D&reserved=0>
> 
> I hope this helps,
> Elaine
> -----
> Elaine C. Meng, Ph.D.                       
> UCSF Chimera(X) team
> Resource for Biocomputing, Visualization, and Informatics
> Department of Pharmaceutical Chemistry
> University of California, San Francisco
> 
> > On Nov 25, 2024, at 1:19 AM, Paul Miller via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
> > 
> > Hi
> > 
> > Is there a way by command line to generate a list of residue to residue (or atom to atom) distances ranked by closest to furthest, for say, all residues within 4A of each other at an interface between two protein chains? Can it also state the type of interaction, e.g. salt bridge, H-bond, vdW?
> > 
> > Also, completely separately, is there a way by command line to select the first and last residue in a chain (without having to find their number)?
> > 
> > No worries if not. Thanks so much!
> > 
> > Cheers, Paul
> 
> 
> _______________________________________________
> ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu
> To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu
> Archives: https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmail.cgl.ucsf.edu%2Fmailman%2Farchives%2Flist%2Fchimerax-users%40cgl.ucsf.edu%2F&data=05%7C02%7Cpm676%40universityofcambridgecloud.onmicrosoft.com%7Cc3ed57ca2390467a639708dd0d94e67a%7C49a50445bdfa4b79ade3547b4f3986e9%7C1%7C0%7C638681655367272986%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=%2FqF8nSe%2BFUkqXwjF6Bsg1aJa2r%2B5N%2F9DJJ3J37UWnJo%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/