Beispiel #1
0
  /**
   * Get the overlap between two HmmerResult objects
   *
   * @param other
   * @return 0 if no overlap, otherwise the length of the overlap
   */
  public int getOverlapLength(HmmerResult other) {

    int overlap = 0;
    for (HmmerDomain d1 : getDomains()) {
      for (HmmerDomain d2 : other.getDomains()) {
        overlap += getOverlap(d1, d2);
      }
    }
    return overlap;
  }
Beispiel #2
0
  @Override
  public int compareTo(HmmerResult o) {
    // 	sort  by the start position of the first domain

    if (emptyDomains(this) && emptyDomains(o)) {
      return 0;
    }

    if (!emptyDomains(this) && emptyDomains(o)) return -1;

    if (emptyDomains(this) && (!emptyDomains(o))) return 1;

    // ok when we are here, both domains are not empty

    HmmerDomain me = this.getDomains().first();
    HmmerDomain other = o.getDomains().first();

    // System.out.println(" domains: " + me.getHmmAcc() + " " + other.getHmmAcc()+ " " +
    // me.getSqFrom().compareTo(other.getSqFrom()));

    return (me.getSqFrom().compareTo(other.getSqFrom()));
  }
Beispiel #3
0
 private boolean emptyDomains(HmmerResult o) {
   if (o.getDomains() == null || o.getDomains().size() == 0) return true;
   return false;
 }