comparison docs/modules/txt/Molecule.txt @ 0:4816e4a8ae95 draft default tip

Uploaded
author deepakjadmin
date Wed, 20 Jan 2016 09:23:18 -0500
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:4816e4a8ae95
1 NAME
2 Molecule - Molecule class
3
4 SYNOPSIS
5 use Molecule;
6
7 use Molecule qw(:all);
8
9 DESCRIPTION
10 Molecule class provides the following methods:
11
12 new, AddAtom, AddAtoms, AddBond, AddBonds, AddHydrogens,
13 AddPolarHydrogens, ClearRings, Copy, DeleteAromaticity, DeleteAtom,
14 DeleteAtoms, DeleteBond, DeleteBonds, DeleteHydrogens,
15 DeletePolarHydrogens, DetectAromaticity, DetectRings,
16 FormatElementalCompositionInformation, GetAllAtomPaths,
17 GetAllAtomPathsStartingAt, GetAllAtomPathsStartingAtWithLength,
18 GetAllAtomPathsStartingAtWithLengthUpto, GetAllAtomPathsWithLength,
19 GetAllAtomPathsWithLengthUpto, GetAromaticRings, GetAromaticityModel,
20 GetAtomNeighborhoods, GetAtomNeighborhoodsWithRadiusUpto,
21 GetAtomNeighborhoodsWithSuccessorAtoms,
22 GetAtomNeighborhoodsWithSuccessorAtomsAndRadiusUpto, GetAtomPathBonds,
23 GetAtomPaths, GetAtomPathsBetween, GetAtomPathsStartingAt,
24 GetAtomPathsStartingAtWithLength, GetAtomPathsStartingAtWithLengthUpto,
25 GetAtomPathsWithLength, GetAtomPathsWithLengthUpto, GetAtoms, GetBonds,
26 GetCharge, GetConnectedComponents, GetConnectedComponentsAtoms,
27 GetDimensionality, GetElementalComposition, GetElementsAndNonElements,
28 GetExactMass, GetFormalCharge, GetFreeRadicalElectrons,
29 GetFusedAndNonFusedRings, GetLargestConnectedComponent,
30 GetLargestConnectedComponentAtoms, GetLargestRing, GetMolecularFormula,
31 GetMolecularWeight, GetNumOfAromaticRings, GetNumOfAtoms, GetNumOfBonds,
32 GetNumOfConnectedComponents, GetNumOfElementsAndNonElements,
33 GetNumOfHeavyAtoms, GetNumOfHydrogenAtoms, GetNumOfMissingHydrogenAtoms,
34 GetNumOfNonHydrogenAtoms, GetNumOfRings, GetNumOfRingsWithEvenSize,
35 GetNumOfRingsWithOddSize, GetNumOfRingsWithSize,
36 GetNumOfRingsWithSizeGreaterThan, GetNumOfRingsWithSizeLessThan,
37 GetRingBonds, GetRingBondsFromRings, GetRings, GetRingsWithEvenSize,
38 GetRingsWithOddSize, GetRingsWithSize, GetRingsWithSizeGreaterThan,
39 GetRingsWithSizeLessThan, GetSizeOfLargestRing, GetSizeOfSmallestRing,
40 GetSmallestRing, GetSpinMultiplicity, GetSupportedAromaticityModels,
41 GetTopologicallySortedAtoms, GetValenceModel, HasAromaticAtomsInRings,
42 HasAromaticAtomsNotInRings, HasAromaticRings, HasAtom, HasBond,
43 HasFusedRings, HasNoRings, HasOnlyOneRing, HasRings, IsAromatic,
44 IsMolecule, IsRingAromatic, IsSupportedAromaticityModel,
45 IsThreeDimensional, IsTwoDimensional, KeepLargestComponent,
46 KekulizeAromaticAtoms, NewAtom, NewBond, SetActiveRings,
47 SetAromaticityModel, SetID, SetValenceModel, StringifyMolecule
48
49 The following methods can also be used as functions:
50
51 FormatElementalCompositionInformation, IsMolecule
52
53 Molecule class is derived from ObjectProperty base class which provides
54 methods not explicitly defined in Molecule or ObjectProperty class using
55 Perl's AUTOLOAD functionality. These methods are generated on-the-fly
56 for a specified object property:
57
58 Set<PropertyName>(<PropertyValue>);
59 $PropertyValue = Get<PropertyName>();
60 Delete<PropertyName>();
61
62 METHODS
63 new
64 $NewMolecule = new Molecule([%PropertyNameAndValues]);
65
66 Using specified *Atom* property names and values hash, new method
67 creates a new object and returns a reference to newly created Atom
68 object. By default, the following properties are initialized:
69
70 ID = SequentialObjectID
71 Name = "Molecule <SequentialObjectID>"
72
73 Examples:
74
75 $Molecule = new Molecule();
76
77 $WaterMolecule = new Molecule('Name' => 'Water');
78
79 $Oxygen = new Atom('AtomSymbol' => 'O', 'XYZ' => [0, 0, 0]);
80 $Hydrogen1 = new Atom('AtomSymbol' => 'H',
81 'XYZ' => [0.7144, 0.4125, 0]);
82 $Hydrogen2 = new Atom('AtomSymbol' => 'H',
83 'XYZ' => [1.1208, -0.2959, 0]);
84 $WaterMolecule->AddAtoms($Oxygen, $Hydrogen1, $Hydrogen2);
85
86 $Bond1 = new Bond('Atoms' => [$Oxygen, $Hydrogen1],
87 'BondOrder' => 1);
88 $Bond2 = new Bond('Atoms' => [$Oxygen, $Hydrogen2],
89 'BondOrder' => 1);
90 $WaterMolecule->AddBonds($Bond1, $Bond2);
91
92 AddAtom
93 $Molecule->AddAtom($Atom);
94
95 Adds an *Atom* to a *Molecule* and returns *Molecule*.
96
97 AddAtoms
98 $Molecule->AddAtoms(@Atoms);
99
100 Adds *Atoms* to a *Molecule* and returns *Molecule*.
101
102 AddBond
103 $Molecule->AddBond($Bond);
104
105 Adds a *Bond* to a *Molecule* and returns *Molecule*.
106
107 AddBonds
108 $Molecule->AddBonds(@Bonds);
109
110 Adds *Bonds* to a *Molecule* and returns *Molecule*.
111
112 AddHydrogens
113 $NumOfHydrogensAdded = $Molecule->AddHydrogens();
114
115 Adds hydrogens to each atom in a *Molecule* and returns total number
116 of hydrogens added. The current release of MayaChemTools doesn't
117 assign hydrogen positions.
118
119 AddPolarHydrogens
120 $NumOfHydrogensAdded = $Molecule->AddPolarHydrogens();
121
122 Adds hydrogens to each polar atom - N, O, P or S - in a *Molecule*
123 and returns total number of polar hydrogens added. The current
124 release of MayaChemTools doesn't assign hydrogen positions.
125
126 ClearRings
127 $Molecule->ClearRings();
128
129 Deletes all rings associated with *Molecule* and returns *Molecule*.
130
131 Copy
132 $MoleculeCopy = $Molecule->Copy();
133
134 Copies *Molecule* and its associated data using Storable::dclone and
135 returns a new Molecule object.
136
137 DeleteAromaticity
138 $Molecule->DeleteAromaticity();
139
140 Deletes aromatic property associated with all atoms and bonds in a
141 *Molecule* and returns *Molecule*.
142
143 DeleteAtom
144 $Molecule->DeleteAtom($Atom);
145
146 Deletes *Atom* from a *Molecule* and returns *Molecule*.
147
148 DeleteAtoms
149 $Molecule->DeleteAtoms(@Atoms);
150
151 Deletes *Atoms* from a *Molecule* and returns *Molecule*.
152
153 DeleteBond
154 $Molecule->DeleteBond($Bond);
155
156 Deletes *Bond* from a *Molecule* and returns *Molecule*.
157
158 DeleteBonds
159 $Molecule->DeleteBonds(@Bonds);
160
161 Deletes *Bonds* from a *Molecule* and returns *Molecule*.
162
163 DeleteHydrogens
164 $NumOfHydrogensDeleted = $Molecule->DeleteHydrogens();
165
166 Removes hydrogens from each atom in a *Molecule* and returns total
167 number of hydrogens deleted.
168
169 DeletePolarHydrogens
170 $NumOfHydrogensDeleted = $Molecule->DeletePolarHydrogens();
171
172 Removes hydrogens to each polar atom - N, O, P or S - in a
173 *Molecule* and returns total number of polar hydrogens deleted.
174
175 DetectAromaticity
176 $Molecule->DetectAromaticity();
177
178 Associates *Aromatic* property to atoms and bonds involved in
179 aromatic rings or ring systems in a *Molecule* and returns
180 *Molecule*.
181
182 This method assumes the ring detection has already been perfomed
183 using DetectRings. And any existing *Aromatic* property associated
184 with atoms and bonds is deleted before performing aromaticity
185 detection.
186
187 What is aromaticity? [ Ref 124 ] It's in the code of the
188 implementer, did you say? Agree. The implementation of aromaticity
189 varies widely across different packages [ Ref 125 ]; additionally,
190 the implementation details are not always completely available, and
191 it's not possible to figure out the exact implementation of
192 aromaticity across various packages. Using the publicly available
193 information, however, one can try to reproduce the available results
194 to the extent possible, along with parameterizing all the control
195 parameters used to implement different aromaticity models, and
196 that's exactly what the current release of MayaChemTools does.
197
198 The implementation of aromaticity corresponding to various
199 aromaticity models in MayaChemTools package is driven by an external
200 CSV file AromaticityModelsData.csv, which is distributed with the
201 package and is available in lib/data directory. The CSV files
202 contains names of supported aromaticity models, along with various
203 control parameters and their values. This file is loaded and
204 processed during instantiation of Molecule class and data
205 corresponding to specific aromaticity model are used to detect
206 aromaticity for that model. Any new aromaticity model added to the
207 aromaticity data file, using different combinations of values for
208 existing control parameters, would work without any changes to the
209 code; the addition of any new control parameters, however, requires
210 its implementation in the code used to calculate number of pi
211 electrons available towards delocalization in a ring or ring
212 systems.
213
214 The current release of MayaChemTools package supports these
215 aromaticity models: MDLAromaticityModel, TriposAromaticityModel,
216 MMFFAromaticityModel, ChemAxonBasicAromaticityModel,
217 ChemAxonGeneralAromaticityModel, DaylightAromaticityModel,
218 MayaChemToolsAromaticityModel.
219
220 The current list of control parameters available to detect
221 aromaticity corresponding to different aromaticity models are:
222 AllowHeteroRingAtoms, HeteroRingAtomsList,
223 AllowExocyclicDoubleBonds, AllowHomoNuclearExocyclicDoubleBonds,
224 AllowElectronegativeRingAtomExocyclicDoubleBonds,
225 AllowRingAtomFormalCharge, AllowHeteroRingAtomFormalCharge,
226 MinimumRingSize. The values for these control parameters are
227 specified in AromaticityModelsData.csv file.
228
229 Although definition of aromaticity differs across various
230 aromaticity models, a ring or a ring system containing 4n + 2 pi
231 electrons (Huckel's rule) corresponding to alternate single and
232 double bonds, in general, is considered aromatic.
233
234 The available valence free electrons on heterocyclic ring atoms,
235 involved in two single ring bonds, are also allowed to participate
236 in pi electron delocalizaiton for most of the supported aromaticity
237 models.
238
239 The presence of exocyclic terminal double bond on ring atoms
240 involved in pi electron delocalization is only allowed for some of
241 the aromaticity models. Additionally, the type atoms involved in
242 exocyclic terminal double bonds may result in making a ring or ring
243 system non-aromatic.
244
245 For molecules containing fused rings, each fused ring set is
246 considered as one aromatic system for counting pi electrons to
247 satisfy Huckel's rule; In case of a failure, rings in fused set are
248 treated individually for aromaticity detection. Additionally,
249 non-fused rings are handled on their own during aromaticity
250 detection.
251
252 DetectRings
253 $Molecule->DetectRings();
254
255 Detects rings in a *Molecule* and returns *Molecule*. Ring detection
256 is performed using DetectCycles method avaible in Graph class which
257 in turn uses methods available Graph::CyclesDetection class.
258 Graph::CyclesDetection class implements collapsing path graph [Ref
259 31] methodology to detect all cycles in a graph.
260
261 FormatElementalCompositionInformation
262 $FormattedInfo = $Molecule->FormatElementalCompositionInformation(
263 $ElementsRef, $ElementCompositionRef,
264 [$Precision]);
265 $FormattedInfo = Molecule::FormatElementalCompositionInformation(
266 $ElementsRef, $ElementCompositionRef,
267 [$Precision]);
268
269 Using *ElementsRef* and *ElementCompositionRef* arrays referneces
270 containg informatio about elements and their composition, formats
271 elemental composition information and returns a *FormattedInfo*
272 string. Defaule *Precision* value: *2*.
273
274 GetAromaticityModel
275 $AromaticityModel = $Molecule->GetAromaticityModel();
276
277 Returns name of AromaticityModel set for *Molecule* corresponding to
278 AromaticityModel property or default model name of
279 MayaChemToolsAromaticityModel.
280
281 GetAllAtomPaths
282 $AtomPathsRef = $Molecule->GetAllAtomPaths([$AllowCycles]);
283
284 Returns all paths as a reference to an array containing reference to
285 arrays with path Atom objects.
286
287 Path atoms correspond to to all possible paths for each atom in
288 molecule with all possible lengths and sharing of bonds in paths
289 traversed. By default, rings are included in paths. A path
290 containing a ring is terminated at an atom completing the ring.
291
292 For molecule without any rings, this method returns the same set of
293 atom paths as GetAtomPaths method.
294
295 GetAllAtomPathsStartingAt
296 $AtomPathsRef = $Molecule->GetAllAtomPathsStartingAt($StartAtom,
297 [$AllowCycles]);
298
299 Returns all atom paths starting from *StartAtom* as a reference to
300 an array containing reference to arrays with path Atom objects.
301
302 Path atoms atoms correspond to to all possible paths for specified
303 atom in molecule with all possible lengths and sharing of bonds in
304 paths traversed. By default, rings are included in paths. A path
305 containing a ring is terminated at an atom completing the ring.
306
307 For molecule without any rings, this method returns the same set of
308 atom paths as GetAtomPathsStartingAt method.
309
310 GetAllAtomPathsStartingAtWithLength
311 $AtomPathsRef = $Molecule->GetAllAtomPathsStartingAtWithLength(
312 $StartAtom, $Length, [$AllowCycles]);
313
314 Returns all atom paths starting from *StartAtom* with specified
315 *Length*as a reference to an array containing reference to arrays
316 with path Atom objects.
317
318 Path atoms atoms correspond to to all possible paths for specified
319 atom in molecule with all possible lengths and sharing of bonds in
320 paths traversed. By default, rings are included in paths. A path
321 containing a ring is terminated at an atom completing the ring.
322
323 For molecule without any rings, this method returns the same set of
324 atom paths as GetAtomPathsStartingAtWithLength method.
325
326 GetAllAtomPathsStartingAtWithLengthUpto
327 $AtomPathsRef = $Molecule->GetAllAtomPathsStartingAtWithLengthUpto(
328 $StartAtom, $Length, [$AllowCycles]);
329
330 Returns atom paths starting from *StartAtom* with length up to
331 *Length* as a reference to an array containing reference to arrays
332 with path Atom objects.
333
334 Path atoms atoms correspond to all possible paths for specified atom
335 in molecule with length up to a specified length and sharing of
336 bonds in paths traversed. By default, rings are included in paths. A
337 path containing a ring is terminated at an atom completing the ring.
338
339 For molecule without any rings, this method returns the same set of
340 atom paths as *GetAtomPathsStartingAtWithLengthUpto* method.
341
342 GetAllAtomPathsWithLength
343 $AtomPathsRef = $Molecule->GetAllAtomPathsWithLength($Length,
344 [$AllowCycles]);
345
346 Returns all atom paths with specified *Length* as a reference to an
347 array containing reference to arrays with path Atom objects.
348
349 Path atoms correspond to to all possible paths for each atom in
350 molecule with length up to a specified length and sharing of bonds
351 in paths traversed. By default, rings are included in paths. A path
352 containing a ring is terminated at an atom completing the ring.
353
354 For molecule without any rings, this method returns the same set of
355 atom paths as as *GetAtomPathsWithLength* method.
356
357 GetAllAtomPathsWithLengthUpto
358 $AtomPathsRef = $Molecule->GetAllAtomPathsWithLengthUpto($Length,
359 [$AllowCycles]);
360
361 Returns all atom paths with length up to *Length* as a reference to
362 an array containing reference to arrays with path Atom objects.
363
364 Path atoms correspond to to all possible paths for each atom in
365 molecule with length up to a specified length and sharing of bonds
366 in paths traversed. By default, rings are included in paths. A path
367 containing a ring is terminated at an atom completing the ring.
368
369 For molecule without any rings, this method returns the same set of
370 atom paths as as *GetAtomPathsWithLengthUpto* method.
371
372 GetAromaticRings
373 @AtomaticRings = $Molecule->GetAromaticRings();
374
375 Returns aromatic rings as an array containing references to arrays
376 of ring *Atom* objects in a *Molecule*.
377
378 GetAtomNeighborhoods
379 @Neighborhoods = $Molecule->GetAtomNeighborhoods($StartAtom);
380
381 Returns atom neighborhoods around a *StartAtom* as an array
382 containing references to arrays with neighborhood *Atom* objects at
383 possible radii.
384
385 GetAtomNeighborhoodsWithRadiusUpto
386 @Neighborhoods = $Molecule->GetAtomNeighborhoodsWithRadiusUpto($StartAtom,
387 $Radius);
388
389 Returns atom neighborhoods around a *StartAtom* as an array
390 containing references to arrays with neighborhood *Atom* objects up
391 to *Radius*.
392
393 GetAtomNeighborhoodsWithSuccessorAtoms
394 @Neighborhoods = $Molecule->GetAtomNeighborhoodsWithSuccessorAtoms(
395 $StartAtom);
396
397 Returns atom neighborhood around a specified *StartAtom*, along with
398 their successor connected atoms, collected at all radii as an array
399 containing references to arrays with first value corresponding to
400 neighborhood atom at a specific radius and second value as reference
401 to an array containing its successor connected atoms.
402
403 For a neighborhood atom at each radius level, the successor
404 connected atoms correspond to the neighborhood atoms at the next
405 radius level. Consequently, the neighborhood atoms at the last
406 radius level don't contain any successor atoms which fall outside
407 the range of specified radius.
408
409 GetAtomNeighborhoodsWithSuccessorAtomsAndRadiusUpto
410 @Neighborhoods = $Molecule->GetAtomNeighborhoodsWithSuccessorAtomsAndRadiusUpto(
411 $StartAtom, $Radius);
412
413 Returns atom neighborhood around a specified *StartAtom*, along with
414 their successor connected atoms, collected upto specified *Radiud*
415 as an array containing references to arrays with first value
416 corresponding to neighborhood atom at a specific radius and second
417 value as reference to an array containing its successor connected
418 atoms.
419
420 For a neighborhood atom at each radius level, the successor
421 connected atoms correspond to the neighborhood atoms at the next
422 radius level. Consequently, the neighborhood atoms at the last
423 radius level don't contain any successor atoms which fall outside
424 the range of specified radius.
425
426 GetAtomPathBonds
427 $Return = $Molecule->GetAtomPathBonds(@PathAtoms);
428
429 Returns an array containing Bond objects corresponding to successive
430 pair of atoms in *PathAtoms*
431
432 GetAtomPaths
433 $AtomPathsRef = $Molecule->GetAtomPaths([$AllowCycles]);
434
435 Returns all paths as a reference to an array containing reference to
436 arrays with path Atom objects.
437
438 Path atoms correspond to to all possible paths for each atom in
439 molecule with all possible lengths and no sharing of bonds in paths
440 traversed. By default, rings are included in paths. A path
441 containing a ring is terminated at an atom completing the ring.
442
443 GetAtomPathsBetween
444 $AtomPathsRef = $Molecule->GetAtomPathsBetween($StartAtom, $EndAtom);
445
446 Returns all paths as between *StartAtom* and *EndAtom* as a
447 reference to an array containing reference to arrays with path Atom
448 objects.
449
450 For molecules with rings, atom paths array contains may contain two
451 paths.
452
453 GetAtomPathsStartingAt
454 $AtomPathsRef = $Molecule->GetAtomPathsStartingAt($StartAtom, [$AllowCycles]);
455
456 Returns paths starting at *StartAtom* as a reference to an array
457 containing reference to arrays with path Atom objects.
458
459 Path atoms correspond to all possible paths for specified atom in
460 molecule with all possible lengths and no sharing of bonds in paths
461 traversed. By default, rings are included in paths. A path
462 containing a ring is terminated at an atom completing the ring.
463
464 GetAtomPathsStartingAtWithLength
465 $AtomPathsRef = $Molecule->GetAtomPathsStartingAtWithLength($StartAtom,
466 $Length, [$AllowCycles]);
467
468 Returns paths starting at *StartAtom* with length *Length* as a
469 reference to an array containing reference to arrays with path Atom
470 objects.
471
472 Path atoms correspond to all possible paths for specified atom in
473 molecule with length upto a specified length and no sharing of bonds
474 in paths traversed. By default, rings are included in paths. A path
475 containing a ring is terminated at an atom completing the ring.
476
477 GetAtomPathsStartingAtWithLengthUpto
478 $AtomPathsRef = $Molecule->GetAtomPathsStartingAtWithLengthUpto($StartAtom,
479 $Length, [$AllowCycles]);
480
481 Returns paths starting at *StartAtom* with length up to *Length* as
482 a reference to an array containing reference to arrays with path
483 Atom objects.
484
485 Path atoms correspond to all possible paths for specified atom in
486 molecule with length upto a specified length and no sharing of bonds
487 in paths traversed. By default, rings are included in paths. A path
488 containing a ring is terminated at an atom completing the ring.
489
490 GetAtomPathsWithLength
491 $AtomPathsRef = $Molecule->GetAtomPathsWithLength($Length, [$AllowCycles]);
492
493 Returns all paths with specified *Length* as a reference to an array
494 containing reference to arrays with path Atom objects.
495
496 Path atoms correspond to all possible paths for each atom in
497 molecule with length upto a specified length and no sharing of bonds
498 in paths traversed. By default, rings are included in paths. A path
499 containing a ring is terminated at an atom completing the ring.
500
501 GetAtomPathsWithLengthUpto
502 $AtomPathsRef = $Molecule->GetAtomPathsWithLengthUpto($Length, [$AllowCycles]);
503
504 Returns all paths with length up to *Length* as a reference to an
505 array containing reference to arrays with path Atom objects.
506
507 Path atoms correspond to all possible paths for each atom in
508 molecule with length upto a specified length and no sharing of bonds
509 in paths traversed. By default, rings are included in paths. A path
510 containing a ring is terminated at an atom completing the ring.
511
512 GetAtoms
513 @AllAtoms = $Molecule->GetAtoms();
514 @PolarAtoms = $Molecule->GetAtoms('IsPolarAtom');
515
516 $NegateMethodResult = 1;
517 @NonHydrogenAtoms = $Molecule->GetAtoms('IsHydrogenAtom',
518 $NegateMethodResult);
519
520 $AtomsCount = $Molecule->GetAtoms();
521
522 Returns an array of *Atoms* in a *Molecule*. In scalar context, it
523 returns number of atoms. Additionally, Atoms array can be filtered
524 by any user specifiable valid Atom class method and the result of
525 the Atom class method used to filter the atoms can also be negated
526 by an optional negate results flag as third parameter.
527
528 GetBonds
529 @Bonds = $Molecule->GetBonds();
530 $BondsCount = $Molecule->GetBonds();
531
532 Returns an array of *Bonds* in a *Molecule*. In scalar context, it
533 returns number of bonds.
534
535 GetCharge
536 $Charge = $Molecule->GetCharge();
537
538 Returns net charge on a *Molecule* using one of the following two
539 methods: explicitly set Charge property or sum of partial atomic
540 charges on each atom.
541
542 GetConnectedComponents
543 @ConnectedComponents = $Molecule->GetConnectedComponents();
544
545 Returns a reference to an array containing *Molecule* objects
546 corresponding to connected components sorted in decreasing order of
547 component size in a *Molecule*.
548
549 GetConnectedComponentsAtoms
550 @ConnectedComponentsAtoms =
551 $Molecule->GetConnectedComponentsAtoms();
552
553 Returns an array containing references to arrays with *Atom* objects
554 corresponding to atoms of connected components sorted in order of
555 component decreasing size in a *Molecule*.
556
557 GetDimensionality
558 $Dimensionality = $Molecule->GetDimensionality();
559
560 Returns *Dimensionality* of a *Molecule* corresponding to explicitly
561 set *Dimensionality* property value or by processing atomic.
562
563 The *Dimensionality* value from atomic coordinates is calculated as
564 follows:
565
566 3D - Three dimensional: One of X, Y or Z coordinate is non-zero
567 2D - Two dimensional: One of X or Y coordinate is non-zero; All Z
568 coordinates are zero
569 0D - Zero dimensional: All atomic coordinates are zero
570
571 GetElementalComposition
572 ($ElementsRef, $CompositionRef) =
573 $Molecule->GetElementalComposition([$IncludeMissingHydrogens]);
574
575 Calculates elemental composition and returns references to arrays
576 containing elements and their percent composition in a *Molecule*.
577 By default, missing hydrogens are included during the calculation.
578
579 GetElementsAndNonElements
580 ($ElementsRef, $NonElementsRef) =
581 $Molecule->GetElementsAndNonElements([$IncludeMissingHydrogens]);
582
583 Counts elements and non-elements in a *Molecule* and returns
584 references to hashes containing element and non-element as hash keys
585 with values corresponding to their count. By default, missing
586 hydrogens are not added to the element hash.
587
588 GetExactMass
589 $ExactMass = $Molecule->GetExactMass();
590
591 Returns exact mass of a *Molecule* corresponding to sum of exact
592 masses of all the atoms.
593
594 GetFormalCharge
595 $FormalCharge = $Molecule->GetFormalCharge();
596
597 Returns net formal charge on a *Molecule* using one of the following
598 two methods: explicitly set FormalCharge property or sum of formal
599 charges on each atom.
600
601 FormalCharge is different from Charge property of the molecule which
602 corresponds to sum of partial atomic charges explicitly set for each
603 atom using a specific methodology.
604
605 GetFreeRadicalElectrons
606 $FreeRadicalElectrons = $Molecule->GetFreeRadicalElectrons();
607
608 Returns total number of free radical electrons available in a
609 *Molecule* using one of the following two methods: explicitly set
610 FreeRadicalElectrons property or sum of available free radical
611 electrons on each atom.
612
613 GetFusedAndNonFusedRings
614 ($FusedRingSetRef, $NonFusedRingsRef) =
615 $Molecule->GetFusedAndNonFusedRings();
616
617 Returns references to array of fused ring sets and non-fused rings
618 in a *Molecule*. Fused ring sets array reference contains refernces
619 to arrays of rings corresponding to ring *Atom* objects; Non-fused
620 rings array reference contains references to arrays of ring *Atom*
621 objects.
622
623 GetLargestConnectedComponent
624 $ComponentMolecule = $Molecule->GetLargestConnectedComponent();
625
626 Returns a reference to Molecule object corresponding to a largest
627 connected component in a *Molecule*.
628
629 GetLargestConnectedComponentAtoms
630 @ComponentAtoms = $Molecule->GetLargestConnectedComponentAtoms();
631
632 Returns a reference to an array of Atom objects corresponding to a
633 largest connected component in a *Molecule*.
634
635 GetLargestRing
636 @RingAtoms = $Molecule->GetLargestRing();
637
638 Returns an array of *Atoms* objects corresponding to a largest ring
639 in a *Molecule*.
640
641 GetMolecularFormula
642 $FormulaString = $Molecule->GetMolecularFormula(
643 [$IncludeMissingHydrogens,
644 $IncludeNonElements]);
645
646 Returns molecular formula of a *Molecule* by collecting information
647 about all atoms in the molecule and composing the formula using
648 Hills ordering system:
649
650 o C shows up first and H follows assuming C is present.
651 o All other standard elements are sorted alphanumerically.
652 o All other non-stanard atom symbols are also sorted
653 alphanumerically and follow standard elements.
654
655 Notes:
656
657 o By default, missing hydrogens and nonelements are also included.
658 o Elements for disconnected fragments are combined into the same
659 formula.
660 o Formal charge is also used during compoisiton of molecular formula.
661
662 GetMolecularWeight
663 $MolWeight = $Molecule->GetMolecularWeight();
664
665 Returns molecular weight of a *Molecule* corresponding to sum of
666 atomic weights of all the atoms.
667
668 GetNumOfAromaticRings
669 $NumOfAromaticRings = $Molecule->GetNumOfAromaticRings();
670
671 Returns number of aromatic rings in a *Molecule*.
672
673 GetNumOfAtoms
674 $NumOfAtoms = $Molecule->GetNumOfAtoms();
675
676 Returns number of atoms in a *Molecule*.
677
678 GetNumOfBonds
679 $NumOfBonds = $Molecule->GetNumOfBonds();
680
681 Returns number of bonds in a *Molecule*.
682
683 GetNumOfConnectedComponents
684 $NumOfComponents = $Molecule->GetNumOfConnectedComponents();
685
686 Returns number of connected components in a *Molecule*.
687
688 GetNumOfElementsAndNonElements
689 ($NumOfElements, $NumOfNonElements) = $Molecule->
690 GetNumOfElementsAndNonElements();
691 ($NumOfElements, $NumOfNonElements) = $Molecule->
692 GetNumOfElementsAndNonElements($IncludeMissingHydrogens);
693
694 Returns number of elements and non-elements in a *Molecule*. By
695 default, missing hydrogens are not added to element count.
696
697 GetNumOfHeavyAtoms
698 $NumOfHeavyAtoms = $Molecule->GetNumOfHeavyAtoms();
699
700 Returns number of heavy atoms, non-hydrogen atoms, in a *Molecule*.
701
702 GetNumOfHydrogenAtoms
703 $NumOfHydrogenAtoms = $Molecule->GetNumOfHydrogenAtoms();
704
705 Returns number of hydrogen atoms in a *Molecule*.
706
707 GetNumOfMissingHydrogenAtoms
708 $NumOfMissingHydrogenAtoms = $Molecule->GetNumOfMissingHydrogenAtoms();
709
710 Returns number of hydrogen atoms in a *Molecule*.
711
712 GetNumOfNonHydrogenAtoms
713 $NumOfNonHydrogenAtoms = $Molecule->GetNumOfNonHydrogenAtoms();
714
715 Returns number of non-hydrogen atoms in a *Molecule*.
716
717 GetNumOfRings
718 $RingCount = $Molecule->GetNumOfRings();
719
720 Returns number of rings in a *Molecule*.
721
722 GetNumOfRingsWithEvenSize
723 $RingCount = $Molecule->GetNumOfRingsWithEvenSize();
724
725 Returns number of rings with even size in a *Molecule*.
726
727 GetNumOfRingsWithOddSize
728 $RingCount = $Molecule->GetNumOfRingsWithOddSize();
729
730 Returns number of rings with odd size in a *Molecule*.
731
732 GetNumOfRingsWithSize
733 $RingCount = $Molecule->GetNumOfRingsWithSize($Size);
734
735 Returns number of rings with *Size* in a *Molecule*.
736
737 GetNumOfRingsWithSizeGreaterThan
738 $RingCount = $Molecule->GetNumOfRingsWithSizeGreaterThan($Size);
739
740 Returns number of rings with size greater than *Size* in a
741 *Molecule*.
742
743 GetNumOfRingsWithSizeLessThan
744 $RingCount = $Molecule->GetNumOfRingsWithSizeLessThan($Size);
745
746 Returns number of rings with size less than *Size* in a *Molecule*.
747
748 GetRingBonds
749 @RingBonds = $Molecule->GetRingBonds(@RingAtoms);
750
751 Returns an array of ring Bond objects correponding to an array of
752 ring *Atoms* in a *Molecule*.
753
754 GetRingBondsFromRings
755 @RingBondsSets = $Molecule->GetRingBondsFromRings(@RingAtomsSets);
756
757 Returns an array containing references to arrays of ring Bond
758 objects for rings specified in an array of references to ring *Atom*
759 objects.
760
761 GetRings
762 @Rings = $Molecule->GetRings();
763
764 Returns rings as an array containing references to arrays of ring
765 *Atom* objects in a *Molecule*.
766
767 GetRingsWithEvenSize
768 @Rings = $Molecule->GetRingsWithEvenSize();
769
770 Returns even size rings as an array containing references to arrays
771 of ring *Atom* objects in a *Molecule*.
772
773 GetRingsWithOddSize
774 @Rings = $Molecule->GetRingsWithOddSize();
775
776 Returns odd size rings as an array containing references to arrays
777 of ring *Atom* objects in a *Molecule*.
778
779 GetRingsWithSize
780 @Rings = $Molecule->GetRingsWithSize($Size);
781
782 Returns rings with *Size* as an array containing references to
783 arrays of ring *Atom* objects in a *Molecule*.
784
785 GetRingsWithSizeGreaterThan
786 @Rings = $Molecule->GetRingsWithSizeGreaterThan($Size);
787
788 Returns rings with size greater than *Size* as an array containing
789 references to arrays of ring *Atom* objects in a *Molecule*.
790
791 GetRingsWithSizeLessThan
792 @Rings = $Molecule->GetRingsWithSizeLessThan($Size);
793
794 Returns rings with size less than *Size* as an array containing
795 references to arrays of ring *Atom* objects in a *Molecule*.
796
797 GetSizeOfLargestRing
798 $Size = $Molecule->GetSizeOfLargestRing();
799
800 Returns size of the largest ring in a *Molecule*.
801
802 GetSizeOfSmallestRing
803 $Size = $Molecule->GetSizeOfSmallestRing();
804
805 Returns size of the smalles ring in a *Molecule*.
806
807 GetSmallestRing
808 @RingAtoms = $Molecule->GetSmallestRing();
809
810 Returns an array containing *Atom* objects corresponding to the
811 smallest ring in a *Molecule*.
812
813 GetSpinMultiplicity
814 $SpinMultiplicity = $Molecule->GetSpinMultiplicity();
815
816 Returns net spin multiplicity of a *Molecule* using one of the
817 following two methods: explicitly set SpinMultiplicity property or
818 sum of spin multiplicity on each atom.
819
820 GetSupportedAromaticityModels
821 @SupportedModels = $Molecule->GetSupportedAromaticityModels();
822
823 Returns an array containing a list of supported aromaticity models.
824
825 GetValenceModel
826 $ValenceModel = $Molecule->GetValenceModel();
827
828 Returns valence model for *Molecule* using one of the following two
829 methods: explicitly set ValenceModel property or defaul value of
830 *InternalValenceModel*.
831
832 GetTopologicallySortedAtoms
833 @SortedAtoms = $Molecule->GetTopologicallySortedAtoms([$StartAtom]);
834
835 Returns an array of topologically sorted *Atom* objects starting
836 from *StartAtom* or an arbitrary atom in a *Molecule*.
837
838 HasAromaticRings
839 $Status = $Molecule->HasAromaticRings();
840
841 Returns 1 or 0 based on whether any aromatic ring is present in a
842 *Molecule*.
843
844 HasAromaticAtomsInRings
845 $Status = $Molecule->HasAromaticAtomsInRings();
846
847 Returns 1 or 0 based on whether any aromatic ring atom is present in
848 a *Molecule*.
849
850 HasAromaticAtomsNotInRings
851 $Status = $Molecule->HasAromaticAtomsNotInRings();
852
853 Returns 1 or 0 based on whether any non-ring atom is marked aromatic
854 in a *Molecule*.
855
856 HasAtom
857 $Status = $Molecule->HasAtom($Atom);
858
859 Returns 1 or 0 based on whether *Atom* is present in a *Molecule*.
860
861 HasBond
862 $Status = $Molecule->HasBond($Bond);
863
864 Returns 1 or 0 based on whether *Bond* is present in a *Molecule*.
865
866 HasFusedRings
867 $Status = $Molecule->HasFusedRings();
868
869 Returns 1 or 0 based on whether any fused rings set is present in a
870 *Molecule*.
871
872 HasNoRings
873 $Status = $Molecule->HasNoRings();
874
875 Returns 0 or 1 based on whether any ring is present in a *Molecule*.
876
877 HasOnlyOneRing
878 $Status = $Molecule->HasOnlyOneRing();
879
880 Returns 1 or 0 based on whether only one ring is present in a
881 *Molecule*.
882
883 HasRings
884 $Status = $Molecule->HasRings();
885
886 Returns 1 or 0 based on whether rings are present in a *Molecule*.
887
888 IsAromatic
889 $Status = $Molecule->IsAromatic();
890
891 Returns 1 or 0 based on whether *Molecule* is aromatic.
892
893 IsMolecule
894 $Status = Molecule::IsMolecule();
895
896 Returns 1 or 0 based on whether *Object* is a Molecule object.
897
898 IsRingAromatic
899 $Status = $Molecule->IsRingAromatic(@RingAtoms);
900
901 Returns 1 or 0 based on whether all *RingAtoms* are aromatic.
902
903 IsSupportedAromaticityModel
904 $Status = $Molecule->IsSupportedAromaticityModel($AromaticityModel);
905 $Status = Molecule::IsSupportedAromaticityModel($AromaticityModel);
906
907 Returns 1 or 0 based on whether specified *AromaticityModel* is
908 supported.
909
910 IsTwoDimensional
911 $Status = $Molecule->IsTwoDimensional();
912
913 Returns 1 or 0 based on whether any atom in *Molecule* has a
914 non-zero value for X or Y coordinate and all atoms have zero value
915 for Z coordinates.
916
917 IsThreeDimensional
918 $Status = $Molecule->IsThreeDimensional();
919
920 Returns 1 or 0 based on whether any atom in *Molecule* has a
921 non-zero value for Z coordinate.
922
923 KeepLargestComponent
924 $Molecule->KeepLargestComponent();
925
926 Deletes atoms corresponding to all other connected components Except
927 for the largest connected component in a *Molecule* and returns
928 *Molecule*.
929
930 KekulizeAromaticAtoms
931 $Status = $Molecule->KekulizeAromaticAtoms();
932
933 Kekulize marked ring and non-ring aromatic atoms in a molecule and
934 return 1 or 1 based on whether the kekulization succeeded.
935
936 NewAtom
937 $NewAtom = $Molecule->NewAtom(%AtomPropertyNamesAndValues);
938
939 Creates a new atom using *AtomPropertyNamesAndValues*, add its to
940 *Molecule*, and returns new Atom object.
941
942 NewBond
943 $NewBond = $Molecule->NewBond(%BondPropertyNamesAndValues);
944
945 Creates a new bond using *AtomPropertyNamesAndValues*, add its to
946 *Molecule*, and returns new Bond object.
947
948 SetActiveRings
949 $Molecule->SetActiveRings($RingsType);
950
951 Sets up type of detected ring sets to use during all ring related
952 methods and returns *Molecule*. Possible *RingType* values:
953 *Independent or All*. By default, *Independent* ring set is used
954 during all ring methods.
955
956 SetAromaticityModel
957 $Molecule = $Molecule->SetAromaticityModel($AromaticityModel);
958
959 Sets up *AromaticityModel* property value for *Molecule* and
960 retrurns *Molecule*.
961
962 SetValenceModel
963 $Molecule = $Molecule->SetValenceModel(ValenceModel);
964
965 Sets up *ValenceModel* property value for *Molecule* and retrurns
966 *Molecule*.
967
968 StringifyMolecule
969 $MoleculeString = $Molecule->StringifyMolecule();
970
971 Returns a string containing information about *Molecule* object
972
973 AUTHOR
974 Manish Sud <msud@san.rr.com>
975
976 SEE ALSO
977 Atom.pm, Bond.pm, MoleculeFileIO.pm, MolecularFormula.pm
978
979 COPYRIGHT
980 Copyright (C) 2015 Manish Sud. All rights reserved.
981
982 This file is part of MayaChemTools.
983
984 MayaChemTools is free software; you can redistribute it and/or modify it
985 under the terms of the GNU Lesser General Public License as published by
986 the Free Software Foundation; either version 3 of the License, or (at
987 your option) any later version.
988