Re: [PyMOL] How to obtain a PyMOL selection within Python

2024-05-28 Thread Zhou, Yingyao via PyMOL-users
Here is the solution. Wonder if someone can help explain why the line below gives an error about print is not defined: out=x.cmd.do("iterate mysel and name CA, print(resi)") Thanks! import pymol2 x=pymol2.PyMOL() x.start() x.cmd.do("fetch 1crn; select mysel, /1crn//A/10-20") out=[] def f(ch

[PyMOL] How to obtain a PyMOL selection within Python

2024-05-28 Thread Zhou, Yingyao via PyMOL-users
Hi, In the example code below, there is a selection object "myself" within PyMOL, I try to obtain the selected residues within Python. The "out=x.cmd.do" prints the selection to stdout, but the variable out remains None. What would be a good way to get the selection without going through disk I

Re: [PyMOL] Help with selecting interface residues between two structures

2023-06-29 Thread Zhou, Yingyao via PyMOL-users
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 eac

[PyMOL] Help with selecting interface residues between two structures

2023-06-28 Thread Zhou, Yingyao via PyMOL-users
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 t