Package pipe_control :: Module plotting
[hide private]
[frames] | no frames]

Module plotting

source code

Module for the plotting of data.

The numerical graph data handled in these functions consists of a 4 dimensional list or array object. The first dimension corresponds to different graphs. The second corresponds the different data sets within a single each graph. The third corresponds to the data series (i.e. each data point). The forth is a list of the information about each point, it is a list where the first element is the X value, the second is the Y value, the third is the optional dX or dY error, and the forth is the optional dY error when X errors are present (the third position is then dx).

Functions [hide private]
list of lists of lists of float, str, and list of str
assemble_data(spin_id=None, x_data_name=None, y_data_name=None, plot_data=None)
Return all the xy data, along with the graph type and names for the graph sets.
source code
list of lists of lists of numbers, list of str, bool, bool
assemble_data_scatter(spin_id=None, x_data_name=None, y_data_name=None, plot_data='value')
Assemble the graph data for scatter type data of one value verses another.
source code
list of lists of lists of numbers, list of str, bool, bool
assemble_data_seq_series(spin_id=None, x_data_name=None, y_data_name=None, plot_data='value', x_type=None, y_type=None)
Assemble the graph data for residue or spin sequence verses verses list or dictionary data.
source code
list of lists of lists of numbers, list of str, bool, bool
assemble_data_seq_value(spin_id=None, x_data_name=None, y_data_name=None, plot_data='value')
Assemble the graph data for residue or spin sequence verses values.
source code
list of lists of lists of numbers, list of str, bool, bool
assemble_data_series_series(spin_id=None, x_data_name=None, y_data_name=None, plot_data='value', x_type=None, y_type=None)
Assemble the graph data for curves of list or dictionary data verses list or dictionary data.
source code
list of str or None, list of int or None, list of int or None, list of str or None
axis_setup(data_type=None, norm=True)
Determine the axis information for relax data store specific data.
source code
str
classify_graph_2D(x_data_name=None, y_data_name=None, x_type=None, y_type=None)
Determine the type of graph to produce.
source code
int or float, None or float
fetch_1D_data(plot_data=None, data_name=None, spin=None, res_num=None, sim_num=None)
Return the value and error for the corresponding axis.
source code
tuple of methods or None
get_functions(data_name=None)
Determine the specific functions for the given data type.
source code
Python type
get_data_type(data_name=None)
Determine the type for the given data.
source code
 
write_xy(format='grace', x_data_type='res_num', y_data_type=None, spin_id=None, plot_data='value', norm_type='first', file=None, dir=None, force=False, norm=True)
Writing data to a file.
source code
Variables [hide private]
  __package__ = 'pipe_control'

Imports: warn, RelaxError, get_file_path, open_write_file, write_xy_data, write_xy_header, RelaxWarning, check_mol_res_spin_data, spin_loop, cdp_name, check_pipe, add_result_file, return_api


Function Details [hide private]

assemble_data(spin_id=None, x_data_name=None, y_data_name=None, plot_data=None)

source code 

Return all the xy data, along with the graph type and names for the graph sets.

Parameters:
  • spin_id (str) - The spin ID string for restricting the graph to.
  • x_data_name (str) - The category of the X-axis data.
  • y_data_name (str) - The category of the Y-axis data.
  • plot_data (str) - The type of the plotted data, one of 'value', 'error', or 'sim'.
Returns: list of lists of lists of float, str, and list of str
The 4D graph numerical data structure, the graph type (i.e. on of 'xy', 'xydy', or 'xydxdy'), and the labels for the graph sets.

assemble_data_scatter(spin_id=None, x_data_name=None, y_data_name=None, plot_data='value')

source code 

Assemble the graph data for scatter type data of one value verses another.

For such data, only a single graph and set will be produced.

Parameters:
  • spin_id (str) - The spin ID string for restricting the graph to.
  • x_data_name (str) - The name of the X-data or variable to plot.
  • y_data_name (str) - The name of the Y-data or variable to plot.
  • plot_data (str) - The type of the plotted data, one of 'value', 'error', or 'sim'.
Returns: list of lists of lists of numbers, list of str, bool, bool
The graph data, set labels, and flags for errors in the X and Y dimensions.

assemble_data_seq_series(spin_id=None, x_data_name=None, y_data_name=None, plot_data='value', x_type=None, y_type=None)

source code 

Assemble the graph data for residue or spin sequence verses verses list or dictionary data.

For such data, one graph will be produced. There will be one data set in this graph per series.

Parameters:
  • spin_id (str) - The spin ID string for restricting the graph to.
  • x_data_name (str) - The name of the X-data or variable to plot.
  • y_data_name (str) - The name of the Y-data or variable to plot.
  • plot_data (str) - The type of the plotted data, one of 'value', 'error', or 'sim'.
  • x_type (type object) - The type of X-data to plot.
  • y_type (type object) - The type of Y-data to plot.
Returns: list of lists of lists of numbers, list of str, bool, bool
The graph data, set labels, and flags for errors in the X and Y dimensions.

assemble_data_seq_value(spin_id=None, x_data_name=None, y_data_name=None, plot_data='value')

source code 

Assemble the graph data for residue or spin sequence verses values.

For such data, only a single graph and set will be produced.

Parameters:
  • spin_id (str) - The spin ID string for restricting the graph to.
  • x_data_name (str) - The name of the X-data or variable to plot.
  • y_data_name (str) - The name of the Y-data or variable to plot.
  • plot_data (str) - The type of the plotted data, one of 'value', 'error', or 'sim'.
Returns: list of lists of lists of numbers, list of str, bool, bool
The graph data, set labels, and flags for errors in the X and Y dimensions.

assemble_data_series_series(spin_id=None, x_data_name=None, y_data_name=None, plot_data='value', x_type=None, y_type=None)

source code 

Assemble the graph data for curves of list or dictionary data verses list or dictionary data.

For such data, one graph will be produced. There will be one data set in this graph per spin.

Parameters:
  • spin_id (str) - The spin ID string for restricting the graph to.
  • x_data_name (str) - The name of the X-data or variable to plot.
  • y_data_name (str) - The name of the Y-data or variable to plot.
  • plot_data (str) - The type of the plotted data, one of 'value', 'error', or 'sim'.
  • x_type (type object) - The type of X-data to plot.
  • y_type (type object) - The type of Y-data to plot.
Returns: list of lists of lists of numbers, list of str, bool, bool
The graph data, set labels, and flags for errors in the X and Y dimensions.

axis_setup(data_type=None, norm=True)

source code 

Determine the axis information for relax data store specific data.

Parameters:
  • data_type (list of str) - The axis data category (in the [X, Y] list format).
  • norm (bool) - The normalisation flag which if set to True will cause all graphs to be normalised to a starting value of 1.
Returns: list of str or None, list of int or None, list of int or None, list of str or None
The axis information. This includes the sequence type, the list of lower bounds, the list of upper bounds, and the axis labels.

classify_graph_2D(x_data_name=None, y_data_name=None, x_type=None, y_type=None)

source code 

Determine the type of graph to produce.

The graph type can be one of:

  • 'seq-value', the residue or spin sequence verses the parameter value.
  • 'seq-series', the residue or spin sequence verses the parameter value.
  • 'value-value', a scatter plot of one value verses another.
  • 'value-series', a curve of one value verses a list or dictionary of data.
  • 'series-series', curves of list or dictionary data verses list or dictionary data.
Parameters:
  • x_data_name (str) - The name of the X-data or variable to plot.
  • y_data_name (str) - The name of the Y-data or variable to plot.
  • x_type (type object) - The type of X-data to plot.
  • y_type (type object) - The type of Y-data to plot.
Returns: str
The graph type.

fetch_1D_data(plot_data=None, data_name=None, spin=None, res_num=None, sim_num=None)

source code 

Return the value and error for the corresponding axis.

Parameters:
  • plot_data (str) - The type of the plotted data, one of 'value', 'error', or 'sim'.
  • data_name (str) - The name of the data or variable to plot.
  • spin (SpinContainer instance) - The spin container to fetch the values from.
  • res_num (int) - The residue number for the given spin.
  • sim_num (int) - The simulation number if simulation data is to be returned.
Returns: int or float, None or float
The value and error when available.

get_functions(data_name=None)

source code 

Determine the specific functions for the given data type.

Parameters:
  • data_name (str) - The name of the data or variable to plot.
Returns: tuple of methods or None
The analysis specific return_value, return_conversion_factor, and data_type methods.

get_data_type(data_name=None)

source code 

Determine the type for the given data.

Parameters:
  • data_name (str) - The name of the data or variable to plot.
Returns: Python type
The data type.

write_xy(format='grace', x_data_type='res_num', y_data_type=None, spin_id=None, plot_data='value', norm_type='first', file=None, dir=None, force=False, norm=True)

source code 

Writing data to a file.

Parameters:
  • format (str) - The specific backend to use. The currently support backends are 'grace'.
  • x_data_type (str) - The category of the X-axis data.
  • y_data_type (str) - The category of the Y-axis data.
  • spin_id (str) - The spin identification string.
  • plot_data (str) - The type of the plotted data, one of 'value', 'error', or 'sim'.
  • norm_type (str) - The point to normalise to 1. This can be 'first' or 'last'.
  • file (str) - The name of the Grace file to create.
  • dir (str) - The optional directory to place the file into.
  • force (bool) - Boolean argument which if True causes the file to be overwritten if it already exists.
  • norm (bool) - The normalisation flag which if set to True will cause all graphs to be normalised to a starting value of 1.