Bioplib
Protein Structure C Library
 All Data Structures Files Functions Variables Typedefs Macros Pages
ReadCSSR.c
Go to the documentation of this file.
1 /************************************************************************/
2 /**
3 
4  \file ReadCSSR.c
5 
6  \version V1.7
7  \date 15.08.14
8  \brief Read a CSSR file
9 
10  \copyright (c) UCL / Dr. Andrew C. R. Martin 1991-2014
11  \author Dr. Andrew C. R. Martin
12  \par
13  Institute of Structural & Molecular Biology,
14  University College London,
15  Gower Street,
16  London.
17  WC1E 6BT.
18  \par
19  andrew@bioinf.org.uk
20  andrew.martin@ucl.ac.uk
21 
22 **************************************************************************
23 
24  This code is NOT IN THE PUBLIC DOMAIN, but it may be copied
25  according to the conditions laid out in the accompanying file
26  COPYING.DOC.
27 
28  The code may be modified as required, but any modifications must be
29  documented so that the person responsible can be identified.
30 
31  The code may not be sold commercially or included as part of a
32  commercial product except as described in the file COPYING.DOC.
33 
34 **************************************************************************
35 
36  Description:
37  ============
38 
39 \code
40  ReadCSSR(fp,cssr,natom,name,title)
41 \endcode
42 
43  This subroutine will read a CSSR file of any size and form a linked list
44  of the structure.
45  This list is contained in a linked set of structures of type cssr_entry.
46  The strucure is set up by including the file "cssr.h". For details of
47  the structure, see this file.
48 
49  To define a structure list in which to store the protein, the
50  user need only include the file "cssr.h", declare a pointer to a
51  structure of type CSSR using the statement:
52  CSSR *mycssr;
53 
54 \code
55  ReadCSSRasPDB(fp,cssr,natom)
56 \endcode
57 
58  As ReadCSSR(), but reads the structure into a PDB type linked list.
59  Atom connection information is ignored, and charges are placed into the
60  B-val column.
61 
62 \code
63  NormaliseCSSR(cssr,cell,alpha,beta,gamma)
64 \endcode
65 
66  Given the unit cell dimensions, converts CSSR to orthonormal
67  coordinates.
68 
69 \code
70  NormalisePDB(pdb,cell,alpha,beta,gamma)
71 \endcode
72 
73  Given the unit cell dimensions, converts PDB to orthonormal
74  coordinates.
75 
76 \code
77  ortho(cell,alpha,beta,gamma,amatrx,isw,ncode)
78 \endcode
79 
80  Calculates the 3x3 matrix required to convert between fractional and
81  orthonormal coordinates given the unit cell dimensions.
82 
83 **************************************************************************
84 
85  Usage:
86  ======
87 
88 \verbatim
89  ReadCSSR(fp,cssr,natom,name,title)
90  Input: FILE *fp A pointer to type FILE in which the
91  CSSR file is stored.
92  CSSR *cssr A pointer to the first allocated item of
93  the CSSR linked list
94  Output: int *natom Number of atoms read.
95  char *name The molecule's name.
96  char *title Title on the molecule.
97 
98  ReadCSSRasPDB(fp,pdb,natom)
99  into a PDB linked list
100  Input: FILE *fp A pointer to type FILE in which the
101  CSSR file is stored.
102  PDB *pdb A pointer to the first allocated item of
103  the PDB linked list
104  Output: int *natom Number of atoms read.
105 
106  NormaliseCSSR(cssr,cell,alpha,beta,gamma)
107  I/O: CSSR *cssr Pointer to CSSR linked list
108  Input: REAL cell[3] Unit cell dimensions
109  alpha Unit cell angles
110  beta
111  gamma
112 
113  NormalisePDB(pdb,cell,alpha,beta,gamma)
114  I/O: PDB *pdb Pointer to PDB linked list
115  Input: REAL cell[3] Unit cell dimensions
116  alpha Unit cell angles
117  beta
118  gamma
119 
120  ortho(cell,alpha,beta,gamma,amatrx,isw,ncode)
121  Input: REAL cell[3] Unit cell dimensions
122  alpha Unit cell angles
123  beta
124  gamma
125  Output: REAL amatrx[3][3] Returned conversion matrix
126  Input: int isw 0: Frac-->Ortho, 1: Ortho-->Frac
127  int ncode Orientation of reciprocal axes wrt true
128  axes.
129  1: a || xo, c* || zo
130  2: b || xo, a* || zo
131  3: c || xo, b* || zo
132  4: hex a & b || xo, c* || zo
133  5: a* || xo, c || zo
134 \endverbatim
135 **************************************************************************
136 
137  Revision History:
138  =================
139 - V1.0 06.09.91 Original
140 - V1.1 24.01.92 Fixed for reading files with blank link numbers.
141 - V1.2 01.06.92 Documented and added FPU check
142 - V1.3 10.06.93 Tidied for book
143 - V1.4 27.07.93 Changed I/O to double precision
144 - V1.5 30.05.02 Changed PDB field from 'junk' to 'record_type'
145 - V1.6 07.07.14 Use bl prefix for functions By: CTP
146 - V1.7 15.08.14 Updated blReadCSSRasPDB() to use CLEAR_PDB() By: CTP
147 
148 *************************************************************************/
149 /* Doxygen
150  -------
151  #GROUP Handling CSSR Data
152  #SUBGROUP File IO
153 
154  #FUNCTION blReadCSSR()
155  Read a CSSR file into a CSSR linked list
156 
157  #FUNCTION blReadCSSRasPDB()
158  Read a CSSR file into a PDB linked list
159 
160 
161  #SUBGROUP Transformations
162 
163  #FUNCTION blNormaliseCSSR()
164  Convert a CSSR linked list in fractional coordinates to orthonormal
165 
166  #FUNCTION blNormalisePDB()
167  Convert a PDB linked list in fractional cooridinates to orthonormal
168 
169  #FUNCTION blOrtho()
170  Calculate a matrix which will convert between fractional and
171  orthonormal coordinates given unit cell dimensions and angles.
172 */
173 /************************************************************************/
174 /* Includes
175 */
176 #include <stdio.h>
177 #include <string.h>
178 #include <math.h>
179 #include <stdlib.h>
180 
181 #include "SysDefs.h"
182 #include "MathType.h"
183 
184 #include "cssr.h" /* This includes pdb.h */
185 #include "matrix.h"
186 #include "general.h"
187 #include "macros.h"
188 
189 /************************************************************************/
190 /* Defines and macros
191 */
192 
193 /************************************************************************/
194 /* Globals
195 */
196 
197 /************************************************************************/
198 /* Prototypes
199 */
200 
201 /************************************************************************/
202 /*>CSSR *blReadCSSR(FILE *fp, int *natom, char *name, char *title)
203  ---------------------------------------------------------------
204 *//**
205 
206  \param[in] *fp A pointer to type FILE in which the
207  CSSR file is stored.
208  \param[out] *natom Number of atoms read.
209  \param[out] *name The molecule's name.
210  \param[out] *title Title on the molecule.
211 
212  Read a CSSR file into a CSSR linked list
213 
214 - 06.09.91 Original
215 - 24.01.92 Fixed for blank link columns (V1.1)
216 - 01.06.92 Documented
217 - 10.06.93 Returns TRUE or FALSE to indicate success
218 - 09.07.93 Changed allocation scheme. Now returns pointer to start of
219  list. No need to call init_cssr
220 - 13.07.93 Returns NULL if allocation failed
221 - 27.07.93 Changed I/O to double precision
222 - 07.07.14 Use bl prefix for functions By: CTP
223 */
224 CSSR *blReadCSSR(FILE *fp,
225  int *natom,
226  char *name,
227  char *title)
228 {
229  char buffer[160],
230  code[8];
231  REAL cell[3],
232  alpha, beta, gamma;
233  int orthonormal,
234  nocharges,
235  i;
236  CSSR *cssr = NULL,
237  *p;
238 
239  /* Initilialise cell parameters, etc. */
240  cell[0] = cell[1] = cell[2] = 1.0;
241  alpha = beta = gamma = 90.0;
242  name[0] = title[0] = '\0';
243 
244  *natom = 0;
245 
246  /*** Record 1 ***/
247  if(!fgets(buffer,160,fp)) return(NULL);
248  TERMINATE(buffer);
249 
250  if(strlen(buffer) >= 28)
251  {
252  /* We can get a code name */
253  strncpy(code,buffer+22,6);
254  code[6] = '\0';
255  }
256 
257  if(strlen(buffer) >= 62)
258  {
259  /* We can get unit cell parameters */
260  sscanf(buffer+38,"%lf%lf%lf",&cell[0],&cell[1],&cell[2]);
261  }
262 
263  /*** Record 2 ***/
264  if(!fgets(buffer,160,fp)) return(NULL);
265  TERMINATE(buffer);
266 
267  if(strlen(buffer) >= 45)
268  {
269  /* We can get cell angles */
270  sscanf(buffer+21,"%lf%lf%lf",&alpha,&beta,&gamma);
271  }
272 
273  /*** Record 3 ***/
274  if(!fgets(buffer,160,fp)) return(NULL);
275  TERMINATE(buffer);
276 
277  sscanf(buffer,"%d%d",natom,&orthonormal);
278  strcpy(name,buffer+9);
279 
280  /*** Record 4 ***/
281  if(!fgets(buffer,160,fp)) return(NULL);
282  TERMINATE(buffer);
283 
284  sscanf(buffer+4,"%d",&nocharges);
285  if(nocharges != 1) nocharges = 0;
286  strcpy(title,buffer+7);
287 
288  /*** Remaining records represent the atoms... ***/
289  for(i=0; i < *natom; i++)
290  {
291  /* Read atom record */
292  if(!fgets(buffer,160,fp)) return(cssr);
293  TERMINATE(buffer);
294 
295  /* Allocate space */
296  if(cssr == NULL)
297  {
298  INIT(cssr, CSSR);
299  p = cssr;
300  }
301  else
302  {
303  ALLOCNEXT(p, CSSR);
304  }
305 
306  /* Check allocation */
307  if(p==NULL)
308  {
309  if(cssr != NULL) FREELIST(cssr,CSSR);
310  return(NULL);
311  }
312 
313  /* V1.1: Initialise all links to zero */
314  p->link[0] = p->link[1] = p->link[2] = p->link[3] =
315  p->link[4] = p->link[5] = p->link[6] = p->link[7] = 0;
316 
317  sscanf(buffer,"%d%s%lf%lf%lf%d%d%d%d%d%d%d%d",&p->atnum,
318  p->atnam,
319  &p->x,
320  &p->y,
321  &p->z,
322  &p->link[0],
323  &p->link[1],
324  &p->link[2],
325  &p->link[3],
326  &p->link[4],
327  &p->link[5],
328  &p->link[6],
329  &p->link[7]);
330  if(!nocharges)
331  sscanf(buffer+73,"%lf",&p->charge);
332  else
333  p->charge = 0.0;
334 
335  sscanf(buffer+83,"%d",&p->group);
336 
337  }
338 
339  /* Normalise if necessary */
340  if(!orthonormal) blNormaliseCSSR(cssr,cell,alpha,beta,gamma);
341 
342  return(cssr);
343 }
344 
345 /************************************************************************/
346 /*>PDB *blReadCSSRasPDB(FILE *fp, int *natom)
347  ------------------------------------------
348 *//**
349 
350  \param[in] *fp A pointer to type FILE in which the
351  CSSR file is stored.
352  \param[out] *natom Number of atoms read.
353  \return A pointer to the first allocated item of
354  the PDB linked list
355 
356  Read a CSSR file into a PDB linked list
357 
358 - 06.09.91 Original
359 - 01.06.92 Documented
360 - 10.06.93 Returns TRUE or FALSE to indicate success
361 - 09.07.93 Changed allocation scheme. Now returns pointer to start of
362  list. No need to call init_pdb
363 - 13.07.93 Returns NULL if allocation failed
364 - 27.07.93 Changed I/O to double precision
365 - 07.07.14 Use bl prefix for functions By: CTP
366 - 15.08.14 Use CLEAR_PDB() By: CTP
367 */
369  int *natom)
370 {
371  char buffer[160],
372  code[8];
373  REAL cell[3],
374  alpha, beta, gamma;
375  int orthonormal,
376  nocharges,
377  i,
378  link[8];
379  char title[80],
380  name[80];
381  PDB *pdb = NULL,
382  *p;
383 
384  /* Initilialise cell parameters, etc. */
385  cell[0] = cell[1] = cell[2] = 1.0;
386  alpha = beta = gamma = 90.0;
387  name[0] = title[0] = '\0';
388 
389  *natom = 0;
390 
391  /*** Record 1 ***/
392  if(!fgets(buffer,160,fp)) return(NULL);
393  TERMINATE(buffer);
394 
395  if(strlen(buffer) >= 28)
396  {
397  /* We can get a code name */
398  strncpy(code,buffer+22,6);
399  code[6] = '\0';
400  }
401 
402  if(strlen(buffer) >= 62)
403  {
404  /* We can get unit cell parameters */
405  sscanf(buffer+38,"%lf%lf%lf",&cell[0],&cell[1],&cell[2]);
406  }
407 
408  /*** Record 2 ***/
409  if(!fgets(buffer,160,fp)) return(NULL);
410  TERMINATE(buffer);
411 
412  if(strlen(buffer) >= 45)
413  {
414  /* We can get cell angles */
415  sscanf(buffer+21,"%lf%lf%lf",&alpha,&beta,&gamma);
416  }
417 
418  /*** Record 3 ***/
419  if(!fgets(buffer,160,fp)) return(NULL);
420  TERMINATE(buffer);
421 
422  sscanf(buffer,"%d%d",natom,&orthonormal);
423  strcpy(name,buffer+9);
424 
425  /*** Record 4 ***/
426  if(!fgets(buffer,160,fp)) return(NULL);
427  TERMINATE(buffer);
428 
429  sscanf(buffer+4,"%d",&nocharges);
430  if(nocharges != 1) nocharges = 0;
431  strcpy(title,buffer+7);
432 
433  /*** Remaining records represent the atoms... ***/
434  for(i=0; i < *natom; i++)
435  {
436  if(!fgets(buffer,160,fp)) return(pdb);
437  TERMINATE(buffer);
438 
439  /* Allocate space */
440  if(pdb == NULL)
441  {
442  INIT(pdb, PDB);
443  p = pdb;
444  }
445  else
446  {
447  ALLOCNEXT(p, PDB);
448  }
449 
450  /* Check allocation */
451  if(p==NULL)
452  {
453  if(pdb==NULL) FREELIST(pdb, PDB);
454  return(NULL);
455  }
456 
457  /* Clear pdb */
458  CLEAR_PDB(p);
459 
460  sscanf(buffer,"%d%s%lf%lf%lf%d%d%d%d%d%d%d%d",&p->atnum,
461  p->atnam,
462  &p->x,
463  &p->y,
464  &p->z,
465  &link[0],
466  &link[1],
467  &link[2],
468  &link[3],
469  &link[4],
470  &link[5],
471  &link[6],
472  &link[7]);
473  strcpy(p->record_type,"ATOM ");
474  blPadterm(p->atnam,4);
475  strcpy(p->resnam,"ATM ");
476  strcpy(p->insert," ");
477  strcpy(p->chain," ");
478  p->occ = 1.0;
479  p->resnum = 1;
480  p->next = NULL;
481 
482  if(!nocharges)
483  sscanf(buffer+73,"%lf",&p->bval);
484  else
485  p->bval = 0.0;
486  }
487 
488  /* Normalise if necessary */
489  if(!orthonormal) blNormalisePDB(pdb,cell,alpha,beta,gamma);
490 
491  return(pdb);
492 }
493 
494 /************************************************************************/
495 /*>void blNormaliseCSSR(CSSR *cssr, REAL cell[3], REAL alpha,
496  REAL beta, REAL gamma)
497  ----------------------------------------------------------
498 *//**
499 
500  \param[in,out] *cssr Pointer to CSSR linked list
501  \param[in] cell Unit cell dimensions
502  \param[in] alpha Unit cell angles
503  \param[in] beta
504  \param[in] gamma
505 
506  Convert a CSSR linked list in fractional coordinates to orthonormal
507 
508 - 06.09.91 Original
509 - 01.06.92 Documented
510 - 10.06.93 void return
511 - 07.07.14 Use bl prefix for functions By: CTP
512 */
514  REAL cell[3],
515  REAL alpha,
516  REAL beta,
517  REAL gamma)
518 {
519  int ncode = 1, /* Assume a* along X and c* || Z */
520  isw = 0; /* Fractional-->Orthonormal */
521  REAL matrix[3][3], /* Normalisation matrix */
522  tempx,tempy,tempz; /* Used during matrix multiplication */
523  CSSR *p;
524 
525  blOrtho(cell,alpha,beta,gamma,matrix,isw,ncode);
526 
527  /* Now multiply the coordinates by the matrix */
528  for(p=cssr;p;NEXT(p))
529  {
530 /**** Original code has this which uses only the RU part of the matrix...
531  tempz = p->x * matrix[2][0] +
532  p->y * matrix[2][1] +
533  p->z * matrix[2][2];
534  tempy = p->x * matrix[1][0] +
535  p->y * matrix[1][1];
536  tempx = p->x * matrix[0][0];
537 ****/
538  tempx = p->x * matrix[0][0] +
539  p->y * matrix[0][1] +
540  p->z * matrix[0][2];
541  tempy = p->x * matrix[1][0] +
542  p->y * matrix[1][1] +
543  p->z * matrix[1][2];
544  tempz = p->x * matrix[2][0] +
545  p->y * matrix[2][1] +
546  p->z * matrix[2][2];
547 
548 
549  p->x = tempx;
550  p->y = tempy;
551  p->z = tempz;
552  }
553 }
554 
555 /************************************************************************/
556 /*>void blNormalisePDB(PDB *pdb, REAL cell[3], REAL alpha,
557  REAL beta, REAL gamma)
558  -------------------------------------------------------
559 *//**
560 
561  \param[in,out] *pdb Pointer to PDB linked list
562  \param[in] cell Unit cell dimensions
563  \param[in] alpha Unit cell angles
564  \param[in] beta
565  \param[in] gamma
566 
567  Convert a PDB linked list in fractional cooridinates to orthonormal
568 
569 - 06.09.91 Original
570 - 01.06.92 Documented
571 - 10.06.93 void return
572 - 07.07.14 Use bl prefix for functions By: CTP
573 */
574 void blNormalisePDB(PDB *pdb,
575  REAL cell[3],
576  REAL alpha,
577  REAL beta,
578  REAL gamma)
579 {
580  int ncode = 1, /* Assume a* along X and c* || Z */
581  isw = 0; /* Fractional-->Orthonormal */
582  REAL matrix[3][3], /* Normalisation matrix */
583  tempx,tempy,tempz; /* Used during matrix multiplication */
584  PDB *p;
585 
586  blOrtho(cell,alpha,beta,gamma,matrix,isw,ncode);
587 
588  /* Now multiply the coordinates by the matrix */
589  for(p=pdb;p;NEXT(p))
590  {
591  tempx = p->x * matrix[0][0] +
592  p->y * matrix[0][1] +
593  p->z * matrix[0][2];
594  tempy = p->x * matrix[1][0] +
595  p->y * matrix[1][1] +
596  p->z * matrix[1][2];
597  tempz = p->x * matrix[2][0] +
598  p->y * matrix[2][1] +
599  p->z * matrix[2][2];
600 
601 
602  p->x = tempx;
603  p->y = tempy;
604  p->z = tempz;
605  }
606 }
607 
608 /************************************************************************/
609 /*>void blOrtho(REAL cell[3], REAL alpha, REAL beta, REAL gamma,
610  REAL amatrx[3][3], int isw, int ncode)
611  -----------------------------------------------------------
612 *//**
613 
614  \param[in] cell Unit cell dimensions
615  \param[in] alpha Unit cell angles
616  \param[in] beta
617  \param[in] gamma
618  \param[out] amatrx Returned conversion matrix
619  \param[in] isw 0: Frac-->Ortho, 1: Ortho-->Frac
620  \param[in] ncode Orientation of reciprocal axes wrt true axes.
621 
622 \verbatim
623  ncode Orientation of reciprocal axes wrt true axes.
624 
625  1: a || xo, c* || zo
626  2: b || xo, a* || zo
627  3: c || xo, b* || zo
628  4: hex a & b || xo, c* || zo
629  5: a* || xo, c || zo
630 \endverbatim
631 
632  Function to calculate a matrix which will convert between fractional and
633  orthonormal coordinates given unit cell dimensions and angles.
634  ncode defines the orientation of the reciprocal axes wrt the real axes.
635 
636  See Rollett `Computing Methods in Crystallography' p.23
637 
638 - 06.09.91 Original
639 - 01.06.92 Documented
640 - 10.06.93 void return
641 - 07.07.14 Use bl prefix for functions By: CTP
642 */
643 void blOrtho(REAL cell[3], /* Cell dimensions */
644  REAL alpha, /* Cell angles */
645  REAL beta,
646  REAL gamma,
647  REAL amatrx[3][3], /* Returned conversion matrix */
648  int isw, /* 0: Frac-->Ortho, 1: Ortho-->Frac */
649  int ncode) /* Orientation of reciprocal axes */
650 {
651  REAL ro[3][3],
652  rf[3][3],
653  conv = PI/180.0,
654  a = cell[0],
655  b = cell[1],
656  c = cell[2],
657  sina, cosa,
658  sinb, cosb,
659  sing, cosg,
660  sinas, cosas,
661  sinbs, cosbs,
662  sings, cosgs;
663  int i, j;
664 
665  /* Convert angles to rad's */
666  alpha *= conv;
667  beta *= conv;
668  gamma *= conv;
669 
670  /* Check code */
671  if(ncode==0) ncode = 1;
672 
673 
674  /* Get sin's and cos's */
675  sina = (REAL)sin((double)alpha);
676  cosa = (REAL)cos((double)alpha);
677  sinb = (REAL)sin((double)beta);
678  cosb = (REAL)cos((double)beta);
679  sing = (REAL)sin((double)gamma);
680  cosg = (REAL)cos((double)gamma);
681  cosbs = (cosa*cosg-cosb)/(sina*sing);
682  sinbs = sqrt(1.0-cosbs*cosbs);
683  cosas = (cosg*cosb-cosa)/(sinb*sing);
684  sinas = sqrt(1.0-cosas*cosas);
685  cosgs = (cosa*cosb-cosg)/(sina*sinb);
686  sings = sqrt(1.0-cosgs*cosgs);
687 
688  for(i=0;i<3;i++)
689  for(j=0;j<3;j++)
690  ro[i][j] = 0.0;
691 
692  switch(ncode)
693  {
694  case 1:
695  /* Brookhaven convention */
696  ro[0][0] = a;
697  ro[0][1] = b*cosg;
698  ro[0][2] = c*cosb;
699  ro[1][0] = 0.0;
700  ro[1][1] = b*sing;
701  ro[1][2] = -c*sinb*cosas;
702  ro[2][0] = 0.0;
703  ro[2][1] = 0.0;
704  ro[2][2] = c*sinb*sinas;
705  break;
706  case 2:
707  ro[0][0] = a*cosg;
708  ro[0][1] = b;
709  ro[0][2] = c*cosa;
710  ro[1][0] = -a*sing*cosbs;
711  ro[1][1] = 0.0;
712  ro[1][2] = c*sina;
713  ro[2][0] = a*sing*sinbs;
714  ro[2][1] = 0.0;
715  ro[2][2] = 0.0;
716  break;
717  case 3:
718  ro[1][0] = a*sinb;
719  ro[1][1] = -b*sina*cosgs;
720  ro[1][2] = 0.0;
721  ro[2][0] = 0.0;
722  ro[2][1] = b*sina*sings;
723  ro[2][2] = 0.0;
724  ro[0][0] = a*cosb;
725  ro[0][1] = b*cosa;
726  ro[0][2] = c;
727  break;
728  case 4:
729  /* Gerard Bricogne's orthogonal System for P3:
730  xo = a + b
731  yo = -a + b
732  */
733  ro[0][0] = a/2.0;
734  ro[0][1] = a/2.0;
735  ro[0][2] = 0.0;
736  ro[1][0] = -a*sing;
737  ro[1][1] = a*sing;
738  ro[1][2] = 0.0;
739  ro[2][0] = 0.0;
740  ro[2][1] = 0.0;
741  ro[2][2] = c;
742  break;
743  case 5:
744  /* Rollet matrix as used in Cambridge */
745  ro[0][0] = a*sinb*sings;
746  ro[0][1] = 0.0;
747  ro[0][2] = 0.0;
748  ro[1][0] = -a*sinb*cosgs;
749  ro[1][1] = b*sina;
750  ro[1][2] = 0.0;
751  ro[2][0] = a*cosb;
752  ro[2][1] = b*cosa;
753  ro[2][2] = c;
754  break;
755  }
756 
757  blInvert33(ro,rf);
758  for(i=0;i<3;i++)
759  {
760  for(j=0;j<3;j++)
761  {
762  if(isw)
763  amatrx[j][i] = rf[j][i];
764  else
765  amatrx[j][i] = ro[j][i];
766  }
767  }
768 
769 }
770 
Defines for CSSR handling.
#define ALLOCNEXT(x, y)
Definition: macros.h:251
void blNormaliseCSSR(CSSR *cssr, REAL cell[3], REAL alpha, REAL beta, REAL gamma)
Definition: ReadCSSR.c:513
#define NULL
Definition: array2.c:99
Definition: pdb.h:298
#define PI
Definition: macros.h:215
void blPadterm(char *string, int length)
Definition: padterm.c:117
#define CLEAR_PDB(p)
Definition: pdb.h:460
#define NEXT(x)
Definition: macros.h:249
void blOrtho(REAL cell[3], REAL alpha, REAL beta, REAL gamma, REAL amatrx[3][3], int isw, int ncode)
Definition: ReadCSSR.c:643
REAL x
Definition: cssr.h:66
Useful macros.
#define TERMINATE(x)
Definition: macros.h:366
double REAL
Definition: MathType.h:67
REAL z
Definition: pdb.h:300
PDB * blReadCSSRasPDB(FILE *fp, int *natom)
Definition: ReadCSSR.c:368
CSSR * blReadCSSR(FILE *fp, int *natom, char *name, char *title)
Definition: ReadCSSR.c:224
Definition: cssr.h:63
Include file for matrix operations.
REAL z
Definition: cssr.h:66
Header file for general purpose routines.
REAL y
Definition: cssr.h:66
#define FREELIST(y, z)
Definition: macros.h:264
#define INIT(x, y)
Definition: macros.h:244
System-type variable type definitions.
Type definitions for maths.
void blInvert33(REAL s[3][3], REAL ss[3][3])
Definition: invert33.c:102
REAL x
Definition: pdb.h:300
REAL y
Definition: pdb.h:300
void blNormalisePDB(PDB *pdb, REAL cell[3], REAL alpha, REAL beta, REAL gamma)
Definition: ReadCSSR.c:574