Reference

file

calculator.py

Module containing the main Data Analyzer

class nmrquant.engine.calculator.Quantifier(verbose=False)

Bases: object

RMNQ main class to quantify and visualize data

calculate_concentrations(strd_conc=1)

Calculate concentrations using number of protons and dilution factor

Parameters

strd_conc – Standard concentration for external calibration. If calibration is internal, concentration is equal to one.

Return self.conc_data

Dataframe containing calculated concentrations

compute_data(strd_conc=None, mean=False)

Run data preparation and computation of concentrations (if strd_conc is not None, else just prepare data)

Parameters

strd_conc – Concentration of standard molecule used (1 if concentration is not needed). Set to None if

concentrations must not be calculated :param mean: should means be computed

export_data(destination, file_name='', fmt='excel', export_mean=False)

Export final data in desired format

generate_metadata(path)

Generate template in excel format

get_data(data, excel_sheet=0)

Get data from path or excel file

get_db(database)

Get database from file or path

Parameters

database – Can be a file directly or a str containing the path to the file

import_md(md)

Import metadata file after modification from path or file

Parameters

md – Can be a file directly or a str containing the path to the file

file

visualizer.py

class nmrquant.engine.visualizer.HistPlot(input_data, metabolite, display)

Bases: abc.ABC

Histogram Abstract base class. All histograms will derive from this class. The initial cleanup and preparation of data is done here. Any modifications will be passed down to children classes. Global checkups should be performed in the constructor of this class. The class implements repr and call dunder methods. The call dunder requests plot creation from the build_plot method so that self() directly creates the plot.

abstract build_plot()
class nmrquant.engine.visualizer.IndHistA(input_data, metabolite, display)

Bases: nmrquant.engine.visualizer.HistPlot

Class for histogram with one or more conditions, no replicates and one or no time points

build_plot()
class nmrquant.engine.visualizer.IndHistB(input_data, metabolite, display)

Bases: nmrquant.engine.visualizer.HistPlot

Class for histograms with one or more conditions but only one (or no) time points and multiple replicates (individual representation)

build_plot()
class nmrquant.engine.visualizer.IndLine(input_data, metabolite, display)

Bases: nmrquant.engine.visualizer.LinePlot

Class to generate lineplots from kinetic data. Each plot is specific to one condition and displays each replicate in a separate line.

build_plot()
class nmrquant.engine.visualizer.LinePlot(input_data, metabolite, display=False)

Bases: abc.ABC

Line Plot Abstract base class. All line plots will derive from this class. The initial cleanup and preparation of data is done here. Any modifications will be passed down to children classes. Global checkups should be performed in the constructor of this class. The class implements repr and call dunder methods. The call dunder requests plot creation from the build_plot method so that self() directly creates the plot.

abstract build_plot()
static show_figure(fig)

In case figures are generated but not used directly, we need a way to visualize them later (from inside a list of figures for example

class nmrquant.engine.visualizer.MeanLine(input_data, metabolite, display)

Bases: nmrquant.engine.visualizer.IndLine

Line plots with meaned replicates for each time point. We inherit from IndLine to initialize the dict containing all the data for all the replicates. We will then calculate means and SDs from this data.

build_plot()
class nmrquant.engine.visualizer.MultHistB(input_data, std_data, metabolite, display)

Bases: nmrquant.engine.visualizer.HistPlot

Class for histograms with one or more conditions but only one (or no) time points and multiple replicates (meaned representation)

build_plot()
class nmrquant.engine.visualizer.NoRepIndLine(input_data, metabolite, display)

Bases: nmrquant.engine.visualizer.LinePlot

Class to generate line plots for kinetic data with only 1 replicate per condition

build_plot()
file

utilities.py

Module containing extra tools

nmrquant.engine.utilities.append_value(dict_obj, key, value)

Add/append values to an existing key to a dictionary

nmrquant.engine.utilities.check_for_sum(y)

Check if two args given in y through ‘+’ operator

Parameters

y

nmrquant.engine.utilities.is_empty(any_structure)

Check if container is empty

Parameters

any_structure – data container to analyze

Returns

if empty True, if not False

nmrquant.engine.utilities.list_average(lst)
nmrquant.engine.utilities.read_data(path, excel_sheet=0)

Function to read incoming data

Parameters
  • path (str or pathlib.PurePath) – path to data to read

  • excel_sheet (int) – excel sheet to read (if data is excel file with multiple sheets)

file

notebook.py

class nmrquant.ui.notebook.Rnb(verbose=False)

Bases: object

Class to control RMNQ notebook interface

build_plots(event)

Control plot creation. Make destination folders and generate plots.

generate_template(event)

Generate template from input data spectrum count

load_events()

Load events for all the different buttons

make_gui()

Display the widgets and build the GUI

process_data(event)

Make destination folder, clean data and calculate results

reset(verbose)

Function to reset the object in notebook (only for notebook use because otherwise cell refresh doesn’t reinitialize the object)