public PeptideCollection getNonIndeterminents() { PeptideCollection pc = new PeptideCollection(); for (PeptideHit p : peptideHits) { if (!p.isIndeterminate()) { pc.addPeptideHit(p); } } return pc; }
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); } }
public PeptideCollection filterByProteinCoverage(int minCoverage) { HashSet<String> proDiscard = new HashSet<String>(); for (String pName : minProteins.keySet()) { Protein p = minProteins.get(pName); if (p.getCoveragePercent() < minCoverage) { proDiscard.add(pName); } } PeptideCollection new_pc = new PeptideCollection(); for (PeptideHit ph : peptideHits) { new_pc.addPeptideHit(ph.maskProtein(proDiscard)); } new_pc.createProteinList(); return new_pc; }
public PeptideCollection filterByPeptidePerProtein(int numPeps) { HashSet<String> proDiscard = new HashSet<String>(); for (String pName : minProteins.keySet()) { Protein p = minProteins.get(pName); if (p.getNumUniquePeptides() < numPeps) { proDiscard.add(pName); } } PeptideCollection new_pc = new PeptideCollection(); for (PeptideHit ph : peptideHits) { new_pc.addPeptideHit(ph.maskProtein(proDiscard)); } new_pc.createProteinList(); return new_pc; }
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 PeptideCollection getCutoffCollection(double omssa, double mascot, double xtandem) { // return getCutoffCollection(omssa, mascot, xtandem, false); // } public PeptideCollection getCutoffCollection(FilterSettings fs) { PeptideCollection pc = new PeptideCollection(); for (PeptideHit p : peptideHits) { if (fs.getUsePepProphet() && p.isPepXML()) { if (p.getPepProphet() >= fs.getPeptideProphetCutoff()) { pc.addPeptideHit(p); } } else { switch (p.getSourceType()) { case MASCOT: if (fs.getUseIonIdent()) { if (p.getIonScore() >= p.getIdent()) { pc.addPeptideHit(p); } } else if (p.getExpect() <= fs.getMascotCutoff()) { pc.addPeptideHit(p); } break; case OMSSA: if (p.getExpect() <= fs.getOmssaCutoff()) { pc.addPeptideHit(p); } break; case XTANDEM: if (p.getExpect() <= fs.getXtandemCutoff()) { pc.addPeptideHit(p); } break; case SEQUEST: if (p.getExpect() <= fs.getSequestCutoff()) { pc.addPeptideHit(p); } break; case PEPXML: if (!p.CanGetPepProphet() || (p.getPepProphet() >= fs.getPeptideProphetCutoff())) { pc.addPeptideHit(p); } break; } } } return pc; }