Project

General

Profile

Bug #366

genconf fails to renumber residues

Added by Peter Kasson about 10 years ago. Updated about 10 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Erik Lindahl
Category:
analysis tools
Target version:
Affected version - extra info:
Affected version:
Difficulty:
uncategorized
Close

Description

Sometime after 4.0 release, the genconf -renumber functionality seems to have broken. I have a genconf binary dated 2008-11-09 (not sure when the source was, but the description line is a 4.0 release) that works; both git-current and CVS current fail.

The relevant CVS diff is attached. ===================================================================
RCS file: /home/gmx/cvs/gmx/src/tools/gmx_genconf.c,v
retrieving revision 1.2
retrieving revision 1.4
diff w -r1.2 -r1.4
2c2
< * $Id: gmx_genconf.c,v 1.2 2008/03/11 08:41:15 hess Exp $
--

  • $Id: gmx_genconf.c,v 1.4 2009/03/06 10:48:15 hess Exp $

69c69
< fprintf(stderr,"center of mass: %f, %f, %f\n",xcm0,xcm1,xcm2);
---

fprintf(stderr,"center of geometry: %f, %f, %f\n",xcm0,xcm1,xcm2);

73c73
< phi=M_PI*max_rot[m]*rando(seed)/180;
---

phi=M_PI*max_rot[m]*(2*rando(seed) - 1)/180;

78c78,81
< mult_matrix(mtemp1,mt2,mr[XX]);
---

/* For mult_matrix we need to multiply in the opposite order
  • compared to normal mathematical notation.
    */
    mult_matrix(mtemp1,mt1,mr[XX]);

81c84
< mult_matrix(mxtot,mtemp3,mt1);
---

mult_matrix(mxtot,mtemp3,mt2);

155c158
< static rvec max_rot = {90,90,90}; /* maximum rotation */
---

static rvec max_rot = {180,180,180}; /* maximum rotation */

211a215,219

} else {
snew(xx,natoms);
for(i=0; i<natoms; i++) {
copy_rvec(x[i],xx[i]);
}

227,228d234
< if ((ndx >= 0) || (bTRX)) {
<
231c237
< rand_rot(natoms,bTRX ? xx : x,v,xrot,vrot,&seed,max_rot);
---

rand_rot(natoms,xx,v,xrot,vrot,&seed,max_rot);

240c246
< x[ndx+l][m] = (bTRX ? xx[l][m] : x[l][m]);
---

x[ndx+l][m] = xx[l][m];

254c260
< atoms->atom[ndx+l].resnr=(bRenum ? nrdx:0) + atoms->atom[l].resnr;
---

atoms->atom[ndx+l].resind = nrdx + atoms->atom[l].resind;

258,259c264,268
< for(l=0; (l<nres); l++)
< atoms->resname[nrdx+l]=atoms->resname[l];
---

for(l=0; (l<nres); l++) {
atoms->resinfo[nrdx+l] = atoms->resinfo[l];
if (bRenum)
atoms->resinfo[nrdx+l].nr += nrdx;
}

267d275
< }

History

#1 Updated by Peter Kasson about 10 years ago

Fixed this in the git master by adding code to renumber residues explicitly. There's a bit of redundancy in the code now, but the functionality is restored.

Also available in: Atom PDF