Skip to content

Commit

Permalink
Version 2.37, Build 74
Browse files Browse the repository at this point in the history
 - Added support for c and z ions in function GetFragmentationMasses()
  • Loading branch information
alchemistmatt committed Oct 16, 2009
1 parent 6ce6cef commit beb98a8
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 21 deletions.
2 changes: 1 addition & 1 deletion MwtWinDll/MwtWinDll.vbw
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
MolecularWeightCalculator = 22, 24, 746, 516,
MolecularWeightCalculator = 22, 24, 746, 516, Z
MWCompoundClass = 132, 144, 856, 636, C
MWPeptideClass = 132, 144, 856, 636,
ElementAndMassRoutines = 154, 168, 891, 660,
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"C:\Program Files\Microsoft Visual Studio\Common\IDE\IDE98\DEVENV.EXE" "D:\My Documents\Projects\DataMining\MwtWin\MwtWinDll\MwtWinDll_MergeModule\MwtWinDll_MergeModule.sln"
"C:\Program Files (x86)\Microsoft Visual Studio\Common\IDE\IDE98\DEVENV.EXE" "F:\My Documents\Projects\DataMining\MwtWin\MwtWinDll\MwtWinDll_MergeModule\MwtWinDll_MergeModule.sln"
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.
6 changes: 3 additions & 3 deletions MwtWinDll/MwtWindll.vbp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Type=OleDll
Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#C:\WINDOWS\system32\stdole2.tlb#OLE Automation
Reference=*\G{F935DC20-1CF0-11D0-ADB9-00C04FD58A0B}#1.0#0#C:\WINDOWS\system32\wshom.ocx#Windows Script Host Object Model
Reference=*\G{F935DC20-1CF0-11D0-ADB9-00C04FD58A0B}#1.0#0#C:\WINDOWS\SysWOW64\wshom.ocx#Windows Script Host Object Model
Class=MolecularWeightCalculator; clsMwtWin.cls
Class=MWCompoundClass; clsCompound.cls
Class=MWPeptideClass; clsPeptideClass.cls
Expand All @@ -20,8 +20,8 @@ Description="Molecular Weight Calculator - Dll Version"
CompatibleMode="0"
CompatibleEXE32="MwtWindll.dll"
MajorVer=2
MinorVer=36
RevisionVer=72
MinorVer=37
RevisionVer=75
AutoIncrementVer=1
ServerSupportFiles=0
VersionComments="Written by Matthew Monroe"
Expand Down
4 changes: 3 additions & 1 deletion MwtWinDll/RevisionHistory.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
MwtWin.Dll Change Log

Future: Changed blnShowCharge() from type Integer to type Boolean in the GetFragmentationMasses() function
Version 2.37, Build 74
- Added support for c and z ions in function GetFragmentationMasses()
- Changed blnShowCharge() from type Integer to type Boolean in the GetFragmentationMasses() function

Version 2.36, Build 70; February 23, 2007
- Added option to include 3+ fragmentation ions in the GetFragmentationMasses() function
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 = "February 23, 2007"
Private Const PROGRAM_DATE = "October 16, 2009"
Private Const PROGRAM_VERSION = "2.37"

' Duplicate of enum statements in ElementAndMassRoutines.bas
Expand Down
40 changes: 26 additions & 14 deletions MwtWinDll/clsPeptideClass.cls
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,13 @@ Public Enum ntgNTerminusGroupConstants
ntgNone = 6
End Enum

Private Const ION_TYPE_MAX As Integer = 2
Private Const ION_TYPE_MAX As Integer = 4
Public Enum itIonTypeConstants
itAIon = 0
itBIon = 1
itYIon = 2
itCIon = 3
itZIon = 4
End Enum

Private Type udtModificationSymbolType
Expand Down Expand Up @@ -274,7 +276,8 @@ Private Function ComputeMaxIonsPerResidue() As Integer
intIonCount = intIonCount + 1

If Abs(.IntensityOptions.BYIonShoulder) > 0 Then
If eIonIndex = itIonTypeConstants.itBIon Or eIonIndex = itIonTypeConstants.itYIon Then
If eIonIndex = itIonTypeConstants.itBIon Or eIonIndex = itIonTypeConstants.itYIon Or _
eIonIndex = itIonTypeConstants.itCIon Or eIonIndex = itIonTypeConstants.itZIon Then
intIonCount = intIonCount + 2
End If
End If
Expand Down Expand Up @@ -406,7 +409,7 @@ Public Function GetFragmentationMasses(ByRef udtFragSpectrum() As udtFragmentati

For eIonType = 0 To ION_TYPE_MAX
If mFragSpectrumOptions.IonTypeOptions(eIonType).ShowIon Then
If (lngResidueIndex = 1 Or lngResidueIndex = ResidueCount) And (eIonType = itIonTypeConstants.itAIon Or eIonType = itIonTypeConstants.itBIon) Then
If (lngResidueIndex = 1 Or lngResidueIndex = ResidueCount) And (eIonType = itIonTypeConstants.itAIon Or eIonType = itIonTypeConstants.itBIon Or eIonType = itIonTypeConstants.itCIon) Then
' Don't include a or b ions in the output masses
Else

Expand All @@ -432,10 +435,10 @@ Public Function GetFragmentationMasses(ByRef udtFragSpectrum() As udtFragmentati
Else
' Add ion to Predicted Spectrum

' Y Ions are numbered in decreasing order: y5, y4, y3, y2, y1
' A and B ions are numbered in increasing order: a1, a2, etc. or b1, b2, etc.
' Y and Z Ions are numbered in decreasing order: y5, y4, y3, y2, y1
' A and B, C ions are numbered in increasing order: a1, a2, etc. or b1, b2, etc.
strIonSymbolGeneric = LookupIonTypeString(eIonType)
If eIonType = itIonTypeConstants.itYIon Then
If eIonType = itIonTypeConstants.itYIon Or eIonType = itIonTypeConstants.itZIon Then
strIonSymbol = strIonSymbolGeneric & Trim(Str(ResidueCount - lngResidueIndex + 1))
Else
strIonSymbol = strIonSymbolGeneric & Trim(Str(lngResidueIndex))
Expand All @@ -448,10 +451,9 @@ Public Function GetFragmentationMasses(ByRef udtFragSpectrum() As udtFragmentati

AppendDataToFragSpectrum lngIonCount, FragSpectrumWork(), sngConvolutedMass, sngIntensity, strIonSymbol, strIonSymbolGeneric, lngResidueIndex, .Symbol, intChargeIndex, eIonType, False

' Add shoulder ions to PredictedSpectrum()
' if a B or Y ion and the shoulder intensity is > 0
' Add shoulder ions to PredictedSpectrum() if a B or Y ion and the shoulder intensity is > 0
' Need to use Abs() here since user can define negative theoretical intensities (which allows for plotting a spectrum inverted)
If Abs(sngIonShoulderIntensity) > 0 And (eIonType = itIonTypeConstants.itBIon Or eIonType = itIonTypeConstants.itYIon) Then
If Abs(sngIonShoulderIntensity) > 0 And (eIonType = itIonTypeConstants.itBIon Or eIonType = itIonTypeConstants.itYIon Or eIonType = itIonTypeConstants.itCIon Or eIonType = itIonTypeConstants.itZIon) Then
For intShoulderIndex = -1 To 1 Step 2
sngObservedMass = sngConvolutedMass + intShoulderIndex * (1 / intChargeIndex)
AppendDataToFragSpectrum lngIonCount, FragSpectrumWork(), sngObservedMass, sngIonShoulderIntensity, SHOULDER_ION_PREFIX & strIonSymbol, SHOULDER_ION_PREFIX & strIonSymbolGeneric, lngResidueIndex, .Symbol, intChargeIndex, eIonType, True
Expand Down Expand Up @@ -549,8 +551,8 @@ End Function

Private Function GetInternalResidues(lngCurrentResidueIndex As Long, eIonType As itIonTypeConstants, Optional ByRef blnPhosphorylated As Boolean) As String
' Determines the residues preceding or following the given residue (up to and including the current residue)
' If eIonType is a or b ions, then returns residues from the N terminus
' If eIonType is y ion, then returns residues from the C terminus
' If eIonType is a, b, or c ions, then returns residues from the N terminus
' If eIonType is y or z ions, then returns residues from the C terminus
' Also, set blnPhosphorylated to true if any of the residues is Ser, Thr, or Tyr and is phosphorylated
'
' Note that the residue symbols are separated by a space to avoid accidental matching by the InStr() function
Expand All @@ -560,7 +562,7 @@ Private Function GetInternalResidues(lngCurrentResidueIndex As Long, eIonType As

strInternalResidues = ""
blnPhosphorylated = False
If eIonType = itIonTypeConstants.itYIon Then
If eIonType = itIonTypeConstants.itYIon Or eIonType = itIonTypeConstants.itZIon Then
For lngResidueIndex = lngCurrentResidueIndex To ResidueCount
With Residues(lngResidueIndex)
strInternalResidues = strInternalResidues & .Symbol & " "
Expand Down Expand Up @@ -1320,6 +1322,8 @@ Public Function LookupIonTypeString(eIonType As itIonTypeConstants) As String
Case itIonTypeConstants.itAIon: LookupIonTypeString = "a"
Case itIonTypeConstants.itBIon: LookupIonTypeString = "b"
Case itIonTypeConstants.itYIon: LookupIonTypeString = "y"
Case itIonTypeConstants.itCIon: LookupIonTypeString = "c"
Case itIonTypeConstants.itZIon: LookupIonTypeString = "z"
Case Else: LookupIonTypeString = ""
End Select

Expand Down Expand Up @@ -1575,6 +1579,8 @@ On Error GoTo SetDefaultOptionsErrorHandler
.IonType(itIonTypeConstants.itAIon) = 20
.IonType(itIonTypeConstants.itBIon) = 100
.IonType(itIonTypeConstants.itYIon) = 100
.IonType(itIonTypeConstants.itCIon) = 100
.IonType(itIonTypeConstants.itZIon) = 100
.BYIonShoulder = 50
.NeutralLoss = 20
End With
Expand All @@ -1587,7 +1593,7 @@ On Error GoTo SetDefaultOptionsErrorHandler
.NeutralLossWater = False
End With

For intIonIndex = itIonTypeConstants.itBIon To itIonTypeConstants.itYIon
For intIonIndex = itIonTypeConstants.itBIon To itIonTypeConstants.itZIon
With .IonTypeOptions(intIonIndex)
.ShowIon = True
.NeutralLossAmmonia = True
Expand Down Expand Up @@ -2074,6 +2080,9 @@ Private Sub UpdateResidueMasses()

.IonMass(itIonTypeConstants.itAIon) = dblRunningTotal - dblImmoniumMassDifference - dblChargeCarrierMass
.IonMass(itIonTypeConstants.itBIon) = dblRunningTotal

' Add NH3 (ammonia) to the B ion mass to get the C ion mass
.IonMass(itIonTypeConstants.itCIon) = .IonMass(itIonTypeConstants.itBIon) + dblNH3Mass
Else
.Mass = 0
.MassWithMods = 0
Expand All @@ -2093,7 +2102,7 @@ Private Sub UpdateResidueMasses()
mTotalMass = 0
End If

' Now compute the y-ion masses
' Now compute the y-ion and z-ion masses
dblRunningTotal = mCTerminus.Mass + dblChargeCarrierMass

For lngIndex = ResidueCount To 1 Step -1
Expand All @@ -2112,6 +2121,9 @@ Private Sub UpdateResidueMasses()
.IonMass(itIonTypeConstants.itYIon) = .IonMass(itIonTypeConstants.itYIon) - dblHydrogenMass
End If
End If

' Subtract NH2 (amide) from the Y ion mass to get the Z ion mass
.IonMass(itIonTypeConstants.itZIon) = .IonMass(itIonTypeConstants.itYIon) - (dblNH3Mass - dblHydrogenMass)
End If
End With
Next lngIndex
Expand Down

0 comments on commit beb98a8

Please sign in to comment.