Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added docs/examples/ex02_Amersfoort/amersfoort.xlsx
Binary file not shown.
214 changes: 214 additions & 0 deletions docs/examples/ex02_Amersfoort/example_02_amersfoort_NAscreening.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,214 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "d7cb246f-47ce-46b5-ba06-cd636bc6528a",
"metadata": {},
"source": [
"# MiBiPreT example: Electron Balance with Amersfoort data\n",
"\n",
"Diagnostic plots for data analysis on microbial biodegredation at the contaminant Amersfoort site. Author: Alraune Zech\n",
"\n",
"Data based on the PhD thesis of *Johan van Leeuwen*, 2021 'Biodegredation of mono- and polyaromatic hydrocarbons in a contaminated aquifer originating from a former Pintsch gas factory site' which is equivalent to the manuscript of van Leeuwen et al., 2022 'Anaerobic degradation of benzene and other aromatic hydrocarbons in a tar-derived plume: Nitrate versus iron reducing conditions', J. of Cont. Hydrol. The data was provided by Johan van Leeuwen.\n",
" \n",
"## Background: Amersfoort contaminant site\n",
"\n",
"Close to the train station in Amersfoort, the Netherlands, the subsurface is contaminated with organic hydrocarbons forming a NAPL. Contamination originates from decades of operating manufactured gas plant, which dumped tar by-products in waste lagoons. The tar is a DNAPL and has spread into the underlying shallow unconfined aquifer. Sample wells were installed to measure various characteristics of the subsurface. The raw data contains measurements on\n",
"* environmental conditions, such as pH, redox potential, concentrations of oxygen, nitrate, etc\n",
"* contaminant concentration such as BTEX, indene, indane, naphtalene and multiple other (typically cyclic) petroleum hydrocarbons\n",
"* metabolite concentration, i.e. byproducts of degredation processes of contaminant\n",
"* isotope measurments for specific contaminants and samples\n",
"* counts of genes (RNA/DNA) of mibrobiota that is know to perform biodegredation as well as functional enzymes know to be responsible for biodegredation"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "9a2d3f66-c10e-45a5-9f8d-69bdde8f1092",
"metadata": {},
"outputs": [],
"source": [
"import mibiscreen as mbs"
]
},
{
"cell_type": "markdown",
"id": "db939a97-8819-445c-98b8-3898a4538af0",
"metadata": {},
"source": [
"## Data loading"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "21e1706b-6580-4e81-a35c-7cb472e46a59",
"metadata": {},
"outputs": [],
"source": [
"file_path = './amersfoort.xlsx'"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "e7d94627-1002-414a-8156-d816b5f4dad0",
"metadata": {},
"outputs": [],
"source": [
"contaminants_raw,_ = mbs.load_excel(file_path,\n",
" sheet_name = 'contaminants')\n",
"contaminants,units = mbs.standardize(contaminants_raw)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "15c5a3f6-7c64-4db7-a796-c13573f5e6be",
"metadata": {},
"outputs": [],
"source": [
"environment_raw,_ = mbs.load_excel(file_path,\n",
" sheet_name = 'environment')\n",
"environment,units = mbs.standardize(environment_raw)"
]
},
{
"cell_type": "markdown",
"id": "1d6a3481-0bfe-4629-bece-b8f767a4ad0a",
"metadata": {},
"source": [
"## Electron balance: Simple NA screening analysis"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "135c4dd4-a338-493e-8297-9b092992cb69",
"metadata": {},
"outputs": [],
"source": [
"mbs.reductors(environment,\n",
" include = True,\n",
" ea_group = 'ONS')"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "aa9a6619-31eb-4511-b0e1-758878f58919",
"metadata": {},
"outputs": [],
"source": [
"mbs.oxidators(contaminants,include = True,\n",
" contaminant_group='BTEX')\n",
"mbs.oxidators(contaminants,include = True,\n",
" contaminant_group='BTEXIIN')"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "36b036a4-68a8-4f98-bb4b-8611f0f688b2",
"metadata": {},
"outputs": [],
"source": [
"data_NA = mbs.merge_data([environment,contaminants])\n",
"mbs.electron_balance(data_NA,include = True)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "904908ca-40a3-4d79-9507-6e2d64b625ba",
"metadata": {},
"outputs": [],
"source": [
"na_traffic = mbs.sample_NA_traffic(data_NA,include = True)"
]
},
{
"cell_type": "markdown",
"id": "fc55c15b-c30a-40a7-9468-a6bfec642f4a",
"metadata": {},
"source": [
"### Electron balance as bar plot\n",
"\n",
"Preprocess data selecting all relevant quantities and save in dictionary (`electron_balance_bar_data_prep()`) as input for visualization rountine `electron_balance_bar()`. Applied here to all samples for electron acceptors *oxygen*, *nitrate*, and *sulfate* and electron reducing contaminant groups *BTEXIIN* and *BTEX*. Samples are sorted according to available electrons. "
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "4aa744d1-84c9-47b7-b147-136363171a59",
"metadata": {},
"outputs": [],
"source": [
"#data_NA.total_reductors.iloc[[21,11,20,3,17,18]]\n",
"#data_NA.total_oxidators_BTEX.iloc[[21,11,20,3,17,18]]\n",
"data_NA.total_oxidators_BTEXIIN.iloc[[21,11,20,3,17,18]]\n",
"data_NA.e_balance.iloc[[21,11,20,3,17,18]]\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "34bd7170-369a-4024-aa39-23e4ff59ecf9",
"metadata": {},
"outputs": [],
"source": [
"electron_balance_bar_dict = mbs.electron_balance_bar_data_prep(data_NA)\n",
"mbs.electron_balance_bar(electron_balance_bar_dict,\n",
" sample_nr = True, \n",
" figsize = [12,3],\n",
" xtick_autorotate = True,\n",
" )\n",
"\n",
"print(electron_balance_bar_dict)"
]
},
{
"cell_type": "markdown",
"id": "49b8be90-4780-4f34-bb12-8b2a04776995",
"metadata": {},
"source": [
"#### Electron balance analysis for selected samples\n",
"\n",
"Preprocess data selecting quantities for specified sample selection, save in dictionary and visualize."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "275e43d0-41ed-4b8a-bf7b-30e4936b3a60",
"metadata": {},
"outputs": [],
"source": [
"electron_balance_bar_dict = mbs.electron_balance_bar_data_prep(data_NA,\n",
" list_samples = [21,11,20,3,17,18])\n",
"mbs.electron_balance_bar(electron_balance_bar_dict,\n",
" loc = 'upper right')"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Loading
Loading