[gmx-developers] Coordinate scaling in pdbio.c

Radhakrishna Bettadapura brrk at utexas.edu
Mon Apr 9 21:45:33 CEST 2012


All,

I'm trying to figure out why a pdb input to pdb2gmx results in coordinates that are scaled by a factor of 0.1. That is, if a line in the PDB file reads


ATOM      1  N   ALA B   3      -1.221  20.481  12.450  1.00 34.64           N

then the corresponding line in the .gro file reads 


 3ALA      N    1  -0.122   2.048   1.245

The culprit seems to be the following lines in pdbio.c:

static int read_atom(t_symtab *symtab,
		     char line[],int type,int natom,
		     t_atoms *atoms,rvec x[],int chainnum,gmx_bool bChange)
{

// do stuff

 x[natom][XX]=strtod(xc,NULL)*0.1; /*all coordinates scaled by 0.1... why?*/
  x[natom][YY]=strtod(yc,NULL)*0.1;
  x[natom][ZZ]=strtod(zc,NULL)*0.1;

//do  more stuff

}


There's also a line in the output function that multiplies all incoming coordinates by 10 before writing it to output:

void write_pdbfile_indexed(FILE *out,const char *title,
			   t_atoms *atoms,rvec x[],
			   int ePBC,matrix box,char chainid,
			   int model_nr, atom_id nindex, atom_id index[],
			   gmx_conect conect, gmx_bool bTerSepChains)
{


//do stuff...


fprintf(out,pdbform,pdbtp[type],(i+1)%100000,nm,resnm,ch,resnr,
	    (resic == '\0') ? ' ' : resic,
	    10*x[i][XX],10*x[i][YY],10*x[i][ZZ],occup,bfac,atoms->atom[i].elem);
    
// do more stuff...

}


Can someone tell me why this coordinate scaling occurs?  And why the scale factor is a single hard-coded number than, say, something that depends on the input?


Radhakrishna Bettadapura
PhD candidate,
Dept. of Mechanical Engineering/Computational Visualization Center,
University of Texas at Austin
http://users.ices.utexas.edu/~brrk

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://maillist.sys.kth.se/pipermail/gromacs.org_gmx-developers/attachments/20120409/088b85be/attachment.html>


More information about the gromacs.org_gmx-developers mailing list