Hello,
I am trying to write a script that will iterate through lists of PDB IDs, the relevant antibody chain labels within those PDBs, and antigen chain labels, and annotate the contacts between the antibody and antigen using the command findclash.
After opening each PDB file, I am struggling to find a way to select the antibody chains as "sel1" and the antigen chain(s) as "sel2" since the command "select" does not seem to recognize chain labels.
Could you please help me find a way to accomplish my goal?
Thank you, Ellen
Hi Ellen, Just about any command that takes a set of atoms will take the chain ID, but there is a specific syntax which may take a little getting used to. Some examples with the "select" command:
select :.A select #0:.C
The first one selects all chains A (multiple models, if present) and the second one selects chain C but only in model #0. There are more examples in this page about command-line specification:
https://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/midas/frameatom_spec.html ...specifically in this section, see chain examples under "subcategories": https://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/midas/atom_spec.html#hierarchy
Say you have structure 2bdn which has antigen chain A with antibody light chain L and heavy chain H (we use the "author" chain IDs), https://www.rcsb.org/structure/2BDN
...and you want to find contacts of A with L+H collectively. Your commands could be something like the following, although you may want different options/values. Note that you do not need to make a selection, you can just specify the chains directly in the findclash command. https://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/midas/findclash.html
open 2bdn findclash :.H:.L test :.A overlap -0.5 hb 0 reveal true log true
....and then look in the Reply Log (under Favorites in menu) to see the details. Or you can use the option to save a text file of the results, see the findclash help link above.
I hope this helps, Elaine ----- Elaine C. Meng, Ph.D. UCSF Chimera(X) team Department of Pharmaceutical Chemistry University of California, San Francisco
On Oct 4, 2023, at 12:55 PM, Ellen Shrock via Chimera-users chimera-users@cgl.ucsf.edu wrote:
Hello,
I am trying to write a script that will iterate through lists of PDB IDs, the relevant antibody chain labels within those PDBs, and antigen chain labels, and annotate the contacts between the antibody and antigen using the command findclash.
After opening each PDB file, I am struggling to find a way to select the antibody chains as "sel1" and the antigen chain(s) as "sel2" since the command "select" does not seem to recognize chain labels.
Could you please help me find a way to accomplish my goal?
Thank you, Ellen
Hi Elaine,
This was extremely helpful and exactly what I was looking for, thank you!
Best, Ellen
On Wed, Oct 4, 2023 at 1:22 PM Elaine Meng meng@cgl.ucsf.edu wrote:
Hi Ellen, Just about any command that takes a set of atoms will take the chain ID, but there is a specific syntax which may take a little getting used to. Some examples with the "select" command:
select :.A select #0:.C
The first one selects all chains A (multiple models, if present) and the second one selects chain C but only in model #0. There are more examples in this page about command-line specification:
< https://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/midas/frameatom_spec.html
...specifically in this section, see chain examples under "subcategories": < https://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/midas/atom_spec.html#hiera...
Say you have structure 2bdn which has antigen chain A with antibody light chain L and heavy chain H (we use the "author" chain IDs), https://www.rcsb.org/structure/2BDN
...and you want to find contacts of A with L+H collectively. Your commands could be something like the following, although you may want different options/values. Note that you do not need to make a selection, you can just specify the chains directly in the findclash command. https://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/midas/findclash.html
open 2bdn findclash :.H:.L test :.A overlap -0.5 hb 0 reveal true log true
....and then look in the Reply Log (under Favorites in menu) to see the details. Or you can use the option to save a text file of the results, see the findclash help link above.
I hope this helps, Elaine
Elaine C. Meng, Ph.D. UCSF Chimera(X) team Department of Pharmaceutical Chemistry University of California, San Francisco
On Oct 4, 2023, at 12:55 PM, Ellen Shrock via Chimera-users <
chimera-users@cgl.ucsf.edu> wrote:
Hello,
I am trying to write a script that will iterate through lists of PDB
IDs, the relevant antibody chain labels within those PDBs, and antigen chain labels, and annotate the contacts between the antibody and antigen using the command findclash.
After opening each PDB file, I am struggling to find a way to select the
antibody chains as "sel1" and the antigen chain(s) as "sel2" since the command "select" does not seem to recognize chain labels.
Could you please help me find a way to accomplish my goal?
Thank you, Ellen
Hi Elaine,
I hope all is well. Previously you helped me iterate through lists of pdb files, annotate the contacts between the antibody and antigen using the command findclash. Now, I was hoping to iterate over each residue of the antigen (in this case labeled as chain T) and identify all antibody residues that contact that particular antigen residue. I have copied my script below, but the iteration over the residues isn't working. I was wondering if you could help me with this? Also, do you know if there is a way to append to a file for each pdb instead of saving a different file for each residue in my case?
Thanks a lot, Ellen
import chimera import os from chimera import runCommand as rc # use 'rc' as shorthand for runCommand from chimera import replyobj # for emitting status messages from chimera.tkgui import saveReplyLog from chimera import selection
# change to folder with data files os.chdir("/home/eshrock/scratch/") out_path = '/home/eshrock/scratch/findclash_results/' # gather the names of .pdb files in the folder file_names = [fn for fn in os.listdir(".") if fn.endswith(".pdb")]
# loop through the files, opening, processing, and closing each in turn for fn in file_names: replyobj.status("Processing " + fn) # show what file we're working on rc("open " + fn) rc("select :.T") for res in list(chimera.selection.residues): save_file_name = out_path + fn + "_" + res +'_findclash.txt' rc("findclash :.H:.L test " + res + " overlapCutoff -1.0 hbondAllowance 0 namingStyle simple saveFile " + save_file_name) rc("close all") rc("stop now")
On Wed, Oct 4, 2023 at 1:26 PM Ellen Shrock eshrock2023@gmail.com wrote:
Hi Elaine,
This was extremely helpful and exactly what I was looking for, thank you!
Best, Ellen
On Wed, Oct 4, 2023 at 1:22 PM Elaine Meng meng@cgl.ucsf.edu wrote:
Hi Ellen, Just about any command that takes a set of atoms will take the chain ID, but there is a specific syntax which may take a little getting used to. Some examples with the "select" command:
select :.A select #0:.C
The first one selects all chains A (multiple models, if present) and the second one selects chain C but only in model #0. There are more examples in this page about command-line specification:
< https://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/midas/frameatom_spec.html
...specifically in this section, see chain examples under "subcategories": < https://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/midas/atom_spec.html#hiera...
Say you have structure 2bdn which has antigen chain A with antibody light chain L and heavy chain H (we use the "author" chain IDs), https://www.rcsb.org/structure/2BDN
...and you want to find contacts of A with L+H collectively. Your commands could be something like the following, although you may want different options/values. Note that you do not need to make a selection, you can just specify the chains directly in the findclash command. https://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/midas/findclash.html
open 2bdn findclash :.H:.L test :.A overlap -0.5 hb 0 reveal true log true
....and then look in the Reply Log (under Favorites in menu) to see the details. Or you can use the option to save a text file of the results, see the findclash help link above.
I hope this helps, Elaine
Elaine C. Meng, Ph.D. UCSF Chimera(X) team Department of Pharmaceutical Chemistry University of California, San Francisco
On Oct 4, 2023, at 12:55 PM, Ellen Shrock via Chimera-users <
chimera-users@cgl.ucsf.edu> wrote:
Hello,
I am trying to write a script that will iterate through lists of PDB
IDs, the relevant antibody chain labels within those PDBs, and antigen chain labels, and annotate the contacts between the antibody and antigen using the command findclash.
After opening each PDB file, I am struggling to find a way to select
the antibody chains as "sel1" and the antigen chain(s) as "sel2" since the command "select" does not seem to recognize chain labels.
Could you please help me find a way to accomplish my goal?
Thank you, Ellen
On Dec 7, 2023, at 7:16 PM, Ellen Shrock via Chimera-users chimera-users@cgl.ucsf.edu wrote:
for res in list(chimera.selection.residues):
This should be:
from chimera.selection import currentResidues for res in currententResidues():
There is no easy way to get the findclash command to append to a file. You would have to open the file yourself, call the underlying findclash Python function, parse the results and format it into the output file. Probably easier to just concatenate the files afterward with the Unix 'cat' command.
--Eric
Eric Pettersen UCSF Computer Graphics Lab
Thank you, Eric!
Best, Ellen
On Fri, Dec 8, 2023 at 4:54 PM Eric Pettersen pett@cgl.ucsf.edu wrote:
On Dec 7, 2023, at 7:16 PM, Ellen Shrock via Chimera-users < chimera-users@cgl.ucsf.edu> wrote:
for res in list(chimera.selection.residues):
This should be:
from chimera.selection import currentResidues for res in currententResidues():
There is no easy way to get the findclash command to append to a file. You would have to open the file yourself, call the underlying findclash Python function, parse the results and format it into the output file. Probably easier to just concatenate the files afterward with the Unix 'cat' command.
--Eric
Eric Pettersen UCSF Computer Graphics Lab
participants (3)
-
Elaine Meng
-
Ellen Shrock
-
Eric Pettersen