*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, 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.
/* First the N terminus */
if (nNtdb > 0)
{
- tdblist = filter_ter(nrtp, restp, nNtdb, ntdb,
+ tdblist = filter_ter(nNtdb, ntdb,
*pdba->resinfo[cc->r_start[i]].name,
- *pdba->resinfo[cc->r_start[i]].rtp,
&ntdblist);
if (ntdblist == 0)
{
/* And the C terminus */
if (nCtdb > 0)
{
- tdblist = filter_ter(nrtp, restp, nCtdb, ctdb,
+ tdblist = filter_ter(nCtdb, ctdb,
*pdba->resinfo[cc->r_end[i]].name,
- *pdba->resinfo[cc->r_end[i]].rtp,
&ntdblist);
if (ntdblist == 0)
{
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017,2018, 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.
return ntb;
}
-t_hackblock **filter_ter(int nrtp, t_restp rtp[],
- int nb, t_hackblock tb[],
+t_hackblock **filter_ter(int nb, t_hackblock tb[],
const char *resname,
- const char *rtpname,
int *nret)
{
// TODO Four years later, no force fields have ever used this, so decide status of this feature
* Remember to free the list when you are done with it...
*/
- t_restp * restp;
int i, j, n, none_idx;
gmx_bool found;
- char *rtpname_match, *s;
+ char *s;
t_hackblock **list;
- rtpname_match = search_rtp(rtpname, nrtp, rtp);
- restp = get_restp(rtpname_match, nrtp, rtp);
-
n = 0;
list = nullptr;
found = FALSE;
do
{
- /* The residue name should appear in a tdb file with the same base name
- * as the file containing the rtp entry.
- * This makes termini selection for different molecule types
- * much cleaner.
- */
- if (gmx_strcasecmp(restp->filebase, tb[i].filebase) == 0 &&
- gmx_strncasecmp(resname, s, 3) == 0)
+ if (gmx_strncasecmp(resname, s, 3) == 0)
{
found = TRUE;
srenew(list, n+1);
for (i = 0; i < nb; i++)
{
s = tb[i].name;
- /* The residue name should appear in a tdb file with the same base name
- * as the file containing the rtp entry.
- * This makes termini selection for different molecule types
- * much cleaner.
- */
- if (gmx_strcasecmp(restp->filebase, tb[i].filebase) == 0)
+ if (!gmx_strcasecmp("None", s))
{
- if (!gmx_strcasecmp("None", s))
- {
- none_idx = i;
- }
- else
+ none_idx = i;
+ }
+ else
+ {
+ /* Time to see if there's a generic terminus that matches.
+ Is there a hyphen? */
+ char *c = strchr(s, '-');
+
+ /* A conjunction hyphen normally indicates a residue-specific
+ terminus, which is named like "GLY-COOH". A generic terminus
+ won't have a hyphen. */
+ bool bFoundAnyHyphen = (c != nullptr);
+ /* '-' as the last character indicates charge, so if that's
+ the only one found e.g. "COO-", then it was not a conjunction
+ hyphen, so this is a generic terminus */
+ bool bOnlyFoundChargeHyphen = (bFoundAnyHyphen &&
+ *(c+1) == '\0');
+ /* Thus, "GLY-COO-" is not recognized as a generic terminus. */
+ bool bFoundGenericTerminus = !bFoundAnyHyphen || bOnlyFoundChargeHyphen;
+ if (bFoundGenericTerminus)
{
- /* Time to see if there's a generic terminus that matches.
- Is there a hyphen? */
- char *c = strchr(s, '-');
-
- /* A conjunction hyphen normally indicates a residue-specific
- terminus, which is named like "GLY-COOH". A generic terminus
- won't have a hyphen. */
- bool bFoundAnyHyphen = (c != nullptr);
- /* '-' as the last character indicates charge, so if that's
- the only one found e.g. "COO-", then it was not a conjunction
- hyphen, so this is a generic terminus */
- bool bOnlyFoundChargeHyphen = (bFoundAnyHyphen &&
- *(c+1) == '\0');
- /* Thus, "GLY-COO-" is not recognized as a generic terminus. */
- bool bFoundGenericTerminus = !bFoundAnyHyphen || bOnlyFoundChargeHyphen;
- if (bFoundGenericTerminus)
+ /* Check that we haven't already added a residue-specific version
+ * of this terminus.
+ */
+ for (j = 0; j < n && strstr((*list[j]).name, s) == nullptr; j++)
{
- /* Check that we haven't already added a residue-specific version
- * of this terminus.
- */
- for (j = 0; j < n && strstr((*list[j]).name, s) == nullptr; j++)
- {
- ;
- }
- if (j == n)
- {
- srenew(list, n+1);
- list[n] = &(tb[i]);
- n++;
- }
+ ;
+ }
+ if (j == n)
+ {
+ srenew(list, n+1);
+ list[n] = &(tb[i]);
+ n++;
}
}
}
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2011,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2011,2014,2015,2018, 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.
t_hackblock **tbptr, gpp_atomtype_t atype);
/* Read database for N&C terminal hacking */
-t_hackblock **filter_ter(int nrtp, t_restp rtp[],
- int nb, t_hackblock tb[],
+t_hackblock **filter_ter(int nb, t_hackblock tb[],
const char *resname,
- const char *rtpname,
int *nret);
/* Return a list of pointers to blocks that match residue name */