Package prompt :: Module residue :: Class Residue
[hide private]
[frames] | no frames]

Class Residue

source code


Class for manipulating the residue data.

Instance Methods [hide private]
 
copy(self, pipe_from=None, res_from=None, pipe_to=None, res_to=None)
Copy all data associated with a residue.
source code
 
create(self, res_num=None, res_name=None, mol_name=None)
Create a new residue.
source code
 
delete(self, res_id=None)
Delete residues from the current data pipe.
source code
 
display(self, res_id=None)
Display information about the residue(s).
source code
 
name(self, res_id=None, name=None, force=False)
Name the residues.
source code
 
number(self, res_id=None, number=None, force=False)
Number the residues.
source code

Inherited from base_class.User_fn_class: __init__

Method Details [hide private]

copy(self, pipe_from=None, res_from=None, pipe_to=None, res_to=None)

source code 
Copy all data associated with a residue.

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

pipe_from:  The data pipe containing the residue from which the data will be copied.  This defaults
to the current data pipe.

res_from:  The residue ID string of the residue to copy the data from.

pipe_to:  The data pipe to copy the data to.  This defaults to the current data pipe.

res_to:  The residue ID string of the residue to copy the data to.


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

This will copy all the data associated with the identified residue to the new, non-existent residue.
The new residue cannot currently exist.


Examples
~~~~~~~~

To copy the residue data from residue 1 to the new residue 2, type:

relax> residue.copy(res_from=':1', res_to=':2')


To copy residue 1 of the molecule 'Old mol' to residue 5 of the molecule 'New mol', type:

relax> residue.copy(res_from='#Old mol:1', res_to='#New mol:5')


To copy the residue data of residue 1 from the data pipe 'm1' to 'm2', assuming the current
data pipe is 'm1', type:

relax> residue.copy(res_from=':1', pipe_to='m2')
relax> residue.copy(pipe_from='m1', res_from=':1', pipe_to='m2', res_to=':1')

create(self, res_num=None, res_name=None, mol_name=None)

source code 
Create a new residue.

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

res_num:  The residue number.

res_name:  The name of the residue.

mol_name:  The name of the molecule to add the residue to.


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

Using this, a new sequence can be generated without using the sequence user functions.  However if
the sequence already exists, the new residue will be added to the end of the residue list (the
residue numbers of this list need not be sequential).  The same residue number cannot be used more
than once.  A corresponding single spin system will be created for this residue.  The spin system
number and name or additional spin systems can be added later if desired.


Examples
~~~~~~~~

The following sequence of commands will generate the sequence 1 ALA, 2 GLY, 3 LYS:

relax> residue.create(1, 'ALA')
relax> residue.create(2, 'GLY')
relax> residue.create(3, 'LYS')

delete(self, res_id=None)

source code 
Delete residues from the current data pipe.

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

res_id:  The residue ID string.


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

This can be used to delete a single or sets of residues.  See the ID string documentation for more
information.  If spin system/atom ids are included a RelaxError will be raised.


Spin ID string documentation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The identification string is composed of three components: the molecule id token beginning with the
'#' character, the residue id token beginning with the ':' character, and the atom or spin system id
token beginning with the '@' character.  Each token can be composed of multiple elements separated
by the ',' character and each individual element can either be a number (which must be an integer,
in string format), a name, or a range of numbers separated by the '-' character.  Negative numbers
are supported.  The full id string specification is '#<mol_name> :<res_id>[, <res_id>[, <res_id>,
...]] @<atom_id>[, <atom_id>[, <atom_id>, ...]]', where the token elements are '<mol_name>', the
name of the molecule, '<res_id>', the residue identifier which can be a number, name, or range of
numbers, '<atom_id>', the atom or spin system identifier which can be a number, name, or range of
numbers.

If one of the tokens is left out then all elements will be assumed to match.  For example if the
string does not contain the '#' character then all molecules will match the string.

Regular expression can be used to select spins.  For example the string '@H*' will select the
protons 'H', 'H2', 'H98'.

display(self, res_id=None)

source code 
Display information about the residue(s).

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

res_id:  The residue ID string.



Spin ID string documentation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The identification string is composed of three components: the molecule id token beginning with the
'#' character, the residue id token beginning with the ':' character, and the atom or spin system id
token beginning with the '@' character.  Each token can be composed of multiple elements separated
by the ',' character and each individual element can either be a number (which must be an integer,
in string format), a name, or a range of numbers separated by the '-' character.  Negative numbers
are supported.  The full id string specification is '#<mol_name> :<res_id>[, <res_id>[, <res_id>,
...]] @<atom_id>[, <atom_id>[, <atom_id>, ...]]', where the token elements are '<mol_name>', the
name of the molecule, '<res_id>', the residue identifier which can be a number, name, or range of
numbers, '<atom_id>', the atom or spin system identifier which can be a number, name, or range of
numbers.

If one of the tokens is left out then all elements will be assumed to match.  For example if the
string does not contain the '#' character then all molecules will match the string.

Regular expression can be used to select spins.  For example the string '@H*' will select the
protons 'H', 'H2', 'H98'.

name(self, res_id=None, name=None, force=False)

source code 
Name the residues.

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

res_id:  The residue ID string corresponding to one or more residues.

name:  The new name.

force:  A flag which if True will cause the residue to be renamed.


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

This simply allows residues to be named (or renamed).


Examples
~~~~~~~~

The following sequence of commands will rename the sequence {1 ALA, 2 GLY, 3 LYS} to {1 XXX,
2 XXX, 3 XXX}:

relax> residue.name(':1', 'XXX', force=True)
relax> residue.name(':2', 'XXX', force=True)
relax> residue.name(':3', 'XXX', force=True)

Alternatively:

relax> residue.name(':1,2,3', 'XXX', force=True)


Spin ID string documentation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The identification string is composed of three components: the molecule id token beginning with the
'#' character, the residue id token beginning with the ':' character, and the atom or spin system id
token beginning with the '@' character.  Each token can be composed of multiple elements separated
by the ',' character and each individual element can either be a number (which must be an integer,
in string format), a name, or a range of numbers separated by the '-' character.  Negative numbers
are supported.  The full id string specification is '#<mol_name> :<res_id>[, <res_id>[, <res_id>,
...]] @<atom_id>[, <atom_id>[, <atom_id>, ...]]', where the token elements are '<mol_name>', the
name of the molecule, '<res_id>', the residue identifier which can be a number, name, or range of
numbers, '<atom_id>', the atom or spin system identifier which can be a number, name, or range of
numbers.

If one of the tokens is left out then all elements will be assumed to match.  For example if the
string does not contain the '#' character then all molecules will match the string.

Regular expression can be used to select spins.  For example the string '@H*' will select the
protons 'H', 'H2', 'H98'.

number(self, res_id=None, number=None, force=False)

source code 
Number the residues.

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

res_id:  The residue ID string corresponding to a single residue.

number:  The new residue number.

force:  A flag which if True will cause the residue to be renumbered.


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

This simply allows residues to be numbered.  The new number cannot correspond to an existing
residue.


Examples
~~~~~~~~

The following sequence of commands will renumber the sequence {1 ALA, 2 GLY, 3 LYS} to
{101 ALA, 102 GLY, 103 LYS}:

relax> residue.number(':1', 101, force=True)
relax> residue.number(':2', 102, force=True)
relax> residue.number(':3', 103, force=True)


Spin ID string documentation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The identification string is composed of three components: the molecule id token beginning with the
'#' character, the residue id token beginning with the ':' character, and the atom or spin system id
token beginning with the '@' character.  Each token can be composed of multiple elements separated
by the ',' character and each individual element can either be a number (which must be an integer,
in string format), a name, or a range of numbers separated by the '-' character.  Negative numbers
are supported.  The full id string specification is '#<mol_name> :<res_id>[, <res_id>[, <res_id>,
...]] @<atom_id>[, <atom_id>[, <atom_id>, ...]]', where the token elements are '<mol_name>', the
name of the molecule, '<res_id>', the residue identifier which can be a number, name, or range of
numbers, '<atom_id>', the atom or spin system identifier which can be a number, name, or range of
numbers.

If one of the tokens is left out then all elements will be assumed to match.  For example if the
string does not contain the '#' character then all molecules will match the string.

Regular expression can be used to select spins.  For example the string '@H*' will select the
protons 'H', 'H2', 'H98'.