Hi,
I have wrote a script to create a table includes TITLE, AUTHOR and DATE of PUBLISH from pdb.org website, but it doesn't work, could you please help me?
#! /usr/bin/env python
import urllib
IDListURL = "http://www.pdb.org/pdb/results/ids.jsp?qrid=4A451CD"
IDList = urllib.urlopen(IDListURL)
for Line in IDList:
CODE = Line.strip()
PDBUrl = "http://www.pdb.org/pdb/files/%s.pdb" % (CODE)
PDBFile = urllib.urlopen(PDBUrl)
FileName = "pdb.test%s.pdb" % (CODE)
OutPDB = open(FileName, 'w')
for Line in PDBFile:
ThisLine = Line.strip()
OutPDB.write(ThisLine+"\n")
OutTableFile = "Result.table.txt"
OutTable = open(OutTableFile, 'w')
Table = []
for Line in IDList:
CODE = Line.strip()
FileName = "pdb.test%s.pdb" % (CODE)
ReadPDB = open(FileName, 'r')
# Search 1:
for Line in ReadPDB:
if "TITLE" in Line:
SE1 = Line.strip()
break
# Search 2:
for Line in ReadPDB:
if "^Author" in Line:
SE2 = Line.strip()
Comments
Leave a comment