Class: chemicalInformation

chemicalInformation

Static class that contains chemical information and functions that are needed in the spectroscopy application.

new chemicalInformation()

chemicalInformation does not need to be instantiated as all of its members and methods are static, however, if you really want to, a default contructor.
Source:
Tutorials:

Members

<static> functionalGroups

A data structure used to map functional group names to an array of regular expressions to match agains SMILE answers. Used in the functionalGroupsSearcher class.
Source:
Example
 

{"functional Group Name" : [regexp1,regexp2,..,regexpN] }

<static> halogens

The Halogens in an array (F,Cl,Br,I)
Source:

Methods

<static> calculateIHD(smile, tokens) → {Number}

Calculates the Index of Hydrogen Deficiency (IHD)
Parameters:
Name Type Description
smile
tokens tokens can be obtained from smidge by Parse.parse(smile)
Source:
Returns:
Type
Number

<static> countAtomsOf(symbol, tokens) → {Number}

This will count all atoms, except Hydrogen atoms.
Parameters:
Name Type Description
symbol String symbol of the element you want to count
tokens tokens can be obtained from smidge by Parse.parse(smile)
Source:
Returns:
the number of atoms of type 'symbol' found
Type
Number

<static> countCharge(tokens) → {Number}

Counts the charge of the answer
Parameters:
Name Type Description
tokens tokens can be obtained from smidge by Parse.parse(smile)
Source:
Returns:
Type
Number

<static> countDoubleBonds(smile) → {Number}

We use the SMILE here because of c1ccccc1 : ie small letter c. We use the SMILE instead of the aromatic property in the tokens because JSME will only produce small c's when the the double bonded hexagon tool is used. In all other cases it produce C=C. Those we count using the tokens.

Relying on this property of JSME allows us to count the number of small c's and then divide the answer by two to get the number of double bonds.

The aromatic property in the tokens could be used for the same purpose but has 2 problems for me: 1. I don't know if other atoms can be aromatic or not and 2. If they can the code needed would be significantly greater to do this.

We can change to the tokens later if it is needed.

Parameters:
Name Type Description
smile SMILE the SMILE string
Source:
Returns:
The number of double bonds
Type
Number

<static> countHalogens(tokens) → {Number}

Parameters:
Name Type Description
tokens tokens can be obtained from smidge by Parse.parse(smile)
Source:
Returns:
the number of halogen atoms found
Type
Number

<static> countHydrogens(tokens) → {Number}

Since H will not be in the smile (we use JSME without explicit Hydrogens). counting them is not as easy as the others. We are going to use the Index of Hydrogen Deficiency to do this. The formula...
Y = -1(2IHD -2X -2) where
Y = #H + #Halogens + #N and
X = #C + #N and
IHD = #rings + #double bonds + 2(#triple bonds)

so, #H = Y -#halogens - #N
Parameters:
Name Type Description
tokens tokens can be obtained from smidge by Parse.parse(smile)
Source:
Returns:
of Hydrogens in the compound.
Type
Number

<static> countRings(tokens) → {Number}

Counts the number of rings in the answer.
Parameters:
Name Type Description
tokens tokens can be obtained from smidge by Parse.parse(smile)
Source:
Returns:
the number of ring closures
Type
Number

<static> countTripleBonds(tokens) → {Number}

Counts the number of triple bonds in the answer.
Parameters:
Name Type Description
tokens tokens can be obtained from smidge by Parse.parse(smile)
Source:
Returns:
the number of triple bonds found
Type
Number

<static> getDistinctAtoms(tokens) → {Array}

Counts the number of disctinct atoms in the answer.
Parameters:
Name Type Description
tokens tokens
Source:
Returns:
of strings where each element is in the answer at least one time. No duplicate strings exist in the Array.
Type
Array

<static> getMolWeightMap() → {Array}

Source:
Returns:
an array with molecular symbols used as keys. Keys map to the molecular weight of the symbol.
Type
Array

<static> getValenceMap() → {Array}

Source:
Returns:
an array with molecular symbols used as keys. Keys map to the valence of the symbol.
Type
Array

<static> isHalogen(candidateHalogen) → {Boolean}

Parameters:
Name Type Description
candidateHalogen String Presumably an Atomic symbol
Source:
Returns:
true if the candidate is a Halogen.
Type
Boolean