Package prompt :: Module sequence :: Class Sequence
[hide private]
[frames] | no frames]

Class Sequence

source code

Instance Methods [hide private]
 
__init__(self, relax) source code
 
add(self, run=None, res_num=None, res_name=None, select=1)
Function for adding a residue onto the sequence.
source code
 
copy(self, run1=None, run2=None)
Function for copying the sequence from run1 to run2.
source code
 
delete(self, run=None)
Function for deleting the sequence.
source code
 
display(self, run=None)
Function for displaying the sequence.
source code
 
read(self, run=None, file=None, dir=None, num_col=0, name_col=1, sep=None)
Function for reading sequence data.
source code
 
sort(self, run=None)
Function for numerically sorting the sequence by residue number.
source code
 
write(self, run=None, file=None, dir=None, force=0)
Function for writing the sequence to a file.
source code
Method Details [hide private]

add(self, run=None, res_num=None, res_name=None, select=1)

source code 
Function for adding a residue onto the sequence.

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

run:  The name of the run.

res_num:  The residue number.

res_name:  The name of the residue.

select:  A flag specifying if the residue should be selected.


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

Using this function a new sequence can be generated without having to load the sequence from
a file.  However if the sequence already exists, the new residue will be added to the end.
The same residue number cannot be used more than once.


Examples
~~~~~~~~

The following sequence of commands will generate the sequence 1 ALA, 2 GLY, 3 LYS and assign
it to the run 'm3':

relax> run = 'm3'
relax> sequence.add(run, 1, 'ALA')
relax> sequence.add(run, 2, 'GLY')
relax> sequence.add(run, 3, 'LYS')

copy(self, run1=None, run2=None)

source code 
Function for copying the sequence from run1 to run2.

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

run1:  The name of the run to copy the sequence from.

run2:  The name of the run to copy the sequence to.


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

This function will copy the sequence from 'run1' to 'run2'.  'run1' must contain sequence
information, while 'run2' must have no sequence loaded.


Examples
~~~~~~~~

To copy the sequence from the run 'm1' to the run 'm2', type:

relax> sequence.copy('m1', 'm2')
relax> sequence.copy(run1='m1', run2='m2')

delete(self, run=None)

source code 
Function for deleting the sequence.

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

run:  The name of the run.


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

This function has the same effect as using the 'delete' function to delete all residue
specific data.

display(self, run=None)

source code 
Function for displaying the sequence.

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

run:  The name of the run.

read(self, run=None, file=None, dir=None, num_col=0, name_col=1, sep=None)

source code 
Function for reading sequence data.

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

run:  The name of the run.

file:  The name of the file containing the sequence data.

dir:  The directory where the file is located.

num_col:  The residue number column (the default is 0, ie the first column).

name_col:  The residue name column (the default is 1).

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


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

If no directory is given, the file will be assumed to be in the current working directory.


Examples
~~~~~~~~

The following commands will read the sequence data out of a file called 'seq' where the
residue numbers and names are in the first and second columns respectively and assign it to
the run 'm1'.

relax> sequence.read('m1', 'seq')
relax> sequence.read('m1', 'seq', num_col=0, name_col=1)
relax> sequence.read(run='m1', file='seq', num_col=0, name_col=1, sep=None)


The following commands will read the sequence out of the file 'noe.out' which also contains
the NOE values.

relax> sequence.read('m1', 'noe.out')
relax> sequence.read('m1', 'noe.out', num_col=0, name_col=1)
relax> sequence.read(run='m1', file='noe.out', num_col=0, name_col=1)


The following commands will read the sequence out of the file 'noe.600.out' where the
residue numbers are in the second column, the names are in the sixth column and the columns
are separated by commas and assign it to the run 'm5'.

relax> sequence.read('m5', 'noe.600.out', num_col=1, name_col=5, sep=',')
relax> sequence.read(run='m5', file='noe.600.out', num_col=1, name_col=5, sep=',')

sort(self, run=None)

source code 
Function for numerically sorting the sequence by residue number.

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

run:  The name of the run.

write(self, run=None, file=None, dir=None, force=0)

source code 
Function for writing the sequence to a file.

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

run:  The name of the run.

file:  The name of the file.

dir:  The directory name.

force:  A flag which, if set to 1, will cause the file to be overwritten.


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

If no directory name is given, the file will be placed in the current working directory.