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

Module selection

source code

Classes [hide private]
  Selection
An object containing mol-res-spin selections.
Functions [hide private]
list of int and str
parse_token(token, verbosity=False)
Parse the token string and return a list of identifying numbers and names.
source code
3-tuple of str or None
tokenise(selection)
Split the input selection string returning the mol_token, res_token, and spin_token strings.
source code
str, int, str, int, str
spin_id_to_data_list(id)
Convert the single spin ID string into a list of the mol, res, and spin names and numbers.
source code
Variables [hide private]
  __package__ = None
hash(x)

Imports: warn, regex, is_unicode, RelaxError, RelaxWarning


Function Details [hide private]

parse_token(token, verbosity=False)

source code 

Parse the token string and return a list of identifying numbers and names.

Firstly the token is split by the ',' character into its individual elements and all whitespace stripped from the elements. Numbers are converted to integers, names are left as strings, and ranges are converted into the full list of integers.

Parameters:
  • token (str) - The identification string, the elements of which are separated by commas. Each element can be either a single number, a range of numbers (two numbers separated by '-'), or a name.
  • verbosity (bool) - A flag which if True will cause a number of printouts to be activated.
Returns: list of int and str
A list of identifying numbers and names.

tokenise(selection)

source code 

Split the input selection string returning the mol_token, res_token, and spin_token strings.

The mol_token is identified as the text from the '#' to either the ':' or '@' characters or the end of the string.

The res_token is identified as the text from the ':' to either the '@' character or the end of the string.

The spin_token is identified as the text from the '@' to the end of the string.

Parameters:
  • selection (str) - The selection identifier.
Returns: 3-tuple of str or None
The mol_token, res_token, and spin_token.

spin_id_to_data_list(id)

source code 

Convert the single spin ID string into a list of the mol, res, and spin names and numbers.

Parameters:
  • id (str) - The spin ID string.
Returns: str, int, str, int, str
The molecule name, the residue number and name, and the spin number and name.