columns¶
-
class
nmrpeaklists.columns.Column(name, fmt)[source]¶ Represent a peak list column and map its data to Peak objects
Provide a base class for representing peak list columns and define an interface for mapping column data to Peak objects.
Parameters: - name : str
Name of the peak list column, should be unique within a peak list
- fmt : str
printf-style format string specifying how the data should be printed
-
get_string(peak)[source]¶ Get column data from a Peak object and return a formatted string
Return a formatted string representing the value from the Peak object corresponding to the associated peak list column.
Parameters: - peak :
Peak Peak object containing the corresponding column data
Returns: - value : str
A formatted string of the column data for the Peak object
- peak :
-
get_value(peak[, default])[source]¶ Get the appropriate column data from a Peak object
Return the value from the Peak object corresponding to the associated peak list column. Each subclass must provide its own definition of this interface.
Parameters: - peak :
Peak Peak object containing the corresponding column data
- default : optional
If the Peak does not contain the corresponding data, return
defaultif provided, otherwise raise an Exception.
Returns: - value
The column value taken from the Peak object
- peak :
-
set_string(peak, string)[source]¶ Set the appropriate value in a Peak object from a formatted string
Set the value in the Peak object corresponding to the associated peak list column based on a formatted string.
Parameters: - peak :
Peak Peak object in which to set the column data
- string : str
Formatted string of the column data to set in the Peak object
- peak :
-
set_value(peak, value)[source]¶ Set the appropriate value in a Peak object from peak list column data
Set the value in the Peak object corresponding to the associated peak list column. Each subclass must provide its own definition of this interface.
Parameters: - peak :
Peak Peak object in which to set the column data
- value
The column value to set in the Peak object
- peak :
-
class
nmrpeaklists.columns.IgnoreColumn(name, string)[source]¶ -
get_string(peak)[source]¶ Get column data from a Peak object and return a formatted string
Return a formatted string representing the value from the Peak object corresponding to the associated peak list column.
Parameters: - peak :
Peak Peak object containing the corresponding column data
Returns: - value : str
A formatted string of the column data for the Peak object
- peak :
-
get_value(peak[, default])[source]¶ Get the appropriate column data from a Peak object
Return the value from the Peak object corresponding to the associated peak list column. Each subclass must provide its own definition of this interface.
Parameters: - peak :
Peak Peak object containing the corresponding column data
- default : optional
If the Peak does not contain the corresponding data, return
defaultif provided, otherwise raise an Exception.
Returns: - value
The column value taken from the Peak object
- peak :
-
set_string(peak, string)[source]¶ Set the appropriate value in a Peak object from a formatted string
Set the value in the Peak object corresponding to the associated peak list column based on a formatted string.
Parameters: - peak :
Peak Peak object in which to set the column data
- string : str
Formatted string of the column data to set in the Peak object
- peak :
-
set_value(peak, value)[source]¶ Set the appropriate value in a Peak object from peak list column data
Set the value in the Peak object corresponding to the associated peak list column. Each subclass must provide its own definition of this interface.
Parameters: - peak :
Peak Peak object in which to set the column data
- value
The column value to set in the Peak object
- peak :
-
-
class
nmrpeaklists.columns.PeakAttrColumn(name, fmt, attr)[source]¶ -
get_value(peak[, default])[source]¶ Get the appropriate column data from a Peak object
Return the value from the Peak object corresponding to the associated peak list column. Each subclass must provide its own definition of this interface.
Parameters: - peak :
Peak Peak object containing the corresponding column data
- default : optional
If the Peak does not contain the corresponding data, return
defaultif provided, otherwise raise an Exception.
Returns: - value
The column value taken from the Peak object
- peak :
-
set_value(peak, value)[source]¶ Set the appropriate value in a Peak object from peak list column data
Set the value in the Peak object corresponding to the associated peak list column. Each subclass must provide its own definition of this interface.
Parameters: - peak :
Peak Peak object in which to set the column data
- value
The column value to set in the Peak object
- peak :
-
-
class
nmrpeaklists.columns.PeakAttrListColumn(name, fmt, attr, index, length=None)[source]¶ -
get_value(peak[, default])[source]¶ Get the appropriate column data from a Peak object
Return the value from the Peak object corresponding to the associated peak list column. Each subclass must provide its own definition of this interface.
Parameters: - peak :
Peak Peak object containing the corresponding column data
- default : optional
If the Peak does not contain the corresponding data, return
defaultif provided, otherwise raise an Exception.
Returns: - value
The column value taken from the Peak object
- peak :
-
set_value(peak, value)[source]¶ Set the appropriate value in a Peak object from peak list column data
Set the value in the Peak object corresponding to the associated peak list column. Each subclass must provide its own definition of this interface.
Parameters: - peak :
Peak Peak object in which to set the column data
- value
The column value to set in the Peak object
- peak :
-
-
class
nmrpeaklists.columns.SpinAttrColumn(name, fmt, attr, index)[source]¶ -
get_value(peak[, default])[source]¶ Get the appropriate column data from a Peak object
Return the value from the Peak object corresponding to the associated peak list column. Each subclass must provide its own definition of this interface.
Parameters: - peak :
Peak Peak object containing the corresponding column data
- default : optional
If the Peak does not contain the corresponding data, return
defaultif provided, otherwise raise an Exception.
Returns: - value
The column value taken from the Peak object
- peak :
-
set_value(peak, value)[source]¶ Set the appropriate value in a Peak object from peak list column data
Set the value in the Peak object corresponding to the associated peak list column. Each subclass must provide its own definition of this interface.
Parameters: - peak :
Peak Peak object in which to set the column data
- value
The column value to set in the Peak object
- peak :
-
-
class
nmrpeaklists.columns.Res3LetterColumn(name, index)[source]¶ -
get_string(peak)[source]¶ Get column data from a Peak object and return a formatted string
Return a formatted string representing the value from the Peak object corresponding to the associated peak list column.
Parameters: - peak :
Peak Peak object containing the corresponding column data
Returns: - value : str
A formatted string of the column data for the Peak object
- peak :
-
set_string(peak, string)[source]¶ Set the appropriate value in a Peak object from a formatted string
Set the value in the Peak object corresponding to the associated peak list column based on a formatted string.
Parameters: - peak :
Peak Peak object in which to set the column data
- string : str
Formatted string of the column data to set in the Peak object
- peak :
-
-
class
nmrpeaklists.columns.PipeNameColumn(index, res_width=4, atom_width=4)[source]¶ -
get_string(peak)[source]¶ Get column data from a Peak object and return a formatted string
Return a formatted string representing the value from the Peak object corresponding to the associated peak list column.
Parameters: - peak :
Peak Peak object containing the corresponding column data
Returns: - value : str
A formatted string of the column data for the Peak object
- peak :
-
get_value(peak[, default])[source]¶ Get the appropriate column data from a Peak object
Return the value from the Peak object corresponding to the associated peak list column. Each subclass must provide its own definition of this interface.
Parameters: - peak :
Peak Peak object containing the corresponding column data
- default : optional
If the Peak does not contain the corresponding data, return
defaultif provided, otherwise raise an Exception.
Returns: - value
The column value taken from the Peak object
- peak :
-
-
class
nmrpeaklists.columns.PipeAnchorColumn(indices, res_width=4, atom_width=8)[source]¶ -
get_string(peak)[source]¶ Get column data from a Peak object and return a formatted string
Return a formatted string representing the value from the Peak object corresponding to the associated peak list column.
Parameters: - peak :
Peak Peak object containing the corresponding column data
Returns: - value : str
A formatted string of the column data for the Peak object
- peak :
-
get_value(peak[, default])[source]¶ Get the appropriate column data from a Peak object
Return the value from the Peak object corresponding to the associated peak list column. Each subclass must provide its own definition of this interface.
Parameters: - peak :
Peak Peak object containing the corresponding column data
- default : optional
If the Peak does not contain the corresponding data, return
defaultif provided, otherwise raise an Exception.
Returns: - value
The column value taken from the Peak object
- peak :
-
set_value(peak, value)[source]¶ Set the appropriate value in a Peak object from peak list column data
Set the value in the Peak object corresponding to the associated peak list column. Each subclass must provide its own definition of this interface.
Parameters: - peak :
Peak Peak object in which to set the column data
- value
The column value to set in the Peak object
- peak :
-