Skip to content

Instantly share code, notes, and snippets.

@atomic77
Last active June 20, 2024 21:56
Show Gist options
  • Save atomic77/59f64cd0f29b65d4cb29a227a715f847 to your computer and use it in GitHub Desktop.
Save atomic77/59f64cd0f29b65d4cb29a227a715f847 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Canadian Nutrient File as a DuckDB Database\n",
"\n",
"This gist contains a compacted and ready-to-use DuckDB version of the \n",
"[Canadian Nutrient File](https://www.canada.ca/en/health-canada/services/food-nutrition/healthy-eating/nutrient-data/canadian-nutrient-file-compilation-canadian-food-composition-data-database-structure.html) from Health Canada, along\n",
"with a Jupyter notebook demonstrating my particular use case. You will likely need duckdb 0.10 or greater [to open it](https://duckdb.org/docs/internals/storage).\n",
"\n",
"The dataset contains a detailed nutritional composition of over 5000 foods sold in Canada across 150 dimensions - essentially anything you may see on a nutition label. The products are Canada-centric, naturally, but there are plenty of less-processed foods that should still make the dataset useful for people elsewhere.\n",
"\n",
"To use, all you should need to do open up the notebook in your favorite Jupyter environment and `pip install requirements.txt` to install the needed packages.\n",
"\n",
"_The original source data can be downloaded from the [Canada Open Data portal](https://open.canada.ca/data/en/dataset/089885f9-ed53-44e6-854a-14d21a1ec2e0), my apologies I lost the script/commands I used to create the DB._\n",
"\n",
"\n",
"### Examples \n",
"\n",
"My original use case for this dataset was to do some analysis of essential amino acid composition,\n",
"and there are some functions below showing how to compare different foods.\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"---------- \n",
"#### Helpers and base functions"
]
},
{
"cell_type": "code",
"execution_count": 32,
"metadata": {},
"outputs": [],
"source": [
"import duckdb\n",
"import pandas as pd\n",
"import plotly.express as px"
]
},
{
"cell_type": "code",
"execution_count": 33,
"metadata": {},
"outputs": [],
"source": [
"db = duckdb.connect('cnf.duckdb', read_only=True)"
]
},
{
"cell_type": "code",
"execution_count": 79,
"metadata": {},
"outputs": [],
"source": [
"def essential_amino_for_food(foodId, with_prot=False):\n",
" \"\"\" Return a dataframe with the scaled ratio of essential amino acids in its protein \n",
" https://en.wikipedia.org/wiki/Essential_amino_acid\n",
" \"\"\"\n",
" # histidine, isoleucine, leucine, lysine, methionine, phenylalanine, threonine, tryptophan and valine.\n",
" ess_amn = [512, 503, 504, 505, 506, 508, 502, 501] \n",
" if with_prot:\n",
" ess_amn.append(203)\n",
" sql = f\"\"\"\n",
" SELECT fn.FoodDescription, nn.NutrientID, nn.NutrientName, nn.NutrientUnit , na.NutrientValue, NutrientValue / sum(NutrientValue) OVER (PARTITION by FoodDescription) as EssentialRatio\n",
" FROM\n",
" main.nutrient_amount na\n",
" NATURAL JOIN main.nutrient_name nn \n",
" NATURAL JOIN main.food_name fn\n",
" WHERE fn.FoodID = {foodId}\n",
" AND nn.NutrientID IN ({\",\".join([str(e) for e in ess_amn])})\n",
" \"\"\"\n",
" return db.sql(sql).to_df()"
]
},
{
"cell_type": "code",
"execution_count": 82,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>FoodID</th>\n",
" <th>FoodDescription</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>4487</td>\n",
" <td>Grains, buckwheat</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>4488</td>\n",
" <td>Grains, buckwheat flour, whole-groat</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>4413</td>\n",
" <td>Grains, buckwheat groats, roasted, cooked</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>4412</td>\n",
" <td>Grains, buckwheat groats, roasted, dry</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>501831</td>\n",
" <td>Pancake, buckwheat, dry mix, incomplete, prepa...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>3937</td>\n",
" <td>Pancake, buckwheat, dry mix, incomplete, unpre...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>6</th>\n",
" <td>4125</td>\n",
" <td>Snacks, rice cakes, brown rice, buckwheat</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7</th>\n",
" <td>4388</td>\n",
" <td>Snacks, rice cakes, brown rice, buckwheat, uns...</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" FoodID FoodDescription\n",
"0 4487 Grains, buckwheat\n",
"1 4488 Grains, buckwheat flour, whole-groat\n",
"2 4413 Grains, buckwheat groats, roasted, cooked\n",
"3 4412 Grains, buckwheat groats, roasted, dry\n",
"4 501831 Pancake, buckwheat, dry mix, incomplete, prepa...\n",
"5 3937 Pancake, buckwheat, dry mix, incomplete, unpre...\n",
"6 4125 Snacks, rice cakes, brown rice, buckwheat\n",
"7 4388 Snacks, rice cakes, brown rice, buckwheat, uns..."
]
},
"execution_count": 82,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"def food_search(food): \n",
" \"\"\" Helper to return FoodIDs to use in other functions \"\"\"\n",
" return db.sql(f\"\"\" \n",
" SELECT FoodID, FoodDescription\n",
" FROM main.food_name\n",
" WHERE FoodDescription ilike '%{food}%'\n",
" ORDER BY 2 ASC\n",
" LIMIT 20\n",
" \"\"\").to_df()\n",
"food_search('buckwheat')"
]
},
{
"cell_type": "code",
"execution_count": 80,
"metadata": {},
"outputs": [],
"source": [
"quinoa = essential_amino_for_food(4495)"
]
},
{
"cell_type": "code",
"execution_count": 81,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>FoodDescription</th>\n",
" <th>NutrientID</th>\n",
" <th>NutrientName</th>\n",
" <th>NutrientUnit</th>\n",
" <th>NutrientValue</th>\n",
" <th>EssentialRatio</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>Grains, quinoa, dry</td>\n",
" <td>501</td>\n",
" <td>TRYPTOPHAN</td>\n",
" <td>g</td>\n",
" <td>0.160</td>\n",
" <td>0.04000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>Grains, quinoa, dry</td>\n",
" <td>502</td>\n",
" <td>THREONINE</td>\n",
" <td>g</td>\n",
" <td>0.421</td>\n",
" <td>0.10525</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>Grains, quinoa, dry</td>\n",
" <td>503</td>\n",
" <td>ISOLEUCINE</td>\n",
" <td>g</td>\n",
" <td>0.504</td>\n",
" <td>0.12600</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>Grains, quinoa, dry</td>\n",
" <td>504</td>\n",
" <td>LEUCINE</td>\n",
" <td>g</td>\n",
" <td>0.840</td>\n",
" <td>0.21000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>Grains, quinoa, dry</td>\n",
" <td>505</td>\n",
" <td>LYSINE</td>\n",
" <td>g</td>\n",
" <td>0.766</td>\n",
" <td>0.19150</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>Grains, quinoa, dry</td>\n",
" <td>506</td>\n",
" <td>METHIONINE</td>\n",
" <td>g</td>\n",
" <td>0.309</td>\n",
" <td>0.07725</td>\n",
" </tr>\n",
" <tr>\n",
" <th>6</th>\n",
" <td>Grains, quinoa, dry</td>\n",
" <td>508</td>\n",
" <td>PHENYLALANINE</td>\n",
" <td>g</td>\n",
" <td>0.593</td>\n",
" <td>0.14825</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7</th>\n",
" <td>Grains, quinoa, dry</td>\n",
" <td>512</td>\n",
" <td>HISTIDINE</td>\n",
" <td>g</td>\n",
" <td>0.407</td>\n",
" <td>0.10175</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" FoodDescription NutrientID NutrientName NutrientUnit NutrientValue \\\n",
"0 Grains, quinoa, dry 501 TRYPTOPHAN g 0.160 \n",
"1 Grains, quinoa, dry 502 THREONINE g 0.421 \n",
"2 Grains, quinoa, dry 503 ISOLEUCINE g 0.504 \n",
"3 Grains, quinoa, dry 504 LEUCINE g 0.840 \n",
"4 Grains, quinoa, dry 505 LYSINE g 0.766 \n",
"5 Grains, quinoa, dry 506 METHIONINE g 0.309 \n",
"6 Grains, quinoa, dry 508 PHENYLALANINE g 0.593 \n",
"7 Grains, quinoa, dry 512 HISTIDINE g 0.407 \n",
"\n",
" EssentialRatio \n",
"0 0.04000 \n",
"1 0.10525 \n",
"2 0.12600 \n",
"3 0.21000 \n",
"4 0.19150 \n",
"5 0.07725 \n",
"6 0.14825 \n",
"7 0.10175 "
]
},
"execution_count": 81,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"quinoa"
]
},
{
"cell_type": "code",
"execution_count": 24,
"metadata": {},
"outputs": [],
"source": [
"def compare_proteins(*args):\n",
" \"\"\" Render a bar/histogram with the essential amino acid content of a\n",
" variable number of foods \"\"\"\n",
" all_df = []\n",
" for f in args:\n",
" all_df.append(essential_amino_for_food(f))\n",
" df = pd.concat(all_df)\n",
" return px.histogram(\n",
" df, x='NutrientName', y='EssentialRatio', color='FoodDescription', \n",
" title='Essential Ratio Comparison', barmode='group'\n",
" )"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"-------------------\n",
"## Comparing Protein Sources"
]
},
{
"cell_type": "code",
"execution_count": 66,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.plotly.v1+json": {
"config": {
"plotlyServerURL": "https://plot.ly"
},
"data": [
{
"alignmentgroup": "True",
"bingroup": "x",
"histfunc": "sum",
"hovertemplate": "FoodDescription=Grains, rice, brown, long-grain, dry<br>NutrientName=%{x}<br>sum of EssentialRatio=%{y}<extra></extra>",
"legendgroup": "Grains, rice, brown, long-grain, dry",
"marker": {
"color": "#636efa",
"pattern": {
"shape": ""
}
},
"name": "Grains, rice, brown, long-grain, dry",
"offsetgroup": "Grains, rice, brown, long-grain, dry",
"orientation": "v",
"showlegend": true,
"type": "histogram",
"x": [
"TRYPTOPHAN",
"THREONINE",
"ISOLEUCINE",
"LEUCINE",
"LYSINE",
"METHIONINE",
"PHENYLALANINE",
"HISTIDINE"
],
"xaxis": "x",
"y": [
0.04074223477208552,
0.11738604275917708,
0.1355385235982251,
0.26502622025010086,
0.12222670431625654,
0.07220653489310205,
0.1653892698668818,
0.08148446954417105
],
"yaxis": "y"
},
{
"alignmentgroup": "True",
"bingroup": "x",
"histfunc": "sum",
"hovertemplate": "FoodDescription=Cereal, hot, oats, large flakes, dry, Quaker<br>NutrientName=%{x}<br>sum of EssentialRatio=%{y}<extra></extra>",
"legendgroup": "Cereal, hot, oats, large flakes, dry, Quaker",
"marker": {
"color": "#EF553B",
"pattern": {
"shape": ""
}
},
"name": "Cereal, hot, oats, large flakes, dry, Quaker",
"offsetgroup": "Cereal, hot, oats, large flakes, dry, Quaker",
"orientation": "v",
"showlegend": true,
"type": "histogram",
"x": [
"TRYPTOPHAN",
"THREONINE",
"ISOLEUCINE",
"LEUCINE",
"LYSINE",
"METHIONINE",
"PHENYLALANINE",
"HISTIDINE"
],
"xaxis": "x",
"y": [
0.045917159763313606,
0.11289940828402364,
0.136094674556213,
0.2518343195266272,
0.13751479289940827,
0.06106508875739644,
0.17538461538461536,
0.07928994082840236
],
"yaxis": "y"
},
{
"alignmentgroup": "True",
"bingroup": "x",
"histfunc": "sum",
"hovertemplate": "FoodDescription=Grains, wheat, hard red spring<br>NutrientName=%{x}<br>sum of EssentialRatio=%{y}<extra></extra>",
"legendgroup": "Grains, wheat, hard red spring",
"marker": {
"color": "#00cc96",
"pattern": {
"shape": ""
}
},
"name": "Grains, wheat, hard red spring",
"offsetgroup": "Grains, wheat, hard red spring",
"orientation": "v",
"showlegend": true,
"type": "histogram",
"x": [
"TRYPTOPHAN",
"THREONINE",
"ISOLEUCINE",
"LEUCINE",
"LYSINE",
"METHIONINE",
"PHENYLALANINE",
"HISTIDINE"
],
"xaxis": "x",
"y": [
0.05006418485237485,
0.11116816431322209,
0.1388960205391528,
0.2664955070603338,
0.10372272143774071,
0.05905006418485238,
0.18587933247753533,
0.0847240051347882
],
"yaxis": "y"
},
{
"alignmentgroup": "True",
"bingroup": "x",
"histfunc": "sum",
"hovertemplate": "FoodDescription=Grains, barley, dry<br>NutrientName=%{x}<br>sum of EssentialRatio=%{y}<extra></extra>",
"legendgroup": "Grains, barley, dry",
"marker": {
"color": "#ab63fa",
"pattern": {
"shape": ""
}
},
"name": "Grains, barley, dry",
"offsetgroup": "Grains, barley, dry",
"orientation": "v",
"showlegend": true,
"type": "histogram",
"x": [
"TRYPTOPHAN",
"THREONINE",
"ISOLEUCINE",
"LEUCINE",
"LYSINE",
"METHIONINE",
"PHENYLALANINE",
"HISTIDINE"
],
"xaxis": "x",
"y": [
0.057426836002208714,
0.11706239646604084,
0.1258972943125345,
0.2341247929320817,
0.12838210933186084,
0.06626173384870236,
0.19326339039204857,
0.07758144671452237
],
"yaxis": "y"
},
{
"alignmentgroup": "True",
"bingroup": "x",
"histfunc": "sum",
"hovertemplate": "FoodDescription=Grains, buckwheat groats, roasted, dry<br>NutrientName=%{x}<br>sum of EssentialRatio=%{y}<extra></extra>",
"legendgroup": "Grains, buckwheat groats, roasted, dry",
"marker": {
"color": "#FFA15A",
"pattern": {
"shape": ""
}
},
"name": "Grains, buckwheat groats, roasted, dry",
"offsetgroup": "Grains, buckwheat groats, roasted, dry",
"orientation": "v",
"showlegend": true,
"type": "histogram",
"x": [
"TRYPTOPHAN",
"THREONINE",
"ISOLEUCINE",
"LEUCINE",
"LYSINE",
"METHIONINE",
"PHENYLALANINE",
"HISTIDINE"
],
"xaxis": "x",
"y": [
0.05187671650900214,
0.13671040585901742,
0.13457430576747026,
0.22459566676838574,
0.1815685077815075,
0.04668904485810193,
0.1406774488861764,
0.08330790357033874
],
"yaxis": "y"
},
{
"alignmentgroup": "True",
"bingroup": "x",
"histfunc": "sum",
"hovertemplate": "FoodDescription=Grains, quinoa, dry<br>NutrientName=%{x}<br>sum of EssentialRatio=%{y}<extra></extra>",
"legendgroup": "Grains, quinoa, dry",
"marker": {
"color": "#19d3f3",
"pattern": {
"shape": ""
}
},
"name": "Grains, quinoa, dry",
"offsetgroup": "Grains, quinoa, dry",
"orientation": "v",
"showlegend": true,
"type": "histogram",
"x": [
"TRYPTOPHAN",
"THREONINE",
"ISOLEUCINE",
"LEUCINE",
"LYSINE",
"METHIONINE",
"PHENYLALANINE",
"HISTIDINE"
],
"xaxis": "x",
"y": [
0.04,
0.10525,
0.126,
0.21,
0.1915,
0.07725,
0.14825,
0.10175
],
"yaxis": "y"
}
],
"layout": {
"barmode": "group",
"legend": {
"title": {
"text": "FoodDescription"
},
"tracegroupgap": 0
},
"template": {
"data": {
"bar": [
{
"error_x": {
"color": "#2a3f5f"
},
"error_y": {
"color": "#2a3f5f"
},
"marker": {
"line": {
"color": "#E5ECF6",
"width": 0.5
},
"pattern": {
"fillmode": "overlay",
"size": 10,
"solidity": 0.2
}
},
"type": "bar"
}
],
"barpolar": [
{
"marker": {
"line": {
"color": "#E5ECF6",
"width": 0.5
},
"pattern": {
"fillmode": "overlay",
"size": 10,
"solidity": 0.2
}
},
"type": "barpolar"
}
],
"carpet": [
{
"aaxis": {
"endlinecolor": "#2a3f5f",
"gridcolor": "white",
"linecolor": "white",
"minorgridcolor": "white",
"startlinecolor": "#2a3f5f"
},
"baxis": {
"endlinecolor": "#2a3f5f",
"gridcolor": "white",
"linecolor": "white",
"minorgridcolor": "white",
"startlinecolor": "#2a3f5f"
},
"type": "carpet"
}
],
"choropleth": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"type": "choropleth"
}
],
"contour": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"colorscale": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
],
"type": "contour"
}
],
"contourcarpet": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"type": "contourcarpet"
}
],
"heatmap": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"colorscale": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
],
"type": "heatmap"
}
],
"heatmapgl": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"colorscale": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
],
"type": "heatmapgl"
}
],
"histogram": [
{
"marker": {
"pattern": {
"fillmode": "overlay",
"size": 10,
"solidity": 0.2
}
},
"type": "histogram"
}
],
"histogram2d": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"colorscale": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
],
"type": "histogram2d"
}
],
"histogram2dcontour": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"colorscale": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
],
"type": "histogram2dcontour"
}
],
"mesh3d": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"type": "mesh3d"
}
],
"parcoords": [
{
"line": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "parcoords"
}
],
"pie": [
{
"automargin": true,
"type": "pie"
}
],
"scatter": [
{
"fillpattern": {
"fillmode": "overlay",
"size": 10,
"solidity": 0.2
},
"type": "scatter"
}
],
"scatter3d": [
{
"line": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scatter3d"
}
],
"scattercarpet": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scattercarpet"
}
],
"scattergeo": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scattergeo"
}
],
"scattergl": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scattergl"
}
],
"scattermapbox": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scattermapbox"
}
],
"scatterpolar": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scatterpolar"
}
],
"scatterpolargl": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scatterpolargl"
}
],
"scatterternary": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scatterternary"
}
],
"surface": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"colorscale": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
],
"type": "surface"
}
],
"table": [
{
"cells": {
"fill": {
"color": "#EBF0F8"
},
"line": {
"color": "white"
}
},
"header": {
"fill": {
"color": "#C8D4E3"
},
"line": {
"color": "white"
}
},
"type": "table"
}
]
},
"layout": {
"annotationdefaults": {
"arrowcolor": "#2a3f5f",
"arrowhead": 0,
"arrowwidth": 1
},
"autotypenumbers": "strict",
"coloraxis": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"colorscale": {
"diverging": [
[
0,
"#8e0152"
],
[
0.1,
"#c51b7d"
],
[
0.2,
"#de77ae"
],
[
0.3,
"#f1b6da"
],
[
0.4,
"#fde0ef"
],
[
0.5,
"#f7f7f7"
],
[
0.6,
"#e6f5d0"
],
[
0.7,
"#b8e186"
],
[
0.8,
"#7fbc41"
],
[
0.9,
"#4d9221"
],
[
1,
"#276419"
]
],
"sequential": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
],
"sequentialminus": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
]
},
"colorway": [
"#636efa",
"#EF553B",
"#00cc96",
"#ab63fa",
"#FFA15A",
"#19d3f3",
"#FF6692",
"#B6E880",
"#FF97FF",
"#FECB52"
],
"font": {
"color": "#2a3f5f"
},
"geo": {
"bgcolor": "white",
"lakecolor": "white",
"landcolor": "#E5ECF6",
"showlakes": true,
"showland": true,
"subunitcolor": "white"
},
"hoverlabel": {
"align": "left"
},
"hovermode": "closest",
"mapbox": {
"style": "light"
},
"paper_bgcolor": "white",
"plot_bgcolor": "#E5ECF6",
"polar": {
"angularaxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
},
"bgcolor": "#E5ECF6",
"radialaxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
}
},
"scene": {
"xaxis": {
"backgroundcolor": "#E5ECF6",
"gridcolor": "white",
"gridwidth": 2,
"linecolor": "white",
"showbackground": true,
"ticks": "",
"zerolinecolor": "white"
},
"yaxis": {
"backgroundcolor": "#E5ECF6",
"gridcolor": "white",
"gridwidth": 2,
"linecolor": "white",
"showbackground": true,
"ticks": "",
"zerolinecolor": "white"
},
"zaxis": {
"backgroundcolor": "#E5ECF6",
"gridcolor": "white",
"gridwidth": 2,
"linecolor": "white",
"showbackground": true,
"ticks": "",
"zerolinecolor": "white"
}
},
"shapedefaults": {
"line": {
"color": "#2a3f5f"
}
},
"ternary": {
"aaxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
},
"baxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
},
"bgcolor": "#E5ECF6",
"caxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
}
},
"title": {
"x": 0.05
},
"xaxis": {
"automargin": true,
"gridcolor": "white",
"linecolor": "white",
"ticks": "",
"title": {
"standoff": 15
},
"zerolinecolor": "white",
"zerolinewidth": 2
},
"yaxis": {
"automargin": true,
"gridcolor": "white",
"linecolor": "white",
"ticks": "",
"title": {
"standoff": 15
},
"zerolinecolor": "white",
"zerolinewidth": 2
}
}
},
"title": {
"text": "Essential Ratio Comparison"
},
"xaxis": {
"anchor": "y",
"domain": [
0,
1
],
"title": {
"text": "NutrientName"
}
},
"yaxis": {
"anchor": "x",
"domain": [
0,
1
],
"title": {
"text": "sum of EssentialRatio"
}
}
}
},
"text/html": [
"<div> <div id=\"10e2b3f8-22e5-4c9c-a0ce-858d37b74c1b\" class=\"plotly-graph-div\" style=\"height:525px; width:100%;\"></div> <script type=\"text/javascript\"> require([\"plotly\"], function(Plotly) { window.PLOTLYENV=window.PLOTLYENV || {}; if (document.getElementById(\"10e2b3f8-22e5-4c9c-a0ce-858d37b74c1b\")) { Plotly.newPlot( \"10e2b3f8-22e5-4c9c-a0ce-858d37b74c1b\", [{\"alignmentgroup\":\"True\",\"bingroup\":\"x\",\"histfunc\":\"sum\",\"hovertemplate\":\"FoodDescription=Grains, rice, brown, long-grain, dry\\u003cbr\\u003eNutrientName=%{x}\\u003cbr\\u003esum of EssentialRatio=%{y}\\u003cextra\\u003e\\u003c\\u002fextra\\u003e\",\"legendgroup\":\"Grains, rice, brown, long-grain, dry\",\"marker\":{\"color\":\"#636efa\",\"pattern\":{\"shape\":\"\"}},\"name\":\"Grains, rice, brown, long-grain, dry\",\"offsetgroup\":\"Grains, rice, brown, long-grain, dry\",\"orientation\":\"v\",\"showlegend\":true,\"x\":[\"TRYPTOPHAN\",\"THREONINE\",\"ISOLEUCINE\",\"LEUCINE\",\"LYSINE\",\"METHIONINE\",\"PHENYLALANINE\",\"HISTIDINE\"],\"xaxis\":\"x\",\"y\":[0.04074223477208552,0.11738604275917708,0.1355385235982251,0.26502622025010086,0.12222670431625654,0.07220653489310205,0.1653892698668818,0.08148446954417105],\"yaxis\":\"y\",\"type\":\"histogram\"},{\"alignmentgroup\":\"True\",\"bingroup\":\"x\",\"histfunc\":\"sum\",\"hovertemplate\":\"FoodDescription=Cereal, hot, oats, large flakes, dry, Quaker\\u003cbr\\u003eNutrientName=%{x}\\u003cbr\\u003esum of EssentialRatio=%{y}\\u003cextra\\u003e\\u003c\\u002fextra\\u003e\",\"legendgroup\":\"Cereal, hot, oats, large flakes, dry, Quaker\",\"marker\":{\"color\":\"#EF553B\",\"pattern\":{\"shape\":\"\"}},\"name\":\"Cereal, hot, oats, large flakes, dry, Quaker\",\"offsetgroup\":\"Cereal, hot, oats, large flakes, dry, Quaker\",\"orientation\":\"v\",\"showlegend\":true,\"x\":[\"TRYPTOPHAN\",\"THREONINE\",\"ISOLEUCINE\",\"LEUCINE\",\"LYSINE\",\"METHIONINE\",\"PHENYLALANINE\",\"HISTIDINE\"],\"xaxis\":\"x\",\"y\":[0.045917159763313606,0.11289940828402364,0.136094674556213,0.2518343195266272,0.13751479289940827,0.06106508875739644,0.17538461538461536,0.07928994082840236],\"yaxis\":\"y\",\"type\":\"histogram\"},{\"alignmentgroup\":\"True\",\"bingroup\":\"x\",\"histfunc\":\"sum\",\"hovertemplate\":\"FoodDescription=Grains, wheat, hard red spring\\u003cbr\\u003eNutrientName=%{x}\\u003cbr\\u003esum of EssentialRatio=%{y}\\u003cextra\\u003e\\u003c\\u002fextra\\u003e\",\"legendgroup\":\"Grains, wheat, hard red spring\",\"marker\":{\"color\":\"#00cc96\",\"pattern\":{\"shape\":\"\"}},\"name\":\"Grains, wheat, hard red spring\",\"offsetgroup\":\"Grains, wheat, hard red spring\",\"orientation\":\"v\",\"showlegend\":true,\"x\":[\"TRYPTOPHAN\",\"THREONINE\",\"ISOLEUCINE\",\"LEUCINE\",\"LYSINE\",\"METHIONINE\",\"PHENYLALANINE\",\"HISTIDINE\"],\"xaxis\":\"x\",\"y\":[0.05006418485237485,0.11116816431322209,0.1388960205391528,0.2664955070603338,0.10372272143774071,0.05905006418485238,0.18587933247753533,0.0847240051347882],\"yaxis\":\"y\",\"type\":\"histogram\"},{\"alignmentgroup\":\"True\",\"bingroup\":\"x\",\"histfunc\":\"sum\",\"hovertemplate\":\"FoodDescription=Grains, barley, dry\\u003cbr\\u003eNutrientName=%{x}\\u003cbr\\u003esum of EssentialRatio=%{y}\\u003cextra\\u003e\\u003c\\u002fextra\\u003e\",\"legendgroup\":\"Grains, barley, dry\",\"marker\":{\"color\":\"#ab63fa\",\"pattern\":{\"shape\":\"\"}},\"name\":\"Grains, barley, dry\",\"offsetgroup\":\"Grains, barley, dry\",\"orientation\":\"v\",\"showlegend\":true,\"x\":[\"TRYPTOPHAN\",\"THREONINE\",\"ISOLEUCINE\",\"LEUCINE\",\"LYSINE\",\"METHIONINE\",\"PHENYLALANINE\",\"HISTIDINE\"],\"xaxis\":\"x\",\"y\":[0.057426836002208714,0.11706239646604084,0.1258972943125345,0.2341247929320817,0.12838210933186084,0.06626173384870236,0.19326339039204857,0.07758144671452237],\"yaxis\":\"y\",\"type\":\"histogram\"},{\"alignmentgroup\":\"True\",\"bingroup\":\"x\",\"histfunc\":\"sum\",\"hovertemplate\":\"FoodDescription=Grains, buckwheat groats, roasted, dry\\u003cbr\\u003eNutrientName=%{x}\\u003cbr\\u003esum of EssentialRatio=%{y}\\u003cextra\\u003e\\u003c\\u002fextra\\u003e\",\"legendgroup\":\"Grains, buckwheat groats, roasted, dry\",\"marker\":{\"color\":\"#FFA15A\",\"pattern\":{\"shape\":\"\"}},\"name\":\"Grains, buckwheat groats, roasted, dry\",\"offsetgroup\":\"Grains, buckwheat groats, roasted, dry\",\"orientation\":\"v\",\"showlegend\":true,\"x\":[\"TRYPTOPHAN\",\"THREONINE\",\"ISOLEUCINE\",\"LEUCINE\",\"LYSINE\",\"METHIONINE\",\"PHENYLALANINE\",\"HISTIDINE\"],\"xaxis\":\"x\",\"y\":[0.05187671650900214,0.13671040585901742,0.13457430576747026,0.22459566676838574,0.1815685077815075,0.04668904485810193,0.1406774488861764,0.08330790357033874],\"yaxis\":\"y\",\"type\":\"histogram\"},{\"alignmentgroup\":\"True\",\"bingroup\":\"x\",\"histfunc\":\"sum\",\"hovertemplate\":\"FoodDescription=Grains, quinoa, dry\\u003cbr\\u003eNutrientName=%{x}\\u003cbr\\u003esum of EssentialRatio=%{y}\\u003cextra\\u003e\\u003c\\u002fextra\\u003e\",\"legendgroup\":\"Grains, quinoa, dry\",\"marker\":{\"color\":\"#19d3f3\",\"pattern\":{\"shape\":\"\"}},\"name\":\"Grains, quinoa, dry\",\"offsetgroup\":\"Grains, quinoa, dry\",\"orientation\":\"v\",\"showlegend\":true,\"x\":[\"TRYPTOPHAN\",\"THREONINE\",\"ISOLEUCINE\",\"LEUCINE\",\"LYSINE\",\"METHIONINE\",\"PHENYLALANINE\",\"HISTIDINE\"],\"xaxis\":\"x\",\"y\":[0.04,0.10525,0.126,0.21,0.1915,0.07725,0.14825,0.10175],\"yaxis\":\"y\",\"type\":\"histogram\"}], {\"template\":{\"data\":{\"histogram2dcontour\":[{\"type\":\"histogram2dcontour\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"choropleth\":[{\"type\":\"choropleth\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}],\"histogram2d\":[{\"type\":\"histogram2d\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"heatmap\":[{\"type\":\"heatmap\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"heatmapgl\":[{\"type\":\"heatmapgl\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"contourcarpet\":[{\"type\":\"contourcarpet\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}],\"contour\":[{\"type\":\"contour\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"surface\":[{\"type\":\"surface\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"mesh3d\":[{\"type\":\"mesh3d\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}],\"scatter\":[{\"fillpattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2},\"type\":\"scatter\"}],\"parcoords\":[{\"type\":\"parcoords\",\"line\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scatterpolargl\":[{\"type\":\"scatterpolargl\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"bar\":[{\"error_x\":{\"color\":\"#2a3f5f\"},\"error_y\":{\"color\":\"#2a3f5f\"},\"marker\":{\"line\":{\"color\":\"#E5ECF6\",\"width\":0.5},\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"type\":\"bar\"}],\"scattergeo\":[{\"type\":\"scattergeo\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scatterpolar\":[{\"type\":\"scatterpolar\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"histogram\":[{\"marker\":{\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"type\":\"histogram\"}],\"scattergl\":[{\"type\":\"scattergl\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scatter3d\":[{\"type\":\"scatter3d\",\"line\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}},\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scattermapbox\":[{\"type\":\"scattermapbox\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scatterternary\":[{\"type\":\"scatterternary\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scattercarpet\":[{\"type\":\"scattercarpet\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"carpet\":[{\"aaxis\":{\"endlinecolor\":\"#2a3f5f\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"minorgridcolor\":\"white\",\"startlinecolor\":\"#2a3f5f\"},\"baxis\":{\"endlinecolor\":\"#2a3f5f\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"minorgridcolor\":\"white\",\"startlinecolor\":\"#2a3f5f\"},\"type\":\"carpet\"}],\"table\":[{\"cells\":{\"fill\":{\"color\":\"#EBF0F8\"},\"line\":{\"color\":\"white\"}},\"header\":{\"fill\":{\"color\":\"#C8D4E3\"},\"line\":{\"color\":\"white\"}},\"type\":\"table\"}],\"barpolar\":[{\"marker\":{\"line\":{\"color\":\"#E5ECF6\",\"width\":0.5},\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"type\":\"barpolar\"}],\"pie\":[{\"automargin\":true,\"type\":\"pie\"}]},\"layout\":{\"autotypenumbers\":\"strict\",\"colorway\":[\"#636efa\",\"#EF553B\",\"#00cc96\",\"#ab63fa\",\"#FFA15A\",\"#19d3f3\",\"#FF6692\",\"#B6E880\",\"#FF97FF\",\"#FECB52\"],\"font\":{\"color\":\"#2a3f5f\"},\"hovermode\":\"closest\",\"hoverlabel\":{\"align\":\"left\"},\"paper_bgcolor\":\"white\",\"plot_bgcolor\":\"#E5ECF6\",\"polar\":{\"bgcolor\":\"#E5ECF6\",\"angularaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\"},\"radialaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\"}},\"ternary\":{\"bgcolor\":\"#E5ECF6\",\"aaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\"},\"baxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\"},\"caxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\"}},\"coloraxis\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}},\"colorscale\":{\"sequential\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]],\"sequentialminus\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]],\"diverging\":[[0,\"#8e0152\"],[0.1,\"#c51b7d\"],[0.2,\"#de77ae\"],[0.3,\"#f1b6da\"],[0.4,\"#fde0ef\"],[0.5,\"#f7f7f7\"],[0.6,\"#e6f5d0\"],[0.7,\"#b8e186\"],[0.8,\"#7fbc41\"],[0.9,\"#4d9221\"],[1,\"#276419\"]]},\"xaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\",\"title\":{\"standoff\":15},\"zerolinecolor\":\"white\",\"automargin\":true,\"zerolinewidth\":2},\"yaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\",\"title\":{\"standoff\":15},\"zerolinecolor\":\"white\",\"automargin\":true,\"zerolinewidth\":2},\"scene\":{\"xaxis\":{\"backgroundcolor\":\"#E5ECF6\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showbackground\":true,\"ticks\":\"\",\"zerolinecolor\":\"white\",\"gridwidth\":2},\"yaxis\":{\"backgroundcolor\":\"#E5ECF6\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showbackground\":true,\"ticks\":\"\",\"zerolinecolor\":\"white\",\"gridwidth\":2},\"zaxis\":{\"backgroundcolor\":\"#E5ECF6\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showbackground\":true,\"ticks\":\"\",\"zerolinecolor\":\"white\",\"gridwidth\":2}},\"shapedefaults\":{\"line\":{\"color\":\"#2a3f5f\"}},\"annotationdefaults\":{\"arrowcolor\":\"#2a3f5f\",\"arrowhead\":0,\"arrowwidth\":1},\"geo\":{\"bgcolor\":\"white\",\"landcolor\":\"#E5ECF6\",\"subunitcolor\":\"white\",\"showland\":true,\"showlakes\":true,\"lakecolor\":\"white\"},\"title\":{\"x\":0.05},\"mapbox\":{\"style\":\"light\"}}},\"xaxis\":{\"anchor\":\"y\",\"domain\":[0.0,1.0],\"title\":{\"text\":\"NutrientName\"}},\"yaxis\":{\"anchor\":\"x\",\"domain\":[0.0,1.0],\"title\":{\"text\":\"sum of EssentialRatio\"}},\"legend\":{\"title\":{\"text\":\"FoodDescription\"},\"tracegroupgap\":0},\"title\":{\"text\":\"Essential Ratio Comparison\"},\"barmode\":\"group\"}, {\"responsive\": true} ).then(function(){\n",
" \n",
"var gd = document.getElementById('10e2b3f8-22e5-4c9c-a0ce-858d37b74c1b');\n",
"var x = new MutationObserver(function (mutations, observer) {{\n",
" var display = window.getComputedStyle(gd).display;\n",
" if (!display || display === 'none') {{\n",
" console.log([gd, 'removed!']);\n",
" Plotly.purge(gd);\n",
" observer.disconnect();\n",
" }}\n",
"}});\n",
"\n",
"// Listen for the removal of the full notebook cells\n",
"var notebookContainer = gd.closest('#notebook-container');\n",
"if (notebookContainer) {{\n",
" x.observe(notebookContainer, {childList: true});\n",
"}}\n",
"\n",
"// Listen for the clearing of the current output cell\n",
"var outputEl = gd.closest('.output');\n",
"if (outputEl) {{\n",
" x.observe(outputEl, {childList: true});\n",
"}}\n",
"\n",
" }) }; }); </script> </div>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# Various grains; as expected most have little lysine. Buckwheat is surprisingly close to quinoa in composition.\n",
"compare_proteins(4496, 1464, 4436, 4485,4412, 4495)"
]
},
{
"cell_type": "code",
"execution_count": 67,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.plotly.v1+json": {
"config": {
"plotlyServerURL": "https://plot.ly"
},
"data": [
{
"alignmentgroup": "True",
"bingroup": "x",
"histfunc": "sum",
"hovertemplate": "FoodDescription=Beans, lima, dry, large, raw<br>NutrientName=%{x}<br>sum of EssentialRatio=%{y}<extra></extra>",
"legendgroup": "Beans, lima, dry, large, raw",
"marker": {
"color": "#636efa",
"pattern": {
"shape": ""
}
},
"name": "Beans, lima, dry, large, raw",
"offsetgroup": "Beans, lima, dry, large, raw",
"orientation": "v",
"showlegend": true,
"type": "histogram",
"x": [
"TRYPTOPHAN",
"THREONINE",
"ISOLEUCINE",
"LEUCINE",
"LYSINE",
"METHIONINE",
"PHENYLALANINE",
"HISTIDINE"
],
"xaxis": "x",
"y": [
0.032727741270454844,
0.11944337069965212,
0.14547094446591935,
0.23837134389898212,
0.18528540136580338,
0.034918180646823865,
0.15925782759953616,
0.08452519005282826
],
"yaxis": "y"
},
{
"alignmentgroup": "True",
"bingroup": "x",
"histfunc": "sum",
"hovertemplate": "FoodDescription=Soybeans, dry, raw<br>NutrientName=%{x}<br>sum of EssentialRatio=%{y}<extra></extra>",
"legendgroup": "Soybeans, dry, raw",
"marker": {
"color": "#EF553B",
"pattern": {
"shape": ""
}
},
"name": "Soybeans, dry, raw",
"offsetgroup": "Soybeans, dry, raw",
"orientation": "v",
"showlegend": true,
"type": "histogram",
"x": [
"TRYPTOPHAN",
"THREONINE",
"ISOLEUCINE",
"LEUCINE",
"LYSINE",
"METHIONINE",
"PHENYLALANINE",
"HISTIDINE"
],
"xaxis": "x",
"y": [
0.04188815649585371,
0.12516833227018215,
0.13969806506485222,
0.2345311503295769,
0.1917924728896449,
0.038769579700900135,
0.15040045361117016,
0.07775178963781983
],
"yaxis": "y"
},
{
"alignmentgroup": "True",
"bingroup": "x",
"histfunc": "sum",
"hovertemplate": "FoodDescription=Peanuts, all types, dry roasted<br>NutrientName=%{x}<br>sum of EssentialRatio=%{y}<extra></extra>",
"legendgroup": "Peanuts, all types, dry roasted",
"marker": {
"color": "#00cc96",
"pattern": {
"shape": ""
}
},
"name": "Peanuts, all types, dry roasted",
"offsetgroup": "Peanuts, all types, dry roasted",
"orientation": "v",
"showlegend": true,
"type": "histogram",
"x": [
"TRYPTOPHAN",
"THREONINE",
"ISOLEUCINE",
"LEUCINE",
"LYSINE",
"METHIONINE",
"PHENYLALANINE",
"HISTIDINE"
],
"xaxis": "x",
"y": [
0.03607277289836888,
0.12719573400250941,
0.1306461731493099,
0.24074654956085317,
0.13331242158092846,
0.04563989962358845,
0.19244040150564617,
0.09394604767879547
],
"yaxis": "y"
},
{
"alignmentgroup": "True",
"bingroup": "x",
"histfunc": "sum",
"hovertemplate": "FoodDescription=Lentils, raw<br>NutrientName=%{x}<br>sum of EssentialRatio=%{y}<extra></extra>",
"legendgroup": "Lentils, raw",
"marker": {
"color": "#ab63fa",
"pattern": {
"shape": ""
}
},
"name": "Lentils, raw",
"offsetgroup": "Lentils, raw",
"orientation": "v",
"showlegend": true,
"type": "histogram",
"x": [
"TRYPTOPHAN",
"THREONINE",
"ISOLEUCINE",
"LEUCINE",
"LYSINE",
"METHIONINE",
"PHENYLALANINE",
"HISTIDINE"
],
"xaxis": "x",
"y": [
0.028362422997946612,
0.11319301848049282,
0.13667864476386038,
0.2292094455852156,
0.22073921971252566,
0.026950718685831623,
0.15592915811088298,
0.08893737166324435
],
"yaxis": "y"
}
],
"layout": {
"barmode": "group",
"legend": {
"title": {
"text": "FoodDescription"
},
"tracegroupgap": 0
},
"template": {
"data": {
"bar": [
{
"error_x": {
"color": "#2a3f5f"
},
"error_y": {
"color": "#2a3f5f"
},
"marker": {
"line": {
"color": "#E5ECF6",
"width": 0.5
},
"pattern": {
"fillmode": "overlay",
"size": 10,
"solidity": 0.2
}
},
"type": "bar"
}
],
"barpolar": [
{
"marker": {
"line": {
"color": "#E5ECF6",
"width": 0.5
},
"pattern": {
"fillmode": "overlay",
"size": 10,
"solidity": 0.2
}
},
"type": "barpolar"
}
],
"carpet": [
{
"aaxis": {
"endlinecolor": "#2a3f5f",
"gridcolor": "white",
"linecolor": "white",
"minorgridcolor": "white",
"startlinecolor": "#2a3f5f"
},
"baxis": {
"endlinecolor": "#2a3f5f",
"gridcolor": "white",
"linecolor": "white",
"minorgridcolor": "white",
"startlinecolor": "#2a3f5f"
},
"type": "carpet"
}
],
"choropleth": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"type": "choropleth"
}
],
"contour": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"colorscale": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
],
"type": "contour"
}
],
"contourcarpet": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"type": "contourcarpet"
}
],
"heatmap": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"colorscale": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
],
"type": "heatmap"
}
],
"heatmapgl": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"colorscale": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
],
"type": "heatmapgl"
}
],
"histogram": [
{
"marker": {
"pattern": {
"fillmode": "overlay",
"size": 10,
"solidity": 0.2
}
},
"type": "histogram"
}
],
"histogram2d": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"colorscale": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
],
"type": "histogram2d"
}
],
"histogram2dcontour": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"colorscale": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
],
"type": "histogram2dcontour"
}
],
"mesh3d": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"type": "mesh3d"
}
],
"parcoords": [
{
"line": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "parcoords"
}
],
"pie": [
{
"automargin": true,
"type": "pie"
}
],
"scatter": [
{
"fillpattern": {
"fillmode": "overlay",
"size": 10,
"solidity": 0.2
},
"type": "scatter"
}
],
"scatter3d": [
{
"line": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scatter3d"
}
],
"scattercarpet": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scattercarpet"
}
],
"scattergeo": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scattergeo"
}
],
"scattergl": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scattergl"
}
],
"scattermapbox": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scattermapbox"
}
],
"scatterpolar": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scatterpolar"
}
],
"scatterpolargl": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scatterpolargl"
}
],
"scatterternary": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scatterternary"
}
],
"surface": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"colorscale": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
],
"type": "surface"
}
],
"table": [
{
"cells": {
"fill": {
"color": "#EBF0F8"
},
"line": {
"color": "white"
}
},
"header": {
"fill": {
"color": "#C8D4E3"
},
"line": {
"color": "white"
}
},
"type": "table"
}
]
},
"layout": {
"annotationdefaults": {
"arrowcolor": "#2a3f5f",
"arrowhead": 0,
"arrowwidth": 1
},
"autotypenumbers": "strict",
"coloraxis": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"colorscale": {
"diverging": [
[
0,
"#8e0152"
],
[
0.1,
"#c51b7d"
],
[
0.2,
"#de77ae"
],
[
0.3,
"#f1b6da"
],
[
0.4,
"#fde0ef"
],
[
0.5,
"#f7f7f7"
],
[
0.6,
"#e6f5d0"
],
[
0.7,
"#b8e186"
],
[
0.8,
"#7fbc41"
],
[
0.9,
"#4d9221"
],
[
1,
"#276419"
]
],
"sequential": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
],
"sequentialminus": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
]
},
"colorway": [
"#636efa",
"#EF553B",
"#00cc96",
"#ab63fa",
"#FFA15A",
"#19d3f3",
"#FF6692",
"#B6E880",
"#FF97FF",
"#FECB52"
],
"font": {
"color": "#2a3f5f"
},
"geo": {
"bgcolor": "white",
"lakecolor": "white",
"landcolor": "#E5ECF6",
"showlakes": true,
"showland": true,
"subunitcolor": "white"
},
"hoverlabel": {
"align": "left"
},
"hovermode": "closest",
"mapbox": {
"style": "light"
},
"paper_bgcolor": "white",
"plot_bgcolor": "#E5ECF6",
"polar": {
"angularaxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
},
"bgcolor": "#E5ECF6",
"radialaxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
}
},
"scene": {
"xaxis": {
"backgroundcolor": "#E5ECF6",
"gridcolor": "white",
"gridwidth": 2,
"linecolor": "white",
"showbackground": true,
"ticks": "",
"zerolinecolor": "white"
},
"yaxis": {
"backgroundcolor": "#E5ECF6",
"gridcolor": "white",
"gridwidth": 2,
"linecolor": "white",
"showbackground": true,
"ticks": "",
"zerolinecolor": "white"
},
"zaxis": {
"backgroundcolor": "#E5ECF6",
"gridcolor": "white",
"gridwidth": 2,
"linecolor": "white",
"showbackground": true,
"ticks": "",
"zerolinecolor": "white"
}
},
"shapedefaults": {
"line": {
"color": "#2a3f5f"
}
},
"ternary": {
"aaxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
},
"baxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
},
"bgcolor": "#E5ECF6",
"caxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
}
},
"title": {
"x": 0.05
},
"xaxis": {
"automargin": true,
"gridcolor": "white",
"linecolor": "white",
"ticks": "",
"title": {
"standoff": 15
},
"zerolinecolor": "white",
"zerolinewidth": 2
},
"yaxis": {
"automargin": true,
"gridcolor": "white",
"linecolor": "white",
"ticks": "",
"title": {
"standoff": 15
},
"zerolinecolor": "white",
"zerolinewidth": 2
}
}
},
"title": {
"text": "Essential Ratio Comparison"
},
"xaxis": {
"anchor": "y",
"domain": [
0,
1
],
"title": {
"text": "NutrientName"
}
},
"yaxis": {
"anchor": "x",
"domain": [
0,
1
],
"title": {
"text": "sum of EssentialRatio"
}
}
}
},
"text/html": [
"<div> <div id=\"2ba812f5-8bf1-4510-86b1-ad08caadf142\" class=\"plotly-graph-div\" style=\"height:525px; width:100%;\"></div> <script type=\"text/javascript\"> require([\"plotly\"], function(Plotly) { window.PLOTLYENV=window.PLOTLYENV || {}; if (document.getElementById(\"2ba812f5-8bf1-4510-86b1-ad08caadf142\")) { Plotly.newPlot( \"2ba812f5-8bf1-4510-86b1-ad08caadf142\", [{\"alignmentgroup\":\"True\",\"bingroup\":\"x\",\"histfunc\":\"sum\",\"hovertemplate\":\"FoodDescription=Beans, lima, dry, large, raw\\u003cbr\\u003eNutrientName=%{x}\\u003cbr\\u003esum of EssentialRatio=%{y}\\u003cextra\\u003e\\u003c\\u002fextra\\u003e\",\"legendgroup\":\"Beans, lima, dry, large, raw\",\"marker\":{\"color\":\"#636efa\",\"pattern\":{\"shape\":\"\"}},\"name\":\"Beans, lima, dry, large, raw\",\"offsetgroup\":\"Beans, lima, dry, large, raw\",\"orientation\":\"v\",\"showlegend\":true,\"x\":[\"TRYPTOPHAN\",\"THREONINE\",\"ISOLEUCINE\",\"LEUCINE\",\"LYSINE\",\"METHIONINE\",\"PHENYLALANINE\",\"HISTIDINE\"],\"xaxis\":\"x\",\"y\":[0.032727741270454844,0.11944337069965212,0.14547094446591935,0.23837134389898212,0.18528540136580338,0.034918180646823865,0.15925782759953616,0.08452519005282826],\"yaxis\":\"y\",\"type\":\"histogram\"},{\"alignmentgroup\":\"True\",\"bingroup\":\"x\",\"histfunc\":\"sum\",\"hovertemplate\":\"FoodDescription=Soybeans, dry, raw\\u003cbr\\u003eNutrientName=%{x}\\u003cbr\\u003esum of EssentialRatio=%{y}\\u003cextra\\u003e\\u003c\\u002fextra\\u003e\",\"legendgroup\":\"Soybeans, dry, raw\",\"marker\":{\"color\":\"#EF553B\",\"pattern\":{\"shape\":\"\"}},\"name\":\"Soybeans, dry, raw\",\"offsetgroup\":\"Soybeans, dry, raw\",\"orientation\":\"v\",\"showlegend\":true,\"x\":[\"TRYPTOPHAN\",\"THREONINE\",\"ISOLEUCINE\",\"LEUCINE\",\"LYSINE\",\"METHIONINE\",\"PHENYLALANINE\",\"HISTIDINE\"],\"xaxis\":\"x\",\"y\":[0.04188815649585371,0.12516833227018215,0.13969806506485222,0.2345311503295769,0.1917924728896449,0.038769579700900135,0.15040045361117016,0.07775178963781983],\"yaxis\":\"y\",\"type\":\"histogram\"},{\"alignmentgroup\":\"True\",\"bingroup\":\"x\",\"histfunc\":\"sum\",\"hovertemplate\":\"FoodDescription=Peanuts, all types, dry roasted\\u003cbr\\u003eNutrientName=%{x}\\u003cbr\\u003esum of EssentialRatio=%{y}\\u003cextra\\u003e\\u003c\\u002fextra\\u003e\",\"legendgroup\":\"Peanuts, all types, dry roasted\",\"marker\":{\"color\":\"#00cc96\",\"pattern\":{\"shape\":\"\"}},\"name\":\"Peanuts, all types, dry roasted\",\"offsetgroup\":\"Peanuts, all types, dry roasted\",\"orientation\":\"v\",\"showlegend\":true,\"x\":[\"TRYPTOPHAN\",\"THREONINE\",\"ISOLEUCINE\",\"LEUCINE\",\"LYSINE\",\"METHIONINE\",\"PHENYLALANINE\",\"HISTIDINE\"],\"xaxis\":\"x\",\"y\":[0.03607277289836888,0.12719573400250941,0.1306461731493099,0.24074654956085317,0.13331242158092846,0.04563989962358845,0.19244040150564617,0.09394604767879547],\"yaxis\":\"y\",\"type\":\"histogram\"},{\"alignmentgroup\":\"True\",\"bingroup\":\"x\",\"histfunc\":\"sum\",\"hovertemplate\":\"FoodDescription=Lentils, raw\\u003cbr\\u003eNutrientName=%{x}\\u003cbr\\u003esum of EssentialRatio=%{y}\\u003cextra\\u003e\\u003c\\u002fextra\\u003e\",\"legendgroup\":\"Lentils, raw\",\"marker\":{\"color\":\"#ab63fa\",\"pattern\":{\"shape\":\"\"}},\"name\":\"Lentils, raw\",\"offsetgroup\":\"Lentils, raw\",\"orientation\":\"v\",\"showlegend\":true,\"x\":[\"TRYPTOPHAN\",\"THREONINE\",\"ISOLEUCINE\",\"LEUCINE\",\"LYSINE\",\"METHIONINE\",\"PHENYLALANINE\",\"HISTIDINE\"],\"xaxis\":\"x\",\"y\":[0.028362422997946612,0.11319301848049282,0.13667864476386038,0.2292094455852156,0.22073921971252566,0.026950718685831623,0.15592915811088298,0.08893737166324435],\"yaxis\":\"y\",\"type\":\"histogram\"}], {\"template\":{\"data\":{\"histogram2dcontour\":[{\"type\":\"histogram2dcontour\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"choropleth\":[{\"type\":\"choropleth\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}],\"histogram2d\":[{\"type\":\"histogram2d\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"heatmap\":[{\"type\":\"heatmap\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"heatmapgl\":[{\"type\":\"heatmapgl\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"contourcarpet\":[{\"type\":\"contourcarpet\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}],\"contour\":[{\"type\":\"contour\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"surface\":[{\"type\":\"surface\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"mesh3d\":[{\"type\":\"mesh3d\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}],\"scatter\":[{\"fillpattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2},\"type\":\"scatter\"}],\"parcoords\":[{\"type\":\"parcoords\",\"line\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scatterpolargl\":[{\"type\":\"scatterpolargl\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"bar\":[{\"error_x\":{\"color\":\"#2a3f5f\"},\"error_y\":{\"color\":\"#2a3f5f\"},\"marker\":{\"line\":{\"color\":\"#E5ECF6\",\"width\":0.5},\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"type\":\"bar\"}],\"scattergeo\":[{\"type\":\"scattergeo\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scatterpolar\":[{\"type\":\"scatterpolar\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"histogram\":[{\"marker\":{\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"type\":\"histogram\"}],\"scattergl\":[{\"type\":\"scattergl\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scatter3d\":[{\"type\":\"scatter3d\",\"line\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}},\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scattermapbox\":[{\"type\":\"scattermapbox\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scatterternary\":[{\"type\":\"scatterternary\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scattercarpet\":[{\"type\":\"scattercarpet\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"carpet\":[{\"aaxis\":{\"endlinecolor\":\"#2a3f5f\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"minorgridcolor\":\"white\",\"startlinecolor\":\"#2a3f5f\"},\"baxis\":{\"endlinecolor\":\"#2a3f5f\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"minorgridcolor\":\"white\",\"startlinecolor\":\"#2a3f5f\"},\"type\":\"carpet\"}],\"table\":[{\"cells\":{\"fill\":{\"color\":\"#EBF0F8\"},\"line\":{\"color\":\"white\"}},\"header\":{\"fill\":{\"color\":\"#C8D4E3\"},\"line\":{\"color\":\"white\"}},\"type\":\"table\"}],\"barpolar\":[{\"marker\":{\"line\":{\"color\":\"#E5ECF6\",\"width\":0.5},\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"type\":\"barpolar\"}],\"pie\":[{\"automargin\":true,\"type\":\"pie\"}]},\"layout\":{\"autotypenumbers\":\"strict\",\"colorway\":[\"#636efa\",\"#EF553B\",\"#00cc96\",\"#ab63fa\",\"#FFA15A\",\"#19d3f3\",\"#FF6692\",\"#B6E880\",\"#FF97FF\",\"#FECB52\"],\"font\":{\"color\":\"#2a3f5f\"},\"hovermode\":\"closest\",\"hoverlabel\":{\"align\":\"left\"},\"paper_bgcolor\":\"white\",\"plot_bgcolor\":\"#E5ECF6\",\"polar\":{\"bgcolor\":\"#E5ECF6\",\"angularaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\"},\"radialaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\"}},\"ternary\":{\"bgcolor\":\"#E5ECF6\",\"aaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\"},\"baxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\"},\"caxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\"}},\"coloraxis\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}},\"colorscale\":{\"sequential\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]],\"sequentialminus\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]],\"diverging\":[[0,\"#8e0152\"],[0.1,\"#c51b7d\"],[0.2,\"#de77ae\"],[0.3,\"#f1b6da\"],[0.4,\"#fde0ef\"],[0.5,\"#f7f7f7\"],[0.6,\"#e6f5d0\"],[0.7,\"#b8e186\"],[0.8,\"#7fbc41\"],[0.9,\"#4d9221\"],[1,\"#276419\"]]},\"xaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\",\"title\":{\"standoff\":15},\"zerolinecolor\":\"white\",\"automargin\":true,\"zerolinewidth\":2},\"yaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\",\"title\":{\"standoff\":15},\"zerolinecolor\":\"white\",\"automargin\":true,\"zerolinewidth\":2},\"scene\":{\"xaxis\":{\"backgroundcolor\":\"#E5ECF6\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showbackground\":true,\"ticks\":\"\",\"zerolinecolor\":\"white\",\"gridwidth\":2},\"yaxis\":{\"backgroundcolor\":\"#E5ECF6\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showbackground\":true,\"ticks\":\"\",\"zerolinecolor\":\"white\",\"gridwidth\":2},\"zaxis\":{\"backgroundcolor\":\"#E5ECF6\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showbackground\":true,\"ticks\":\"\",\"zerolinecolor\":\"white\",\"gridwidth\":2}},\"shapedefaults\":{\"line\":{\"color\":\"#2a3f5f\"}},\"annotationdefaults\":{\"arrowcolor\":\"#2a3f5f\",\"arrowhead\":0,\"arrowwidth\":1},\"geo\":{\"bgcolor\":\"white\",\"landcolor\":\"#E5ECF6\",\"subunitcolor\":\"white\",\"showland\":true,\"showlakes\":true,\"lakecolor\":\"white\"},\"title\":{\"x\":0.05},\"mapbox\":{\"style\":\"light\"}}},\"xaxis\":{\"anchor\":\"y\",\"domain\":[0.0,1.0],\"title\":{\"text\":\"NutrientName\"}},\"yaxis\":{\"anchor\":\"x\",\"domain\":[0.0,1.0],\"title\":{\"text\":\"sum of EssentialRatio\"}},\"legend\":{\"title\":{\"text\":\"FoodDescription\"},\"tracegroupgap\":0},\"title\":{\"text\":\"Essential Ratio Comparison\"},\"barmode\":\"group\"}, {\"responsive\": true} ).then(function(){\n",
" \n",
"var gd = document.getElementById('2ba812f5-8bf1-4510-86b1-ad08caadf142');\n",
"var x = new MutationObserver(function (mutations, observer) {{\n",
" var display = window.getComputedStyle(gd).display;\n",
" if (!display || display === 'none') {{\n",
" console.log([gd, 'removed!']);\n",
" Plotly.purge(gd);\n",
" observer.disconnect();\n",
" }}\n",
"}});\n",
"\n",
"// Listen for the removal of the full notebook cells\n",
"var notebookContainer = gd.closest('#notebook-container');\n",
"if (notebookContainer) {{\n",
" x.observe(notebookContainer, {childList: true});\n",
"}}\n",
"\n",
"// Listen for the clearing of the current output cell\n",
"var outputEl = gd.closest('.output');\n",
"if (outputEl) {{\n",
" x.observe(outputEl, {childList: true});\n",
"}}\n",
"\n",
" }) }; }); </script> </div>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# Legumes - lentils are particularly high in lysine for a plant-based source\n",
"compare_proteins(3288, 3400, 3362, 3392)"
]
},
{
"cell_type": "code",
"execution_count": 68,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.plotly.v1+json": {
"config": {
"plotlyServerURL": "https://plot.ly"
},
"data": [
{
"alignmentgroup": "True",
"bingroup": "x",
"histfunc": "sum",
"hovertemplate": "FoodDescription=Pork, ground, lean, raw<br>NutrientName=%{x}<br>sum of EssentialRatio=%{y}<extra></extra>",
"legendgroup": "Pork, ground, lean, raw",
"marker": {
"color": "#636efa",
"pattern": {
"shape": ""
}
},
"name": "Pork, ground, lean, raw",
"offsetgroup": "Pork, ground, lean, raw",
"orientation": "v",
"showlegend": true,
"type": "histogram",
"x": [
"TRYPTOPHAN",
"THREONINE",
"ISOLEUCINE",
"LEUCINE",
"LYSINE",
"METHIONINE",
"PHENYLALANINE",
"HISTIDINE"
],
"xaxis": "x",
"y": [
0.03322212955240478,
0.11968306922435362,
0.12260216847372811,
0.21017514595496248,
0.23561301084236866,
0.06936335835418404,
0.10467055879899917,
0.10467055879899917
],
"yaxis": "y"
},
{
"alignmentgroup": "True",
"bingroup": "x",
"histfunc": "sum",
"hovertemplate": "FoodDescription=Egg, chicken, whole, fresh or frozen, raw<br>NutrientName=%{x}<br>sum of EssentialRatio=%{y}<extra></extra>",
"legendgroup": "Egg, chicken, whole, fresh or frozen, raw",
"marker": {
"color": "#EF553B",
"pattern": {
"shape": ""
}
},
"name": "Egg, chicken, whole, fresh or frozen, raw",
"offsetgroup": "Egg, chicken, whole, fresh or frozen, raw",
"orientation": "v",
"showlegend": true,
"type": "histogram",
"x": [
"TRYPTOPHAN",
"THREONINE",
"ISOLEUCINE",
"LEUCINE",
"LYSINE",
"METHIONINE",
"PHENYLALANINE",
"HISTIDINE"
],
"xaxis": "x",
"y": [
0.03510733452593917,
0.11672629695885509,
0.14087656529516993,
0.22808586762075134,
0.19163685152057242,
0.07983005366726297,
0.1428890876565295,
0.0648479427549195
],
"yaxis": "y"
},
{
"alignmentgroup": "True",
"bingroup": "x",
"histfunc": "sum",
"hovertemplate": "FoodDescription=Fish, salmon, pink (humpback), raw<br>NutrientName=%{x}<br>sum of EssentialRatio=%{y}<extra></extra>",
"legendgroup": "Fish, salmon, pink (humpback), raw",
"marker": {
"color": "#00cc96",
"pattern": {
"shape": ""
}
},
"name": "Fish, salmon, pink (humpback), raw",
"offsetgroup": "Fish, salmon, pink (humpback), raw",
"orientation": "v",
"showlegend": true,
"type": "histogram",
"x": [
"TRYPTOPHAN",
"THREONINE",
"ISOLEUCINE",
"LEUCINE",
"LYSINE",
"METHIONINE",
"PHENYLALANINE",
"HISTIDINE"
],
"xaxis": "x",
"y": [
0.029360967184801384,
0.14162348877374786,
0.1267437225986449,
0.20751959612063242,
0.23369204198219742,
0.07665736681280723,
0.11226252158894647,
0.07214029493822241
],
"yaxis": "y"
},
{
"alignmentgroup": "True",
"bingroup": "x",
"histfunc": "sum",
"hovertemplate": "FoodDescription=Chicken, broiler, breast, meat and skin, raw<br>NutrientName=%{x}<br>sum of EssentialRatio=%{y}<extra></extra>",
"legendgroup": "Chicken, broiler, breast, meat and skin, raw",
"marker": {
"color": "#ab63fa",
"pattern": {
"shape": ""
}
},
"name": "Chicken, broiler, breast, meat and skin, raw",
"offsetgroup": "Chicken, broiler, breast, meat and skin, raw",
"orientation": "v",
"showlegend": true,
"type": "histogram",
"x": [
"TRYPTOPHAN",
"THREONINE",
"ISOLEUCINE",
"LEUCINE",
"LYSINE",
"METHIONINE",
"PHENYLALANINE",
"HISTIDINE"
],
"xaxis": "x",
"y": [
0.031889128094725515,
0.11692680301399357,
0.14303013993541444,
0.20640473627556516,
0.23210441334768575,
0.07575349838536061,
0.10979547900968785,
0.08409580193756729
],
"yaxis": "y"
},
{
"alignmentgroup": "True",
"bingroup": "x",
"histfunc": "sum",
"hovertemplate": "FoodDescription=Cheese, cottage, creamed (4.5% M.F.)<br>NutrientName=%{x}<br>sum of EssentialRatio=%{y}<extra></extra>",
"legendgroup": "Cheese, cottage, creamed (4.5% M.F.)",
"marker": {
"color": "#FFA15A",
"pattern": {
"shape": ""
}
},
"name": "Cheese, cottage, creamed (4.5% M.F.)",
"offsetgroup": "Cheese, cottage, creamed (4.5% M.F.)",
"orientation": "v",
"showlegend": true,
"type": "histogram",
"x": [
"TRYPTOPHAN",
"THREONINE",
"ISOLEUCINE",
"LEUCINE",
"LYSINE",
"METHIONINE",
"PHENYLALANINE",
"HISTIDINE"
],
"xaxis": "x",
"y": [
0.03295964125560538,
0.11210762331838565,
0.13251121076233183,
0.2502242152466368,
0.20941704035874442,
0.060313901345291486,
0.12937219730941704,
0.07309417040358744
],
"yaxis": "y"
},
{
"alignmentgroup": "True",
"bingroup": "x",
"histfunc": "sum",
"hovertemplate": "FoodDescription=Milk, fluid, partly skimmed, 2% M.F.<br>NutrientName=%{x}<br>sum of EssentialRatio=%{y}<extra></extra>",
"legendgroup": "Milk, fluid, partly skimmed, 2% M.F.",
"marker": {
"color": "#19d3f3",
"pattern": {
"shape": ""
}
},
"name": "Milk, fluid, partly skimmed, 2% M.F.",
"offsetgroup": "Milk, fluid, partly skimmed, 2% M.F.",
"orientation": "v",
"showlegend": true,
"type": "histogram",
"x": [
"TRYPTOPHAN",
"THREONINE",
"ISOLEUCINE",
"LEUCINE",
"LYSINE",
"METHIONINE",
"PHENYLALANINE",
"HISTIDINE"
],
"xaxis": "x",
"y": [
0.03228285933897002,
0.10837817063797077,
0.13143735588009223,
0.24058416602613372,
0.2121445042275173,
0.06687163720215218,
0.13143735588009223,
0.07686395080707148
],
"yaxis": "y"
}
],
"layout": {
"barmode": "group",
"legend": {
"title": {
"text": "FoodDescription"
},
"tracegroupgap": 0
},
"template": {
"data": {
"bar": [
{
"error_x": {
"color": "#2a3f5f"
},
"error_y": {
"color": "#2a3f5f"
},
"marker": {
"line": {
"color": "#E5ECF6",
"width": 0.5
},
"pattern": {
"fillmode": "overlay",
"size": 10,
"solidity": 0.2
}
},
"type": "bar"
}
],
"barpolar": [
{
"marker": {
"line": {
"color": "#E5ECF6",
"width": 0.5
},
"pattern": {
"fillmode": "overlay",
"size": 10,
"solidity": 0.2
}
},
"type": "barpolar"
}
],
"carpet": [
{
"aaxis": {
"endlinecolor": "#2a3f5f",
"gridcolor": "white",
"linecolor": "white",
"minorgridcolor": "white",
"startlinecolor": "#2a3f5f"
},
"baxis": {
"endlinecolor": "#2a3f5f",
"gridcolor": "white",
"linecolor": "white",
"minorgridcolor": "white",
"startlinecolor": "#2a3f5f"
},
"type": "carpet"
}
],
"choropleth": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"type": "choropleth"
}
],
"contour": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"colorscale": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
],
"type": "contour"
}
],
"contourcarpet": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"type": "contourcarpet"
}
],
"heatmap": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"colorscale": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
],
"type": "heatmap"
}
],
"heatmapgl": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"colorscale": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
],
"type": "heatmapgl"
}
],
"histogram": [
{
"marker": {
"pattern": {
"fillmode": "overlay",
"size": 10,
"solidity": 0.2
}
},
"type": "histogram"
}
],
"histogram2d": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"colorscale": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
],
"type": "histogram2d"
}
],
"histogram2dcontour": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"colorscale": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
],
"type": "histogram2dcontour"
}
],
"mesh3d": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"type": "mesh3d"
}
],
"parcoords": [
{
"line": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "parcoords"
}
],
"pie": [
{
"automargin": true,
"type": "pie"
}
],
"scatter": [
{
"fillpattern": {
"fillmode": "overlay",
"size": 10,
"solidity": 0.2
},
"type": "scatter"
}
],
"scatter3d": [
{
"line": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scatter3d"
}
],
"scattercarpet": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scattercarpet"
}
],
"scattergeo": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scattergeo"
}
],
"scattergl": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scattergl"
}
],
"scattermapbox": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scattermapbox"
}
],
"scatterpolar": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scatterpolar"
}
],
"scatterpolargl": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scatterpolargl"
}
],
"scatterternary": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scatterternary"
}
],
"surface": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"colorscale": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
],
"type": "surface"
}
],
"table": [
{
"cells": {
"fill": {
"color": "#EBF0F8"
},
"line": {
"color": "white"
}
},
"header": {
"fill": {
"color": "#C8D4E3"
},
"line": {
"color": "white"
}
},
"type": "table"
}
]
},
"layout": {
"annotationdefaults": {
"arrowcolor": "#2a3f5f",
"arrowhead": 0,
"arrowwidth": 1
},
"autotypenumbers": "strict",
"coloraxis": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"colorscale": {
"diverging": [
[
0,
"#8e0152"
],
[
0.1,
"#c51b7d"
],
[
0.2,
"#de77ae"
],
[
0.3,
"#f1b6da"
],
[
0.4,
"#fde0ef"
],
[
0.5,
"#f7f7f7"
],
[
0.6,
"#e6f5d0"
],
[
0.7,
"#b8e186"
],
[
0.8,
"#7fbc41"
],
[
0.9,
"#4d9221"
],
[
1,
"#276419"
]
],
"sequential": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
],
"sequentialminus": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
]
},
"colorway": [
"#636efa",
"#EF553B",
"#00cc96",
"#ab63fa",
"#FFA15A",
"#19d3f3",
"#FF6692",
"#B6E880",
"#FF97FF",
"#FECB52"
],
"font": {
"color": "#2a3f5f"
},
"geo": {
"bgcolor": "white",
"lakecolor": "white",
"landcolor": "#E5ECF6",
"showlakes": true,
"showland": true,
"subunitcolor": "white"
},
"hoverlabel": {
"align": "left"
},
"hovermode": "closest",
"mapbox": {
"style": "light"
},
"paper_bgcolor": "white",
"plot_bgcolor": "#E5ECF6",
"polar": {
"angularaxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
},
"bgcolor": "#E5ECF6",
"radialaxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
}
},
"scene": {
"xaxis": {
"backgroundcolor": "#E5ECF6",
"gridcolor": "white",
"gridwidth": 2,
"linecolor": "white",
"showbackground": true,
"ticks": "",
"zerolinecolor": "white"
},
"yaxis": {
"backgroundcolor": "#E5ECF6",
"gridcolor": "white",
"gridwidth": 2,
"linecolor": "white",
"showbackground": true,
"ticks": "",
"zerolinecolor": "white"
},
"zaxis": {
"backgroundcolor": "#E5ECF6",
"gridcolor": "white",
"gridwidth": 2,
"linecolor": "white",
"showbackground": true,
"ticks": "",
"zerolinecolor": "white"
}
},
"shapedefaults": {
"line": {
"color": "#2a3f5f"
}
},
"ternary": {
"aaxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
},
"baxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
},
"bgcolor": "#E5ECF6",
"caxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
}
},
"title": {
"x": 0.05
},
"xaxis": {
"automargin": true,
"gridcolor": "white",
"linecolor": "white",
"ticks": "",
"title": {
"standoff": 15
},
"zerolinecolor": "white",
"zerolinewidth": 2
},
"yaxis": {
"automargin": true,
"gridcolor": "white",
"linecolor": "white",
"ticks": "",
"title": {
"standoff": 15
},
"zerolinecolor": "white",
"zerolinewidth": 2
}
}
},
"title": {
"text": "Essential Ratio Comparison"
},
"xaxis": {
"anchor": "y",
"domain": [
0,
1
],
"title": {
"text": "NutrientName"
}
},
"yaxis": {
"anchor": "x",
"domain": [
0,
1
],
"title": {
"text": "sum of EssentialRatio"
}
}
}
},
"text/html": [
"<div> <div id=\"b05dcd7f-bd7e-4333-84b9-bd449d876e1d\" class=\"plotly-graph-div\" style=\"height:525px; width:100%;\"></div> <script type=\"text/javascript\"> require([\"plotly\"], function(Plotly) { window.PLOTLYENV=window.PLOTLYENV || {}; if (document.getElementById(\"b05dcd7f-bd7e-4333-84b9-bd449d876e1d\")) { Plotly.newPlot( \"b05dcd7f-bd7e-4333-84b9-bd449d876e1d\", [{\"alignmentgroup\":\"True\",\"bingroup\":\"x\",\"histfunc\":\"sum\",\"hovertemplate\":\"FoodDescription=Pork, ground, lean, raw\\u003cbr\\u003eNutrientName=%{x}\\u003cbr\\u003esum of EssentialRatio=%{y}\\u003cextra\\u003e\\u003c\\u002fextra\\u003e\",\"legendgroup\":\"Pork, ground, lean, raw\",\"marker\":{\"color\":\"#636efa\",\"pattern\":{\"shape\":\"\"}},\"name\":\"Pork, ground, lean, raw\",\"offsetgroup\":\"Pork, ground, lean, raw\",\"orientation\":\"v\",\"showlegend\":true,\"x\":[\"TRYPTOPHAN\",\"THREONINE\",\"ISOLEUCINE\",\"LEUCINE\",\"LYSINE\",\"METHIONINE\",\"PHENYLALANINE\",\"HISTIDINE\"],\"xaxis\":\"x\",\"y\":[0.03322212955240478,0.11968306922435362,0.12260216847372811,0.21017514595496248,0.23561301084236866,0.06936335835418404,0.10467055879899917,0.10467055879899917],\"yaxis\":\"y\",\"type\":\"histogram\"},{\"alignmentgroup\":\"True\",\"bingroup\":\"x\",\"histfunc\":\"sum\",\"hovertemplate\":\"FoodDescription=Egg, chicken, whole, fresh or frozen, raw\\u003cbr\\u003eNutrientName=%{x}\\u003cbr\\u003esum of EssentialRatio=%{y}\\u003cextra\\u003e\\u003c\\u002fextra\\u003e\",\"legendgroup\":\"Egg, chicken, whole, fresh or frozen, raw\",\"marker\":{\"color\":\"#EF553B\",\"pattern\":{\"shape\":\"\"}},\"name\":\"Egg, chicken, whole, fresh or frozen, raw\",\"offsetgroup\":\"Egg, chicken, whole, fresh or frozen, raw\",\"orientation\":\"v\",\"showlegend\":true,\"x\":[\"TRYPTOPHAN\",\"THREONINE\",\"ISOLEUCINE\",\"LEUCINE\",\"LYSINE\",\"METHIONINE\",\"PHENYLALANINE\",\"HISTIDINE\"],\"xaxis\":\"x\",\"y\":[0.03510733452593917,0.11672629695885509,0.14087656529516993,0.22808586762075134,0.19163685152057242,0.07983005366726297,0.1428890876565295,0.0648479427549195],\"yaxis\":\"y\",\"type\":\"histogram\"},{\"alignmentgroup\":\"True\",\"bingroup\":\"x\",\"histfunc\":\"sum\",\"hovertemplate\":\"FoodDescription=Fish, salmon, pink (humpback), raw\\u003cbr\\u003eNutrientName=%{x}\\u003cbr\\u003esum of EssentialRatio=%{y}\\u003cextra\\u003e\\u003c\\u002fextra\\u003e\",\"legendgroup\":\"Fish, salmon, pink (humpback), raw\",\"marker\":{\"color\":\"#00cc96\",\"pattern\":{\"shape\":\"\"}},\"name\":\"Fish, salmon, pink (humpback), raw\",\"offsetgroup\":\"Fish, salmon, pink (humpback), raw\",\"orientation\":\"v\",\"showlegend\":true,\"x\":[\"TRYPTOPHAN\",\"THREONINE\",\"ISOLEUCINE\",\"LEUCINE\",\"LYSINE\",\"METHIONINE\",\"PHENYLALANINE\",\"HISTIDINE\"],\"xaxis\":\"x\",\"y\":[0.029360967184801384,0.14162348877374786,0.1267437225986449,0.20751959612063242,0.23369204198219742,0.07665736681280723,0.11226252158894647,0.07214029493822241],\"yaxis\":\"y\",\"type\":\"histogram\"},{\"alignmentgroup\":\"True\",\"bingroup\":\"x\",\"histfunc\":\"sum\",\"hovertemplate\":\"FoodDescription=Chicken, broiler, breast, meat and skin, raw\\u003cbr\\u003eNutrientName=%{x}\\u003cbr\\u003esum of EssentialRatio=%{y}\\u003cextra\\u003e\\u003c\\u002fextra\\u003e\",\"legendgroup\":\"Chicken, broiler, breast, meat and skin, raw\",\"marker\":{\"color\":\"#ab63fa\",\"pattern\":{\"shape\":\"\"}},\"name\":\"Chicken, broiler, breast, meat and skin, raw\",\"offsetgroup\":\"Chicken, broiler, breast, meat and skin, raw\",\"orientation\":\"v\",\"showlegend\":true,\"x\":[\"TRYPTOPHAN\",\"THREONINE\",\"ISOLEUCINE\",\"LEUCINE\",\"LYSINE\",\"METHIONINE\",\"PHENYLALANINE\",\"HISTIDINE\"],\"xaxis\":\"x\",\"y\":[0.031889128094725515,0.11692680301399357,0.14303013993541444,0.20640473627556516,0.23210441334768575,0.07575349838536061,0.10979547900968785,0.08409580193756729],\"yaxis\":\"y\",\"type\":\"histogram\"},{\"alignmentgroup\":\"True\",\"bingroup\":\"x\",\"histfunc\":\"sum\",\"hovertemplate\":\"FoodDescription=Cheese, cottage, creamed (4.5% M.F.)\\u003cbr\\u003eNutrientName=%{x}\\u003cbr\\u003esum of EssentialRatio=%{y}\\u003cextra\\u003e\\u003c\\u002fextra\\u003e\",\"legendgroup\":\"Cheese, cottage, creamed (4.5% M.F.)\",\"marker\":{\"color\":\"#FFA15A\",\"pattern\":{\"shape\":\"\"}},\"name\":\"Cheese, cottage, creamed (4.5% M.F.)\",\"offsetgroup\":\"Cheese, cottage, creamed (4.5% M.F.)\",\"orientation\":\"v\",\"showlegend\":true,\"x\":[\"TRYPTOPHAN\",\"THREONINE\",\"ISOLEUCINE\",\"LEUCINE\",\"LYSINE\",\"METHIONINE\",\"PHENYLALANINE\",\"HISTIDINE\"],\"xaxis\":\"x\",\"y\":[0.03295964125560538,0.11210762331838565,0.13251121076233183,0.2502242152466368,0.20941704035874442,0.060313901345291486,0.12937219730941704,0.07309417040358744],\"yaxis\":\"y\",\"type\":\"histogram\"},{\"alignmentgroup\":\"True\",\"bingroup\":\"x\",\"histfunc\":\"sum\",\"hovertemplate\":\"FoodDescription=Milk, fluid, partly skimmed, 2% M.F.\\u003cbr\\u003eNutrientName=%{x}\\u003cbr\\u003esum of EssentialRatio=%{y}\\u003cextra\\u003e\\u003c\\u002fextra\\u003e\",\"legendgroup\":\"Milk, fluid, partly skimmed, 2% M.F.\",\"marker\":{\"color\":\"#19d3f3\",\"pattern\":{\"shape\":\"\"}},\"name\":\"Milk, fluid, partly skimmed, 2% M.F.\",\"offsetgroup\":\"Milk, fluid, partly skimmed, 2% M.F.\",\"orientation\":\"v\",\"showlegend\":true,\"x\":[\"TRYPTOPHAN\",\"THREONINE\",\"ISOLEUCINE\",\"LEUCINE\",\"LYSINE\",\"METHIONINE\",\"PHENYLALANINE\",\"HISTIDINE\"],\"xaxis\":\"x\",\"y\":[0.03228285933897002,0.10837817063797077,0.13143735588009223,0.24058416602613372,0.2121445042275173,0.06687163720215218,0.13143735588009223,0.07686395080707148],\"yaxis\":\"y\",\"type\":\"histogram\"}], {\"template\":{\"data\":{\"histogram2dcontour\":[{\"type\":\"histogram2dcontour\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"choropleth\":[{\"type\":\"choropleth\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}],\"histogram2d\":[{\"type\":\"histogram2d\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"heatmap\":[{\"type\":\"heatmap\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"heatmapgl\":[{\"type\":\"heatmapgl\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"contourcarpet\":[{\"type\":\"contourcarpet\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}],\"contour\":[{\"type\":\"contour\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"surface\":[{\"type\":\"surface\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"mesh3d\":[{\"type\":\"mesh3d\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}],\"scatter\":[{\"fillpattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2},\"type\":\"scatter\"}],\"parcoords\":[{\"type\":\"parcoords\",\"line\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scatterpolargl\":[{\"type\":\"scatterpolargl\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"bar\":[{\"error_x\":{\"color\":\"#2a3f5f\"},\"error_y\":{\"color\":\"#2a3f5f\"},\"marker\":{\"line\":{\"color\":\"#E5ECF6\",\"width\":0.5},\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"type\":\"bar\"}],\"scattergeo\":[{\"type\":\"scattergeo\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scatterpolar\":[{\"type\":\"scatterpolar\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"histogram\":[{\"marker\":{\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"type\":\"histogram\"}],\"scattergl\":[{\"type\":\"scattergl\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scatter3d\":[{\"type\":\"scatter3d\",\"line\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}},\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scattermapbox\":[{\"type\":\"scattermapbox\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scatterternary\":[{\"type\":\"scatterternary\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scattercarpet\":[{\"type\":\"scattercarpet\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"carpet\":[{\"aaxis\":{\"endlinecolor\":\"#2a3f5f\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"minorgridcolor\":\"white\",\"startlinecolor\":\"#2a3f5f\"},\"baxis\":{\"endlinecolor\":\"#2a3f5f\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"minorgridcolor\":\"white\",\"startlinecolor\":\"#2a3f5f\"},\"type\":\"carpet\"}],\"table\":[{\"cells\":{\"fill\":{\"color\":\"#EBF0F8\"},\"line\":{\"color\":\"white\"}},\"header\":{\"fill\":{\"color\":\"#C8D4E3\"},\"line\":{\"color\":\"white\"}},\"type\":\"table\"}],\"barpolar\":[{\"marker\":{\"line\":{\"color\":\"#E5ECF6\",\"width\":0.5},\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"type\":\"barpolar\"}],\"pie\":[{\"automargin\":true,\"type\":\"pie\"}]},\"layout\":{\"autotypenumbers\":\"strict\",\"colorway\":[\"#636efa\",\"#EF553B\",\"#00cc96\",\"#ab63fa\",\"#FFA15A\",\"#19d3f3\",\"#FF6692\",\"#B6E880\",\"#FF97FF\",\"#FECB52\"],\"font\":{\"color\":\"#2a3f5f\"},\"hovermode\":\"closest\",\"hoverlabel\":{\"align\":\"left\"},\"paper_bgcolor\":\"white\",\"plot_bgcolor\":\"#E5ECF6\",\"polar\":{\"bgcolor\":\"#E5ECF6\",\"angularaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\"},\"radialaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\"}},\"ternary\":{\"bgcolor\":\"#E5ECF6\",\"aaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\"},\"baxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\"},\"caxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\"}},\"coloraxis\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}},\"colorscale\":{\"sequential\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]],\"sequentialminus\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]],\"diverging\":[[0,\"#8e0152\"],[0.1,\"#c51b7d\"],[0.2,\"#de77ae\"],[0.3,\"#f1b6da\"],[0.4,\"#fde0ef\"],[0.5,\"#f7f7f7\"],[0.6,\"#e6f5d0\"],[0.7,\"#b8e186\"],[0.8,\"#7fbc41\"],[0.9,\"#4d9221\"],[1,\"#276419\"]]},\"xaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\",\"title\":{\"standoff\":15},\"zerolinecolor\":\"white\",\"automargin\":true,\"zerolinewidth\":2},\"yaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\",\"title\":{\"standoff\":15},\"zerolinecolor\":\"white\",\"automargin\":true,\"zerolinewidth\":2},\"scene\":{\"xaxis\":{\"backgroundcolor\":\"#E5ECF6\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showbackground\":true,\"ticks\":\"\",\"zerolinecolor\":\"white\",\"gridwidth\":2},\"yaxis\":{\"backgroundcolor\":\"#E5ECF6\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showbackground\":true,\"ticks\":\"\",\"zerolinecolor\":\"white\",\"gridwidth\":2},\"zaxis\":{\"backgroundcolor\":\"#E5ECF6\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showbackground\":true,\"ticks\":\"\",\"zerolinecolor\":\"white\",\"gridwidth\":2}},\"shapedefaults\":{\"line\":{\"color\":\"#2a3f5f\"}},\"annotationdefaults\":{\"arrowcolor\":\"#2a3f5f\",\"arrowhead\":0,\"arrowwidth\":1},\"geo\":{\"bgcolor\":\"white\",\"landcolor\":\"#E5ECF6\",\"subunitcolor\":\"white\",\"showland\":true,\"showlakes\":true,\"lakecolor\":\"white\"},\"title\":{\"x\":0.05},\"mapbox\":{\"style\":\"light\"}}},\"xaxis\":{\"anchor\":\"y\",\"domain\":[0.0,1.0],\"title\":{\"text\":\"NutrientName\"}},\"yaxis\":{\"anchor\":\"x\",\"domain\":[0.0,1.0],\"title\":{\"text\":\"sum of EssentialRatio\"}},\"legend\":{\"title\":{\"text\":\"FoodDescription\"},\"tracegroupgap\":0},\"title\":{\"text\":\"Essential Ratio Comparison\"},\"barmode\":\"group\"}, {\"responsive\": true} ).then(function(){\n",
" \n",
"var gd = document.getElementById('b05dcd7f-bd7e-4333-84b9-bd449d876e1d');\n",
"var x = new MutationObserver(function (mutations, observer) {{\n",
" var display = window.getComputedStyle(gd).display;\n",
" if (!display || display === 'none') {{\n",
" console.log([gd, 'removed!']);\n",
" Plotly.purge(gd);\n",
" observer.disconnect();\n",
" }}\n",
"}});\n",
"\n",
"// Listen for the removal of the full notebook cells\n",
"var notebookContainer = gd.closest('#notebook-container');\n",
"if (notebookContainer) {{\n",
" x.observe(notebookContainer, {childList: true});\n",
"}}\n",
"\n",
"// Listen for the clearing of the current output cell\n",
"var outputEl = gd.closest('.output');\n",
"if (outputEl) {{\n",
" x.observe(outputEl, {childList: true});\n",
"}}\n",
"\n",
" }) }; }); </script> </div>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# Animal-sourced proteins for reference\n",
"compare_proteins(6119, 125, 3221, 838, 25, 61)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Miscellaneous \n",
"\n",
"What are good sources of lysine?"
]
},
{
"cell_type": "code",
"execution_count": 69,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>FoodID</th>\n",
" <th>FoodDescription</th>\n",
" <th>NutrientID</th>\n",
" <th>NutrientName</th>\n",
" <th>NutrientValue</th>\n",
" <th>EssentialRatio</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>1689</td>\n",
" <td>Tamarind, raw</td>\n",
" <td>505</td>\n",
" <td>LYSINE</td>\n",
" <td>0.139</td>\n",
" <td>0.812865</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>2298</td>\n",
" <td>Parsley, freeze-dried</td>\n",
" <td>505</td>\n",
" <td>LYSINE</td>\n",
" <td>3.115</td>\n",
" <td>0.810987</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>1597</td>\n",
" <td>Lychee, dried</td>\n",
" <td>505</td>\n",
" <td>LYSINE</td>\n",
" <td>0.187</td>\n",
" <td>0.713740</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>2239</td>\n",
" <td>Sweet potato leaves, steamed</td>\n",
" <td>505</td>\n",
" <td>LYSINE</td>\n",
" <td>0.132</td>\n",
" <td>0.653465</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>2238</td>\n",
" <td>Sweet potato leaves, raw</td>\n",
" <td>505</td>\n",
" <td>LYSINE</td>\n",
" <td>0.228</td>\n",
" <td>0.653295</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>501788</td>\n",
" <td>Sweet potato leaves, steamed, with salt</td>\n",
" <td>505</td>\n",
" <td>LYSINE</td>\n",
" <td>0.130</td>\n",
" <td>0.650000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>6</th>\n",
" <td>2385</td>\n",
" <td>Cauliflower, raw</td>\n",
" <td>505</td>\n",
" <td>LYSINE</td>\n",
" <td>0.217</td>\n",
" <td>0.336434</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7</th>\n",
" <td>194</td>\n",
" <td>Spices, onion powder</td>\n",
" <td>505</td>\n",
" <td>LYSINE</td>\n",
" <td>0.490</td>\n",
" <td>0.310127</td>\n",
" </tr>\n",
" <tr>\n",
" <th>8</th>\n",
" <td>4998</td>\n",
" <td>Beef, ground, extra lean, crumbled, pan-fried</td>\n",
" <td>505</td>\n",
" <td>LYSINE</td>\n",
" <td>2.355</td>\n",
" <td>0.309055</td>\n",
" </tr>\n",
" <tr>\n",
" <th>9</th>\n",
" <td>5009</td>\n",
" <td>Beef, ground, lean, crumbled, pan-fried</td>\n",
" <td>505</td>\n",
" <td>LYSINE</td>\n",
" <td>2.295</td>\n",
" <td>0.308966</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" FoodID FoodDescription NutrientID \\\n",
"0 1689 Tamarind, raw 505 \n",
"1 2298 Parsley, freeze-dried 505 \n",
"2 1597 Lychee, dried 505 \n",
"3 2239 Sweet potato leaves, steamed 505 \n",
"4 2238 Sweet potato leaves, raw 505 \n",
"5 501788 Sweet potato leaves, steamed, with salt 505 \n",
"6 2385 Cauliflower, raw 505 \n",
"7 194 Spices, onion powder 505 \n",
"8 4998 Beef, ground, extra lean, crumbled, pan-fried 505 \n",
"9 5009 Beef, ground, lean, crumbled, pan-fried 505 \n",
"\n",
" NutrientName NutrientValue EssentialRatio \n",
"0 LYSINE 0.139 0.812865 \n",
"1 LYSINE 3.115 0.810987 \n",
"2 LYSINE 0.187 0.713740 \n",
"3 LYSINE 0.132 0.653465 \n",
"4 LYSINE 0.228 0.653295 \n",
"5 LYSINE 0.130 0.650000 \n",
"6 LYSINE 0.217 0.336434 \n",
"7 LYSINE 0.490 0.310127 \n",
"8 LYSINE 2.355 0.309055 \n",
"9 LYSINE 2.295 0.308966 "
]
},
"execution_count": 69,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"\n",
"db.sql(\"\"\"\n",
"SELECT * FROM (\n",
"\tSELECT fn.FoodId, fn.FoodDescription, nn.NutrientID, nn.NutrientName, na.NutrientValue, \n",
" NutrientValue / sum(NutrientValue) OVER (PARTITION by FoodDescription) as EssentialRatio\n",
" FROM\n",
" main.nutrient_amount na\n",
" NATURAL JOIN main.nutrient_name nn \n",
" NATURAL JOIN main.food_name fn\n",
" WHERE \n",
" nn.NutrientID IN (512, 503, 504, 505, 506, 508, 502, 501)\n",
") ess\n",
"WHERE NutrientId = 505\n",
"-- Filter out foods with neglible overall protein amounts\n",
"AND NutrientValue >= 0.1\n",
"ORDER BY EssentialRatio DESC \n",
"LIMIT 10\"\"\").to_df()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Dried parsley seems surprisingly high in protein as a leafy vegetable, are there others?"
]
},
{
"cell_type": "code",
"execution_count": 56,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>FoodID</th>\n",
" <th>FoodDescription</th>\n",
" <th>NutrientID</th>\n",
" <th>NutrientName</th>\n",
" <th>NutrientValue</th>\n",
" <th>MacroSum</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>2320</td>\n",
" <td>Seaweed, spirulina, dried</td>\n",
" <td>203</td>\n",
" <td>PROTEIN</td>\n",
" <td>57.47</td>\n",
" <td>100.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>2499</td>\n",
" <td>Seaweed, dulse (laver, nori), dried</td>\n",
" <td>203</td>\n",
" <td>PROTEIN</td>\n",
" <td>36.22</td>\n",
" <td>100.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>2298</td>\n",
" <td>Parsley, freeze-dried</td>\n",
" <td>203</td>\n",
" <td>PROTEIN</td>\n",
" <td>31.30</td>\n",
" <td>100.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>5605</td>\n",
" <td>Yeast extract spread</td>\n",
" <td>203</td>\n",
" <td>PROTEIN</td>\n",
" <td>23.88</td>\n",
" <td>100.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>2289</td>\n",
" <td>Chives, freeze-dried</td>\n",
" <td>203</td>\n",
" <td>PROTEIN</td>\n",
" <td>21.20</td>\n",
" <td>100.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>501703</td>\n",
" <td>Pepper, sweet, red, freeze-dried</td>\n",
" <td>203</td>\n",
" <td>PROTEIN</td>\n",
" <td>17.90</td>\n",
" <td>100.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>6</th>\n",
" <td>2300</td>\n",
" <td>Pepper, sweet, green, freeze-dried</td>\n",
" <td>203</td>\n",
" <td>PROTEIN</td>\n",
" <td>17.90</td>\n",
" <td>100.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7</th>\n",
" <td>502350</td>\n",
" <td>Seaweed, Canadian cultivated EMI-TSUNOMATA, dried</td>\n",
" <td>203</td>\n",
" <td>PROTEIN</td>\n",
" <td>15.34</td>\n",
" <td>100.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>8</th>\n",
" <td>2297</td>\n",
" <td>Leeks (bulb and lower-leaf portion), freeze-dried</td>\n",
" <td>203</td>\n",
" <td>PROTEIN</td>\n",
" <td>15.20</td>\n",
" <td>100.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>9</th>\n",
" <td>6263</td>\n",
" <td>Corn, dried, yellow</td>\n",
" <td>203</td>\n",
" <td>PROTEIN</td>\n",
" <td>14.48</td>\n",
" <td>99.99</td>\n",
" </tr>\n",
" <tr>\n",
" <th>10</th>\n",
" <td>2348</td>\n",
" <td>Tomato, sun-dried</td>\n",
" <td>203</td>\n",
" <td>PROTEIN</td>\n",
" <td>14.11</td>\n",
" <td>100.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>11</th>\n",
" <td>501765</td>\n",
" <td>Soybeans, mature seeds, sprouted, bean sprouts...</td>\n",
" <td>203</td>\n",
" <td>PROTEIN</td>\n",
" <td>13.10</td>\n",
" <td>100.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>12</th>\n",
" <td>2212</td>\n",
" <td>Soybeans, mature seeds, sprouted, bean sprouts...</td>\n",
" <td>203</td>\n",
" <td>PROTEIN</td>\n",
" <td>13.10</td>\n",
" <td>100.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>13</th>\n",
" <td>2210</td>\n",
" <td>Soybeans, mature seeds, sprouted, bean sprouts...</td>\n",
" <td>203</td>\n",
" <td>PROTEIN</td>\n",
" <td>13.09</td>\n",
" <td>100.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>14</th>\n",
" <td>2208</td>\n",
" <td>Soybeans, green (edamame), raw</td>\n",
" <td>203</td>\n",
" <td>PROTEIN</td>\n",
" <td>12.95</td>\n",
" <td>100.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>15</th>\n",
" <td>2260</td>\n",
" <td>Tomato powder</td>\n",
" <td>203</td>\n",
" <td>PROTEIN</td>\n",
" <td>12.91</td>\n",
" <td>100.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>16</th>\n",
" <td>2209</td>\n",
" <td>Soybeans, green (edamame), boiled, drained</td>\n",
" <td>203</td>\n",
" <td>PROTEIN</td>\n",
" <td>12.35</td>\n",
" <td>100.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>17</th>\n",
" <td>501764</td>\n",
" <td>Soybeans, green (edamame), boiled, drained, wi...</td>\n",
" <td>203</td>\n",
" <td>PROTEIN</td>\n",
" <td>12.35</td>\n",
" <td>100.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>18</th>\n",
" <td>4863</td>\n",
" <td>Pepper, pasilla, dried</td>\n",
" <td>203</td>\n",
" <td>PROTEIN</td>\n",
" <td>12.35</td>\n",
" <td>99.99</td>\n",
" </tr>\n",
" <tr>\n",
" <th>19</th>\n",
" <td>2302</td>\n",
" <td>Shallot, freeze-dried</td>\n",
" <td>203</td>\n",
" <td>PROTEIN</td>\n",
" <td>12.30</td>\n",
" <td>100.00</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" FoodID FoodDescription NutrientID \\\n",
"0 2320 Seaweed, spirulina, dried 203 \n",
"1 2499 Seaweed, dulse (laver, nori), dried 203 \n",
"2 2298 Parsley, freeze-dried 203 \n",
"3 5605 Yeast extract spread 203 \n",
"4 2289 Chives, freeze-dried 203 \n",
"5 501703 Pepper, sweet, red, freeze-dried 203 \n",
"6 2300 Pepper, sweet, green, freeze-dried 203 \n",
"7 502350 Seaweed, Canadian cultivated EMI-TSUNOMATA, dried 203 \n",
"8 2297 Leeks (bulb and lower-leaf portion), freeze-dried 203 \n",
"9 6263 Corn, dried, yellow 203 \n",
"10 2348 Tomato, sun-dried 203 \n",
"11 501765 Soybeans, mature seeds, sprouted, bean sprouts... 203 \n",
"12 2212 Soybeans, mature seeds, sprouted, bean sprouts... 203 \n",
"13 2210 Soybeans, mature seeds, sprouted, bean sprouts... 203 \n",
"14 2208 Soybeans, green (edamame), raw 203 \n",
"15 2260 Tomato powder 203 \n",
"16 2209 Soybeans, green (edamame), boiled, drained 203 \n",
"17 501764 Soybeans, green (edamame), boiled, drained, wi... 203 \n",
"18 4863 Pepper, pasilla, dried 203 \n",
"19 2302 Shallot, freeze-dried 203 \n",
"\n",
" NutrientName NutrientValue MacroSum \n",
"0 PROTEIN 57.47 100.00 \n",
"1 PROTEIN 36.22 100.00 \n",
"2 PROTEIN 31.30 100.00 \n",
"3 PROTEIN 23.88 100.00 \n",
"4 PROTEIN 21.20 100.00 \n",
"5 PROTEIN 17.90 100.00 \n",
"6 PROTEIN 17.90 100.00 \n",
"7 PROTEIN 15.34 100.00 \n",
"8 PROTEIN 15.20 100.00 \n",
"9 PROTEIN 14.48 99.99 \n",
"10 PROTEIN 14.11 100.00 \n",
"11 PROTEIN 13.10 100.00 \n",
"12 PROTEIN 13.10 100.00 \n",
"13 PROTEIN 13.09 100.00 \n",
"14 PROTEIN 12.95 100.00 \n",
"15 PROTEIN 12.91 100.00 \n",
"16 PROTEIN 12.35 100.00 \n",
"17 PROTEIN 12.35 100.00 \n",
"18 PROTEIN 12.35 99.99 \n",
"19 PROTEIN 12.30 100.00 "
]
},
"execution_count": 56,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"#\n",
"db.sql(\"\"\"\n",
"SELECT * FROM (\n",
"\tSELECT fn.FoodId, fn.FoodDescription, nn.NutrientID, nn.NutrientName, na.NutrientValue, \n",
" sum(NutrientValue) OVER (PARTITION by FoodDescription) as MacroSum\n",
" FROM\n",
" main.nutrient_amount na\n",
" NATURAL JOIN main.nutrient_name nn \n",
" NATURAL JOIN main.food_name fn\n",
" NATURAL JOIN main.food_group fg\n",
" WHERE fg.FoodGroupID = 11\n",
" -- Major macronutrients protein, fat, carbs, water, ash\n",
" AND NutrientId IN (203, 204, 205, 207, 255) \n",
") ess\n",
"WHERE NutrientId = 203\n",
"-- Filter out foods with neglible overall protein amounts\n",
"AND NutrientValue >= 0.1\n",
"ORDER BY NutrientValue DESC \n",
"LIMIT 20\"\"\").to_df()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "ddbtest",
"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.9.5"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
This file has been truncated, but you can view the full file.
View raw

(Sorry about that, but we can’t show files that are this big right now.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment