Skip to content

Commit

Permalink
Don't overwrite progress with made up numbers.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mailaender committed Oct 5, 2023
1 parent 61aa7e9 commit 76dee6f
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ public class FileIdentifier {

public IMassSpectra runIdentification(List<IScanMSD> massSpectraList, ILibraryIdentifierSettings fileIdentifierSettings, IProgressMonitor monitor) throws FileNotFoundException {

SubMonitor subMonitor = SubMonitor.convert(monitor, "Running mass spectra identification", 100);
/*
* Pre-filter the mass spectra to identify.
*/
Expand All @@ -91,10 +90,9 @@ public IMassSpectra runIdentification(List<IScanMSD> massSpectraList, ILibraryId
* Load the mass spectra database only if the raw file or its content has changed.
*/
List<String> files = extractFiles(fileIdentifierSettings.getMassSpectraFiles());
Map<String, IMassSpectra> databases = databasesCache.getDatabases(files, subMonitor.split(10));
subMonitor.setWorkRemaining(databases.size() * 100);
Map<String, IMassSpectra> databases = databasesCache.getDatabases(files, monitor);
for(Map.Entry<String, IMassSpectra> database : databases.entrySet()) {
compareMassSpectraAgainstDatabase(massSpectra.getList(), database.getValue().getList(), fileIdentifierSettings, identifier, database.getKey(), subMonitor.split(100, SubMonitor.SUPPRESS_NONE));
compareMassSpectraAgainstDatabase(massSpectra.getList(), database.getValue().getList(), fileIdentifierSettings, identifier, database.getKey(), monitor);
}
//
return massSpectra;
Expand All @@ -112,7 +110,6 @@ public IMassSpectra runIdentification(List<IScanMSD> massSpectraList, ILibraryId
*/
public IPeakIdentificationResults runPeakIdentification(List<? extends IPeakMSD> peaks, PeakIdentifierSettings peakIdentifierSettings, IProcessingInfo<?> processingInfo, IProgressMonitor monitor) throws FileNotFoundException {

SubMonitor subMonitor = SubMonitor.convert(monitor, "Running mass spectra identification", 100);
/*
* Pre-filter the mass spectra to identify.
*/
Expand All @@ -138,10 +135,9 @@ public IPeakIdentificationResults runPeakIdentification(List<? extends IPeakMSD>
* Load the mass spectra database only if the raw file or its content has changed.
*/
List<String> files = extractFiles(peakIdentifierSettings.getMassSpectraFiles());
Map<String, IMassSpectra> databases = databasesCache.getDatabases(files, subMonitor.split(10));
subMonitor.setWorkRemaining(databases.size() * 100);
Map<String, IMassSpectra> databases = databasesCache.getDatabases(files, monitor);
for(Map.Entry<String, IMassSpectra> database : databases.entrySet()) {
comparePeaksAgainstDatabase(peaksToIdentify, database.getValue().getList(), peakIdentifierSettings, identifier, database.getKey(), subMonitor.split(100, SubMonitor.SUPPRESS_NONE));
comparePeaksAgainstDatabase(peaksToIdentify, database.getValue().getList(), peakIdentifierSettings, identifier, database.getKey(), monitor);
}
//
return identificationResults;
Expand Down

0 comments on commit 76dee6f

Please sign in to comment.