schrodinger.protein.getpdb_utility module¶
Copy a PDB file out of the PDB directory, or, if not found, download it from the rcsb repository: https://rcsb.org/.
Note: the location of the PDB directory can be specified via environment variables; the order of precedence is:
SCHRODINGER_PDB
SCHRODINGER_THIRDPARTY
SCHRODINGER/thirdparty (the default)
Copyright Schrodinger, LLC. All rights reserved.
- class schrodinger.protein.getpdb_utility.WholePDB(code)[source]¶
Bases:
object
Class to take care of the file work for entire PDB files.
- __init__(code)[source]¶
Create a WholePDB object.
- Parameters
code (str) – the PDB code for this file
- class schrodinger.protein.getpdb_utility.Chain(name, code, debug=False)[source]¶
Bases:
object
Class to handle splitting a chain out of a PDB file.
- __init__(name, code, debug=False)[source]¶
Create a Chain object.
- Parameters
code (str) – The PDB code of the parent PDB file
name (1 character string) – the Chain ID to extract
- write(line)[source]¶
Write a line to the chain file if it applies to this chain.
- Parameters
line (str) – the current line of the PDB file.
- class schrodinger.protein.getpdb_utility.Code(code, debug=False)[source]¶
Bases:
object
Class to handle all the various files for each PDB code.
- __init__(code, debug=False)[source]¶
Create a Code object.
- Parameters
code (str) – the 4-letter PDB code
- addChain(chain)[source]¶
Add another Chain ID to be extracted from the parent file.
- Parameters
chain (1 character string or None) – The Chain ID to be extracted. If chain is None, then the whole PDB file is desired.
- sidechains()[source]¶
Check if any chains are to be extracted.
- Return type
bool
- Returns
True if any chains are to be extracted, False if not
- findLocally(local_dirs)[source]¶
Check a series of local directories and filenames for the PDB files.
First we look for current files ending in .gz or .Z, then obsolete files with the same endings. The file name we search for is:
pdbXXXX.ent.Y where XXXX is the PDB code and Y is either gz or Z
- openFiles(web=False)[source]¶
Prepare all the chain and whole PDB files for writing.
- Parameters
web (bool) – True if the source file is from the web, False if not. In this case “from the web” means uncompressed and in the destination directory with the correct name.
- write(line)[source]¶
Write line to each of the appropriate files
- Parameters
line (str) – the current line from the source PDB file.
- schrodinger.protein.getpdb_utility.invalid_code(acode)[source]¶
Print a warning that a given code is invalid
- schrodinger.protein.getpdb_utility.download_format(pdb_code, file_format)[source]¶
Attemps to download the file of requested format for the given given PDB ID and (optinally) chain.
- Parameters
pdb_code (str) – PDB ID of the file to download
file_format (str) – Format extension. One of: pdb, cif, xml, sf, fasta.