Skip to content

Commit

Permalink
Merge branch 'master' of github.com:ACRMGroup/bioplib
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewCRMartin committed Aug 14, 2018
2 parents 5f3e2ee + da24888 commit 4c4609a
Show file tree
Hide file tree
Showing 10 changed files with 108 additions and 62 deletions.
11 changes: 7 additions & 4 deletions src/FitNCaCPDB.c
Expand Up @@ -3,12 +3,12 @@
\file FitNCaCPDB.c
\version V1.5
\date 19.08.14
\version V1.6
\date 07.08.18
\brief Fit two PDB linked lists. Also a weighted fit and support
routines
\copyright (c) UCL / Dr. Andrew C. R. Martin 1993-6
\copyright (c) UCL / Dr. Andrew C. R. Martin 1993-2018
\author Dr. Andrew C. R. Martin
\par
Institute of Structural & Molecular Biology,
Expand Down Expand Up @@ -58,6 +58,7 @@
- V1.4 07.07.14 Use bl prefix for functions By: CTP
- V1.5 19.08.14 Added AsCopy suffix to calls to blSelectAtomsPDB()
By: CTP
- V1.6 07.08.18 Removed erroneous check on sel[3]
*************************************************************************/
/* Doxygen
Expand Down Expand Up @@ -111,6 +112,8 @@
- 07.07.14 Use bl prefix for functions By: CTP
- 19.08.14 Added AsCopy suffix to calls to blSelectAtomsPDB() By: CTP
- 03.11.17 Initialize RetVal! By: ACRM
- 07.08.18 Removed erroneous check on sel[3]
*/
BOOL blFitNCaCPDB(PDB *ref_pdb, PDB *fit_pdb, REAL rm[3][3])
{
Expand All @@ -132,7 +135,7 @@ BOOL blFitNCaCPDB(PDB *ref_pdb, PDB *fit_pdb, REAL rm[3][3])
SELECT(sel[0], "N ");
SELECT(sel[1], "CA ");
SELECT(sel[2], "C ");
if((sel[0]==NULL)||(sel[1]==NULL)||(sel[2]==NULL)||(sel[3]==NULL))
if((sel[0]==NULL)||(sel[1]==NULL)||(sel[2]==NULL))
return(FALSE);
if( (ref_bb_pdb = blSelectAtomsPDBAsCopy(ref_pdb, 3, sel, &natoms))
== NULL )
Expand Down
11 changes: 7 additions & 4 deletions src/GetCofGPDBSCRange.c
Expand Up @@ -3,11 +3,11 @@
\file GetCofGPDBSCRange.c
\version V1.2
\date 07.07.14
\version V1.3
\date 07.08.18
\brief Find CofG of a PDB linked list
\copyright (c) UCL / Dr. Andrew C. R. Martin 1992-4
\copyright (c) UCL / Dr. Andrew C. R. Martin 1992-2018
\author Dr. Andrew C. R. Martin
\par
Institute of Structural & Molecular Biology,
Expand Down Expand Up @@ -50,6 +50,7 @@
- V1.1 03.10.94 Added GetCofGPDBRange(), FindCofGPDBSCRange() and
fixed NULL coord search in GetCofGPDB()
- V1.2 07.07.14 Use bl prefix for functions By: CTP
- V1.3 07.08.18 Initialized variable to silence gcc 7.3.1 with -O2
*************************************************************************/
/* Doxygen
Expand Down Expand Up @@ -97,11 +98,13 @@
For Glycine, returns the CA coordinates.
- 03.10.94 Original By: ACRM
- 07.08.18 Initialized ca to silence gcc 7.3.1 with -O2
*/
void blGetCofGPDBSCRange(PDB *start, PDB *stop, VEC3F *cg)
{
int natom;
PDB *p, *ca;
PDB *p,
*ca = NULL;

cg->x = 0.0;
cg->y = 0.0;
Expand Down
19 changes: 14 additions & 5 deletions src/HAddPDB.c
Expand Up @@ -3,11 +3,11 @@
\file HAddPDB.c
\version V2.22
\date 23.06.15
\version V2.23
\date 07.08.18
\brief Add hydrogens to a PDB linked list
\copyright (c) UCL / Dr. Andrew C. R. Martin 1990-2015
\copyright (c) UCL / Dr. Andrew C. R. Martin 1990-2018
\author Dr. Andrew C. R. Martin
\par
Institute of Structural & Molecular Biology,
Expand Down Expand Up @@ -134,6 +134,8 @@
- V2.21 23.02.15 Uses new blRenumAtomsPDB()
- V2.22 23.06.15 Various calls to CLEAR_PDB() to fix problems with
uninitialized CONECT data
- V2.23 07.08.18 initialized and foce-terminated variables to silence
gcc 7.3.1 with -O2
*************************************************************************/
/* Doxygen
Expand Down Expand Up @@ -616,14 +618,19 @@ preceeding the last residue\n");
- 26.08.14 Used n and nt variables consistently instead of literal
strings. Moved all use of 'ok' variable into SCREEN_INFO
- 13.02.15 Added setting of element type
- 07.08.18 initialized variables to silence gcc 7.3.1 with -O2
*/
static PDB *makeh(int HType, REAL BondLen, REAL alpha, REAL beta,
BOOL firstres)
{
static char *nt = "NT ",
*n = "N ";
REAL x1,y1,z1,x2,y2,z2,x3,y3,z3,
x4,y4,z4,x5,y5,z5,x6,y6,z6,
REAL x1 = 0.0, y1 = 0.0, z1 = 0.0,
x2 = 0.0, y2 = 0.0, z2 = 0.0,
x3 = 0.0, y3 = 0.0, z3 = 0.0,
x4 = 0.0, y4 = 0.0, z4 = 0.0,
x5 = 0.0, y5 = 0.0, z5 = 0.0,
x6 = 0.0, y6 = 0.0, z6 = 0.0,
x21,y21,z21,r21,
x21p,y21p,z21p,r21p,
x23,y23,z23,r23,
Expand Down Expand Up @@ -1417,12 +1424,14 @@ been set.\n",DATAENV);
- 05.12.02 Original By: ACRM
- 17.02.15 Terminates the out string when it is 4 or more characters
- 18.03.15 Changed to use MAXLABEL
- 07.08.18 Force terminated instr to silence gcc 7.3.1 with -O2
*/
static void SetRawAtnam(char *out, char *in)
{
char instr[MAXLABEL];

strncpy(instr, in, MAXLABEL-1);
instr[MAXLABEL-1] = '\0';
TERMAT(instr, ' ');

if(strlen(instr) > 3)
Expand Down
55 changes: 35 additions & 20 deletions src/ReadPDB.c
Expand Up @@ -3,11 +3,11 @@
\file ReadPDB.c
\version V3.11
\date 01.07.15
\version V3.12
\date 07.08.18
\brief Read coordinates from a PDB file
\copyright (c) UCL / Dr. Andrew C. R. Martin 1988-2015
\copyright (c) UCL / Dr. Andrew C. R. Martin 1988-2018
\author Dr. Andrew C. R. Martin
\par
Institute of Structural & Molecular Biology,
Expand Down Expand Up @@ -232,11 +232,13 @@ BUGS: 25.01.05 Note the multiple occupancy code won't work properly for
checks for failed XML extractions.
- V3.10 25.06.15 Fixed bug for pdbml parsing where residue number is set
to 0. By: CTP
- £3.11 01.07.15 Added ParseHeaderRecordsPDBML().
- V3.11 01.07.15 Added ParseHeaderRecordsPDBML().
ParseHeaderPDBML() broken into smaller functions:
ParseTitlePDBML(), ParseCompndPDBML(),
ParseSourcePDBML(), ParseResolPDBML(),
ParseSeqresPDBML() and ParseModresPDBML(). By: CTP
- V3.12 07.08.18 Increased text buffer sizes to silence gcc 7.3.1
with -O2
*************************************************************************/
/* Doxygen
Expand Down Expand Up @@ -3317,6 +3319,7 @@ static STRINGLIST *ParseSeqresPDBML(xmlDoc *document)
Parses PDBML header data and returns MODRES record.
- 01.07.15 Original. By: CTP
- 07.08.18 Increased text buffer sizes to silence gcc 7.3.1 with -O2
*/
static STRINGLIST *ParseModresPDBML(xmlDoc *document)
{
Expand All @@ -3332,20 +3335,30 @@ static STRINGLIST *ParseModresPDBML(xmlDoc *document)
*node = NULL,
*subnode = NULL,
*n = NULL;
xmlChar *content, *attribute;
double content_lf = 0.0;
xmlChar *content,
*attribute;
double content_lf = 0.0;
STRINGLIST *modres_lines = NULL;
char pdb_field[5] = "";
char pdb_field[8];

/* modres */
char modres_line[82] = "",
modres_resnam[8] = "",
modres_chain[8] = "",
modres_insert[2] = " ",
modres_stdnam[8] = "",
modres_comment[42] = "";
char modres_line[160],
modres_resnam[8],
modres_chain[8],
modres_insert[8],
modres_stdnam[8],
modres_comment[80];
int modres_seqnum = 0;

modres_line[0] = '\0';
modres_resnam[0] = '\0';
modres_chain[0] = '\0';
modres_insert[0] = ' ';
modres_insert[1] = '\0';
modres_stdnam[0] = '\0';
modres_comment[0] = '\0';


/* Parse Document Tree */
root_node = xmlDocGetRootElement(document);
for(node = root_node->children; node; NEXT(node))
Expand Down Expand Up @@ -4232,7 +4245,7 @@ static STRINGLIST *SourceStringlist(STRINGLIST *stringlist,
Creates SEQRES records in PDB-format.
- 23.06.15 Original. By: CTP
- 07.08.18 Increase size of buffers to silence gcc 7.3.1 with -O2
*/
static STRINGLIST *SeqresStringlist(int nchains, char **chains,
STRINGLIST **residues)
Expand All @@ -4245,12 +4258,14 @@ static STRINGLIST *SeqresStringlist(int nchains, char **chains,
#else

STRINGLIST *stringlist = NULL,
*residue = NULL;
int i = 0, j = 0, nres = 0;
int nline = 0;
char seqres_line[82] = "";
char residue_field[5] = "";
char sequence_field[53] = "";
*residue = NULL;
int i = 0,
j = 0,
nres = 0,
nline = 0;
char seqres_line[160],
residue_field[8],
sequence_field[80];


/* process chains */
Expand Down
10 changes: 6 additions & 4 deletions src/StripWatersPDB.c
Expand Up @@ -3,11 +3,11 @@
\file StripWatersPDB.c
\version V1.3
\date 19.04.15
\version V1.4
\date 07.08.18
\brief
\copyright (c) Dr. Andrew C. R. Martin, UCL, 2008-2014
\copyright (c) Dr. Andrew C. R. Martin, UCL, 2008-2018
\author Dr. Andrew C. R. Martin
\par
Institute of Structural & Molecular Biology,
Expand Down Expand Up @@ -51,6 +51,7 @@
- V1.2 19.08.14 Renamed function blStripWatersPDB() to
blStripWatersPDBAsCopy() By: CTP
- V1.3 19.04.15 Added call to blCopyConect() By: ACRM
- V1.4 07.08.18 Initialized variable to silence gcc 7.3.1 with -O2
*************************************************************************/
/* Doxygen
Expand Down Expand Up @@ -95,12 +96,13 @@
- 30.04.08 Original based on StripHPDB() By: ACRM
- 19.08.14 Renamed function to blStripWatersPDBAsCopy() By: CTP
- 12.04.15 Added rebuild of CONECT data
- 07.08.18 Initialized q to silence gcc 7.3.1 with -O2
*/
PDB *blStripWatersPDBAsCopy(PDB *pdbin, int *natom)
{
PDB *pdbout = NULL,
*p,
*q;
*q = NULL;

*natom = 0;

Expand Down
22 changes: 13 additions & 9 deletions src/WritePDB.c
Expand Up @@ -3,8 +3,8 @@
\file WritePDB.c
\version V1.30
\date 09.02.18
\version V1.31
\date 07.08.18
\brief Write a PDB file from a linked list
\copyright (c) UCL / Dr. Andrew C. R. Martin 1993-2018
Expand Down Expand Up @@ -113,6 +113,8 @@
Added ReadSeqresChainLabelWholePDB() and
ReadSeqresResidueListWholePDB(). By: CTP
- V1.30 09.02.18 Corrected calls to ABS() in formal charges By: ACRM
- V1.31 07.08.18 Increased text buffer sizes to silence gcc 7.3.1
with -O2
*************************************************************************/
/* Doxygen
Expand Down Expand Up @@ -576,6 +578,7 @@ BOOL blWritePDBAsPDBML(FILE *fp, PDB *pdb)
in PDB. Set compound type to polymer. By: CTP
- 10.07.15 Added return value for no XML_SUPPORT By: ACRM
- 29.07.15 Added output of SEQRES records from wpdb->header. By: CTP
- 07.08.18 Increased text buffer sizes to silence gcc 7.3.1 with -O2
*/
static BOOL blDoWritePDBAsPDBML(FILE *fp, WHOLEPDB *wpdb, BOOL doWhole)
{
Expand All @@ -596,7 +599,7 @@ static BOOL blDoWritePDBAsPDBML(FILE *fp, WHOLEPDB *wpdb, BOOL doWhole)
node = NULL;
xmlNsPtr pdbx = NULL,
xsi = NULL;
char buffer[16],
char buffer[80],
*buffer_ptr;
int conect_id = 0,
i, j;
Expand All @@ -607,14 +610,14 @@ static BOOL blDoWritePDBAsPDBML(FILE *fp, WHOLEPDB *wpdb, BOOL doWhole)
pdbml_date[11] = "",
*title = NULL;

COMPND compound;
PDBSOURCE species;
int molid = 0;
HASHTABLE *chain_to_entity = NULL;
COMPND compound;
PDBSOURCE species;
int molid = 0;
HASHTABLE *chain_to_entity = NULL;
int seqres_nchains = 0;
char **seqres_chain = NULL;
STRINGLIST **seqres_residues = NULL,
*s = NULL;
*s = NULL;

/* Create document */
if((doc = xmlNewDoc((xmlChar *)"1.0"))==NULL)
Expand Down Expand Up @@ -1642,6 +1645,7 @@ void blWriteWholePDBHeader(FILE *fp, WHOLEPDB *wpdb)
- 23.02.15 Added numTer parameter
- 02.03.15 Padded END and CONECT
- 06.08.15 Updated XML check. By: CTP
- 07.08.18 Increased text buffer sizes to silence gcc 7.3.1 with -O2
*/
void blWriteWholePDBTrailer(FILE *fp, WHOLEPDB *wpdb, int numTer)
{
Expand All @@ -1660,7 +1664,7 @@ void blWriteWholePDBTrailer(FILE *fp, WHOLEPDB *wpdb, int numTer)
int i,
nPrinted,
width=0;
char format[8];
char format[16];

for(i=0, nPrinted=0; i<p->nConect; i++)
{
Expand Down

0 comments on commit 4c4609a

Please sign in to comment.