9 Model repository. A model repository abstracts the way that PDB files are
10 loaded. Instead of explicitly specifying the PDB filename, only the PDB
11 id (and optionally a chain) needs to be specified. The actual files are then
12 resolved by the repository.
16 The usage pattern of the model repository is simple. After construction,
17 models may be loaded by passing in a model id and optionally a number of
18 chain names (see documentation for io.LoadPDB).
22 repos=repository.ModelRepository('path_to_pdbs',
23 file_pattern='pdb%(id)s.ent.gz',
24 transform=string.lower)
25 # load 1ake (note that the name is transformed by string.lower)
29 file_pattern='%(id)s.pdb
',transform=str):
31 Construct new model repository
41 basename=self.
file_pattern_file_pattern_ % {
'id' : pdb_id,
'chain' :chain,
'dir' : pdb_id[1:3]}
42 return os.path.join(self.
directory_directory_, basename)
44 def Load(self, pdb_id, chains='', calpha_only=False, fault_tolerant=False):
46 chains, calpha_only=calpha_only,
47 fault_tolerant=fault_tolerant)
50 return io.LoadMultiPDB(self.
FilenameForModelFilenameForModel(pdb_id, chains))
def FilenameForModel(self, pdb_id, chain)
def __init__(self, directory=None, file_pattern='%(id) s.pdb', transform=str)
def LoadMulti(self, pdb_id, chains="")
def Load(self, pdb_id, chains='', calpha_only=False, fault_tolerant=False)