Esempio n. 1
0
  public PeptideCollection getNonIndeterminents() {
    PeptideCollection pc = new PeptideCollection();

    for (PeptideHit p : peptideHits) {
      if (!p.isIndeterminate()) {
        pc.addPeptideHit(p);
      }
    }
    return pc;
  }
Esempio n. 2
0
 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);
   }
 }
Esempio n. 3
0
 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;
 }
Esempio n. 4
0
 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;
 }
Esempio n. 5
0
  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);
      }
    }
  }
Esempio n. 6
0
  //    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;
  }