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

Module selection

source code

Module for selecting and deselecting spins.

Functions [hide private]
bool
boolean_deselect(current=None, boolean=None)
Return the new boolean deselection result using the current selection.
source code
bool
boolean_select(current=None, boolean=None)
Return the new boolean selection result using the current selection.
source code
 
desel_all()
Deselect all spins.
source code
 
desel_interatom(spin_id1=None, spin_id2=None, boolean='AND', change_all=False)
Deselect specific interatomic data containers.
source code
 
desel_read(file=None, dir=None, file_data=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 the given file.
source code
 
desel_spin(spin_id=None, boolean='AND', change_all=False)
Deselect specific spins.
source code
 
is_mol_selected(selection=None)
Query if the molecule is selected.
source code
 
is_res_selected(selection=None)
Query if the residue is selected.
source code
 
is_spin_selected(selection=None)
Query if the spin is selected.
source code
 
reverse(spin_id=None)
Reversal of spin selections.
source code
 
sel_all()
Select all residues.
source code
 
sel_interatom(spin_id1=None, spin_id2=None, boolean='OR', change_all=False)
Select specific interatomic data containers.
source code
 
sel_read(file=None, dir=None, file_data=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 the given file.
source code
 
sel_spin(spin_id=None, boolean='OR', change_all=False)
Select specific spins.
source code
Variables [hide private]
  uf_tables = Uf_tables()
  boolean_doc = Desc_container("Boolean operators")
  table = uf_tables.add_table(label= "table: bool operators", ca...
  __package__ = 'generic_fns'

Imports: warn, interatomic_loop, exists_mol_res_spin_data, generate_spin_id_unique, return_spin, spin_loop, pipes, RelaxError, RelaxNoSequenceError, read_spin_data, RelaxNoSpinWarning, Uf_tables, Desc_container


Function Details [hide private]

boolean_deselect(current=None, boolean=None)

source code 

Return the new boolean deselection result using the current selection.

Parameters:
  • current (bool) - The current selection state.
  • boolean (str) - The boolean operator used to select with. It can be one of 'OR', 'NOR', 'AND', 'NAND', 'XOR', or 'XNOR'.
Returns: bool
The new selection state.

boolean_select(current=None, boolean=None)

source code 

Return the new boolean selection result using the current selection.

Parameters:
  • current (bool) - The current selection state.
  • boolean (str) - The boolean operator used to select with. It can be one of 'OR', 'NOR', 'AND', 'NAND', 'XOR', or 'XNOR'.
Returns: bool
The new selection state.

desel_all()

source code 

Deselect all spins.

Raises:

desel_interatom(spin_id1=None, spin_id2=None, boolean='AND', change_all=False)

source code 

Deselect specific interatomic data containers.

Parameters:
  • spin_id1 (str or None) - The spin ID string of the first spin of the pair.
  • spin_id2 (str or None) - The spin ID string of the second spin of the pair.
  • boolean (str) - The boolean operator used to deselect the spin systems with. It can be one of 'OR', 'NOR', 'AND', 'NAND', 'XOR', or 'XNOR'. This will be ignored if the change_all flag is set.
  • change_all (bool) - A flag which if True will cause all spins not specified in the file to be selected. Only the boolean operator 'AND' is compatible with this flag set to True (all others will be ignored).
Raises:

desel_read(file=None, dir=None, file_data=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 the given file.

Parameters:
  • file (str) - The name of the file to open.
  • dir (str or None) - The directory containing the file (defaults to the current directory if None).
  • file_data (list of lists) - An alternative opening a file, if the data already exists in the correct format. The format is a list of lists where the first index corresponds to the row and the second the column.
  • spin_id_col (int or None) - The column containing the spin ID strings. If supplied, the mol_name_col, res_name_col, res_num_col, spin_name_col, and spin_num_col arguments must be none.
  • mol_name_col (int or None) - The column containing the molecule name information. If supplied, spin_id_col must be None.
  • res_name_col (int or None) - The column containing the residue name information. If supplied, spin_id_col must be None.
  • res_num_col (int or None) - The column containing the residue number information. If supplied, spin_id_col must be None.
  • spin_name_col (int or None) - The column containing the spin name information. If supplied, spin_id_col must be None.
  • spin_num_col (int or None) - The column containing the spin number information. If supplied, spin_id_col must be None.
  • sep (str or None) - The column separator which, if None, defaults to whitespace.
  • spin_id (None or str) - The spin ID string used to restrict data loading to a subset of all spins.
  • boolean (str) - The boolean operator used to deselect the spin systems with. It can be one of 'OR', 'NOR', 'AND', 'NAND', 'XOR', or 'XNOR'. This will be ignored if the change_all flag is set.
  • change_all (bool) - A flag which if True will cause all spins not specified in the file to be selected. Only the boolean operator 'AND' is compatible with this flag set to True (all others will be ignored).
Raises:

desel_spin(spin_id=None, boolean='AND', change_all=False)

source code 

Deselect specific spins.

Parameters:
  • spin_id (str or None) - The spin identification string.
  • boolean (str) - The boolean operator used to deselect the spin systems with. It can be one of 'OR', 'NOR', 'AND', 'NAND', 'XOR', or 'XNOR'. This will be ignored if the change_all flag is set.
  • change_all (bool) - A flag which if True will cause all spins not specified in the file to be selected. Only the boolean operator 'AND' is compatible with this flag set to True (all others will be ignored).
Raises:

is_mol_selected(selection=None)

source code 

Query if the molecule is selected.

Parameters:
  • selection (str) - The molecule ID string.

is_res_selected(selection=None)

source code 

Query if the residue is selected.

Parameters:
  • selection (str) - The residue ID string.

is_spin_selected(selection=None)

source code 

Query if the spin is selected.

Parameters:
  • selection (str) - The molecule ID string.

reverse(spin_id=None)

source code 

Reversal of spin selections.

Parameters:
  • spin_id (str or None) - The spin identification string.
Raises:

sel_all()

source code 

Select all residues.

Raises:

sel_interatom(spin_id1=None, spin_id2=None, boolean='OR', change_all=False)

source code 

Select specific interatomic data containers.

Parameters:
  • spin_id1 (str or None) - The spin ID string of the first spin of the pair.
  • spin_id2 (str or None) - The spin ID string of the second spin of the pair.
  • boolean (str) - The boolean operator used to select the spin systems with. It can be one of 'OR', 'NOR', 'AND', 'NAND', 'XOR', or 'XNOR'. This will be ignored if the change_all flag is set.
  • change_all (bool) - A flag which if True will cause all spins not specified in the file to be deselected. Only the boolean operator 'OR' is compatible with this flag set to True (all others will be ignored).
Raises:

sel_read(file=None, dir=None, file_data=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 the given file.

Parameters:
  • file (str) - The name of the file to open.
  • dir (str or None) - The directory containing the file (defaults to the current directory if None).
  • file_data (list of lists) - An alternative opening a file, if the data already exists in the correct format. The format is a list of lists where the first index corresponds to the row and the second the column.
  • spin_id_col (int or None) - The column containing the spin ID strings. If supplied, the mol_name_col, res_name_col, res_num_col, spin_name_col, and spin_num_col arguments must be none.
  • mol_name_col (int or None) - The column containing the molecule name information. If supplied, spin_id_col must be None.
  • res_name_col (int or None) - The column containing the residue name information. If supplied, spin_id_col must be None.
  • res_num_col (int or None) - The column containing the residue number information. If supplied, spin_id_col must be None.
  • spin_name_col (int or None) - The column containing the spin name information. If supplied, spin_id_col must be None.
  • spin_num_col (int or None) - The column containing the spin number information. If supplied, spin_id_col must be None.
  • sep (str or None) - The column separator which, if None, defaults to whitespace.
  • spin_id (None or str) - The spin ID string used to restrict data loading to a subset of all spins.
  • boolean (str) - The boolean operator used to select the spin systems with. It can be one of 'OR', 'NOR', 'AND', 'NAND', 'XOR', or 'XNOR'. This will be ignored if the change_all flag is set.
  • change_all (bool) - A flag which if True will cause all spins not specified in the file to be deselected. Only the boolean operator 'OR' is compatible with this flag set to True (all others will be ignored).
Raises:

sel_spin(spin_id=None, boolean='OR', change_all=False)

source code 

Select specific spins.

Parameters:
  • spin_id (str or None) - The spin identification string.
  • boolean (str) - The boolean operator used to select the spin systems with. It can be one of 'OR', 'NOR', 'AND', 'NAND', 'XOR', or 'XNOR'. This will be ignored if the change_all flag is set.
  • change_all (bool) - A flag which if True will cause all spins not specified in the file to be deselected. Only the boolean operator 'OR' is compatible with this flag set to True (all others will be ignored).
Raises:

Variables Details [hide private]

table

Value:
uf_tables.add_table(label= "table: bool operators", caption= "Boolean \
operators and their effects on selections")