OSDN Git Service

Molecule#is_atom_hidden and AtomRef#hidden, hidden= are implemented, and Molecule...
[molby/Molby.git] / Documents / src / molby_rb / Molecule.html
1 <?xml version="1.0" encoding="utf-8"?>
2 <!DOCTYPE html 
3      PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
6 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7 <head>
8   <title>Class: Molecule</title>
9   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
10   <meta http-equiv="Content-Script-Type" content="text/javascript" />
11   <link rel="stylesheet" href="rdoc-style.css" type="text/css" media="screen" />
12 </head>
13 <body>
14
15 <div id="navi">
16 <a href="../index.html">[Molby Document Home]</a>
17 <a href="../ruby_ref.html">[Contents]</a>
18 </div>
19
20 <div id="classHeader">
21 <table class="header-table">
22 <tr>
23 <td><strong>Class:</strong></td>
24 <td class="class-name-in-header">Molecule</td>
25 </tr>
26 <tr>
27 <td><strong>Parent:</strong></td>
28 <td><a href="Object.html">Object</a></td>
29 </tr>
30 </table>
31 </div>
32
33 <div id="section">
34 <h3 class="section-bar">Description</h3>
35 <a name="description-overview"></a>
36 <h4>Overview</h4>
37 <p>
38 The class <a href="Molecule.html">Molecule</a> is the principal data structure in Molby. It contains the list of atoms, bonds, angles, dihedrals, and impropers. It may also contain optional information such as a unit cell, symmetry operations, multiple frames, electrostatic potentials, quantum chemistry information (basis sets and MO coefficients), MM/MD parameters (see class <a href="Parameter.html">Parameter</a>), and MM/MD runtime information (see class <a href="MDArena.html">MDArena</a>).
39 </p>
40 <a name="description-documents"></a>
41 <h4>Documents and Molecule objects</h4>
42 <p>
43 <a href="Molecule.html">Molecule</a> objects can be obtained from the documents; examples are the return values of <a href="Molecule.html#M000322">Molecule#current</a> and <a href="Molecule.html#M000323">Molecule[name]</a>. However, not all <a href="Molecule.html">Molecule</a> objects necessarily have the associated documents. Some methods of <a href="Molecule.html">Molecule</a> generates a new <a href="Molecule.html">Molecule</a> object that has no associated document (e.g. <a href="Molecule.html#M000190">Molecule#new</a>, <a href="Molecule.html#M000191">Molecule#dup</a>, <a href="Molecule.html#M000244">Molecule#extract</a>). Such Molecule objects are useful for keeping partial structures until model-building is complete.
44 </p>
45 <a name="description-atomref"></a>
46 <h4>AtomRef</h4>
47 <p>
48 Atoms are the most important component in <a href="Molecule.html">Molecule</a>. For efficiency reasons, the internal representation of atoms is a flat array, not a collection of "Atom" objects. Consequently, there is no "Atom" object in Molby; instead, an atom is represented by the <a href="AtomRef.html">AtomRef</a> object, which "points" to a particular atom via a pointer to <a href="Molecule.html">Molecule</a> and an index.
49 </p>
50 <a name="description-atom-index"></a>
51 <h4>Atom index</h4>
52 <p>
53 The atom index in Molby is 0-based, unlike the 1-based index found in many chemical files. In addition, there is a convenient way to specify an atom via its name and (optionally) the residue name and residue number. Thus, if an atom has a name "CA" and belongs to a residue number 1 named "RES", then the atom can be specified by "CA", "1:CA", "RES:CA", or "RES.1:CA". If the description matches more than two atoms, it specifies the atom with the lowest index. Such description is acceptable in such methods like  <a href="MolEnumerable.html#M000002">MolEnumerable#[]</a>, <a href="Molecule.html#M000247">Molecule#atom_group</a>, etc.
54 </p>
55 <a name="description-molenumerable"></a>
56 <h4>MolEnumerable</h4>
57 <p>
58 As described above, the components in <a href="Molecule.html">Molecule</a> such as atoms, bonds, etc. are not represented by Array objects of Ruby. Nevertheless, it is often convenient if we can treat the collection of these substances as a single Enumerable object. The class <a href="MolEnumerable.html">MolEnumerable</a> does this job, and allows to access the individual substances in an Array-like manner, e.g. <tt>mol.atoms[n]</tt> (mol.<a href="Molecule.html#M000211">atoms</a> is a <a href="MolEnumerable.html">MolEnumerable</a> object).
59 </p>
60 <h4>Atom group</h4>
61 <a name="description-atom-group"></a>
62 <p>
63 Many methods of <a href="Molecule.html">Molecule</a> take a "group" argument, which means a group of atoms. A group is represented by an <a href="IntGroup.html">IntGroup</a> object, which is a collection of non-negative integers.
64 </p>
65 <h4>Undo support</h4>
66 <a name="description-undo-support"></a>
67 <p>
68 Many methods of <a href="Molecule.html">Molecule</a> are described as "undoable". This means, when such methods are invoked for a <a href="Molecule.html">Molecule</a> that has an associated document, an undo operation is automatically registered to the document. 
69 </p>
70 <h4>Graphic objects</h4>
71 <a name="description-graphic-objects"></a>
72 <p>
73 (New in 0.6.2) Some Ruby methods allow you to handle graphic objects that are displayed in the same view as the molecule. The methods include <a href="#create_graphic">create_graphic</a>, <a href="#remove_graphic">remove_graphic</a>, <a href="#ngraphics">ngraphics</a>, <a href="#set_graphic_point">set_graphic_point</a>, <a href="#set_graphic_color">set_graphic_color</a>, <a href="#show_graphic">show_graphic</a>, and <a href="#hide_graphic">hide_graphic</a>.
74 </p>
75
76 </div>
77
78 <div id="methods">
79 <h3 class="section-bar">Public Class methods</h3>
80
81 <div id="method-M000323" class="method-detail">
82 <a name="M000323"></a>
83 <div class="method-heading">
84 <span class="method-name">
85 Molecule[]          &rarr; <a href="Molecule.html">Molecule</a><br />
86 Molecule[n]         &rarr; <a href="Molecule.html">Molecule</a><br />
87 Molecule[name]      &rarr; <a href="Molecule.html">Molecule</a><br />
88 Molecule[name, k]   &rarr; <a href="Molecule.html">Molecule</a><br />
89 Molecule[regex]     &rarr; <a href="Molecule.html">Molecule</a><br />
90 Molecule[regex, k]  &rarr; <a href="Molecule.html">Molecule</a><br />
91 </span>
92 </div>
93 <div class="method-description">
94 <p>
95 <a href="Molecule.html">Molecule</a>[] is equivalent to <a
96 href="Molecule.html#M000322">Molecule.current</a>. <a
97 href="Molecule.html">Molecule</a>[n] (n is an integer) is equivalent to <a
98 href="Molecule.html#M000325">Molecule.list</a>[n]. <a
99 href="Molecule.html">Molecule</a>[name]
100 gives the first document (in the order of creation time) that has the given
101 name. If a second argument (k) is
102 given, the k-th document that has the given name is returned. <a
103 href="Molecule.html">Molecule</a>[regex] gives the first document (in the
104 order of creation time) that has a name
105 matching the regular expression. If a second argument (k) is given, the
106 k-th document that has a name matching
107 the regex is returned.
108 </p>
109 </div>
110 </div>
111
112 <div id="method-M000176" class="method-detail">
113 <a name="M000176"></a>
114 <div class="method-heading">
115 <span class="method-name">calc_angle(v1, v2, v3) &rarr; Float</span>
116 </div>
117 <div class="method-description">
118 <p>
119 Calculate the angle defined by three vectors. The result is in degree.
120 </p>
121 <p>
122 <i>See Also:</i> <a href="#M000179">Molecule#calc_angle</a> (Instance Method)
123 </p>
124 </div>
125 </div>
126
127 <div id="method-M000175" class="method-detail">
128 <a name="M000175"></a>
129 <div class="method-heading">
130 <span class="method-name">calc_bond(v1, v2) &rarr; Float</span>
131 </div>
132 <div class="method-description">
133 <p>
134 Calculate the bond length defined by two vectors.
135 </p>
136 <p>
137 <i>See Also:</i> <a href="#M000178">Molecule#calc_bond</a> (Instance Method)
138 </p>
139 </div>
140 </div>
141
142 <div id="method-M000177" class="method-detail">
143 <a name="M000177"></a>
144 <div class="method-heading">
145 <span class="method-name">calc_dihedral(v1, v2, v3, v4) &rarr; Float</span>
146 </div>
147 <div class="method-description">
148 <p>
149 Calculate the dihedral angle defined by four vectors. The result is in degree.
150 </p>
151 <p>
152 <i>See Also:</i> <a href="#M000180">Molecule#calc_dihedral</a> (Instance Method)
153 </p></div>
154 </div>
155
156 <div id="method-M000322" class="method-detail">
157 <a name="M000322"></a>
158 <div class="method-heading">
159 <span class="method-name">current       &rarr; <a href="Molecule.html">Molecule</a><br />
160 </span>
161 </div>
162 <div class="method-description">
163 <p>
164 Get the currently &quot;active&quot; molecule.
165 </p>
166 </div>
167 </div>
168
169 <div id="method-M000120" class="method-detail">
170 <a name="M000120"></a>
171 <div class="method-heading">
172 <span class="method-name">from_formula(str, resname = nil) &rarr; (new) <a href="Molecule.html">Molecule</a></span>
173 </div>
174 <div class="method-description">
175 <p>
176 Convert a string (like "CH2OCH3") to a molecule.
177 </p>
178 </div>
179 </div>
180
181 <div id="method-M000325" class="method-detail">
182 <a name="M000325"></a>
183 <div class="method-heading">
184 <span class="method-name">list         &rarr; Array of <a href="Molecule.html">Molecule</a><br />
185 </span>
186 </div>
187
188 <div class="method-description">
189 <p>
190 Get the list of molecules associated to
191 the documents, in the order of creation time of the document. If no
192 document is open, returns an empry array.
193 </p>
194 </div>
195 </div>
196
197 <div id="method-M000190" class="method-detail">
198 <a name="M000190"></a>
199 <div class="method-heading">
200 <span class="method-name">new  &rarr; (new) <a href="Molecule.html">Molecule</a><br />
201 <span class="method-name">new(file, *args)  &rarr; (new) <a href="Molecule.html">Molecule</a><br />
202 </span>
203 </div>
204 <div class="method-description">
205 <p>
206 Create a new molecule. If any arguments are given, call <a href="Molecule.html#M000200">molload</a> method with the same arguments. The created molecule has no associated document window.
207 </p>
208 <p>
209 <i>See Also:</i> <a href="#M000324">Molecule#open</a>, which opens the molecule as a document (i.e. with associated window).
210 </p>
211 </div>
212 </div>
213
214 <div id="method-M000324" class="method-detail">
215 <a name="M000324"></a>
216 <div class="method-heading">
217 <span class="method-name">open  &rarr; (new) <a href="Molecule.html">Molecule</a><br />
218 <span class="method-name">open(file)  &rarr; (new) <a href="Molecule.html">Molecule</a><br />
219 </span>
220 </div>
221 <div class="method-description">
222 <p>
223 Open a molecule from file as a document. If file is not given, an untitled document is created.
224 </p>
225 <p>
226 <i>See Also:</i> <a href="#M000190">Molecule#new</a>, which creates a new Molecule object but does not open as a document (i.e. no associated window is opened).
227 </p>
228 </div>
229 </div>
230
231 <div id="method-M000326" class="method-detail">
232 <a name="M000326"></a>
233 <div class="method-heading">
234 <span class="method-name">ordered_list         &rarr; Array of <a href="Molecule.html">Molecule</a><br />
235 </span>
236 </div>
237 <div class="method-description">
238 <p>
239 Get the list of molecules which are opened as documents, in the order of front-to-back ordering of the associated window. If no document is open, returns
240 an empry array.
241 </p>
242 </div>
243 </div>
244
245 <h3 class="section-bar">Public Instance methods</h3>
246
247 <div id="method-M000245" class="method-detail">
248 <a name="M000245"></a>
249 <div class="method-heading">
250 <span class="method-name">
251 add(molecule2)       &rarr; self<br />
252 </span>
253 </div>
254 <div class="method-description">
255 <p>
256 Combine two molecules. The residue numbers of the newly added atoms 
257 may be renumbered to avoid
258 conflicts. This operation is undoable.
259 </p>
260 </div>
261 </div>
262
263 <div id="method-M000252" class="method-detail">
264 <a name="M000252"></a>
265 <div class="method-heading">
266 <span class="method-name">add_angle(n1, n2, n3)       &rarr; self<br />
267 </span>
268 </div>
269 <div class="method-description">
270 <p>
271 Add angle n1-n2-n3. Returns self. Usually, angles are automatically added when a bond
272 is created, so it is rarely necessary to use this method explicitly. This
273 operation is undoable.
274 </p>
275 <p>
276 <i>See Also:</i> <a href="Molecule.html#M000251">Molecule#create_bond</a>
277 </p>
278 </div>
279 </div>
280
281 <div id="method-M000184" class="method-detail">
282 <a name="M000184"></a>
283 <div class="method-heading">
284 <span class="method-name">add_atom(name, atom_type = &quot;c3&quot;, element = &quot;C&quot;, bond = nil, base1 = nil, angle = nil, base2 = nil, dihed = nil, base3 = nil) -> <a href="AtomRef.html">AtomRef</a></span>
285 </div>
286 <div class="method-description">
287   <p>
288 Add a new atom. The arguments bond, base1, angle,
289 base2, dihed, and base3 defines the position of the new atom in the Z-matrix style. (Note:
290 angle and dihed should be given in <b>degree</b>, not in radian). If
291 bond/base1 are specified, a new bond is
292 also created between the new atom and
293 base1. If bond/base1 are specified but angle/base2 are not, then the
294 direction of the new bond is assumed as
295 the most distant direction from the existing bonds. Returns the reference to the new atom. This operation is undoable.
296 </p>
297 <p>
298 <i>See Also:</i> <a href="Molecule.html#M000249">Molecule#create_atom</a>
299 </p>
300 </div>
301 </div>
302
303 <div id="method-M000254" class="method-detail">
304 <a name="M000254"></a>
305 <div class="method-heading">
306 <span class="method-name">add_dihedral(n1, n2, n3, n4)       &rarr; self<br />
307 </span>
308 </div>
309 <div class="method-description">
310 <p>
311 Add dihedral n1-n2-n3-n4. Returns self. Usually, dihedrals are automatically added when a
312 bond is created, so it is rarely necessary to use this method explicitly.
313 This operation is undoable.
314 </p>
315 <p>
316 <i>See Also:</i> <a href="Molecule.html#M000251">Molecule#create_bond</a>
317 </p>
318 </div>
319 </div>
320
321 <div id="method-M000125" class="method-detail">
322 <a name="M000125"></a>
323 <div class="method-heading">
324 <span class="method-name">add_hydrogen(idx, atype, bond = 1.07, anum = 1)</span>
325 </div>
326 <div class="method-description">
327 <p>
328 Add missing hydrogen (or other atom) according to the given geometry type.
329 Atype is a String, which is one of the following: &quot;td&quot; (tetrahedral),
330 &quot;tr&quot; (trigonal), &quot;py&quot; (pyramidal, like amine nitrogen),
331 &quot;li&quot; (linear). This operation is undoable.
332 </p>
333 </div>
334 </div>
335
336 <div id="method-M000256" class="method-detail">
337 <a name="M000256"></a>
338 <div class="method-heading">
339 <span class="method-name">add_improper(n1, n2, n3, n4)       &rarr; self<br />
340 </span>
341 </div>
342 <div class="method-description">
343 <p>
344 Add dihedral n1-n2-n3-n4. Returns self. Unlike angles and dihedrals, impropers
345 are <b>not</b> automatically added when
346 new bonds are created, so this method
347 is more useful than the angle/dihedral counterpart. This operation is
348 undoable.
349 </p>
350 </div>
351 </div>
352
353 <div id="method-M000242" class="method-detail">
354 <a name="M000242"></a>
355 <div class="method-heading">
356 <span class="method-name">add_symmetry(Transform) &rarr; Integer<br />
357 </span>
358 </div>
359 <div class="method-description">
360 <p>
361 Add a new symmetry operation. If no symmetry operation is defined and the
362 given argument is not an identity transform, then an identity transform is
363 added before the given transform is added. Returns the
364 new total number of symmetry operations. This operation is undoable.
365 </p>
366 </div>
367 </div>
368
369 <div id="method-M000172" class="method-detail">
370 <a name="M000172"></a>
371 <div class="method-heading">
372 <span class="method-name">all &rarr; <a href="IntGroup.html">IntGroup</a></span>
373 </div>
374 <div class="method-description">
375 <p>
376 Returns <a href="IntGroup.html">IntGroup</a>[0..<a href="Molecule.html#M000217">natoms</a>-1], which represents "all atoms in the molecule".
377 </p>
378 </div>
379 </div>
380
381 <div id="method-amend-by-symmetry" class="method-detail">
382 <a name="amend_by_symmetry"></a>
383 <div class="method-heading">
384 <span class="method-name">amend_by_symmetry(group = nil) &rarr; <a href="IntGroup.html">IntGroup</a></span>
385 </div>
386 <div class="method-description">
387 <p>
388 Replace the symmetry-expanded atoms so that the positions are correctly related to those of the base atoms. If an atom group is given as the argument, only those atoms whose base atoms are in the groups are processed. Returns the group of processed atoms.
389 </p>
390 </div>
391 </div>
392
393 <div id="method-angle-par" class="method-detail">
394 <a name="angle_par"></a>
395 <div class="method-heading">
396   <span class="method-name">angle_par(idx)       &rarr; <a href="ParameterRef.html">ParameterRef</a><br />
397 </span>
398 </div>
399 <div class="method-description">
400 <p>
401 Returns a <a href="ParameterRef.html">ParameterRef</a> object (of type "angle") representing the MD parameter for the specified angle. If the MD parameters are not initialized yet, tries to initialize them by self.<a href="#M000313">md_arena</a>.<a href="MDArena.html#M000046">prepare</a>(true), which may throw exception.
402 </p>
403 <p>
404 <i>See Also:</i> <a href="Molecule.html#bond_par">Molecule#bond_par</a>, 
405 <a href="Molecule.html#dihedral_par">Molecule#dihedral_par</a>, 
406 <a href="Molecule.html#improper_par">Molecule#improper_par</a>, 
407 <a href="Molecule.html#vdw_par">Molecule#vdw_par</a>
408 </p>
409 </div>
410 </div>
411
412 <div id="method-M000213" class="method-detail">
413 <a name="M000213"></a>
414 <div class="method-heading">
415 <span class="method-name">angles       &rarr; <a href="MolEnumerable.html">MolEnumerable</a><br />
416 </span>
417 </div>
418 <div class="method-description">
419 <p>
420 Returns a <a href="MolEnumerable.html">MolEnumerable</a> object
421 representing the array of angles. An
422 angle n1-n2-n3 is represented [n1, n2, n3], where n1, n2, n3 are the atom indices.
423 </p>
424 <p>
425 <i>See Also:</i> <a href="Molecule.html#M000219">Molecule#nangles</a>
426 </div>
427 </div>
428
429 <div id="method-M000258" class="method-detail">
430 <a name="M000258"></a>
431 <div class="method-heading">
432 <span class="method-name">assign_residue(group, res)       &rarr; self<br />
433 </span>
434 </div>
435 <div class="method-description">
436 <p>
437 Assign the specified atoms (as <a href="IntGroup.html">IntGroup</a>) to have the given
438 residue. res can either be an integer, &quot;resname&quot; or
439 &quot;resname.resno&quot;. When the residue number is not specified, the
440 residue number of the first atom in the group is used. This operation is
441 undoable.
442 </p>
443 </div>
444 </div>
445
446 <div id="method-M000247" class="method-detail">
447 <a name="M000247"></a>
448 <div class="method-heading">
449 <span class="method-name">atom_group &rarr; <a href="IntGroup.html">IntGroup</a><br />
450 atom_group {|aref| ...} &rarr; <a href="IntGroup.html">IntGroup</a><br />
451 atom_group(arg1, arg2, ...) &rarr; <a href="IntGroup.html">IntGroup</a> <br />
452 atom_group(arg1, arg2, ...) {|aref| ...} &rarr; <a href="IntGroup.html">IntGroup</a><br />
453 </span>
454 </div>
455 <div class="method-description">
456 <p>
457 Specify a group of atoms. If no
458 arguments are given, <a href="IntGroup.html">IntGroup</a>[0..<a href="Molecule.html#M000217">natoms</a>-1] is the
459 result. If arguments are given, then the atoms reprensented by the arguments are
460 added to the group. For a conversion of a string to an atom index, see the
461 description of <a href="Molecule.html#M000248">Molecule#atom_index</a>.
462 </p>
463 <p>
464 If a block is given, it is evaluated with an <a
465 href="AtomRef.html">AtomRef</a> (not atom index integers) representing each
466 atom, and the atoms are removed from
467 the result if the block returns false.
468 </p>
469 <p>
470 <i>See Also:</i> <a href="#M000172">Molecule#all</a>
471 </p>
472 </div>
473 </div>
474
475 <div id="method-M000248" class="method-detail">
476 <a name="M000248"></a>
477 <div class="method-heading">
478   <span class="method-name">atom_index(val)       &rarr; Integer<br />
479 </span>
480 </div>
481 <div class="method-description">
482 <p>
483 Returns the atom index represented by val. Val can be either a non-negative
484 integer (directly representing the atom index), a negative integer
485 (representing <a href="Molecule.html#M000217">natoms</a> - val), a
486 string of type &quot;resname.resid:name&quot; or &quot;resname:name&quot; or &quot;resid:name&quot; or &quot;name&quot;, where resname, resid, name are the residue name, residue id, and atom name, respectively. If val is a string and
487 multiple atoms match the description,
488 the atom with the lowest index is returned.
489 </p>
490 </div>
491 </div>
492
493 <div id="method-M000211" class="method-detail">
494 <a name="M000211"></a>
495 <div class="method-heading">
496 <span class="method-name">atoms       &rarr; <a href="MolEnumerable.html">MolEnumerable</a><br />
497 </span>
498 </div>
499 <div class="method-description">
500 <p>
501 Returns a <a href="MolEnumerable.html">MolEnumerable</a> object
502 representing the array of atoms.
503 </p>
504 <p>
505 <i>See Also:</i> <a href="Molecule.html#M000217">Molecule#natoms</a>
506 </p>
507 </div>
508 </div>
509
510 <div id="method-bond-par" class="method-detail">
511 <a name="bond_par"></a>
512 <div class="method-heading">
513   <span class="method-name">bond_par(idx)       &rarr; <a href="ParameterRef.html">ParameterRef</a><br />
514 </span>
515 </div>
516 <div class="method-description">
517 <p>
518 Returns a <a href="ParameterRef.html">ParameterRef</a> object (of type "bond") representing the MD parameter for the specified bond. If the MD parameters are not initialized yet, tries to initialize them by self.<a href="#M000313">md_arena</a>.<a href="MDArena.html#M000046">prepare</a>(true), which may throw exception.
519 </p>
520 <p>
521 <i>See Also:</i> <a href="Molecule.html#angle_par">Molecule#angle_par</a>, 
522 <a href="Molecule.html#dihedral_par">Molecule#dihedral_par</a>, 
523 <a href="Molecule.html#improper_par">Molecule#improper_par</a>, 
524 <a href="Molecule.html#vdw_par">Molecule#vdw_par</a>
525 </p>
526 </div>
527 </div>
528
529 <div id="method-M000212" class="method-detail">
530 <a name="M000212"></a>
531 <div class="method-heading">
532   <span class="method-name">bonds       &rarr; <a href="MolEnumerable.html">MolEnumerable</a><br />
533 </span>
534 </div>
535 <div class="method-description">
536 <p>
537 Returns a <a href="MolEnumerable.html">MolEnumerable</a> object
538 representing the array of bonds. 
539 A bond n1-n2 is represented by an array [n1, n2], where n1 and n2 are the atom index integers.</p>
540 <p>
541 <i>See Also:</i> <a href="Molecule.html#M000218">Molecule#nbonds</a>
542 </p>
543 </div>
544 </div>
545
546 <div id="method-M000280" class="method-detail">
547 <a name="M000280"></a>
548 <div class="method-heading">
549   <span class="method-name">bonds_on_border(group = selection)  &rarr; [[na1, nb1], [na2, nb2], ...]<br />
550 </span>
551 </div>
552 <div class="method-description">
553   <p>
554 Returns an array of bonds that connect
555 atoms in the group and atoms out of the group. The first atom in the
556 bond always belongs to the group. If no such bonds are present, an empty array is
557 returned.
558 </p>
559 </div>
560 </div>
561
562 <div id="method-M000288" class="method-detail">
563 <a name="M000288"></a>
564 <div class="method-heading">
565   <span class="method-name">bounds(group = nil)       &rarr; [min, max]<br />
566 </span>
567 </div>
568 <div class="method-description">
569   <p>
570 Calculate the boundary. The return value is an array of two <a
571 href="Vector3D.html">Vector3D</a> objects.
572 </p>
573 <p>
574 <i>See Also:</i> <a href="Molecule.html#M000169">Molecule#min</a>, <a href="Molecule.html#M000170">Molecule#max</a>
575 </p>
576 </div>
577 </div>
578
579 <div id="method-M000238" class="method-detail">
580 <a name="M000238"></a>
581 <div class="method-heading">
582   <span class="method-name">box &rarr; [avec, bvec, cvec, origin, flags]<br />
583 </span>
584 </div>
585 <div class="method-description">
586   <p>
587 Get the unit cell information in the
588 form of a periodic bounding box. Avec,
589 bvec, cvec, origin are <a href="Vector3D.html">Vector3D</a> objects, and
590 flags is a 3-member array of Integers which define whether the system is
591 periodic along the axis. If no unit cell is defined, nil is returned.
592 </p>
593 <p>
594 <i>See Also:</i> <a href="Molecule.html#M000239">Molecule#box=</a>, <a href="Molecule.html#M000235">Molecule#cell</a>, <a href="Molecule.html#M000236">Molecule#cell=</a>
595 </p>
596 </div>
597 </div>
598
599 <div id="method-M000239" class="method-detail">
600 <a name="M000239"></a>
601 <div class="method-heading">
602   <span class="method-name">
603 self.box = [avec, bvec, cvec, origin = [0, 0, 0], flags = [1, 1, 1]]<br />
604 self.box = [d, origin = [0, 0, 0]]<br />
605 self.box = nil<br />
606 set_box(avec, bvec, cvec, origin = [0, 0, 0], flags = [1, 1, 1])<br />
607 set_box(d, origin = [0, 0, 0])<br />
608 set_box<br />
609 </span>
610 </div>
611 <div class="method-description">
612 <p>
613 Set the unit cell parameters. Avec,
614 bvec, and cvec can be either a <a href="Vector3D.html">Vector3D</a> or a
615 number. If it is a number, the x/y/z axis vector is multiplied with the
616 given number and used as the cell axis
617 vector. Flags, if present, is a 3-member array of Integers defining whether
618 the system is periodic along the axis.
619 </p>
620 <p>
621 In the second form, an isotropic box with cell-length d is set.
622 </p>
623 <p>
624 In the third form,
625 the existing unit cell is cleared.
626 </p>
627 <p>
628 This operation is undoable, in any of the above form.
629 </p>
630 <p>
631 Note: if the sigma values of the cell parameters were already set by <a href="Molecule.html#M000236">Molecule#cell=</a>, those values are left untouched unless the cell itself is cleared.
632 </p>
633 <p>
634 <i>See Also:</i> <a href="Molecule.html#M000238">Molecule#box</a>, <a href="Molecule.html#M000235">Molecule#cell</a>, <a href="Molecule.html#M000236">Molecule#cell=</a>
635 </p>
636 </div>
637 </div>
638
639 <div id="method-M000179" class="method-detail">
640 <a name="M000179"></a>
641 <div class="method-heading">
642 <span class="method-name">calc_angle(n1, n2, n3) &rarr; Float</span>
643 </div>
644 <div class="method-description">
645 <p>
646 Calculate the bond angle defined by the three atoms. The result is in degree.
647 </p>
648 <p>
649 <i>See Also:</i> <a href="#M000176">Molecule#calc_angle</a> (Class Method)
650 </p>
651 </div>
652 </div>
653
654 <div id="method-M000178" class="method-detail">
655 <a name="M000178"></a>
656 <div class="method-heading">
657 <span class="method-name">calc_bond(n1, n2) &rarr; Float</span>
658 </div>
659 <div class="method-description">
660 <p>
661 Calculate the bond length between the two atoms.
662 </p>
663 <p>
664 <i>See Also:</i> <a href="#M000175">Molecule#calc_bond</a> (Class Method)
665 </p>
666 </div>
667 </div>
668
669 <div id="method-M000180" class="method-detail">
670 <a name="M000180"></a>
671 <div class="method-heading">
672 <span class="method-name">calc_dihedral(n1, n2, n3, n4) &rarr; Float</span>
673 </div>
674 <div class="method-description">
675 <p>
676 Calculate the dihedral angle defined by the four atoms. The result is in degree.
677 </p>
678 <p>
679 <i>See Also:</i> <a href="#M000177">Molecule#calc_dihedral</a> (Class Method)
680 </p>
681 </div>
682 </div>
683
684 <div id="method-M000235" class="method-detail">
685 <a name="M000235"></a>
686 <div class="method-heading">
687 <span class="method-name">cell     &rarr; [a, b, c, alpha, beta, gamma [, sig_a, sig_b, sig_c, sig_alpha, sig_beta, sig_gamma]]<br />
688 </span>
689 </div>
690 <div class="method-description">
691 <p>
692 Returns the unit cell parameters. If a unit cell is not set, returns nil. Alpha/beta/gamma are in degree. If the sigma value are present, the return value is an array of 12 floats instead of 6.
693 </p>
694 <p>
695 <i>See Also:</i> <a href="Molecule.html#M000238">Molecule#box</a>, <a href="Molecule.html#M000239">Molecule#box=</a>, <a href="Molecule.html#M000236">Molecule#cell=</a>
696 </p>
697 </div>
698 </div>
699
700 <div id="method-M000236" class="method-detail">
701 <a name="M000236"></a>
702 <div class="method-heading">
703 <span class="method-name">cell = [a, b, c, alpha, beta, gamma [, sig_a, sig_b, sig_c, sig_alpha, sig_beta, sig_gamma]]<br />
704 set_cell([a, b, c, alpha, beta, gamma [, sig_a, sig_b, sig_c, sig_alpha, sig_beta, sig_gamma]], flag = nil)<br />
705 </span>
706 </div>
707 <div class="method-description">
708 <p>
709 Set the unit cell parameters. Alpha/beta/gamma are in degree. If the right-hand value (or the first argument) is nil, then clear the current unit cell. If the second argument is given as non-nil, then
710 the coordinates are transformed so that the cartesian coordinates remain the same. If the cell parameters are given as an array of 12 floats, then the second half of the array is to represent the sigma value (that are common in crystallographic data). This operation is undoable.
711 </p>
712 <p>
713 <i>See Also:</i> <a href="Molecule.html#M000238">Molecule#box</a>, <a href="Molecule.html#M000239">Molecule#box=</a>, <a href="Molecule.html#M000235">Molecule#cell</a>
714 </p>
715 </div>
716 </div>
717
718 <div id="method-M000237" class="method-detail">
719 <a name="M000237"></a>
720 <div class="method-heading">
721 <span class="method-name">cell_transform &rarr; <a href="Transform.html">Transform</a><br />
722 </span>
723 </div>
724 <div class="method-description">
725 <p>
726 Return the <a href="Transform.html">Transform</a> matrix that converts
727 internal coordinates to cartesian coordinates. If the unit cell is not defined, nil is returned.
728 </p>
729 </div>
730 </div>
731
732 <div id="method-M000286" class="method-detail">
733 <a name="M000286"></a>
734 <div class="method-heading">
735 <span class="method-name">center_of_mass(group = nil)       &rarr; <a href="Vector3D.html">Vector3D</a><br />
736 </span>
737 </div>
738 <div class="method-description">
739 <p>
740 Calculate the center of mass for the given set of atoms. If the argument group is null, all atoms are considered.
741 </p>
742 </div>
743 </div>
744
745 <div id="method-M000287" class="method-detail">
746 <a name="M000287"></a>
747 <div class="method-heading">
748 <span class="method-name">centralize(group = nil)       &rarr; self<br />
749 </span>
750 </div>
751 <div class="method-description">
752 <p>
753 Translate the molecule so that the center of mass of the given group is
754 located at (0, 0, 0). Equivalent to
755 <a href="Molecule.html#M000281">self.translate</a>(<a href="Molecule.html#M000286">self.center_of_mass</a>(group) * -1). This operation is undoable.
756 </p>
757 </div>
758 </div>
759
760 <div id="method-M000189" class="method-detail">
761 <a name="M000189"></a>
762 <div class="method-heading">
763 <span class="method-name">count_bonds(n1, n2) &rarr; Integer</span>
764 </div>
765 <div class="method-description">
766 <p>
767 Count the (minimum) number of bonds
768 between atoms n1 and n2. If there is no connection between n1 and n2, return -1.
769 </p>
770 </div>
771 </div>
772
773 <div id="method-M000249" class="method-detail">
774 <a name="M000249"></a>
775 <div class="method-heading">
776 <span class="method-name">create_atom(name, pos = -1)  &rarr; <a href="AtomRef.html">AtomRef</a><br />
777 </span>
778 </div>
779 <div class="method-description">
780 <p>
781 Create a new atom with the specified name (may contain residue information) and
782 position (if position is out of range, the atom is appended at the end). The occupancy of the new atom is 1.0, and other attributes are 0 or null.
783 Returns the reference to the atom.
784 This operation is undoable.
785 </p>
786 <p>
787 <i>See Also:</i> <a href="Molecule.html#M000184">Molecule#add_atom</a>
788 </p>
789 </div>
790 </div>
791
792 <div id="method-M000251" class="method-detail">
793 <a name="M000251"></a>
794 <div class="method-heading">
795 <span class="method-name">create_bond(n1, n2, ...)       &rarr; Integer<br />
796 <span class="method-name">create_bonds(n1, n2, ...)       &rarr; Integer<br />
797 </span>
798 </div>
799 <div class="method-description">
800 <p>
801 Create bond(s) between atoms n1 and n2, n3 and n4, and so on.
802 If the atoms already have other bonds, new angles and dihedrals are automatically created.
803 If a bond is already present for a particular pair of atoms, do nothing for that pair.
804 Returns the number of bonds actually created. This operation is undoable.
805 </p>
806 </div>
807 </div>
808
809 <div id="method-M000268" class="method-detail">
810 <a name="M000268"></a>
811 <div class="method-heading">
812 <span class="method-name">create_frame(coordinates = nil) &rarr; Integer<br />
813 create_frames(coordinates = nil) &rarr; Integer<br />
814 </span>
815 </div>
816 <div class="method-description">
817 <p>
818 Same as <a href="Molecule.html#M000336">Molecule#insert_frames</a>(nil, coordinates).
819 </p>
820 </div>
821 </div>
822
823 <div id="method-create_graphic" class="method-detail">
824 <a name="create_graphic"></a>
825 <div class="method-heading">
826 <span class="method-name">create_graphic(kind, color, points, fill = nil) &rarr; Integer</span>
827 </div>
828 <div class="method-description">
829 <p>
830 Create a new graphic object. Kind: a symbol representing the kind of the graphic. :line, :poly, :cylinder, :cone, :ellipsoid. Color: an array of 3 (rgb) or 4 (rgba) floating numbers. Points: an array of <a href="Vector3D.html">Vector3D</a>s or Floats (depending on the graphic type). The arguments points = [p1, p2, ..., pn] and fill have the following meanings for each kind of the graphic.
831 </p>
832 <ul>
833 <li><b>line</b>: Points correspond to a set of lines (p1, p2), (p2, p3), ..., (p(n-1), pn). Fill has no meaning.</li>
834 <li><b>poly</b>: Points correspond to a set of connected triangles (p1, p2, p3), (p1, p3, p4), ..., (p1, p(n-1), pn). Fill has no meaning.</li>
835 <li><b>cylinder</b>: p1 = center of the bottom face, p2 = center of the top face, p3 (number) = radius. If fill is true, both faces are drawn. Otherwise, only the side surface is drawn.</li>
836 <li><b>cone</b>: p1 = center of the bottom face, p2 = top point, p3 (number) = radius. If fill is true, the bottom face is drawn. Otherwise, only the side surface is drawn.</li>
837 <li><b>ellipsoid</b>: Two argument types. (1) p1 = center, p2 (number) = radius. (2) p1 = center, p2, p3, p4 = main axis of the ellipsoid (not necessarily orthogonal each other). Fill has no meaning.</li>
838 </ul>
839 <p>
840 Returns the index of the newly created graphic.
841 </p>
842 <p>
843 <i>See Also:</i> <a href="#remove_graphic">Molecule#remove_graphic</a>
844 </p></div>
845 </div>
846
847 <div id="method-M000318" class="method-detail">
848 <a name="M000318"></a>
849 <div class="method-heading">
850 <span class="method-name">cubegen(fname, mo, npoints=1000000 [, iflag])<br />
851 cubegen(fname, mo, origin, dx, dy, dz, nx, ny, nz [, iflag])<br />
852 </span>
853 </div>
854 <div class="method-description">
855 <p>
856 Calculate the molecular orbital with number mo and create a cube file. 
857 In the first form, the cube size is estimated from
858 the atomic coordinates. In the second form, the cube dimension is
859 explicitly given. Returns fname when successful, nil otherwise. If iflag is
860 non-false, then interrupt check is enabled during calculation.
861 </p>
862 </div>
863 </div>
864
865 <div id="method-M000317" class="method-detail">
866 <a name="M000317"></a>
867 <div class="method-heading">
868 <span class="method-name">default_MO_grid(npoints = 80*80*80) &rarr; [origin, dx, dy, dz, nx, ny, nz]<br />
869 </span>
870 </div>
871 <div class="method-description">
872 <p>
873 Calculate a default MO grid for cube file generation. Origin is <a href="Vector3D.html">Vector3D</a>; dx, dy,
874 dz are Float; nx, ny, nz are Integer. If the molecule does not contain a basis
875 set information, then returns nil.
876 </p>
877 </div>
878 </div>
879
880 <div id="method-M000279" class="method-detail">
881 <a name="M000279"></a>
882 <div class="method-heading">
883 <span class="method-name">detachable?(group)  &rarr; [n1, n2]<br />
884 </span>
885 </div>
886 <div class="method-description">
887 <p>
888 Check whether the group is detachable, i.e. the group is
889 bound to the rest of the molecule via only one bond. If it is, then the
890 indices of the atoms belonging to the
891 bond is returned; n1 is the atom belonging to the group, and n2 is the atom not belonging to the group and bound to n1. If the above conditions are not met, nil is returned.
892 </p>
893 </div>
894 </div>
895
896 <div id="method-dihedral-par" class="method-detail">
897 <a name="dihedral_par"></a>
898 <div class="method-heading">
899   <span class="method-name">dihedral_par(idx)       &rarr; <a href="ParameterRef.html">ParameterRef</a><br />
900 </span>
901 </div>
902 <div class="method-description">
903 <p>
904 Returns a <a href="ParameterRef.html">ParameterRef</a> object (of type "dihedral") representing the MD parameter for the specified dihedral. If the MD parameters are not initialized yet, tries to initialize them by self.<a href="#M000313">md_arena</a>.<a href="MDArena.html#M000046">prepare</a>(true), which may throw exception.
905 </p>
906 <p>
907 <i>See Also:</i>
908 <a href="Molecule.html#angle_par">Molecule#angle_par</a>, 
909 <a href="Molecule.html#bond_par">Molecule#bond_par</a>, 
910 <a href="Molecule.html#improper_par">Molecule#improper_par</a>, 
911 <a href="Molecule.html#vdw_par">Molecule#vdw_par</a>
912 </p>
913 </div>
914 </div>
915
916 <div id="method-M000214" class="method-detail">
917 <a name="M000214"></a>
918 <div class="method-heading">
919 <span class="method-name">dihedrals       &rarr; <a href="MolEnumerable.html">MolEnumerable</a><br />
920 </span>
921 </div>
922 <div class="method-description">
923 <p>
924 Returns a <a href="MolEnumerable.html">MolEnumerable</a> object
925 representing the array of <a href="Molecule.html#M000214">dihedrals</a>. A
926 dihedral n1-n2-n3-n4 is represented by an array [n1, n2, n3, n4], where n1, n2, n3, n4 are the atom index integers.
927 </p>
928 <p>
929 <i>See Also:</i> <a href="Molecule.html#M000220">Molecule#ndihedrals</a>
930 </p>
931 </div>
932 </div>
933
934 <div id="method-M000209" class="method-detail">
935 <a name="M000209"></a>
936 <div class="method-heading">
937 <span class="method-name">dir       &rarr; String<br />
938 </span>
939 </div>
940 <div class="method-description">
941 <p>
942 Returns the full path name of the directory in which the file
943 associated with the molecule is located. If the molecule has no associated
944 file, then returns nil.
945 </p>
946 <p>
947 <i>See Also:</i> <a href="Molecule.html#M000208">Molecule#path</a>
948 </p>
949 </div>
950 </div>
951
952 <div id="method-M000295" class="method-detail">
953 <a name="M000295"></a>
954 <div class="method-heading">
955 <span class="method-name">display<br />
956 </span>
957 </div>
958 <div class="method-description">
959 <p>
960 Refresh the display if this molecule is
961 bound to a view. Otherwise do nothing.
962 </p>
963 </div>
964 </div>
965
966 <div id="method-M000183" class="method-detail">
967 <a name="M000183"></a>
968 <div class="method-heading">
969 <span class="method-name">dock(mol, base1, base2, rem1 = nil, rem2 = nil, len = nil, dihed = nil, def1 = nil, def2 = nil)</span>
970 </div>
971
972 <div class="method-description">
973 <p>
974 Combine two molecules. A new bond is
975 created between base1 and base2.
976 Rem1 and rem2 specify the atom (or fragment) to be removed when creating the new bond.
977 If nil is specified for
978 either of them, a dummy atom (which has a name beginning with '#')
979  is looked for, and if none is
980 found then no atom is removed and the new bond is directed so that it is most
981 remote from any of the existing bonds.
982 </p>
983 <p>
984 Rem1 and rem2 can also be <a href="Vector3D.html">Vector3D</a> objects that
985 specify the direction of the <a href="Molecule.html#M000190">new</a> bond.
986 In this case, no atoms are removed.
987 </p>
988 <p>
989 If len is specified, then the length of the new bond is set to this value. Otherwise,
990 it is set to 1.5.
991 </p>
992 <p>
993 If dihed is specified, then the dihedral angle
994 def1-base1-base2-def2 is set to this value (in <b>degree</b>, not radian). If nil is specified
995 for either def1 or def2 (or both), then the atom which is connected to
996 base1 (base2) and has the smallest index is used.
997 </p>
998 <p>
999 Returns the group of atom indices that have been added. This operation is undoable.
1000 </p>
1001 <p>
1002 <i>See Also:</i> <a href="Molecule.html#M000279">Molecule#detachable?</a> (for description of detachability), <a href="Molecule.html#M000121">Molecule#dock_formula</a>, <a href="Molecule.html#M000122">Molecule#dock_fragment</a>
1003 </p>
1004 </div>
1005 </div>
1006
1007 <div id="method-M000121" class="method-detail">
1008 <a name="M000121"></a>
1009 <div class="method-heading">
1010 <span class="method-name">dock_formula(str, group = selection)</span>
1011 </div>
1012 <div class="method-description">
1013 <p>
1014 Create a fragment from str and replace
1015 the group with the generated fragment.
1016 This method is invoked when a detachable selection is double-clicked and user
1017 enters the formula in the dialog box. This operation is undoable.
1018 </p>
1019 <p>
1020 <i>See Also:</i> <a href="Molecule.html#M000183">Molecule#dock</a>, <a href="Molecule.html#M000122">Molecule#dock_fragment</a>
1021 </p>
1022 </div>
1023 </div>
1024
1025 <div id="method-M000122" class="method-detail">
1026 <a name="M000122"></a>
1027 <div class="method-heading">
1028 <span class="method-name">dock_fragment(fragment, group = selection)</span>
1029 </div>
1030 <div class="method-description">
1031 <p>
1032 Replace the specified group with the given fragment, which is another <a href="Molecule.html">Molecule</a> object. This operation is undoable.
1033 </p>
1034 <p>
1035 <i>See Also:</i> <a href="Molecule.html#M000183">Molecule#dock</a>, <a href="Molecule.html#M000121">Molecule#dock_formula</a>
1036 </p>
1037 </div>
1038 </div>
1039
1040 <div id="method-M000142" class="method-detail">
1041 <a name="M000142"></a>
1042 <div class="method-heading">
1043 <span class="method-name">dump(group = nil) &rarr; String</span>
1044 </div>
1045 <div class="method-description">
1046 <p>
1047 Create a String that represent the atom list. If a group is given, only the atoms in the group will be included.
1048 </p>
1049 <p>
1050 <i>See Also:</i> <a href="Molecule.html#M000144">Molecule#from_dump</a>
1051 </div>
1052 </div>
1053
1054 <div id="method-M000191" class="method-detail">
1055 <a name="M000191"></a>
1056 <div class="method-heading">
1057 <span class="method-name">dup          &rarr; (new) <a href="Molecule.html">Molecule</a><br />
1058 </span>
1059 </div>
1060 <div class="method-description">
1061 <p>
1062 Duplicate a molecule. All entries are deep copied, so that modifying the newly
1063 created object does not affect the old object in any sense.
1064 </p>
1065 </div>
1066 </div>
1067
1068 <div id="method-M000250" class="method-detail">
1069 <a name="M000250"></a>
1070 <div class="method-heading">
1071 <span class="method-name">duplicate_atom(atomref, pos = -1)  &rarr; <a href="AtomRef.html">AtomRef</a><br />
1072 </span>
1073 </div>
1074 <div class="method-description">
1075 <p>
1076 Create a new atom with the same
1077 attributes (but no bonding information) with the specified atom. Returns
1078 the reference to the new atom. Useful as a convenient version of Molecule#create_atom, with the various atomic attributes duplicated from the reference atom. This operation is undoable.
1079 </p>
1080 </div>
1081 </div>
1082
1083 <div id="method-M000234" class="method-detail">
1084 <a name="M000234"></a>
1085 <div class="method-heading">
1086 <span class="method-name">each_atom(atom_group = nil) {|aref| ...}<br />
1087 </span>
1088 </div>
1089 <div class="method-description">
1090 <p>
1091 Execute the block for each atom, with the <a href="AtomRef.html">AtomRef</a> object as the argument. If an atom group is given, only the specified atoms are processed. Otherwise, equivalent to <a href="Molecule.html#M000211">self.atoms</a>.<a href="MolEnumerable.html#M000004">each</a>, except that the return value is self.
1092 </p>
1093 </div>
1094 </div>
1095
1096 <div id="method-M000278" class="method-detail">
1097 <a name="M000278"></a>
1098 <div class="method-heading">
1099 <span class="method-name">each_fragment {|group| ...}<br />
1100 </span>
1101 </div>
1102 <div class="method-description">
1103 <p>
1104 Execute the block for each fragment in the molecule, with the <a href="IntGroup.html">IntGroup</a> object representing the fragment as the block 
1105 argument. No new atoms or bonds should be created or removed during the execution of the block, otherwise the results will be unpredictable (may even cause a crash).
1106 </p>
1107 </div>
1108 </div>
1109
1110 <div id="method-M000271" class="method-detail">
1111 <a name="M000271"></a>
1112 <div class="method-heading">
1113 <span class="method-name">each_frame {|n| ...}<br />
1114 </span>
1115 </div>
1116 <div class="method-description">
1117 <p>
1118 Set the frame number from 0 to <a
1119 href="Molecule.html#M000267">nframes</a>-1 and execute the block. The block
1120 argument is the frame number. After
1121 completion, the original frame number
1122 is restored. Roughly equivalent to the following code snippet:
1123 </p>
1124 <pre><tt>old_frame = self.frame
1125 for n in 0..self.nframes-1
1126   self.frame = n
1127   yield(n)
1128 end
1129 self.frame = old_frame</tt>
1130 </pre>
1131 <p>
1132 <i>See Also:</i> <a href="Molecule.html#M000267">Molecule#nframes</a>
1133 </p>
1134 </div>
1135 </div>
1136
1137 <div id="method-M000320" class="method-detail">
1138 <a name="M000320"></a>
1139 <div class="method-heading">
1140 <span class="method-name">elpot(idx) &rarr; [pos, potential]<br />
1141 </span>
1142 </div>
1143 <div class="method-description">
1144 <p>
1145 Get the electrostatic potential info at the given index. The electrostatic potential are read from the output of quantum chemistry softwares. If present, then
1146 the return value is [Vector3D, Float] (position and potential). If not
1147 present, then returns nil.
1148 </p>
1149 <p>
1150 <i>See Also: </i> <a href="Molecule.html#M000133">Molecule#loadlog</a> (to load GAMESS output), <a href="Molecule.html#M000319">Molecule#nelpots</a>
1151 </p>
1152 </div>
1153 </div>
1154
1155 <div id="method-M000292" class="method-detail">
1156 <a name="M000292"></a>
1157 <div class="method-heading">
1158 <span class="method-name">expand_by_symmetry(group, sym, dx=0, dy=0, dz=0) &rarr; <a href="IntGroup.html">IntGroup</a><br />
1159 </span>
1160 </div>
1161 <div class="method-description">
1162 <p>
1163 Expand the specified part of the molecule by the given symmetry operation. Sym is the index to the <a href="Molecule.html#M000331">symmetries</a> array, and dx/dy/dz are the integers representing the translational operations along the unit cell axes. Returns an <a
1164 href="IntGroup.html">IntGroup</a> that represents the added atoms. This operation is undoable.
1165 </p>
1166 </div>
1167 </div>
1168
1169 <div id="method-M000244" class="method-detail">
1170 <a name="M000244"></a>
1171 <div class="method-heading">
1172 <span class="method-name">extract(group, dummy_flag = nil)       &rarr; (new) <a href="Molecule.html">Molecule</a><br />
1173 </span>
1174 </div>
1175 <div class="method-description">
1176 <p>
1177 Extract the atoms represented by the given group, and
1178 return as a new Molecule object. If
1179 dummy_flag is true, then the atoms that
1180 are not selected but are connected to any selected atoms are also included as dummy atoms.
1181 (i.e. with element &quot;Du&quot; and names beginning with an underscore).
1182 </p>
1183 </div>
1184 </div>
1185
1186 <div id="method-M000261" class="method-detail">
1187 <a name="find_close_atoms"></a>
1188 <div class="method-heading">
1189 <span class="method-name">find_close_atoms(atom, limit = 1.2)       &rarr; Array of Integers<br />
1190 </span>
1191 </div>
1192 <div class="method-description">
1193 <p>
1194 Find atoms that are within the threshold distance from the given atom. If limit is a positive number, the threshold distance is the sum of the vdw radii times limit. If limit is a negative number, its absolute value is used for the threshold distance in angstrom. If limit is not given, a default value of 1.2 is used. The number of the newly created bonds is returned. An array of atom indices is returned. If no atoms are found, an empty array is returned.
1195 </p>
1196 </div>
1197 </div>
1198
1199 <div id="method-M000294" class="method-detail">
1200 <a name="M000294"></a>
1201 <div class="method-heading">
1202 <span class="method-name">find_conflicts(limit[, group1[, group2[, ignore_exclusion]]]) &rarr; [[n1, n2], [n3, n4], ...]<br />
1203 </span>
1204 </div>
1205 <div class="method-description">
1206 <p>
1207 Find pairs of atoms that are within the limit distance. If group1 and group2 are given, the first and second atom in the pair should belong to group1 and group2, respectively. By default, the atom pairs separated by one to three bonds are excluded. However, if ignore_exclusion is given as non-false, then those pairs are also included.
1208 </p>
1209 </div>
1210 </div>
1211
1212 <div id="method-M000109" class="method-detail">
1213 <a name="M000109"></a>
1214 <div class="method-heading">
1215 <span class="method-name">find_dummy_atoms(how_many = nil)</span>
1216 </div>
1217 <div class="method-description">
1218 <p>
1219 Find dummy atoms, i.e. the atoms whose element is &quot;Du&quot; and
1220 whose name begins with an underscore.
1221 </p>
1222 </div>
1223 </div>
1224
1225 <div id="method-M000109" class="method-detail">
1226 <a name="fit_coordinates"></a>
1227 <div class="method-heading">
1228 <span class="method-name">fit_coordinates(group, ref, weight = nil) -> [transform, rmsd]</span>
1229 </div>
1230 <div class="method-description">
1231 <p>
1232 Calculate the transform to fit the given group to the set of reference coordinates. The reference coordinates ref is given as either a frame number, an array of <a href="Vector3D.html">Vector3D</a>s or arrays, or an <a href="LAMatrix.html">LAMatrix</a>. Weight can be optionally given as an array of numbers or an <a href="LAMatrix.html">LAMatrix</a>. If weight is not given, the atomic weights are used.
1233 </p>
1234 <p>
1235 Return values are the transform (that converts the present coordinates to the target coordinates) and root mean square deviation (without weight).
1236 </p>
1237 </div>
1238 </div>
1239
1240 <div id="method-M000277" class="method-detail">
1241 <a name="M000277"></a>
1242 <div class="method-heading">
1243 <span class="method-name">fragment(n1, *exatoms)  &rarr; <a href="IntGroup.html">IntGroup</a><br />
1244 fragment(group, *exatoms)  &rarr; <a href="IntGroup.html">IntGroup</a><br />
1245 </span>
1246 </div>
1247 <div class="method-description">
1248 <p>
1249 Find the fragment (i.e. a group of connected atoms) including the atom n1
1250 or the atom group. If additional arguments are given, those atoms will not be counted during the search.
1251 </p>
1252 </div>
1253 </div>
1254
1255 <div id="method-M000265" class="method-detail">
1256 <a name="M000265"></a>
1257 <div class="method-heading">
1258 <span class="method-name">frame &rarr; Integer<br />
1259 </span>
1260 </div>
1261 <div class="method-description">
1262 <p>
1263 Get the current frame shown in the window.
1264 </p>
1265 </div>
1266 </div>
1267
1268 <div id="method-M000266" class="method-detail">
1269 <a name="M000266"></a>
1270 <div class="method-heading">
1271 <span class="method-name">self.frame = index<br />
1272 select_frame(index)<br />
1273 </span>
1274 </div>
1275 <div class="method-description">
1276 <p>
1277 Select the specified frame. If
1278 successful, returns true, otherwise returns false.
1279 </p>
1280 <p>
1281 <i>See Also:</i> <a href="Molecule.html#M000267">Molecule#nframes</a>
1282 </p>
1283 </div>
1284 </div>
1285
1286 <div id="method-M000144" class="method-detail">
1287 <a name="M000144"></a>
1288 <div class="method-heading">
1289 <span class="method-name">from_dump(str) &rarr; self</span>
1290 </div>
1291 <div class="method-description">
1292 <p>
1293 Read the description of atoms from the String of the <a href="Molecule.html#M000142">dump</a> format. Self must be empty.
1294 </p>
1295 <p>
1296 <i>See Also:</i> <a href="Molecule.html#M000142">Molecule#dump</a>
1297 </p>
1298 </div>
1299 </div>
1300
1301 <div id="method-M000276" class="method-detail">
1302 <a name="M000276"></a>
1303 <div class="method-heading">
1304 <span class="method-name">get_atom_attr(index, key)<br />
1305 </span>
1306 </div>
1307 <div class="method-description">
1308 <p>
1309 Get the atom attribute for the specified atom. Equivalent to <a href="Molecule.html#M000211">self.atoms</a>[index].key. See the methods of class <a href"AtomRef.html">AtomRef</a> for available atrributes.
1310 </p>
1311 </div>
1312 </div>
1313
1314 <div id="method-get_coord_from_frame" class="method-detail">
1315 <a name="get_coord_from_frame"></a>
1316 <div class="method-heading">
1317 <span class="method-name">get_coord_from_frame(index, group = nil, cflag = nil) &rarr; self<br />
1318 </span>
1319 </div>
1320 <div class="method-description">
1321 <p>
1322 Copy the coordinates from the specified frame. If group is specified, then only the atoms in the group are modified. If cflag is true, then the cell information is also copied. This operation is undoable.
1323 </p>
1324 </div>
1325 </div>
1326
1327 <div id="method-get_view_rotation" class="method-detail">
1328 <a name="get_view_rotation"></a>
1329 <div class="method-heading">
1330 <span class="method-name">get_view_rotation &rarr; [[ax, ay, az], angle]</span>
1331 </div>
1332 <div class="method-description">
1333 <p>
1334 Get the current rotation for the view. Angle is in degree, not radian. The sign of the angle is positive when the rotation and the axis vector follow the left-hand rule (i.e. clockwise when viewed from the tip of the axis). Note that this is opposite from the OpenGL convention.
1335 </p>
1336 <p>
1337 <i>See Also:</i> <a href="#set_view_rotation">Molecule#set_view_rotation</a>
1338 </p></div>
1339 </div>
1340
1341 <div id="method-get_view_scale" class="method-detail">
1342 <a name="get_view_scale"></a>
1343 <div class="method-heading">
1344 <span class="method-name">get_view_scale &rarr; Float</span>
1345 </div>
1346 <div class="method-description">
1347 <p>
1348 Get the current scale for the view. Scale is expressed with a dimensionless floating-point number in the range -5.0 to 5.0. The scale parameter is transformed to perspective parameters (fovy and distance) in the following way: for negative scale, fovy = 30 degree and distance = cot(15) * 10^(-scale) * 10 &Aring;; for positive scale, fovy = 30 * 10^(-scale) degree and distance = cot(15) * 10 &Aring;.
1349 </p>
1350 <p>
1351 <i>See Also:</i> <a href="#set_view_scale">Molecule#set_view_scale</a>
1352 </p></div>
1353 </div>
1354
1355 <div id="method-get_view_center" class="method-detail">
1356 <a name="get_view_center"></a>
1357 <div class="method-heading">
1358 <span class="method-name">get_view_center &rarr; <a href="Vector3D.html">Vector3D</a></span>
1359 </div>
1360 <div class="method-description">
1361 <p>
1362 Get the current center point of the view.
1363 </p>
1364 <p>
1365 <i>See Also:</i> <a href="#set_view_center">Molecule#set_view_center</a>
1366 </p></div>
1367 </div>
1368
1369 <div id="method-M000261" class="method-detail">
1370 <a name="M000261"></a>
1371 <div class="method-heading">
1372 <span class="method-name">guess_bonds(limit = 1.2)       &rarr; Integer<br />
1373 </span>
1374 </div>
1375 <div class="method-description">
1376 <p>
1377 Create bonds between atoms that are within the threshold distance. If limit is a positive number, the threshold distance is the sum of the vdw radii times limit. If limit is a negative number, its absolute value is used for the threshold distance in angstrom. If limit is not given, a default value of 1.2 is used. The number of the newly created bonds is returned. This operation is undoable.
1378 </p>
1379 </div>
1380 </div>
1381
1382 <div id="method-hide_graphic" class="method-detail">
1383 <a name="hide_graphic"></a>
1384 <div class="method-heading">
1385 <span class="method-name">hide_graphic(graphic_index) &rarr; self</span>
1386 </div>
1387 <div class="method-description">
1388 <p>
1389 Unset the visibility flag of the graphic_index-th graphic object.
1390 </p>
1391 <p>
1392 <i>See Also:</i> <a href="#show_graphic">Molecule#show_graphic</a>
1393 </p></div>
1394 </div>
1395
1396 <div id="method-improper-par" class="method-detail">
1397 <a name="improper_par"></a>
1398 <div class="method-heading">
1399   <span class="method-name">improper_par(idx)       &rarr; <a href="ParameterRef.html">ParameterRef</a><br />
1400 </span>
1401 </div>
1402 <div class="method-description">
1403 <p>
1404 Returns a <a href="ParameterRef.html">ParameterRef</a> object (of type "improper") representing the MD parameter for the specified improper torsion. If the MD parameters are not initialized yet, tries to initialize them by self.<a href="#M000313">md_arena</a>.<a href="MDArena.html#M000046">prepare</a>(true), which may throw exception.
1405 </p>
1406 <p>
1407 <i>See Also:</i>
1408 <a href="Molecule.html#angle_par">Molecule#angle_par</a>, 
1409 <a href="Molecule.html#bond_par">Molecule#bond_par</a>, 
1410 <a href="Molecule.html#dihedral_par">Molecule#dihedral_par</a>, 
1411 <a href="Molecule.html#vdw_par">Molecule#vdw_par</a>
1412 </p>
1413 </div>
1414 </div>
1415
1416 <div id="method-M000215" class="method-detail">
1417 <a name="M000215"></a>
1418 <div class="method-heading">
1419 <span class="method-name">impropers       &rarr; <a href="MolEnumerable.html">MolEnumerable</a><br />
1420 </span>
1421 </div>
1422 <div class="method-description">
1423 <p>
1424 Returns a <a href="MolEnumerable.html">MolEnumerable</a> object
1425 representing the array of impropers.
1426 improper is represented by an array of four atom indices.
1427 </p>
1428 <p>
1429 <i>See Also:</i> <a href="Molecule.html#M000221">Molecule#nimpropers</a>
1430 </p>
1431 </div>
1432 </div>
1433
1434 <div id="method-M000269" class="method-detail">
1435 <a name="M000269"></a>
1436 <div class="method-heading">
1437 <span class="method-name">insert_frame(integer, coordinates = nil) &rarr; <a href="IntGroup.html">IntGroup</a><br />
1438 insert_frames(intGroup = nil, coordinates = nil) &rarr; <a href="IntGroup.html">IntGroup</a><br />
1439 </span>
1440 </div>
1441
1442 <div class="method-description">
1443 <p>
1444 Insert new frames at the indices
1445 specified by the intGroup. If the first argument is an integer, a single new frame is inserted at that index. If the
1446 first argument is nil, a new frame is inserted at the last. If non-nil
1447 coordinates is given, it should be an array of arrays of Vector3Ds, and
1448 those coordinates are set to the new frame. Otherwise, the current coordinates are copied to the new frame. Returns an <a href="IntGroup.html">IntGroup</a> representing
1449 the inserted frames if successful, nil if not.
1450 </p>
1451 </div>
1452 </div>
1453
1454 <div id="method-M000210" class="method-detail">
1455 <a name="M000210"></a>
1456 <div class="method-heading">
1457 <span class="method-name">inspect       &rarr; String<br />
1458 </span>
1459 </div>
1460 <div class="method-description">
1461 <p>
1462 Returns a string in the form &quot;<a href="Molecule.html">Molecule</a>[name]&quot;
1463 if the molecule has the
1464 associated document. Otherwise, an internal representation like &quot;&lt;<a
1465 href="Molecule.html">Molecule</a>:0x****&gt;&quot; is returned.
1466 </p>
1467 </div>
1468 </div>
1469
1470 <div id="method-M000284" class="method-detail">
1471 <a name="M000284"></a>
1472 <div class="method-heading">
1473 <span class="method-name">invert(center = [0,0,0], group = nil)       &rarr; self<br />
1474 </span>
1475 </div>
1476 <div class="method-description">
1477 <p>
1478 Invert the molecule with the given center. If group is given, only the atoms in the group are moved. This operation is undoable.
1479 </p>
1480 </div>
1481 </div>
1482
1483 <div id="method-M000284" class="method-detail">
1484 <a name="is_atom_hidden"></a>
1485 <div class="method-heading">
1486 <span class="method-name">is_atom_hidden(index)       &rarr; Boolean<br />
1487 </span>
1488 </div>
1489 <div class="method-description">
1490 <p>
1491 Check whether the atom is visible or not. Unlike <a href="AtomRef.html#hidden">AtomRef#hidden</a>, this method takes care of the Molecule attributes <a href="Molecule.html#show_hydrogens">show_hydrogens</a>, <a href="Molecule.html#show_expanded">show_expanded</a> and <a href="Molecule.html#show_dummy_atoms">show_dummy_atoms</a>. 
1492 </p>
1493 </div>
1494 </div>
1495
1496 <div id="method-M000311" class="method-detail">
1497 <a name="M000311"></a>
1498 <div class="method-heading">
1499 <span class="method-name">line_mode<br />
1500 line_mode(bool)<br />
1501 self.line_mode = bool<br />
1502 </span>
1503 </div>
1504 <div class="method-description">
1505 <p>
1506 Set the flag whether to draw the model in line mode. If no argument is
1507 given, the current flag is returned.
1508 </p>
1509 </div>
1510 </div>
1511
1512 <div id="method-M000136" class="method-detail">
1513 <a name="M000136"></a>
1514 <div class="method-heading">
1515 <span class="method-name">loadcom(filename) &rarr; bool<br />
1516 loadgjf(filename) &rarr; bool</span>
1517 </div>
1518 <div class="method-description">
1519 <p>
1520 Load a molecule from a Gaussian input file.
1521 </p>
1522 </div>
1523 </div>
1524
1525 <div id="method-M000131" class="method-detail">
1526 <a name="M000131"></a>
1527 <div class="method-heading">
1528 <span class="method-name">loadcrd(filename) &rarr; bool</span>
1529 </div>
1530 <div class="method-description">
1531 <p>
1532 Import the frames from a crd file (from AMBER etc.). The molecule must <b>not</b> be empty, because a crd file does not contain structure information, 
1533 </p>
1534 </div>
1535 </div>
1536
1537 <div id="method-M000199" class="method-detail">
1538 <a name="M000199"></a>
1539 <div class="method-heading">
1540 <span class="method-name">loaddat(file)       &rarr; bool<br />
1541 </span>
1542 </div>
1543 <div class="method-description">
1544 <p>
1545 Read coordinates and ESP information (if present) from a GAMESS dat file. (TODO: read MO
1546 info as well) Return true if successful.
1547 </p>
1548 </div>
1549 </div>
1550
1551 <div id="method-M000195" class="method-detail">
1552 <a name="M000195"></a>
1553 <div class="method-heading">
1554 <span class="method-name">loaddcd(file)       &rarr; bool<br />
1555 </span>
1556 </div>
1557 <div class="method-description">
1558 <p>
1559 Read coordinates from a dcd file. The molecule must <b>not</b> be empty, because a dcd file does not contain structure information. This method is aware of the endian of the input file, so that you do not need to flip the endian when you transfer a dcd file created on other platform.
1560 Return true if successful.
1561 </p>
1562 </div>
1563 </div>
1564
1565 <div id="method-M000198" class="method-detail">
1566 <a name="M000198"></a>
1567 <div class="method-heading">
1568 <span class="method-name">loadfchk(file)       &rarr; bool<br />
1569 </span>
1570 </div>
1571 <div class="method-description">
1572 <p>
1573 Read coordinates and MO information from a Gaussian fchk file. Return true if successful.
1574 </p>
1575 </div>
1576 </div>
1577
1578 <div id="method-M000137" class="method-detail">
1579 <a name="M000137"></a>
1580 <div class="method-heading">
1581 <span class="method-name">loadinp(filename) &rarr; bool</span>
1582 </div>
1583 <div class="method-description">
1584 <p>
1585 Load molecule from a GAMESS input file.
1586 </p>
1587 </div>
1588 </div>
1589
1590 <div id="method-M000133" class="method-detail">
1591 <a name="M000133"></a>
1592 <div class="method-heading">
1593 <span class="method-name">loadlog(filename) &rarr; bool</span>
1594 </div>
1595 <div class="method-description">
1596 <p>
1597 Read coordinates from a GAMESS log file.
1598 </p>
1599 </div>
1600 </div>
1601
1602 <div id="method-M000192" class="method-detail">
1603 <a name="M000192"></a>
1604 <div class="method-heading">
1605 <span class="method-name">loadmbsf(file)       &rarr; bool<br />
1606 </span>
1607 </div>
1608 <div class="method-description">
1609 <p>
1610 Read a structure from a mbsf (Molby structure format) file. Return true if successful.
1611 </p>
1612 </div>
1613 </div>
1614
1615 <div id="method-M000135" class="method-detail">
1616 <a name="M000135"></a>
1617 <div class="method-heading">
1618 <span class="method-name">loadout(filename) &rarr; bool</span>
1619 </div>
1620 <div class="method-description">
1621 <p>
1622 Read coordinates from a Gaussian output file. If molecule is empty, then structure is built by guessing bonds from the interatomic distances. Otherwise, only the coordinates are read in. Return true if successful.
1623 </p>
1624 </div>
1625 </div>
1626
1627 <div id="method-M000194" class="method-detail">
1628 <a name="M000194"></a>
1629 <div class="method-heading">
1630 <span class="method-name">loadpdb(file)       &rarr; bool<br />
1631 </span>
1632 </div>
1633 <div class="method-description">
1634 <p>
1635 Read coordinates from a pdb file. If molecule is empty, then structure is
1636 build by use of CONECT instructions. Otherwise, only the coordinates are
1637 read in. Return true if successful.
1638 </p>
1639 </div>
1640 </div>
1641
1642 <div id="method-M000193" class="method-detail">
1643 <a name="M000193"></a>
1644 <div class="method-heading">
1645 <span class="method-name">loadpsf(file, pdbfile = nil)       &rarr; bool<br />
1646 </span>
1647 </div>
1648 <div class="method-description">
1649 <p>
1650 Read a structure from a psf file. molecule must be empty. The psf may be an
1651 &quot;extended&quot; version, which also contains coordinates. If pdbfile
1652 is given, then atomic coordinates are read from that file. Return true if
1653 successful.
1654 </p>
1655 </div>
1656 </div>
1657
1658 <div id="method-M000197" class="method-detail">
1659 <a name="M000197"></a>
1660 <div class="method-heading">
1661 <span class="method-name">loadres(file)       &rarr; bool<br />
1662 </span>
1663 </div>
1664 <div class="method-description">
1665 <p>
1666 Read coordinates from a SHELX input/result file. Return true if successful.
1667 </p>
1668 </div>
1669 </div>
1670
1671 <div id="method-M000196" class="method-detail">
1672 <a name="M000196"></a>
1673 <div class="method-heading">
1674 <span class="method-name">loadtep(file)       &rarr; bool<br />
1675 </span>
1676 </div>
1677 <div class="method-description">
1678 <p>
1679 Read coordinates from an ORTEP input file. Return true if successful.
1680 </p>
1681 </div>
1682 </div>
1683
1684 <div id="method-M000134" class="method-detail">
1685 <a name="M000134"></a>
1686 <div class="method-heading">
1687 <span class="method-name">loadxyz(file) &rarr; bool</span>
1688 </div>
1689 <div class="method-description">
1690 <p>
1691 Load molecule from a text file describing the cartesian coordinates. The first line may be "natoms a b c alpha beta gamma", which defines crystallographic unit cell; in this case, the coordinates are regarded as crystallographic internal coordinates. (The first "natoms" field is present for historical reasons.)
1692 </p>
1693 </div>
1694 </div>
1695
1696 <div id="method-M000170" class="method-detail">
1697 <a name="M000170"></a>
1698 <div class="method-heading">
1699 <span class="method-name">max(group = nil) &rarr; <a href="Vector3D.html">Vector3D</a></span>
1700 </div>
1701 <div class="method-description">
1702 <p>
1703 Return a Vector3D consisting of the largest value of x/y/z coordinates for the atoms in the group. If group is not given, all atoms are considered. Equivalent to <a href="Molecule.html#M000288">self.bounds</a>[1].
1704 </p>
1705 </div>
1706 </div>
1707
1708 <div id="method-M000232" class="method-detail">
1709 <a name="M000232"></a>
1710 <div class="method-heading">
1711 <span class="method-name">max_residue_number(group = nil)     &rarr; Integer<br />
1712 </span>
1713 </div>
1714 <div class="method-description">
1715 <p>
1716 Returns the maximum residue number used in the given group. If group is not specified, all atoms are considered. If no atom is present, nil is returned.
1717 </p>
1718 </div>
1719 </div>
1720
1721 <div id="method-M000313" class="method-detail">
1722 <a name="M000313"></a>
1723 <div class="method-heading">
1724 <span class="method-name">md_arena &rarr; <a href="MDArena.html">MDArena</a><br />
1725 </span>
1726 </div>
1727 <div class="method-description">
1728 <p>
1729 Returns the <a href="MDArena.html">MDArena</a> object associated to this
1730 molecule. If no <a href="MDArena.html">MDArena</a> is associated to this
1731 molecule, a new arena is created.
1732 </p>
1733 </div>
1734 </div>
1735
1736 <div id="method-M000290" class="method-detail">
1737 <a name="M000290"></a>
1738 <div class="method-heading">
1739 <span class="method-name">measure_angle(n1, n2, n3)       &rarr; Float<br />
1740 </span>
1741 </div>
1742 <div class="method-description">
1743 <p>
1744 Calculate the bond angle. The arguments can either be atom indices, the
1745 &quot;residue:name&quot;
1746 representation, or <a href="Vector3D.html">Vector3D</a> values. The return
1747 value is in <b>degree</b> (not radian).
1748 </p>
1749 </div>
1750 </div>
1751
1752 <div id="method-M000289" class="method-detail">
1753 <a name="M000289"></a>
1754 <div class="method-heading">
1755 <span class="method-name">measure_bond(n1, n2)       &rarr; Float<br />
1756 </span>
1757 </div>
1758 <div class="method-description">
1759 <p>
1760 Calculate the bond length. The arguments can either be atom indices, the
1761 &quot;residue:name&quot;
1762 representation, or <a href="Vector3D.html">Vector3D</a> values.
1763 </p>
1764 </div>
1765 </div>
1766
1767 <div id="method-M000291" class="method-detail">
1768 <a name="M000291"></a>
1769 <div class="method-heading">
1770 <span class="method-name">measure_dihedral(n1, n2, n3, n4)       &rarr; Float<br />
1771 </span>
1772 </div>
1773 <div class="method-description">
1774 <p>
1775 Calculate the dihedral angle. The arguments can either be atom indices, the
1776 &quot;residue:name&quot;
1777 representation, or <a href="Vector3D.html">Vector3D</a> values. The return
1778 value is in <b>degree</b> (not radian).
1779 </p>
1780 </div>
1781 </div>
1782
1783 <div id="method-M000169" class="method-detail">
1784 <a name="M000169"></a>
1785 <div class="method-heading">
1786 <span class="method-name">min(group = nil)</span>
1787 </div>
1788 <div class="method-description">
1789 <p>
1790 Return a Vector3D consisting of the smallest value of x/y/z coordinates for the atoms in the group. If group is not given, all atoms are considered. Equivalent to <a href="Molecule.html#M000288">self.bounds</a>[0].
1791 </p>
1792 </div>
1793 </div>
1794
1795 <div id="method-M000233" class="method-detail">
1796 <a name="M000233"></a>
1797 <div class="method-heading">
1798 <span class="method-name">min_residue_number(group = nil)     &rarr; Integer<br />
1799 </span>
1800 </div>
1801 <div class="method-description">
1802 <p>
1803 Returns the minimum residue number used in the given group. If group is not specified, all atoms are considered. If no atom is present, nil is returned.
1804 </p>
1805 </div>
1806 </div>
1807
1808 <div id="method-M000200" class="method-detail">
1809 <a name="M000200"></a>
1810 <div class="method-heading">
1811 <span class="method-name">molload(file, *args)       &rarr; bool<br />
1812 </span>
1813 </div>
1814 <div class="method-description">
1815 <p>
1816 Read a structure from the given file by calling the public method
1817 &quot;loadXXX&quot; (XXX is the file type given by the extension). If this
1818 method fails, then all defined (public)
1819 &quot;loadXXX&quot; methods are invoked, and raises an exception if none of
1820 them were successful.
1821 </p>
1822 </div>
1823 </div>
1824
1825 <div id="method-M000201" class="method-detail">
1826 <a name="M000201"></a>
1827 <div class="method-heading">
1828 <span class="method-name">molsave(file, *args)       &rarr; bool<br />
1829 </span>
1830 </div>
1831 <div class="method-description">
1832 <p>
1833 Write a structure/coordinate to the given file by calling the public method
1834 &quot;saveXXX&quot; (XXX is the file type given by the extension).
1835 </p>
1836 </div>
1837 </div>
1838
1839 <div id="method-M000207" class="method-detail">
1840 <a name="M000207"></a>
1841 <div class="method-heading">
1842 <span class="method-name">name       &rarr; String<br />
1843 </span>
1844 </div>
1845 <div class="method-description">
1846 <p>
1847 Returns the name of the molecule, which is the basename of the filename of the associated document. If the molecule has no associated document, nil is returned.
1848 </p>
1849 </div>
1850 </div>
1851
1852 <div id="method-M000219" class="method-detail">
1853 <a name="M000219"></a>
1854 <div class="method-heading">
1855 <span class="method-name">nangles       &rarr; Integer<br />
1856 </span>
1857 </div>
1858 <div class="method-description">
1859 <p>
1860 Returns the number of angles.
1861 </p>
1862 <p>
1863 <i>See Also:</i> <a href="Molecule.html#M000213">Molecule#angles</a>.
1864 </p>
1865 </div>
1866 </div>
1867
1868 <div id="method-M000217" class="method-detail">
1869 <a name="M000217"></a>
1870 <div class="method-heading">
1871 <span class="method-name">natoms       &rarr; Integer<br />
1872 </span>
1873 </div>
1874 <div class="method-description">
1875 <p>
1876 Returns the number of atoms.
1877 </p>
1878 <p>
1879 <i>See Also:</i> <a href="Molecule.html#M000211">Molecule#atoms</a>.
1880 </p>
1881 </div>
1882 </div>
1883
1884 <div id="method-M000218" class="method-detail">
1885 <a name="M000218"></a>
1886 <div class="method-heading">
1887 <span class="method-name">nbonds       &rarr; Integer<br />
1888 </span>
1889 </div>
1890 <div class="method-description">
1891 <p>
1892 Returns the number of bonds.
1893 </p>
1894 <p>
1895 <i>See Also:</i> <a href="Molecule.html#M000212">Molecule#bonds</a>.
1896 </p>
1897 </div>
1898 </div>
1899
1900 <div id="method-M000220" class="method-detail">
1901 <a name="M000220"></a>
1902 <div class="method-heading">
1903 <span class="method-name">ndihedrals       &rarr; Integer<br />
1904 </span>
1905 </div>
1906 <div class="method-description">
1907 <p>
1908 Returns the number of dihedrals.
1909 </p>
1910 <p>
1911 <i>See Also:</i> <a href="Molecule.html#M000214">Molecule#dihedrals</a>.
1912 </p>
1913 </div>
1914 </div>
1915
1916 <div id="method-M000319" class="method-detail">
1917 <a name="M000319"></a>
1918 <div class="method-heading">
1919 <span class="method-name">nelpots &rarr; Integer<br />
1920 </span>
1921 </div>
1922 <div class="method-description">
1923 <p>
1924 Get the number of electrostatic potential info.
1925 </p>
1926 <p>
1927 <i>See Also:</i> <a href="Molecule.html#M000320">Molecule#elpot</a>
1928 </div>
1929 </div>
1930
1931 <div id="method-M000171" class="method-detail">
1932 <a name="M000171"></a>
1933 <div class="method-heading">
1934 <span class="method-name">neutralize(charge = 0.0, group = nil)</span>
1935 </div>
1936 <div class="method-description">
1937 <p>
1938 Shift the partial charges of atoms, so that the sum of the charges becomes the specified value. If group is specified, only the atoms in the group are examined.
1939 </p>
1940 </div>
1941 </div>
1942
1943 <div id="method-M000267" class="method-detail">
1944 <a name="M000267"></a>
1945 <div class="method-heading">
1946 <span class="method-name">nframes &rarr; Integer<br />
1947 </span>
1948 </div>
1949 <div class="method-description">
1950 <p>
1951 Get the number of frames. Note that the minimum number of frames is 1, not 0.
1952 </p>
1953 <p>
1954 <i>See Also:</i> <a href="Molecule.html#M000265">Molecule#frame</a>, <a href="Molecule.html#M000266">Molecule#frame=</a>
1955 </p>
1956 </div>
1957 </div>
1958
1959 <div id="method-ngraphics" class="method-detail">
1960 <a name="ngraphics"></a>
1961 <div class="method-heading">
1962 <span class="method-name">ngraphics &rarr; Integer</span>
1963 </div>
1964 <div class="method-description">
1965 <p>
1966 Get the number of graphic objects.
1967 </p>
1968 </div>
1969 </div>
1970
1971 <div id="method-M000221" class="method-detail">
1972 <a name="M000221"></a>
1973 <div class="method-heading">
1974 <span class="method-name">nimpropers       &rarr; Integer<br />
1975 </span>
1976 </div>
1977 <div class="method-description">
1978 <p>
1979 Returns the number of impropers.
1980 </p>
1981 <p>
1982 <i>See Also:</i> <a href="Molecule.html#M000215">Molecule#impropers</a>.
1983 </p>
1984 </div>
1985 </div>
1986
1987 <div id="method-M000230" class="method-detail">
1988 <a name="M000230"></a>
1989 <div class="method-heading">
1990 <span class="method-name">nresidues       &rarr; Integer<br />
1991 </span>
1992 </div>
1993 <div class="method-description">
1994 <p>
1995 Returns the number of residues.
1996 </p>
1997 <p>
1998 <i>See Also:</i> <a href="Molecule.html#M000216">Molecule#residues</a>.
1999 </p>
2000 </div>
2001 </div>
2002
2003 <div id="method-M000231" class="method-detail">
2004 <a name="M000231"></a>
2005 <div class="method-heading">
2006 <span class="method-name">self.nresidues = Integer<br />
2007 </span>
2008 </div>
2009 <div class="method-description">
2010 <p>
2011 Change the number of residues.
2012 </p>
2013 <p>
2014 <i>See Also:</i> <a href="Molecule.html#M000216">Molecule#residues</a>, <a href="Molecule.html#M000230">Molecule#nresidues</a>.
2015 </p>
2016 </div>
2017 </div>
2018
2019 <div id="method-M000241" class="method-detail">
2020 <a name="M000241"></a>
2021 <div class="method-heading">
2022 <span class="method-name">nsymmetries &rarr; Integer<br />
2023 </span>
2024 </div>
2025 <div class="method-description">
2026 <p>
2027 Get the number of currently defined symmetry operations.
2028 </p>
2029 <p>
2030 <i>See Also:</i> <a href="Molecule.html#M000240">Molecule#symmetries</a>
2031 </p>
2032 </div>
2033 </div>
2034
2035 <div id="method-M000259" class="method-detail">
2036 <a name="M000259"></a>
2037 <div class="method-heading">
2038 <span class="method-name">offset_residue(group, offset)       &rarr; self<br />
2039 </span>
2040 </div>
2041 <div class="method-description">
2042 <p>
2043 Offset the residue number of the specified atoms. If any of the residue number gets
2044 negative, then exception is thrown. This operation is undoable.
2045 </p>
2046 </div>
2047 </div>
2048
2049 <div id="method-M000124" class="method-detail">
2050 <a name="M000124"></a>
2051 <div class="method-heading">
2052 <span class="method-name">orthogonal_vector(v)</span>
2053 </div>
2054 <div class="method-description">
2055 <p>
2056 Returns an arbitrary unit vector that is orthogonal to v
2057 </p>
2058 </div>
2059 </div>
2060
2061 <div id="method-M000315" class="method-detail">
2062 <a name="M000315"></a>
2063 <div class="method-heading">
2064 <span class="method-name">parameter &rarr; <a href="Parameter.html">Parameter</a><br />
2065 </span>
2066 </div>
2067 <div class="method-description">
2068 <p>
2069 Get a <a href="Parameter.html">Parameter</a> object that represents the local 
2070 parameters for this molecule. This method may call <code>self.md_arena.prepare(true)</code> internally, so that the side effect caused by <a href="MDArena.html#M000046">MDArena#prepare</a> may be observed.
2071 </p>
2072 </div>
2073 </div>
2074
2075 <div id="method-M000208" class="method-detail">
2076 <a name="M000208"></a>
2077 <div class="method-heading">
2078 <span class="method-name">path       &rarr; String<br />
2079 </span>
2080 </div>
2081 <div class="method-description">
2082 <p>
2083 Returns the full path name of the molecule, if it has an associated document.
2084 If the molecule has no associated document, then returns nil.
2085 </p>
2086 <p>
2087 <i>See Also:</i> <a href="Molecule.html#M000209">Molecule#dir</a>, <a href="Molecule.html#M000207">Molecule#name</a>
2088 </p>
2089 </div>
2090 </div>
2091
2092 <div id="method-M000226" class="method-detail">
2093 <a name="M000226"></a>
2094 <div class="method-heading">
2095 <span class="method-name">ps_per_step       &rarr; Float<br />
2096 </span>
2097 </div>
2098 <div class="method-description">
2099 <p>
2100 Returns the time increment (in picoseconds) for one step (defined by dcd
2101 format).
2102 </p>
2103 <p>
2104 <i>See Also:</i> <a href="Molecule.html#M000195">Molecule#loaddcd</a>, <a href="Molecule.html#M000227">Molecule#ps_per_step=</a>
2105 </p>
2106 </div>
2107 </div>
2108
2109 <div id="method-M000227" class="method-detail">
2110 <a name="M000227"></a>
2111 <div class="method-heading">
2112 <span class="method-name">ps_per_step = Float<br />
2113 </span>
2114 </div>
2115 <div class="method-description">
2116 <p>
2117 Set the time increment (in picoseconds) for one step (defined by dcd format).
2118 </p>
2119 <p>
2120 <i>See Also:</i> <a href="Molecule.html#M000195">Molecule#loaddcd</a>, <a href="Molecule.html#M000226">Molecule#ps_per_step</a>
2121 </p>
2122 </div>
2123 </div>
2124
2125 <div id="method-M000283" class="method-detail">
2126 <a name="M000283"></a>
2127 <div class="method-heading">
2128 <span class="method-name">reflect(axis, center = [0,0,0], group = nil)       &rarr; self<br />
2129 </span>
2130 </div>
2131 <div class="method-description">
2132 <p>
2133 Reflect the molecule by the plane which is perpendicular to axis and
2134 including center. axis must not be a zero vector. If group is given, only
2135 the atoms in the group are moved. This
2136 operation is undoable.
2137 </p>
2138 </div>
2139 </div>
2140
2141 <div id="method-M000272" class="method-detail">
2142 <a name="M000272"></a>
2143 <div class="method-heading">
2144 <span class="method-name">register_undo(script, *args)</span>
2145 </div>
2146 <div class="method-description">
2147 <p>
2148 Register an undo operation with the current molecule. When "undo" menu command is selected, a command "script(*args)" is executed. If self has no associated document, do nothing.
2149 </p>
2150 </div>
2151 </div>
2152
2153 <div id="method-M000246" class="method-detail">
2154 <a name="M000246"></a>
2155 <div class="method-heading">
2156 <span class="method-name">remove(group)       &rarr; self<br />
2157 </span>
2158 </div>
2159 <div class="method-description">
2160 <p>
2161 The atoms in the group are removed from the molecule. This operation is undoable.
2162 </p>
2163 </div>
2164 </div>
2165
2166 <div id="method-M000253" class="method-detail">
2167 <a name="M000253"></a>
2168 <div class="method-heading">
2169 <span class="method-name">remove_angle(n1, n2, n3)       &rarr; self<br />
2170 </span>
2171 </div>
2172 <div class="method-description">
2173 <p>
2174 Remove angle n1-n2-n3. Returns self. Usually, angles are automatically removed when any of the constituent bonds are removed, so it is rarely necessary to use this method explicitly.
2175 This operation is undoable.
2176 </p>
2177 <p>
2178 <i>See Also:</i> <a href="Molecule.html#remove_bond">Molecule#remove_bond</a>
2179 </p>
2180 </div>
2181 </div>
2182
2183 <div id="method-remove_bond" class="method-detail">
2184 <a name="remove_bond"></a>
2185 <div class="method-heading">
2186 <span class="method-name">remove_bond(n1, n2, ...)       &rarr; Integer<br />
2187 <span class="method-name">remove_bonds(n1, n2, ...)       &rarr; Integer<br />
2188 </span>
2189 </div>
2190 <div class="method-description">
2191 <p>
2192 Remove bond(s) between atoms n1 and n2, n3 and n4, and so on.
2193 The angles, dihedrals, and impropers including the removed bonds are automatically removed.
2194 If a bond for a particular pair of atoms is not present, do nothing for that pair.
2195 Returns the number of bonds actually removed. This operation is undoable.
2196 </p>
2197 </div>
2198 </div>
2199
2200 <div id="method-M000255" class="method-detail">
2201 <a name="M000255"></a>
2202 <div class="method-heading">
2203 <span class="method-name">remove_dihedral(n1, n2, n3, n4)       &rarr; self<br />
2204 </span>
2205 </div>
2206 <div class="method-description">
2207 <p>
2208 Remove dihedral n1-n2-n3-n4. Returns self. Usually, dihedrals are automatically removed when any of the constituent bonds are removed, so it is rarely necessary to use this method explicitly.
2209 This operation is undoable.
2210 </p>
2211 <p>
2212 <i>See Also:</i> <a href="Molecule.html#remove_bond">Molecule#remove_bond</a>
2213 </p>
2214 </div>
2215 </div>
2216
2217 <div id="method-M000270" class="method-detail">
2218 <a name="M000270"></a>
2219 <div class="method-heading">
2220 <span class="method-name">
2221 remove_frame(intGroup, want_coordinates = false)<br />
2222 remove_frames(intGroup, want_coordinates = false)<br />
2223 </span>
2224 </div>
2225 <div class="method-description">
2226 <p>
2227 Remove the frames at group. If want_coordinates is false (default), returns
2228 true if successful and nil otherwise. If want_coordinates is true, an array
2229 of arrays of the coordinates in the removed frames is returned.
2230 </p>
2231 <p>
2232 If the given group corrensponds to all frames, then the current frame is retained. Otherwise, if the current frame is included in the given group, the frame immediately before the group is selected (if no frame is present before the group, the frame with the lowest index is selected).
2233 </p>
2234 </div>
2235 </div>
2236
2237 <div id="method-remove_graphic" class="method-detail">
2238 <a name="remove_graphic"></a>
2239 <div class="method-heading">
2240 <span class="method-name">remove_graphic(index) &rarr; index</span>
2241 </div>
2242 <div class="method-description">
2243 <p>
2244 Remove a graphic object.
2245 </p>
2246 <p>
2247 <i>See Also:</i> <a href="#create_graphic">Molecule#create_graphic</a>
2248 </p></div>
2249 </div>
2250
2251 <div id="method-M000257" class="method-detail">
2252 <a name="M000257"></a>
2253 <div class="method-heading">
2254 <span class="method-name">remove_improper(n1, n2, n3, n4)       &rarr; self<br />
2255 </span>
2256 </div>
2257 <div class="method-description">
2258 <p>
2259 Remove improper n1-n2-n3-n4. Returns self. Usually, impropers are automatically 
2260 removed when any of the constituent bonds are removed, so it is rarely necessary to use this method explicitly.
2261 This operation is undoable.
2262 </p>
2263 <p>
2264 <i>See Also:</i> <a href="Molecule.html#remove_bond">Molecule#remove_bond</a>
2265 </p>
2266 </div>
2267 </div>
2268
2269 <div id="method-M000243" class="method-detail">
2270 <a name="M000243"></a>
2271 <div class="method-heading">
2272 <span class="method-name">remove_symmetry(count = nil) &rarr; Integer<br />
2273 remove_symmetries(count = nil) &rarr; Integer<br />
2274 </span>
2275 </div>
2276 <div class="method-description">
2277 <p>
2278 Remove the specified number of symmetry operations.
2279 The last added ones are removed first. If count is nil, then all symmetry operations are removed. Returns the number of leftover symmetry operations. This operation is undoable.
2280 </p>
2281 </div>
2282 </div>
2283
2284 <div id="method-M000260" class="method-detail">
2285 <a name="M000260"></a>
2286 <div class="method-heading">
2287 <span class="method-name">renumber_atoms(array)       &rarr; <a href="IntGroup.html">IntGroup</a><br />
2288 </span>
2289 </div>
2290 <div class="method-description">
2291 <p>
2292 Change the order of atoms so that the atoms specified in the array argument
2293 appear in this order from the top of the molecule. The atoms that are not included in array are
2294 placed after these atoms, and these atoms are returned as an intGroup. This
2295 operation is undoable.
2296 </p>
2297 </div>
2298 </div>
2299
2300 <div id="method-M000216" class="method-detail">
2301 <a name="M000216"></a>
2302 <div class="method-heading">
2303 <span class="method-name">residues       &rarr; <a href="MolEnumerable.html">MolEnumerable</a><br />
2304 </span>
2305 </div>
2306 <div class="method-description">
2307 <p>
2308 Returns a <a href="MolEnumerable.html">MolEnumerable</a> object
2309 representing the array of residue names.
2310 </p>
2311 <p>
2312 <i>See Also:</i> <a href="Molecule.html#M000230">Molecule#nresidues</a>
2313 </p>
2314 </div>
2315 </div>
2316
2317 <div id="method-M000216" class="method-detail">
2318 <a name="resize_to_fit"></a>
2319 <div class="method-heading">
2320 <span class="method-name">resize_to_fit       &rarr; self<br />
2321 </span>
2322 </div>
2323 <div class="method-description">
2324 <p>
2325 Resize the model drawing to fit in the window.
2326 </p>
2327 </div>
2328 </div>
2329
2330 <div id="method-M000282" class="method-detail">
2331 <a name="M000282"></a>
2332 <div class="method-heading">
2333 <span class="method-name">rotate(axis, angle, center = [0,0,0], group = nil)       &rarr; self<br />
2334 </span>
2335 </div>
2336 <div class="method-description">
2337 <p>
2338 Rotate the molecule. The axis must not a zero vector. angle is given in
2339 <b>degree</b> (not radian). If group is given, only the atoms
2340 in the group are moved. This operation is undoable.
2341 </p>
2342 </div>
2343 </div>
2344
2345 <div id="method-M000174" class="method-detail">
2346 <a name="M000174"></a>
2347 <div class="method-heading">
2348 <span class="method-name">rotate_fragment(n1, n2, angle)</span>
2349 </div>
2350 <div class="method-description">
2351 <p>
2352 Rotate the molecular fragment. The fragment given by &quot;<a
2353 href="Molecule.html#M000277">fragment</a>(n2, n1)&quot; is rotated, with
2354 the atom n1 as the center and the vector n2-&gt;n1 as the axis.
2355 Note the order of the arguments; the fragment including n2 is rotated. This operation is undoable.
2356 </p>
2357 </div>
2358 </div>
2359
2360 <div id="method-M000173" class="method-detail">
2361 <a name="M000173"></a>
2362 <div class="method-heading">
2363 <span class="method-name">rotate_with_axis(x, y, c = nil, group = nil)</span>
2364 </div>
2365 <div class="method-description">
2366 <p>
2367 Move the molecule (or the group if specified) so that c becomes the origin, x points to the x-axis, and y lies in the xy-plane (with the y-coordinate to be positive). X, y, and c can be either a Vector3D, an atom index, or an atom description like "1:CA1". If c is nil, it is equivalent to [0, 0, 0]. This operation is undoable.
2368 </p>
2369 </div>
2370 </div>
2371
2372 <div id="method-M000139" class="method-detail">
2373 <a name="M000139"></a>
2374 <div class="method-heading">
2375 <span class="method-name">savecom(file) &rarr; bool<br />
2376 savegjf(file) &rarr; bool</span>
2377 </div>
2378 <div class="method-description">
2379 <p>
2380 Write a Gaussian input file. Returns true if successful.
2381 </p>
2382 </div>
2383 </div>
2384
2385 <div id="method-M000132" class="method-detail">
2386 <a name="M000132"></a>
2387 <div class="method-heading">
2388 <span class="method-name">savecrd(file) &rarr; bool</span>
2389 </div>
2390 <div class="method-description">
2391 <p>
2392 Write coordinates to a crd file. Returns true if successful.
2393 </p>
2394 </div>
2395 </div>
2396
2397 <div id="method-M000205" class="method-detail">
2398 <a name="M000205"></a>
2399 <div class="method-heading">
2400 <span class="method-name">savedcd(file)       &rarr; bool<br />
2401 </span>
2402 </div>
2403 <div class="method-description">
2404 <p>
2405 Write coordinates to a dcd file. Returns true if successful.
2406 </p>
2407 </div>
2408 </div>
2409
2410 <div id="method-M000138" class="method-detail">
2411 <a name="M000138"></a>
2412 <div class="method-heading">
2413 <span class="method-name">saveinp(file) &rarr; bool</span>
2414 </div>
2415 <div class="method-description">
2416 <p>
2417 Write a GAMESS input file. Returns true if successful.
2418 </p>
2419 </div>
2420 </div>
2421
2422 <div id="method-M000202" class="method-detail">
2423 <a name="M000202"></a>
2424 <div class="method-heading">
2425 <span class="method-name">savembsf(file)       &rarr; bool<br />
2426 </span>
2427 </div>
2428 <div class="method-description">
2429 <p>
2430 Write structure as a mbsf file. Returns true if successful.
2431 </p>
2432 </div>
2433 </div>
2434
2435 <div id="method-M000204" class="method-detail">
2436 <a name="M000204"></a>
2437 <div class="method-heading">
2438 <span class="method-name">savepdb(file)       &rarr; bool<br />
2439 </span>
2440 </div>
2441 <div class="method-description">
2442 <p>
2443 Write coordinates to a pdb file. Returns true if successful.
2444 </p>
2445 </div>
2446 </div>
2447
2448 <div id="method-M000203" class="method-detail">
2449 <a name="M000203"></a>
2450 <div class="method-heading">
2451 <span class="method-name">savepsf(file)       &rarr; bool<br />
2452 </span>
2453 </div>
2454 <div class="method-description">
2455 <p>
2456 Write structure as a psf file. Returns true if successful.
2457 </p>
2458 <p>
2459 Note: when a document is saved as a psf file from a menu command, a pdb file is created at the same time. However, this is <b>not</b> the case with the script command savepsf. You need to invoke savepdb explicitly, if you want a pdb file.
2460 </p>
2461 </div>
2462 </div>
2463
2464 <div id="method-M000206" class="method-detail">
2465 <a name="M000206"></a>
2466 <div class="method-heading">
2467 <span class="method-name">savetep(file)       &rarr; bool<br />
2468 </span>
2469 </div>
2470 <div class="method-description">
2471 <p>
2472 Write an ORTEP input file. Returns true if successful.
2473 </p>
2474 </div>
2475 </div>
2476
2477 <div id="method-M000321" class="method-detail">
2478 <a name="M000321"></a>
2479 <div class="method-heading">
2480 <span class="method-name">search_equivalent_atoms(ig = nil) &rarr; Array of Integer<br />
2481 </span>
2482 </div>
2483 <div class="method-description">
2484 <p>
2485 Search topologically equivalent atoms (within the atom group if given).
2486 Returns an array of integers of size natoms, each entry designates the equivalent atom with the lowest index, or -1 if no equivalent atoms are present.
2487 </p>
2488 </div>
2489 </div>
2490
2491 <div id="method-M000316" class="method-detail">
2492 <a name="M000316"></a>
2493 <div class="method-heading">
2494 <span class="method-name">selectedMO &rarr; <a href="IntGroup.html">IntGroup</a><br />
2495 </span>
2496 </div>
2497 <div class="method-description">
2498 <p>
2499 Returns a group of selected MO in the &quot;MO Info&quot; table. If the MO
2500 info table is not selected, returns nil. If the MO info table is selected
2501 but no MOs are selected, returns an empty <a
2502 href="IntGroup.html">IntGroup</a>. The numbers in the table are 1-based.
2503 </p>
2504 </div>
2505 </div>
2506
2507 <div id="method-M000262" class="method-detail">
2508 <a name="M000262"></a>
2509 <div class="method-heading">
2510 <span class="method-name">selection       &rarr; <a href="IntGroup.html">IntGroup</a> (frozen)<br />
2511 </span>
2512 </div>
2513 <div class="method-description">
2514 <p>
2515 Returns the current selection. The returned value is frozen.
2516 </p>
2517 </div>
2518 </div>
2519
2520 <div id="method-M000263" class="method-detail">
2521 <a name="M000263"></a>
2522 <div class="method-heading">
2523 <span class="method-name">self.selection = group<br />
2524 </span>
2525 </div>
2526 <div class="method-description">
2527 <p>
2528 Set the current selection. The right-hand operand (of class <a href="IntGroup.html">IntGroup</a>) may be
2529 nil, in which case all atoms will be unselected.
2530 This operation is <b>not</b> undoable. If you need undo, use <a
2531 href="Molecule.html#M000264">set_undoable_selection</a> instead.
2532 </p>
2533 </div>
2534 </div>
2535
2536 <div id="method-M000275" class="method-detail">
2537 <a name="M000275"></a>
2538 <div class="method-heading">
2539 <span class="method-name">set_atom_attr(index, key, value)<br />
2540 </span>
2541 </div>
2542 <div class="method-description">
2543 <p>
2544 Set the atom attribute for the specified atom. Equivalent to <a href="Molecule.html#M000211">self.atoms</a>[index].key = value. See the methods of class <a href"AtomRef.html">AtomRef</a> for available atrributes. This operation is undoable.
2545 </p>
2546 </div>
2547 </div>
2548
2549 <div id="method-set_background_color" class="method-detail">
2550 <a name="set_background_color"></a>
2551 <div class="method-heading">
2552 <span class="method-name">set_background_color(red, green, blue) &rarr; self</span>
2553 </div>
2554 <div class="method-description">
2555 <p>
2556 Set the background color of the model view. Red, green, blue are in the range of [0, 1].
2557 </p>
2558 </div>
2559 </div>
2560
2561 <div id="method-M000181" class="method-detail">
2562 <a name="M000181"></a>
2563 <div class="method-heading">
2564 <span class="method-name">set_dihedral(n1, n2, n3, n4, angle)</span>
2565 </div>
2566 <div class="method-description">
2567 <p>
2568 Set the dihedral angle n1-n2-n3-n4 to the specified value. The bond n2-n3 should be rotatable. The fragment including n3 and n4 are rotated. This operation is undoable.
2569 </p>
2570 </div>
2571 </div>
2572
2573 <div id="method-set_graphic_color" class="method-detail">
2574 <a name="set_graphic_color"></a>
2575 <div class="method-heading">
2576 <span class="method-name">set_graphic_color(graphic_index, new_vaue) &rarr; new_value</span>
2577 </div>
2578 <div class="method-description">
2579 <p>
2580 Change the color of graphic_index-th graphic object. The new value must be an array-like object containing three or four numbers.
2581 </p>
2582 </div>
2583 </div>
2584
2585 <div id="method-set_graphic_point" class="method-detail">
2586 <a name="set_graphic_point"></a>
2587 <div class="method-heading">
2588 <span class="method-name">set_graphic_point(graphic_index, point_index, new_value) &rarr; new_value</span>
2589 </div>
2590 <div class="method-description">
2591 <p>
2592 Change the point_index-th control point of graphic_index-th graphic object. If the object is a line strip, nil is allowed for the new value, which means the line strip ends at the last point.
2593 </p>
2594 </div>
2595 </div>
2596
2597 <div id="method-M000264" class="method-detail">
2598 <a name="M000264"></a>
2599 <div class="method-heading">
2600 <span class="method-name">set_undoable_selection(group)<br />
2601 </span>
2602 </div>
2603 <div class="method-description">
2604 <p>
2605 Set the current selection with undo registration. The
2606 right-hand operand (of class <a href="IntGroup.html">IntGroup</a>) may be nil, in which case all atoms are unselected.
2607 This operation is undoable.
2608 </p>
2609 </div>
2610 </div>
2611
2612 <div id="method-set_view_rotation" class="method-detail">
2613 <a name="set_view_rotation"></a>
2614 <div class="method-heading">
2615 <span class="method-name">set_view_rotation(axis, angle) &rarr; self</span>
2616 </div>
2617 <div class="method-description">
2618 <p>
2619 Set the current rotation for the view. Axis is a <a href="Vector3D.html">Vector3D</a> or an object that can be transformed to a <a href="Vector3D.html">Vector3D</a>. Angle is in degree, not radian. The sign of the angle is positive when the rotation and the axis vector follow the left-hand rule (i.e. clockwise when viewed from the tip of the axis). Note that this is opposite from the OpenGL convention.
2620 </p>
2621 <p>
2622 <i>See Also:</i> <a href="#get_view_rotation">Molecule#get_view_rotation</a>
2623 </p></div>
2624 </div>
2625
2626 <div id="method-set_view_scale" class="method-detail">
2627 <a name="set_view_scale"></a>
2628 <div class="method-heading">
2629 <span class="method-name">set_view_scale(scale) &rarr; self</span>
2630 </div>
2631 <div class="method-description">
2632 <p>
2633 Set the current scale for the view. For detailed description of the scale parameter, see <a href="#get_view_scale">Molecule#get_view_scale</a>.
2634 </p>
2635 <p>
2636 <i>See Also:</i> <a href="#get_view_scale">Molecule#get_view_scale</a>
2637 </p></div>
2638 </div>
2639
2640 <div id="method-set_view_center" class="method-detail">
2641 <a name="set_view_center"></a>
2642 <div class="method-heading">
2643 <span class="method-name">set_view_center(vec) &rarr; self</span>
2644 </div>
2645 <div class="method-description">
2646 <p>
2647 Set the current center point of the view.
2648 </p>
2649 <p>
2650 <i>See Also:</i> <a href="#get_view_center">Molecule#get_view_center</a>
2651 </p></div>
2652 </div>
2653
2654 <div id="method-M000301" class="method-detail">
2655 <a name="M000301"></a>
2656 <div class="method-heading">
2657 <span class="method-name">show_dummy_atoms &rarr; bool<br />
2658 show_dummy_atoms(bool)<br />
2659 self.show_dummy_atoms = bool<br />
2660 </span>
2661 </div>
2662 <div class="method-description">
2663 <p>
2664 Set the flag whether to show the dummy atoms. If no argument is given, the current flag is returned.
2665 </p>
2666 </div>
2667 </div>
2668
2669 <div id="method-M000305" class="method-detail">
2670 <a name="M000305"></a>
2671 <div class="method-heading">
2672 <span class="method-name">show_ellipsoids &rarr; bool<br />
2673 show_ellipsoids(bool)<br />
2674 self.show_ellipsoids = bool<br />
2675 </span>
2676 </div>
2677 <div class="method-description">
2678 <p>
2679 Set the flag whether to show the thermal ellipsoids. If no argument is
2680 given, the current flag is returned.
2681 </p>
2682 </div>
2683 </div>
2684
2685 <div id="method-M000303" class="method-detail">
2686 <a name="M000303"></a>
2687 <div class="method-heading">
2688 <span class="method-name">show_expanded &rarr; bool<br />
2689 show_expanded(bool)<br />
2690 self.show_expanded = bool<br />
2691 </span>
2692 </div>
2693 <div class="method-description">
2694 <p>
2695 Set the flag whether to show the expanded atoms. If no argument is given, the current flag is returned.
2696 </p>
2697 </div>
2698 </div>
2699
2700 <div id="method-show_graphic" class="method-detail">
2701 <a name="show_graphic"></a>
2702 <div class="method-heading">
2703 <span class="method-name">show_graphic(graphic_index) &rarr; self</span>
2704 </div>
2705 <div class="method-description">
2706 <p>
2707 Set the visibility flag of the graphic_index-th graphic object.
2708 </p>
2709 <p>
2710 <i>See Also:</i> <a href="#hide_graphic">Molecule#hide_graphic</a>
2711 </p></div>
2712 </div>
2713
2714 <div id="method-M000307" class="method-detail">
2715 <a name="M000307"></a>
2716 <div class="method-heading">
2717 <span class="method-name">show_graphite &rarr; Integer<br />
2718 self.show_graphite = Integer<br />
2719 </span>
2720 </div>
2721 <div class="method-description">
2722 <p>
2723 Set whether to show the graphite plane. The plane is assumed to be on the xy plane. If the argument is positive, it also indicates the number of rings to display for each direction. If the argument is zero, the plane is not displayed. If no argument is given, the current value is returned.
2724 </p>
2725 </div>
2726 </div>
2727
2728 <div id="method-M000299" class="method-detail">
2729 <a name="M000299"></a>
2730 <div class="method-heading">
2731 <span class="method-name">show_hydrogens &rarr; bool<br />
2732 show_hydrogens(bool)<br />
2733 self.show_hydrogens = bool<br />
2734 </span>
2735 </div>
2736 <div class="method-description">
2737 <p>
2738 Set the flag whether to show the hydrogen atoms. If no argument is given, the current flag is returned.
2739 </p>
2740 </div>
2741 </div>
2742
2743 <div id="method-M000309" class="method-detail">
2744 <a name="M000309"></a>
2745 <div class="method-heading">
2746 <span class="method-name">self.show_periodic_image = [amin, amax, bmin, bmax, cmin, cmax]<br />
2747 </span>
2748 </div>
2749 <div class="method-description">
2750 <p>
2751 Set the number of periodic images to show along each cell axis. If the unit cell is not defined, the values are set but no visual effects are observed.
2752 </p>
2753 </div>
2754 </div>
2755
2756 <div id="method-M000312" class="method-detail">
2757 <a name="M000312"></a>
2758 <div class="method-heading">
2759 <span class="method-name">show_text(string)<br />
2760 </span>
2761 </div>
2762 <div class="method-description">
2763 <p>
2764 Show the string in the info text box in the molecule window.
2765 </p>
2766 </div>
2767 </div>
2768
2769 <div id="method-M000298" class="method-detail">
2770 <a name="M000298"></a>
2771 <div class="method-heading">
2772 <span class="method-name">show_unitcell &rarr; bool<br />
2773 show_unitcell(bool)<br />
2774 self.show_unitcell = bool<br />
2775 </span>
2776 </div>
2777 <div class="method-description">
2778 <p>
2779 Set the flag whether to show the unit cell. If no argument is given, the current flag is returned.
2780 </p>
2781 </div>
2782 </div>
2783
2784 <div id="method-M000188" class="method-detail">
2785 <a name="M000188"></a>
2786 <div class="method-heading">
2787 <span class="method-name">solvate(sbox, size = [10.0, 10.0, 10.0], limit = 3.0) &rarr; <a href="IntGroup.html">IntGroup</a></span>
2788 </div>
2789 <div class="method-description">
2790 <p>
2791 Solvate the molecule with the given solvent box. The first argument (sbox)
2792 must be a <a href="Molecule.html">Molecule</a> containing the solvent, which
2793 must have a unit cell information. The second argument
2794 defines the size of the solvated system. A positive number represents an
2795 offset to the bounding box of the
2796 solute, and a negative number represents an absolute size.
2797 The third argument represents the limit distance to avoid
2798 conflict between the solute and solvent. The solvent molecule containing atoms
2799 within this limit from the solute is removed.
2800 </p>
2801 <p>
2802 The return value is the IntGroup representing the added solvent atoms. This operation is undoable.
2803 </p>
2804 </div>
2805 </div>
2806
2807 <div id="method-M000222" class="method-detail">
2808 <a name="M000222"></a>
2809 <div class="method-heading">
2810 <span class="method-name">start_step       &rarr; Integer<br />
2811 </span>
2812 </div>
2813 <div class="method-description">
2814 <p>
2815 Returns the start step (defined by dcd format).
2816 </p>
2817 </div>
2818 </div>
2819
2820 <div id="method-M000223" class="method-detail">
2821 <a name="M000223"></a>
2822 <div class="method-heading">
2823 <span class="method-name">self.start_step = Integer<br />
2824 </span>
2825 </div>
2826 <div class="method-description">
2827 <p>
2828 Set the start step (defined by dcd format).
2829 </p>
2830 </div>
2831 </div>
2832
2833 <div id="method-M000224" class="method-detail">
2834 <a name="M000224"></a>
2835 <div class="method-heading">
2836 <span class="method-name">steps_per_frame       &rarr; Integer<br />
2837 </span>
2838 </div>
2839 <div class="method-description">
2840 <p>
2841 Returns the number of steps between frames (defined by dcd format).
2842 </p>
2843 </div>
2844 </div>
2845
2846 <div id="method-M000225" class="method-detail">
2847 <a name="M000225"></a>
2848 <div class="method-heading">
2849 <span class="method-name">self.steps_per_frame = Integer<br />
2850 </span>
2851 </div>
2852 <div class="method-description">
2853 <p>
2854 Set the number of steps between frames (defined by dcd format).
2855 </p>
2856 </div>
2857 </div>
2858
2859 <div id="method-M000240" class="method-detail">
2860 <a name="M000240"></a>
2861 <div class="method-heading">
2862 <span class="method-name">symmetry &rarr; Array of <a href="Transform.html">Transform</a><br />
2863 symmetries &rarr; Array of <a href="Transform.html">Transform</a><br />
2864 </span>
2865 </div>
2866 <div class="method-description">
2867 <p>
2868 Get the currently defined symmetry operations. If no symmetry operation is
2869 defined, returns an empty array.
2870 </p>
2871 </div>
2872 </div>
2873
2874 <div id="method-M000285" class="method-detail">
2875 <a name="M000285"></a>
2876 <div class="method-heading">
2877 <span class="method-name">transform(transform, group = nil)       &rarr; self<br />
2878 </span>
2879 </div>
2880 <div class="method-description">
2881 <p>
2882 Transform the molecule by the given <a href="Transform.html">Transform</a> object.
2883 If group is given, only the atoms in the group are moved. This operation is undoable.
2884 </p>
2885 </div>
2886 </div>
2887
2888 <div id="method-M000281" class="method-detail">
2889 <a name="M000281"></a>
2890 <div class="method-heading">
2891 <span class="method-name">translate(vec, group = nil)       &rarr; self<br />
2892 </span>
2893 </div>
2894 <div class="method-description">
2895 <p>
2896 Translate the molecule by vec. If group is given, only the atoms in the group are moved. This
2897 operation is undoable.
2898 </p>
2899 </div>
2900 </div>
2901
2902 <div id="method-M000274" class="method-detail">
2903 <a name="M000274"></a>
2904 <div class="method-heading">
2905 <span class="method-name">self.undo_enabled = bool<br />
2906 </span>
2907 </div>
2908 <div class="method-description">
2909 <p>
2910 Enable or disable undo.
2911 </p>
2912 </div>
2913 </div>
2914
2915 <div id="method-M000273" class="method-detail">
2916 <a name="M000273"></a>
2917 <div class="method-heading">
2918 <span class="method-name">undo_enabled? &rarr; bool<br />
2919 </span>
2920 </div>
2921 <div class="method-description">
2922 <p>
2923 Returns true if undo is enabled for this molecule; otherwise no.
2924 </p>
2925 </div>
2926 </div>
2927
2928 <div id="method-M000297" class="method-detail">
2929 <a name="M000297"></a>
2930 <div class="method-heading">
2931 <span class="method-name">self.update_enabled = bool<br />
2932 </span>
2933 </div>
2934 <div class="method-description">
2935 <p>
2936 Enable or disable screen update. This is effective for automatic update on
2937 modification. Explicit call to <a href="Molecule.html#M000295">Molecule#display</a> always updates the
2938 screen.
2939 </p>
2940 </div>
2941 </div>
2942
2943 <div id="method-M000296" class="method-detail">
2944 <a name="M000296"></a>
2945 <div class="method-heading">
2946 <span class="method-name">update_enabled? &rarr; bool<br />
2947 </span>
2948 </div>
2949 <div class="method-description">
2950 <p>
2951 Returns true if screen update is enabled; otherwise no.
2952 </p>
2953 </div>
2954 </div>
2955
2956 <div id="method-vdw-par" class="method-detail">
2957 <a name="vdw_par"></a>
2958 <div class="method-heading">
2959   <span class="method-name">vdw_par(idx)       &rarr; <a href="ParameterRef.html">ParameterRef</a><br />
2960 </span>
2961 </div>
2962 <div class="method-description">
2963 <p>
2964 Returns a <a href="ParameterRef.html">ParameterRef</a> object (of type "vdw") representing the vdw MD parameter for the specified atom. If the MD parameters are not initialized yet, tries to initialize them by self.<a href="#M000313">md_arena</a>.<a href="MDArena.html#M000046">prepare</a>(true), which may throw exception.
2965 </p>
2966 <p>
2967 <i>See Also:</i>
2968 <a href="Molecule.html#angle_par">Molecule#angle_par</a>, 
2969 <a href="Molecule.html#bond_par">Molecule#bond_par</a>, 
2970 <a href="Molecule.html#dihedral_par">Molecule#dihedral_par</a>, 
2971 <a href="Molecule.html#improper_par">Molecule#improper_par</a>
2972 </p>
2973 </div>
2974 </div>
2975
2976 <div id="method-M000293" class="method-detail">
2977 <a name="M000293"></a>
2978 <div class="method-heading">
2979 <span class="method-name">wrap_unit_cell(group) &rarr; <a href="Vector3D.html">Vector3D</a><br />
2980 </span>
2981 </div>
2982 <div class="method-description">
2983 <p>
2984 Move the specified group so that the center of mass of the group is within
2985 the unit cell. The offset vector is
2986 returned. If no unit cell is
2987 defined, exception is raised. This operation is undoable.
2988 </p>
2989 </div>
2990 </div>
2991
2992 </div>
2993
2994 </body>
2995 </html>