18 from rosetta
import Pose
19 from rosetta
import pose_from_pdb
22 from cleaning
import cleanATOM
23 from cleaning
import cleanCRYS
29 Writes PDB data for RCSB data for <pdb_code> into the file <pdb_code>.pdb
32 load_from_rcsb('1YY8')
42 pdb_code = pdb_code.upper()
44 filename = urllib.urlretrieve(
'http://www.rcsb.org/pdb/files/' + pdb_code +
'.pdb')[0]
46 raise IOError(
'Cannot access the PDB database, please check your Internet access')
48 if (os.path.getsize(filename) > 1500):
50 pdb_file =
open(filename)
51 pdb_data = pdb_file.readlines()
55 pdb_code = pdb_code +
'.pdb'
58 pdb_outfile = pdb_code
59 if os.path.exists( os.getcwd() +
'/' + pdb_outfile ):
60 print 'the file',pdb_outfile,
'already exists, this file will be overwritten'
62 pdb_file =
open(pdb_outfile,
'w')
63 pdb_file.writelines(pdb_data)
66 print 'PDB',pdb_code[:-4],
'successfully loaded from rcsb into',pdb_outfile
70 raise IOError(
'Invalid PDB code')
74 def pose_from_rcsb( pdb_code , ATOM = True , CRYS = False , pdb_outfile = '' ):
76 Returns a pose for RCSB PDB <pdb_code> , also writes this data to
77 <pdb_code>.pdb, optionally calls cleanATOM and cleanCYRS
80 pose=pose_from_rcsb('1YY8')
93 pdb_outfile = pdb_code +
'.pdb'
101 pdb_outfile = pdb_outfile[:edit]+
'.clean.pdb'
104 pdb_outfile = pdb_outfile[:edit]+
'.mono.pdb'
105 pose = pose_from_pdb(pdb_outfile)
112 pdb_code = pdb_code.upper()
114 filename = urllib.urlretrieve(
'http://www.rcsb.org/pdb/files/fasta.txt?structureIdList=' + pdb_code)[0]
116 raise IOError(
'Cannot access the PDB database, please check your Internet access')
118 if (os.path.getsize(filename)):
119 pdb_file =
open(filename)
120 pdb_data = pdb_file.readlines()
124 if not fasta_outfile:
125 fasta_outfile = pdb_code +
'.fa'
126 if os.path.exists( os.getcwd() +
'/' + fasta_outfile ):
127 print 'the file',fasta_outfile,
'already exists, this file will be overwritten'
129 pdb_file =
open(fasta_outfile,
'w')
130 pdb_file.writelines(pdb_data)
133 print 'PDB',pdb_code,
'sequence successfully loaded from rcsb into',fasta_outfile
135 raise IOError(
'Invalid PDB code')
bool open(utility::io::izstream &db_stream, std::string const &db_file, bool warn)
Open a database file on a provided stream.