Atom Class
The Class for Atoms
Constructor
Atom
()
Item Index
Methods
Properties
Methods
countBondsOfOrder
-
order
Returns count of Bonds with given order
Parameters:
-
order
Number
Returns:
Returns count of bonds
forEachBond
-
callback
Calls given callback for each bond
Parameters:
-
callback
FunctionThe callback to be called for each bond
Returns:
Returns this
Example:
atom.forEachBond(function(bond) {
console.log(atom.getOrder());
});
forEachNeighbour
-
callback
Calls given callback for each neighbor of this atom
Parameters:
-
callback
FunctionThe callback to be called for each neighbour
Returns:
Returns this
Example:
atom.forEachNeighbour(function(atom) {
console.log(atom.atomicNumber);
});
getDistance
-
The
Computes the distance between two atoms
Parameters:
-
The
Atomatom to distance being compute with
Returns:
Returns distance
hasBondOfOrder
-
order
Check if this atom has any bond with given order
Parameters:
-
order
Number
Returns:
Returns the result
is
-
expression
Check if this atom matches with given expression
Parameters:
-
expression
String
Returns:
Returns the result
Example:
atom.is('Hydrogen')
atom.is('Carbon')
atom.is('Nitrogen')
atom.is('Oxygen')
atom.is('Phosphorus')
atom.is('Sulfur')
atom.is('CarboxylOxygen')
atom.is('PhosphateOxygen')
atom.is('SulfateOxygen')
atom.is('NitroOxygen')
atom.is('AmideNitrogen')
atom.is('PolarHydrogen')
atom.is('NonPolarHydrogen')
atom.is('AromaticNOxide')
atom.is('Axial')
atom.is('InRing')
isConnected
-
atom
Checks if this atom is connected to given atom
Parameters:
-
atom
AtomThe atom to be checked
Returns:
Returns the result
isConnectedWith
-
atom
-
distance
Check if this atom is connected with another atom by given distance
Parameters:
-
atom
Atom -
distance
Number
Returns:
Returns the result
isOneFour
-
atom
Check if this atom is in one-four position with the given atom
Parameters:
-
atom
Atom
Returns:
Returns the result
isOneThree
-
atom
Check if this atom is in one-three position with the given atom
Parameters:
-
atom
Atom
Returns:
Returns the result
matchesSMARTS
-
smart
Checks if given SMARTS matches with this atom
Parameters:
-
smart
StringThe SMARTS expression
Returns:
Returns the result
Properties
atomicNumber
Number
Atomic number of this atom
index
Number
Index of this atom in the molecule