Package prompt :: Module deselect :: Class Deselect
[hide private]
[frames] | no frames]

Class Deselect

source code


Class for deselecting spins.

Instance Methods [hide private]
 
all(self)
Deselect 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='AND', change_all=False)
Deselect 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, change_all=False)
Deselect specific spins.
source code

Inherited from base_class.User_fn_class: __init__

Method Details [hide private]

all(self)

source code 
Deselect all spins.

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

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


Examples
~~~~~~~~

To deselect all spins, simply type:

relax> deselect.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='AND', change_all=False)

source code 
Deselect the spins contained in a file.

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

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

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 selected.


Examples
~~~~~~~~

To deselect all overlapped residues listed with residue numbers in the first column of the
file 'unresolved', type one of:

relax> deselect.read('unresolved', res_num_col=1)
relax> deselect.read(file='unresolved', res_num_col=1)

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

relax> deselect.read('r1.600', spin_num_col=2, change_all=True)
relax> deselect.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 deselect all currently selected spins and select those which are deselected type:

relax> deselect.reverse()

spin(self, spin_id=None, change_all=False)

source code 
Deselect specific spins.

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

spin_id:  The spin ID string.

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 deselect all glycines and alanines, type:

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

To deselect residue 12 MET type:

relax> deselect.spin(':12')
relax> deselect.spin(spin_id=':12')
relax> deselect.spin(spin_id=':12&:MET')