Esempio n. 1
0
  /*the sequence evidences must be sorted on :
  1. best_confidence
  2. #psms
  3. #assays
  4. sequence length

  */
  @Override
  public int compareTo(Object o) {
    if (o instanceof PeptideEvidence) {
      PeptideEvidence other = (PeptideEvidence) o;
      if (other.getBestPEP() > this.getBestPEP()) {
        return -1;
      } else if (other.getBestPEP() < this.getBestPEP()) {
        return 1;
      } else {
        if (other.getTotalPSMCount() > this.getTotalPSMCount()) {
          return -1;
        } else if (other.getTotalPSMCount() < this.getTotalPSMCount()) {
          return 1;
        } else {
          if (other.getAssayCount().size() > this.getAssayCount().size()) {
            return -1;
          } else if (other.getAssayCount().size() < this.getAssayCount().size()) {
            return 1;
          } else {
            if (other.getSequence().length() < this.getSequence().length()) {
              return -1;
            } else if (other.getSequence().length() > this.getSequence().length()) {
              return 1;
            } else {
              return 0;
            }
          }
        }
      }
    } else {
      return -1;
    }
  }