Bioplib
Protein Structure C Library
 All Data Structures Files Functions Variables Typedefs Macros Pages
Macros | Functions
access.c File Reference

Accessibility calculation code. More...

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "macros.h"
#include "SysDefs.h"
#include "pdb.h"
#include "access.h"

Go to the source code of this file.

Macros

#define MAXBUFF   160 /* I/O buffer */
 
#define MAX_INTERSECT
 
#define MAX_INTERSECT_EXP   100 /* Amount to expand intersect array by */
 
#define MAX_ATOM_IN_CUBE
 
#define FREE_ACCESS_STORAGE
 
#define EXPAND_INTERSECT_ARRAYS
 

Functions

RESRADblSetAtomRadii (PDB *pdb, FILE *fpRad)
 
BOOL blCalcAccess (PDB *pdb, int natoms, REAL integrationAccuracy, REAL probeRadius, BOOL doAccessibility)
 
RESACCESSblCalcResAccess (PDB *pdb, RESRAD *resrad)
 

Detailed Description

Accessibility calculation code.

Version
V1.2
Date
17.06.15
Author
Dr. Andrew C.R. Martin
Institute of Structural & Molecular Biology, University College London, Gower Street, London. WC1E 6BT.
andre.nosp@m.w@bi.nosp@m.oinf..nosp@m.org..nosp@m.uk andre.nosp@m.w.ma.nosp@m.rtin@.nosp@m.ucl..nosp@m.ac.uk

This code is NOT IN THE PUBLIC DOMAIN, but it may be copied according to the conditions laid out in the accompanying file COPYING.DOC.

The code may be modified as required, but any modifications must be documented so that the person responsible can be identified.

The code may not be sold commercially or included as part of a commercial product except as described in the file COPYING.DOC.

Description:

Calculation of solvent accessibility by the method of Lee and Richards. Based loosely on PMCL code by Peter McLaughlin

Usage:

RESRAD *blSetAtomRadii(PDB *pdb, FILE *fpRad)

Read the radius file and set the radii in the PDB linked list. Also returns the data from the radius file for use by blCalcResAccess()

BOOL blCalcAccess(PDB *pdb, int natoms,
REAL integrationAccuracy, REAL probeRadius,
BOOL doAccessibility)

Does the accessibilty calculations. integrationAccuracy can be set to zero to use the default value

Calculates residue accessibility and relative accessibility

Revision History:

Definition in file access.c.

Macro Definition Documentation

#define EXPAND_INTERSECT_ARRAYS
Value:
do { int newMaxIntersect = (maxIntersect+MAX_INTERSECT_EXP), \
iexpand; \
neighbours = (int *)realloc(neighbours, \
(newMaxIntersect+1)*sizeof(int)); \
flag = (int *)realloc(flag, (newMaxIntersect+1)*sizeof(int)); \
arci = (REAL *)realloc(arci, (newMaxIntersect+1)*sizeof(REAL)); \
arcf = (REAL *)realloc(arcf, (newMaxIntersect+1)*sizeof(REAL)); \
deltaX = (REAL *)realloc(deltaX, (newMaxIntersect+1)*sizeof(REAL)); \
deltaY = (REAL *)realloc(deltaY, (newMaxIntersect+1)*sizeof(REAL)); \
dist = (REAL *)realloc(dist, (newMaxIntersect+1)*sizeof(REAL)); \
distSquared = (REAL *)realloc(distSquared, \
(newMaxIntersect+1)*sizeof(REAL)); \
if(neighbours==NULL || flag==NULL || arci==NULL || arcf==NULL || \
deltaX==NULL || deltaY==NULL || dist==NULL || \
distSquared==NULL) \
return(FALSE); \
} \
for(iexpand=maxIntersect+1; iexpand<=newMaxIntersect; iexpand++) \
{ neighbours[iexpand] = 0; \
flag[iexpand] = 0; \
arci[iexpand] = 0.0; \
arcf[iexpand] = 0.0; \
deltaX[iexpand] = 0.0; \
deltaY[iexpand] = 0.0; \
dist[iexpand] = 0.0; \
distSquared[iexpand] = 0.0; \
} \
maxIntersect = newMaxIntersect; \
} while(0)
#define NULL
Definition: array2.c:99
#define FALSE
Definition: macros.h:223
double REAL
Definition: MathType.h:67
#define FREE_ACCESS_STORAGE
Definition: access.c:115
#define MAX_INTERSECT_EXP
Definition: access.c:111

Definition at line 139 of file access.c.

#define FREE_ACCESS_STORAGE
Value:
do { \
if(cube) free(cube); \
if(radii) free(radii); \
if(radiiSquared) free(radiiSquared); \
if(neighbours) free(neighbours); \
if(flag) free(flag); \
if(arci) free(arci); \
if(arcf) free(arcf); \
if(deltaX) free(deltaX); \
if(deltaY) free(deltaY); \
if(dist) free(dist); \
if(distSquared) free(distSquared); \
if(atomTable) free(atomTable); \
if(atomsInCube) { \
for(i=0;i<=maxAtomInCube;i++) \
{ if(atomsInCube[i]) free(atomsInCube[i]); \
else break; \
} \
free(atomsInCube); \
} \
} while(0);

Definition at line 115 of file access.c.

#define MAX_ATOM_IN_CUBE
Value:
100 /* Initial max no. of atoms in a cube -
expands as required */

Definition at line 112 of file access.c.

#define MAX_INTERSECT
Value:
10000 /* Initial max no. of intersections of
neighbouring spheres - expands as
required */

Definition at line 108 of file access.c.

#define MAX_INTERSECT_EXP   100 /* Amount to expand intersect array by */

Definition at line 111 of file access.c.

#define MAXBUFF   160 /* I/O buffer */

Definition at line 107 of file access.c.

Function Documentation

BOOL blCalcAccess ( PDB pdb,
int  natoms,
REAL  integrationAccuracy,
REAL  probeRadius,
BOOL  doAccessibility 
)
Parameters
[in,out]*pdbPDB linked list
[in]natomsNumber of atoms
[in]integrationAccuracyIntegration accuracy
[in]probeRadiusProbe radius
[in]doAccessibilityAccessibility or contact area
Returns
Success

Allocates arrays and calls routines to populate them, do the access calculations and populate into the PDB linked list

  • 22.04.99 Original By: ACRM

Definition at line 331 of file access.c.

RESACCESS* blCalcResAccess ( PDB pdb,
RESRAD resrad 
)
Parameters
[in,out]*pdbPDB linked list
[in]*resradLinked list of atom radius information
Returns
Linked list of residue accessibilities

Calculates and populates the residue totals and relative values using standards stored in resrad

  • 22.04.99 Original By: ACRM
  • 04.08.99 Changed check on return from GetStandardAccess() to check for < VERY_SMALL rather than ==0.0 Set relative access to -1 if the standard accessibility is unknown rather than to 0.0
  • 17.06.15 Added calculation of sidechain accessibility

Definition at line 673 of file access.c.

RESRAD* blSetAtomRadii ( PDB pdb,
FILE *  fpRad 
)
Parameters
[in,out]*pdbPDB linked list
[in]*fpRadRadius file pointer
Returns
Linked list of radius information

Set atom radii from the radius file in the PDB linked list Returns the radius lookup information since it also contains the standard accessibilities

  • 22.04.99 Original By: ACRM
  • 16.06.99 Initialise radii to NULL
  • 22.06.99 Changed to call DefaultRadius() with element type rather than atom name
  • 16.07.14 Rewritten to work outside XMAS format and now takes the file pointer to the radii file rather than the filename

Definition at line 259 of file access.c.