Skip to content

Commit

Permalink
- add normalisation to NMR and LC-MS examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Gscorreia89 committed Jun 7, 2021
1 parent 2912eea commit 909d58d
Show file tree
Hide file tree
Showing 4 changed files with 111 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -938,6 +938,56 @@
"source": [
"nPYc.reports.generateReport(msDatacorrected, 'final report', pcaModel=PCAmodel, destinationPath='.')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# 8. OPTIONAL: Normalise Data and Export"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Dilution effects on global sample intensity can be normalised by using one of the available [Normalisation classes](https://npyc-toolbox.readthedocs.io/en/latest/normalisation.html).\n",
"\n",
"This is especially critical in urine samples when samples can vary substantially in concentration. Here we apply Probabilistic Quotient Normalisation (PQN) [Deterle et al. 2006](https://pubs.acs.org/doi/10.1021/ac051632c).\n",
"\n",
"Setting the 'Normalisation' parameter in msDataCorrected automatically applies the selected normalisation."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"msDatacorrected.Normalisation = ProbabilisticQuotientNormaliser()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"And the normalised data exported (here we first change the name for clarity and so as not to overwrite existing data):"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Append name\n",
"msDatacorrected.name = msDatacorrected.name + '_PQN_normalised'\n",
"\n",
"# Export dataset\n",
"msDatacorrected.exportDataset(destinationPath='.')\n",
"\n",
"# Export final summary report\n",
"nPYc.reports.generateReport(msDatacorrected, 'final report', destinationPath='.')"
]
}
],
"metadata": {
Expand All @@ -957,7 +1007,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.4"
"version": "3.9.5"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,63 @@
"source": [
"nPYc.reports.generateReport(nmrData, 'final report', pcaModel=PCAmodel, destinationPath='.')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# 8. OPTIONAL: Normalise Data and Export"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Dilution effects on global sample intensity can be normalised by using one of the available [Normalisation classes](https://npyc-toolbox.readthedocs.io/en/latest/normalisation.html).\n",
"\n",
"This is especially critical in urine samples when samples can vary substantially in concentration. Here we apply Probabilistic Quotient Normalisation (PQN) [Deterle et al. 2006](https://pubs.acs.org/doi/10.1021/ac051632c).\n",
"\n",
"Setting the 'Normalisation' parameter in msDataCorrected automatically applies the selected normalisation."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"nmrData.Normalisation = ProbabilisticQuotientNormaliser()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"And the normalised data exported (here we first change the name for clarity and so as not to overwrite existing data):"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Append name\n",
"nmrData.name = nmrData.name + '_PQN_normalised'\n",
"\n",
"# Export dataset\n",
"nmrData.exportDataset(destinationPath='.')\n",
"\n",
"# Export final summary report\n",
"nPYc.reports.generateReport(nmrData, 'final report', destinationPath='.')# Append name\n",
"nmrData.name = nmrData.name + '_PQN_normalised'\n",
"\n",
"# Export dataset\n",
"nmrData.exportDataset(destinationPath='.')\n",
"\n",
"# Export final summary report\n",
"nPYc.reports.generateReport(nmrData, 'final report', destinationPath='.')"
]
}
],
"metadata": {
Expand All @@ -772,7 +829,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.8"
"version": "3.9.5"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.4"
"version": "3.9.5"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.8"
"version": "3.9.5"
},
"pycharm": {
"stem_cell": {
Expand Down

0 comments on commit 909d58d

Please sign in to comment.