@@ -171,17 +171,18 @@ protected override MyTaskResults RunSpecific(string OutputFolder, List<DbForTask
171
171
IMsDataFile < IMsDataScan < IMzSpectrum < IMzPeak > > > myMsDataFile ;
172
172
lock ( lock1 ) // Lock because reading is sequential
173
173
{
174
- StartingDataFile ( origDataFileName , new List < string > { taskId } ) ;
175
- Status ( "Loading spectra file " + origDataFileName + "..." , new List < string > { taskId } ) ;
174
+ NewCollection ( Path . GetFileName ( origDataFileName ) , new List < string > { taskId , "Individual Searches" , origDataFileName } ) ;
175
+ StartingDataFile ( origDataFileName , new List < string > { taskId , "Individual Searches" , origDataFileName } ) ;
176
+ Status ( "Loading spectra file " + origDataFileName + "..." , new List < string > { taskId , "Individual Searches" , origDataFileName } ) ;
176
177
if ( Path . GetExtension ( origDataFileName ) . Equals ( ".mzML" ) )
177
178
myMsDataFile = Mzml . LoadAllStaticData ( origDataFileName ) ;
178
179
else
179
180
myMsDataFile = ThermoStaticData . LoadAllStaticData ( origDataFileName ) ;
180
- Status ( "Opening spectra file " + origDataFileName + "..." , new List < string > { taskId } ) ;
181
+ Status ( "Opening spectra file " + origDataFileName + "..." , new List < string > { taskId , "Individual Searches" , origDataFileName } ) ;
181
182
listOfSortedms2Scans = MyEngine . GetMs2Scans ( myMsDataFile ) . OrderBy ( b => b . MonoisotopicPrecursorMass ) . ToArray ( ) ;
182
183
}
183
184
184
- var searchEngine = new ClassicSearchEngine ( listOfSortedms2Scans , myMsDataFile . NumSpectra , variableModifications , fixedModifications , proteinList , ProductMassTolerance , Protease , searchModes , MaxMissedCleavages , MaxModificationIsoforms , origDataFileName , lp , new List < string > { taskId } ) ;
185
+ var searchEngine = new ClassicSearchEngine ( listOfSortedms2Scans , myMsDataFile . NumSpectra , variableModifications , fixedModifications , proteinList , ProductMassTolerance , Protease , searchModes , MaxMissedCleavages , MaxModificationIsoforms , origDataFileName , lp , new List < string > { taskId , "Individual Searches" , origDataFileName } ) ;
185
186
186
187
var searchResults = ( ClassicSearchResults ) searchEngine . Run ( ) ;
187
188
myTaskResults . AddResultText ( searchResults ) ;
@@ -191,7 +192,7 @@ protected override MyTaskResults RunSpecific(string OutputFolder, List<DbForTask
191
192
192
193
InitiatorMethionineBehavior initiatorMethionineBehavior = InitiatorMethionineBehavior . Variable ;
193
194
// Run analysis on single file results
194
- var analysisEngine = new AnalysisEngine ( searchResults . OuterPsms , compactPeptideToProteinPeptideMatching , proteinList , variableModifications , fixedModifications , localizeableModifications , Protease , searchModes , myMsDataFile , ProductMassTolerance , ( BinTreeStructure myTreeStructure , string s ) => WriteTree ( myTreeStructure , OutputFolder , Path . GetFileNameWithoutExtension ( origDataFileName ) + s , new List < string > { taskId , origDataFileName } ) , ( List < NewPsmWithFdr > h , string s ) => WritePsmsToTsv ( h , OutputFolder , Path . GetFileNameWithoutExtension ( origDataFileName ) + s , new List < string > { taskId , origDataFileName } ) , null , false , false , MaxMissedCleavages , MaxModificationIsoforms , false , lp , double . NaN , initiatorMethionineBehavior , new List < string > { taskId } , false , 0 , 0 ) ;
195
+ var analysisEngine = new AnalysisEngine ( searchResults . OuterPsms , compactPeptideToProteinPeptideMatching , proteinList , variableModifications , fixedModifications , localizeableModifications , Protease , searchModes , myMsDataFile , ProductMassTolerance , ( BinTreeStructure myTreeStructure , string s ) => WriteTree ( myTreeStructure , OutputFolder , Path . GetFileNameWithoutExtension ( origDataFileName ) + s , new List < string > { taskId , "Individual Searches" , origDataFileName } ) , ( List < NewPsmWithFdr > h , string s ) => WritePsmsToTsv ( h , OutputFolder , Path . GetFileNameWithoutExtension ( origDataFileName ) + s , new List < string > { taskId , "Individual Searches" , origDataFileName } ) , null , false , false , MaxMissedCleavages , MaxModificationIsoforms , false , lp , double . NaN , initiatorMethionineBehavior , new List < string > { taskId , "Individual Searches" , origDataFileName } , false , 0 , 0 ) ;
195
196
196
197
var analysisResults = ( AnalysisResults ) analysisEngine . Run ( ) ;
197
198
myTaskResults . AddResultText ( analysisResults ) ;
@@ -206,56 +207,58 @@ protected override MyTaskResults RunSpecific(string OutputFolder, List<DbForTask
206
207
207
208
// TODO: fix the tolerance calculation below
208
209
209
- var a = new CalibrationEngine ( myMsDataFile , ProductMassTolerance , identifications , minMS1isotopicPeaksNeededForConfirmedIdentification , minMS2isotopicPeaksNeededForConfirmedIdentification , numFragmentsNeededForEveryIdentification , PrecursorMassTolerance , fragmentTypesForCalibration , ( List < LabeledMs1DataPoint > theList , string s ) => WriteMs1DataPoints ( theList , OutputFolder , Path . GetFileNameWithoutExtension ( origDataFileName ) + s , new List < string > { taskId , origDataFileName } ) , ( List < LabeledMs2DataPoint > theList , string s ) => WriteMs2DataPoints ( theList , OutputFolder , Path . GetFileNameWithoutExtension ( origDataFileName ) + s , new List < string > { taskId , origDataFileName } ) , false , new List < string > { taskId } ) ;
210
+ var a = new CalibrationEngine ( myMsDataFile , ProductMassTolerance , identifications , minMS1isotopicPeaksNeededForConfirmedIdentification , minMS2isotopicPeaksNeededForConfirmedIdentification , numFragmentsNeededForEveryIdentification , PrecursorMassTolerance , fragmentTypesForCalibration , ( List < LabeledMs1DataPoint > theList , string s ) => WriteMs1DataPoints ( theList , OutputFolder , Path . GetFileNameWithoutExtension ( origDataFileName ) + s , new List < string > { taskId , "Individual Searches" , origDataFileName } ) , ( List < LabeledMs2DataPoint > theList , string s ) => WriteMs2DataPoints ( theList , OutputFolder , Path . GetFileNameWithoutExtension ( origDataFileName ) + s , new List < string > { taskId , "Individual Searches" , origDataFileName } ) , false , new List < string > { taskId , "Individual Searches" , origDataFileName } ) ;
210
211
211
212
var resultBeforeFC = a . Run ( ) ;
212
213
myTaskResults . AddResultText ( resultBeforeFC ) ;
213
214
214
215
// Second search round
215
216
216
217
var listOfSortedms2ScansTest = MyEngine . GetMs2Scans ( myMsDataFile ) . OrderBy ( b => b . MonoisotopicPrecursorMass ) . ToArray ( ) ;
217
- var searchEngineTest = new ClassicSearchEngine ( listOfSortedms2ScansTest , myMsDataFile . NumSpectra , variableModifications , fixedModifications , proteinList , ProductMassTolerance , Protease , searchModes , MaxMissedCleavages , MaxModificationIsoforms , origDataFileName , lp , new List < string > { taskId } ) ;
218
+ var searchEngineTest = new ClassicSearchEngine ( listOfSortedms2ScansTest , myMsDataFile . NumSpectra , variableModifications , fixedModifications , proteinList , ProductMassTolerance , Protease , searchModes , MaxMissedCleavages , MaxModificationIsoforms , origDataFileName , lp , new List < string > { taskId , "Individual Searches" , origDataFileName } ) ;
218
219
var searchResultsTest = ( ClassicSearchResults ) searchEngineTest . Run ( ) ;
219
220
myTaskResults . AddResultText ( searchResultsTest ) ;
220
- var analysisEngineTest = new AnalysisEngine ( searchResultsTest . OuterPsms , compactPeptideToProteinPeptideMatching , proteinList , variableModifications , fixedModifications , localizeableModifications , Protease , searchModes , myMsDataFile , ProductMassTolerance , ( BinTreeStructure myTreeStructure , string s ) => WriteTree ( myTreeStructure , OutputFolder , Path . GetFileNameWithoutExtension ( origDataFileName ) + s + "test" , new List < string > { taskId , origDataFileName } ) , ( List < NewPsmWithFdr > h , string s ) => WritePsmsToTsv ( h , OutputFolder , Path . GetFileNameWithoutExtension ( origDataFileName ) + s + "test" , new List < string > { taskId , origDataFileName } ) , null , false , false , MaxMissedCleavages , MaxModificationIsoforms , false , lp , double . NaN , initiatorMethionineBehavior , new List < string > { taskId } , false , 0 , 0 ) ;
221
+ var analysisEngineTest = new AnalysisEngine ( searchResultsTest . OuterPsms , compactPeptideToProteinPeptideMatching , proteinList , variableModifications , fixedModifications , localizeableModifications , Protease , searchModes , myMsDataFile , ProductMassTolerance , ( BinTreeStructure myTreeStructure , string s ) => WriteTree ( myTreeStructure , OutputFolder , Path . GetFileNameWithoutExtension ( origDataFileName ) + s + "test" , new List < string > { taskId , "Individual Searches" , origDataFileName } ) , ( List < NewPsmWithFdr > h , string s ) => WritePsmsToTsv ( h , OutputFolder , Path . GetFileNameWithoutExtension ( origDataFileName ) + s + "test" , new List < string > { taskId , "Individual Searches" , origDataFileName } ) , null , false , false , MaxMissedCleavages , MaxModificationIsoforms , false , lp , double . NaN , initiatorMethionineBehavior , new List < string > { taskId , "Individual Searches" , origDataFileName } , false , 0 , 0 ) ;
221
222
var analysisResultsTest = ( AnalysisResults ) analysisEngineTest . Run ( ) ;
222
223
myTaskResults . AddResultText ( analysisResultsTest ) ;
223
224
224
225
//
225
226
226
- var resultAfterFC = new CalibrationEngine ( myMsDataFile , ProductMassTolerance , analysisResultsTest . AllResultingIdentifications [ 0 ] , minMS1isotopicPeaksNeededForConfirmedIdentification , minMS2isotopicPeaksNeededForConfirmedIdentification , numFragmentsNeededForEveryIdentification , PrecursorMassTolerance , fragmentTypesForCalibration , ( List < LabeledMs1DataPoint > theList , string s ) => WriteMs1DataPoints ( theList , OutputFolder , Path . GetFileNameWithoutExtension ( origDataFileName ) + s + "after" , new List < string > { taskId , origDataFileName } ) , ( List < LabeledMs2DataPoint > theList , string s ) => WriteMs2DataPoints ( theList , OutputFolder , Path . GetFileNameWithoutExtension ( origDataFileName ) + s + "after" , new List < string > { taskId , origDataFileName } ) , true , new List < string > { taskId } ) . Run ( ) ;
227
+ var resultAfterFC = new CalibrationEngine ( myMsDataFile , ProductMassTolerance , analysisResultsTest . AllResultingIdentifications [ 0 ] , minMS1isotopicPeaksNeededForConfirmedIdentification , minMS2isotopicPeaksNeededForConfirmedIdentification , numFragmentsNeededForEveryIdentification , PrecursorMassTolerance , fragmentTypesForCalibration , ( List < LabeledMs1DataPoint > theList , string s ) => WriteMs1DataPoints ( theList , OutputFolder , Path . GetFileNameWithoutExtension ( origDataFileName ) + s + "after" , new List < string > { taskId , "Individual Searches" , origDataFileName } ) , ( List < LabeledMs2DataPoint > theList , string s ) => WriteMs2DataPoints ( theList , OutputFolder , Path . GetFileNameWithoutExtension ( origDataFileName ) + s + "after" , new List < string > { taskId , "Individual Searches" , origDataFileName } ) , true , new List < string > { taskId , "Individual Searches" , origDataFileName } ) . Run ( ) ;
227
228
myTaskResults . AddResultText ( resultAfterFC ) ;
228
229
229
230
// Final search round - not required
230
231
231
232
var listOfSortedms2ScansTest2 = MyEngine . GetMs2Scans ( myMsDataFile ) . OrderBy ( b => b . MonoisotopicPrecursorMass ) . ToArray ( ) ;
232
- var searchEngineTest2 = new ClassicSearchEngine ( listOfSortedms2ScansTest2 , myMsDataFile . NumSpectra , variableModifications , fixedModifications , proteinList , ProductMassTolerance , Protease , searchModes , MaxMissedCleavages , MaxModificationIsoforms , origDataFileName , lp , new List < string > { taskId } ) ;
233
+ var searchEngineTest2 = new ClassicSearchEngine ( listOfSortedms2ScansTest2 , myMsDataFile . NumSpectra , variableModifications , fixedModifications , proteinList , ProductMassTolerance , Protease , searchModes , MaxMissedCleavages , MaxModificationIsoforms , origDataFileName , lp , new List < string > { taskId , "Individual Searches" , origDataFileName } ) ;
233
234
var searchResultsTest2 = ( ClassicSearchResults ) searchEngineTest2 . Run ( ) ;
234
235
myTaskResults . AddResultText ( searchResultsTest2 ) ;
235
- var analysisEngineTest2 = new AnalysisEngine ( searchResultsTest2 . OuterPsms , compactPeptideToProteinPeptideMatching , proteinList , variableModifications , fixedModifications , localizeableModifications , Protease , searchModes , myMsDataFile , ProductMassTolerance , ( BinTreeStructure myTreeStructure , string s ) => WriteTree ( myTreeStructure , OutputFolder , Path . GetFileNameWithoutExtension ( origDataFileName ) + s + "test2" , new List < string > { taskId , origDataFileName } ) , ( List < NewPsmWithFdr > h , string s ) => WritePsmsToTsv ( h , OutputFolder , Path . GetFileNameWithoutExtension ( origDataFileName ) + s + "test2" , new List < string > { taskId , origDataFileName } ) , null , false , false , MaxMissedCleavages , MaxModificationIsoforms , false , lp , double . NaN , initiatorMethionineBehavior , new List < string > { taskId } , false , 0 , 0 ) ;
236
+ var analysisEngineTest2 = new AnalysisEngine ( searchResultsTest2 . OuterPsms , compactPeptideToProteinPeptideMatching , proteinList , variableModifications , fixedModifications , localizeableModifications , Protease , searchModes , myMsDataFile , ProductMassTolerance , ( BinTreeStructure myTreeStructure , string s ) => WriteTree ( myTreeStructure , OutputFolder , Path . GetFileNameWithoutExtension ( origDataFileName ) + s + "test2" , new List < string > { taskId , "Individual Searches" , origDataFileName } ) , ( List < NewPsmWithFdr > h , string s ) => WritePsmsToTsv ( h , OutputFolder , Path . GetFileNameWithoutExtension ( origDataFileName ) + s + "test2" , new List < string > { taskId , "Individual Searches" , origDataFileName } ) , null , false , false , MaxMissedCleavages , MaxModificationIsoforms , false , lp , double . NaN , initiatorMethionineBehavior , new List < string > { taskId , "Individual Searches" , origDataFileName } , false , 0 , 0 ) ;
237
+
236
238
var analysisResultsTest2 = ( AnalysisResults ) analysisEngineTest2 . Run ( ) ;
237
239
myTaskResults . AddResultText ( analysisResultsTest2 ) ;
238
240
239
241
//
240
242
241
243
if ( resultBeforeFC is MyErroredResults )
242
244
{
243
- Warn ( a . ToString ( ) , new List < string > { taskId } ) ;
245
+ Warn ( a . ToString ( ) , new List < string > { taskId , "Individual Searches" , origDataFileName } ) ;
244
246
}
245
247
else
246
248
{
247
- Status ( "Creating _indexedmzMLConnection, putting data in it, and writing!" , new List < string > { taskId } ) ;
249
+ Status ( "Creating _indexedmzMLConnection, putting data in it, and writing!" , new List < string > { taskId , "Individual Searches" , origDataFileName } ) ;
248
250
var path = Path . Combine ( OutputFolder , Path . GetFileNameWithoutExtension ( origDataFileName ) + "-Calibrated.mzML" ) ;
249
251
lock ( lock2 ) // Lock because writing is sequential
250
252
{
251
253
MzmlMethods . CreateAndWriteMyMzmlWithCalibratedSpectra ( myMsDataFile , path ) ;
252
254
253
- SucessfullyFinishedWritingFile ( path , new List < string > { taskId , origDataFileName } ) ;
255
+ SucessfullyFinishedWritingFile ( path , new List < string > { taskId , "Individual Searches" , origDataFileName } ) ;
254
256
255
257
myTaskResults . newSpectra . Add ( path ) ;
256
258
}
257
259
}
258
- FinishedDataFile ( origDataFileName , new List < string > { taskId } ) ;
260
+ FinishedDataFile ( origDataFileName , new List < string > { taskId , "Individual Searches" , origDataFileName } ) ;
261
+ Status ( "Done!" , new List < string > { taskId , "Individual Searches" , origDataFileName } ) ;
259
262
}
260
263
) ;
261
264
return myTaskResults ;
0 commit comments