Package lib :: Module selection :: Class Selection
[hide private]
[frames] | no frames]

Class Selection

source code


An object containing mol-res-spin selections.

A Selection object represents either a set of selected molecules, residues and spins, or the union or intersection of two other Selection objects.

Instance Methods [hide private]
 
__init__(self, select_string)
Initialise a Selection object.
source code
bool
contains_mol(self, mol=None)
Determine if the molecule name, in string form, is contained in this selection object.
source code
bool
contains_res(self, res_num=None, res_name=None, mol=None)
Determine if the residue name, in string form, is contained in this selection object.
source code
bool
contains_spin(self, spin_num=None, spin_name=None, res_num=None, res_name=None, mol=None)
Determine if the spin is contained in this selection object.
source code
bool
contains_spin_id(self, spin_id)
Is the molecule, residue, and/or spin of the spin_id string located in the selection.
source code
bool
has_molecules(self)
Determine if the selection object contains molecules.
source code
bool
has_residues(self)
Determine if the selection object contains residues.
source code
bool
has_spins(self)
Determine if the selection object contains spins.
source code
 
intersection(self, select_obj0, select_obj1)
Make this Selection object the intersection of two other Selection objects.
source code
 
union(self, select_obj0, select_obj1)
Make this Selection object the union of two other Selection objects.
source code

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, select_string)
(Constructor)

source code 

Initialise a Selection object.

Parameters:
  • select_string (string) - A mol-res-spin selection string.
Overrides: object.__init__

contains_mol(self, mol=None)

source code 

Determine if the molecule name, in string form, is contained in this selection object.

Parameters:
  • mol (str or None) - The name of the molecule.
Returns: bool
The answer of whether the molecule is contained withing the selection object.

contains_res(self, res_num=None, res_name=None, mol=None)

source code 

Determine if the residue name, in string form, is contained in this selection object.

Parameters:
  • res_num (int or None) - The residue number.
  • res_name (str or None) - The residue name.
  • mol (str or None) - The molecule name.
Returns: bool
The answer of whether the molecule is contained withing the selection object.

contains_spin(self, spin_num=None, spin_name=None, res_num=None, res_name=None, mol=None)

source code 

Determine if the spin is contained in this selection object.

Parameters:
  • spin_num (int or None) - The spin number.
  • spin_name (str or None) - The spin name.
  • res_num (int or None) - The residue number.
  • res_name (str or None) - The residue name.
  • mol (str or None) - The molecule name.
Returns: bool
The answer of whether the spin is contained withing the selection object.

contains_spin_id(self, spin_id)

source code 

Is the molecule, residue, and/or spin of the spin_id string located in the selection.

Only the simple selections allowed by the tokenise function are currently supported.

Parameters:
  • spin_id (str) - The spin identification string.
Returns: bool
The answer of whether the molecule, residue, and/or spin corresponding to the spin_id string found within the selection object.

has_molecules(self)

source code 

Determine if the selection object contains molecules.

Returns: bool
The answer of whether the selection contains molecules.

has_residues(self)

source code 

Determine if the selection object contains residues.

Returns: bool
The answer of whether the selection contains residues.

has_spins(self)

source code 

Determine if the selection object contains spins.

Returns: bool
The answer of whether the selection contains spins.

intersection(self, select_obj0, select_obj1)

source code 

Make this Selection object the intersection of two other Selection objects.

Parameters:
  • select_obj0 (Selection instance.) - First Selection object in intersection.
  • select_obj1 (Selection instance.) - First Selection object in intersection.

union(self, select_obj0, select_obj1)

source code 

Make this Selection object the union of two other Selection objects.

Parameters:
  • select_obj0 (Selection instance.) - First Selection object in intersection.
  • select_obj1 (Selection instance.) - First Selection object in intersection.