示例#1
0
static t_hackblock *get_hackblocks(t_atoms *pdba, int nah, t_hackblock ah[],
				   int nterpairs,
				   t_hackblock **ntdb, t_hackblock **ctdb, 
				   int *rN, int *rC)
{
  int i,rnr;
  t_hackblock *hb,*ahptr;

  /* make space */
  snew(hb,pdba->nres);
  /* first the termini */
  for(i=0; i<nterpairs; i++) {
    if (ntdb[i] != NULL) {
      copy_t_hackblock(ntdb[i], &hb[rN[i]]);
    }
    if (ctdb[i] != NULL) {
      merge_t_hackblock(ctdb[i], &hb[rC[i]]);
    }
  }
  /* then the whole hdb */
  for(rnr=0; rnr < pdba->nres; rnr++) {
    ahptr=search_h_db(nah,ah,*pdba->resinfo[rnr].rtp);
    if ( ahptr ) {
      if (hb[rnr].name==NULL) {
	    hb[rnr].name=strdup(ahptr->name);
      }
      merge_hacks(ahptr, &hb[rnr]);
    }
  }
  return hb;
}
示例#2
0
void merge_t_hackblock(t_hackblock *s, t_hackblock *d)
{
    merge_hacks(s, d);
    merge_t_bondeds(s->rb, d->rb, FALSE, FALSE);
}