PDB BioPython- extracting the coordinates
<p>I am new to Python, is there any function in BioPython to calculate the vector of an atom given a PDB file, passing the coordinates as its input?</p>

<p>[OR]</p>

<p>Is there a BioPython function to extract the coordinates separately from a PDB file?</p>

<p>There's such method for atoms and surpringsingly it's called <a href="http://biopython.org/DIST/docs/api/Bio.PDB.Atom.Atom-class.html#get_vector" rel="nofollow">get_vector()</a>.</p>

<pre><code>from Bio.PDB import PDBParser


p = PDBParser()
s = p.get_structure("4K5Y", "4K5Y.pdb")                    

for chains in s:
    for chain in chains:
        for residue in chain:                             
            for atom in residue:
                print(atom.get_vector())
</code></pre>

<p>After that, you have some methods available for each <code>Vector</code> object documented <a href="http://biopython.org/DIST/docs/api/Bio.PDB.Vector%27.Vector-class.html" rel="nofollow">here</a></p>

python biopython