Package schrodinger :: Package protein :: Module getpdb_utility :: Class Code
[hide private]
[frames] | no frames]

Class Code

object --+
         |
        Code

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

Instance Methods [hide private]
 
__init__(self, code, debug=False)
Create a Code object.
 
addChain(self, chain)
Add another Chain ID to be extracted from the parent file.
bool
sidechains(self)
Check if any chains are to be extracted.
 
wholePDB(self)
Returns True if the whole PDB file should be kept
 
findLocally(self, local_dirs)
Check a series of local directories and filenames for the PDB files.
 
handleObsolete(self)
Print a warning if we are using a file from the obsolete directory
 
openFiles(self, web=False)
Prepare all the chain and whole PDB files for writing.
 
write(self, line)
Write line to each of the appropriate files
bool
checkOK(self)
Check to make sure all the files were written properly.
 
closeFiles(self)
Close all the files

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, code, debug=False)
(Constructor)

 

Create a Code object.

Parameters:
  • code (str) - the 4-letter PDB code
Overrides: object.__init__

addChain(self, 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(self)

 

Check if any chains are to be extracted.

Returns: bool
True if any chains are to be extracted, False if not

findLocally(self, 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

openFiles(self, 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(self, line)

 

Write line to each of the appropriate files

Parameters:
  • line (str) - the current line from the source PDB file.

checkOK(self)

 

Check to make sure all the files were written properly.

Returns: bool
True if all the files were written properly, False if there were any problems.