Skip to content

Commit

Permalink
Merge pull request #31 from michaelmarty/v3
Browse files Browse the repository at this point in the history
Update to v.3.2. Build now with Python 3.7. Added logo to main screen…
  • Loading branch information
michaelmarty authored Mar 11, 2019
2 parents e0c13a7 + eaa3a11 commit faf0d40
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 7 deletions.
1 change: 1 addition & 0 deletions GUniDec.spec
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ a.datas += [('mass_table.csv', 'unidec_bin\\mass_table.csv', 'DATA')]
a.datas += [('metaunidec/images/allButton.png', 'metaunidec\\images\\allButton.png', 'DATA')]
a.datas += [('metaunidec/images/peakRightClick.png', 'metaunidec\\images\\peakRightClick.png', 'DATA')]
a.datas += [('metaunidec/images/rightClick.png', 'metaunidec\\images\\rightClick.png', 'DATA')]
a.datas += [('UniDecLogoMR.png', 'UniDecLogoMR.png', 'DATA')]


a.datas.extend(dir_files(os.path.join(os.path.dirname(pymzml.__file__), 'obo'), 'obo'))
Expand Down
16 changes: 15 additions & 1 deletion Launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from metaunidec.ultrameta import DataCollector as UMDC
import wx.py as py
import sys

import os

class UniDecLauncher(UniDecPres):
"""
Expand Down Expand Up @@ -58,13 +58,27 @@ def __init__(self, parent):
button6 = wx.Button(panel, -1, "HDF5 Import Wizard\n\nImport Data into HDF5 for MetaUniDec")
button7 = wx.Button(panel, -1, "UltraMeta Data Collector\n\nVisualize Multiple HDF5 Data Sets\nFit Trends")

html = wx.html.HtmlWindow(panel, -1, size=(330,260))
pathtofile = os.path.dirname(os.path.abspath(__file__))
self.imagepath = os.path.join(pathtofile, "UniDecLogoMR.png")
#print(self.imagepath)
html.SetPage(
"<html><body>"
#"<h1>UniDec</h1>"
"<img src=\"" + self.imagepath +"\" alt=\"PNG Icon\" height=\"200\" width=\"290\">"
"<p>Please Cite: Marty et al. Anal. Chem. 2015. "
"DOI: 10.1021/acs.analchem.5b00140.</p>"
"</body></html>"
)

sizer.Add(button1, (0, 0), flag=wx.EXPAND)
sizer.Add(button2, (1, 0), flag=wx.EXPAND)
sizer.Add(button3, (2, 0), flag=wx.EXPAND)
sizer.Add(button4, (0, 1), flag=wx.EXPAND)
sizer.Add(button6, (2, 1), flag=wx.EXPAND)
sizer.Add(button7, (1, 1), flag=wx.EXPAND)
sizer.Add(button5, (3, 0), span=(1, 2), flag=wx.EXPAND)
sizer.Add(html, (0, 2), span=(4, 2))

self.Bind(wx.EVT_BUTTON, self.button1, button1)
self.Bind(wx.EVT_BUTTON, self.button2, button2)
Expand Down
Binary file added UniDecLogoMR.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,16 @@ The main GUI class is GUniDec.UniDecApp.

## Change Log

v.3.2

Added a logo to the start screen.

Update to the latest mzML specification.

Build update to Python 3.7 and latest libraries.

Bug fixes.

v.3.1.1

Expanded isotope mode to either output monoisotopic masses or average masses.
Expand Down
7 changes: 5 additions & 2 deletions unidec.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,11 @@ def pick_peaks(self):
# Generate Intensities of Each Charge State for Each Peak
mztab = ud.make_peaks_mztab(self.data.mzgrid, self.pks, self.config.adductmass)
#Calculate errors for peaks with FWHM
ud.peaks_error_FWHM(self.pks, self.data.massdat)
ud.peaks_error_mean(self.pks, self.data.massgrid, self.data.ztab, self.data.massdat, self.config)
try:
ud.peaks_error_FWHM(self.pks, self.data.massdat)
ud.peaks_error_mean(self.pks, self.data.massgrid, self.data.ztab, self.data.massdat, self.config)
except Exception as e:
print("Error in error calculations:", e)
if self.config.batchflag == 0:
ud.make_peaks_mztab_spectrum(self.data.mzgrid, self.pks, self.data.data2, mztab)
self.export_config()
Expand Down
2 changes: 1 addition & 1 deletion unidec_modules/isolated_packages/ZoomBox.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from matplotlib.patches import Rectangle

from pubsub import setupkwargs
#from pubsub import setupkwargs
from pubsub import pub

import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion unidec_modules/unidec_enginebase.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def __init__(self):
:return: None
"""
self.version = "3.1.1"
self.version = "3.2.0"
print("\nUniDec Engine v." + self.version)
self.config = None
self.config_history = []
Expand Down
12 changes: 10 additions & 2 deletions unidec_modules/unidectools.py
Original file line number Diff line number Diff line change
Expand Up @@ -2212,8 +2212,16 @@ def peaks_error_FWHM(pks, data):
else:
rightwidth += 1
counter += 1
pk.errorFWHM = data[index + rightwidth, 0] - data[index - leftwidth, 0]
pk.intervalFWHM = [data[index - leftwidth, 0], data[index + rightwidth, 0]]

indexstart = index - leftwidth
indexend = index + rightwidth
if indexstart < 0:
indexstart = 0
if indexend >= len(data):
indexend = len(data) - 1

pk.errorFWHM = data[indexend, 0] - data[indexstart, 0]
pk.intervalFWHM = [data[indexstart, 0], data[indexend, 0]]
start = pk.intervalFWHM[0]
end = pk.intervalFWHM[1]
pk.centroid = center_of_mass(data, start, end)[0]
Expand Down

0 comments on commit faf0d40

Please sign in to comment.