-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathMWTWIN.BAS
3136 lines (2665 loc) · 152 KB
/
MWTWIN.BAS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
Attribute VB_Name = "MwtWinProcedures"
Option Explicit
' A chemistry molecular weight calculator
' Windows 95/98/NT Version
'
' By Matthew Monroe
' Richland, WA
'
' Dos Version completed on August 9, 1995
' Windows Version 3.0 Completed on June 10, 1996
' Windows 95 version 4.0 Completed August 25, 1997
' Windows 95 version 4.6 final, Completed January 23, 1999
' Windows 95/98/NT version 5.11, Last modified January 26, 2000 (VB v6.0, sp3)
' Windows 9x/NT/2000 version 5.2, Last modified July 9, 2000 (VB v6.0, sp5)
' Windows 9x/ME/NT/2000/XP version 6.23, Last modified November 11, 2002 (VB v6.0, sp5)
' Primary computation algorithms moved to an ActiveX Dll in December 2002, allowing the computational routines to be accessed by other developers' programs
'
' E-mail: [email protected] or [email protected]
' WWW: http://www.alchemistmatt.com/ and
' http://ncrr.pnl.gov/software/
' http://www.geocities.com/alchemistmatt/
' http://come.to/alchemistmatt/
'
' As of version 4.61 (2/1/99) there are 10,300 lines of code
' As of version 4.62 (2/8/99) there are 9,505 lines of code (combined redundant functions)
' As of version 5.11 (1/25/00) there are 13,092 lines of code (added numerous items, including Capillary Calculations form, plus made more readable)
' As of version 6.14 (5/9/02) there are 25,300 lines of code; 9,200 in .Bas files and 16,100 in .Frm files (numerous new features added since last count)
' version 6.35
' *** Be sure to update version in Project | Properties also ***
Public Const PROGRAM_VERSION = "6.50"
Public Const PROGRAM_DATE = "November 21, 2014"
' ***
'
'
' Test String: HHeLiBeBCNoFNeNaMgAlSiPSClArKCaScTiVCrMnFeCoNiCu[xZnGaGe]AsSeBrKrRbSrYZrNbMoTcRuRhPdAgCdInSnSbTeIXeCsBaLaHfTaWReOsIrPtAuHgTiPbBiPoAtRnFrRaAcCePrNdPmSmEuGdTbDyHoErTmYbLuThPaUNpPuAmCmBkCfEsFmMdNoLr
' Should give answer MW = 13140.9(±2) in Average Mode
' and MW = 13167.4185807(±0) in Isotopic mode
' and MW = 13172(±0) in Integer Mode
' ToDo for next version:
' Language Captions for all the new labels and buttons and forms and tooltips
' Tooltips for new items
' Update help file for isotopic distribution simulator and Iso option in formula finder (Ctrl+D)
' Compute multiplicity in isotopic distribution
' Update the Overview.htm help file
' June 2003:
' Allow up to 3 custom neutral losses in Peptide fragmentation modeller
' Allow multiple neutral losses (see protein prospector for example)
'
' File Name Constants
'
Public Const INI_FILENAME = "MWTWIN.INI"
Public Const HELP_FILENAME = "MWTWIN.CHM"
Public Const ELEMENTS_FILENAME = "MWT_ELEM.DAT"
Public Const ABBREVIATIONS_FILENAME = "MWT_ABBR.DAT"
Public Const VALUES_FILENAME = "MWT_VALU.INI"
Public Const DEFAULT_LANGUAGE_FILENAME = "Lang_English.ini"
Public Const MAX_LANGUAGE_FILE_COUNT = 200 ' Maximum number of language files to find in a given directory
Public Const FORMULA_CHANGED = "Changed"
' Formula and element Constants
'
Public Const MAX_FORMULAS = 25 ' Maximum number of formulas that will ever be shown simultaneously
Public Const MAX_ELEMENT_INDEX = 103
'
' Public Constants
'
Public Const RTF_HEIGHT_ADJUSTCHAR = "~" ' A hidden character to adjust the height of Rtf Text Boxes when using superscripts
Public Const EMPTY_STRINGCHAR = "~"
Public Const COMMENT_CHAR = ";"
Public Const LowestValueForDoubleDataType = -1.79E+308 ' Use -3.4E+38 for Single
Public Const HighestValueForDoubleDataType = 1.79E+308 ' Use 3.4E+38 for Single
'
' Enumerated Constants
'
Public Enum vmdViewModeConstants
vmdMultiView = 0
vmdSingleView = 1
End Enum
Public Enum psmPercentSolverModeConstants
psmPercentSolverOff = 0
psmPercentSolverOn = 1
End Enum
' Constants for Text Boxes on Capillary Calcs form
' The text boxes are part of an array;
' the following constants are used to reference the appropriate text box in the array
Public Const CapTextBoxMaxIndex = 16
Public Enum cctCapCalcTextBoxIDConstants
cctPressure = 0
cctColumnLength = 1
cctColumnID = 2
cctViscosity = 3
cctParticleDiamter = 4
cctFlowRate = 5
cctDeadTime = 6
cctPorosity = 7
cctMassRateConcentration = 8
cctMassRateVolFlowRate = 9
cctMassRateInjectionTime = 10
cctBdLinearVelocity = 11
cctBdDiffusionCoefficient = 12
cctBdOpenTubeLength = 13
cctBdOpenTubeID = 14
cctBdInitialPeakWidth = 15
cctBdAdditionalVariance = 16
End Enum
' Constants for cboCapValue() array of Combo Boxes on Capillary Calcs form
Public Const CapComboBoxMaxIndex = 18
Public Enum cccCapCalComboBoxIDConstants
cccPressureUnits = 0
cccColumnLengthUnits = 1
cccColumnIDUnits = 2
cccViscosityUnits = 3
cccParticleDiameterUnits = 4
cccFlowRateUnits = 5
cccLinearVelocityUnits = 6
cccDeadTimeUnits = 7
cccVolumeUnits = 8
cccMassRateConcentrationUnits = 9
cccMassRateVolFlowRateUnits = 10
cccMassRateInjectionTimeUnits = 11
cccMassFlowRateUnits = 12
cccMassRateMolesInjectedUnits = 13
cccBdLinearVelocityUnits = 14
cccBdOpenTubeLengthUnits = 15
cccBdOpenTubeIDUnits = 16
cccBdInitialPeakWidthUnits = 17
cccBdResultantPeakWidthUnits = 18
End Enum
Public Enum mmcMassModeConstants
mmcComputedMass = 0
mmcCustomMass = 1
End Enum
Public Enum exmExitModeConstants
exmEscapeKeyConfirmExit = 0
exmEscapeKeyDoNotConfirmExit
exmIgnoreEscapeKeyConfirmExit
exmIgnoreEscapeKeyDoNotConfirmExit
End Enum
Public Enum gcmGridCopyModeConstants
gcmText = 0
gcmRTF = 1
gcmHTML = 2
End Enum
Public Enum smcFinderResultsSortModeConstants
smcSortByFormula = 0
smcSortByCharge = 1
smcSortByMWT = 2
smcSortByMZ = 3
smcSortByDeltaMass = 4
End Enum
' Choose Color API's
Private Declare Function ChooseColor Lib "comdlg32.dll" Alias "ChooseColorA" (pChoosecolor As ChooseColorType) As Long
Private Declare Function GetSysColor Lib "user32" (ByVal nIndex As Long) As Long
'structure used for Color Dialog
Private Type ChooseColorType
lStructSize As Long
hwndOwner As Long
hInstance As Long
rgbResult As Long
lpCustColors As Long
flags As Long
lCustData As Long
lpfnHook As Long
lpTemplateName As String
End Type
' Constants for Button Return Status between forms
Public Const BUTTON_NOT_CLICKED_YET = -1
Public Const BUTTON_OK = 0
Public Const BUTTON_CANCEL = 1
Public Const BUTTON_RESET = 2 ' Also used for Remove Abbreviation or Remove Mod Symbol
' Screen Colors
Public Const COLOR_ERR = 12 ' Light Red
Public Const COLOR_WARN = 13 ' Light Yellow
Public Const COLOR_SOLVER = 2 ' Green
Public Const COLOR_CALC = 2 ' Bright White
Public Const COLOR_DIREC = 9 ' Light Blue
Public Const COLOR_WHITE = 15 ' White
Public Const COLOR_COMPUTEDQUANTITY = 14 ' Bright yellow
' Constants for loading an HTML Help file
Public Const HH_DISPLAY_TOPIC = &H0
Public Const HH_HELP_CONTEXT = &HF ' Display mapped numeric value in dwData
''Public Const HH_SET_WIN_TYPE = &H4 ' Unused
''Public Const HH_GET_WIN_TYPE = &H5 ' Unused
''Public Const HH_GET_WIN_HANDLE = &H6 ' Unused
''Public Const HH_DISPLAY_TEXT_POPUP = &HE ' Unused - Display string resource ID or text in a pop-up window
''Public Const HH_TP_HELP_CONTEXTMENU = &H10 ' Unused - Text pop-up help, similar to WinHelp's HELP_CONTEXTMENU
''Public Const HH_TP_HELP_WM_HELP = &H11 ' Unused - text pop-up help, similar to WinHelp's HELP_WM_HELP
' Declare the HTML help function
Public Declare Function HtmlHelp Lib "hhctrl.ocx" Alias "HtmlHelpA" _
(ByVal hwndCaller As Long, ByVal pszFile As String, _
ByVal uCommand As Long, ByVal dwData As Long) As Long
'
' User Defined Types (UDT's)
'
Public Type udtCapillaryFlowValuesType
' Text Boxes
TextValues(CapTextBoxMaxIndex + 1) As Double
' Combo Boxes
ComboValues(CapComboBoxMaxIndex + 1) As Integer
End Type
'
' Public Non-Array Variables
'
Public gCurrentPath As String
Public gMaxFormulaIndex As Integer ' Maximum number of formulas to display for the given screen resolution; absolute max is MAX_FORMULAS
Public gBlnShowStdDevWithMass As Boolean
Public gBlnErrorPresent As Boolean
Public gBlnStatusCaution As Boolean
Public gBlnLoadStatusOK As Boolean
Public gBlnAccessFilesOnDrive As Boolean ' If False, then drive is never accessed
Public gBlnWriteFilesOnDrive As Boolean ' If false, then files are read, but not written
Public gKeyPressAbortFormulaFinder As Integer ' Used with frmProgress
Public gElementWeightTypeInFile As emElementModeConstants
Public gCurrentLanguage As String
Public gCurrentLanguageFileName As String
Public gMWAbbreviation As String
Public gNonSaveExitApp As Boolean
Public gCommandLineInstructionsDisplayed As Boolean
Public gLastFileOpenSaveFolder As String
'
' Public Array variables
'
' The following variables are used to remember unique settings for
' Open and Packed capillaries on frmCapillaryCalcs
Public OpenCapVals As udtCapillaryFlowValuesType
Public PackedCapVals As udtCapillaryFlowValuesType
Public gCapFlowComputationTypeSave As Integer
Public gCapFlowLinkMassRateFlowRateSave As Integer
Public gCapFlowLinkBdLinearVelocitySave As Integer
Public gCapFlowShowPeakBroadeningSave As Integer
' Reference to the MwtWinDll.Dll
Public objMwtWin As New MwtWinDll.MolecularWeightCalculator
Public objCompounds(MAX_FORMULAS) As New MWCompoundClass
' Purpose: Append a string to frmIntro.lblLoadStatus.Caption
' When blnErrorMessage is true, then sets gBlnLoadStatusOK to False and shows cmdOK
Public Sub AddToIntro(strAdd As String, Optional blnUseMsgBoxInstead As Boolean = False, Optional blnErrorMessage As Boolean = True)
If blnUseMsgBoxInstead Then
MsgBox strAdd, vbOKOnly + vbInformation, frmMain.Caption
Else
frmIntro.lblLoadStatus.Caption = frmIntro.lblLoadStatus.Caption & vbCrLf & strAdd
If blnErrorMessage Then
gBlnLoadStatusOK = False
frmIntro.cmdOK.Visible = True
End If
End If
End Sub
' Purpose: Append ellipses to a menu
Public Function AppendEllipsesToSingleMenu(strMenuCaption As String, boolDynamicMenu As Boolean, Optional boolAlwaysShowExclamationpoint As Boolean = False) As String
' Append ... to menu, making sure not to add ... if already present
' If boolDynamicMenu = True, then add either ... or ! depending on
' frmProgramPreferences.optExitConfirmation
Dim strEllipsesToAppend As String, intOldCaptionEllipsesStartIndex As Integer
Dim strOriginalCaption As String
If Not boolDynamicMenu Then
strEllipsesToAppend = "..."
Else
If (frmProgramPreferences.optExitConfirmation(exmEscapeKeyConfirmExit).value = True Or frmProgramPreferences.optExitConfirmation(exmIgnoreEscapeKeyConfirmExit).value = True) And _
Not boolAlwaysShowExclamationpoint Then
strEllipsesToAppend = "..."
Else
strEllipsesToAppend = "!"
End If
End If
' Strip to current caption
' First look for ellipses
intOldCaptionEllipsesStartIndex = InStr(strMenuCaption, "...")
If intOldCaptionEllipsesStartIndex <= 0 Then
' Ellipses not found, look for !
intOldCaptionEllipsesStartIndex = InStr(strMenuCaption, "!")
End If
' If either ... or ! was found, remove them
If intOldCaptionEllipsesStartIndex > 0 Then
strOriginalCaption = Left(strMenuCaption, intOldCaptionEllipsesStartIndex - 1)
Else
strOriginalCaption = strMenuCaption
End If
AppendEllipsesToSingleMenu = strOriginalCaption & strEllipsesToAppend
End Function
Public Sub AppendShortcutKeysToMenuCaptions()
With frmMain
' First add ... or ! to corresponding menus
.mnuEditElements.Caption = AppendEllipsesToSingleMenu(.mnuEditElements.Caption, False)
.mnuEditAbbrev.Caption = AppendEllipsesToSingleMenu(.mnuEditAbbrev.Caption, False)
.mnuCalculateFile.Caption = AppendEllipsesToSingleMenu(.mnuCalculateFile.Caption, False)
.mnuPrint.Caption = AppendEllipsesToSingleMenu(.mnuPrint.Caption, False)
.mnuExit.Caption = AppendEllipsesToSingleMenu(.mnuExit.Caption, True)
.mnuEraseAll.Caption = AppendEllipsesToSingleMenu(.mnuEraseAll.Caption, False)
.mnuEraseCurrent.Caption = AppendEllipsesToSingleMenu(.mnuEraseCurrent.Caption, False)
.mnuExpandAbbrev.Caption = AppendEllipsesToSingleMenu(.mnuExpandAbbrev.Caption, True)
.mnuEmpirical.Caption = AppendEllipsesToSingleMenu(.mnuEmpirical.Caption, True)
.mnuMMConvert.Caption = AppendEllipsesToSingleMenu(.mnuMMConvert.Caption, False)
.mnuFinder.Caption = AppendEllipsesToSingleMenu(.mnuFinder.Caption, False)
.mnuAminoAcidNotationConverter.Caption = AppendEllipsesToSingleMenu(.mnuAminoAcidNotationConverter.Caption, False)
.mnuPeptideSequenceFragmentation.Caption = AppendEllipsesToSingleMenu(.mnuPeptideSequenceFragmentation.Caption, False)
.mnuIsotopicDistribution.Caption = AppendEllipsesToSingleMenu(.mnuIsotopicDistribution.Caption, False)
.mnuCalculator.Caption = AppendEllipsesToSingleMenu(.mnuCalculator.Caption, False)
.mnuCapillaryFlow.Caption = AppendEllipsesToSingleMenu(.mnuCapillaryFlow.Caption, False)
.mnuChooseLanguage.Caption = AppendEllipsesToSingleMenu(.mnuChooseLanguage.Caption, False)
.mnuProgramOptions.Caption = AppendEllipsesToSingleMenu(.mnuProgramOptions.Caption, False)
.mnuChangeFont.Caption = AppendEllipsesToSingleMenu(.mnuChangeFont.Caption, False)
.mnuRestoreValues.Caption = AppendEllipsesToSingleMenu(.mnuRestoreValues.Caption, False)
.mnuAbout.Caption = AppendEllipsesToSingleMenu(.mnuAbout.Caption, False)
' Special handling for mnuSaveValues
' Always append title with an exclamation point
.mnuSaveValues.Caption = AppendEllipsesToSingleMenu(.mnuSaveValues.Caption, True, True)
' Now add shortcut key tips to menus
.mnuExit.Caption = AppendShortcutKeyToDynamicMenu(.mnuExit.Caption)
.mnuCut.Caption = AppendShortcutKeyToSingleMenu(.mnuCut.Caption, "Ctrl+X")
.mnuCopy.Caption = AppendShortcutKeyToSingleMenu(.mnuCopy.Caption, "Ctrl+C")
.mnuPaste.Caption = AppendShortcutKeyToSingleMenu(.mnuPaste.Caption, "Ctrl+V")
.mnuDelete.Caption = AppendShortcutKeyToSingleMenu(.mnuDelete.Caption, "Del")
.mnuRightClickUndo.Caption = AppendShortcutKeyToSingleMenu(.mnuRightClickUndo.Caption, "Ctrl+Z")
.mnuRightClickCut.Caption = AppendShortcutKeyToSingleMenu(.mnuRightClickCut.Caption, "Ctrl+X")
.mnuRightClickCopy.Caption = AppendShortcutKeyToSingleMenu(.mnuRightClickCopy.Caption, "Ctrl+C")
.mnuRightClickPaste.Caption = AppendShortcutKeyToSingleMenu(.mnuRightClickPaste.Caption, "Ctrl+V")
.mnuRightClickDelete.Caption = AppendShortcutKeyToSingleMenu(.mnuRightClickDelete.Caption, "Del")
.mnuRightClickSelectAll.Caption = AppendShortcutKeyToSingleMenu(.mnuRightClickSelectAll.Caption, "Ctrl+A")
.mnuEmpirical.Caption = AppendShortcutKeyToSingleMenu(.mnuEmpirical.Caption, "Ctrl+E")
.mnuViewType(vmdMultiView).Caption = AppendShortcutKeyToSingleMenu(.mnuViewType(vmdMultiView).Caption, "F8")
.mnuViewType(vmdSingleView).Caption = AppendShortcutKeyToSingleMenu(.mnuViewType(vmdSingleView).Caption, "F8")
.mnuPercentSolver.Caption = AppendShortcutKeyToSingleMenu(.mnuPercentSolver.Caption, "F11")
End With
With frmCapillaryCalcs
.mnuLoadCapValues.Caption = AppendEllipsesToSingleMenu(.mnuLoadCapValues.Caption, False)
.mnuSaveCapValues.Caption = AppendEllipsesToSingleMenu(.mnuSaveCapValues.Caption, False)
End With
With frmFragmentationModelling
.mnuLoadSequenceInfo.Caption = AppendEllipsesToSingleMenu(.mnuLoadSequenceInfo.Caption, False)
.mnuSaveSequenceInfo.Caption = AppendEllipsesToSingleMenu(.mnuSaveSequenceInfo.Caption, False)
.mnuLoadIonList.Caption = AppendEllipsesToSingleMenu(.mnuLoadIonList.Caption, False)
.mnuIonMatchListOptions.Caption = AppendEllipsesToSingleMenu(.mnuIonMatchListOptions.Caption, False)
.mnuShowMassSpectrum.Caption = AppendEllipsesToSingleMenu(.mnuShowMassSpectrum.Caption, False)
.mnuAutoAlign.Caption = AppendEllipsesToSingleMenu(.mnuAutoAlign.Caption, False)
End With
''' With frmMsPlot
''' .mnuExportData.Caption = AppendEllipsesToSingleMenu(.mnuExportData.Caption, False)
''' .mnuSetResolution.Caption = AppendEllipsesToSingleMenu(.mnuSetResolution.Caption, False)
''' .mnuTicksXAxis.Caption = AppendEllipsesToSingleMenu(.mnuTicksXAxis.Caption, False)
''' .mnuTicksYAxis.Caption = AppendEllipsesToSingleMenu(.mnuTicksYAxis.Caption, False)
''' .mnuGaussianQuality.Caption = AppendEllipsesToSingleMenu(.mnuGaussianQuality.Caption, False)
''' .mnuApproximationFactor.Caption = AppendEllipsesToSingleMenu(.mnuApproximationFactor.Caption, False)
''' .mnuSetRangeX.Caption = AppendEllipsesToSingleMenu(.mnuSetRangeX.Caption, False)
''' .mnuSetRangeY.Caption = AppendEllipsesToSingleMenu(.mnuSetRangeY.Caption, False)
''' .mnuResetToDefaults.Caption = AppendEllipsesToSingleMenu(.mnuResetToDefaults.Caption, False)
'''
''' ' Special shortcut keys with language-specific captions
''' .mnuZoomOutToPrevious.Caption = .mnuZoomOutToPrevious.Caption & vbTab & LookupLanguageCaption(13295, "Ctrl+Z or Right Click")
''' .mnuCursorMode.Caption = .mnuCursorMode.Caption & vbTab & LookupLanguageCaption(13315, "Space Enables Move")
''' .mnuZoomIn.Caption = .mnuZoomIn.Caption & vbTab & LookupLanguageCaption(13365, "Left Click")
''' End With
End Sub
Private Function AppendShortcutKeyToDynamicMenu(strMenuCaption As String, Optional intExitMode As Integer = -1) As String
' This sub either appends a new shortcut key to the Exit menu
' Must use different logic than in sub AppendShortcutKeyToSingleMenu
' since sometimes the exit menu is Exit! and other times Exit... (! means immediate exit)
Dim strNewShortcut As String, eWorkingExitMode As exmExitModeConstants, intIndex As Integer
Dim intOldCaptionShortcutStartIndex As Integer, strOriginalCaption As String
If intExitMode >= exmEscapeKeyConfirmExit And intExitMode <= exmIgnoreEscapeKeyDoNotConfirmExit Then
' Sub called due to changing exit mode
eWorkingExitMode = intExitMode
Else
' Sub called due to changing caption or appending shortcut to caption
eWorkingExitMode = exmEscapeKeyConfirmExit
For intIndex = exmEscapeKeyConfirmExit To exmIgnoreEscapeKeyDoNotConfirmExit
If frmProgramPreferences.optExitConfirmation(intIndex).value = True Then
eWorkingExitMode = intIndex
Exit For
End If
Next intIndex
End If
' Construct new shortcut
Select Case eWorkingExitMode
Case exmEscapeKeyConfirmExit
strNewShortcut = "..." & vbTab & "Esc or Alt+F4"
Case exmEscapeKeyDoNotConfirmExit
strNewShortcut = "!" & vbTab & "Esc or Alt+F4"
Case exmIgnoreEscapeKeyConfirmExit
strNewShortcut = "..." & vbTab & "Alt+F4"
Case Else
' Includes exmIgnoreEscapeKeyDoNotConfirmExit
strNewShortcut = "!" & vbTab & "Alt+F4"
End Select
' Find current caption
intOldCaptionShortcutStartIndex = InStr(strMenuCaption, "...")
If intOldCaptionShortcutStartIndex <= 0 Then
intOldCaptionShortcutStartIndex = InStr(strMenuCaption, "!")
End If
If intOldCaptionShortcutStartIndex > 0 Then
strOriginalCaption = Left(strMenuCaption, intOldCaptionShortcutStartIndex - 1)
Else
strOriginalCaption = strMenuCaption
End If
' Combine the current caption with the correct shortcut
AppendShortcutKeyToDynamicMenu = strOriginalCaption & strNewShortcut
End Function
Public Function AppendShortcutKeyToSingleMenu(strMenuCaption As String, strShortcutKey As String) As String
' This sub appends shortcut key to a menu
Dim intTabIndex As Integer, strOriginalCaption As String
intTabIndex = InStr(strMenuCaption, vbTab)
If intTabIndex > 0 Then
strOriginalCaption = Left(strMenuCaption, intTabIndex - 1)
Else
strOriginalCaption = strMenuCaption
End If
AppendShortcutKeyToSingleMenu = strOriginalCaption & vbTab & strShortcutKey
End Function
Public Sub BatchProcessTextFile(Optional strInputFilename As String = "", Optional strOutputFilename As String = "", Optional boolOverwriteWithoutAsking As Boolean = False)
' Use Open dialog to choose file
Dim strFileName As String
Dim strWork As String, strPeptide3Letter As String
Dim strOutLine As String
Dim strMessage As String
Dim lngBytesRead As Long, lngFormulasProcessed As Long
Dim eResponse As VbMsgBoxResult
Dim intIndex As Integer
Dim strCommand As String, strSettings As String, strSettingsUCase As String
Dim strStatus As String
Dim strCustomElementFormula As String
Dim strDelimeter As String
Dim blnShowCapitalizedFormula As Boolean
Dim blnConvertToEmpiricalFormula As Boolean
Dim blnExpandAbbreviations As Boolean
Dim blnStdDevModeEnabled As Boolean
Dim eStdDevModeSaved As smStdDevModeConstants
Dim eElementModeSaved As emElementModeConstants
Dim blnShowWeight As Boolean
Dim blnOneLetterPeptideWeightMode As Boolean
Dim strPeptideWeightModePrefixFormula As String ' Atoms that make up the prefix group for Peptide weight mode; default is H
Dim strPeptideWeightModeSuffixFormula As String ' Atoms that make up the suffix group for Peptide weight mode; default is OH
Dim blnAAConvert1to3 As Boolean, blnAAConvert3to1 As Boolean
Dim blnSpaceEvery10 As Boolean, blnSeparateWithDash As Boolean
Dim blnShowInputSequence As Boolean
Dim blnShowSourceFormula As Boolean
Dim blnEchoComments As Boolean
Dim blnVerboseMode As Boolean
Dim blnFFMode As Boolean
Dim intValsFound As Integer
Dim intElementsChecked As Integer, intCustomElementIndex As Integer
Dim intMatchLoc As Integer
Dim lngNewMaxHits As Long
Dim blnIsotopicDistributionMode As Boolean
Dim intIsotopicDistributionChargeState As Integer
Dim strResults As String
Dim dblDummyArray() As Double
Dim lngErrorID As Long
Dim strHeaderIsotopicAbundace As String
Dim strHeaderMass As String
Dim strHeaderFraction As String
Dim strHeaderIntensity As String
Dim blnAddProtonChargeCarrier As Boolean
Dim InFileNum As Integer, OutFileNum As Integer
Dim objCompound As New MWCompoundClass
Const MAX_SEARCH_ELEMENTS = 20
Dim strSearchElements(MAX_SEARCH_ELEMENTS) As String, strRemaining As String
Dim strThisElement As String, strSearchElementsSelected As String
' Save the current standard deviation mode and retrieve the current state of displaying the StdDev Mode
eElementModeSaved = objMwtWin.GetElementMode
eStdDevModeSaved = objMwtWin.StdDevMode
blnStdDevModeEnabled = gBlnShowStdDevWithMass
' Set default output options
strDelimeter = vbTab
blnShowWeight = True
blnShowInputSequence = True
blnShowSourceFormula = True
blnEchoComments = False
blnVerboseMode = True
' Default AA weight mode prefix and suffix
strPeptideWeightModePrefixFormula = "H"
strPeptideWeightModeSuffixFormula = "OH"
' Isotopic Distribution Options
intIsotopicDistributionChargeState = 1
strHeaderIsotopicAbundace = LookupLanguageCaption(15200, "Isotopic Abundances for")
strHeaderMass = LookupLanguageCaption(15210, "Mass/Charge")
strHeaderFraction = LookupLanguageCaption(15220, "Fraction")
strHeaderIntensity = LookupLanguageCaption(15230, "Intensity")
blnAddProtonChargeCarrier = True
If strInputFilename = "" Then
' 1510 = Text Files, 1515 = .txt
strFileName = SelectFile(frmMain.hwnd, "Select File", gLastFileOpenSaveFolder, False, "", ConstructFileDialogFilterMask(LookupMessage(1510), LookupMessage(1515)), 1)
If Len(strFileName) = 0 Then
' No file selected (or other error)
Exit Sub
End If
strOutputFilename = strFileName & ".out"
Else
strFileName = strInputFilename
If Not FileExists(strInputFilename) Then
MsgBox LookupMessage(470, " (" & strInputFilename & ")"), vbOKOnly + vbExclamation, LookupMessage(480)
Exit Sub
End If
If strOutputFilename = "" Or strOutputFilename = strFileName Then
strOutputFilename = strFileName & ".out"
End If
End If
On Error GoTo BatchFileProb
' Open the file for input
InFileNum = FreeFile()
Open strFileName For Input As #InFileNum
If Not boolOverwriteWithoutAsking And (frmProgramPreferences.optExitConfirmation(exmEscapeKeyConfirmExit).value = True Or frmProgramPreferences.optExitConfirmation(exmIgnoreEscapeKeyConfirmExit).value = True) Then
If FileExists(strOutputFilename) Then
eResponse = MsgBox(strOutputFilename & ": " & LookupMessage(490), vbYesNoCancel + vbDefaultButton2 + vbExclamation, LookupMessage(500))
If eResponse <> vbYes Then Exit Sub
End If
End If
OutFileNum = FreeFile()
Open strOutputFilename For Output As #OutFileNum
' Change mouse pointer to hourglass
frmMain.MousePointer = vbArrowHourglass
blnFFMode = False
blnIsotopicDistributionMode = False
frmProgress.InitializeForm "Batch analyzing", 0, FileLen(strFileName), True, False, True
frmProgress.ToggleAlwaysOnTop True
Do Until EOF(InFileNum)
Line Input #InFileNum, strWork
lngBytesRead = lngBytesRead + Len(strWork) + 2
If Trim(strWork) = "" Or IsComment(strWork) Then
If blnEchoComments Then
Print #OutFileNum, strWork
End If
Else
' Examine strWork to see if it contains an = sign
' If so, then it is a batch processing Command
intMatchLoc = InStr(strWork, "=")
If intMatchLoc > 0 Then
' Command Found
strCommand = Trim(UCase(Left(strWork, intMatchLoc - 1)))
strSettings = Trim(Mid(strWork, intMatchLoc + 1))
strSettingsUCase = UCase(strSettings)
Select Case Trim(strCommand)
' Output option commands
Case "VERBOSEMODE"
Select Case strSettingsUCase
Case "TRUE", "1", "ON"
Print #OutFileNum, COMMENT_CHAR & " Verbose mode is now on"
blnVerboseMode = True
Case Else
blnVerboseMode = False
End Select
Case "DELIMETER"
If Left(strSettings, 1) = "<" And Right(strSettings, 1) = ">" Then
' Special delimeter
Select Case UCase(Mid(strSettings, 2, Len(strSettings) - 2))
Case "TAB"
strDelimeter = vbTab
If blnVerboseMode Then Print #OutFileNum, COMMENT_CHAR & " Delimeter now a Tab"
Case "SPACE"
strDelimeter = " "
If blnVerboseMode Then Print #OutFileNum, COMMENT_CHAR & " Delimeter now a Space"
Case "ENTER", "CRLF"
strDelimeter = vbCrLf
If blnVerboseMode Then Print #OutFileNum, COMMENT_CHAR & " Delimeter now a Carriage Return (Enter)"
Case Else
Print #OutFileNum, COMMENT_CHAR & " Unknown delimeter code: " & strSettings & " -- Should be one of the following: <TAB>, <SPACE>, <ENTER>, <CRLF>"
End Select
ElseIf Len(Mid(strWork, intMatchLoc + 1)) > 0 Then
' Normal text delimeter (one or more characters)
strDelimeter = Mid(strWork, intMatchLoc + 1)
If blnVerboseMode Then Print #OutFileNum, COMMENT_CHAR & " Delimeter now " & strDelimeter
Else
If blnVerboseMode Then Print #OutFileNum, COMMENT_CHAR & " Delimeter reset to default (Tab)"
strDelimeter = vbTab
End If
Case "ECHOCOMMENTS"
Select Case strSettingsUCase
Case "TRUE", "1", "ON"
If blnVerboseMode Then Print #OutFileNum, COMMENT_CHAR & " Will now write comments present in the source file to the output file"
blnEchoComments = True
Case Else
If blnVerboseMode Then Print #OutFileNum, COMMENT_CHAR & " Comments found in the source file will not be written to the output file"
blnEchoComments = False
End Select
' Molecular Weight commands
Case "MW"
If blnFFMode Then
frmFinder.Hide
blnFFMode = False
End If
blnIsotopicDistributionMode = False
blnShowWeight = True
blnAAConvert3to1 = False
blnAAConvert1to3 = False
blnConvertToEmpiricalFormula = False
blnExpandAbbreviations = False
blnOneLetterPeptideWeightMode = False
If blnVerboseMode Then
Print #OutFileNum, ""
Print #OutFileNum, COMMENT_CHAR & " Normal Molecular Weight Mode Enabled (other modes turned Off)"
End If
Case "CAPITALIZED"
Select Case strSettingsUCase
Case "TRUE", "1", "ON"
If blnVerboseMode Then Print #OutFileNum, COMMENT_CHAR & " Source formula will be displayed with proper capitalization"
blnShowCapitalizedFormula = True
blnShowSourceFormula = True
Case Else
If blnVerboseMode Then Print #OutFileNum, COMMENT_CHAR & " Source formula will be displayed exactly as found in the input file"
blnShowCapitalizedFormula = False
End Select
Case "MWSHOWSOURCEFORMULA"
Select Case strSettingsUCase
Case "TRUE", "1", "ON"
If blnVerboseMode Then Print #OutFileNum, COMMENT_CHAR & " Display of source formula is now On"
blnShowSourceFormula = True
Case Else
If blnVerboseMode Then Print #OutFileNum, COMMENT_CHAR & " Display of source formula is now Off"
blnShowSourceFormula = False
End Select
Case "EMPIRICAL"
If blnVerboseMode Then Print #OutFileNum, ""
Select Case strSettingsUCase
Case "TRUE", "1", "ON"
' Enable conversion of formulas to their empirical formulas
If blnVerboseMode Then Print #OutFileNum, COMMENT_CHAR & " Converting formulas to empirical formulas now On"
blnConvertToEmpiricalFormula = True
Case Else
If blnVerboseMode Then Print #OutFileNum, COMMENT_CHAR & " Converting formulas to empirical formulas now Off"
blnConvertToEmpiricalFormula = False
End Select
Case "EXPANDABBREVIATIONS"
If blnVerboseMode Then Print #OutFileNum, ""
Select Case strSettingsUCase
Case "TRUE", "1", "ON"
' Enable expansion of abbreviations
If blnVerboseMode Then Print #OutFileNum, COMMENT_CHAR & " Abbreviation expansion now On"
blnExpandAbbreviations = True
Case Else
If blnVerboseMode Then Print #OutFileNum, COMMENT_CHAR & " Abbreviation expansion now Off"
blnExpandAbbreviations = False
End Select
Case "SHOWWEIGHT"
Select Case strSettingsUCase
Case "TRUE", "1", "ON"
' Show molecular weight
If blnVerboseMode Then Print #OutFileNum, COMMENT_CHAR & " Will display the molecular weight (mass) of each formula"
blnShowWeight = True
Case Else
If blnVerboseMode Then Print #OutFileNum, COMMENT_CHAR & " Will not display the molecular weight (mass) of each formula"
blnShowWeight = False
End Select
Case "STDDEVMODE"
Select Case strSettingsUCase
Case "SHORT"
objMwtWin.StdDevMode = smShort
If blnVerboseMode Then Print #OutFileNum, COMMENT_CHAR & " Standard deviation mode using Short display"
blnStdDevModeEnabled = True
Case "SCIENTIFIC"
objMwtWin.StdDevMode = smScientific
If blnVerboseMode Then Print #OutFileNum, COMMENT_CHAR & " Standard deviation mode using Scientific display"
blnStdDevModeEnabled = True
Case "DECIMAL"
objMwtWin.StdDevMode = smDecimal
If blnVerboseMode Then Print #OutFileNum, COMMENT_CHAR & " Standard deviation mode using Decimal display"
blnStdDevModeEnabled = True
Case "OFF"
blnStdDevModeEnabled = False
If blnVerboseMode Then Print #OutFileNum, COMMENT_CHAR & " Standard deviations will not be displayed"
Case Else
Print #OutFileNum, COMMENT_CHAR & " Warning: Invalid standard deviation mode: " & strSettingsUCase & " -- Should be one of the following: SHORT, SCIENTIFIC, DECIMAL, OFF"
End Select
Case "WEIGHTMODE"
Select Case strSettingsUCase
Case "AVERAGE"
SwitchWeightMode emAverageMass, False
If blnVerboseMode Then Print #OutFileNum, COMMENT_CHAR & " Average Weight Mode Enabled"
Case "ISOTOPIC"
SwitchWeightMode emIsotopicMass, False
If blnVerboseMode Then Print #OutFileNum, COMMENT_CHAR & " Isotopic Weight Mode Enabled"
Case "INTEGER"
SwitchWeightMode emIntegerMass, False
If blnVerboseMode Then Print #OutFileNum, COMMENT_CHAR & " Integer Weight Mode Enabled"
Case Else
Print #OutFileNum, COMMENT_CHAR & " Warning: Invalid elemental weight mode: " & strSettingsUCase & " -- Should be one of the following: AVERAGE, ISOTOPIC, INTEGER"
End Select
Case "ONELETTERPEPTIDEWEIGHTMODE"
Select Case strSettingsUCase
Case "TRUE", "1", "ON"
' Show molecular weight
If blnVerboseMode Then
Print #OutFileNum, ""
Print #OutFileNum, COMMENT_CHAR & " One letter Amino Acid weight mode: input formulas are assumed to be peptides in one-letter notation"
End If
If blnFFMode Then
frmFinder.Hide
blnFFMode = False
End If
blnIsotopicDistributionMode = False
blnShowWeight = True
blnAAConvert3to1 = False
blnAAConvert1to3 = False
blnConvertToEmpiricalFormula = False
blnExpandAbbreviations = False
blnOneLetterPeptideWeightMode = True
Case Else
If blnVerboseMode Then Print #OutFileNum, COMMENT_CHAR & " "
blnOneLetterPeptideWeightMode = False
End Select
Case "PEPTIDEWEIGHTMODEPEPTIDEPREFIX"
strPeptideWeightModePrefixFormula = strSettings
Case "PEPTIDEWEIGHTMODEPEPTIDESUFFIX"
strPeptideWeightModeSuffixFormula = strSettings
' Amino acid notation conversion commands
Case "AACONVERT3TO1"
' Treat strSettings as an amino acid with 3 letter symbols
' Convert to 1 letter symbols
If blnVerboseMode Then Print #OutFileNum, ""
Select Case strSettingsUCase
Case "TRUE", "1", "ON"
If blnVerboseMode Then Print #OutFileNum, COMMENT_CHAR & " 3 letter to 1 letter amino acid symbol conversion now On"
blnAAConvert3to1 = True
Case Else
If blnVerboseMode Then Print #OutFileNum, COMMENT_CHAR & " 3 letter to 1 letter amino acid symbol conversion now Off"
blnAAConvert3to1 = True
End Select
blnAAConvert1to3 = False
blnFFMode = False
blnIsotopicDistributionMode = False
Case "AACONVERT1TO3"
' Treat strSettings as an amino acid with 1 letter symbols
' Convert to 3 letter symbols
If blnVerboseMode Then Print #OutFileNum, ""
Select Case strSettingsUCase
Case "TRUE", "1", "ON"
If blnVerboseMode Then Print #OutFileNum, COMMENT_CHAR & " 1 letter to 3 letter amino acid symbol conversion now On"
blnAAConvert1to3 = True
Case Else
If blnVerboseMode Then Print #OutFileNum, COMMENT_CHAR & " 1 letter to 3 letter amino acid symbol conversion Off"
blnAAConvert1to3 = False
End Select
blnAAConvert3to1 = False
blnFFMode = False
blnIsotopicDistributionMode = False
Case "AASPACEEVERY10"
Select Case strSettingsUCase
Case "TRUE", "1", "ON"
If blnVerboseMode Then Print #OutFileNum, COMMENT_CHAR & " Will add a space every 10 amino acids"
blnSpaceEvery10 = True
Case Else
If blnVerboseMode Then Print #OutFileNum, COMMENT_CHAR & " Will not add a space every 10 amino acids"
blnSpaceEvery10 = False
End Select
Case "AA1TO3USEDASH"
Select Case strSettingsUCase
Case "TRUE", "1", "ON"
If blnVerboseMode Then Print #OutFileNum, COMMENT_CHAR & " Will separate residues with a dash"
blnSeparateWithDash = True
Case Else
If blnVerboseMode Then Print #OutFileNum, COMMENT_CHAR & " Will not separate residues with a dash"
blnSeparateWithDash = False
End Select
Case "AASHOWSEQUENCEBEINGCONVERTED"
Select Case strSettingsUCase
Case "TRUE", "1", "ON"
If blnVerboseMode Then Print #OutFileNum, COMMENT_CHAR & " Will show sequence being converted, in addition to the converted sequence"
blnShowInputSequence = True
Case Else
If blnVerboseMode Then Print #OutFileNum, COMMENT_CHAR & " Will only show the converted sequence, not the sequence being converted"
blnShowInputSequence = False
End Select
' Formula Finder commands
Case "FF"
If Not blnFFMode Then
blnFFMode = True
frmFinder.Show
' Need to re-initialize to make sure the progress window is on top
frmProgress.UpdateCurrentTask "Batch analyzing"
End If
frmFinder.SetWeightMatchingMode 0
' Examine strSettings to see if any elements/abbreviations are specified
' If yes, construct an array of the elements/abbreviations
' Once constructed, select the appropriate elements on the form
If Len(strSettings) > 0 Then
intValsFound = ParseString(strSettings, strSearchElements, MAX_SEARCH_ELEMENTS, ",", strRemaining, True, True)
If intValsFound > 0 Then
' Uncheck all of the currently selected search elements on frmFinder
For intIndex = 0 To 9
frmFinder.chkElements(intIndex).value = vbUnchecked
Next intIndex
intCustomElementIndex = 3
For intIndex = 1 To intValsFound
strCustomElementFormula = strSearchElements(intIndex)
Select Case Trim(UCase(strCustomElementFormula))
Case "C": frmFinder.chkElements(0).value = vbChecked
Case "H": frmFinder.chkElements(1).value = vbChecked
Case "N": frmFinder.chkElements(2).value = vbChecked
Case "O": frmFinder.chkElements(3).value = vbChecked
Case Else
If intCustomElementIndex < 9 Then
' See if strCustomElementFormula is valid by checking if it has a weight of 0 or more
strCustomElementFormula = UCase(Left(strCustomElementFormula, 1)) & Mid(strCustomElementFormula, 2)
objCompound.Formula = strCustomElementFormula
If objCompound.ErrorID = 0 Then
intCustomElementIndex = intCustomElementIndex + 1
frmFinder.chkElements(intCustomElementIndex).value = vbChecked
frmFinder.txtWeight(intCustomElementIndex).Text = objCompound.FormulaCapitalized
Else
Print #OutFileNum, COMMENT_CHAR & " Error: Invalid formula or abbreviation: " & strCustomElementFormula
End If
Else
Print #OutFileNum, COMMENT_CHAR & " Error: Too many custom search elements (" & intValsFound & ")"
Exit For
End If
End Select
Next intIndex
End If
End If
strSearchElementsSelected = ""
For intIndex = 0 To 9
If cChkBox(frmFinder.chkElements(intIndex)) Then
Select Case intIndex
Case 0: strThisElement = "C"
Case 1: strThisElement = "H"
Case 2: strThisElement = "N"
Case 3: strThisElement = "O"
Case Else
strThisElement = frmFinder.txtWeight(intIndex)
End Select
If Len(strSearchElementsSelected) > 0 Then
strSearchElementsSelected = strSearchElementsSelected & ", " & strThisElement
Else
strSearchElementsSelected = strThisElement
End If
End If
Next intIndex
If blnVerboseMode Then Print #OutFileNum, ""
If blnVerboseMode Then Print #OutFileNum, COMMENT_CHAR & " Formula Finder Mode Enabled. Search elements/abbreviations: " & strSearchElementsSelected
Case "MAXHITS"
If IsNumeric(strSettings) Then
lngNewMaxHits = CLng(strSettings)
If lngNewMaxHits >= 1 And lngNewMaxHits <= 15000 Then
frmFinder.txtHits = lngNewMaxHits
If blnVerboseMode Then Print #OutFileNum, COMMENT_CHAR & " FF Maximum Hits set to " & Trim(lngNewMaxHits)
End If
End If
Case "TOLERANCE"
If IsNumeric(strSettings) Then
frmFinder.txtWeightTolerance = CSng(strSettings)
If blnVerboseMode Then Print #OutFileNum, COMMENT_CHAR & " FF Tolerance set to " & Trim(CSng(strSettings))
End If
Case "ISOTOPICDISTRIBUTION"
' 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 now On"
blnIsotopicDistributionMode = True
blnShowWeight = False
Case Else
If blnVerboseMode Then Print #OutFileNum, COMMENT_CHAR & " Isotopic Distribution calculations now Off"
blnIsotopicDistributionMode = False
blnShowWeight = True
End Select
blnFFMode = False
blnAAConvert3to1 = False
blnAAConvert1to3 = False
blnConvertToEmpiricalFormula = False
blnExpandAbbreviations = False
blnOneLetterPeptideWeightMode = False
Case "ISOTOPICDISTRIBUTIONCHARGE"
' Charge state for Isotopic Distribution calculations
If IsNumeric(strSettings) Then
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
Else
If KeyPressAbortProcess > 1 Then
Print #OutFileNum, COMMENT_CHAR & " Error: Processing aborted"
Exit Do
End If
lngFormulasProcessed = lngFormulasProcessed + 1
If blnFFMode Then
' Using Formula Finder
' Only parse line if it contains a number
If IsNumeric(strWork) Then