The outage for Sunday 24th November has been cancelled.
Bioplib
Protein Structure C Library
 All Data Structures Files Functions Variables Typedefs Macros Pages
Functions
ReadCSSR.c File Reference

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

CSSRblReadCSSR (FILE *fp, int *natom, char *name, char *title)
 
PDBblReadCSSRasPDB (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)
 

Detailed Description

Read a CSSR file.

Version
V1.7
Date
15.08.14
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:

ReadCSSR(fp,cssr,natom,name,title)

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;

ReadCSSRasPDB(fp,cssr,natom)

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.

NormaliseCSSR(cssr,cell,alpha,beta,gamma)

Given the unit cell dimensions, converts CSSR to orthonormal coordinates.

NormalisePDB(pdb,cell,alpha,beta,gamma)

Given the unit cell dimensions, converts PDB to orthonormal coordinates.

ortho(cell,alpha,beta,gamma,amatrx,isw,ncode)

Calculates the 3x3 matrix required to convert between fractional and orthonormal coordinates given the unit cell dimensions.

Usage:

   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

Revision History:

Definition in file ReadCSSR.c.

Function Documentation

void blNormaliseCSSR ( CSSR cssr,
REAL  cell[3],
REAL  alpha,
REAL  beta,
REAL  gamma 
)
Parameters
[in,out]*cssrPointer to CSSR linked list
[in]cellUnit cell dimensions
[in]alphaUnit cell angles
[in]beta
[in]gammaConvert a CSSR linked list in fractional coordinates to orthonormal
  • 06.09.91 Original
  • 01.06.92 Documented
  • 10.06.93 void return
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 513 of file ReadCSSR.c.

void blNormalisePDB ( PDB pdb,
REAL  cell[3],
REAL  alpha,
REAL  beta,
REAL  gamma 
)
Parameters
[in,out]*pdbPointer to PDB linked list
[in]cellUnit cell dimensions
[in]alphaUnit cell angles
[in]beta
[in]gammaConvert a PDB linked list in fractional cooridinates to orthonormal
  • 06.09.91 Original
  • 01.06.92 Documented
  • 10.06.93 void return
  • 07.07.14 Use bl prefix for functions By: CTP

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 
)
Parameters
[in]cellUnit cell dimensions
[in]alphaUnit cell angles
[in]beta
[in]gamma
[out]amatrxReturned conversion matrix
[in]isw0: Frac–>Ortho, 1: Ortho–>Frac
[in]ncodeOrientation 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

  • 06.09.91 Original
  • 01.06.92 Documented
  • 10.06.93 void return
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 643 of file ReadCSSR.c.

CSSR* blReadCSSR ( FILE *  fp,
int *  natom,
char *  name,
char *  title 
)
Parameters
[in]*fpA pointer to type FILE in which the CSSR file is stored.
[out]*natomNumber of atoms read.
[out]*nameThe molecule's name.
[out]*titleTitle on the molecule.

Read a CSSR file into a CSSR linked list

  • 06.09.91 Original
  • 24.01.92 Fixed for blank link columns (V1.1)
  • 01.06.92 Documented
  • 10.06.93 Returns TRUE or FALSE to indicate success
  • 09.07.93 Changed allocation scheme. Now returns pointer to start of list. No need to call init_cssr
  • 13.07.93 Returns NULL if allocation failed
  • 27.07.93 Changed I/O to double precision
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 224 of file ReadCSSR.c.

PDB* blReadCSSRasPDB ( FILE *  fp,
int *  natom 
)
Parameters
[in]*fpA pointer to type FILE in which the CSSR file is stored.
[out]*natomNumber of atoms read.
Returns
A pointer to the first allocated item of the PDB linked list

Read a CSSR file into a PDB linked list

  • 06.09.91 Original
  • 01.06.92 Documented
  • 10.06.93 Returns TRUE or FALSE to indicate success
  • 09.07.93 Changed allocation scheme. Now returns pointer to start of list. No need to call init_pdb
  • 13.07.93 Returns NULL if allocation failed
  • 27.07.93 Changed I/O to double precision
  • 07.07.14 Use bl prefix for functions By: CTP
  • 15.08.14 Use CLEAR_PDB() By: CTP

Definition at line 368 of file ReadCSSR.c.