Skip to content

Commit

Permalink
Revision 6.48 - October 10, 2010
Browse files Browse the repository at this point in the history
 - New version of MwtWindll.dll that avoids overflow errors when computing isotopic distributions for large compounds
  • Loading branch information
alchemistmatt committed Oct 11, 2010
1 parent d5aebaf commit dacdb39
Show file tree
Hide file tree
Showing 25 changed files with 77 additions and 48 deletions.
4 changes: 2 additions & 2 deletions MWTWIN.BAS
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ Option Explicit
' version 6.35

' *** Be sure to update version in Project | Properties also ***
Public Const PROGRAM_VERSION = "6.47"
Public Const PROGRAM_DATE = "October 26, 2009"
Public Const PROGRAM_VERSION = "6.48"
Public Const PROGRAM_DATE = "October 10, 2010"
' ***

'
Expand Down
20 changes: 10 additions & 10 deletions MWT_VALU.bak
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; Values File for MWTWIN Program (v6.47)
; Values File for MWTWIN Program (v6.48)
;
; File Automatically Created -- Select Save Values and Formulas under the Options Menu
;
Expand Down Expand Up @@ -371,23 +371,23 @@ FragModelIonAlignment=0
SeriesPlotMode=1
SeriesLineStyle=0
SeriesLineWidth=1
SeriesLineColor=255
SeriesLineToBaseColor=255
SeriesBarFillColor=255
SeriesLineColor=16711680
SeriesLineToBaseColor=16711680
SeriesBarFillColor=16711680
SeriesPointStyle=0
SeriesPointColor=255
SeriesPointColor=16711680
AnnotationFontName=Arial
AnnotationFontSize=10
AnnotationFontColor=0
[PlotOptions_Series2]
SeriesPlotMode=1
SeriesLineStyle=0
SeriesLineWidth=1
SeriesLineColor=40960
SeriesLineToBaseColor=40960
SeriesBarFillColor=40960
SeriesLineColor=32768
SeriesLineToBaseColor=32768
SeriesBarFillColor=32768
SeriesPointStyle=0
SeriesPointColor=40960
SeriesPointColor=32768
AnnotationFontName=Arial
AnnotationFontSize=10
AnnotationFontColor=0
Expand Down Expand Up @@ -422,7 +422,7 @@ PrecisionY=1
CursorVisible=True
CursorSnapToData=False
CursorColor=0
CursorPositionX=0
CursorPositionX=100
CursorPositionY=0
AutoLabelPeaksDisplayXPosition=True
AutoLabelPeaksDisplayYPosition=False
Expand Down
Binary file modified MsiSetup/MwtWinMsiSetup.cache
Binary file not shown.
Binary file modified MsiSetup/MwtWinMsiSetup.wip
Binary file not shown.
2 changes: 0 additions & 2 deletions MwtWinDll/ErrorLog.txt

This file was deleted.

2 changes: 1 addition & 1 deletion MwtWinDll/MwtWinDll.vbw
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
MolecularWeightCalculator = 22, 24, 746, 516,
MWCompoundClass = 132, 144, 856, 636, C
MWPeptideClass = 132, 144, 856, 636,
ElementAndMassRoutines = 154, 168, 891, 660, Z
ElementAndMassRoutines = 154, 168, 891, 660,
modSharedVBRoutines = 0, 0, 795, 492, C
MWCapillaryFlowClass = 154, 168, 884, 660, C
frmProgress = 115, 115, 784, 491, C, 23, 23, 670, 391, C
Expand Down
Binary file modified MwtWinDll/MwtWinDllTest.exe
Binary file not shown.
11 changes: 6 additions & 5 deletions MwtWinDll/MwtWinDllTest.vbp
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
Type=Exe
Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#C:\WINDOWS\system32\stdole2.tlb#OLE Automation
Reference=*\G{40A1F1BF-ADB0-441E-BF5F-0A5E4A1DDC48}#1.0#0#MwtWindll.dll#Molecular Weight Calculator - Dll Version
Object={3B7C8863-D78F-101B-B9B5-04021C009402}#1.2#0; richtx32.ocx
Object={5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0; MSFLXGRD.OCX
Reference=*\G{2779F0A5-153F-49E8-BDA8-2417488A54A3}#1.0#0#MwtWindll.dll#Molecular Weight Calculator - Dll Version
Object={3B7C8863-D78F-101B-B9B5-04021C009402}#1.2#0; richtx32.Ocx
Object={5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0; msflxgrd.ocx
Form=MwtWinDllTest.frm
Module=modMwtWinDllTest; MwtWinDllTest.bas
Form=frmresults.frm
IconForm="frmMwtWinDllTest"
Startup="Sub Main"
HelpFile=""
Title="MwtWinDllTest"
ExeName32="MwtWinDllTest.exe"
Command32=""
Name="MwtWinDllTest"
HelpContextID="0"
CompatibleMode="0"
MajorVer=1
MinorVer=0
RevisionVer=0
AutoIncrementVer=0
RevisionVer=2
AutoIncrementVer=1
ServerSupportFiles=0
VersionCompanyName="PNNL"
CompilationType=0
Expand Down
2 changes: 1 addition & 1 deletion MwtWinDll/MwtWinDllTest.vbw
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
frmMwtWinDllTest = 75, 21, 514, 513, , 10, -7, 777, 590, C
frmMwtWinDllTest = 75, 21, 514, 513, Z, 10, -7, 777, 590, C
modMwtWinDllTest = 22, 24, 866, 533,
frmResults = 110, 120, 952, 647, , 66, 72, 908, 599, C
Binary file modified MwtWinDll/MwtWinDll_MergeModule/MwtWinDll_MergeModule.cache
Binary file not shown.
Binary file modified MwtWinDll/MwtWinDll_MergeModule/MwtWinDll_MergeModule.wip
Binary file not shown.
Binary file modified MwtWinDll/MwtWindll.dll
Binary file not shown.
Binary file modified MwtWinDll/MwtWindll.exp
Binary file not shown.
Binary file modified MwtWinDll/MwtWindll.lib
Binary file not shown.
2 changes: 1 addition & 1 deletion MwtWinDll/MwtWindll.vbp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ CompatibleMode="0"
CompatibleEXE32="MwtWindll.dll"
MajorVer=2
MinorVer=37
RevisionVer=75
RevisionVer=76
AutoIncrementVer=1
ServerSupportFiles=0
VersionComments="Written by Matthew Monroe"
Expand Down
5 changes: 5 additions & 0 deletions MwtWinDll/RevisionHistory.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
MwtWin.Dll Change Log

Version 2.37, Build 75; October 10, 2010
- Now checking for PredictedConvIterations in ComputeIsotopicAbundancesInternal surpassing the 32-bit integer boundary (2147483647)
- Now checking for the Iteration tracking variable in ConvoluteMasses surpassing the 32-bit integer boundary
- If this happens, then resets the iterations to 0

Version 2.37, Build 74; October 16, 2009
- Added support for c and z ions in function GetFragmentationMasses()
- Changed blnShowCharge() from type Integer to type Boolean in the GetFragmentationMasses() function
Expand Down
31 changes: 26 additions & 5 deletions MwtWinDll/WorkingRoutines.bas
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ Public Function ComputeIsotopicAbundancesInternal(ByRef strFormulaIn As String,
Exit Function
End If

On Error GoTo IsoAbundanceErrorHandler
On Error GoTo IsoAbundanceErrorHandler

' Change strHeaderMassToCharge to "Neutral Mass" if intChargeState = 0 and strHeaderMassToCharge is "Mass/Charge"
If intChargeState = 0 Then
Expand Down Expand Up @@ -814,10 +814,17 @@ Public Function ComputeIsotopicAbundancesInternal(ByRef strFormulaIn As String,
Next intElementIndex

' Examine IsoStats() to predict the number of ConvolutionIterations
' Note that PredictedConvIterations could become larger than a long (32-bit integer)
' We're using on error resume next to catch this

On Error Resume Next

PredictedConvIterations = IsoStats(1).ResultsCount
For intElementIndex = 2 To intElementCount
PredictedConvIterations = PredictedConvIterations * IsoStats(2).ResultsCount
Next intElementIndex

On Error GoTo IsoAbundanceErrorHandler

If blnShowProgressForm Then
frmProgress.InitializeForm "Finding Isotopic Abundances", 0, IsoStats(1).ResultsCount, False
Expand Down Expand Up @@ -1182,17 +1189,30 @@ Private Function FindIndexForNominalMass(IsoCombos() As Long, ComboIndex As Long
FindIndexForNominalMass = (lngWorkingMass - AtomCount * Round(ThisElementsIsotopes(1).Mass, 0)) + 1
End Function

Private Sub ConvoluteMasses(ByRef ConvolutedAbundances() As udtIsoResultsOverallType, ByRef ConvolutedAbundanceStartMass As Long, ByRef WorkingRow As Long, ByRef WorkingAbundance As Single, ByRef WorkingMassTotal As Long, ByRef ElementTrack As Integer, ByRef IsoStats() As udtIsoResultsByElementType, ByRef ElementCount As Integer, ByRef Iterations As Long)
Private Sub ConvoluteMasses(ByRef ConvolutedAbundances() As udtIsoResultsOverallType, _
ByRef ConvolutedAbundanceStartMass As Long, _
ByRef WorkingRow As Long, _
ByRef WorkingAbundance As Single, _
ByRef WorkingMassTotal As Long, _
ByRef ElementTrack As Integer, _
ByRef IsoStats() As udtIsoResultsByElementType, _
ByRef ElementCount As Integer, _
ByRef Iterations As Long)

' Recursive function to Convolute the Results in IsoStats() and store in ConvolutedAbundances(); 1-based array

Dim IndexToStoreResult As Long, RowIndex As Long
Dim NewAbundance As Single, NewMassTotal As Long

If KeyPressAbortProcess > 1 Then Exit Sub

Iterations = Iterations + 1
If Iterations Mod 10000 = 0 Then
DoEvents
If Iterations < 2147483647 Then
Iterations = Iterations + 1
If Iterations Mod 10000 = 0 Then
DoEvents
End If
Else
Iterations = 0
End If

NewAbundance = WorkingAbundance * IsoStats(ElementTrack).MassAbundances(WorkingRow)
Expand All @@ -1208,6 +1228,7 @@ Private Sub ConvoluteMasses(ByRef ConvolutedAbundances() As udtIsoResultsOverall
End With
Else
For RowIndex = 1 To IsoStats(ElementTrack + 1).ResultsCount
' Recursively call this function
ConvoluteMasses ConvolutedAbundances(), ConvolutedAbundanceStartMass, RowIndex, NewAbundance, NewMassTotal, ElementTrack + 1, IsoStats(), ElementCount, Iterations
Next RowIndex
End If
Expand Down
2 changes: 1 addition & 1 deletion MwtWinDll/clsMwtWin.cls
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Option Explicit
'
' Project started: November 12, 2002

Private Const PROGRAM_DATE = "October 16, 2009"
Private Const PROGRAM_DATE = "October 10, 2010"
Private Const PROGRAM_VERSION = "2.37"

' Duplicate of enum statements in ElementAndMassRoutines.bas
Expand Down
12 changes: 6 additions & 6 deletions Mwtwin.vbp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ Type=Exe
Reference=*\G{ADB880A2-D8FF-11CF-9377-00AA003B7A11}#4.0#0#C:\WINDOWS\SysWow64\hhctrl.ocx#HHCtrl 4.0 Type Library
Reference=*\G{F935DC20-1CF0-11D0-ADB9-00C04FD58A0B}#1.0#0#C:\WINDOWS\SysWOW64\wshom.ocx#Windows Script Host Object Model
Reference=*\G{C4BE505F-B909-4F29-9F14-365325BDB989}#2e.0#0#C:\WINDOWS\SysWOW64\CWSpectrumDll.dll#CWSpectrumDLL
Reference=*\G{5847469D-67A3-42D8-841C-FE5A387950AE}#1.0#0#C:\WINDOWS\SysWOW64\MwtWindll.dll#Molecular Weight Calculator - Dll Version
Object={5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0; MSFlxGrd.ocx
Object={3B7C8863-D78F-101B-B9B5-04021C009402}#1.2#0; richtx32.ocx
Object={F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0; ComDlg32.OCX
Reference=*\G{2779F0A5-153F-49E8-BDA8-2417488A54A3}#1.0#0#MwtWindll.dll#Molecular Weight Calculator - Dll Version
Object={5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0; msflxgrd.ocx
Object={3B7C8863-D78F-101B-B9B5-04021C009402}#1.2#0; richtx32.Ocx
Object={F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0; comdlg32.ocx
Form=mwtwin.frm
Module=MwtWinProcedures; MWTWIN.BAS
Form=ABOUT.FRM
Expand Down Expand Up @@ -52,8 +52,8 @@ HelpContextID="0"
Description="Molecular Weight Calculator for Windows, v6.41"
CompatibleMode="0"
MajorVer=6
MinorVer=47
RevisionVer=237
MinorVer=48
RevisionVer=238
AutoIncrementVer=1
ServerSupportFiles=0
VersionComments="by Matthew Monroe "
Expand Down
4 changes: 2 additions & 2 deletions Mwtwin.vbw
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
frmMain = 0, 0, 0, 0, C, 132, 174, 855, 641, C
MwtWinProcedures = 88, 116, 1011, 553,
MwtWinProcedures = 88, 116, 1011, 553, Z
frmAboutBox = 0, 0, 0, 0, C, 44, 58, 767, 525, C
frmChangeFont = 0, 0, 0, 0, C, 66, 87, 789, 554, C
frmChangeValue = 0, 0, 0, 0, C, 88, 116, 811, 583, C
Expand All @@ -20,7 +20,7 @@ frmIntro = 0, 0, 0, 0, C, 22, 29, 745, 496, C
frmMMConvert = 66, 87, 789, 554, , 22, 29, 745, 496, C
modSharedVBRoutines = 44, 58, 967, 495,
frmSetValue = 0, 0, 0, 0, C, 66, 87, 789, 554, C
frmFragmentationModelling = 154, 203, 1490, 753, Z, 88, 116, 811, 583, C
frmFragmentationModelling = 154, 203, 1490, 753, , 88, 116, 811, 583, C
frmIonMatchOptions = 0, 0, 0, 0, C, 110, 145, 833, 612, C
frmFinder = 0, 0, 0, 0, C, 132, 174, 855, 641, C
frmIsotopicDistribution = 154, 203, 835, 679, , 154, 203, 877, 670, C
Expand Down
4 changes: 4 additions & 0 deletions RevisionHistory.txt
Original file line number Diff line number Diff line change
Expand Up @@ -514,3 +514,7 @@ Revision 6.46 - October 16, 2009

Revision 6.47 - October 26, 2009
- Updated the Mole/Mass Converter window to include m/z conversion tools, including M+H conversion, and calculation of mass ranges for a given ppm-based tolerance

Revision 6.48 - October 10, 2010
- New version of MwtWindll.dll that avoids overflow errors when computing isotopic distributions for large compounds
- Example: C489 H300 F27 Fe8 N72 Ni6 O27 S9
2 changes: 1 addition & 1 deletion SetupHelp.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ to run the "Molecular Weight Calculator.msi" setup file.
Written by Matthew Monroe for the Department of Energy (PNNL, Richland, WA)

E-mail: matthew.monroe@pnl.gov or matt@alchemistmatt.com
Website: http://ncrr.pnl.gov/ or http://www.sysbio.org/resources/staff/ or
Website: http://omics.pnl.gov/software or http://www.sysbio.org/resources/staff/ or
http://www.alchemistmatt.com/ or http://come.to/alchemistmatt/
-------------------------------------------------------------------------------

Expand Down
20 changes: 10 additions & 10 deletions mwt_valu.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; Values File for MWTWIN Program (v6.47)
; Values File for MWTWIN Program (v6.48)
;
; File Automatically Created -- Select Save Values and Formulas under the Options Menu
;
Expand Down Expand Up @@ -371,23 +371,23 @@ FragModelIonAlignment=0
SeriesPlotMode=1
SeriesLineStyle=0
SeriesLineWidth=1
SeriesLineColor=255
SeriesLineToBaseColor=255
SeriesBarFillColor=255
SeriesLineColor=16711680
SeriesLineToBaseColor=16711680
SeriesBarFillColor=16711680
SeriesPointStyle=0
SeriesPointColor=255
SeriesPointColor=16711680
AnnotationFontName=Arial
AnnotationFontSize=10
AnnotationFontColor=0
[PlotOptions_Series2]
SeriesPlotMode=1
SeriesLineStyle=0
SeriesLineWidth=1
SeriesLineColor=40960
SeriesLineToBaseColor=40960
SeriesBarFillColor=40960
SeriesLineColor=32768
SeriesLineToBaseColor=32768
SeriesBarFillColor=32768
SeriesPointStyle=0
SeriesPointColor=40960
SeriesPointColor=32768
AnnotationFontName=Arial
AnnotationFontSize=10
AnnotationFontColor=0
Expand Down Expand Up @@ -422,7 +422,7 @@ PrecisionY=1
CursorVisible=True
CursorSnapToData=False
CursorColor=0
CursorPositionX=0
CursorPositionX=100
CursorPositionY=0
AutoLabelPeaksDisplayXPosition=True
AutoLabelPeaksDisplayYPosition=False
Expand Down
Binary file modified mwtwin.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion mwtwin.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; Options File for MWTWIN Program (v6.47)
; Options File for MWTWIN Program (v6.48)
;
; File Automatically Created -- Select Save Options As Defaults in Preferences under the Options Menu
;
Expand Down

0 comments on commit dacdb39

Please sign in to comment.