Skip to content

Instantly share code, notes, and snippets.

@nashv
Created February 19, 2017 20:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nashv/df99294076846bee9676381b05084cf5 to your computer and use it in GitHub Desktop.
Save nashv/df99294076846bee9676381b05084cf5 to your computer and use it in GitHub Desktop.
Biliary Tree calculations
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": true,
"deletable": true,
"editable": true
},
"outputs": [],
"source": [
"import pint\n",
"import numpy\n",
"import math\n",
"from uncertainties import ufloat"
]
},
{
"cell_type": "code",
"execution_count": 28,
"metadata": {
"collapsed": false,
"deletable": true,
"editable": true
},
"outputs": [],
"source": [
"unit = pint.UnitRegistry()"
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": true,
"deletable": true,
"editable": true
},
"source": [
"### We will define certain volumes here. The most important case is the fractionation of the liver volume."
]
},
{
"cell_type": "code",
"execution_count": 58,
"metadata": {
"collapsed": false,
"deletable": true,
"editable": true
},
"outputs": [],
"source": [
"vol_Blood = 1.6*unit.milliliter # 7.6% of a standard mouse weighing 22g according to EPA reference.\n",
"vol_Liver = 1.2*unit.milliliter # 5.5% of a standard mouse weighing 22g according to EPA reference.\n",
"vol_Hepatocytes = 0.83*vol_Liver #Hepatocytes constitute 83% of the liver volume\n",
"vol_Canaliculi = 0.03*vol_Liver #Canaliculi constitute 3% of the liver volume\n",
"vol_Biliarytree = (56.9*unit.microliter)*1.2 #According to J Physiol (Paris). 1977 Jun;73(1):37-46 in rats"
]
},
{
"cell_type": "markdown",
"metadata": {
"deletable": true,
"editable": true
},
"source": [
"### Let's say we have injected 20 µl of 1 mg/ml CLF in a mouse as is typically the case."
]
},
{
"cell_type": "code",
"execution_count": 59,
"metadata": {
"collapsed": true,
"deletable": true,
"editable": true
},
"outputs": [],
"source": [
"conc_CLF = 1*(unit.milligram/unit.milliliter)\n",
"amount_CLF_solution = 20*(unit.microliter)"
]
},
{
"cell_type": "markdown",
"metadata": {
"deletable": true,
"editable": true
},
"source": [
"### The molecular weight of CLF is 376 g/mole"
]
},
{
"cell_type": "code",
"execution_count": 60,
"metadata": {
"collapsed": false,
"deletable": true,
"editable": true
},
"outputs": [],
"source": [
"mol_wt_CLF = 376*(unit.gram/unit.mole)"
]
},
{
"cell_type": "code",
"execution_count": 61,
"metadata": {
"collapsed": false,
"deletable": true,
"editable": true
},
"outputs": [],
"source": [
"amount_CLF_moles = (conc_CLF/mol_wt_CLF)*amount_CLF_solution"
]
},
{
"cell_type": "markdown",
"metadata": {
"deletable": true,
"editable": true
},
"source": [
"### This yields a total amount CLF injected in the mouse to be : "
]
},
{
"cell_type": "code",
"execution_count": 62,
"metadata": {
"collapsed": false,
"deletable": true,
"editable": true
},
"outputs": [
{
"data": {
"text/html": [
"53.191489361702125 nanomole"
],
"text/latex": [
"$53.191489361702125 nanomole$"
],
"text/plain": [
"<Quantity(53.191489361702125, 'nanomole')>"
]
},
"execution_count": 62,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"amount_CLF_moles.to('nmole')"
]
},
{
"cell_type": "markdown",
"metadata": {
"deletable": true,
"editable": true
},
"source": [
"### If the liver does not function at all, and the CLF only remains in blood, we can calculate the expected blood concentration to be:"
]
},
{
"cell_type": "code",
"execution_count": 89,
"metadata": {
"collapsed": false,
"deletable": true,
"editable": true
},
"outputs": [
{
"data": {
"text/html": [
"33.24468085106383 micromole/liter"
],
"text/latex": [
"$33.24468085106383 \\frac{micromole}{liter}$"
],
"text/plain": [
"<Quantity(33.24468085106383, 'micromole / liter')>"
]
},
"execution_count": 89,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"conc_CLF_moles_Blood = (amount_CLF_moles/vol_Blood).to('micromole/liter')\n",
"conc_CLF_moles_Blood"
]
},
{
"cell_type": "markdown",
"metadata": {
"deletable": true,
"editable": true
},
"source": [
"### Let's assume that by whatever processes, under 90% uptake block conditions, 10% of this CLF ends up in the biliary tree. Thus, the concentration of CLF in the biliary tree is given as follows."
]
},
{
"cell_type": "code",
"execution_count": 84,
"metadata": {
"collapsed": true,
"deletable": true,
"editable": true
},
"outputs": [],
"source": [
"conc_CLF_moles_biliarytree = 0.1*amount_CLF_moles/vol_Biliarytree"
]
},
{
"cell_type": "code",
"execution_count": 85,
"metadata": {
"collapsed": false,
"deletable": true,
"editable": true
},
"outputs": [
{
"data": {
"text/html": [
"77.90200550922985 micromole/liter"
],
"text/latex": [
"$77.90200550922985 \\frac{micromole}{liter}$"
],
"text/plain": [
"<Quantity(77.90200550922985, 'micromole / liter')>"
]
},
"execution_count": 85,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"conc_CLF_moles_biliarytree.to('micromole/liter')"
]
},
{
"cell_type": "markdown",
"metadata": {
"deletable": true,
"editable": true
},
"source": [
"### This would be the expected concentration of CLF in bile from the biliary tree. If we now assume, that this total amount of CLF is freely allowed to pass to the blood. That is, the blood and bile compartments become completely linked. We can calculate the total expected concentration in blood as follows :"
]
},
{
"cell_type": "code",
"execution_count": 86,
"metadata": {
"collapsed": false,
"deletable": true,
"editable": true
},
"outputs": [],
"source": [
"dil_factor_bile_blood = vol_Biliarytree/(vol_Blood+vol_Biliarytree)\n",
"conc_CLF_moles_blood_fromBile = dil_factor_bile_blood*conc_CLF_moles_biliarytree"
]
},
{
"cell_type": "markdown",
"metadata": {
"deletable": true,
"editable": true
},
"source": [
"### The expected CLF concentration in blood due to free influx from the bile compartment is therefore : "
]
},
{
"cell_type": "code",
"execution_count": 108,
"metadata": {
"collapsed": false,
"deletable": true,
"editable": true
},
"outputs": [
{
"data": {
"text/html": [
"3.1884029876101225 micromole/liter"
],
"text/latex": [
"$3.1884029876101225 \\frac{micromole}{liter}$"
],
"text/plain": [
"<Quantity(3.1884029876101225, 'micromole / liter')>"
]
},
"execution_count": 108,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"conc_CLF_moles_blood_fromBile.to('micromole/liter')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### The CLF that remained in the blood and never entered the biliary tree (due to uptake block) gives a blood concentration of: "
]
},
{
"cell_type": "code",
"execution_count": 111,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
"29.92021276595745 micromole/liter"
],
"text/latex": [
"$29.92021276595745 \\frac{micromole}{liter}$"
],
"text/plain": [
"<Quantity(29.92021276595745, 'micromole / liter')>"
]
},
"execution_count": 111,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"(0.9*(conc_CLF_moles_Blood.to('micromole/liter')))"
]
},
{
"cell_type": "markdown",
"metadata": {
"deletable": true,
"editable": true
},
"source": [
"### The relative change in blood concentration due to free influx from the bile compartment is : "
]
},
{
"cell_type": "code",
"execution_count": 114,
"metadata": {
"collapsed": false,
"deletable": true,
"editable": true
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"10.656351318590275 dimensionless %\n"
]
}
],
"source": [
"Relative_change = conc_CLF_moles_blood_fromBile.to('micromole/liter')/(0.9*(conc_CLF_moles_Blood.to('micromole/liter')))\n",
"print(Relative_change*100, '%')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true,
"deletable": true,
"editable": true
},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true,
"deletable": true,
"editable": true
},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"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",
"version": "3.6.0"
}
},
"nbformat": 4,
"nbformat_minor": 1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment