[AMBER-Developers] antechamber vs. long atom names

From: Eric Pettersen <pett.cgl.ucsf.edu>
Date: Tue, 17 Jul 2012 14:48:18 -0700

If the Mol2 file that antechamber is given has long atom names (>4 characters) it coughs up a hairball. Maybe passes gas is the more appropriate simile since the failure is silent but leaves a bad stink behind. ;-) The problem is that the "PDB" input it prepares for the atomtype subprogram winds up with mis-aligned columns, so the coordinates wind up wrong. Oddly, the input preparation routine guards against long residue names but not long atom names. I've attached a patch file with a fix, and am also putting it inline as text in case the attachment is omitted by the mailing list, though I've cc'ed Dave so he at least should get it as an attachment.

Very skippable aside: so why long atom names? Chimera sometimes send adjacent residues as a group to antechamber and to guarantee atom name uniqueness in the new jumbo "residue" it adds characters to the atom names as needed.

--Eric

                        Eric Pettersen
                        UCSF Computer Graphics Lab
                        http://www.cgl.ucsf.edu



*** AmberTools/src/antechamber/ac.c 2012-03-06 10:26:49.000000000 -0800
--- AmberTools/src/antechamber/ac.c 2012-07-17 14:01:04.000000000 -0700
***************
*** 148,154 ****
          char form[5 * MAXCHAR];
          double fraction;
          double tmpf;
! char resname[10];
  
          FILE *fpout;
          if ((fpout = fopen(filename, "w")) == NULL) {
--- 148,154 ----
          char form[5 * MAXCHAR];
          double fraction;
          double tmpf;
! char resname[10], atomname[10];
  
          FILE *fpout;
          if ((fpout = fopen(filename, "w")) == NULL) {
***************
*** 199,204 ****
--- 199,213 ----
          formula(atomnum, atom, form);
          fprintf(fpout, "Formula: %s\n", form);
          for (i = 0; i < atomnum; i++) {
+ if(strlen(atom[i].name) > 4) {
+ atomname[0] = atom[i].name[0];
+ atomname[1] = atom[i].name[1];
+ atomname[2] = atom[i].name[2];
+ atomname[3] = atom[i].name[3];
+ atomname[4] = '\0';
+ }
+ else
+ strcpy(atomname, atom[i].name);
                  if(strlen(atom[i].aa) > 3) {
                          resname[0] = atom[i].aa[0];
                          resname[1] = atom[i].aa[1];
***************
*** 209,215 ****
                          strcpy(resname, atom[i].aa);
                  fprintf(fpout,
                                  "ATOM%7d %-4s%-4s%5d%12.3f%8.3f%8.3f%10.6lf%10s\n",
! i + 1, atom[i].name, resname, atom[i].resno, atom[i].x,
                                  atom[i].y, atom[i].z, atom[i].charge, atom[i].ambername);
          }
  
--- 218,224 ----
                          strcpy(resname, atom[i].aa);
                  fprintf(fpout,
                                  "ATOM%7d %-4s%-4s%5d%12.3f%8.3f%8.3f%10.6lf%10s\n",
! i + 1, atomname, resname, atom[i].resno, atom[i].x,
                                  atom[i].y, atom[i].z, atom[i].charge, atom[i].ambername);
          }
  

_______________________________________________
AMBER-Developers mailing list
AMBER-Developers.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber-developers
Received on Tue Jul 17 2012 - 15:00:02 PDT
Custom Search