Bioplib
Protein Structure C Library
|
Read a CSSR file. More...
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include "SysDefs.h"
#include "MathType.h"
#include "cssr.h"
#include "matrix.h"
#include "general.h"
#include "macros.h"
Go to the source code of this file.
Functions | |
CSSR * | blReadCSSR (FILE *fp, int *natom, char *name, char *title) |
PDB * | blReadCSSRasPDB (FILE *fp, int *natom) |
void | blNormaliseCSSR (CSSR *cssr, REAL cell[3], REAL alpha, REAL beta, REAL gamma) |
void | blNormalisePDB (PDB *pdb, REAL cell[3], REAL alpha, REAL beta, REAL gamma) |
void | blOrtho (REAL cell[3], REAL alpha, REAL beta, REAL gamma, REAL amatrx[3][3], int isw, int ncode) |
Read a CSSR file.
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.
This subroutine will read a CSSR file of any size and form a linked list of the structure. This list is contained in a linked set of structures of type cssr_entry. The strucure is set up by including the file "cssr.h". For details of the structure, see this file.
To define a structure list in which to store the protein, the user need only include the file "cssr.h", declare a pointer to a structure of type CSSR using the statement: CSSR *mycssr;
As ReadCSSR(), but reads the structure into a PDB type linked list. Atom connection information is ignored, and charges are placed into the B-val column.
Given the unit cell dimensions, converts CSSR to orthonormal coordinates.
Given the unit cell dimensions, converts PDB to orthonormal coordinates.
Calculates the 3x3 matrix required to convert between fractional and orthonormal coordinates given the unit cell dimensions.
ReadCSSR(fp,cssr,natom,name,title) Input: FILE *fp A pointer to type FILE in which the CSSR file is stored. CSSR *cssr A pointer to the first allocated item of the CSSR linked list Output: int *natom Number of atoms read. char *name The molecule's name. char *title Title on the molecule. ReadCSSRasPDB(fp,pdb,natom) into a PDB linked list Input: FILE *fp A pointer to type FILE in which the CSSR file is stored. PDB *pdb A pointer to the first allocated item of the PDB linked list Output: int *natom Number of atoms read. NormaliseCSSR(cssr,cell,alpha,beta,gamma) I/O: CSSR *cssr Pointer to CSSR linked list Input: REAL cell[3] Unit cell dimensions alpha Unit cell angles beta gamma NormalisePDB(pdb,cell,alpha,beta,gamma) I/O: PDB *pdb Pointer to PDB linked list Input: REAL cell[3] Unit cell dimensions alpha Unit cell angles beta gamma ortho(cell,alpha,beta,gamma,amatrx,isw,ncode) Input: REAL cell[3] Unit cell dimensions alpha Unit cell angles beta gamma Output: REAL amatrx[3][3] Returned conversion matrix Input: int isw 0: Frac-->Ortho, 1: Ortho-->Frac int ncode Orientation of reciprocal axes wrt true axes. 1: a || xo, c* || zo 2: b || xo, a* || zo 3: c || xo, b* || zo 4: hex a & b || xo, c* || zo 5: a* || xo, c || zo
Definition in file ReadCSSR.c.
[in,out] | *cssr | Pointer to CSSR linked list |
[in] | cell | Unit cell dimensions |
[in] | alpha | Unit cell angles |
[in] | beta | |
[in] | gamma | Convert a CSSR linked list in fractional coordinates to orthonormal |
Definition at line 513 of file ReadCSSR.c.
[in,out] | *pdb | Pointer to PDB linked list |
[in] | cell | Unit cell dimensions |
[in] | alpha | Unit cell angles |
[in] | beta | |
[in] | gamma | Convert a PDB linked list in fractional cooridinates to orthonormal |
Definition at line 574 of file ReadCSSR.c.
void blOrtho | ( | REAL | cell[3], |
REAL | alpha, | ||
REAL | beta, | ||
REAL | gamma, | ||
REAL | amatrx[3][3], | ||
int | isw, | ||
int | ncode | ||
) |
[in] | cell | Unit cell dimensions |
[in] | alpha | Unit cell angles |
[in] | beta | |
[in] | gamma | |
[out] | amatrx | Returned conversion matrix |
[in] | isw | 0: Frac–>Ortho, 1: Ortho–>Frac |
[in] | ncode | Orientation of reciprocal axes wrt true axes. |
ncode Orientation of reciprocal axes wrt true axes. 1: a || xo, c* || zo 2: b || xo, a* || zo 3: c || xo, b* || zo 4: hex a & b || xo, c* || zo 5: a* || xo, c || zo
Function to calculate a matrix which will convert between fractional and orthonormal coordinates given unit cell dimensions and angles. ncode defines the orientation of the reciprocal axes wrt the real axes.
See Rollett `Computing Methods in Crystallography' p.23
Definition at line 643 of file ReadCSSR.c.
CSSR* blReadCSSR | ( | FILE * | fp, |
int * | natom, | ||
char * | name, | ||
char * | title | ||
) |
[in] | *fp | A pointer to type FILE in which the CSSR file is stored. |
[out] | *natom | Number of atoms read. |
[out] | *name | The molecule's name. |
[out] | *title | Title on the molecule. |
Read a CSSR file into a CSSR linked list
Definition at line 224 of file ReadCSSR.c.
PDB* blReadCSSRasPDB | ( | FILE * | fp, |
int * | natom | ||
) |
[in] | *fp | A pointer to type FILE in which the CSSR file is stored. |
[out] | *natom | Number of atoms read. |
Read a CSSR file into a PDB linked list
Definition at line 368 of file ReadCSSR.c.