Local PDB Handlers¶
This module defines functions for handling local PDB folders.
Returns or specify local PDB folder for storing PDB files downloaded from wwPDB servers. Files stored in this folder can be accessed via
fetchPDB()from any working directory. To release the current folder, pass an invalid path, e.g.
If divided is True, the divided folder structure of wwPDB servers will be assumed when reading from and writing to the local folder. For example, a structure with identifier 1XYZ will be present as
If divided is False, a plain folder structure will be expected and adopted when saving files. For example, the same structure will be present as
Finally, in either case, lower case letters will be used and compressed files will be stored.
Returns or specify PDB mirror path to be used by
fetchPDB(). To release the current mirror, pass an invalid path, e.g.
path=''. If you are keeping a partial mirror, such as PDB files in
/data/structures/divided/pdb/folder, specify format, which is
'pdb'in this case.
Returns path(s) to PDB file(s) for specified pdb identifier(s). Files will be sought in user specified folder or current working director, and then in local PDB folder and mirror, if they are available. If copy is set True, files will be copied into folder. If compressed is False, all files will be decompressed. See
pathPDBMirror()for managing local resources,
fetchPDBviaFTP()for downloading files from PDB servers.
Returns path(s) to PDB (default), PDBML, or mmCIF file(s) for specified pdb identifier(s). If a folder is specified, files will be copied into this folder. If compressed is False, files will decompressed. format argument can be used to get PDBML and mmCIF files:
format='cif'will fetch an mmCIF file, and
format='xml'will fetch a PDBML file. If PDBML header file is desired,
noatom=Trueargument will do the job.
iterPDBFilenames(path=None, sort=False, unique=True, **kwargs)¶
Yield PDB filenames in path specified by the user or in local PDB mirror (see
pathPDBMirror()). When unique is True, files one of potentially identical files will be yielded (e.g.
.entextensions, and compressed files are considered.
findPDBFiles(path, case=None, **kwargs)¶
Returns a dictionary that maps PDB filenames to file paths. If case is specified (
'l[ower]'), dictionary keys (filenames) will be modified accordingly. If a PDB filename has
pdbprefix, it will be trimmed, for example
'1mkp'will be mapped to file path
./pdb1mkp.pdb.gz). If a file is present with multiple extensions, only one of them will be returned. See also