public void appendProteins(Appendable out) {
    try {
      List<String> proteins = new ArrayList<String>(proteinToHits.keySet());
      Collections.sort(proteins);
      for (String protein : proteins) {
        Set<IdentifiedPSM> pps = proteinToHits.get(protein);
        List<IdentifiedPSM> psms = new ArrayList<IdentifiedPSM>(pps);
        Collections.sort(psms);

        out.append(protein);
        for (IdentifiedPSM psm : psms) {
          out.append("\t");
          IPolypeptide unModified = psm.getPeptide(); // .getUnModified();
          out.append(unModified.toString());
          out.append("\t");
          out.append(psm.getId());
        }
        out.append("\n");
      }
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }