Package Scientific :: Package IO :: Module PDB :: Class Structure
[hide private]
[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 [hide private]
  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 [hide private]
  __getitem__(self, item)
  __init__(self, filename, model=0, alternate_code='A')
Constructor: Structure(|filename|, |model|='0', |alternate_code|='"A"'),
  __len__(self)
  __repr__(self)
  _joinChains(self, constructor, chain_list, first, second)
  _splitChain(self, constructor, chain_list, number, position)
  addMolecule(self, molecule)
  deleteHydrogens(self)
Remove all hydrogen atoms
  extractData(self, data)
  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 [hide private]

__getitem__(self, item)
(Indexing operator)

 

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

 

Constructor: Structure(|filename|, |model|='0', |alternate_code|='"A"'),
Parameters:
  • filename (str) - the name of the PDB file. 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.

__len__(self)
(Length operator)

 

__repr__(self)
(Representation operator)

 

_joinChains(self, constructor, chain_list, first, second)

 

_splitChain(self, constructor, chain_list, number, position)

 

addMolecule(self, molecule)

 

deleteHydrogens(self)

 

Remove all hydrogen atoms

extractData(self, data)

 

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

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

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