Sorry, typo. For the second approach, state should be `i + 1` and not `-1`"

Jarrett J.

On Thu, Jul 20, 2023 at 8:49 AM Jarrett Johnson <
jarrett.john...@schrodinger.com> wrote:

> Hi Neena,
>
> Is the split_states necessary? You can query the distance between atoms on
> the state-level as well without having to break up your structure. Here's
> two approaches that show either way; I recommend the second if possible.
> You'll of course have to switch out the selection string to fit your own
> atom pairs.
>
> from pymol import cmd
>
> # Approach 1: With splitting states
>
> cmd.fetch('1L2Y')
> cmd.split_states('1L2Y')
> for i in range(cmd.count_states('1L2Y')):
>     nmr_frame = f"1L2Y_{i + 1:04d}"
>     sele1 = f"/{nmr_frame}/A/A/ILE`4/O"
>     sele2 = f"/{nmr_frame}/A/A/ASP`9/CA"
>     dist = cmd.dist(f"dist_{nmr_frame}", sele1, sele2)
>     print(dist)
>
> print("--------------------")
>
> # Approach 2: Without splitting states
>
> for i in range(cmd.count_states('1L2Y')):
>     sele1 = "/1L2Y/A/A/ILE`4/O"
>     sele2 = "/1L2Y/A/A/ASP`9/CA"
>     dist = cmd.get_distance(sele1, sele2, state=-1)
>     print(dist)
>
>
> Hope that helps,
> Jarrett J
>
>
> On Wed, Jul 19, 2023 at 9:48 PM Neena Susan Eappen <
> neenasusan...@gmail.com> wrote:
>
>> Hello PyMOL users,
>>
>> Can I get some insight on how to approach this analysis?
>>
>> Many thanks,
>> Neena
>>
>> On Wed, 5 Jul 2023 at 18:54, Neena Susan Eappen <neenasusan...@gmail.com>
>> wrote:
>>
>>> Hello PyMOL Team,
>>>
>>> I am studying a protein called Trp-cage (PDB code: 1L2Y); this PDB has
>>> 38 NMR structures deposited in it.
>>> Using split_states command, I can see all 38 structures.
>>> I want to find polar contacts between same 3 residues in all these 38
>>> structures and extract corresponding distance values for polar contacts.
>>>
>>> Question: Is there a single command to select 3 residues in all these 38
>>> structures and find polar contacts within this selection?
>>>
>>> Many thanks,
>>> Neena
>>>
>> _______________________________________________
>> 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
>
>

-- 

*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