@@ -77,10 +77,8 @@ protected override MyResults RunSpecific()
77
77
myTaskResults . newSpectra = new List < string > ( ) ;
78
78
var currentRawFileList = rawDataFilenameList ;
79
79
80
- var compactPeptideToProteinPeptideMatching = new Dictionary < CompactPeptide , HashSet < PeptideWithSetModifications > > ( ) ;
81
-
82
80
SearchMode searchMode ;
83
- searchMode = new SingleAbsoluteAroundZeroSearchMode ( "" , PrecursorMassToleranceInDaltons ) ;
81
+ searchMode = new SingleAbsoluteAroundZeroSearchMode ( PrecursorMassToleranceInDaltons ) ;
84
82
var searchModes = new List < SearchMode > { searchMode } ;
85
83
86
84
List < ParentSpectrumMatch > [ ] allPsms = new List < ParentSpectrumMatch > [ 1 ] ;
@@ -99,19 +97,21 @@ protected override MyResults RunSpecific()
99
97
100
98
Parallel . For ( 0 , currentRawFileList . Count , spectraFileIndex =>
101
99
{
100
+ var compactPeptideToProteinPeptideMatching = new Dictionary < CompactPeptide , HashSet < PeptideWithSetModifications > > ( ) ;
102
101
var origDataFileName = currentRawFileList [ spectraFileIndex ] ;
103
102
LocalMS2Scan [ ] listOfSortedms2Scans ;
104
103
IMsDataFile < IMzSpectrum < MzPeak > > myMsDataFile ;
105
104
lock ( myTaskResults )
106
105
{
106
+ StartingDataFile ( origDataFileName ) ;
107
107
Status ( "Loading spectra file " + origDataFileName + "..." ) ;
108
108
if ( Path . GetExtension ( origDataFileName ) . Equals ( ".mzML" ) )
109
109
myMsDataFile = new Mzml ( origDataFileName , MaxNumPeaksPerScan ) ;
110
110
else
111
111
myMsDataFile = new ThermoRawFile ( origDataFileName , MaxNumPeaksPerScan ) ;
112
112
Status ( "Opening spectra file " + origDataFileName + "..." ) ;
113
113
myMsDataFile . Open ( ) ;
114
- listOfSortedms2Scans = myMsDataFile . Where ( b => b . MsnOrder == 2 ) . Select ( b => new LocalMS2Scan ( b ) ) . OrderBy ( b => b . PrecursorMass ) . ToArray ( ) ;
114
+ listOfSortedms2Scans = GetMs2Scans ( myMsDataFile ) . OrderBy ( b => b . PrecursorMass ) . ToArray ( ) ;
115
115
}
116
116
117
117
var searchEngine = new ClassicSearchEngine ( listOfSortedms2Scans , myMsDataFile . NumSpectra , variableModifications , fixedModifications , proteinList , new Tolerance ( ToleranceUnit . Absolute , ProductMassToleranceInDaltons ) , Protease , searchModes , MaxMissedCleavages , MaxModificationIsoforms , myMsDataFile . Name ) ;
@@ -121,8 +121,6 @@ protected override MyResults RunSpecific()
121
121
for ( int i = 0 ; i < searchModes . Count ; i ++ )
122
122
allPsms [ i ] . AddRange ( searchResults . OuterPsms [ i ] ) ;
123
123
124
- lock ( myTaskResults )
125
- {
126
124
// Run analysis on single file results
127
125
var analysisEngine = new AnalysisEngine ( searchResults . OuterPsms , compactPeptideToProteinPeptideMatching , proteinList , variableModifications , fixedModifications , localizeableModifications , Protease , searchModes , myMsDataFile , new Tolerance ( ToleranceUnit . Absolute , ProductMassToleranceInDaltons ) , ( BinTreeStructure myTreeStructure , string s ) => WriteTree ( myTreeStructure , OutputFolder , Path . GetFileNameWithoutExtension ( origDataFileName ) + s ) , ( List < NewPsmWithFdr > h , string s ) => WritePsmsToTsv ( h , OutputFolder , Path . GetFileNameWithoutExtension ( origDataFileName ) + s ) , null , false , MaxMissedCleavages , MaxModificationIsoforms , false ) ;
128
126
@@ -158,12 +156,16 @@ protected override MyResults RunSpecific()
158
156
159
157
Status ( "Creating _indexedmzMLConnection, putting data in it, and writing!" ) ;
160
158
var path = Path . Combine ( OutputFolder , Path . GetFileNameWithoutExtension ( origDataFileName ) + "-Calibrated.mzML" ) ;
161
- MzmlMethods . CreateAndWriteMyIndexedMZmlwithCalibratedSpectra ( result . MyMSDataFile , path ) ;
159
+ lock ( myTaskResults )
160
+ {
161
+ MzmlMethods . CreateAndWriteMyIndexedMZmlwithCalibratedSpectra ( result . MyMSDataFile , path ) ;
162
162
163
- SucessfullyFinishedWritingFile ( path ) ;
163
+ SucessfullyFinishedWritingFile ( path ) ;
164
164
165
165
myTaskResults . newSpectra . Add ( path ) ;
166
166
}
167
+
168
+ FinishedDataFile ( origDataFileName ) ;
167
169
}
168
170
) ;
169
171
return myTaskResults ;
0 commit comments