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.

schrodinger.protein.getpdb_utility.parse_arguments(args)
class schrodinger.protein.getpdb_utility.WholePDB(code)

Bases: object

Class to take care of the file work for entire PDB files.

__init__(code)

Create a WholePDB object.

Parameters:code (str) – the PDB code for this file
openFile(web)
write(line)

If we are writing a file, add this line to it.

Parameters:line (str) – The line to add to the file
closeFile()

Close the file if it is open

checkOK()

This is just a stub routine for compatibility with the Chain class

Return type:bool
Returns:True
class schrodinger.protein.getpdb_utility.Chain(name, code, debug=False)

Bases: object

Class to handle splitting a chain out of a PDB file.

__init__(name, code, debug=False)

Create a Chain object.

Parameters:
  • code (str) – The PDB code of the parent PDB file
  • name (1 character string) – the Chain ID to extract
openFile(web)
write(line)

Write a line to the chain file if it applies to this chain.

Parameters:line (str) – the current line of the PDB file.
checkOK()

Check to see if everything went OK writing the file.

Return type:bool
Returns:True if everything checks out OK, false if not
closeFile()

Add the END tag and close the chain file

class schrodinger.protein.getpdb_utility.Code(code, debug=False)

Bases: object

Class to handle all the various files for each PDB code.

__init__(code, debug=False)

Create a Code object.

Parameters:code (str) – the 4-letter PDB code
addChain(chain)

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()

Check if any chains are to be extracted.

Return type:bool
Returns:True if any chains are to be extracted, False if not
wholePDB()

Returns True if the whole PDB file should be kept

findLocally(local_dirs)

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

handleObsolete()

Print a warning if we are using a file from the obsolete directory

openFiles(web=False)

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)

Write line to each of the appropriate files

Parameters:line (str) – the current line from the source PDB file.
checkOK()

Check to make sure all the files were written properly.

Return type:bool
Returns:True if all the files were written properly, False if there were any problems.
closeFiles()

Close all the files

merge_biologic_unit(pdb_file)
schrodinger.protein.getpdb_utility.invalid_code(acode)

Print a warning that a given code is invalid

schrodinger.protein.getpdb_utility.download_format(pdb_code, file_format, chain=None)

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.
  • chain (str or None) – The chain name to download. If None, the file will contain all chains
schrodinger.protein.getpdb_utility.from_maestro(*args)
schrodinger.protein.getpdb_utility.main(args)