# Class: MolecularFormulae

## MolecularFormulae()

Code to calculate distribution based on molecular formula

## Constructor

#### new MolecularFormulae()

Source:
  - molecularformulae.js, line 5

### Methods

#### emass(mass, peakDataList, charge)

Function to calculate the emass distrubution fo the given sequence

##### Parameters:

Name | Type | Description
--- | --- | ---
`mass` | Double | Contains the mass at that position of the sequence
`peakDataList` | Array | Contains the peak list provided by the user
`charge` | Float | Contains the chrage of the ion

Source:
  - molecularformulae.js, line 27

#### getMassAndIntensity(totDistributionList, aminoAcidDist)

Logic to calculate distribution

##### Parameters:

Name | Type | Description
--- | --- | ---
`totDistributionList` | Array | Array with current total distribution
`aminoAcidDist` | Array | Array with existing calculated distribution of amino acid

Source:
  - molecularformulae.js, line 62

#### getMolecularFormula()

Code to get the molecular formular based on the mass. Number of atoms of each atom in the averagine * number of atoms of each atom calculated from mass gives the total number of atoms.

Source:
  - molecularformulae.js, line 104

#### getMZwithHighInte(totDistributionList, charge, massError, peakDataList)

Code to calculate MZ(mass/charge) and remove low intensity values

##### Parameters:

Name | Type | Description
--- | --- | ---
`totDistributionList` | Array | Array with total distribution
`charge` | Float | Float from mass list
`massError` | Float | Calculated massError needed to be added as we taken int values of number of atoms eleminating mass from the float values.
`peakDataList` | Array | Array of peak list from user

Source:
  - molecularformulae.js, line 143

#### getNormalizedIntensity(totDistributionList, peakDataList)

Code to normalize the Intensity. Take the average of intensity from the peaks entered by the user. Take the average of the calculated distribution for each Array element in the Array. Make both of them equal and calculating the rest of the distribution intensity based on the avg value from the peak list.

##### Parameters:

Name | Type | Description
--- | --- | ---
`totDistributionList` | Array | Total distribution calculated
`peakDataList` | Array | Peak Data entered by the user

Source:
  - molecularformulae.js, line 179