Bsoft  2.1.0
Bernard's software package
rwresprop.cpp
Go to the documentation of this file.
1 
9 #include "rwresprop.h"
10 #include "rwstar.h"
11 #include "mol_tags.h"
12 #include "seq_util.h"
13 #include "linked_list.h"
14 #include "utilities.h"
15 
16 // Declaration of global variables
17 extern int verbose; // Level of output to the screen
18 
19 // Internal function prototypes
25 
26 
27 // Masses from Amos Bairoch (SWISS-PROT)
28 // Volumes from:
29 // Tsai J, Taylor R, Chothia C, Gerstein M.
30 // The packing density in proteins: standard radii and volumes.
31 // J Mol Biol. 1999 Jul 2;290(1):253-66.
32 // Side-chain extensions according to Walther et al. 1996, 255, 536-553.
33 // only for ACFGILMVW
34 // others are guesses with sigma = 0.5
35 // Hydrophobicity according to the GES scale
36 struct resprop { char code; float mass, vol, ext, extsd, charge, hphob; }
37 defaultprops[] = {
38  {'-', 0.00, 0.0, 0.0, 0.00, 0.0, 0.0},
39  {'*', 0.00, 0.0, 0.0, 0.00, 0.0, 0.0},
40  {'A', 89.09, 89.0, 3.4, 0.10, 0.0, -1.6},
41  {'B', 132.61, 118.0, 5.5, 0.50, -0.5, 7.0},
42  {'C', 121.15, 103.0, 4.4, 0.24, 0.0, -2.0},
43  {'D', 133.10, 114.0, 5.5, 0.50, -1.0, 9.2},
44  {'E', 147.13, 139.0, 6.1, 0.50, -1.0, 8.2},
45  {'F', 165.19, 199.0, 6.7, 0.32, 0.0, -3.7},
46  {'G', 75.07, 64.0, 2.3, 0.07, 0.0, -1.0},
47  {'H', 155.16, 157.0, 6.0, 0.50, 0.5, 3.0},
48  {'I', 131.17, 163.0, 5.1, 0.22, 0.0, -3.1},
49  {'K', 146.19, 165.0, 6.7, 0.50, 1.0, 8.8},
50  {'L', 131.17, 163.0, 5.5, 0.20, 0.0, -2.8},
51  {'M', 149.21, 166.0, 6.1, 0.45, 0.0, -3.4},
52  {'N', 132.12, 122.0, 5.5, 0.50, 0.0, 4.8},
53  {'P', 115.13, 122.0, 4.4, 0.50, 0.0, 0.2},
54  {'Q', 146.15, 147.0, 6.1, 0.50, 0.0, 4.1},
55  {'R', 174.23, 191.0, 7.3, 0.50, 1.0, 12.0},
56  {'S', 105.09, 94.0, 4.4, 0.50, 0.0, -0.6},
57  {'T', 119.12, 120.0, 4.5, 0.50, 0.0, -1.2},
58  {'V', 117.15, 138.0, 4.5, 0.12, 0.0, -2.6},
59  {'W', 204.23, 226.0, 7.4, 0.61, 0.0, -1.9},
60  {'X', 128.16, 144.0, 5.5, 0.50, 0.0, 0.0},
61  {'Y', 181.19, 195.0, 7.3, 0.50, 0.0, 0.7},
62  {'Z', 146.64, 143.0, 6.1, 0.50, -0.5, 6.2},
63 } ;
64 
65 char defaultcode[] = "-*ABCDEFGHIKLMNPQRSTVWXYZ";
66 float defaultsim[] = {
67  1.0,1.0,-4.0,-4.0,-4.0,-4.0,-4.0,-4.0,-4.0,-4.0,-4.0,-4.0,-4.0,-4.0,-4.0,-4.0,-4.0,-4.0,-4.0,-4.0,-4.0,-4.0,-4.0,-4.0,-4.0,
68  1.0,1.0,-4.0,-4.0,-4.0,-4.0,-4.0,-4.0,-4.0,-4.0,-4.0,-4.0,-4.0,-4.0,-4.0,-4.0,-4.0,-4.0,-4.0,-4.0,-4.0,-4.0,-4.0,-4.0,-4.0,
69  -4.0,-4.0,4.0,-2.0,0.0,-2.0,-1.0,-2.0,0.0,-2.0,-1.0,-1.0,-1.0,-1.0,-2.0,-1.0,-1.0,-1.0,1.0,0.0,0.0,-3.0,0.0,-2.0,-1.0,
70  -4.0,-4.0,-2.0,4.0,-3.0,4.0,1.0,-3.0,-1.0,0.0,-3.0,0.0,-4.0,-3.0,3.0,-2.0,0.0,-1.0,0.0,-1.0,-3.0,-4.0,-1.0,-3.0,1.0,
71  -4.0,-4.0,0.0,-3.0,9.0,-3.0,-4.0,-2.0,-3.0,-3.0,-1.0,-3.0,-1.0,-1.0,-3.0,-3.0,-3.0,-3.0,-1.0,-1.0,-1.0,-2.0,-2.0,-2.0,-3.0,
72  -4.0,-4.0,-2.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.0,-4.0,0.0,-1.0,-2.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-2.0,-1.0,-1.0,0.0,0.0,-1.0,-2.0,-1.0,-1.0,-1.0,
90  -4.0,-4.0,-2.0,-3.0,-2.0,-3.0,-2.0,3.0,-3.0,2.0,-1.0,-2.0,-1.0,-1.0,-2.0,-3.0,-1.0,-2.0,-2.0,-2.0,-1.0,2.0,-1.0,7.0,-2.0,
91  -4.0,-4.0,-1.0,1.0,-3.0,1.0,4.0,-3.0,-2.0,0.0,-3.0,1.0,-3.0,-1.0,0.0,-1.0,3.0,0.0,0.0,-1.0,-2.0,-3.0,-1.0,-2.0,4.0,
92 } ;
93 
100 {
101  if ( verbose & VERB_DEBUG )
102  cout << "DEBUG get_residue_properties: Initializing atomic parameters" << endl;
103 
104  Bresidue_type* rt_curr = NULL;
105  Bresidue_type* rt_first = NULL;
106 
107  int i;
108 
109  // Residue parameter file
110  Bstring rtfile;
111  if ( filename.length() ) rtfile = filename;
112  else rtfile = "res_prop.star";
113 
114  Bstring propfile = parameter_file_path(rtfile);
115  Bstring ext = rtfile.extension();
116  if ( ext.length() ) {
117  if ( ext.contains("star") )
118  rt_first = read_residue_prop_star(propfile);
119  else
120  rt_first = read_residue_properties(propfile);
121  }
122 
123  if ( !rt_first ) {
124  if ( verbose )
125  cerr << "Warning: Residue property file " << rtfile << " not opened! Using default properties" << endl;
126  for ( i=0; i<MAXRES; i++ ) {
127  rt_curr = residue_type_add(&rt_curr, defaultprops[i].code);
128  if ( i == 1 ) rt_first = rt_curr;
129  rt_curr->mass = defaultprops[i].mass;
130  rt_curr->vol = defaultprops[i].vol;
131  rt_curr->ext = defaultprops[i].ext;
132  rt_curr->extsd = defaultprops[i].extsd;
133  rt_curr->charge = defaultprops[i].charge;
134  rt_curr->hphob = defaultprops[i].hphob;
135  }
136  }
137 
138  for ( i=0, rt_curr = rt_first; rt_curr; rt_curr = rt_curr->next, i++ ) ;
139 
140  if ( verbose & VERB_DEBUG )
141  cout << "DEBUG get_residue_properties: Number of residue types = " << i << endl;
142 
143  return rt_first;
144 }
145 
153 {
154  int err = write_residue_prop_star(filename, rt);
155 
156  return err;
157 }
158 
165 {
166  int i;
167  Bresidue_matrix* resmat = NULL;
168 
169  // Matrix file
170  Bstring matfile;
171  if ( filename.c_str() ) matfile = filename;
172  else matfile = "blosum62.star";
173 
174  Bstring propfile = parameter_file_path(matfile);
175  Bstring ext = matfile.extension();
176  if ( ext.length() ) {
177  if ( ext.contains("star") )
178  resmat = read_residue_mat_star(propfile);
179  }
180 
181  if ( !resmat ) {
182  resmat = new Bresidue_matrix;
183  memset(resmat, 0, sizeof(Bresidue_matrix));
184  resmat->n = MAXRES;
185  resmat->c = defaultcode;
186  resmat->m = new float[resmat->n*resmat->n];
187  for ( i=0; i<resmat->n*resmat->n; i++ ) resmat->m[i] = defaultsim[i];
188  }
189 
190  if ( verbose & VERB_DEBUG ) {
191  cout << "DEBUG get_residue_matrix: Matrix from file " << matfile << endl;
192  for ( int i=0; i<resmat->n; i++ ) {
193  cout << resmat->c[i];
194  for ( int j=0; j<resmat->n; j++ )
195  cout << tab << resmat->m[resmat->n*j+i];
196  cout << endl;
197  }
198  }
199 
200  return resmat;
201 }
202 
209 {
210  if ( !resmat ) return 0;
211 
212  resmat->c = 0;
213 
214  if ( resmat->m ) delete[] resmat->m;
215 
216  delete resmat;
217 
218  return 0;
219 }
220 
222 {
223  Bresidue_type* this_rtype = *rtype;
224  Bresidue_type* new_rtype = new Bresidue_type;
225  memset(new_rtype, 0, sizeof(Bresidue_type));
226 
227  new_rtype->c = c;
228  getcode3(c, new_rtype->cod);
229 
230  if ( !this_rtype )
231  *rtype = new_rtype;
232  else {
233  while ( this_rtype->next ) this_rtype = this_rtype->next;
234  this_rtype->next = new_rtype;
235  }
236 
237  return new_rtype;
238 }
239 
241 {
242  int err(0);
243 
244  Bstar* star = init_star();
245  Bresidue_type* rt = NULL;
246  Bresidue_type* rt_first = NULL;
247 
248  err = read_star(filename.c_str(), star);
249 
250  Bstar_block* block = star->block;
251  Bstar_item* item = NULL;
252  Bstring* data;
253 
254  // Find the number of residues
255  int n = item_get_number(star, RESPROP_CODE1);
256 
257  if ( err < 0 || n < 1 ) {
258  cerr << "Error: Star to residue properties conversion unsuccessful!" << endl;
259  return NULL;
260  }
261 
262  block = block_find_with_tag(star, RESPROP_CODE1);
263  item = item_find(block, RESPROP_CODE1);
264  for ( data=item->data; data; data=data->next ) {
265  rt = residue_type_add(&rt, data[0][0]);
266  if ( !rt_first ) rt_first = rt;
267  }
268  item = item_find(block, RESPROP_MASS);
269  if ( item )
270  for ( data=item->data, rt=rt_first; data && rt; data=data->next, rt=rt->next )
271  rt->mass = data->real();
272  item = item_find(block, RESPROP_VOLUME);
273  if ( item )
274  for ( data=item->data, rt=rt_first; data && rt; data=data->next, rt=rt->next )
275  rt->vol = data->real();
276  item = item_find(block, RESPROP_EXTENSION);
277  if ( item )
278  for ( data=item->data, rt=rt_first; data && rt; data=data->next, rt=rt->next )
279  rt->ext = data->real();
280  item = item_find(block, RESPROP_EXTSTDEV);
281  if ( item )
282  for ( data=item->data, rt=rt_first; data && rt; data=data->next, rt=rt->next )
283  rt->extsd = data->real();
284  item = item_find(block, RESPROP_HYDROPHOBICITY);
285  if ( item )
286  for ( data=item->data, rt=rt_first; data && rt; data=data->next, rt=rt->next )
287  rt->hphob = data->real();
288  item = item_find(block, RESPROP_CHARGE);
289  if ( item )
290  for ( data=item->data, rt=rt_first; data && rt; data=data->next, rt=rt->next )
291  rt->charge = data->real();
292  item = item_find(block, RESPROP_H);
293  if ( item )
294  for ( data=item->data, rt=rt_first; data && rt; data=data->next, rt=rt->next )
295  rt->comp[0] = data->real();
296  item = item_find(block, RESPROP_C);
297  if ( item )
298  for ( data=item->data, rt=rt_first; data && rt; data=data->next, rt=rt->next )
299  rt->comp[1] = data->real();
300  item = item_find(block, RESPROP_N);
301  if ( item )
302  for ( data=item->data, rt=rt_first; data && rt; data=data->next, rt=rt->next )
303  rt->comp[2] = data->real();
304  item = item_find(block, RESPROP_O);
305  if ( item )
306  for ( data=item->data, rt=rt_first; data && rt; data=data->next, rt=rt->next )
307  rt->comp[3] = data->real();
308  item = item_find(block, RESPROP_S);
309  if ( item )
310  for ( data=item->data, rt=rt_first; data && rt; data=data->next, rt=rt->next )
311  rt->comp[4] = data->real();
312 
313  kill_star(star);
314 
315  return rt_first;
316 }
317 
319 {
320  if ( !rt ) return 0;
321 
322  int err(0), loop, n = count_list((char *)rt);
323 
324  if ( n < 1 ) return 0;
325 
326  Bstar* star = init_star();
327  Bstar_block* block = (Bstar_block *) add_item((char **)&star->block, sizeof(Bstar_block));
328 
329  item_put_list(block, RESPROP_CODE1, (char *) rt,
330  (char *)&rt->c - (char *)rt, "%s");
331  item_put_list(block, RESPROP_MASS, (char *) rt,
332  (char *)&rt->mass - (char *)rt, "%7.3f");
333  item_put_list(block, RESPROP_VOLUME, (char *) rt,
334  (char *)&rt->vol - (char *)rt, "%7.3f");
335  item_put_list(block, RESPROP_EXTENSION, (char *) rt,
336  (char *)&rt->ext - (char *)rt, "%7.3f");
337  item_put_list(block, RESPROP_EXTSTDEV, (char *) rt,
338  (char *)&rt->extsd - (char *)rt, "%7.3f");
339  item_put_list(block, RESPROP_HYDROPHOBICITY, (char *) rt,
340  (char *)&rt->hphob - (char *)rt, "%7.3f");
341  item_put_list(block, RESPROP_CHARGE, (char *) rt,
342  (char *)&rt->charge - (char *)rt, "%7.3f");
343  loop = item_index(block, RESPROP_CODE1);
344  loop_set_identifier(block, loop, 1, "residue_property");
345 
346  err = write_star(filename.c_str(), star);
347 
348  kill_star(star);
349 
350  if ( err < 0 ) n = err;
351 
352  return n;
353 }
354 
356 {
357  Bresidue_type* rt_curr = NULL;
358  Bresidue_type* rt_first = NULL;
359 
360  // Open property file read only
361  FILE *fprop;
362  if ( ( fprop = fopen(filename.c_str(), "r") ) == NULL ) return NULL;
363 
364  if ( verbose )
365  cout << "Reading file: " << filename << endl;
366 
367  // The property list column headers are recognized by one of a set of
368  // expected strings (such "Mass" or "MW" or "VOL")
369  int i, n;
370  int headflag(0), nhead(0), nrow(0);
371  int imass = -1, ivol = -1, iext = -1, iextsd = -1, icharge = -1, ihphob = -1;
372  float val[32];
373  int nrechead = 8;
374  const char* rechead[] = {" MW"," MAS"," VOL"," EXT"," EXTSD"," HP"," HYD"," CH"};
375 
376  // Parse the file
377  char aline[128], *aptr;
378  Bstring string, *itemlist, *item;
379  while ( fgets(aline, 100, fprop) != NULL ) {
380  string = aline;
381  if ( string.length() < 3 ) // Blank lines = end of section
382  headflag = 0;
383  if ( headflag > 1 ) { // Read a line of properties
384  rt_curr = residue_type_add(&rt_curr, aline[0]);
385  if ( !rt_first ) rt_first = rt_curr;
386  aptr = aline + 1;
387  for ( i=0; i<nhead; i++ ) {
388  sscanf(aptr, "%f%n", &val[i], &n);
389  aptr += n;
390  }
391  if ( imass > -1 ) rt_curr->mass = val[imass];
392  if ( ivol > -1 ) rt_curr->vol = val[ivol];
393  if ( iext > -1 ) rt_curr->ext = val[iext];
394  if ( iextsd > -1 ) rt_curr->extsd = val[iextsd];
395  if ( icharge > -1 ) rt_curr->charge = val[icharge];
396  if ( ihphob > -1 ) rt_curr->hphob = val[ihphob];
397  nrow++;
398  }
399  if ( headflag == 0 ) // Check for property headers
400  for ( i=0; i<nrechead; i++ )
401  if ( string.contains(rechead[i]) ) headflag = 1;
402  if ( headflag == 1 ) {
403  itemlist = string.split();
404  for ( item = itemlist, nhead = 0; item; item = item->next, nhead++ ) {
405  if ( item->contains("MW") || item->contains("MAS") ) imass = nhead;
406  if ( item->contains("VOL") ) ivol = nhead;
407  if ( item->contains("EXT") ) iext = nhead;
408  if ( item->contains("EXTSD") ) iextsd = nhead;
409  if ( item->contains("HP") || item->contains("HYD") ) ihphob = nhead;
410  if ( item->contains("CH") || item->contains("Q") ) icharge = nhead;
411  }
412  string_kill(itemlist);
413  headflag = 100;
414  nrow = 0;
415  }
416  }
417 
418  fclose(fprop);
419 
420  return rt_first;
421 }
422 
424 {
425 /* int nres2 = item_get_number(star, RESMATRIX_SUBSTITUTION);
426  int nres = (int) sqrt(nres2);
427  char* mat_code = item_get_string_array(star, RESMATRIX2_CODE1, -1);
428  char* code1 = new char[nres+1];
429  for ( i=0; i<nres; i++ ) code1[i] = mat_code[2*i];
430  float* sim_mat = item_get_float_array(star, RESMATRIX_SUBSTITUTION, -1);*/
431  return NULL;
432 }
433 
434 
Bstar_item::data
Bstring * data
Definition: rwstar.h:43
Bstar_item
Definition: rwstar.h:36
resprop::vol
float vol
Definition: rwresprop.cpp:36
item_put_list
int item_put_list(Bstar_block *block, const char *tag, char *list, size_t offset, const char *format)
Writes a list of string or numeric values into a data item associated with a specific data block and ...
Definition: rwstar.cpp:1436
VERB_DEBUG
#define VERB_DEBUG
Definition: utilities.h:116
string_kill
int string_kill(Bstring *list)
Kills a string linked list.
Definition: Bstring.cpp:768
Bresidue_type::mass
float mass
Definition: rwresprop.h:26
item_index
int item_index(Bstar_block *block, const char *tag)
Gets the STAR item associated with a tag in a STAR data block.
Definition: rwstar.cpp:1029
Bresidue_type::c
char c
Definition: rwresprop.h:24
Bstring
Definition: Bstring.h:29
add_item
char * add_item(char **list, unsigned long size)
Adds an item to a linked list.
Definition: linked_list.cpp:26
Bstring::extension
Bstring extension()
Definition: Bstring.cpp:523
Bresidue_matrix::c
Bstring c
Definition: rwresprop.h:46
resprop::charge
float charge
Definition: rwresprop.cpp:36
Bresidue_type::next
Bresidue_type * next
Definition: rwresprop.h:23
RESPROP_VOLUME
#define RESPROP_VOLUME
Definition: mol_tags.h:84
resprop
Definition: rwresprop.cpp:36
RESPROP_H
#define RESPROP_H
Definition: mol_tags.h:89
defaultprops
struct resprop defaultprops[]
parameter_file_path
Bstring parameter_file_path(Bstring filename)
Finds the parameter file path.
Definition: Bstring.cpp:795
loop_set_identifier
int loop_set_identifier(Bstar_block *block, int loop, int n,...)
Assigns a loop identification number to items.
Definition: rwstar.cpp:1803
Bresidue_type::extsd
float extsd
Definition: rwresprop.h:29
Bstring::real
double real()
Definition: Bstring.cpp:553
RESPROP_HYDROPHOBICITY
#define RESPROP_HYDROPHOBICITY
Definition: mol_tags.h:87
get_residue_matrix
Bresidue_matrix * get_residue_matrix(Bstring &filename)
Reading a residue matrix from a file.
Definition: rwresprop.cpp:164
length
double length(vector< T > v)
Definition: Vector3.h:530
RESPROP_EXTENSION
#define RESPROP_EXTENSION
Definition: mol_tags.h:85
count_list
long count_list(char *list)
Counts the number of items in a linked list.
Definition: linked_list.cpp:235
read_residue_prop_star
Bresidue_type * read_residue_prop_star(Bstring &filename)
Definition: rwresprop.cpp:240
rwresprop.h
Header file for reading residue property files.
RESPROP_S
#define RESPROP_S
Definition: mol_tags.h:93
Bstring::c_str
const char * c_str()
Definition: Bstring.h:70
read_residue_properties
Bresidue_type * read_residue_properties(Bstring &filename)
Definition: rwresprop.cpp:355
residue_type_add
Bresidue_type * residue_type_add(Bresidue_type **rtype, char c)
Definition: rwresprop.cpp:221
RESPROP_C
#define RESPROP_C
Definition: mol_tags.h:90
Bresidue_type::charge
float charge
Definition: rwresprop.h:30
residue_matrix_kill
int residue_matrix_kill(Bresidue_matrix *resmat)
Deallocating a residue matrix.
Definition: rwresprop.cpp:208
write_star
int write_star(const char *filename, Bstar *star)
Writes a STAR data base to one or more STAR format files.
Definition: rwstar.cpp:666
mol_tags.h
All STAR file format tags for molecules and molecular parameters.
defaultcode
char defaultcode[]
Definition: rwresprop.cpp:65
verbose
int verbose
write_residue_properties
int write_residue_properties(Bstring &filename, Bresidue_type *rt)
Writing residue properties from a parameter file.
Definition: rwresprop.cpp:152
RESPROP_EXTSTDEV
#define RESPROP_EXTSTDEV
Definition: mol_tags.h:86
resprop::extsd
float extsd
Definition: rwresprop.cpp:36
resprop::hphob
float hphob
Definition: rwresprop.cpp:36
read_residue_mat_star
Bresidue_matrix * read_residue_mat_star(Bstring &filename)
Definition: rwresprop.cpp:423
Bresidue_type
Definition: rwresprop.h:22
getcode3
int getcode3(char c, char *cod)
Converts a one-letter amino acid designation to the three-letter equivalent.
Definition: seq_util.cpp:510
defaultsim
float defaultsim[]
Definition: rwresprop.cpp:66
utilities.h
Header file for general utilities.
tab
ostream & tab(ostream &out)
Definition: utilities.cpp:22
Bstring::length
long length() const
Definition: Bstring.cpp:263
read_star
int read_star(const char *filename, Bstar *star)
Reads paramaters and data into a STAR data base from a list of files.
Definition: rwstar.cpp:224
seq_util.h
Header file for sequence utilities.
RESPROP_MASS
#define RESPROP_MASS
Definition: mol_tags.h:83
RESPROP_CHARGE
#define RESPROP_CHARGE
Definition: mol_tags.h:88
resprop::code
char code
Definition: rwresprop.cpp:36
kill_star
int kill_star(Bstar *star)
Destroys a STAR data base.
Definition: rwstar.cpp:132
resprop::mass
float mass
Definition: rwresprop.cpp:36
Bstring::next
Bstring * next
Definition: Bstring.h:31
Bresidue_type::ext
float ext
Definition: rwresprop.h:28
RESPROP_O
#define RESPROP_O
Definition: mol_tags.h:92
linked_list.h
Header file for generalized linked list functions.
Bstring::split
Bstring * split()
Definition: Bstring.cpp:605
item_get_number
long item_get_number(Bstar *star, const char *tag)
Gets the number of values associated with a tag in a STAR data base.
Definition: rwstar.cpp:1134
item_find
Bstar_item * item_find(Bstar_block *block, const char *tag)
Gets the STAR item associated with a tag in a STAR data block.
Definition: rwstar.cpp:1083
rwstar.h
A header file for STAR format files.
RESPROP_N
#define RESPROP_N
Definition: mol_tags.h:91
RESPROP_CODE1
#define RESPROP_CODE1
Definition: mol_tags.h:81
Bstar::block
Bstar_block * block
Definition: rwstar.h:82
write_residue_prop_star
int write_residue_prop_star(Bstring &filename, Bresidue_type *rt)
Definition: rwresprop.cpp:318
Bstring::contains
bool contains(const Bstring &s)
Definition: Bstring.cpp:592
Bresidue_type::hphob
float hphob
Definition: rwresprop.h:31
Bresidue_type::comp
float comp[5]
Definition: rwresprop.h:32
Bresidue_type::cod
char cod[3]
Definition: rwresprop.h:25
Bresidue_matrix
Definition: rwresprop.h:44
Bresidue_matrix::n
int n
Definition: rwresprop.h:45
resprop::ext
float ext
Definition: rwresprop.cpp:36
Bstar_block
Definition: rwstar.h:55
Bresidue_matrix::m
float * m
Definition: rwresprop.h:47
init_star
Bstar * init_star()
Creates a STAR data base.
Definition: rwstar.cpp:111
get_residue_properties
Bresidue_type * get_residue_properties(Bstring &filename)
Reading residue properties from parameter files.
Definition: rwresprop.cpp:99
MAXRES
#define MAXRES
Definition: rwresprop.h:12
Bresidue_type::vol
float vol
Definition: rwresprop.h:27
Bstar
Definition: rwstar.h:78
block_find_with_tag
Bstar_block * block_find_with_tag(Bstar *star, const char *tag)
Gets the first block associated with a tag in a STAR data base.
Definition: rwstar.cpp:1050