Molecule Class
The Class for Molecules
Constructor
Molecule
()
Item Index
Methods
- addAtom
- addBond
- addHydrogens
- createAtom
- createBond
- deleteAtom
- deleteBond
- deleteHydrogens
- forEachAtom
- forEachBond
- getAngle
- getTorsion
- has2D
- has3D
- hasAromaticCorrected deprecated
- hasAromaticPerceived
- hasAtomTypesPerceived
- hasChainsPerceived
- hasChiralityPerceived
- hasClosureBondsPerceived
- hasHybridizationPerceived
- hasHydrogensAdded
- hasImplicitValencePerceived
- hasKekulePerceived
- hasLSSRPerceived
- hasNonZeroCoords
- hasPartialChargesPerceived
- hasRingAtomsAndBondsPerceived
- hasRingTypesPerceived
- hasSSSRPerceived
- isChiral
- isEmpty
- setPH
Methods
addAtom
-
atom
Adds the given atom to this molecule
Parameters:
-
atom
AtomThe Atom to be added to this molecule
Returns:
Returns true on success
addBond
-
atom
Adds the given bond to this molecule
Parameters:
-
atom
BondThe Bond to be added to this molecule
Returns:
Returns true on success
addHydrogens
-
[polarOnly=false]
Add Hydrogens to the entire molecule to fill out implicit valence spots
Parameters:
-
[polarOnly=false]
Boolean optionalWhether to add only polar hydrogens
Returns:
Returns true on success
createAtom
()
Atom
Creates a new atom and appends it to this molecule
Returns:
Returns the created Atom
createBond
()
Bond
Creates a new bond and appends it to this molecule
Returns:
Returns the created bond
deleteAtom
-
atom
Deletes the given atom from this molecule
Parameters:
-
atom
AtomThe Atom to be deleted from this molecule
Returns:
Returns true on success
deleteBond
-
bond
Deletes the given bond from this molecule
Parameters:
-
bond
BondThe Bond to be deleted from this molecule
Returns:
Returns true on success
deleteHydrogens
-
[polarOnly=false]
Delete Hydrogens from the molecule
Parameters:
-
[polarOnly=false]
Boolean optionalWhether to add only polar hydrogens
Returns:
Returns true on success
forEachAtom
-
callback
Executes a callback for each atom
Parameters:
-
callback
FunctionThe callback to call for each atom
Returns:
Returns this
Example:
mol.forEachAtom(function(atom) {
console.log(atom.atomicNumber);
});
forEachBond
-
callback
Executes a callback for each bond
Parameters:
-
callback
FunctionThe callback to call for each bond
Returns:
Returns this
Example:
mol.forEachBond(function(bond) {
console.log(bond.getOrder());
});
getAngle
-
atom1
-
atom2
-
atom3
Get angle between 3 atoms of this molecule
Returns:
Returns the angle
getTorsion
-
atom1
-
atom2
-
atom3
-
atom4
Get Torsion angle between 4 atoms of this molecule
Returns:
Returns the torsion angle
has2D
()
Boolean
Checks if the molecule has 2D Coordinates
Returns:
Returns the result
has3D
()
Boolean
Checks if the molecule has 3D Coordinates
Returns:
Returns the result
hasAromaticCorrected
()
Boolean
deprecated
Checks if aromatic Nitrogens have been corrected
Returns:
Returns the result
hasAromaticPerceived
()
Boolean
Checks if aromatic perception has been performed
Returns:
Returns the result
hasAtomTypesPerceived
()
Boolean
Checks if atom types have been assigned
Returns:
Returns the result
hasChainsPerceived
()
Boolean
Checks if Biomolecule chains and residues have been assigned.
Returns:
Returns the result
hasChiralityPerceived
()
Boolean
Checks if atom chirality have been assigned
Returns:
Returns the result
hasClosureBondsPerceived
()
Boolean
Checks if ring "closure" bonds has been assigned
Returns:
Returns the result
hasHybridizationPerceived
()
Boolean
Checks if atomic hybridization has been assigned
Returns:
Returns the result
hasHydrogensAdded
()
Boolean
Checks if Hydrogens have been added to the molecule
Returns:
Returns the result
hasImplicitValencePerceived
()
Boolean
Checks if implicit hydrogen valence has been assigned
Returns:
Returns the result
hasKekulePerceived
()
Boolean
Checks if aromaticity and Kekule forms has been assigned
Returns:
Returns the result
hasLSSRPerceived
()
Boolean
Checks if the largest set of smallest rings (FindLSSR) has been performed
Returns:
Returns the result
hasNonZeroCoords
()
Boolean
Checks if the there are any non-zero coordinates
Returns:
Returns the result
hasPartialChargesPerceived
()
Boolean
Checks if atomic Gasteiger partial charges have been assigned
Returns:
Returns the result
hasRingAtomsAndBondsPerceived
()
Boolean
Checks if ring atoms and bonds has been assigned
Returns:
Returns the result
hasRingTypesPerceived
()
Boolean
Checks if ring types have been assigned
Returns:
Returns the result
hasSSSRPerceived
()
Boolean
Checks if the smallest set of smallest rings (FindSSSR) has been performed
Returns:
Returns the result
isChiral
()
Boolean
Check if the molecule is chiral
Returns:
Returns the result
isEmpty
()
Boolean
Check if the molecule contains no atom
Returns:
Returns the result
setPH
-
[pH=7.4]
Sets the pH. The pH affects on Hydrogens to be added to this molecule
Parameters:
-
[pH=7.4]
Number optional
Returns:
Returns true on success
Properties
atoms
Atom[]
Get atoms by given index. It's not iterable. Only can be accessed via given index. Indexes start from 0.
Example:
mol.atoms[1].atomicNumber
atomsCount
Number
Count of atoms in this molecule
bonds
Bond[]
Get bonds by given index. It's not iterable. Only can be accessed via given index. Indexes start from 0.
Example:
mol.bonds[0].order
bondsCount
Number
Count of bonds in this molecule
conformersCount
Number
Count of conformers for this molecule
enery
Number
The value of energy for this molecule
exactMass
Number
The mass given by isotopes
heavyAtomsCount
Number
Count of heavy atoms in this molecule
molarMass
Number
The Standard Molar Mass given bye IUPAC Atomic Masses (amu)
totalCharge
Number
Total chrage of this molecule