@@ -62,25 +62,28 @@ protected override MyResults RunSpecific()
62
62
Status ( "Calibration round " + calibrationRound ) ;
63
63
int numMs1MassChargeCombinationsConsidered = 0 ;
64
64
int numMs1MassChargeCombinationsThatAreIgnoredBecauseOfTooManyPeaks = 0 ;
65
+ int numMs2MassChargeCombinationsConsidered = 0 ;
66
+ int numMs2MassChargeCombinationsThatAreIgnoredBecauseOfTooManyPeaks = 0 ;
65
67
Status ( "Getting Training Points" ) ;
66
- pointList = GetDataPoints ( ref numMs1MassChargeCombinationsConsidered , ref numMs1MassChargeCombinationsThatAreIgnoredBecauseOfTooManyPeaks ) ;
68
+ pointList = GetDataPoints ( ref numMs1MassChargeCombinationsConsidered , ref numMs1MassChargeCombinationsThatAreIgnoredBecauseOfTooManyPeaks , ref numMs2MassChargeCombinationsConsidered , ref numMs2MassChargeCombinationsThatAreIgnoredBecauseOfTooManyPeaks ) ;
67
69
68
- goodResult . Add ( calibrationRound , numMs1MassChargeCombinationsConsidered , numMs1MassChargeCombinationsThatAreIgnoredBecauseOfTooManyPeaks , pointList . Count ) ;
70
+ goodResult . Add ( calibrationRound , numMs1MassChargeCombinationsConsidered , numMs1MassChargeCombinationsThatAreIgnoredBecauseOfTooManyPeaks , pointList . Count , numMs2MassChargeCombinationsConsidered , numMs2MassChargeCombinationsThatAreIgnoredBecauseOfTooManyPeaks ) ;
69
71
70
72
if ( calibrationRound >= 2 && pointList . Count <= trainingPointCounts [ calibrationRound - 2 ] )
71
73
break ;
72
74
73
75
trainingPointCounts . Add ( pointList . Count ) ;
74
76
75
- var pointList1 = pointList . Where ( ( b ) => b . inputs [ 0 ] < 0 ) . ToList ( ) ;
76
- if ( pointList1 . Count == 0 )
77
- {
78
- return new MyErroredResults ( this , "Not enough MS1 training points, identification quality is poor" ) ;
79
- }
80
77
var pointList2 = pointList . Where ( ( b ) => b . inputs [ 0 ] > 0 ) . ToList ( ) ;
81
78
if ( pointList2 . Count == 0 )
82
79
{
83
- return new MyErroredResults ( this , "Not enough MS2 training points, identification quality is poor" ) ;
80
+ return new MyErroredResults ( this , "No MS2 training points, identification quality is poor. Try to change the Fragment tolerance." + goodResult . ToString ( ) ) ;
81
+ }
82
+
83
+ var pointList1 = pointList . Where ( ( b ) => b . inputs [ 0 ] < 0 ) . ToList ( ) ;
84
+ if ( pointList1 . Count == 0 )
85
+ {
86
+ return new MyErroredResults ( this , "No MS1 training points, identification quality is poor. Try to change the Parent tolerance." + goodResult . ToString ( ) ) ;
84
87
}
85
88
86
89
CalibrationFunction combinedCalibration = Calibrate ( pointList ) ;
@@ -96,7 +99,7 @@ protected override MyResults RunSpecific()
96
99
97
100
#region Private Methods
98
101
99
- private List < LabeledDataPoint > GetDataPoints ( ref int numMs1MassChargeCombinationsConsidered , ref int numMs1MassChargeCombinationsThatAreIgnoredBecauseOfTooManyPeaks )
102
+ private List < LabeledDataPoint > GetDataPoints ( ref int numMs1MassChargeCombinationsConsidered , ref int numMs1MassChargeCombinationsThatAreIgnoredBecauseOfTooManyPeaks , ref int numMs2MassChargeCombinationsConsidered , ref int numMs2MassChargeCombinationsThatAreIgnoredBecauseOfTooManyPeaks )
100
103
{
101
104
Status ( "Extracting data points:" ) ;
102
105
// The final training point list
@@ -133,7 +136,7 @@ private List<LabeledDataPoint> GetDataPoints(ref int numMs1MassChargeCombination
133
136
Peptide coolPeptide = null ;
134
137
coolPeptide = new Peptide ( SequenceWithChemicalFormulas ) ;
135
138
136
- candidateTrainingPointsForPeptide = SearchMS2Spectrum ( myMsDataFile . GetOneBasedScan ( ms2spectrumIndex ) , coolPeptide , peptideCharge , out numFragmentsIdentified ) ;
139
+ candidateTrainingPointsForPeptide = SearchMS2Spectrum ( myMsDataFile . GetOneBasedScan ( ms2spectrumIndex ) , coolPeptide , peptideCharge , out numFragmentsIdentified , ref numMs2MassChargeCombinationsConsidered , ref numMs2MassChargeCombinationsThatAreIgnoredBecauseOfTooManyPeaks ) ;
137
140
138
141
// If MS2 has low evidence for peptide, skip and go to next one
139
142
if ( numFragmentsIdentified < numFragmentsNeededForEveryIdentification )
@@ -441,7 +444,7 @@ private int SearchMS1Spectra(double[] originalMasses, double[] originalIntensiti
441
444
return goodIndex ;
442
445
}
443
446
444
- private List < LabeledDataPoint > SearchMS2Spectrum ( IMsDataScan < IMzSpectrum < MzPeak > > ms2DataScan , Peptide peptide , int peptideCharge , out int candidateFragmentsIdentified )
447
+ private List < LabeledDataPoint > SearchMS2Spectrum ( IMsDataScan < IMzSpectrum < MzPeak > > ms2DataScan , Peptide peptide , int peptideCharge , out int candidateFragmentsIdentified , ref int numMs2MassChargeCombinationsConsidered , ref int numMs2MassChargeCombinationsThatAreIgnoredBecauseOfTooManyPeaks )
445
448
{
446
449
var myCandidatePoints = new List < LabeledDataPoint > ( ) ;
447
450
@@ -520,8 +523,10 @@ private List<LabeledDataPoint> SearchMS2Spectrum(IMsDataScan<IMzSpectrum<MzPeak>
520
523
{
521
524
break ;
522
525
}
526
+ numMs2MassChargeCombinationsConsidered ++ ;
523
527
if ( npwr > 1 )
524
528
{
529
+ numMs2MassChargeCombinationsThatAreIgnoredBecauseOfTooManyPeaks ++ ;
525
530
continue ;
526
531
}
527
532
var closestPeak = ms2DataScan . MassSpectrum . GetClosestPeak ( theMZ ) ;
0 commit comments