Re: [AMBER] Extracting residue number from a given resname - Pytraj

From: Hai Nguyen via AMBER <amber.ambermd.org>
Date: Fri, 12 Aug 2022 20:28:02 -0400

On Thu, Aug 4, 2022 at 1:09 PM Carlos Navarro via AMBER <amber.ambermd.org>
wrote:

> Hi all,
> On pytraj I’m trying to select the info of the ions CA/Cl- on a given
> system to save it on a list, but I don’t know how.
> The only option I found is by a for loop, like:
> top = traj.top
> for residue in top.residues:
>
> But this display extra information that I don’t need, for example below:
> <SER0, 13 atoms>
> <TRP1, 24 atoms>
> …..
>

Please use: residue.original_resid (or residue.index)

Hai

>
> Regarding atom numbers, I found that you could easily use top.select to
> get this info, but I need the number of the residues, not of the atoms.
> I’m new to pytraj and python in general, so any input/recommendations are
> more than welcome.
> Thanks!
> Carlos
>
>
>
>
>
> _______________________________________________
> AMBER mailing list
> AMBER.ambermd.org
> http://lists.ambermd.org/mailman/listinfo/amber
>
_______________________________________________
AMBER mailing list
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber
Received on Fri Aug 12 2022 - 17:30:03 PDT
Custom Search