Program: 180522
Project: 180522
Buggy source:
private static void extractSigs(String infile) throws Exception {
  HMMPfam hmmpfam=new HMMPfam();
  File model=Helper.deployFile(ResourceManager.class.getResourceAsStream("String_Node_Str"));
  hmmpfam.run(0.00001,model,new File(infile));
  List<QueryResult> res=hmmpfam.getResults();
  ADomain cur_adom=null;
  for (  QueryResult qr : res) {
    List<DomainHit> hits=qr.getHits();
    List<DomainAlignment> alis=qr.getAlignments();
    int N=hits.size();
    for (int i=0; i < N; i+=2) {
      DomainAlignment adom=alis.get(i);
      DomainHit adom_hit=hits.get(i);
      String a_topline=adom.target;
      String a_downline=adom.query;
      String l_topline="String_Node_Str";
      String l_downline="String_Node_Str";
      if ((i + 1) < alis.size()) {
        DomainAlignment lys=alis.get(i + 1);
        l_topline=lys.target;
        l_downline=lys.query;
      }
      ADomSigExtractor e=new ADomSigExtractor();
      e.setADomainTopline(a_topline);
      e.setADomainDownline(a_downline);
      e.setLysDomainTopline(l_topline);
      e.setLysDomainDownline(l_downline);
      e.run();
      cur_adom=new ADomain();
      cur_adom.sig8a=e.get8ASignature();
      cur_adom.sigstach=e.getStachelhausCode();
      cur_adom.sid=qr.getQueryId();
      cur_adom.startPos=adom_hit.seqfrom;
      cur_adom.endPos=adom_hit.seqto;
      cur_adom.pfamscore=adom_hit.score;
      adoms.add(cur_adom);
    }
  }
}

Fixed version (ground truth):
private static void extractSigs(String infile) throws Exception {
  HMMPfam hmmpfam=new HMMPfam();
  File model=Helper.deployFile(ResourceManager.class.getResourceAsStream("String_Node_Str"));
  hmmpfam.run(evalue,model,new File(infile));
  List<QueryResult> res=hmmpfam.getResults();
  ADomain cur_adom=null;
  for (  QueryResult qr : res) {
    List<DomainHit> hits=qr.getHits();
    List<DomainAlignment> alis=qr.getAlignments();
    int N=hits.size();
    List<DomainHit> a_hits=new ArrayList<DomainHit>();
    List<DomainAlignment> a_alis=new ArrayList<DomainAlignment>();
    List<DomainHit> l_hits=new ArrayList<DomainHit>();
    List<DomainAlignment> l_alis=new ArrayList<DomainAlignment>();
    for (int i=0; i < N; i++) {
      DomainHit hit=hits.get(i);
      DomainAlignment ali=alis.get(i);
      if (hit.hmmname.equals("String_Node_Str")) {
        a_alis.add(ali);
        a_hits.add(hit);
      }
      if (hit.hmmname.equals("String_Node_Str")) {
        l_alis.add(ali);
        l_hits.add(hit);
      }
    }
    int A=a_hits.size();
    int L=l_hits.size();
    Map<Integer,Integer> aIdx2lIdx=new HashMap<Integer,Integer>();
    int J=0;
    for (int i=0; i < A; i++) {
      DomainHit adom_hit=a_hits.get(i);
      int Aend=adom_hit.seqto;
      for (int j=J; j < L; j++) {
        DomainHit lys_hit=l_hits.get(j);
        int Lstart=lys_hit.seqfrom;
        if ((Aend + 200) > Lstart && (Aend < Lstart)) {
          debug("String_Node_Str" + i + "String_Node_Str"+ j);
          aIdx2lIdx.put(i,j);
          J++;
          break;
        }
      }
    }
    for (int i=0; i < A; i++) {
      DomainHit adom_hit=a_hits.get(i);
      DomainAlignment adom_ali=a_alis.get(i);
      DomainAlignment ldom_ali=null;
      Integer mIdx=aIdx2lIdx.get(i);
      if (mIdx != null) {
        ldom_ali=l_alis.get(aIdx2lIdx.get(i));
      }
      ADomSigExtractor e=new ADomSigExtractor();
      e.setADomain(adom_ali);
      e.setLDomain(ldom_ali);
      e.run();
      cur_adom=new ADomain();
      try {
        cur_adom.sig8a=e.get8ASignature();
        cur_adom.sigstach=e.getStachelhausCode();
      }
 catch (      Exception ex) {
        continue;
      }
      debug(cur_adom.sig8a + "String_Node_Str" + cur_adom.sigstach);
      cur_adom.sid=qr.getQueryId();
      cur_adom.startPos=adom_hit.seqfrom;
      cur_adom.endPos=adom_hit.seqto;
      cur_adom.pfamscore=adom_hit.score;
      adoms.add(cur_adom);
    }
  }
}