UniDec
Universal Deconvolution of Mass and Ion Mobility Spectra
Public Member Functions | Public Attributes | List of all members
UniDec.GUniDec.UniDecApp Class Reference
Inheritance diagram for UniDec.GUniDec.UniDecApp:
Inheritance graph
[legend]
Collaboration diagram for UniDec.GUniDec.UniDecApp:
Collaboration graph
[legend]

Public Member Functions

def __init__ (self, args, kwargs)
 
def start (self)
 
def on_end_session (self)
 
def quit_application (self)
 
def init (self, args, kwargs)
 
def import_config
 
def export_config
 
def on_open
 
def on_open_file
 
def on_save_state
 
def on_load_state
 
def on_raw_open
 
def on_load_conf_file
 
def on_save_default
 
def on_load_default
 
def on_paste_spectrum
 
def on_reset
 
def on_dataprep_button
 
def on_unidec_button
 
def after_unidec_run (self)
 
def on_pick_peaks
 
def on_plot_peaks
 
def on_peak_errors
 
def check_badness (self)
 
def warn
 
def on_auto
 
def makeplot1
 
def makeplot2
 
def makeplot3
 
def makeplot4
 
def makeplot5
 
def makeplot6
 
def on_plot_composite
 
def make_im_plots (self)
 
def on_plot_nativeccs
 
def on_replot
 
def make_cube_plot
 
def on_delete
 
def on_charge_states
 
def on_differences
 
def on_plot_offsets
 
def on_color_plot1d
 
def plot_integral
 
def on_integrate
 
def on_smash (self)
 
def on_get_mzlimits (self)
 
def on_charge_plot
 
def on_batch_raw
 
def on_manual
 
def on_match
 
def on_mass_tools
 
def on_auto_peak_width
 
def on_peak_width_tool
 
def on_additional_parameters
 
def on_autocorr_window
 
def on_unidec_path
 
def on_file_name
 
def on_data_collector
 
def on_import_wizard
 
def on_im_tools
 
def on_im_extract
 
def on_tweet
 
def on_kendrick
 
def on_2d_grid
 
def on_nativez_tools
 
def on_export_params
 
def on_mass_process
 
def on_calibrate
 
def on_center_of_mass
 
def on_zerocharge_mass
 
def on_fit_masses
 
def on_batch
 
def on_batch2
 
def on_super_batch
 
def on_cross_validate
 
def on_pdf_report
 
def on_fft_window (self, e)
 
def on_left_click (self, xpos, ypos)
 
def on_grid_decon (self, e)
 
def on_flip_mode (self, e)
 
def on_flip_tabbed (self, e)
 
def on_flip_twave (self, e)
 
def remake_mainwindow
 

Public Attributes

 eng
 
 view
 
 twittercodes
 

Detailed Description

Main UniDec GUI Application.

Presenter contains UniDec engine at self.eng and main GUI window at self.view

Constructor & Destructor Documentation

def UniDec.GUniDec.UniDecApp.__init__ (   self,
  args,
  kwargs 
)
Initialize App
:param args:
:param kwargs:
:return: UniDecApp object

Member Function Documentation

def UniDec.GUniDec.UniDecApp.after_unidec_run (   self)
Plots to make after running UniDec.
:return: None

Here is the call graph for this function:

Here is the caller graph for this function:

def UniDec.GUniDec.UniDecApp.check_badness (   self)
Check for any bad parameters and warn the user if something is off.
:return: code (see unidecstructure.check_badness)

Here is the call graph for this function:

Here is the caller graph for this function:

def UniDec.GUniDec.UniDecApp.export_config (   self,
  file_name = None 
)
Get configuration from GUI and (if file_name is specified) write from engine to file_name
:param file_name: Path of file to save config to
:return: None

Here is the caller graph for this function:

def UniDec.GUniDec.UniDecApp.import_config (   self,
  file_name = None 
)
Import configuration from file to engine (if file_name is specified) and from engine to GUI.
:param file_name: Path of file to import
:return: None

Here is the caller graph for this function:

def UniDec.GUniDec.UniDecApp.init (   self,
  args,
  kwargs 
)
Initialize Engine and View. Load defaults.
:param args:
:param kwargs:
:return:

Here is the call graph for this function:

def UniDec.GUniDec.UniDecApp.make_cube_plot (   self,
  e = None 
)
Make cube plots for IMMS.
:param e: unused event
:return: None

Here is the call graph for this function:

Here is the caller graph for this function:

def UniDec.GUniDec.UniDecApp.make_im_plots (   self)
Make Ion Mobility plots (but not cube plots)
:return: None

Here is the call graph for this function:

Here is the caller graph for this function:

def UniDec.GUniDec.UniDecApp.makeplot1 (   self,
  e = None 
)
Plot data and fit in self.view.plot1 and optionally in plot1fit
:param e: unused event
:return: None

Here is the caller graph for this function:

def UniDec.GUniDec.UniDecApp.makeplot2 (   self,
  e = None 
)
Plot mass data and peaks if possible in self.view.plot2
:param e: unused event
:return: None

Here is the caller graph for this function:

def UniDec.GUniDec.UniDecApp.makeplot3 (   self,
  e = None 
)
Plot m/z vs charge grid.
:param e: unused event
:return: None

Here is the caller graph for this function:

def UniDec.GUniDec.UniDecApp.makeplot4 (   self,
  e = None 
)
Plots isolated peaks against the data in self.view.plot4.
Will plot dots at peak positions.
If possible, will plot full isolated spectra.
:param e: unused event
:return: None

Here is the caller graph for this function:

def UniDec.GUniDec.UniDecApp.makeplot5 (   self,
  e = None 
)
Plot mass vs charge grid
:param e: unused event
:return: None

Here is the caller graph for this function:

def UniDec.GUniDec.UniDecApp.makeplot6 (   self,
  e = None,
  show = "height" 
)
Plots bar chart of peak heights or areas in self.view.plot6.
:param e: unused event
:param show: What parameter to plot
"height" will plot p.height for p in self.eng.pks.peaks
"integral" will plot p.integral
:return: None

Here is the caller graph for this function:

def UniDec.GUniDec.UniDecApp.on_2d_grid (   self,
  e = None 
)
Opens 2D grid extraction window. Grid extraction parameters are stored at self.eng.config.gridparams.
:param e: unused event
:return: None
def UniDec.GUniDec.UniDecApp.on_additional_parameters (   self,
  e = None 
)
Open additional data parameter window, which hads some of the experimental and obscure variables.
Window directly modifies self.eng.config.
Saves config to file after window is closed.
:param e: unused event
:return: None

Here is the call graph for this function:

def UniDec.GUniDec.UniDecApp.on_auto (   self,
  e = None 
)
Prepare data, run UniDec, and pick peaks.
:param e: unused space for event
:return: None

Here is the call graph for this function:

Here is the caller graph for this function:

def UniDec.GUniDec.UniDecApp.on_auto_peak_width (   self,
  e = None 
)

Here is the call graph for this function:

def UniDec.GUniDec.UniDecApp.on_autocorr_window (   self,
  e = None 
)
Opens the autocorrelation window. Feed the config and massdat from the engine.
:param e: Unused event
:return: None

Here is the caller graph for this function:

def UniDec.GUniDec.UniDecApp.on_batch (   self,
  e = None,
  flag = 0,
  batchfiles = None 
)
Batch processing!

Spawns a directory to select multiple files.
Feeds the file names into a loop that:

Opens the file (self.on_open_file)
Prepares the data (self.on_dataprep_button)
Runs UniDec (self.unidec_button)
Picks Peaks (self.on_pick_peaks)
Exports Peak Parameters (self.on_export_params)
Saves State (self.on_save_state)

If uses self.eng.config.batchflag to prevent certain things from plotting and all key parameters from changing.
If batchflag is 2 (flag=1),
    all key paramters are kept, but the data ranges are refreshed from the individual files.
:param e: event passed to some function (unused)
:param flag: flag added to self.eng.config.batchflag
:param batchfiles: List of files to run in batch. If None, will open dialog.
:return:

Here is the call graph for this function:

Here is the caller graph for this function:

def UniDec.GUniDec.UniDecApp.on_batch2 (   self,
  e = None 
)
Runs batch processing without restricting the data ranges.

The date range can be set ahead of time and will update independently for each file.
Other parameters are fixed for the whole batch.
:param e: unused event passed to self.on_batch
:return: None

Here is the call graph for this function:

def UniDec.GUniDec.UniDecApp.on_batch_raw (   self,
  e = None,
  dirs = None,
  clip = True 
)
Batch process Waters .Raw files into .txt files.
Opens a multiple directory dialog and then sends the results to self.eng.raw_process
:param e: unused event
:return: None
def UniDec.GUniDec.UniDecApp.on_calibrate (   self,
  e = None 
)
def UniDec.GUniDec.UniDecApp.on_center_of_mass (   self,
  e = None 
)
Determines the center of mass for the region zoomed on plot2.

Get limits from plot2.
Get Center of Mass from self.eng.center_of_mass
Reports these as text on plot2.
:param e:
:return:
def UniDec.GUniDec.UniDecApp.on_charge_plot (   self,
  e = None 
)
Change peaks and plots so that the total charge distribution is plotted in plot2.
Picks new peaks as each charge state and updates peakpanel.
:param e: unused event
:return: None

Here is the call graph for this function:

def UniDec.GUniDec.UniDecApp.on_charge_states (   self,
  e = None 
)
Triggered by right click "plot charge states" on self.view.peakpanel.
Plots a line with text listing the charge states of a specific peak.
:param e: unused event
:return: None
def UniDec.GUniDec.UniDecApp.on_color_plot1d (   self,
  e = None,
  filled = False 
)

Here is the call graph for this function:

def UniDec.GUniDec.UniDecApp.on_cross_validate (   self,
  e = None 
)
Experimental...

Run cross validation on spectrum by splitting the spectrum into subspectra and fitting each independently.

Runs self.eng.cross_validate()
Adds plots of mean and std deviation to plot2
:param e: unused event
:return: None

Here is the call graph for this function:

def UniDec.GUniDec.UniDecApp.on_data_collector (   self,
  e = None 
)
Spawns separate DataCollector window.
:param e: unused event
:return: None
def UniDec.GUniDec.UniDecApp.on_dataprep_button (   self,
  e = None 
)
Prepares data. Runs eng.process_data() and then updates and plots in view
:param e: unused space for event
:return: None

Here is the call graph for this function:

Here is the caller graph for this function:

def UniDec.GUniDec.UniDecApp.on_delete (   self,
  e = None 
)
Triggered on deletion or modification of selection in self.view.peakpanel.
Replots everything with peaks involved to reflect ignored peaks.
:param e: unused event
:return: None

Here is the call graph for this function:

Here is the caller graph for this function:

def UniDec.GUniDec.UniDecApp.on_differences (   self,
  e = None 
)
Triggered by right click "Display Differences" on self.view.peakpanel.
Plots a line with text listing the difference between each mass and a specific peak.
Updates the peakpanel to show the differences.
:param e: unused event
:return: None
def UniDec.GUniDec.UniDecApp.on_end_session (   self)

Here is the call graph for this function:

def UniDec.GUniDec.UniDecApp.on_export_params (   self,
  e = None 
)
Runs self.eng.export_params(), which gets critical peak parameters and writes them to a file.
:param e: event or arguments passed to self.eng.export_params()
:return: None

Here is the caller graph for this function:

def UniDec.GUniDec.UniDecApp.on_fft_window (   self,
  e 
)
def UniDec.GUniDec.UniDecApp.on_file_name (   self,
  e = None 
)
Opens window with default file names in it.
Possible to tweak default paths here, but probably dangerous.
:param e: unused event
:return: None
def UniDec.GUniDec.UniDecApp.on_fit_masses (   self,
  e = None 
)
Using the peaks as a starting guess, it will fit the zero-charge mass spectrum to a set of overlapping peaks.

Gets guesses using self.on_export_params()
Calls self.eng.fit_all_masses()
Then, plots resulting fit.
Updates peakpanel to reflect normalized peak area based on fits.
Export parameters from fit using self.on_export_params() and sending the "PostFit" argument
:param e: event or argument passed to self.on_export_params
:return: None

Here is the call graph for this function:

def UniDec.GUniDec.UniDecApp.on_flip_mode (   self,
  e 
)
Flips between MS and IM-MS mode
:param e: wx event or anything (will flip if not 0)
:return: None

Here is the call graph for this function:

Here is the caller graph for this function:

def UniDec.GUniDec.UniDecApp.on_flip_tabbed (   self,
  e 
)
Flips between tabbed plots and a single window of plots
:param e: wx Event or anything (will flip if not 0)
:return: None

Here is the call graph for this function:

def UniDec.GUniDec.UniDecApp.on_flip_twave (   self,
  e 
)
Flips between T-Wave and Linear IM-MS
:param e: wx Event or anything (will get value from Selection if not 0)
:return: None

Here is the call graph for this function:

Here is the caller graph for this function:

def UniDec.GUniDec.UniDecApp.on_get_mzlimits (   self)

Here is the caller graph for this function:

def UniDec.GUniDec.UniDecApp.on_grid_decon (   self,
  e 
)
def UniDec.GUniDec.UniDecApp.on_im_extract (   self,
  e = None 
)
Open IM extraction window for extracting data from IM plots.
Has to run UniDec again with self.eng.config.zout=-1,
    which causes the export of all charge state slices of mass vs ccs plots.
    Normally only the faces of the mass vs ccs vs charge cube are output.
:param e: unused event
:return: None

Here is the call graph for this function:

def UniDec.GUniDec.UniDecApp.on_im_tools (   self,
  e = None 
)
Open IM Parameters tool window for guessing at IM parameters.
:param e: unused event
:return: None

Here is the call graph for this function:

def UniDec.GUniDec.UniDecApp.on_import_wizard (   self,
  e = None 
)
Opens Import Wizard for extreme file conversion.
:param e: unused event
:return: None
def UniDec.GUniDec.UniDecApp.on_integrate (   self,
  plot = True,
  filled = True 
)
Triggered by right click on plot2. Integrates peaks.

If plot2 is zoomed out, it will use self.eng.autointegrate() to integrate the peaks.
If plot2 is zoomed in to a single peak, the integral for that peak is recalculated from the plot limits.
If plot2 is zoomed in to more than one peak, the integral is not set for a single peak but simply printed on
    the plot

:param plot: Boolean, whether to add filled areas to plot.
:return: None

Here is the call graph for this function:

Here is the caller graph for this function:

def UniDec.GUniDec.UniDecApp.on_kendrick (   self,
  e = None 
)
Opens Kendrick Mass Defect Analysis window.
:param e: unused event
:return: None
def UniDec.GUniDec.UniDecApp.on_left_click (   self,
  xpos,
  ypos 
)
Triggered by pubsub from plot windows.
Gets a m/z peak near the click, stores it, and waits for another click.
When two clicks has been performed, it tries to calculate the mass from their m/z value.
:param xpos: x position fed from event
:param ypos: y position fed from event
:return: None

Here is the caller graph for this function:

def UniDec.GUniDec.UniDecApp.on_load_conf_file (   self,
  e = None 
)
Opens a file dialog and then imports a new _conf.dat config file
:param e: unused space for event
:return: None

Here is the call graph for this function:

def UniDec.GUniDec.UniDecApp.on_load_default (   self,
  e = None 
)
Resets the configuration then loads the default config file from self.eng.config.defaultconfig.
Ignores min and max data cutoffs.
:param e: unused space for event
:return: None

Here is the call graph for this function:

Here is the caller graph for this function:

def UniDec.GUniDec.UniDecApp.on_load_state (   self,
  e = None 
)
Loads a saved file state by running self.eng.load_state and then updating self.view.
Runs several engine components rather than importing.
:param e: unused space for event
:return: None

Here is the call graph for this function:

def UniDec.GUniDec.UniDecApp.on_manual (   self,
  e = None 
)
Opens window for setting manual assignments. Window directly modifies self.eng.config.
:param e: unused event
:return: None
def UniDec.GUniDec.UniDecApp.on_mass_process (   self,
  e = None 
)
Updates config from the GUI, processes the zero-charge mass spectrum with the same parameters used for the
raw data, then replots the zero-charge mass spectrum.
:param e: unused event
:return: None

Here is the call graph for this function:

def UniDec.GUniDec.UniDecApp.on_mass_tools (   self,
  e = None,
  show = True 
)
Opens masstools window.

If a match was performed, it will update plot 6 and the peak panel.
If the user decides to use simulated masses, it will make plot these new peaks.
:param e: unused event
:param show: Whether to thow the window (True) or simply match and return (False)
:return: None

Here is the call graph for this function:

Here is the caller graph for this function:

def UniDec.GUniDec.UniDecApp.on_match (   self,
  e = None 
)
Automatic matching to present oligomer list.

Opens masstools window but doesn't make it visible.
Matches results to any combination of oligomers.
Hits ok and plots results.

:param e:
:return:

Here is the call graph for this function:

def UniDec.GUniDec.UniDecApp.on_nativez_tools (   self,
  e = None 
)
Opens Native Charge State analysis tools window. Parameters are stored in self.eng.config.zoffs.
:param e: unused event
:return: None
def UniDec.GUniDec.UniDecApp.on_open (   self,
  e = None 
)
Open dialog for file opening
:param e: unused space for event
:return: None

Here is the call graph for this function:

def UniDec.GUniDec.UniDecApp.on_open_file (   self,
  filename,
  directory,
  skipengine = False 
)
Opens a file. Run self.eng.open_file.
:param filename: File name
:param directory: Directory containing file
:param skipengine: Boolean, Whether to skip running the engine (used when loading state)
:return: None

Here is the call graph for this function:

Here is the caller graph for this function:

def UniDec.GUniDec.UniDecApp.on_paste_spectrum (   self,
  e = None 
)
Gets spectum from the clipboard, writes it to a new file, and then opens that new file.
:param e: unused space for event
:return: None

Here is the call graph for this function:

def UniDec.GUniDec.UniDecApp.on_pdf_report (   self,
  e = None 
)
Creates PDF report.

First, writes figures to PDF.
Then sends results to texmaker, which creates a .tex file.
Finally, runs pdflatex as commandline subprocess to convert .tex to PDF.

:param e: event passed to self.view.on_save_figur_pdf
:return: None
def UniDec.GUniDec.UniDecApp.on_peak_errors (   self,
  e = None 
)
Get peak errors and plot on Plot2.
:param e: unused space for event
:return: None
def UniDec.GUniDec.UniDecApp.on_peak_width_tool (   self,
  e = None 
)
Open peak width tool window. After it has returned, update the GUI to reflect the new peak widths.
:param e: unused event
:return: None

Here is the call graph for this function:

def UniDec.GUniDec.UniDecApp.on_pick_peaks (   self,
  e = None 
)
Pick peaks and perform initial plots on them.
:param e: unused space for event
:return: None

Here is the call graph for this function:

Here is the caller graph for this function:

def UniDec.GUniDec.UniDecApp.on_plot_composite (   self,
  e = None 
)
Plots a composite of isolated peaks that are selected.
:param e: unused event
:return: None
def UniDec.GUniDec.UniDecApp.on_plot_nativeccs (   self,
  e = None 
)
Plot native CCS as a red line on self.view.plot5mccs (mass vs ccs) plot.
:param e: unused event
:return: None
def UniDec.GUniDec.UniDecApp.on_plot_offsets (   self,
  e = None 
)
Transform the mass vs charge grid to a mass vs charge offset grid. Plot in self.view.plot5.
:param e: unused event
:return: None
def UniDec.GUniDec.UniDecApp.on_plot_peaks (   self,
  e = None 
)
Plots individual peaks as simulated spectra in plot 4.
:param e: unused space for event
:return: None

Here is the call graph for this function:

Here is the caller graph for this function:

def UniDec.GUniDec.UniDecApp.on_raw_open (   self,
  e = None,
  dirname = None 
)
Opens a file dialog for opening a raw file. Runs self.eng.raw_process and then opens the processed file.
:param e: unused space for event
:return:

Here is the call graph for this function:

def UniDec.GUniDec.UniDecApp.on_replot (   self,
  e = None 
)
Refresh the parameters from the GUI and plot everything again with the new parameters.
:param e: unused event
:return: None

Here is the call graph for this function:

Here is the caller graph for this function:

def UniDec.GUniDec.UniDecApp.on_reset (   self,
  e = None 
)
Resets UniDecConfig to default and then loads to self.view.
:param e: unused space for event
:return:

Here is the call graph for this function:

Here is the caller graph for this function:

def UniDec.GUniDec.UniDecApp.on_save_default (   self,
  e = None 
)
Saves the default config file to self.eng.config.defaultconfig
:param e: unused space for event
:return: None

Here is the call graph for this function:

def UniDec.GUniDec.UniDecApp.on_save_state (   self,
  e = None,
  filenew = None 
)
Saves the state by running self.eng.save_state. If no file is specified, opens a file dialog.
:param e: unused space for event
:param filenew: Save state zip file name
:return: None

Here is the caller graph for this function:

def UniDec.GUniDec.UniDecApp.on_smash (   self)
Triggered by right click on plot1.
Smashes the zoomed region to 0. Used to eliminate unwanted peaks.
:return: None

Here is the call graph for this function:

Here is the caller graph for this function:

def UniDec.GUniDec.UniDecApp.on_super_batch (   self,
  e = None 
)
Speedy, minimal batch procssing. Data must be processed in advance.

Does not load file or process data.
Simply writes the configuration with updated defaults to a conf.dat file.
Then runs the conf.dat file with UniDec binary.
Does not do any post processing.

This function is useful for largee data sets where you are using DataCollector or some other program to
analyze the results outside of UniDec. It allows new parameters to be run with the maximum speed.

:param e: unused event
:return: None

Here is the call graph for this function:

def UniDec.GUniDec.UniDecApp.on_tweet (   self,
  e = None 
)
Opens Twitter Extension Window.

First makes PNG files of all the figures it can. Those are fed to the window.

self.twittercodes is modified if the person has logged in, so that the person only has to log in once.

Note: don't mess with self.twittercodes. It DOES NOT contain log in information such as user name or password,
but it shouldn't be printed, which is why it lives in the memory only.

:param e: event
:return: None
def UniDec.GUniDec.UniDecApp.on_unidec_button (   self,
  e = None 
)
Runs UniDec, imports the results, and plots the output.
:param e: unused space for event
:return: None

Here is the call graph for this function:

Here is the caller graph for this function:

def UniDec.GUniDec.UniDecApp.on_unidec_path (   self,
  e = None 
)
Opens file dialog to specify new UniDec binary.
Only useful for advanced users or if something has gone horribly wrong.
Modifies self.eng.config.UniDecPath and others.
:param e: unused event
:return: None
def UniDec.GUniDec.UniDecApp.on_zerocharge_mass (   self,
  e = None 
)
The old switcheroo. Takes the mass output and makes it the m/z input.
Then changes some of the deconvolution parameters to reflect this.

The reason for this type of function is to separate deconvolution from deisotoping when isotope mode is on.
Deconvolution can be performed to generate a zero-charge mass spectrum, which can then be loaded as a new
spectrum and deisotoped with isotope mode. Still a bit experimental...
:param e: unused event
:return: None

Here is the call graph for this function:

def UniDec.GUniDec.UniDecApp.plot_integral (   self,
  limits,
  color = None,
  filled = True 
)
Plot a filled integral under a peak.
:param limits: Limits of integration
:param color: Color of fill and plot
:return: None

Here is the caller graph for this function:

def UniDec.GUniDec.UniDecApp.quit_application (   self)

Here is the caller graph for this function:

def UniDec.GUniDec.UniDecApp.remake_mainwindow (   self,
  tabbed = None 
)

Here is the caller graph for this function:

def UniDec.GUniDec.UniDecApp.start (   self)
Launch view and start MainLoop
:return:
def UniDec.GUniDec.UniDecApp.warn (   self,
  message,
  caption = 'Warning!' 
)
Send the user a message box.
:param message: Message string
:param caption: Caption string
:return: None

Here is the caller graph for this function:

Member Data Documentation

UniDec.GUniDec.UniDecApp.eng
UniDec.GUniDec.UniDecApp.twittercodes
UniDec.GUniDec.UniDecApp.view

The documentation for this class was generated from the following file: