[Biopython] Parsing DNA coordinate files in the pdb

Peter Cock p.j.a.cock at googlemail.com
Thu May 4 11:48:45 UTC 2017


Strange, it works for me...

>>> chain = model['A']  # the only chain
>>> for residue in chain:
...    for atom in residue:
...        print(atom, atom.get_coord())
...
<Atom O5'> [ -3.92000008 -12.37800026   9.69099998]
<Atom C5'> [ -3.72399998 -12.25699997   8.28100014]
<Atom C4'> [ -2.27999997 -12.51399994   7.91900015]
<Atom O4'> [ -1.93400002 -13.87199974   8.31200027]
<Atom C3'> [ -1.96000004 -12.43900013   6.42999983]
<Atom O3'> [ -1.62       -11.11299992   6.03499985]
<Atom C2'> [ -0.78899997 -13.40200043   6.296     ]
<Atom O2'> [  0.41499999 -12.81299973   6.75      ]
(etc)

Peter


On Thu, May 4, 2017 at 12:42 PM, Ahmad Abdelzaher
<underoath006 at gmail.com> wrote:
> Amazing. But for atom in residue doesn't seem to be working! I also
> want to to atom.get_coord(), any idea how?
>
> On Thu, May 4, 2017 at 11:14 AM, Peter Cock <p.j.a.cock at googlemail.com> wrote:
>> 1JO7 is an RNA structure, Solution Structure of Influenza A Virus Promoter.
>>
>> And yes, you can parse it with Biopython:
>>
>> $ python3
>> Python 3.6.0 (v3.6.0:41df79263a11, Dec 22 2016, 17:23:13)
>> [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
>> Type "help", "copyright", "credits" or "license" for more information.
>>>>> from Bio.PDB import PDBParser
>>>>> parser = PDBParser()
>>>>> structure = parser.get_structure("1JO7", "1jo7.pdb")
>>>>> len(structure)
>> 32
>>>>> model = structure[0]
>>>>> for chain in model:
>> ...    for residue in chain:
>> ...         print(residue)
>> ...
>> <Residue   A het=  resseq=1 icode= >
>> <Residue   G het=  resseq=2 icode= >
>> <Residue   U het=  resseq=3 icode= >
>> <Residue   A het=  resseq=4 icode= >
>> <Residue   G het=  resseq=5 icode= >
>> <Residue   A het=  resseq=6 icode= >
>> <Residue   A het=  resseq=7 icode= >
>> <Residue   A het=  resseq=8 icode= >
>> <Residue   C het=  resseq=9 icode= >
>> <Residue   A het=  resseq=10 icode= >
>> <Residue   A het=  resseq=11 icode= >
>> <Residue   G het=  resseq=12 icode= >
>> <Residue   G het=  resseq=13 icode= >
>> <Residue   C het=  resseq=14 icode= >
>> <Residue   U het=  resseq=15 icode= >
>> <Residue   U het=  resseq=16 icode= >
>> <Residue   C het=  resseq=17 icode= >
>> <Residue   G het=  resseq=18 icode= >
>> <Residue   G het=  resseq=19 icode= >
>> <Residue   C het=  resseq=20 icode= >
>> <Residue   C het=  resseq=21 icode= >
>> <Residue   U het=  resseq=22 icode= >
>> <Residue   G het=  resseq=23 icode= >
>> <Residue   C het=  resseq=24 icode= >
>> <Residue   U het=  resseq=25 icode= >
>> <Residue   U het=  resseq=26 icode= >
>> <Residue   U het=  resseq=27 icode= >
>> <Residue   U het=  resseq=28 icode= >
>> <Residue   G het=  resseq=29 icode= >
>> <Residue   C het=  resseq=30 icode= >
>> <Residue   U het=  resseq=31 icode= >
>>
>>
>> The 32 models here are the 32 conformers submitted, according
>> to the website they are those with Lowest Energy and Acceptable
>> Covalent Geometry.
>>
>> By co-incidence there are also 32 residues, RNA bases A, G, U,
>> ..., G, C, U.
>>
>> This matches the FASTA sequence available from the PDB:
>>
>>>1JO7:A|PDBID|CHAIN|SEQUENCE
>> AGUAGAAACAAGGCUUCGGCCUGCUUUUGCU
>>
>> Regards,
>>
>> Peter
>>
>> On Thu, May 4, 2017 at 4:40 AM, Ahmad Abdelzaher <underoath006 at gmail.com> wrote:
>>> Is there a way in Biopython to parse .pdb files that contain the
>>> crystal structure of molecules other than proteins, for example
>>> 1jo7.pdb?
>>>
>>> Regards.
>>> _______________________________________________
>>> Biopython mailing list  -  Biopython at mailman.open-bio.org
>>> http://mailman.open-bio.org/mailman/listinfo/biopython


More information about the Biopython mailing list