use of com.compomics.util.experiment.identification.protein_inference.PeptideAndProteinBuilder in project peptide-shaker by compomics.
the class PeptideShaker method attachSpectrumProbabilitiesAndBuildPeptidesAndProteins.
/**
* Attaches the spectrum posterior error probabilities to the spectrum
* matches and creates peptides and proteins.
*
* @param sequenceProvider a protein sequence provider
* @param sequenceMatchingPreferences the sequence matching preferences
* @param projectType the project type
* @param fastaParameters the FASTA parsing parameters
* @param waitingHandler the handler displaying feedback to the user
*/
private void attachSpectrumProbabilitiesAndBuildPeptidesAndProteins(SequenceProvider sequenceProvider, SequenceMatchingParameters sequenceMatchingPreferences, ProjectType projectType, FastaParameters fastaParameters, WaitingHandler waitingHandler) {
waitingHandler.setSecondaryProgressCounterIndeterminate(false);
waitingHandler.setMaxSecondaryProgressCounter(identification.getSpectrumIdentificationSize());
PeptideAndProteinBuilder peptideAndProteinBuilder = new PeptideAndProteinBuilder(identification);
identification.getSpectrumIdentification().values().stream().flatMap(keys -> keys.stream()).parallel().map(key -> identification.getSpectrumMatch(key)).forEach(spectrumMatch -> attachSpectrumProbabilitiesAndBuildPeptidesAndProteins(spectrumMatch, peptideAndProteinBuilder, sequenceProvider, sequenceMatchingPreferences, projectType, fastaParameters, waitingHandler));
waitingHandler.setSecondaryProgressCounterIndeterminate(true);
}
Aggregations