Skip to content

Commit

Permalink
Version 2.37, Build 78; May 15, 2012
Browse files Browse the repository at this point in the history
 - Added parameter blnAddProtonChargeCarrier to ComputeIsotopicAbundances
  • Loading branch information
alchemistmatt committed May 16, 2012
1 parent 6b4f603 commit 840590a
Show file tree
Hide file tree
Showing 33 changed files with 143 additions and 136 deletions.
4 changes: 4 additions & 0 deletions Batch.txt
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,7 @@ CH2(CH2)7CH2Br
; Change the charge state with the following command
ISOTOPICDISTRIBUTIONCHARGE=2
CH2(CH2)7CH2Br

; Disable adding a proton when computing m/z
ISOTOPICDISTRIBUTIONADDPROTON=False
CH2(CH2)7CH2Br
4 changes: 4 additions & 0 deletions BatchSimple.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@ CH2(CH2)7CH2Br
; Change the charge state with the following command
ISOTOPICDISTRIBUTIONCHARGE=2
CH2(CH2)7CH2Br

; Disable adding a proton when computing m/z
ISOTOPICDISTRIBUTIONADDPROTON=False
CH2(CH2)7CH2Br
2 changes: 2 additions & 0 deletions FileIOFunctions.bas
Original file line number Diff line number Diff line change
Expand Up @@ -1358,6 +1358,7 @@ On Error GoTo LoadValuesAndFormulasErrorHandler
frmIsotopicDistribution.txtEffectiveResolution = strSettingInFile
Case "IONPLOTRESOLUTIONMASS": frmIsotopicDistribution.txtEffectiveResolutionMass = strSettingInFile
Case "IONPLOTGAUSSIANQUALITY": frmIsotopicDistribution.txtGaussianQualityFactor = strSettingInFile
Case "IONPLOTADDPROTON": frmIsotopicDistribution.chkAddProtonChargeCarrier.value = lngSettingInFile
Case "IONCOMPARISONPLOTCOLOR": frmIsotopicDistribution.lblComparisonListPlotColor.BackColor = lngSettingInFile
Case "IONCOMPARISONPLOTTYPE"
ValidateValueLng lngSettingInFile, 0, 2, 0 ' ipmSticksToZero
Expand Down Expand Up @@ -2381,6 +2382,7 @@ On Error GoTo SaveValuesErrorHandler
Print #OutFileNum, "IonPlotResolution=" & Trim(.txtEffectiveResolution.Text)
Print #OutFileNum, "IonPlotResolutionMass=" & Trim(.txtEffectiveResolutionMass.Text)
Print #OutFileNum, "IonPlotGaussianQuality=" & Trim(.txtGaussianQualityFactor.Text)
Print #OutFileNum, "IonPlotAddProton=" & CheckBoxToIntegerString(.chkAddProtonChargeCarrier)
Print #OutFileNum, "IonComparisonPlotColor=" & Trim(.lblComparisonListPlotColor.BackColor)
Print #OutFileNum, "IonComparisonPlotType=" & Trim(.cboComparisonListPlotType.ListIndex)
Print #OutFileNum, "IonComparisonPlotNormalize=" & CheckBoxToIntegerString(.chkComparisonListNormalize)
Expand Down
26 changes: 22 additions & 4 deletions MWTWIN.BAS
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Option Explicit

' *** Be sure to update version in Project | Properties also ***
Public Const PROGRAM_VERSION = "6.49"
Public Const PROGRAM_DATE = "April 11, 2012"
Public Const PROGRAM_DATE = "May 15, 2012"
' ***

'
Expand Down Expand Up @@ -276,7 +276,7 @@ Public Sub AddToIntro(strAdd As String, Optional blnUseMsgBoxInstead As Boolean
frmIntro.lblLoadStatus.Caption = frmIntro.lblLoadStatus.Caption & vbCrLf & strAdd
If blnErrorMessage Then
gBlnLoadStatusOK = False
frmIntro.CmdOK.Visible = True
frmIntro.cmdOK.Visible = True
End If
End If

Expand Down Expand Up @@ -519,6 +519,7 @@ Public Sub BatchProcessTextFile(Optional strInputFilename As String = "", Option
Dim strHeaderMass As String
Dim strHeaderFraction As String
Dim strHeaderIntensity As String
Dim blnAddProtonChargeCarrier As Boolean

Dim InFileNum As Integer, OutFileNum As Integer

Expand Down Expand Up @@ -551,6 +552,7 @@ Public Sub BatchProcessTextFile(Optional strInputFilename As String = "", Option
strHeaderMass = LookupLanguageCaption(15210, "Mass/Charge")
strHeaderFraction = LookupLanguageCaption(15220, "Fraction")
strHeaderIntensity = LookupLanguageCaption(15230, "Intensity")
blnAddProtonChargeCarrier = True

If strInputFilename = "" Then
' 1510 = Text Files, 1515 = .txt
Expand Down Expand Up @@ -617,6 +619,7 @@ Public Sub BatchProcessTextFile(Optional strInputFilename As String = "", Option
strSettingsUCase = UCase(strSettings)

Select Case Trim(strCommand)

' Output option commands
Case "VERBOSEMODE"
Select Case strSettingsUCase
Expand Down Expand Up @@ -968,6 +971,19 @@ Public Sub BatchProcessTextFile(Optional strInputFilename As String = "", Option
intIsotopicDistributionChargeState = CInt(strSettings)
If blnVerboseMode Then Print #OutFileNum, COMMENT_CHAR & " Isotopic Distribution charge set to " & Trim(intIsotopicDistributionChargeState)
End If

Case "ISOTOPICDISTRIBUTIONADDPROTON"
' Whether or not to add a proton whem charge is >=1 during Isotopic Distribution calculations
If blnVerboseMode Then Print #OutFileNum, ""
Select Case strSettingsUCase
Case "TRUE", "1", "ON"
If blnVerboseMode Then Print #OutFileNum, COMMENT_CHAR & " Isotopic Distribution calculations will add a proton when charge is >= 1"
blnAddProtonChargeCarrier = True
Case Else
If blnVerboseMode Then Print #OutFileNum, COMMENT_CHAR & " Isotopic Distribution calculations will not add a proton when charge is >= 1"
blnAddProtonChargeCarrier = False
End Select

Case Else
Print #OutFileNum, COMMENT_CHAR & " Error: Unknown Command: " & strCommand
End Select
Expand Down Expand Up @@ -1044,7 +1060,7 @@ Public Sub BatchProcessTextFile(Optional strInputFilename As String = "", Option
intIsotopicDistributionChargeState = 1
End If

lngErrorID = objMwtWin.ComputeIsotopicAbundances(strWork, intIsotopicDistributionChargeState, strResults, dblDummyArray, 0, strHeaderIsotopicAbundace, strHeaderMass, strHeaderFraction, strHeaderIntensity)
lngErrorID = objMwtWin.ComputeIsotopicAbundances(strWork, intIsotopicDistributionChargeState, strResults, dblDummyArray, 0, strHeaderIsotopicAbundace, strHeaderMass, strHeaderFraction, strHeaderIntensity, blnAddProtonChargeCarrier)

If lngErrorID = 0 Then
' Formula parsed successfuly
Expand Down Expand Up @@ -1814,7 +1830,7 @@ Public Sub Main()

If Not gNonSaveExitApp Then
If Not gBlnLoadStatusOK Then
frmIntro.CmdOK.SetFocus
frmIntro.cmdOK.SetFocus
End If
Else
If gCommandLineInstructionsDisplayed Then
Expand Down Expand Up @@ -2889,6 +2905,8 @@ On Error GoTo SetDefaultValuesAndFormulasErrorHandler

SetCheckBox .chkAutoLabelPeaks, False
SetCheckBox .chkPlotResults, True

SetCheckBox .chkAddProtonChargeCarrier, True
End With

If blnShowDebugPrompts Then MsgBox "Call objMwtWin.Peptide.SetDefaultModificationSymbols"
Expand Down
2 changes: 1 addition & 1 deletion MWT_ELEM.bak
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; Elements File for MWTWIN program (v6.48)
; Elements File for MWTWIN program (v6.49)
;
; Comments may be added by preceding with a semicolon
; The heading [ELEMENTWEIGHTTYPE] 1 signifies that Average Elemental Weights are
Expand Down
61 changes: 31 additions & 30 deletions MWT_VALU.bak
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
; Values File for MWTWIN Program (v6.48)
; Values File for MWTWIN Program (v6.49)
;
; File Automatically Created -- Select Save Values and Formulas under the Options Menu
;
Formula0=C2H3NO
Formula1=C2H2O
Formula0=BrCH2(CH2)7CH2Br
Formula1=FeCl3-6H2O
Formula2=Co(Bpy)(CO)4
Formula3=^13C6H6-.1H2O
Formula4=HGlyLeuTyrOH
Expand Down Expand Up @@ -126,15 +126,16 @@ IonPlotType=1
IonPlotResolution=5000
IonPlotResolutionMass=1000
IonPlotGaussianQuality=50
IonPlotAddProton=1
IonComparisonPlotColor=255
IonComparisonPlotType=0
IonComparisonPlotNormalize=1
FinderAction=0
FinderMWT=515.343
FinderMWT=200
FinderPercentMaxWeight=400
FinderPPM=1
FinderPPM=0
FinderShowDeltaMass=1
FinderWtTolerance=15
FinderWtTolerance=0.05
FinderPercentTolerance=1
FinderMaxHits=100
FinderSortResults=1
Expand All @@ -149,48 +150,48 @@ FinderHighlightText=0
FinderAutoBoundsSet=1
FinderSortMode=0
FinderMin0=0
FinderMax0=44
FinderMax0=10
FinderCheckElements0=1
FinderPercentValue0=Percent
FinderMin1=0
FinderMax1=257
FinderMax1=10
FinderCheckElements1=1
FinderPercentValue1=Percent
FinderMin2=0
FinderMax2=38
FinderMax2=10
FinderCheckElements2=1
FinderPercentValue2=Percent
FinderMin3=0
FinderMax3=33
FinderMax3=10
FinderCheckElements3=1
FinderPercentValue3=Percent
FinderMin4=0
FinderMax4=20
FinderMax4=10
FinderCheckElements4=0
FinderPercentValue4=Percent
FinderCustomWeight1=# or Element or Abbrev.
FinderMin5=0
FinderMax5=20
FinderMax5=10
FinderCheckElements5=0
FinderPercentValue5=Percent
FinderCustomWeight2=# or Element or Abbrev.
FinderMin6=0
FinderMax6=20
FinderMax6=10
FinderCheckElements6=0
FinderPercentValue6=Percent
FinderCustomWeight3=# or Element or Abbrev.
FinderMin7=0
FinderMax7=20
FinderMax7=10
FinderCheckElements7=0
FinderPercentValue7=Percent
FinderCustomWeight4=# or Element or Abbrev.
FinderMin8=0
FinderMax8=20
FinderMax8=10
FinderCheckElements8=0
FinderPercentValue8=Percent
FinderCustomWeight5=# or Element or Abbrev.
FinderMin9=0
FinderMax9=20
FinderMax9=10
FinderCheckElements9=0
FinderPercentValue9=Percent
FinderCustomWeight6=# or Element or Abbrev.
Expand All @@ -205,8 +206,8 @@ FragModelModificationSymbol7=$,227.127,False,Cleavable ICAT [(^12C10)H17N3O3]
FragModelModificationSymbol8=%,236.127,False,Cleavable ICAT [(^13C9)(^12C)H17N3O3]
FragModelModificationSymbol9=~,442.225,False,ICAT D0 [C20H34N4O5S]
FragModelModificationSymbol10=`,450.274,False,ICAT D8 [C20H26D8N4O5S]
FragModelNotationMode=0
FragModelSequence=.FGAPPAGEISVDEGATAAILERGSSLLPK.G
FragModelNotationMode=1
FragModelSequence=Arg-His-Pro-Glu-Tyr-Ala-Val
FragModelNTerminus=0
FragModelCTerminus=0
FragModelIonType0=0
Expand All @@ -220,14 +221,14 @@ FragModelIonsToModify2=1
FragModelWaterLoss=1
FragModelAmmoniaLoss=0
FragModelPhosphateLoss=0
FragModelDoubleCharge=1
FragModelDoubleCharge=0
FragModelDoubleChargeThreshold=8
FragModelTripleCharge=0
FragModelTripleChargeThreshold=9
FragModelPrecursorIonRemove=1
FragModelPrecursorIonMass=2808.52
FragModelPrecursorIonMass=300
FragModelPrecursorIonMassWindow=2
FragModelIonMatchWindow=0.1
FragModelIonMatchWindow=0.5
FragModelIonIntensity0=10
FragModelIonIntensity1=50
FragModelIonIntensity2=50
Expand Down Expand Up @@ -1443,23 +1444,23 @@ FragModelIonAlignment=0
SeriesPlotMode=1
SeriesLineStyle=0
SeriesLineWidth=1
SeriesLineColor=16711680
SeriesLineToBaseColor=16711680
SeriesBarFillColor=16711680
SeriesLineColor=255
SeriesLineToBaseColor=255
SeriesBarFillColor=255
SeriesPointStyle=0
SeriesPointColor=16711680
SeriesPointColor=255
AnnotationFontName=Arial
AnnotationFontSize=10
AnnotationFontColor=0
[PlotOptions_Series2]
SeriesPlotMode=1
SeriesLineStyle=0
SeriesLineWidth=1
SeriesLineColor=32768
SeriesLineToBaseColor=32768
SeriesBarFillColor=32768
SeriesLineColor=40960
SeriesLineToBaseColor=40960
SeriesBarFillColor=40960
SeriesPointStyle=0
SeriesPointColor=32768
SeriesPointColor=40960
AnnotationFontName=Arial
AnnotationFontSize=10
AnnotationFontColor=0
Expand Down Expand Up @@ -1494,7 +1495,7 @@ PrecisionY=1
CursorVisible=True
CursorSnapToData=False
CursorColor=0
CursorPositionX=100
CursorPositionX=0
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: 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,
ElementAndMassRoutines = 154, 168, 891, 660, Z
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.
10 changes: 5 additions & 5 deletions MwtWinDll/MwtWinDllTest.vbp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Type=Exe
Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#C:\WINDOWS\system32\stdole2.tlb#OLE Automation
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
Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#C:\Windows\SysWOW64\stdole2.tlb#OLE Automation
Reference=*\G{22E3BE8D-4CAB-4EA3-87EC-2B1C8512C0FD}#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
Expand All @@ -17,7 +17,7 @@ HelpContextID="0"
CompatibleMode="0"
MajorVer=1
MinorVer=0
RevisionVer=2
RevisionVer=3
AutoIncrementVer=1
ServerSupportFiles=0
VersionCompanyName="PNNL"
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, Z, 10, -7, 777, 590, C
frmMwtWinDllTest = 75, 21, 514, 513, , 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=78
RevisionVer=79
AutoIncrementVer=1
ServerSupportFiles=0
VersionComments="Written by Matthew Monroe"
Expand Down
3 changes: 3 additions & 0 deletions MwtWinDll/RevisionHistory.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
MwtWin.Dll Change Log

Version 2.37, Build 78; May 15, 2012
- Added parameter blnAddProtonChargeCarrier to ComputeIsotopicAbundances

Version 2.37, Build 77; August 5, 2011
- Recompiled due to new computer OS

Expand Down
9 changes: 7 additions & 2 deletions MwtWinDll/WorkingRoutines.bas
Original file line number Diff line number Diff line change
Expand Up @@ -330,9 +330,10 @@ Public Function TestComputeIsotopicAbundances(ByRef strFormulaIn As String, ByVa

End Function

Public Function ComputeIsotopicAbundancesInternal(ByRef strFormulaIn As String, ByVal intChargeState As Integer, ByRef strResults As String, ByRef ConvolutedMSData2DOneBased() As Double, ByRef ConvolutedMSDataCount As Long, Optional ByVal strHeaderIsotopicAbundances As String = "Isotopic Abundances for", Optional ByVal strHeaderMassToCharge As String = "Mass/Charge", Optional ByVal strHeaderFraction As String = "Fraction", Optional ByVal strHeaderIntensity As String = "Intensity", Optional blnUseFactorials As Boolean = False) As Integer
Public Function ComputeIsotopicAbundancesInternal(ByRef strFormulaIn As String, ByVal intChargeState As Integer, ByRef strResults As String, ByRef ConvolutedMSData2DOneBased() As Double, ByRef ConvolutedMSDataCount As Long, Optional ByVal strHeaderIsotopicAbundances As String = "Isotopic Abundances for", Optional ByVal strHeaderMassToCharge As String = "Mass/Charge", Optional ByVal strHeaderFraction As String = "Fraction", Optional ByVal strHeaderIntensity As String = "Intensity", Optional blnUseFactorials As Boolean = False, Optional blnAddProtonChargeCarrier As Boolean = True) As Integer
' Computes the Isotopic Distribution for a formula, returns uncharged mass vlaues if intChargeState=0,
' M+H values if intChargeState=1, and convoluted m/z if intChargeState is > 1
' If blnAddProtonChargeCarrier is False, then still convlutes by charge, but doesn't add a proton
' Updates strFormulaIn to the properly formatted formula
' Returns the results in strResults
' Returns 0 if success, or -1 if an error
Expand Down Expand Up @@ -907,7 +908,11 @@ On Error GoTo IsoAbundanceErrorHandler
ConvolutedMSData2DOneBased(lngMassIndex, 1) = .Abundance / dblMaxAbundance * 100

If intChargeState >= 1 Then
ConvolutedMSData2DOneBased(lngMassIndex, 0) = ConvoluteMassInternal(ConvolutedMSData2DOneBased(lngMassIndex, 0), 0, intChargeState)
If blnAddProtonChargeCarrier Then
ConvolutedMSData2DOneBased(lngMassIndex, 0) = ConvoluteMassInternal(ConvolutedMSData2DOneBased(lngMassIndex, 0), 0, intChargeState)
Else
ConvolutedMSData2DOneBased(lngMassIndex, 0) = ConvolutedMSData2DOneBased(lngMassIndex, 0) / intChargeState
End If
End If
End With
Next lngMassIndex
Expand Down
7 changes: 5 additions & 2 deletions MwtWinDll/clsMwtWin.cls
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,14 @@ Public Function ComputeMass(ByVal strFormula As String) As Double

End Function

Public Function ComputeIsotopicAbundances(ByRef strFormulaIn As String, ByVal intChargeState As Integer, ByRef strResults As String, ByRef ConvolutedMSData2DOneBased() As Double, ByRef ConvolutedMSDataCount As Long, Optional ByVal strHeaderIsotopicAbundances As String = "Isotopic Abundances for", Optional ByVal strHeaderMass As String = "Mass", Optional ByVal strHeaderFraction As String = "Fraction", Optional ByVal strHeaderIntensity As String = "Intensity") As Integer
Public Function ComputeIsotopicAbundances(ByRef strFormulaIn As String, ByVal intChargeState As Integer, ByRef strResults As String, ByRef ConvolutedMSData2DOneBased() As Double, ByRef ConvolutedMSDataCount As Long, Optional ByVal strHeaderIsotopicAbundances As String = "Isotopic Abundances for", Optional ByVal strHeaderMass As String = "Mass", Optional ByVal strHeaderFraction As String = "Fraction", Optional ByVal strHeaderIntensity As String = "Intensity", Optional blnAddProtonChargeCarrier As Boolean = True) As Integer
' Computes the Isotopic Distribution for a formula
' Returns 0 if success, or -1 if an error

ComputeIsotopicAbundances = ComputeIsotopicAbundancesInternal(strFormulaIn, intChargeState, strResults, ConvolutedMSData2DOneBased(), ConvolutedMSDataCount, strHeaderIsotopicAbundances, strHeaderMass, strHeaderFraction, strHeaderIntensity, False)
Dim blnUseFactorials As Boolean
blnUseFactorials = False

ComputeIsotopicAbundances = ComputeIsotopicAbundancesInternal(strFormulaIn, intChargeState, strResults, ConvolutedMSData2DOneBased(), ConvolutedMSDataCount, strHeaderIsotopicAbundances, strHeaderMass, strHeaderFraction, strHeaderIntensity, blnUseFactorials, blnAddProtonChargeCarrier)
End Function

Public Function ConvoluteMass(ByVal dblMassMZ As Double, ByVal intCurrentCharge As Integer, Optional ByVal intDesiredCharge As Integer = 1, Optional ByVal dblChargeCarrierMass As Double = 0) As Double
Expand Down
Loading

0 comments on commit 840590a

Please sign in to comment.