*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018,2019, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
case efENT:
case efPQR:
out = gmx_fio_fopen(outfile, "w");
- write_pdbfile_indexed(out, title, atoms, x, ePBC, box, ' ', -1, nindex, index, nullptr, TRUE, ftp == efPQR);
+ write_pdbfile_indexed(out, title, atoms, x, ePBC, box, ' ', -1, nindex, index, nullptr, ftp == efPQR);
gmx_fio_fclose(out);
break;
case efESP:
case efBRK:
case efENT:
out = gmx_fio_fopen(outfile, "w");
- write_pdbfile(out, title, atoms, x, ePBC, box, ' ', -1, nullptr, TRUE);
+ write_pdbfile(out, title, atoms, x, ePBC, box, ' ', -1, nullptr);
gmx_fio_fclose(out);
break;
case efESP:
const t_atoms *atoms, const rvec x[],
int ePBC, const matrix box, char chainid,
int model_nr, int nindex, const int index[],
- gmx_conect conect, gmx_bool bTerSepChains,
+ gmx_conect conect,
bool usePqrFormat)
{
gmx_conect_t *gc = static_cast<gmx_conect_t *>(conect);
fprintf(out, "MODEL %8d\n", model_nr > 0 ? model_nr : 1);
- int lastchainnum = -1;
- std::string prevRestype;
- std::string lastRestype;
-
ResidueType rt;
for (int ii = 0; ii < nindex; ii++)
{
- int i = index[ii];
- int resind = atoms->atom[i].resind;
- int chainnum = atoms->resinfo[resind].chainnum;
- lastRestype = prevRestype;
- prevRestype = rt.typeNameForIndexedResidue(*atoms->resinfo[resind].name);
-
- /* Add a TER record if we changed chain, and if either the previous or this chain is protein/DNA/RNA. */
- if (bTerSepChains && ii > 0 && chainnum != lastchainnum)
- {
- /* Only add TER if the previous chain contained protein/DNA/RNA. */
- if (rt.namedResidueHasType(lastRestype, "Protein") ||
- rt.namedResidueHasType(lastRestype, "DNA") ||
- rt.namedResidueHasType(lastRestype, "RNA"))
- {
- fprintf(out, "TER\n");
- }
- lastchainnum = chainnum;
- }
-
- std::string resnm = *atoms->resinfo[resind].name;
- std::string nm = *atoms->atomname[i];
+ int i = index[ii];
+ int resind = atoms->atom[i].resind;
+ std::string resnm = *atoms->resinfo[resind].name;
+ std::string nm = *atoms->atomname[i];
/* rename HG12 to 2HG1, etc. */
nm = xlate_atomname_gmx2pdb(nm);
}
void write_pdbfile(FILE *out, const char *title, const t_atoms *atoms, const rvec x[],
- int ePBC, const matrix box, char chainid, int model_nr, gmx_conect conect, gmx_bool bTerSepChains)
+ int ePBC, const matrix box, char chainid, int model_nr, gmx_conect conect)
{
int i, *index;
index[i] = i;
}
write_pdbfile_indexed(out, title, atoms, x, ePBC, box, chainid, model_nr,
- atoms->nr, index, conect, bTerSepChains, false);
+ atoms->nr, index, conect, false);
sfree(index);
}
void write_pdbfile_indexed(FILE *out, const char *title, const t_atoms *atoms,
const rvec x[], int ePBC, const matrix box, char chain,
int model_nr, int nindex, const int index[],
- gmx_conect conect, gmx_bool bTerSepChains,
+ gmx_conect conect,
bool usePqrFormat);
/* REALLY low level */
void write_pdbfile(FILE *out, const char *title, const t_atoms *atoms,
const rvec x[], int ePBC, const matrix box, char chain,
- int model_nr, gmx_conect conect, gmx_bool bTerSepChains);
+ int model_nr, gmx_conect conect);
/* Low level pdb file writing routine.
*
* ONLY FOR SPECIAL PURPOSES,
else
{
write_pdbfile_indexed(gmx_fio_getfp(status->fio), title, fr->atoms,
- fr->x, -1, fr->box, ' ', fr->step, nind, ind, gc, TRUE, FALSE);
+ fr->x, -1, fr->box, ' ', fr->step, nind, ind, gc, FALSE);
}
break;
case efG96:
{
write_pdbfile(gmx_fio_getfp(status->fio), title,
fr->atoms, fr->x, fr->bPBC ? fr->ePBC : -1, fr->box,
- ' ', fr->step, gc, TRUE);
+ ' ', fr->step, gc);
}
break;
case efG96:
fprintf(fp, "REMARK generated by g_chi\n");
fprintf(fp, "REMARK "
"B-factor field contains negative of dihedral order parameters\n");
- write_pdbfile(fp, nullptr, atoms, x, ePBC, box, ' ', 0, nullptr, TRUE);
+ write_pdbfile(fp, nullptr, atoms, x, ePBC, box, ' ', 0, nullptr);
x0 = y0 = z0 = 1000.0;
for (i = 0; (i < atoms->nr); i++)
{
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018,2019, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
fp = gmx_ffopen(outfile, "w");
if (!bOne)
{
- write_pdbfile(fp, *top1->name, atoms1, x1, ePBC1, box1, ' ', 1, nullptr, TRUE);
+ write_pdbfile(fp, *top1->name, atoms1, x1, ePBC1, box1, ' ', 1, nullptr);
}
- write_pdbfile(fp, *top2->name, atoms2, x2, ePBC2, box2, ' ', bOne ? -1 : 2, nullptr, TRUE);
+ write_pdbfile(fp, *top2->name, atoms2, x2, ePBC2, box2, ' ', bOne ? -1 : 2, nullptr);
gmx_ffclose(fp);
break;
case efGRO:
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2012,2013,2014,2015,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2017,2018,2019, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
}
gmx_rmpbc(gpbc, natoms, box, x);
tapein = gmx_ffopen(pdbfile, "w");
- write_pdbfile_indexed(tapein, nullptr, atoms, x, ePBC, box, ' ', -1, gnx, index, nullptr, TRUE, FALSE);
+ write_pdbfile_indexed(tapein, nullptr, atoms, x, ePBC, box, ' ', -1, gnx, index, nullptr, FALSE);
gmx_ffclose(tapein);
/* strip_dssp returns the number of lines found in the dssp file, i.e.
* the number of residues plus the separator lines */
model_nr++;
}
write_pdbfile(out, title.c_str(), &useatoms, frout.x,
- frout.ePBC, frout.box, ' ', model_nr, gc, TRUE);
+ frout.ePBC, frout.box, ' ', model_nr, gc);
break;
case efG96:
const char *outputTitle = "";
if (outftp == efPDB)
{
out = gmx_ffopen(outfile, "w");
- write_pdbfile_indexed(out, *top_tmp.name, &atoms, x, ePBC, box, ' ', 1, isize, index, conect, TRUE, FALSE);
+ write_pdbfile_indexed(out, *top_tmp.name, &atoms, x, ePBC, box, ' ', 1, isize, index, conect, FALSE);
gmx_ffclose(out);
}
else
index[i] = i;
}
write_pdbfile_indexed(out, *top_tmp.name, &atoms, x, ePBC, box, ' ', -1, atoms.nr, index, conect,
- TRUE, outftp == efPQR);
+ outftp == efPQR);
sfree(index);
if (bLegend)
{