public void computeIndeterminates() { HashMap<String, HashSet<PeptideHit>> scan2pep = new HashMap<String, HashSet<PeptideHit>>(); HashSet<PeptideHit> pepList; for (PeptideHit p : peptideHits) { String scan = p.getScanTuple(); if (scan2pep.containsKey(scan)) { pepList = scan2pep.get(scan); } else { pepList = new HashSet<PeptideHit>(); scan2pep.put(scan, pepList); } pepList.add(p); } for (HashSet<PeptideHit> pepSet : scan2pep.values()) { boolean indeterm = false; if (pepSet.size() > 1) { HashSet<String> pepSeqs = new HashSet<String>(); for (PeptideHit p : pepSet) { pepSeqs.add(p.getSequence()); } if (pepSeqs.size() > 1) indeterm = true; } for (PeptideHit p : pepSet) { p.setIndeterminate(indeterm); } } }
public void addPeptideHit(PeptideHit p) { if (p == null) { return; } peptideHits.add(p); experimentSet.add(p.getExperiment()); String key = p.getSequence(); if (minPeptides.containsKey(key)) { Peptide pg = minPeptides.get(key); pg.addPeptideHit(p); } else { Peptide pg = new Peptide(p); minPeptides.put(key, pg); } }