peptideAssumptions.get(p).get(proteinMax).get(nSE).get(-1.0).put(-1.0, assumptions);
} else {
HashMap<Ion.IonType, HashSet<Integer>> iontypes = annotationPreferences.getIonTypes();
NeutralLossesMap neutralLosses = annotationPreferences.getNeutralLosses();
ArrayList<Integer> charges = annotationPreferences.getValidatedCharges();
MSnSpectrum spectrum = (MSnSpectrum) spectrumFactory.getSpectrum(spectrumKey);
double mzTolerance = searchParameters.getFragmentIonAccuracy();
boolean isPpm = false; //@TODO change this as soon as search engine support fragment ion tolerance in ppm
if (peptideAssumptions.get(p).get(proteinMax).get(nSE).containsKey(-1.0)) {
ArrayList<PeptideAssumption> assumptions = peptideAssumptions.get(p).get(proteinMax).get(nSE).get(-1.0).get(-1.0);
PeptideAssumption tempAssumption = assumptions.get(0);
Peptide peptide = tempAssumption.getPeptide();
int precursorCharge = tempAssumption.getIdentificationCharge().value;
annotationPreferences.setCurrentSettings(tempAssumption, true, sequenceMatchingPreferences);
double nIons = spectrumAnnotator.getCoveredAminoAcids(iontypes, neutralLosses, charges, precursorCharge,
spectrum, peptide, 0, mzTolerance, isPpm, annotationPreferences.isHighResolutionAnnotation()).keySet().size();
double coverage = nIons / peptide.getSequence().length();
peptideAssumptions.get(p).get(proteinMax).get(nSE).put(coverage, new HashMap<Double, ArrayList<PeptideAssumption>>());
peptideAssumptions.get(p).get(proteinMax).get(nSE).get(coverage).put(-1.0, assumptions);
peptideAssumptions.get(p).get(proteinMax).get(nSE).remove(-1.0);
}
Peptide peptide = peptideAssumption1.getPeptide();
int precursorCharge = peptideAssumption1.getIdentificationCharge().value;
annotationPreferences.setCurrentSettings(peptideAssumption1, true, sequenceMatchingPreferences);
double nIons = spectrumAnnotator.getCoveredAminoAcids(iontypes, neutralLosses, charges, precursorCharge,
spectrum, peptide, 0, mzTolerance, isPpm, annotationPreferences.isHighResolutionAnnotation()).keySet().size();
double coverage = nIons / peptide.getSequence().length();
HashMap<Double, ArrayList<PeptideAssumption>> coverageMap = peptideAssumptions.get(p).get(proteinMax).get(nSE).get(coverage);
if (coverageMap == null) {
coverageMap = new HashMap<Double, ArrayList<PeptideAssumption>>();
ArrayList<PeptideAssumption> assumptions = new ArrayList<PeptideAssumption>();
assumptions.add(peptideAssumption1);
coverageMap.put(-1.0, assumptions);
peptideAssumptions.get(p).get(proteinMax).get(nSE).put(coverage, coverageMap);
} else {
ArrayList<PeptideAssumption> assumptions = coverageMap.get(-1.0);
if (assumptions != null) {
PeptideAssumption tempAssumption = assumptions.get(0);
double massError = Math.abs(tempAssumption.getDeltaMass(spectrum.getPrecursor().getMz(), searchParameters.isPrecursorAccuracyTypePpm()));
peptideAssumptions.get(p).get(proteinMax).get(nSE).get(coverage).put(massError, assumptions);
peptideAssumptions.get(p).get(proteinMax).get(nSE).get(coverage).remove(-1.0);
}
double massError = Math.abs(peptideAssumption1.getDeltaMass(spectrum.getPrecursor().getMz(), searchParameters.isPrecursorAccuracyTypePpm()));
assumptions = coverageMap.get(massError);
if (assumptions == null) {
assumptions = new ArrayList<PeptideAssumption>();
coverageMap.put(massError, assumptions);