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

Class Sequence

source code


Class for manipulating sequence data.

Instance Methods [hide private]
 
copy(self, pipe_from=None, pipe_to=None)
Copy the molecule, residue, and spin sequence data from one data pipe to another.
source code
 
display(self, sep=None, mol_name_flag=True, res_num_flag=True, res_name_flag=True, spin_num_flag=True, spin_name_flag=True)
Display sequences of molecules, residues, and/or 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)
Read the molecule, residue, and spin sequence from a file.
source code
 
write(self, file, dir=None, sep=None, mol_name_flag=False, res_num_flag=False, res_name_flag=False, spin_num_flag=False, spin_name_flag=False, force=False)
Write the molecule, residue, and spin sequence to a file.
source code

Inherited from base_class.User_fn_class: __init__

Method Details [hide private]

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

source code 
Copy the molecule, residue, and spin sequence data from one data pipe to another.

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

pipe_from:  The name of the data pipe to copy the sequence data from.

pipe_to:  The name of the data pipe to copy the sequence data to.


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

This will copy the sequence data between data pipes.  The destination data pipe must not contain any
sequence data.  If the source and destination pipes are not specified, then both will default to the
current data pipe (hence providing one is essential).


Examples
~~~~~~~~

To copy the sequence from the data pipe 'm1' to the current data pipe, type:

relax> sequence.copy('m1')
relax> sequence.copy(pipe_from='m1')


To copy the sequence from the current data pipe to the data pipe 'm9', type:

relax> sequence.copy(pipe_to='m9')


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

relax> sequence.copy('m1', 'm2')
relax> sequence.copy(pipe_from='m1', pipe_to='m2')

display(self, sep=None, mol_name_flag=True, res_num_flag=True, res_name_flag=True, spin_num_flag=True, spin_name_flag=True)

source code 
Display sequences of molecules, residues, and/or spins.

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

sep:  The column separator (the default of None corresponds to white space).

mol_name_flag:  A flag whic if True will cause the molecule name column to be shown.

res_num_flag:  A flag whic if True will cause the residue number column to be shown.

res_name_flag:  A flag whic if True will cause the residue name column to be shown.

spin_num_flag:  A flag whic if True will cause the spin number column to be shown.

spin_name_flag:  A flag whic if True will cause the spin name column to be shown.

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)

source code 
Read the molecule, residue, and spin sequence from a file.

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

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

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

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.


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.


Examples
~~~~~~~~

The following commands will read protein backbone 15N sequence data out of a file called
'seq' where the residue numbers and names are in the first and second columns respectively:

relax> sequence.read('seq')
relax> sequence.read('seq', res_num_col=1, res_name_col=2)
relax> sequence.read(file='seq', res_num_col=1, res_name_col=2, sep=None)


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

relax> sequence.read('noe.out')
relax> sequence.read('noe.out', res_num_col=1, res_name_col=2)
relax> sequence.read(file='noe.out', res_num_col=1, res_name_col=2)


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:

relax> sequence.read('noe.600.out', res_num_col=2, res_name_col=6, sep=',')
relax> sequence.read(file='noe.600.out', res_num_col=2, res_name_col=6, sep=',')


The following commands will read the RNA residues and atoms (including C2, C5, C6, C8, N1,
and N3) from the file '500.NOE', where the residue number, residue name, spin number, and
spin name are in the first to fourth columns respectively:

relax> sequence.read('500.NOE', res_num_col=1, res_name_col=2, spin_num_col=3,
                     spin_name_col=4)
relax> sequence.read(file='500.NOE', res_num_col=1, res_name_col=2, spin_num_col=3,
                     spin_name_col=4)

write(self, file, dir=None, sep=None, mol_name_flag=False, res_num_flag=False, res_name_flag=False, spin_num_flag=False, spin_name_flag=False, force=False)

source code 
Write the molecule, residue, and spin sequence to a file.

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

file:  The name of the file.

dir:  The directory name.

sep:  The column separator (the default of None corresponds to white space).

mol_name_flag:  A flag which if True will cause the molecule name column to be shown.

res_num_flag:  A flag which if True will cause the residue number column to be shown.

res_name_flag:  A flag which if True will cause the residue name column to be shown.

spin_num_flag:  A flag which if True will cause the spin number column to be shown.

spin_name_flag:  A flag which if True will cause the spin name column to be shown.

force:  A flag which if True will cause the file to be overwritten.


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

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