[MMTK] Extracting atom coordinates

David Evans david.evans at ulsop.ac.uk
Fri Jun 3 18:43:27 CEST 2005


Thank you. I guess it just wasn't obvious how to index the objects
all the way down from universe to atom.
The other  way I found to do it was  to loop over the atoms
looking for one with the correct fullName(), but that is pretty stupid.

Thanks again,

Dave


khinsen at cea.fr wrote:

> On 03.06.2005, at 12:20, David Evans wrote:
>
>> configuration = PDBConfiguration('nuc_H.pdb')
>>                                              universe =  
>> InfiniteUniverse()
>> universe.addObject(configuration.createAll(None, 1))
>>
>>
>> How do I print out the coordinates of one
>> particular atom, referred to by atom name and residue name or number?
>> eg DT8:O2
>
>
> First you need to identify the right chain, but there is no generic  
> solution, it depends on the PDB file. Let's suppose the righ chain is  
> universe[0]. Then
>
>     universe[0][7]
>
> is the 8th residue,
>
>     universe[0][7].phosphate
>
> is the phosphate group, and
>
>     universe[0][7].phosphate.O_2
>
> is the atom O_2.
>
> Konrad.
> -- 
> ------------------------------------------------------------------------ 
> -------
> Konrad Hinsen
> Laboratoire Leon Brillouin, CEA Saclay,
> 91191 Gif-sur-Yvette Cedex, France
> Tel.: +33-1 69 08 79 25
> Fax: +33-1 69 08 82 61
> E-Mail: khinsen at cea.fr
> ------------------------------------------------------------------------ 
> -------
>





More information about the mmtk mailing list