By adding protein-nterm and protein-cterm classes for atom
name translation in xlateat.dat we now avoid replacing
names such as O2 in non-standard amino acids. This patch
also corrects a cosmetic issue in the number of residues
claimed to be found in each chain by pdb2gmx.
Fixes #567.
Change-Id: I5956991e3ff3e5e1202330a857fd773f9e9b6945
-ILE CD1 CD
-ILE HD11 HD1
-ILE HD12 HD2
-ILE HD13 HD3
-HOH O OW
-HOH OW1 OW
-HO4 O OW
-HO4 OW1 OW
-HO5 O OW
-HO5 OW1 OW
-HEME N_A NA
-HEME N_B NB
-HEME N_C NC
-HEME N_D ND
-protein O1 O
-protein O2 OXT
-protein OT1 O
-protein OT2 OXT
-protein OT OXT
-protein O' O
-protein O'' OXT
-protein OC1 O
-protein OC2 OXT
-protein HN H
-protein HT1 H1
-protein HT2 H2
-protein HT3 H3
+ILE CD1 CD
+ILE HD11 HD1
+ILE HD12 HD2
+ILE HD13 HD3
+HOH O OW
+HOH OW1 OW
+HO4 O OW
+HO4 OW1 OW
+HO5 O OW
+HO5 OW1 OW
+HEME N_A NA
+HEME N_B NB
+HEME N_C NC
+HEME N_D ND
+protein HN H
+protein-nterm HT1 H1
+protein-nterm HT2 H2
+protein-nterm HT3 H3
+protein-cterm O1 O
+protein-cterm O2 OXT
+protein-cterm OT1 O
+protein-cterm OT2 OXT
+protein-cterm OT OXT
+protein-cterm O' O
+protein-cterm O'' OXT
+protein-cterm OC1 O
+protein-cterm OC2 OXT
printf("There are %d chains and %d blocks of water and "
"%d residues with %d atoms\n",
nch-nwaterchain, nwaterchain,
printf("There are %d chains and %d blocks of water and "
"%d residues with %d atoms\n",
nch-nwaterchain, nwaterchain,
- pdba_all.resinfo[pdba_all.atom[natom-1].resind].nr, natom);
printf("\n %5s %4s %6s\n", "chain", "#res", "#atoms");
for (i = 0; (i < nch); i++)
printf("\n %5s %4s %6s\n", "chain", "#res", "#atoms");
for (i = 0; (i < nch); i++)
char **f;
char c, *rnm, atombuf[32], *ptr0, *ptr1;
gmx_bool bReorderedNum, bRenamed, bMatch;
char **f;
char c, *rnm, atombuf[32], *ptr0, *ptr1;
gmx_bool bReorderedNum, bRenamed, bMatch;
+ gmx_bool bStartTerm, bEndTerm;
nxlate = 0;
xlatom = NULL;
nxlate = 0;
xlatom = NULL;
for (a = 0; (a < atoms->nr); a++)
{
resind = atoms->atom[a].resind;
for (a = 0; (a < atoms->nr); a++)
{
resind = atoms->atom[a].resind;
+
+ bStartTerm = (resind == 0) || atoms->resinfo[resind].chainnum != atoms->resinfo[resind-1].chainnum;
+ bEndTerm = (resind >= atoms->nres-1) || atoms->resinfo[resind].chainnum != atoms->resinfo[resind+1].chainnum;
+
if (bResname)
{
rnm = *(atoms->resinfo[resind].name);
if (bResname)
{
rnm = *(atoms->resinfo[resind].name);
{
/* Match the residue name */
bMatch = (xlatom[i].res == NULL ||
{
/* Match the residue name */
bMatch = (xlatom[i].res == NULL ||
+ (gmx_strcasecmp("protein-nterm", xlatom[i].res) == 0 &&
+ gmx_residuetype_is_protein(rt, rnm) && bStartTerm) ||
+ (gmx_strcasecmp("protein-cterm", xlatom[i].res) == 0 &&
+ gmx_residuetype_is_protein(rt, rnm) && bEndTerm) ||
(gmx_strcasecmp("protein", xlatom[i].res) == 0 &&
gmx_residuetype_is_protein(rt, rnm)) ||
(gmx_strcasecmp("DNA", xlatom[i].res) == 0 &&
(gmx_strcasecmp("protein", xlatom[i].res) == 0 &&
gmx_residuetype_is_protein(rt, rnm)) ||
(gmx_strcasecmp("DNA", xlatom[i].res) == 0 &&