Hi,

There might be a cleaner way to do this, but I propose creating a mapping
of your chains from base to pred and use the `iterate` command to get the
relevant identifiers and map them back to the prediction. Here is a full
script that pulls from the PDB that attempts this idea.

from pymol import cmd

# our reference
cmd.fetch('3hfm', 'base')
# dummy prediction
cmd.copy('pred', 'base')

# Heavy & Light chains in 3hfm are named L and H
# Antigen is Y so lets rename to A to simulate your case
cmd.alter('base & chain Y', 'chain="A"')

# change chain to emulate same residues different chain names
cmd.alter('pred & chain L', 'chain="A"')
cmd.alter('pred & chain H', 'chain="B"')
cmd.alter('pred & chain Y', 'chain="C"')

base_interface = 'int_base'
cmd.select(base_interface, 'byres(base & (/base//H+L around 5))')

# After preparation:
# create a mapping of chains from base to pred
base_to_pred_chains = {'L': 'A', 'H': 'B', 'A': 'C'}

# Create a list of identifiers in the interface from the selection
myspace = {'int_set': set()}
cmd.iterate(base_interface, 'int_set.add((chain, resi, resn))', space=
myspace)

# Map them to a new selection onto the prediction
pred_interface = 'int_pred'
cmd.select(pred_interface, 'none')
for chain, resi, resn in myspace['int_set']:
    new_chain = base_to_pred_chains[chain]
    # Add each pred residue to the selection
    cmd.select(pred_interface,
               f'pred & chain {new_chain} & resi {resi} & resn {resn}',
               merge=1)

Hope that helps,
Jarrett J

On Thu, Jun 29, 2023 at 12:59 AM Zhou, Yingyao via PyMOL-users <
pymol-users@lists.sourceforge.net> wrote:

> I am a relatively new PyMOL user and would like to get some helps from the
> community.
>
>
>
> I have two structures for the same antibody-antigen complex (with three
> chains: light chain L, heavy chain H, and an antigen chain A) .
>
> Structure “base” is the experimental true structure, structure “pred” is
> the predicted structure. My goal is to determine how close the predicted
> interface is w.r.t. the experimental truth.
>
>
>
> I first select the interface residues as defined by “base”
>
>
>
> load base.pdb
>
> load pred.pdb
>
> select int_base, byres(base & (/base//H+L around 5))
>
>
>
> How do I select the same corresponding residues in object “pred”?
>
>
>
> In addition, what if in the pred structure, chains are named A, B, and C,
> corresponding to base structure L, H, A, respectively, how will I handle
> that?
>
> (I was planning to rename the chains, if there is no nice trick to
> transfer the selections from base to pred)
>
>
>
> Thanks!
>
>
>
>
> _______________________________________________
> PyMOL-users mailing list
> Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
> Unsubscribe:
> https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe
>


-- 

*Jarrett Johnson* | Senior Developer, PyMOL
_______________________________________________
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

Reply via email to