Package prompt :: Module select :: Class Select
[hide private]
[frames] | no frames]

Class Select

source code


Class for selecting spins.

Instance Methods [hide private]
 
all(self)
Select all spins.
source code
 
read(self, file=None, dir=None, spin_id_col=None, mol_name_col=None, res_num_col=None, res_name_col=None, spin_num_col=None, spin_name_col=None, sep=None, spin_id=None, boolean='OR', change_all=False)
Select the spins contained in a file.
source code
 
reverse(self, spin_id=None)
Reversal of the spin selection for the given spins.
source code
 
spin(self, spin_id=None, boolean='OR', change_all=False)
Select specific spins.
source code

Inherited from base_class.User_fn_class: __init__

Method Details [hide private]

all(self)

source code 
Select all spins.

Description
~~~~~~~~~~~

This will select all spins, irregardless of their current state.


Examples
~~~~~~~~

To select all spins, simply type:

relax> select.all()

read(self, file=None, dir=None, spin_id_col=None, mol_name_col=None, res_num_col=None, res_name_col=None, spin_num_col=None, spin_name_col=None, sep=None, spin_id=None, boolean='OR', change_all=False)

source code 
Select the spins contained in a file.

Keyword Arguments
~~~~~~~~~~~~~~~~~

file:  The name of the file containing the list of spins to select.

dir:  The directory where the file is located.

spin_id_col:  The spin ID string column (an alternative to the mol, res, and spin name and number
columns).

mol_name_col:  The molecule name column (alternative to the spin_id_col).

res_num_col:  The residue number column (alternative to the spin_id_col).

res_name_col:  The residue name column (alternative to the spin_id_col).

spin_num_col:  The spin number column (alternative to the spin_id_col).

spin_name_col:  The spin name column (alternative to the spin_id_col).

data_col:  The RDC data column.

error_col:  The experimental error column.

sep:  The column separator (the default is white space).

spin_id:  The spin ID string to restrict the loading of data to certain spin subsets.

boolean:  The boolean operator specifying how spins should be selected.

change_all:  A flag specifying if all other spins should be changed.


Description
~~~~~~~~~~~

The spin system can be identified in the file using two different formats.  The first is the spin ID
string column which can include the molecule name, the residue name and number, and the spin name
and number.  Alternatively the molecule name, residue number, residue name, spin number and/or spin
name columns can be supplied allowing this information to be in separate columns.  Note that the
numbering of columns starts at one.  The spin ID string can be used to restrict the reading to
certain spin types, for example only 15N spins when only residue information is in the file.

Empty lines and lines beginning with a hash are ignored.

The 'change all' flag default is False meaning that all spins currently either selected or
deselected will remain that way.  Setting this to True will cause all spins not specified in the
file to be deselected.


Examples
~~~~~~~~

To select all residues listed with residue numbers in the first column of the file
'isolated_peaks', type one of:

relax> select.read('isolated_peaks', res_num_col=1)
relax> select.read(file='isolated_peaks', res_num_col=1)

To select the spins in the second column of the relaxation data file 'r1.600' while
deselecting all other spins, for example type:

relax> select.read('r1.600', spin_num_col=2, change_all=True)
relax> select.read(file='r1.600', spin_num_col=2, change_all=True)


Boolean operators
~~~~~~~~~~~~~~~~~

The boolean operator can be used to change how spin systems are selected.  The allowed values are:
'OR', 'NOR', 'AND', 'NAND', 'XOR', 'XNOR'.  The following table details how the selections will
occur for the different boolean operators.
__________________________________________________________
|                    |   |   |   |   |   |   |   |   |   |
| Spin system        | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
|____________________|___|___|___|___|___|___|___|___|___|
|                    |   |   |   |   |   |   |   |   |   |
| Original selection | 0 | 1 | 1 | 1 | 1 | 0 | 1 | 0 | 1 |
|                    |   |   |   |   |   |   |   |   |   |
| New selection      | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 |
|                    |   |   |   |   |   |   |   |   |   |
| OR                 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 1 |
|                    |   |   |   |   |   |   |   |   |   |
| NOR                | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 |
|                    |   |   |   |   |   |   |   |   |   |
| AND                | 0 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 |
|                    |   |   |   |   |   |   |   |   |   |
| NAND               | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 |
|                    |   |   |   |   |   |   |   |   |   |
| XOR                | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 |
|                    |   |   |   |   |   |   |   |   |   |
| XNOR               | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 1 | 0 |
|____________________|___|___|___|___|___|___|___|___|___|

reverse(self, spin_id=None)

source code 
Reversal of the spin selection for the given spins.

Keyword Arguments
~~~~~~~~~~~~~~~~~

spin_id:  The spin ID string.


Description
~~~~~~~~~~~

By supplying the spin ID string, a subset of spins can have their selection status reversed.


Examples
~~~~~~~~

To select all currently deselected spins and deselect those which are selected type:

relax> select.reverse()

spin(self, spin_id=None, boolean='OR', change_all=False)

source code 
Select specific spins.

Keyword Arguments
~~~~~~~~~~~~~~~~~

spin_id:  The spin ID string.

boolean:  The boolean operator specifying how spins should be selected.

change_all:  A flag specifying if all other spins should be changed.


Description
~~~~~~~~~~~

The 'change all' flag default is False meaning that all spins currently either selected or
deselected will remain that way.  Setting this to True will cause all spins not specified by the
spin ID string to be selected.


Examples
~~~~~~~~

To select only glycines and alanines, assuming they have been loaded with the names GLY and
ALA, type one of:

relax> select.spin(spin_id=':GLY|:ALA')

To select residue 5 CYS in addition to the currently selected residues, type one of:

relax> select.spin(':5')
relax> select.spin(':5&:CYS')
relax> select.spin(spin_id=':5&:CYS')


Boolean operators
~~~~~~~~~~~~~~~~~

The boolean operator can be used to change how spin systems are selected.  The allowed values are:
'OR', 'NOR', 'AND', 'NAND', 'XOR', 'XNOR'.  The following table details how the selections will
occur for the different boolean operators.
__________________________________________________________
|                    |   |   |   |   |   |   |   |   |   |
| Spin system        | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
|____________________|___|___|___|___|___|___|___|___|___|
|                    |   |   |   |   |   |   |   |   |   |
| Original selection | 0 | 1 | 1 | 1 | 1 | 0 | 1 | 0 | 1 |
|                    |   |   |   |   |   |   |   |   |   |
| New selection      | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 |
|                    |   |   |   |   |   |   |   |   |   |
| OR                 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 1 |
|                    |   |   |   |   |   |   |   |   |   |
| NOR                | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 |
|                    |   |   |   |   |   |   |   |   |   |
| AND                | 0 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 |
|                    |   |   |   |   |   |   |   |   |   |
| NAND               | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 |
|                    |   |   |   |   |   |   |   |   |   |
| XOR                | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 |
|                    |   |   |   |   |   |   |   |   |   |
| XNOR               | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 1 | 0 |
|____________________|___|___|___|___|___|___|___|___|___|