# Global

##

### Methods

#### addColorsToDropdown()

Provide a drop down to add different background colors to the mass shifted elements

Source:
  - drawsvg.js, line 403

#### addMassShift(position, massShiftList, mass)

Returns the current mass after adding mass shift

##### Parameters:

Name | Type | Description
--- | --- | ---
`position` | Integer | Contains position at which the mass shift needed to be added
`massShiftList` | Array | List of mass shifts along with position
`mass` | Float | Mass to which the mass shift to be added

Source:
  - calculateprefixandsuffixmass.js, line 157

#### addNewFixedPtmRow(fixedptm)

On Click of '+' symbol under fixed ptms in the HTML, creates new block to add Acid and mass shift

##### Parameters:

Name | Type | Description
--- | --- | ---
`fixedptm` | String | Contains Acid name and mass shift seperated by ':'

Source:
  - commonFixedPtms.js, line 27

#### addWaterMass()

Function to add mass of water to the suffix mass list

Source:
  - calculateprefixandsuffixmass.js, line 177

#### annotations(para, matchedPeaks, id)

Draw annotations

##### Parameters:

Name | Type | Description
--- | --- | ---
`para` | Object | Contains parameters of width, letter space etc., to draw SVG
`matchedPeaks` | Array | Contains Matched List
`id` | String | Contains id of the SVG tag from html to draw sequence

Source:
  - drawsvg.js, line 223

#### appendTooltip(charge)

Append Charge to the tool tip

##### Parameters:

Name | Type | Description
--- | --- | ---
`charge` | String | Contains the charge at the current position to display on hover of the annotation

Source:
  - drawsvg.js, line 332

#### buildSvg(parameters, seq, id, massShiftList, monoMassList)

Draw the sequence on to svg

##### Parameters:

Name | Type | Description
--- | --- | ---
`parameters` | Object | Contains parameters of width, letter space etc., to draw SVG
`seq` | String | Contains the protein sequence
`id` | String | Contians id of the SVG tag from html.
`massShiftList` | Array | Contains list of all the mass shifts
`monoMassList` | Array | Contains Mono Mass list data

Source:
  - drawsvg.js, line 23

#### calculatePrefixAndSuffixMass()

Function calculates both prefix and suffix masses

Source:
  - calculateprefixandsuffixmass.js, line 1

#### calibrateLeftNum(para, position)

Function provides position of the Numbers on the left side of the Acid Sequence

##### Parameters:

Name | Type | Description
--- | --- | ---
`para` | Object | Contains parameters of the graph
`position` | number | Contains position of the Acid

Source:
  - coordinates_util.js, line 56

#### calibrateRightNum(para, position)

Function provides position of the Numbers on the right side of the Acid Sequence

##### Parameters:

Name | Type | Description
--- | --- | ---
`para` | object | Contains the parameters to draw the SVG
`position` | Integer | Provides the position of the left side number

Source:
  - coordinates_util.js, line 68

#### calibrateSkipEnd(para, position, start_value)

Function provides position to write information of skipped amino acids at th bottom of Sequence SVG

##### Parameters:

Name | Type | Description
--- | --- | ---
`para` | object | Contains the parameters to draw the SVG
`position` | Integer | Provides the position of the left side number
`start_value` | Integer | Provides starting number the sequnce after trimming the skipped scids

Source:
  - coordinates_util.js, line 92

#### calibrateSkipStart(para)

Function provides position to write information of skipped amino acids at the top of Sequence SVG

##### Parameters:

Name | Type | Description
--- | --- | ---
`para` | object | Contains the parameters to draw the SVG

Source:
  - coordinates_util.js, line 80

#### drawAnnotation(position, charge, id, coordinates, x, y)

Draw Annotations

##### Parameters:

Name | Type | Description
--- | --- | ---
`position` | Integer | Position of the amino acid
`charge` | String | Contains the charge at the current position to display on hover of the annotation
`id` | String | Contains id of the SVG tag from html to draw sequence
`coordinates` | String | Contains coordinates to draw the annotaion
`x` | Integer | Contains x coordinate of start point to draw the annotation
`y` | Integer | Contains y coordinate of start point to draw the annotation

Source:
  - drawsvg.js, line 300

#### drawAnnotation_B(para, position, charge, id)

Draw the annotation when the ion type is B

##### Parameters:

Name | Type | Description
--- | --- | ---
`para` | Object | Contains parameters of width, letter space etc., to draw SVG
`position` | Integer | Position of the amino acid
`charge` | String | Contains the charge at the current position to display on hover of the annotation
`id` | String | Contains id of the SVG tag from html to draw sequence

Source:
  - drawsvg.js, line 253

#### drawAnnotation_Y(para, position, charge, id)

Draw the annotation when the ion type is Y

##### Parameters:

Name | Type | Description
--- | --- | ---
`para` | Object | Contains parameters of width, letter space etc., to draw SVG
`position` | Integer | Position of the amino acid
`charge` | String | Contains the charge at the current position to display on hover of the annotation
`id` | String | Contains id of the SVG tag from html to draw sequence

Source:
  - drawsvg.js, line 268

#### drawAnnotation_YB(para, position, charge, id)

generate cooordinates to dray Y or B annotation

##### Parameters:

Name | Type | Description
--- | --- | ---
`para` | Object | Contains parameters of width, letter space etc., to draw SVG
`position` | Integer | Position of the amino acid
`charge` | String | Contains the charge at the current position to display on hover of the annotation
`id` | String | Contains id of the SVG tag from html to draw sequence

Source:
  - drawsvg.js, line 283

#### drawRectagleWithColors(color, index)

Add rectagular block with selected color

##### Parameters:

Name | Type | Description
--- | --- | ---
`color` | String | Backgroung color added tot he amino acid
`index` | Integer | Position at which the color needed to be added

Source:
  - drawsvg.js, line 422

#### generateCorrespondingGraph(peakDataList, distributionList, prec_mz)

Generates Corresponding graph on to the html by calling addSpectrum from invokespectrum.js

##### Parameters:

Name | Type | Description
--- | --- | ---
`peakDataList` | Array | Contains Peak list data
`distributionList` | Array | Contains envelope data
`prec_mz` | Float | contains mass to which the graph has to be zoomed

Source:
  - addIonsToGraph.js, line 7

#### generateMonoMassGraph(monoMassList, prec_mz)

Generating Mono Mass Graph with calculated masses

##### Parameters:

Name | Type | Description
--- | --- | ---
`monoMassList` | Array | Contians the mono Mass list data
`prec_mz` | Float | Contains mass to which the graph has to be zoomed

Source:
  - addIonsToGraph.js, line 17

#### getAbsoluteMaxValfromList(errorDataList)

Function return the max error value from the list

##### Parameters:

Name | Type | Description
--- | --- | ---
`errorDataList` | Array | Contains list of error data to plot on the error graph

Source:
  - addIonsToGraph.js, line 70

#### getActualIdvalues(ionType)

Dictionary to get correspoding actual heading for all the Id's of Ion Fragmentation from UI.

##### Parameters:

Name | Type | Description
--- | --- | ---
`ionType` | String | Id of the ion from UI

Source:
  - iontabledata.js, line 3

#### getAminoAcidDistribution(aminoAcid)

Calculated distribution of amino-acid. The first element in each amino-acid list give tha mass of the amino acid.

##### Parameters:

Name | Type | Description
--- | --- | ---
`aminoAcid` | Char | Containd Amino Acid

Source:
  - aminoaciddistribution.js, line 1

#### getCTerminusMassShiftVal()

Checks for all the ions selected and gets all the consolidated mass of all the C terminus ions selected by user

Source:
  - utilfunctions.js, line 44

#### getIonCharge(matchedPeaks, position)

Get the charge of the Ion

##### Parameters:

Name | Type | Description
--- | --- | ---
`matchedPeaks` | Array | Array with charge data at all the matched positions
`position` | Integer | Position at which the charge data has to be consolidated to show on hover of an annotation

Source:
  - drawsvg.js, line 356

#### getIsotopicMassOfAtom()

Code to get absolute mass and intensity values of atoms

Source:
  - isotopes.js, line 1

#### getIsotopicMassRef()

Code to calculate distributions by taking relative values of mass and intensity of atoms.

Source:
  - isotopes.js, line 64

#### getMassShift(ions)

Function checks all the ions selected and adds together to get the mass shift needed to add to suffix mass list

##### Parameters:

Name | Type | Description
--- | --- | ---
`ions` | Array | Contains all the ion types selected

Source:
  - utilfunctions.js, line 18

#### 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:
  - calculateEnvelopeIntensity.js, line 10

#### getNTerminusMassShiftVal()

Checks for all the ions selected and gets all the consolidated mass of all the N terminus ions selected by user

Source:
  - utilfunctions.js, line 30

#### getNumValues(para, seq, id)

Put the numerical positions at the start and end of each row of the sequence

##### Parameters:

Name | Type | Description
--- | --- | ---
`para` | Object | Contains parameters of width, letter space etc., to draw SVG
`seq` | Object | Amino Acid Sequence
`id` | String | Id of the SVG from html

Source:
  - drawsvg.js, line 155

#### getPrefixMassList(sequence, massShiftList, massShift_in)

Returns prefix mass list

##### Parameters:

Name | Type | Description
--- | --- | ---
`sequence` | String | Contains Protein sequence
`massShiftList` | Array | Contains list of mass shifts
`massShift_in` | Float | Contains mass shift based on the Ion Types selected

Source:
  - calculateprefixandsuffixmass.js, line 9

#### getSuffixMassList(sequence, massShiftList, massShift_in)

Returns suffix mass list

##### Parameters:

Name | Type | Description
--- | --- | ---
`sequence` | String | Contains Protein sequence
`massShiftList` | Array | Contains list of mass shifts
`massShift_in` | Float | Contains mass shift based on the Ion Types selected

Source:
  - calculateprefixandsuffixmass.js, line 76

#### getSvgSize(parameters, seq)

Get the size of the svg based on the no. of rows and row length and other parameter.,.

##### Parameters:

Name | Type | Description
--- | --- | ---
`parameters` | Object | Contains parameters of width, letter space etc., to draw SVG
`seq` | String | Contains protein Sequence

Source:
  - drawsvg.js, line 6

#### getTerminus(ionType)

function checks for ion type and returns whether it is C terminus or N terminus

##### Parameters:

Name | Type | Description
--- | --- | ---
`ionType` | String | Contains information of the ion type from UI

Source:
  - utilfunctions.js, line 9

#### getTotalSeqMass(seq, massShiftList)

Returns total mass of the sequence

##### Parameters:

Name | Type | Description
--- | --- | ---
`seq` | String | Contains Protein sequence
`massShiftList` | Array | Contains list of mass shifts

Source:
  - calculateprefixandsuffixmass.js, line 134

#### getX(para, position)

Function provides with X coordinate

##### Parameters:

Name | Type | Description
--- | --- | ---
`para` | Object | Contains parameters of the graph
`position` | number | Contains position of the Acid

Source:
  - coordinates_util.js, line 42

#### getY(para, position)

Function provides the Y coordinate based on the position of the Acid

##### Parameters:

Name | Type | Description
--- | --- | ---
`para` | Object | Contains parameters of the graph
`position` | number | Contains position of the Acid

Source:
  - coordinates_util.js, line 31

#### handleOnClick(d, i, id, seq, massShiftList, monoMassList)

Handles on click actions. on click of any amino acid, provides a box to enter mass shift. On click of ok, will re calculate and redraws entire page.

##### Parameters:

Name | Type | Description
--- | --- | ---
`d` | Char | Current Amino Acid
`i` | Integer | Index or position of the amino acid
`id` | String | Contains Id of the SVG on which the sequence is drawn
`seq` | String | Sequence of the amino acid
`massShiftList` | Array | List of all the amino acids
`monoMassList` | Array | List of Mono Mass data

Source:
  - drawsvg.js, line 113

#### MassShift(thisElem, MassShift, position)

MassShift value at the top of the acids

##### Parameters:

Name | Type | Description
--- | --- | ---
`thisElem` | Object | Current element of the amino acid
`MassShift` | Float | Value of the mass shift
`position` | Integer | Position of the amino acid

Source:
  - drawsvg.js, line 374

#### onClickofMatchedPeaks()

Function to zoom the graph to the mass point on click of matched mass

Source:
  - getmasstableofselectedions.js, line 115

#### onLoadOfHTML(precursorMass)

Gets invoked immediatley after loading html

##### Parameters:

Name | Type | Description
--- | --- | ---
`precursorMass` | Float | Contains precursorMass value

Source:
  - onclickandeventhandler.js, line 1

#### parameters()

Fixed Parameters to draw the Sequence SVG

Source:
  - coordinates_util.js, line 4

#### parsePeakMass(dataName)

receives file name to parse and replace "" and [] to make it same as the result from original JSON.parse function

##### Parameters:

Name | Type | Description
--- | --- | ---
`dataName` | String | contains parsePeakMass in a sting format as we stringify while storing in local storage variable

Source:
  - parseData.js, line 5

#### parsePrecursorMass(dataName)

Function returns a json formatted data after getting precursor mass data from local storage

##### Parameters:

Name | Type | Description
--- | --- | ---
`dataName` | String | contains precursor mass in a sting format as we stringify while storing in local storage variable

Source:
  - parseData.js, line 54

#### parsePTM(dataName)

Function returns a json formatted after getting fixed ptm data from local storage

##### Parameters:

Name | Type | Description
--- | --- | ---
`dataName` | String | contains Fixed PTMs in a sting format as we stringify while storing in local storage variable

Source:
  - parseData.js, line 36

#### parseSeq(dataName)

receives file name to parse and replace "" and [] to make it same as the result from original JSON.parse function

##### Parameters:

Name | Type | Description
--- | --- | ---
`dataName` | String | contains sequence in a sting format as we stringify while storing in local storage variable

Source:
  - parseData.js, line 22

#### parseUnknowmassList(dataName)

Function returns a json formatted data after getting unknow mass list data from local storage

##### Parameters:

Name | Type | Description
--- | --- | ---
`dataName` | String | contains unkwon mass lists in a sting format as we stringify while storing in local storage variable

Source:
  - parseData.js, line 46

#### removeToolTip()

Remove tootltip on remove of the mouse from annotation

Source:
  - drawsvg.js, line 347

#### setIonCheckbox(ionType)

map the ion name from the prsm.js files to the ion checkbox id in the spectrum.html

##### Parameters:

Name | Type | Description
--- | --- | ---
`ionType` | Char | Contains ion types from check box

Source:
  - checkIonCheckbox.js, line 5

#### showAllPeaks()

Function to display all peaks of data in table. This handles on click action from html of show all peaks button.

Source:
  - onclickandeventhandler.js, line 74

#### showIonPeaks(ids)

Function to show only matched on unmatched peaks on click of matched or unmatched peak buttons

##### Parameters:

Name | Type | Description
--- | --- | ---
`ids` | String | Contains Ids of respective matched peaks or un matched peaks

Source:
  - onclickandeventhandler.js, line 129

#### showMatchedPeaks()

Function to display only matched peaks in table. This handles on click action from html of show matched peaks button.

Source:
  - onclickandeventhandler.js, line 91

#### showNonMatchedPeaks()

Function to display only un matched peaks in table. This handles on click action from html of show un matched peaks button.

Source:
  - onclickandeventhandler.js, line 108

#### utilFunctions()

Utility function retrieve data from UI

Source:
  - utilfunctions.js, line 1

#### {onClickSequenceOfExecution} executes when user enters mass shift on any amino acid and click "OK" button.()

This class contains functions {sequenceOfExecution} and {onClickSequenceOfExecution}.

Source:
  - seqofexecution.js, line 1