Package Scientific :: Package IO :: Module PDB :: Class Structure
[frames] | no frames]

Class Structure

A high-level representation of the contents of a PDB file

The components of a structure can be accessed in several ways ('s' is an instance of this class):

An iteration over a Structure instance by a for-loop is equivalent to an iteration over the residue list.

Nested Classes
  molecule_constructor
Molecule in a PDB file
  nucleotide_chain_constructor
Nucleotide chain in a PDB file
  peptide_chain_constructor
Peptide chain in a PDB file
Instance Methods
 
__getitem__(self, item)
 
__init__(self, file_or_filename, model=0, alternate_code='A')
 
__len__(self)
 
__repr__(self)
 
addMolecule(self, molecule)
 
deleteHydrogens(self)
Remove all hydrogen atoms
 
deleteResidue(self, residue)
 
extractData(self, data)
 
findSpaceGroupTransformations(self)
 
joinNucleotideChains(self, first, second)
Join two nucleotide chains into a single one.
 
joinPeptideChains(self, first, second)
Join two peptide chains into a single one.
 
newChain(self, residue, chain_data)
 
newResidue(self, residue_data)
 
parseFile(self, file)
 
renumberAtoms(self)
Renumber all atoms sequentially starting with 1
 
splitNucleotideChain(self, number, position)
Split a nucleotide chain into two chains
 
splitPeptideChain(self, number, position)
Split a peptide chain into two chains
 
writeToFile(self, file)
Write everything to a file
Method Details

__init__(self, file_or_filename, model=0, alternate_code='A')
(Constructor)

 
Parameters:
  • file_or_filename (str or file) - the name of the PDB file, or a file object. Compressed files and URLs are accepted, as for class PDBFile.
  • model (int) - the number of the model to read from a multiple-model file. Only one model can be treated at a time.
  • alternate_code (single-letter str) - the version of the positions to be read from a file with alternate positions.

joinNucleotideChains(self, first, second)

 

Join two nucleotide chains into a single one. The new chain occupies the position of the first chain, the second one is removed from the nucleotide chain list.

Parameters:
  • first (int) - the number of the first chain
  • second (int) - the number of the second chain

joinPeptideChains(self, first, second)

 

Join two peptide chains into a single one. The new chain occupies the position of the first chain, the second one is removed from the peptide chain list.

Parameters:
  • first (int) - the number of the first chain
  • second (int) - the number of the second chain

splitNucleotideChain(self, number, position)

 

Split a nucleotide chain into two chains

The two chain fragments remain adjacent in the nucleotide chain list, i.e. the numbers of all following chains increase by one.

Parameters:
  • number (int) - the number of the nucleotide chain to be split
  • position (int) - the residue index at which the chain is split.

splitPeptideChain(self, number, position)

 

Split a peptide chain into two chains

The two chain fragments remain adjacent in the peptide chain list, i.e. the numbers of all following chains increase by one.

Parameters:
  • number (int) - the number of the peptide chain to be split
  • position (int) - the residue index at which the chain is split.

writeToFile(self, file)

 

Write everything to a file

Parameters:
  • file (PDBFile or str) - a PDB file object or a filename