unidec.modules.isolated_packages package

Submodules

unidec.modules.isolated_packages.FileDialogs module

unidec.modules.isolated_packages.FileDialogs.open_dir_dialog(message='Select a Folder')
unidec.modules.isolated_packages.FileDialogs.open_file_dialog(message='Open File', file_types='*.*', default=None)
unidec.modules.isolated_packages.FileDialogs.open_multiple_dir_dialog(message, default)
unidec.modules.isolated_packages.FileDialogs.open_multiple_files_dialog(message='Open Files', file_type='*.*')
unidec.modules.isolated_packages.FileDialogs.open_single_dir_dialog(message, default)
unidec.modules.isolated_packages.FileDialogs.save_file_dialog(message='Save File', file_types='*.*', default_file='')

unidec.modules.isolated_packages.MD_Fitter module

unidec.modules.isolated_packages.MD_Fitter.MD_Fitter(data, mds=None, maxshift=0.1, widthguess=0.05, shiftguess=None, plot=False)
unidec.modules.isolated_packages.MD_Fitter.error_function(array, massdat, psfun, posarray, nparam, maxshift, *args)
unidec.modules.isolated_packages.MD_Fitter.error_function2(array, massdat, psfun, posarray, nparam, maxshift, *args)
unidec.modules.isolated_packages.MD_Fitter.least_squares_minimize(massdat, array, psfun, posarray, nparam=3, maxshift=None, *args)

Perform least squares minimization of peaks defined in array to massdat. :param massdat: Data to fit :param array: Array of parameters for defining peaks that will be fit :param psfun: Peak shape function integer code :param args: Extra arguments for make_mass_list :return: Best fit of values in array

unidec.modules.isolated_packages.MD_Fitter.make_mass_list(massdat, arrayin, psfun, posarray, nparam=3, maxshift=None, *args)

For parameters in arrayin, make mass peaks to be fit to massdat. Arrayin must be P x 3 array of (mid, fwhm, area). :param massdat: Data to be fit :param arrayin: Parameters defining peaks :param psfun: Peak shape function integer code :param startarray: Starting array (not currently used but can be used to restrict some guesses) :param args: Extra arguments (such as nonorm to prevent normalization) :return:

unidec.modules.isolated_packages.MD_compare module

class unidec.modules.isolated_packages.MD_compare.MassDefectCompareWindow(parent, datalist=None, filelist=None, config=None)

Bases: Frame

file_dialog(e=0)
get_data(file1, file2)
makeplot(e)
notchanged

# Make the menu filemenu = wx.Menu() if self.datalist.shape[0] > 1:

extractwindow = filemenu.Append(wx.ID_ANY, “Extract Mass Defect Values”,

“Open Window to Extract Mass Defect Values”)

self.Bind(wx.EVT_MENU, self.on_extract_window, extractwindow) filemenu.AppendSeparator()

menu_save_fig_png = filemenu.Append(wx.ID_ANY, “Save Figures as PNG”,

“Save all figures as PNG in central directory”)

menu_save_fig_pdf = filemenu.Append(wx.ID_ANY, “Save Figures as PDF”,

“Save all figures as PDF in central directory”)

self.Bind(wx.EVT_MENU, self.on_save_fig, menu_save_fig_png) self.Bind(wx.EVT_MENU, self.on_save_fig_pdf, menu_save_fig_pdf)

self.plotmenu = wx.Menu() self.menuaddline = self.plotmenu.Append(wx.ID_ANY, “Add Horizontal Line”,

“Add Horizontal Line at Specific Y Value”)

self.menuaddmultiline = self.plotmenu.Append(wx.ID_ANY, “Add Multiple Lines”,

“Add Multiple Horizontal Lines at Specific Y Values”)

self.menufit = self.plotmenu.Append(wx.ID_ANY, “Fit Peaks”,

“Fit total mass defect peaks”)

self.menupeaks = self.plotmenu.Append(wx.ID_ANY, “Label Peaks”,

“Label peaks”)

self.menulinreg = self.plotmenu.Append(wx.ID_ANY, “Linear Regression”,

“Linear Regression”)

self.menucom = self.plotmenu.Append(wx.ID_ANY, “Center of Mass”, “Center of Mass”)

self.Bind(wx.EVT_MENU, self.on_add_line, self.menuaddline) self.Bind(wx.EVT_MENU, self.on_add_multilines, self.menuaddmultiline) self.Bind(wx.EVT_MENU, self.on_fit, self.menufit) self.Bind(wx.EVT_MENU, self.on_label_peaks, self.menupeaks) self.Bind(wx.EVT_MENU, self.on_linear_regression, self.menulinreg) self.Bind(wx.EVT_MENU, self.on_com, self.menucom)

menu_bar = wx.MenuBar() menu_bar.Append(filemenu, “&File”) menu_bar.Append(self.plotmenu, “Plot”) self.SetMenuBar(menu_bar)

on_close(e)

Close the window. Will try to set self.config.molig as self.m0. :param e: Unused event :return: None

on_f1button(e=0)
on_f2button(e=0)
on_replot(e=0)

unidec.modules.isolated_packages.NoZoomSpan module

class unidec.modules.isolated_packages.NoZoomSpan.NoZoomSpan(axes, onselect, parent=None, minspan=None, useblit=False, rectprops=None, zoombutton=None, onmove_callback=None)

Bases: ZoomCommon

Expansion of matplotlib embed in wx example by John Bender and Edward Abraham, see https://www.scipy.org/Matplotlib_figure_in_a_wx_panel

This version allows the user to zoom in on the figure using either a span selector or a box selector. You can also set a persistent span selector that acts as cursor references on top of whatever is plotted

ZoomSpan based on matplotlib.widgets.SpanSelector CursorSpan based on matplotlib.widgets.SpanSelector BoxZoom based on matplotlib.widgets.RectangleSelector

Brian J. Soher, Duke University, 20 October, 2010

Select a min/max range of the x or y axes for a matplotlib Axes

Example usage:

axes = subplot(111) axes.plot(x,y)

def onselect(vmin, vmax):

print vmin, vmax

span = ZoomSpan(axes, onselect, ‘horizontal’)

onmove_callback is an optional callback that will be called on mouse move with the span range

ignore(event)

return True if event should be ignored

new_axes(axes)
onmove(event)
press(event)

on button press event

release(event)

on button release event

update()

draw using newfangled blit or oldfangled draw depending on useblit

update_background(event)

force an update of the background

unidec.modules.isolated_packages.ZoomBox module

class unidec.modules.isolated_packages.ZoomBox.ZoomBox(axes, onselect, parent=None, groups=None, drawtype='box', minspanx=None, minspany=None, useblit=False, lineprops=None, rectprops=None, onmove_callback=None, spancoords='data', button=None, data_lims=None, swoop=False, integrate=0, smash=0, pad=0.0001)

Bases: ZoomCommon

Select a min/max range of the x axes for a matplotlib Axes

Example usage:

from matplotlib.widgets import  RectangleSelector
from pylab import *

def onselect(xmin, xmax, value, ymin, ymax):
  'eclick and erelease are matplotlib events at press and release'
  print ' x,y min position : (%f, %f)' % (xmin, ymin)
  print ' x,y max position   : (%f, %f)' % (xmax, ymax)
  print ' used button   : ', eclick.button

def toggle_selector(event):
    print ' Key pressed.'
    if event.key in ['Q', 'q'] and toggle_selector.RS.active:
        print ' RectangleSelector deactivated.'
        toggle_selector.RS.set_active(False)
    if event.key in ['A', 'a'] and not toggle_selector.RS.active:
        print ' RectangleSelector activated.'
        toggle_selector.RS.set_active(True)

x = arange(100)/(99.0)
y = sin(x)
fig = figure
axes = subplot(111)
axes.plot(x,y)

toggle_selector.RS = ZoomBox(axes, onselect, drawtype='line')
connect('key_press_event', toggle_selector)
show()
ignore(event)

return True if event should be ignored

initialize()
new_axes(axes, rectprops=None)
onmove(event)
press(event)

on button press event

release(event)

on button release event

set_clipping()
update()

draw using newfangled blit or oldfangled draw depending on useblit

zoomout(event=None)

unidec.modules.isolated_packages.ZoomCommon module

unidec.modules.isolated_packages.ZoomCommon.GetMaxes(axes, xmin=None, xmax=None)
unidec.modules.isolated_packages.ZoomCommon.GetStart(axes)
unidec.modules.isolated_packages.ZoomCommon.ResetVisible(axes)
class unidec.modules.isolated_packages.ZoomCommon.ZoomCommon

Bases: object

get_active()

to get status of active mode (boolean variable)

kill_labels()
label()
left_click(x, y)
on_newxy(x, y)
peakdetect(data, window=10.0, threshold=0.0)
right_click(event=None)
scans_selected(vmin, vmax)
set_active(active)

Use this to activate / deactivate the RectangleSelector

from your program with an boolean variable ‘active’.

set_auto_ylim(xmin, xmax, draw=True)
set_manual(xmin, xmax)
set_manual_y(ymin, ymax)
set_xlim(xmin, xmax, draw=True)
set_ylim(ymin, ymax, draw=True)
switch_label()
update_background(event)

force an update of the background

unidec.modules.isolated_packages.ZoomCommon.clip_all(axes)
unidec.modules.isolated_packages.ZoomCommon.clip_none(axes)
unidec.modules.isolated_packages.ZoomCommon.set_clipping(axes)
unidec.modules.isolated_packages.ZoomCommon.special_clip(axes)

unidec.modules.isolated_packages.ZoomSpan module

class unidec.modules.isolated_packages.ZoomSpan.ZoomSpan(axes, onselect, parent=None, minspan=None, useblit=False, rectprops=None, onmove_callback=None)

Bases: ZoomCommon

Expansion of matplotlib embed in wx example by John Bender and Edward Abraham, see https://www.scipy.org/Matplotlib_figure_in_a_wx_panel

This version allows the user to zoom in on the figure using either a span selector or a box selector. You can also set a persistent span selector that acts as cursor references on top of whatever is plotted

ZoomSpan based on matplotlib.widgets.SpanSelector CursorSpan based on matplotlib.widgets.SpanSelector BoxZoom based on matplotlib.widgets.RectangleSelector

Brian J. Soher, Duke University, 20 October, 2010

Select a min/max range of the x or y axes for a matplotlib Axes

Example usage:

axes = subplot(111) axes.plot(x,y)

def onselect(vmin, vmax):

print vmin, vmax

span = ZoomSpan(axes, onselect, ‘horizontal’)

onmove_callback is an optional callback that will be called on mouse move with the span range

ignore(event)

return True if event should be ignored

new_axes(axes)
onmove(event)
press(event)

on button press event

release(event)

on button release event

update()

draw using newfangled blit or oldfangled draw depending on useblit

zoomout(event=None)

unidec.modules.isolated_packages.biopolymer_calculator module

class unidec.modules.isolated_packages.biopolymer_calculator.BiopolymerFrame(parent)

Bases: Dialog

calculate(e=0)
close_ok(e=None)
on_close_cancel(e)

Close the dialog but do not modify any of the values. :param e: Unused event :return: None

unidec.modules.isolated_packages.mql_tool module

class unidec.modules.isolated_packages.mql_tool.MQL_TOOL(file)

Bases: object

query(input_query, pks)

unidec.modules.isolated_packages.navia_importer module

unidec.modules.isolated_packages.navia_importer.navia2config(config_obj, json_dict)
unidec.modules.isolated_packages.navia_importer.navia2manualfile(json_dict, mfilepath)
unidec.modules.isolated_packages.navia_importer.navia2ofile(json_dict, ofilepath)
unidec.modules.isolated_packages.navia_importer.navia_import(path)

unidec.modules.isolated_packages.preset_manager module

class unidec.modules.isolated_packages.preset_manager.TestWindow(parent=None)

Bases: Frame

on_defaults(e)
unidec.modules.isolated_packages.preset_manager.make_preset_menu(toppath=None, exclude_dir=None, topi=1500, ext='', exclude_ext=None, exclude_dir_list=None)

unidec.modules.isolated_packages.score_window module

class unidec.modules.isolated_packages.score_window.ScoreFrame(parent)

Bases: Frame

populate(pks)
class unidec.modules.isolated_packages.score_window.ScoreListCtrl(parent, id_value, pos=wx.Point(-1, -1), size=wx.Size(-1, -1))

Bases: Grid

OnKey(event)
clear_list()
copy()

Copies the current range of select cells to clipboard.

populate(pks)
unidec.modules.isolated_packages.score_window.score_plots(eng)
unidec.modules.isolated_packages.score_window.score_plots2(eng, save=False)
unidec.modules.isolated_packages.score_window.score_window(eng)
unidec.modules.isolated_packages.score_window.scr(score)
unidec.modules.isolated_packages.score_window.scr2(p)

unidec.modules.isolated_packages.spreadsheet module

class unidec.modules.isolated_packages.spreadsheet.CutomGridCellAutoWrapStringRenderer

Bases: GridCellRenderer

Clone() GridCellRenderer

This function must be implemented in derived classes to return a copy of itself.

Draw(grid, attr, dc, rect, row, col, isSelected)

Draw the given cell on the provided DC inside the given rectangle using the style specified by the attribute and the default or selected state corresponding to the isSelected value.

GetBestSize(grid, attr, dc, row, col) wx.Size

Get the preferred size of the cell for its contents.

class unidec.modules.isolated_packages.spreadsheet.MyApp(redirect=False, filename=None, useBestVisual=False, clearSigInt=True)

Bases: App, InspectionMixin

OnInit(self) bool
class unidec.modules.isolated_packages.spreadsheet.MyGrid(parent, panel)

Bases: Grid

add_cols(event)
add_history(change)
add_line(**kwargs)
add_rows(event=None)
autoscale_column_width()
clear_all()
color_column(col, color)
color_columns_by_keyword(keyword, color)
copy(event)

Copies range of selected cells to clipboard.

cut(event)
delete(event)
delete_all()
delete_cols(event)
delete_rows(event)
fill_empty(fillvalue='0')
get_col_headers()
get_df()
get_list()
get_selected_cells()
get_selected_rows()
get_selection()

Returns selected range’s start_row, start_col, end_row, end_col If there is no selection, returns selected cell’s start_row=end_row, start_col=end_col

get_table()
hide_columns(index)
hide_columns_by_keyword(keyword)
hide_empty_columns()
is_empty_column(col)
on_cell_right_click(event)
on_change(event)
on_hide_columns(event)
on_key(event)

Handles all key events.

on_label_right_click(event)
paste(event)
remove_empty(col_header=None)
rename_col(event)
save_file(filename=None)

Saves the grid to a file. :param filename: filename to save to :return: None

set_col_headers(headers)
set_df(df)
set_row_values(row, **kwargs)
show_all_columns(event=None)
show_columns_by_keyword(keyword)
sort_by_column(column)
sort_by_selected_column(event)
undo()
class unidec.modules.isolated_packages.spreadsheet.SpreadsheetFrame(nrows, ncolumns, title='')

Bases: Frame

class unidec.modules.isolated_packages.spreadsheet.SpreadsheetPanel(parent, panel, nrows=0, ncolumns=0)

Bases: object

add_col(label='')
set_col_labels(labels)

unidec.modules.isolated_packages.texmaker module

Created on Wed Apr 02 15:52:23 2014

@author: Michael.Marty

unidec.modules.isolated_packages.texmaker.MakeTexReport(fname, config, path, peaks, labels, names, color, figureflags)
unidec.modules.isolated_packages.texmaker.PDFTexReport(fname)

unidec.modules.isolated_packages.texmaker_nmsgsb module

Created on Wed Apr 02 15:52:23 2014

@author: Michael.Marty

unidec.modules.isolated_packages.texmaker_nmsgsb.MakeTexReport(fname, config, path, peaks, labels, names, color, figureflags, output, rawsamplename, match, uniscore)
unidec.modules.isolated_packages.texmaker_nmsgsb.PDFTexReport(fname)

This new call adds in a change directory, which previously had been part of the UniDec code. Note: I would like to remove this but can’t figure out how to get LaTeX to work of absolute paths. :param fname: File Name :return: None

Module contents