| Bsoft 2.0.5 Bernard's software package

mol_alpha.cpp
Go to the documentation of this file.
1
9 #include "rwmolecule.h"
10 #include "mol_alpha.h"
11 #include "mol_transform.h"
12 #include "mol_util.h"
13 #include "Bimage.h"
14 #include "linked_list.h"
15 #include "random_numbers.h"
16 #include "Matrix3.h"
17 #include "utilities.h"
18
19 // Declaration of global variables
20 extern int verbose; // Level of output to the screen
21
22 /*
23 Records for the template residue in an alpha helix:
24 ATOM 39 N ALA S 7 1.378 -0.646 -0.926 1.00 0.00 N 0.000
25 ATOM 40 CA ALA S 7 2.303 0.000 -0.000 1.00 0.00 C 0.000
26 ATOM 41 C ALA S 7 1.599 0.860 1.028 1.00 0.00 C 0.000
27 ATOM 42 O ALA S 7 2.020 1.002 2.171 1.00 0.00 O 0.000
28 ATOM 43 CB ALA S 7 3.260 0.864 -0.824 1.00 0.00 C 0.000
29 ATOM 44 H ALA S 7 1.279 -0.316 -1.865 1.00 0.00 H 0.000
30 */
31
32 #define NTEMPATOM 6 // Number of atoms defined in template
33 #define DAXIS 2.303 // Distance between Ca and helical axis
34 #define HRISE 1.5 // Helical rise per residue
35 #define HANGLE 100 // Helical rotation per residue in degrees
36
37 struct AlphaTemplate {
38 char atomtype[8];
39 double coord[3];
40 } alpha_template[] = {
41 {"N", {1.378, -0.646, -0.926}},
42 {"CA", {2.303, 0.000, 0.000}},
43 {"C", {1.599, 0.860, 1.028}},
44 {"O", {2.020, 1.002, 2.171}},
45 {"CB", {3.260, 0.864, -0.824}},
46 {"H", {1.279, -0.316, -1.865}}
47 } ;
48
54 Bmolgroup* molgroup_generate_alpha_helix(int length)
55 {
56 Bmolgroup* molgroup = molgroup_init();
57
58 molgroup->mol = mol_generate_alpha_helix(length);
59
60 return molgroup;
61 }
62
68 Bmolecule* mol_generate_alpha_helix(int length)
69 {
70 int i, j, n;
71 char molname[8] = "A";
72 char restype[8] = "ALA";
73 Bmolecule* mol = NULL;
74 mol = molecule_add(&mol, molname);
75
76 Bsecondary* sec = (Bsecondary *) add_item((char **) &mol->sec, sizeof(Bsecondary));
77 Bresidue* res = NULL;
78 Batom* atom = NULL;
79 Matrix3 mat(1);
80 Vector3<double> shift, axis(0,0,1);
81
82 if ( verbose & VERB_PROCESS )
83 cout << "Generating an aplha helix of length " << length << endl << endl;
84
85 for ( i=n=0; i<length; i++ ) {
86 res = residue_add(&mol->res, restype);
87 res->num = i + 1;
88 mat = Matrix3(axis, HANGLE*i*M_PI/180.0);
89 shift = Vector3<double>(0, 0, HRISE*i);
90 for ( j=0; j<NTEMPATOM; j++ ) {
91 atom = atom_add(&res->atom, alpha_template[j].atomtype);
92 atom->coord[0] = alpha_template[j].coord[0];
93 atom->coord[1] = alpha_template[j].coord[1];
94 atom->coord[2] = alpha_template[j].coord[2];
95 atom->coord = mat * atom->coord;
96 atom->coord += shift;
97 atom->num = ++n;
98 atom->sel = 1;
99 }
100 }
101
102 sec->num = 1;
103 sec->id[0] = 'A';
104 sec->first = mol->res;
105 sec->last = res;
106
107 return mol;
108 }
109
117 int molgroup_set_alpha_helix(Bmolgroup* molgroup, int helix_start, int helix_end)
118 {
119 Bmolecule* mol;
120 Bsecondary* sec;
121 Bresidue* res1, *res2;
122
123 for ( mol = molgroup->mol; mol; mol = mol->next ) {
124 for ( res1 = mol->res; res1 && res1->num < helix_start; res1 = res1->next ) ;
125 if ( res1 ) {
126 for ( res2 = res1; res2->next && res2->next->num < helix_end; res2 = res2->next ) ;
127 if ( res2->next ) {
128 if ( res2->next->num == helix_end ) res2 = res2->next;
129 if ( res2 ) {
130 sec = (Bsecondary *) add_item((char **) &mol->sec, sizeof(Bsecondary));
131 sec->first = res1;
132 sec->last = res2;
133 }
134 }
135 }
136 }
137
138 return 0;
139 }
140
141
147 int molgroup_find_helical_axes(Bmolgroup* molgroup)
148 {
149 Bmolecule* mol;
150 Bsecondary* sec;
151 int i;
152 Vector3<double> c, a;
153
154 if ( verbose & VERB_PROCESS )
155 cout << "Mol\tHelix\tFirst\tLast\tLength\tCenter\t\t\tAxis" << endl;
156 for ( mol = molgroup->mol; mol; mol = mol->next ) {
157 for ( i=1, sec = mol->sec; sec; sec = sec->next, i++ ) {
158 c = alpha_find_center(sec->first, sec->last);
159 a = alpha_find_orientation(sec->first, sec->last);
160 if ( verbose & VERB_PROCESS )
161 cout << mol->id << tab << i << tab << sec->first->num << tab << sec->last->num << tab <<
162 sec->last->num - sec->first->num + 1 << tab <<
163 c[0] << tab << c[1] << tab << c[2] << tab <<
164 a[0] << tab << a[1] << tab << a[2] << endl;
165 }
166 }
167 if ( verbose & VERB_PROCESS )
168 cout << endl;
169
170 return 0;
171 }
172
179 Vector3<double> alpha_find_center(Bresidue* resfirst, Bresidue* reslast)
180 {
181 int i, n;
182 Vector3<double> ca[3];
183 Bresidue* res;
184 Batom* atom;
185
186 for ( n=1, res = resfirst; res && res != reslast; res = res->next ) n++;
187 for ( i=0, res = resfirst; res && i<n/2-1; res = res->next ) i++;
188
189 for ( i=0; res && i<3; res = res->next, i++ ) {
190 for ( atom = res->atom; atom && strncmp(atom->type, "CA", 2); atom = atom->next ) ;
191 ca[i] = atom->coord;
192 }
193
194 Vector3<double> center = point_on_helix_axis(ca[0], ca[1], ca[2]);
195
196 if ( verbose & VERB_FULL )
197 cout << "Helical center: " << center << " (" << n/2 << ")" << endl;
198
199 return center;
200 }
201
208 Vector3<double> alpha_find_orientation(Bresidue* resfirst, Bresidue* reslast)
209 {
210 int i, nca;
211 Bresidue* res;
212 Batom* atom;
213 Vector3<double> ca[1000], v1, v2, va, vas;
214
215 for ( nca=0, res = resfirst; res != reslast->next; res = res->next )
216 for ( atom = res->atom; atom; atom = atom->next )
217 if ( strncmp(atom->type, "CA", 2) == 0 )
218 ca[nca++] = atom->coord;
219
220 for ( i=0; i<nca-3; i++ ) {
221 v1 = (ca[i] + ca[i+2]) - (ca[i+1] * 2);
222 v2 = (ca[i+1] + ca[i+3]) - (ca[i+2] * 2);
223 v1.normalize();
224 v2.normalize();
225 va = v1.cross(v2);
226 va.normalize();
227 vas += va;
228 }
229
230 vas.normalize();
231
232 i = nca/2;
233 va = point_on_helix_axis(ca[i-1], ca[i], ca[i+1]);
234
235 if ( verbose & VERB_FULL ) {
236 cout << "Helical center: " << va << endl;
237 cout << "Helical axis: " << vas << endl << endl;
238 }
239
240 return vas;
241 }
242
249 Vector3<double> mol_find_alpha_orientation(Bmolecule* mol, int set_std)
250 {
251 if ( verbose & VERB_PROCESS ) {
252 cout << "Finding the helical axis:" << endl;
253 cout << "Molecule: " << mol->id << endl;
254 }
255
256 int i, nca;
257 Bresidue* res;
258 Batom* atom;
259 double dca;
260 Transform t;
261 Vector3<double> ca[1000], v1, v2, va, vas, d, ds, axis(0,0,1);
262
263 for ( nca=0, res = mol->res; res; res = res->next )
264 for ( atom = res->atom; atom; atom = atom->next )
265 if ( strncmp(atom->type, "CA", 2) == 0 )
266 ca[nca++] = atom->coord;
267
268 for ( i=0; i<nca-3; i++ ) {
269 v1 = (ca[i] + ca[i+2]) - (ca[i+1] * 2);
270 v2 = (ca[i+1] + ca[i+3]) - (ca[i+2] * 2);
271 v1.normalize();
272 v2.normalize();
273 va = v1.cross(v2);
274 va.normalize();
275 vas += va;
276 d = ((va * 1.5) + (ca[i+1] - ca[i+2])) / (v2 - v1);
277 ds += d;
278 if ( verbose & VERB_FULL )
279 cout << va << " " << d << endl;
280 }
281
282 vas.normalize();
283 d = ds / (nca-3.0);
284 dca = 0;
285 i = 0;
286 if ( isfinite(d[0]) && fabs(d[0]) > 0.5 ) {
287 dca += d[0];
288 i++;
289 }
290 if ( isfinite(d[1]) && fabs(d[1]) > 0.5 ) {
291 dca += d[1];
292 i++;
293 }
294 if ( isfinite(d[2]) && fabs(d[2]) > 0.5 ) {
295 dca += d[2];
296 i++;
297 }
298 dca /= i;
299
300 i = nca/2;
301 v1 = point_on_helix_axis(ca[i-1], ca[i], ca[i+1]);
302
303 if ( verbose & VERB_PROCESS ) {
304 cout << "Helical center: " << v1 << endl;
305 cout << "Helical axis: " << vas << endl;
306 cout << "Ca-axis distance: " << dca << " A" << endl << endl;
307 }
308
309 if ( set_std ) {
310 // i = nca/2;
311 // v1 = vector3_subtract(vector3_add(ca[i-1], ca[i+1]), vector3_scale(ca[i], 2));
312 // v1 = vector3_normalize(v1);
313
314 t.axis = vas.cross(axis);
315 t.axis.normalize();
316 t.origin = v1;
317 t.angle = vas.angle(axis);
318
319 t.trans = -t.origin;
320 if ( t.angle > 1e-20 )
321 mol_coor_rotate(mol, t);
322 else
323 mol_coor_shift(mol, t.trans);
324
325 for ( i=0, res = mol->res; res && i<nca/2; res = res->next ) i++;
326 for ( atom = res->atom; atom && strncmp(atom->type, "CA", 2); atom = atom->next ) ;
327
328 t.angle = -atan2(atom->coord[1], atom->coord[0]);
329 t.origin = 0;
330 t.axis = Vector3<double>(0,0,1);
331 t.trans = 0;
332
333 mol_coor_rotate(mol, t);
334 }
335
336 return vas;
337 }
338
349 Vector3<double> point_on_helix_axis(Vector3<double> ca1, Vector3<double> ca2, Vector3<double> ca3)
350 {
351 Vector3<double> v = (ca1 + ca3) - (ca2 * 2.0);
352
353 v.normalize();
354 v = (v * DAXIS) + ca2;
355
356 return v;
357 }
358
359 long find_closest_mean(long k, Vector3<double>* mc, Vector3<double>* ma, Vector3<double> c, Vector3<double> a, double afac)
360 {
361 long i, iclose = -1;
362 double d, dmin = 1e30, angle;
363
364 for ( i=0; i<k; i++ ) {
365 d = c.distance2(mc[i]);
366 angle = afac*a.angle(ma[i]);
367 d = sqrt(d + angle*angle);
368 if ( dmin > d ) {
369 dmin = d;
370 iclose = i;
371 }
372 }
373
374 return iclose;
375 }
376
382 Bmolgroup* molgroup_consolidate_alpha(Bmolgroup* molgroup)
383 {
384 long i, j, x, y, z, nsec;
385 double sampling = 3;
386 Bmolecule* mol, *newmol;
387 Bsecondary* sec;
388
389 for ( nsec=0, mol = molgroup->mol; mol; mol = mol->next )
390 for ( sec = mol->sec; sec; sec = sec->next ) nsec++;
391
392 if ( nsec < 1 ) {
393 cerr << "Error: No helices found!" << endl;
394 return NULL;
395 }
396
397 // Convert molecules to position and orientation vectors
398 Vector3<double>* c = new Vector3<double>[nsec];
399 Vector3<double>* a = new Vector3<double>[nsec];
400
401 for ( i=0, mol = molgroup->mol; mol; mol = mol->next ) {
402 for ( sec = mol->sec; sec; sec = sec->next, i++ ) {
403 c[i] = alpha_find_center(sec->first, sec->last);
404 a[i] = alpha_find_orientation(sec->first, sec->last);
405 }
406 }
407
408 molgroup->box = molgroup->max - molgroup->min;
409
410 // Find the number of density peaks as the number of means and their starting points
411 Bimage* p = new Bimage(Integer, TSimple,
412 (long) (molgroup->box[0]/sampling+1),
413 (long) (molgroup->box[1]/sampling+1),
414 (long) (molgroup->box[2]/sampling+1), 1);
415 p->sampling(sampling, sampling, sampling);
416
417 for ( i=0; i<nsec; i++ ) {
418 x = (long) ((c[i][0] - molgroup->min[0])/p->sampling()[0]);
419 y = (long) ((c[i][1] - molgroup->min[1])/p->sampling()[1]);
420 z = (long) ((c[i][2] - molgroup->min[2])/p->sampling()[2]);
421 j = p->index(0, x, y, z, 0);
422 p->set(j, (*p)[j] + 1);
423 }
424
425 Bimage* pseg = p->regions(1, 0);
426
427 delete p;
428
429 // write_img("t.tif", pseg, 0);
430
431 long k = (long) pseg->maximum();
432 int* n = new int[k];
433 Vector3<double>* mc = new Vector3<double>[k];
434 Vector3<double>* ma = new Vector3<double>[k];
435 Vector3<double>* mcn = new Vector3<double>[k];
436 Vector3<double>* man = new Vector3<double>[k];
437 Vector3<double>* min = new Vector3<double>[k];
438 Vector3<double>* max = new Vector3<double>[k];
439
440 for ( i=0; i<k; i++ ) n[k] = 0;
441
442 for ( i=z=0; z<pseg->sizeZ(); z++ ) {
443 for ( y=0; y<pseg->sizeY(); y++ ) {
444 for ( x=0; x<pseg->sizeX(); x++, i++ ) {
445 if ( (*pseg)[i] > 0 ) {
446 j = (long)(*pseg)[i] - 1;
447 n[j]++;
448 mc[j] += Vector3<double>(x*pseg->sampling()[0] + molgroup->min[0],
449 y*pseg->sampling()[1] + molgroup->min[1], z*pseg->sampling()[2] + molgroup->min[2]);
450 }
451 }
452 }
453 }
454
455 delete pseg;
456
457 if ( verbose & VERB_PROCESS ) {
458 cout << "Consolidating a set of helices:" << endl;
459 cout << "Number of helix groups: " << k << endl;
460 }
461
462 for ( j=0; j<k; j++ )
463 if ( n[j] ) mc[j] /= n[j];
464
465 // Do k-means iterations
466 long it = 0;
467 double afac = 0;
468 double d = 1e30;
469 while ( d > 1e-10 ) {
470 it++;
471 for ( j=0; j<k; j++ ) {
472 mcn[j] = man[j] = 0;
473 min[j] = Vector3<double>(1e30, 1e30, 1e30);
474 max[j] = Vector3<double>(-1e30, -1e30, -1e30);
475 n[j] = 0;
476 }
477 for ( i=0; i<nsec; i++ ) {
478 j = find_closest_mean(k, mc, ma, c[i], a[i], afac);
479 mcn[j] += c[i];
480 man[j] += a[i];
481 min[j] = min[j].min(c[i]);
482 max[j] = max[j].max(c[i]);
483 n[j]++;
484 }
485 d = 0;
486 if ( verbose & VERB_FULL )
487 cout << "Iteration " << it << ":" << endl;
488 for ( j=0; j<k; j++ ) {
489 if ( n[j] ) {
490 mcn[j] /= n[j];
491 man[j] /= n[j];
492 } else {
493 mcn[j] = vector3_random(molgroup->max, molgroup->min);
494 man[j] = vector3_random(-1.0, 1.0);
495 man[j].normalize();
496 }
497 if ( verbose & VERB_FULL )
498 cout << j+1 << tab << n[j] << tab <<
499 mcn[j][0] << tab << mcn[j][1] << tab << mcn[j][2] << tab <<
500 man[j][0] << tab << man[j][1] << tab << man[j][2] << endl;
501 d += mcn[j].distance2(mc[j]);
502 d += man[j].distance2(ma[j]);
503 mc[j] = mcn[j];
504 ma[j] = man[j];
505 }
506 d = sqrt(d/k);
507 afac = 10;
508 if ( verbose )
509 cout << it << tab << d << endl;
510 }
511
512 molgroup_kill(molgroup);
513
514 // Generate a new set of helices
515 molgroup = molgroup_init();
516 Bmolecule* molalpha = NULL;
517 View view;
518 Vector3<double> origin;
519 char molname = 'A';
520
521 for ( j=0; j<k; j++ ) if ( n[j] ) {
522 d = max[j].distance(min[j]);
523 molalpha = mol_generate_alpha_helix(14 + (int)(d/1.5));
524 mol_shift_to_center_of_mass(molalpha);
525 // view = View(ma[j][0], ma[j][1], ma[j][2], 0);
526 view = View(-ma[j][0], -ma[j][1], ma[j][2], 0);
527 newmol = mol_rotate_to_view(molalpha, view, origin, mc[j]);
528 newmol->id[0] = molname;
529 if ( !molgroup->mol ) molgroup->mol = newmol;
530 else mol->next = newmol;
531 mol = newmol;
532 molname++;
533 if ( molname > 'Z' ) molname = 'A';
534 molecule_kill(molalpha);
535 }
536
537 delete[] c;
538 delete[] a;
539 delete[] n;
540 delete[] mc;
541 delete[] ma;
542 delete[] mcn;
543 delete[] man;
544 delete[] min;
545 delete[] max;
546
547 return molgroup;
548 }
549
mol_rotate_to_view
Bmolecule * mol_rotate_to_view(Bmolecule *mol, View view, Vector3< double > origin, Vector3< double > trans)
Rotates a molecule to a specified view and translates it afterwards.
Definition: mol_transform.cpp:258
Bmolecule::id
Bstring id
Definition: rwmolecule.h:110
Bmolgroup::mol
Bmolecule * mol
Definition: rwmolecule.h:189
Vector3::cross
Vector3 cross(const Vector3 &v)
Definition: Vector3.h:250
AlphaTemplate::atomtype
char atomtype[8]
Definition: mol_alpha.cpp:38
vector3_random
Vector3< double > vector3_random(const double min, const double max)
Generates a random vector within a defined cube.
Definition: random_numbers.cpp:440
point_on_helix_axis
Vector3< double > point_on_helix_axis(Vector3< double > ca1, Vector3< double > ca2, Vector3< double > ca3)
Calculates a point on an alpha helix corresponding to a Ca atom.
Definition: mol_alpha.cpp:349
Vector3::normalize
double normalize()
Definition: Vector3.h:236
Bimage.h
Header file for image class.
mol_shift_to_center_of_mass
int mol_shift_to_center_of_mass(Bmolecule *mol)
Translates a set of coordinates to the center of mass.
Definition: mol_transform.cpp:645
Bimage::sampling
Vector3< double > sampling()
Definition: Bimage.h:505
mol_find_alpha_orientation
Vector3< double > mol_find_alpha_orientation(Bmolecule *mol, int set_std)
Calculates the orientation of an alpha helix.
Definition: mol_alpha.cpp:249
NTEMPATOM
#define NTEMPATOM
Definition: mol_alpha.cpp:32
Bimage::regions
Bimage * regions(double threshold, int sign)
Segments an image into contiguous regions.
Definition: Bimage_segment.cpp:58
utilities.h
Header file for general utilities.
molecule_kill
int molecule_kill(Bmolecule *mol)
Destroys a molecule.
Definition: rwmolecule.cpp:417
mol_coor_shift
int mol_coor_shift(Bmolecule *mol, Vector3< double > shift)
Translates a molecule.
Definition: mol_transform.cpp:56
Bmolecule::res
Bresidue * res
Definition: rwmolecule.h:122
Transform::angle
double angle
Definition: Transform.h:29
Integer
Definition: utilities.h:154
molgroup_consolidate_alpha
Bmolgroup * molgroup_consolidate_alpha(Bmolgroup *molgroup)
Cluster a set of alpha helices to consolidate helices.
Definition: mol_alpha.cpp:382
Bimage::index
long index(long nx, long ny) const
Definition: Bimage.h:383
AlphaTemplate::coord
double coord[3]
Definition: mol_alpha.cpp:39
add_item
char * add_item(char **list, unsigned long size)
Adds an item to a linked list.
Definition: linked_list.cpp:26
Matrix3
Definition: Matrix3.h:17
mol_alpha.h
Header for functions to make and analyze alpha helices.
mol_generate_alpha_helix
Bmolecule * mol_generate_alpha_helix(int length)
Generates an alpha helix of the desired length.
Definition: mol_alpha.cpp:68
molgroup_set_alpha_helix
int molgroup_set_alpha_helix(Bmolgroup *molgroup, int helix_start, int helix_end)
Sets a residue range to an alpha helix in all molecules.
Definition: mol_alpha.cpp:117
mol_transform.h
Library routines used for atomic coordinate transformations.
Bsecondary::num
int num
Definition: rwmolecule.h:90
alpha_find_center
Vector3< double > alpha_find_center(Bresidue *resfirst, Bresidue *reslast)
Calculates the center of an alpha helix.
Definition: mol_alpha.cpp:179
VERB_PROCESS
#define VERB_PROCESS
Definition: utilities.h:107
molgroup_generate_alpha_helix
Bmolgroup * molgroup_generate_alpha_helix(int length)
Generates an alpha helix of the desired length.
Definition: mol_alpha.cpp:54
Bsecondary::next
Bsecondary * next
Definition: rwmolecule.h:88
Vector3::distance
double distance(const Vector3 &v)
Definition: Vector3.h:227
Matrix3.h
3x3 Matrix manipulation functions
TSimple
Definition: Bimage.h:58
residue_add
Bresidue * residue_add(Bresidue **res, const char *type)
Adds a residue to a linked list.
Definition: rwmolecule.cpp:113
Batom::sel
int sel
Definition: rwmolecule.h:34
verbose
int verbose
Bmolgroup::box
Vector3< double > box
Definition: rwmolecule.h:184
DAXIS
#define DAXIS
Definition: mol_alpha.cpp:33
Bmolecule::sec
Bsecondary * sec
Definition: rwmolecule.h:123
mol_util.h
Library routines used for atomic coordinates.
Batom::type
char type[8]
Definition: rwmolecule.h:28
Vector3::max
Type max()
Definition: Vector3.h:175
Bimage
General image parameter class.
Definition: Bimage.h:163
Batom::num
int num
Definition: rwmolecule.h:26
Vector3::distance2
double distance2(const Vector3 &v)
Definition: Vector3.h:228
Transform
Definition: Transform.h:24
M_PI
#define M_PI
Definition: utilities.h:59
linked_list.h
Header file for generalized linked list functions.
Bsecondary::last
Bresidue * last
Definition: rwmolecule.h:95
isfinite
bool isfinite(complex< T > &value)
rwmolecule.h
Header file for reading reflection files.
Bmolgroup
Definition: rwmolecule.h:170
HRISE
#define HRISE
Definition: mol_alpha.cpp:34
Bimage::maximum
double maximum()
Definition: Bimage.h:535
HANGLE
#define HANGLE
Definition: mol_alpha.cpp:35
Bsecondary::id
char id[4]
Definition: rwmolecule.h:91
Vector3::angle
double angle(Vector3< T2 > &v)
Definition: Vector3.h:257
molgroup_kill
int molgroup_kill(Bmolgroup *molgroup)
Destroys a molecule group.
Definition: rwmolecule.cpp:374
length
double length(vector< T > v)
Definition: Vector3.h:528
molgroup_init
Bmolgroup * molgroup_init()
Initializes and allocates a new molecule group.
Definition: rwmolecule.cpp:45
Bmolecule::next
Bmolecule * next
Definition: rwmolecule.h:108
molecule_add
Bmolecule * molecule_add(Bmolecule **mol, char *name)
Adds a molecule to a linked list.
Definition: rwmolecule.cpp:76
Bmolgroup::max
Vector3< double > max
Definition: rwmolecule.h:183
Transform::trans
Vector3< double > trans
Definition: Transform.h:30
Bresidue::atom
Batom * atom
Definition: rwmolecule.h:54
Bmolecule
Definition: rwmolecule.h:107
alpha_find_orientation
Vector3< double > alpha_find_orientation(Bresidue *resfirst, Bresidue *reslast)
Calculates the orientation of an alpha helix.
Definition: mol_alpha.cpp:208
mol_coor_rotate
int mol_coor_rotate(Bmolecule *mol, Transform t)
Rotates and translates a molecule.
Definition: mol_transform.cpp:131
Bimage::set
void set(long j, double v)
Sets a single value at the given index.
Definition: Bimage.cpp:1096
atom_add
Batom * atom_add(Batom **atom, const char *type)
Adds an atom to a linked list.
Definition: rwmolecule.cpp:152
Bresidue::next
Bresidue * next
Definition: rwmolecule.h:50
Transform::origin
Vector3< double > origin
Definition: Transform.h:27
Bresidue
Definition: rwmolecule.h:49
random_numbers.h
Header file for functions for creating random images.
Bimage::sizeX
void sizeX(long nx)
Definition: Bimage.h:377
Batom
Definition: rwmolecule.h:24
Bsecondary::first
Bresidue * first
Definition: rwmolecule.h:94
Bimage::sizeZ
void sizeZ(long nz)
Definition: Bimage.h:379
Vector3< double >
alpha_template
struct AlphaTemplate alpha_template[]
Bresidue::num
int num
Definition: rwmolecule.h:51
AlphaTemplate
Definition: mol_alpha.cpp:37
View
Definition: View.h:26
molgroup_find_helical_axes
int molgroup_find_helical_axes(Bmolgroup *molgroup)
Calculates the centers and orientations of all alpha helices.
Definition: mol_alpha.cpp:147
Vector3::min
Type min()
Definition: Vector3.h:169
Batom::coord
Vector3< double > coord
Definition: rwmolecule.h:30
Transform::axis
Vector3< double > axis
Definition: Transform.h:28
Bmolgroup::min
Vector3< double > min
Definition: rwmolecule.h:182
VERB_FULL
#define VERB_FULL
Definition: utilities.h:109
Bimage::sizeY
void sizeY(long ny)
Definition: Bimage.h:378
Batom::next
Batom * next
Definition: rwmolecule.h:25
tab
ostream & tab(ostream &out)
Definition: utilities.cpp:21
Bsecondary
Definition: rwmolecule.h:87
find_closest_mean
long find_closest_mean(long k, Vector3< double > *mc, Vector3< double > *ma, Vector3< double > c, Vector3< double > a, double afac)
Definition: mol_alpha.cpp:359