DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

A Simple Python Script To Extract CA Coordinates From A Protein Data Bank File

07.14.2008
| 5265 views |
  • submit to reddit
        A simple python script to extract CA coordinates from a protein data bank file

pdb = open("1D9Z.pdb", "r")

for line in pdb:
    if line[:4] == 'ATOM' and line[12:16] == " CA ":
        print line

# that's all, folks!