Package lib :: Package spectrum :: Module peak_list
[hide private]
[frames] | no frames]

Module peak_list

source code

Module containing functions for the handling of peak intensities.

Functions [hide private]
 
autodetect_format(file_data)
Automatically detect the format of the peak list.
source code
 
intensity_generic(peak_list=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, data_col=None, sep=None, spin_id=None)
Extract the peak intensity information from the generic column formatted peak list.
source code
lib.spectrum.objects.Peak_list instance
read_peak_list(file=None, dir=None, int_col=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 peak intensity data.
source code
Variables [hide private]
  __package__ = 'lib.spectrum'

Imports: warn, RelaxError, extract_data, strip, read_spin_data, nmrpipe, nmrview, sparky, xeasy, Peak_list, RelaxWarning


Function Details [hide private]

autodetect_format(file_data)

source code 

Automatically detect the format of the peak list.

Parameters:
  • file_data (list of lists of str) - The processed results file data.

intensity_generic(peak_list=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, data_col=None, sep=None, spin_id=None)

source code 

Extract the peak intensity information from the generic column formatted peak list.

Parameters:
  • peak_list (lib.spectrum.objects.Peak_list instance) - The peak list object to place all data into.
  • file_data (list of lists of str) - The data extracted from the file converted into a list of lists.
  • spin_id_col - The column containing the spin ID strings (used by the generic intensity file format). If supplied, the mol_name_col, res_name_col, res_num_col, spin_name_col, and spin_num_col arguments must be none. @type spin_id_col: int or None @keyword mol_name_col: The column containing the molecule name information (used by the generic intensity file format). If supplied, spin_id_col must be None.
  • res_name_col (int or None) - The column containing the residue name information (used by the generic intensity file format). If supplied, spin_id_col must be None.
  • res_num_col (int or None) - The column containing the residue number information (used by the generic intensity file format). If supplied, spin_id_col must be None.
  • spin_name_col (int or None) - The column containing the spin name information (used by the generic intensity file format). If supplied, spin_id_col must be None.
  • spin_num_col (int or None) - The column containing the spin number information (used by the generic intensity file format). If supplied, spin_id_col must be None.
  • data_col (int or list of int) - The column containing the peak intensities.
  • 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.
  • mol_name_col (int or None)
Raises:
  • RelaxError - When the expected peak intensity is not a float.

read_peak_list(file=None, dir=None, int_col=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 peak intensity data.

Parameters:
  • file (str) - The name of the file containing the peak intensities.
  • dir (str) - The directory where the file is located.
  • int_col (None or int) - The column containing the peak intensity data. If set to None, the auto-detection of intensity data will be attempted.
  • spin_id_col (int or None) - The column containing the spin ID strings (used by the generic intensity file format). 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 (used by the generic intensity file format). If supplied, spin_id_col must be None.
  • res_name_col (int or None) - The column containing the residue name information (used by the generic intensity file format). If supplied, spin_id_col must be None.
  • res_num_col (int or None) - The column containing the residue number information (used by the generic intensity file format). If supplied, spin_id_col must be None.
  • spin_name_col (int or None) - The column containing the spin name information (used by the generic intensity file format). If supplied, spin_id_col must be None.
  • spin_num_col (int or None) - The column containing the spin number information (used by the generic intensity file format). 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.
Returns: lib.spectrum.objects.Peak_list instance
The peak list object containing all relevant data in the peak list.