Package prompt :: Module pcs :: Class PCS
[hide private]
[frames] | no frames]

Class PCS

source code


Class for handling pseudo-contact shifts.

Instance Methods [hide private]
 
back_calc(self, align_id=None)
Back calculate the pseudo-contact shifts.
source code
 
calc_q_factors(self, spin_id=None)
Calculate the PCS Q-factor for the selected spins.
source code
 
copy(self, pipe_from=None, pipe_to=None, align_id=None)
Copy PCS data from pipe_from to pipe_to.
source code
 
corr_plot(self, format='grace', file='pcs_corr_plot.agr', dir=None, force=False)
Generate a correlation plot of the measured vs.
source code
 
delete(self, align_id=None)
Delete the PCS data corresponding to the alignment ID.
source code
 
display(self, align_id=None, bc=False)
Display the PCS data corresponding to the alignment ID.
source code
 
read(self, align_id=None, 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, data_col=None, error_col=None, sep=None, spin_id=None)
Read the PCS data from file.
source code
 
weight(self, align_id=None, spin_id=None, weight=1.0)
Set optimisation weights on the PCS data.
source code
 
write(self, align_id=None, file=None, dir=None, bc=False, force=False)
Write the PCS data to file.
source code

Inherited from base_class.User_fn_class: __init__

Method Details [hide private]

back_calc(self, align_id=None)

source code 
Back calculate the pseudo-contact shifts.

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

align_id:  The alignment ID string.

calc_q_factors(self, spin_id=None)

source code 
Calculate the PCS Q-factor for the selected spins.

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

spin_id:  The spin ID string for restricting to subset of all selected spins.


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

For this function to work, the back-calculated PCS data must first be generated by the
analysis specific code.  Otherwise a warning will be given.


Examples
~~~~~~~~

To calculate the PCS Q-factor for only the spins '@H26', '@H27', and '@H28', type one of:

relax> pcs.calc_q_factors('@H26 & @H27 & @H28')
relax> pcs.calc_q_factors(spin_id='@H26 & @H27 & @H28')

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

source code 
Copy PCS data from pipe_from to pipe_to.

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

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

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

align_id:  The alignment ID string.


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

This function will copy PCS data from 'pipe_from' to 'pipe_to'.  If align_id is not given
then all PCS data will be copied, otherwise only a specific data set will be.


Examples
~~~~~~~~

To copy all PCS data from pipe 'm1' to pipe 'm9', type one of:

relax> pcs.copy('m1', 'm9')
relax> pcs.copy(pipe_from='m1', pipe_to='m9')
relax> pcs.copy('m1', 'm9', None)
relax> pcs.copy(pipe_from='m1', pipe_to='m9', align_id=None)

To copy only the 'Th' PCS data from 'm3' to 'm6', type one of:

relax> pcs.copy('m3', 'm6', 'Th')
relax> pcs.copy(pipe_from='m3', pipe_to='m6', align_id='Th')

corr_plot(self, format='grace', file='pcs_corr_plot.agr', dir=None, force=False)

source code 
Generate a correlation plot of the measured vs. the back-calculated PCSs.

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

format:  The format of the plot data.

file:  The name of the file.

dir:  The directory name.

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


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

Two formats are currently supported.  If format is set to 'grace', then a Grace plot file
will be created.  If the format arg is set to None, then a plain text list of the measured
and back-calculated data will be created.


Examples
~~~~~~~~

To create a Grace plot of the data, type:

relax> pcs.corr_plot()


To create a plain text list of the measured and back-calculated data, type one of:

relax> pcs.corr_plot(None)
relax> pcs.corr_plot(format=None)

delete(self, align_id=None)

source code 
Delete the PCS data corresponding to the alignment ID.

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

align_id:  The alignment ID string.


Examples
~~~~~~~~

To delete the PCS data corresponding to align_id='PH_gel', type:

relax> pcs.delete('PH_gel')

display(self, align_id=None, bc=False)

source code 
Display the PCS data corresponding to the alignment ID.

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

align_id:  The alignment ID string.

bc:  A flag which if set will display the back-calculated rather than measured RDCs.


Examples
~~~~~~~~

To display the 'phage' PCS data, type:

relax> pcs.display('phage')

read(self, align_id=None, 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, data_col=None, error_col=None, sep=None, spin_id=None)

source code 
Read the PCS data from file.

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

align_id:  The alignment ID string.

file:  The name of the file containing the PCS 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).

data_col:  The PCS 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.


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 mol_name_col, res_num_col, res_name_col,
spin_num_col, and/or spin_name_col arguments can be supplied allowing this information to be
in separate columns.  Note that the numbering of columns starts at one.  The spin_id
argument 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 the PCS data out of the file 'Tb.txt' where the columns are
separated by the symbol ',', and store the PCSs under the ID 'Tb'.

relax> pcs.read('Tb', 'Tb.txt', sep=',')


To read the 15N and 1H PCSs from the file 'Eu.txt', where the 15N values are in the 4th
column and the 1H in the 9th, type both the following:

relax> pcs.read('Tb', 'Tb.txt', spin_id='@N', res_num_col=1, data_col=4)
relax> pcs.read('Tb', 'Tb.txt', spin_id='@H', res_num_col=1, data_col=9)

weight(self, align_id=None, spin_id=None, weight=1.0)

source code 
Set optimisation weights on the PCS data.

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

align_id:  The alignment ID string.

spin_id:  The spin ID string.

weight:  The weighting value.


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

This function can be used to force the PCS to contribute more or less to the chi-squared
optimisation statistic.  The higher the value, the more importance the PCS will have.

write(self, align_id=None, file=None, dir=None, bc=False, force=False)

source code 
Write the PCS data to file.

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

align_id:  The alignment ID string.

file:  The name of the file.

dir:  The directory name.

bc:  A flag which if set will write out the back-calculated rather than measured RDCs.

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


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

If no directory name is given, the file will be placed in the current working directory.
The 'align_id' argument are required for selecting which PCS data set will be written to file.