/**
   * Get the number of peptides.
   *
   * @return int the count of entries
   */
  public int getNumberOfPeptides() {
    int cnt = 0;
    // gel free
    Collection<IndexElement> gelFreePeptides =
        indexer.getIndexElements(PrideXmlXpath.GELFREE_PEPTIDE.getXpath());
    cnt += gelFreePeptides == null ? 0 : gelFreePeptides.size();
    // two dim
    Collection<IndexElement> twoDimPeptides =
        indexer.getIndexElements(PrideXmlXpath.TWOD_PEPTIDE.getXpath());
    cnt += twoDimPeptides == null ? 0 : twoDimPeptides.size();

    return cnt;
  }
  private Map<String, List<IndexElement>> initPeptideCacheMap() {
    // 1. create a empty identification to peptide mapping map
    Map<String, List<IndexElement>> identPeptideMap =
        new LinkedHashMap<String, List<IndexElement>>();
    // 2. get all gel free peptide index element
    Collection<IndexElement> gelFreePeptideElements =
        indexer.getIndexElements(PrideXmlXpath.GELFREE_PEPTIDE.getXpath());
    // 3. iterate over each gel free peptide index element
    for (IndexElement gelFreePeptideElement : gelFreePeptideElements) {
      String identId = searchForId(gelFreePeptideElement, gelFreeAccMap);
      addIdentPeptide(identId, gelFreePeptideElement, identPeptideMap);
    }
    // 4. get all two dimensional peptide index element
    Collection<IndexElement> twoDimPeptideElements =
        indexer.getIndexElements(PrideXmlXpath.TWOD_PEPTIDE.getXpath());
    // 5. iterate over each peptide index element
    for (IndexElement twoDimPeptideElement : twoDimPeptideElements) {
      String identId = searchForId(twoDimPeptideElement, twoDimAccMap);
      addIdentPeptide(identId, twoDimPeptideElement, identPeptideMap);
    }

    return identPeptideMap;
  }