API Docs for:
Show:

Atom Class

The Class for Atoms

Methods

countBondsOfOrder

(
  • order
)
Number

Returns count of Bonds with given order

Parameters:

  • order Number

Returns:

Number:

Returns count of bonds

forEachBond

(
  • callback
)
Atom

Calls given callback for each bond

Parameters:

  • callback Function

    The callback to be called for each bond

Returns:

Atom:

Returns this

Example:

atom.forEachBond(function(bond) {
    console.log(atom.getOrder());
});

forEachNeighbour

(
  • callback
)
Atom

Calls given callback for each neighbor of this atom

Parameters:

  • callback Function

    The callback to be called for each neighbour

Returns:

Atom:

Returns this

Example:

atom.forEachNeighbour(function(atom) {
    console.log(atom.atomicNumber);
});

getDistance

(
  • The
)
Number

Computes the distance between two atoms

Parameters:

  • The Atom

    atom to distance being compute with

Returns:

Number:

Returns distance

hasBondOfOrder

(
  • order
)
Boolean

Check if this atom has any bond with given order

Parameters:

  • order Number

Returns:

Boolean:

Returns the result

is

(
  • expression
)
Boolean

Check if this atom matches with given expression

Parameters:

  • expression String

Returns:

Boolean:

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
)
Boolean

Checks if this atom is connected to given atom

Parameters:

  • atom Atom

    The atom to be checked

Returns:

Boolean:

Returns the result

isConnectedWith

(
  • atom
  • distance
)
Boolean

Check if this atom is connected with another atom by given distance

Parameters:

  • atom Atom
  • distance Number

Returns:

Boolean:

Returns the result

isOneFour

(
  • atom
)
Boolean

Check if this atom is in one-four position with the given atom

Parameters:

Returns:

Boolean:

Returns the result

isOneThree

(
  • atom
)
Boolean

Check if this atom is in one-three position with the given atom

Parameters:

Returns:

Boolean:

Returns the result

matchesSMARTS

(
  • smart
)
Boolean

Checks if given SMARTS matches with this atom

Parameters:

  • smart String

    The SMARTS expression

Returns:

Boolean:

Returns the result

Properties

atomicNumber

Number

Atomic number of this atom

index

Number

Index of this atom in the molecule

vector

Vector

Vector of coordinates for this atom