@@ -222,10 +222,9 @@ protected override MyResults RunSpecific()
222
222
lp . Add ( ProductType . Y ) ;
223
223
224
224
Status ( "Loading proteins..." ) ;
225
- var allKnownModifications = GetDict ( localizeableModifications ) ;
226
225
Dictionary < string , Modification > um = null ;
227
- var proteinList = dbFilenameList . SelectMany ( b => ProteinDbLoader . LoadProteinDb ( b . FileName , true , allKnownModifications , b . IsContaminant , out um ) ) . ToList ( ) ;
228
- AnalysisEngine analysisEngine ;
226
+ var proteinList = dbFilenameList . SelectMany ( b => ProteinDbLoader . LoadProteinDb ( b . FileName , true , GetDict ( localizeableModifications ) , b . IsContaminant , out um ) ) . ToList ( ) ;
227
+
229
228
AnalysisResults analysisResults = null ;
230
229
var numRawFiles = currentRawFileList . Count ;
231
230
for ( int spectraFileIndex = 0 ; spectraFileIndex < numRawFiles ; spectraFileIndex ++ )
@@ -240,38 +239,30 @@ protected override MyResults RunSpecific()
240
239
Status ( "Opening spectra file..." ) ;
241
240
myMsDataFile . Open ( ) ;
242
241
243
- var listOfSortedms2Scans = GetMs2Scans ( myMsDataFile ) . OrderBy ( b => b . PrecursorMass ) . ToArray ( ) ;
244
-
245
- var searchEngine = new ClassicSearchEngine ( listOfSortedms2Scans , myMsDataFile . NumSpectra , variableModifications , fixedModifications , proteinList , ProductMassTolerance , Protease , searchModes , MaxMissedCleavages , MaxModificationIsoforms , myMsDataFile . Name , lp ) ;
246
-
247
- var searchResults = ( ClassicSearchResults ) searchEngine . Run ( ) ;
242
+ var searchResults = ( ClassicSearchResults ) new ClassicSearchEngine ( GetMs2Scans ( myMsDataFile ) . OrderBy ( b => b . PrecursorMass ) . ToArray ( ) , myMsDataFile . NumSpectra , variableModifications , fixedModifications , proteinList , ProductMassTolerance , Protease , searchModes , MaxMissedCleavages , MaxModificationIsoforms , myMsDataFile . Name , lp ) . Run ( ) ;
243
+ myGPTMDresults . AddResultText ( searchResults ) ;
248
244
249
245
allPsms [ 0 ] . AddRange ( searchResults . OuterPsms [ 0 ] ) ;
250
246
251
- analysisEngine = new AnalysisEngine ( searchResults . OuterPsms , compactPeptideToProteinPeptideMatching , proteinList , variableModifications , fixedModifications , localizeableModifications , Protease , searchModes , myMsDataFile , ProductMassTolerance , ( BinTreeStructure myTreeStructure , string s ) => WriteTree ( myTreeStructure , OutputFolder , Path . GetFileNameWithoutExtension ( origDataFile ) + s ) , ( List < NewPsmWithFdr > h , string s ) => WritePsmsToTsv ( h , OutputFolder , Path . GetFileNameWithoutExtension ( origDataFile ) + s ) , null , false , MaxMissedCleavages , MaxModificationIsoforms , true , lp , binTolInDaltons , initiatorMethionineBehavior ) ;
252
- analysisResults = ( AnalysisResults ) analysisEngine . Run ( ) ;
253
- //output(analysisResults.ToString());
247
+ analysisResults = ( AnalysisResults ) new AnalysisEngine ( searchResults . OuterPsms , compactPeptideToProteinPeptideMatching , proteinList , variableModifications , fixedModifications , localizeableModifications , Protease , searchModes , myMsDataFile , ProductMassTolerance , ( BinTreeStructure myTreeStructure , string s ) => WriteTree ( myTreeStructure , OutputFolder , Path . GetFileNameWithoutExtension ( origDataFile ) + s ) , ( List < NewPsmWithFdr > h , string s ) => WritePsmsToTsv ( h , OutputFolder , Path . GetFileNameWithoutExtension ( origDataFile ) + s ) , null , false , MaxMissedCleavages , MaxModificationIsoforms , true , lp , binTolInDaltons , initiatorMethionineBehavior ) . Run ( ) ;
248
+ myGPTMDresults . AddResultText ( analysisResults ) ;
254
249
}
255
250
256
251
if ( numRawFiles > 1 )
257
252
{
258
- analysisEngine = new AnalysisEngine ( allPsms . Select ( b => b . ToArray ( ) ) . ToArray ( ) , compactPeptideToProteinPeptideMatching , proteinList , variableModifications , fixedModifications , localizeableModifications , Protease , searchModes , null , ProductMassTolerance , ( BinTreeStructure myTreeStructure , string s ) => WriteTree ( myTreeStructure , OutputFolder , "aggregate" + s ) , ( List < NewPsmWithFdr > h , string s ) => WritePsmsToTsv ( h , OutputFolder , "aggregate" + s ) , null , false , MaxMissedCleavages , MaxModificationIsoforms , true , lp , binTolInDaltons , initiatorMethionineBehavior ) ;
259
- analysisResults = ( AnalysisResults ) analysisEngine . Run ( ) ;
260
- //output(analysisResults.ToString());
253
+ analysisResults = ( AnalysisResults ) new AnalysisEngine ( allPsms . Select ( b => b . ToArray ( ) ) . ToArray ( ) , compactPeptideToProteinPeptideMatching , proteinList , variableModifications , fixedModifications , localizeableModifications , Protease , searchModes , null , ProductMassTolerance , ( BinTreeStructure myTreeStructure , string s ) => WriteTree ( myTreeStructure , OutputFolder , "aggregate" + s ) , ( List < NewPsmWithFdr > h , string s ) => WritePsmsToTsv ( h , OutputFolder , "aggregate" + s ) , null , false , MaxMissedCleavages , MaxModificationIsoforms , true , lp , binTolInDaltons , initiatorMethionineBehavior ) . Run ( ) ;
254
+ myGPTMDresults . AddResultText ( analysisResults ) ;
261
255
}
262
256
263
- var gptmdEngine = new GptmdEngine ( analysisResults . AllResultingIdentifications [ 0 ] , IsotopeErrors , gptmdModifications , combos , PrecursorMassTolerance ) ;
264
- var gptmdResults = ( GptmdResults ) gptmdEngine . Run ( ) ;
265
-
266
- //output(gptmdResults.ToString());
257
+ var gptmdResults = ( GptmdResults ) new GptmdEngine ( analysisResults . AllResultingIdentifications [ 0 ] , IsotopeErrors , gptmdModifications , combos , PrecursorMassTolerance ) . Run ( ) ;
258
+ myGPTMDresults . AddResultText ( gptmdResults ) ;
267
259
268
260
string outputXMLdbFullName = Path . Combine ( OutputFolder , string . Join ( "-" , dbFilenameList . Select ( b => Path . GetFileNameWithoutExtension ( b . FileName ) ) ) + "GPTMD.xml" ) ;
269
261
270
262
WriteXmlDatabase ( gptmdResults . Mods , proteinList . Where ( b => ! b . IsDecoy ) . ToList ( ) , outputXMLdbFullName ) ;
271
263
272
264
SucessfullyFinishedWritingFile ( outputXMLdbFullName ) ;
273
265
274
- // TODO: Fix so not always outputting a contaminant
275
266
myGPTMDresults . newDatabases . Add ( new DbForTask ( outputXMLdbFullName , false ) ) ;
276
267
277
268
return myGPTMDresults ;
0 commit comments