protected override bool LoadBackground(IDocumentContainer container, SrmDocument document, SrmDocument docCurrent) { if (!FastaImporter.HasWebAccess()) // Do we even have web access? { EndProcessing(container.Document); return(false); // Return silently rather than flashing the progress bar } SrmDocument docNew, docOrig; do { docOrig = container.Document; var loadMonitor = new LoadMonitor(this, container, docOrig); docNew = LookupProteinMetadata(docOrig, loadMonitor); if (null == docNew) { EndProcessing(docOrig); return(false); } } while (!CompleteProcessing(container, docNew, docOrig)); CleanupProcessedNodesDict(docNew); // Drop any completed work, we're done with it return(true); }
protected override bool LoadBackground(IDocumentContainer container, SrmDocument document, SrmDocument docCurrent) { var loadMonitor = new LoadMonitor(this, container, container.Document); IPeakScoringModel scoringModel = new MProphetPeakScoringModel( Path.GetFileNameWithoutExtension(container.DocumentFilePath), null as LinearModelParams, MProphetPeakScoringModel.GetDefaultCalculators(docCurrent), true); var targetDecoyGenerator = new TargetDecoyGenerator(docCurrent, scoringModel, this, loadMonitor); // Get scores for target and decoy groups. List <IList <float[]> > targetTransitionGroups, decoyTransitionGroups; targetDecoyGenerator.GetTransitionGroups(out targetTransitionGroups, out decoyTransitionGroups); if (!decoyTransitionGroups.Any()) { throw new InvalidDataException(); } // Set intial weights based on previous model (with NaN's reset to 0) var initialWeights = new double[scoringModel.PeakFeatureCalculators.Count]; // But then set to NaN the weights that have unknown values for this dataset for (var i = 0; i < initialWeights.Length; ++i) { if (!targetDecoyGenerator.EligibleScores[i]) { initialWeights[i] = double.NaN; } } var initialParams = new LinearModelParams(initialWeights); // Train the model. scoringModel = scoringModel.Train(targetTransitionGroups, decoyTransitionGroups, targetDecoyGenerator, initialParams, null, null, scoringModel.UsesSecondBest, true, loadMonitor); SrmDocument docNew; do { docCurrent = container.Document; docNew = docCurrent.ChangeSettings(docCurrent.Settings.ChangePeptideIntegration(i => i.ChangeAutoTrain(false).ChangePeakScoringModel((PeakScoringModelSpec)scoringModel))); // Reintegrate peaks var resultsHandler = new MProphetResultsHandler(docNew, (PeakScoringModelSpec)scoringModel, _cachedFeatureScores); resultsHandler.ScoreFeatures(loadMonitor); if (resultsHandler.IsMissingScores()) { throw new InvalidDataException(Resources.ImportPeptideSearchManager_LoadBackground_The_current_peak_scoring_model_is_incompatible_with_one_or_more_peptides_in_the_document_); } docNew = resultsHandler.ChangePeaks(loadMonitor); }while (!CompleteProcessing(container, docNew, docCurrent)); return(true); }
protected override bool LoadBackground(IDocumentContainer container, SrmDocument document, SrmDocument docCurrent) { SrmDocument docNew, docOrig; do { docOrig = container.Document; var loadMonitor = new LoadMonitor(this, container, docOrig); docNew = DocumentRetentionTimes.RecalculateAlignments(docOrig, loadMonitor); if (null == docNew) { EndProcessing(docOrig); return false; } } while (!CompleteProcessing(container, docNew, docOrig)); return true; }
protected override bool LoadBackground(IDocumentContainer container, SrmDocument document, SrmDocument docCurrent) { SrmDocument docNew, docOrig; do { docOrig = container.Document; var loadMonitor = new LoadMonitor(this, container, docOrig); docNew = DocumentRetentionTimes.RecalculateAlignments(docOrig, loadMonitor); if (null == docNew) { EndProcessing(docOrig); return(false); } }while (!CompleteProcessing(container, docNew, docOrig)); return(true); }
public void Load() { string documentFilePath = _container.DocumentFilePath; if (documentFilePath == null) { return; } var results = _docCurrent.Settings.MeasuredResults; if (results.IsLoaded) { return; } var loadMonitor = new LoadMonitor(_manager, _container, results) { HasUI = _manager.SupportAllGraphs }; results.Load(_docCurrent, documentFilePath, loadMonitor, FinishLoad); }
public void Load() { string documentFilePath = _container.DocumentFilePath; if (documentFilePath == null) return; var results = _docCurrent.Settings.MeasuredResults; if (results.IsLoaded) return; var loadMonitor = new LoadMonitor(_manager, _container, results) {HasUI = _manager.SupportAllGraphs}; results.Load(_docCurrent, documentFilePath, loadMonitor, FinishLoad); }
protected override bool LoadBackground(IDocumentContainer container, SrmDocument document, SrmDocument docCurrent) { if (!FastaImporter.HasWebAccess()) // Do we even have web access? return false; // Return silently rather than flashing the progress bar SrmDocument docNew, docOrig; do { docOrig = container.Document; var loadMonitor = new LoadMonitor(this, container, docOrig); docNew = LookupProteinMetadata(docOrig, loadMonitor); if (null == docNew) { EndProcessing(docOrig); return false; } } while (!CompleteProcessing(container, docNew, docOrig)); CleanupProcessedNodesDict(docNew); // Drop any completed work, we're done with it return true; }