Package generic_fns :: Package structure :: Module scientific :: Class Scientific_data
[hide private]
[frames] | no frames]

Class Scientific_data

source code


The Scientific Python specific data object.

Instance Methods [hide private]
 
__init__(self)
Initialise the class.
source code
tuple consisting of the atom number (int), atom name (str), element name (str), and atomic position (Numeric array of len 3)
__find_bonded_atom(self, attached_atom, mol_type, res)
Find the atom named attached_atom directly bonded to the desired atom.
source code
(Scientific Python PDB object, str, str)
__residue_loop(self, mol, sel_obj=None)
Generator function for looping over all residues in the Scientific PDB data objects.
source code
tuple consisting of optional molecule name (str), residue number (int), residue name (str), atom number (int), atom name(str), element name (str), and atomic position (array of len 3).
atom_loop(self, atom_id=None, str_id=None, model_num=None, model_num_flag=False, mol_name_flag=False, res_num_flag=False, res_name_flag=False, atom_num_flag=False, atom_name_flag=False, element_flag=False, pos_flag=False, ave=False)
Generator function for looping over all atoms in the Scientific Python data objects.
source code
tuple consisting of the atom number (int), atom name (str), element name (str), and atomic positions for each model (list of numpy arrays)
attached_atom(self, atom_id=None, attached_atom=None, model=None)
Find the atom corresponding to 'attached_atom' which is bonded to the atom of 'atom_id'.
source code
 
__ave_atom_pos(self, mol_index, res_index, atom_index)
Determine the average atom position across all models.
source code
list of numpy arrays
bond_vectors(self, attached_atom=None, model_num=None, mol_name=None, res_num=None, res_name=None, spin_num=None, spin_name=None, return_name=False, return_warnings=False)
Find the bond vectors between the atoms of 'attached_atom' and 'atom_id'.
source code
bool
load_pdb(self, file_path, read_mol=None, set_mol_name=None, read_model=None, set_model_num=None, verbosity=False)
Function for loading the structures from the PDB file.
source code

Inherited from api_base.Base_struct_API: add_atom, add_model, add_molecule, connect_atom, delete, empty, from_xml, get_model, get_molecule, load_xyz, model_loop, num_models, num_molecules, pack_structs, rotate, target_mol_name, to_xml, translate, validate, validate_models, write_pdb

Class Variables [hide private]
  id = 'scientific'
Method Details [hide private]

__init__(self)
(Constructor)

source code 

Initialise the class.

Overrides: api_base.Base_struct_API.__init__

__find_bonded_atom(self, attached_atom, mol_type, res)

source code 

Find the atom named attached_atom directly bonded to the desired atom.

Parameters:
  • attached_atom (str) - The name of the attached atom to return.
  • mol_type (str) - The type of the molecule. This can be one of 'protein', 'nucleic acid', or 'other'.
  • res (Scientific Python residue instance) - The Scientific Python residue object.
Returns: tuple consisting of the atom number (int), atom name (str), element name (str), and atomic position (Numeric array of len 3)
A tuple of information about the bonded atom.

__residue_loop(self, mol, sel_obj=None)

source code 

Generator function for looping over all residues in the Scientific PDB data objects.

Parameters:
  • mol (Scientific Python PDB object) - The individual molecule Scientific Python PDB data object.
  • sel_obj (instance of generic_fns.mol_res_spin.Selection) - The selection object.
Returns: (Scientific Python PDB object, str, str)
A tuple of the Scientific Python PDB object representing a single residue, the residue number, and residue name.

atom_loop(self, atom_id=None, str_id=None, model_num=None, model_num_flag=False, mol_name_flag=False, res_num_flag=False, res_name_flag=False, atom_num_flag=False, atom_name_flag=False, element_flag=False, pos_flag=False, ave=False)

source code 

Generator function for looping over all atoms in the Scientific Python data objects.

Parameters:
  • atom_id (str) - The molecule, residue, and atom identifier string. Only atoms matching this selection will be yielded.
  • str_id (str, int, or None) - The structure identifier. This can be the file name, model number, or structure number. If None, then all structures will be looped over.
  • model_num (int or None) - Only loop over a specific model.
  • model_num_flag (bool) - A flag which if True will cause the model number to be yielded.
  • mol_name_flag (bool) - A flag which if True will cause the molecule name to be yielded.
  • res_num_flag (bool) - A flag which if True will cause the residue number to be yielded.
  • res_name_flag (bool) - A flag which if True will cause the residue name to be yielded.
  • atom_num_flag (bool) - A flag which if True will cause the atom number to be yielded.
  • atom_name_flag (bool) - A flag which if True will cause the atom name to be yielded.
  • element_flag (bool) - A flag which if True will cause the element name to be yielded.
  • pos_flag (bool average atom properties across all loaded structures.) - A flag which if True will cause the atomic position to be yielded.
  • ave (bool)
Returns: tuple consisting of optional molecule name (str), residue number (int), residue name (str), atom number (int), atom name(str), element name (str), and atomic position (array of len 3).
A tuple of atomic information, as described in the docstring.
Overrides: api_base.Base_struct_API.atom_loop

attached_atom(self, atom_id=None, attached_atom=None, model=None)

source code 

Find the atom corresponding to 'attached_atom' which is bonded to the atom of 'atom_id'.

Parameters:
  • atom_id (str) - The molecule, residue, and atom identifier string. This must correspond to a single atom in the system.
  • attached_atom (str) - The name of the attached atom to return.
  • model (None or int) - The model to return the positional information from. If not supplied and multiple models exist, then the returned atomic position will be a list of the positions in each model.
Returns: tuple consisting of the atom number (int), atom name (str), element name (str), and atomic positions for each model (list of numpy arrays)
A tuple of information about the bonded atom.
Overrides: api_base.Base_struct_API.attached_atom

__ave_atom_pos(self, mol_index, res_index, atom_index)

source code 

Determine the average atom position across all models.

Parameters:
  • mol_index (int) - The molecule index.
  • res_index (int) - The residue index.
  • atom_index (int) - The atom index.

bond_vectors(self, attached_atom=None, model_num=None, mol_name=None, res_num=None, res_name=None, spin_num=None, spin_name=None, return_name=False, return_warnings=False)

source code 

Find the bond vectors between the atoms of 'attached_atom' and 'atom_id'.

Parameters:
  • attached_atom (str) - The name of the bonded atom.
  • model_num (None or int) - The model of which to return the vectors from. If not supplied and multiple models exist, then vectors from all models will be returned.
  • mol_name (str) - The name of the molecule that attached_atom belongs to.
  • res_num (str) - The number of the residue that attached_atom belongs to.
  • res_name (str) - The name of the residue that attached_atom belongs to.
  • spin_num (str) - The number of the spin that attached_atom is attached to.
  • spin_name (str) - The name of the spin that attached_atom is attached to.
  • return_name (bool) - A flag which if True will cause the name of the attached atom to be returned together with the bond vectors.
  • return_warnings (bool) - A flag which if True will cause warning messages to be returned.
Returns: list of numpy arrays
The list of bond vectors for each structure.
Overrides: api_base.Base_struct_API.bond_vectors

load_pdb(self, file_path, read_mol=None, set_mol_name=None, read_model=None, set_model_num=None, verbosity=False)

source code 

Function for loading the structures from the PDB file.

Parameters:
  • file_path (str) - The full path of the file.
  • read_mol (None, int, or list of int) - The molecule(s) to read from the file, independent of model. The molecules are determined differently by the different parsers, but are numbered consecutively from 1. If set to None, then all molecules will be loaded.
  • set_mol_name (None, str, or list of str) - Set the names of the molecules which are loaded. If set to None, then the molecules will be automatically labelled based on the file name or other information.
  • read_model (None, int, or list of int) - The PDB model to extract from the file. If set to None, then all models will be loaded.
  • set_model_num (None, int, or list of int) - Set the model number of the loaded molecule. If set to None, then the PDB model numbers will be preserved, if they exist.
  • verbosity (bool) - A flag which if True will cause messages to be printed.
Returns: bool
The status of the loading of the PDB file.
Overrides: api_base.Base_struct_API.load_pdb