{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Applying GNC, a non-stationary codon model\n",
"\n",
"See [Kaehler et al](https://academic.oup.com/gbe/article-lookup/doi/10.1093/gbe/evw308) for the formal description of this model. Note that we demonstrate hypothesis testing using this model elsewhere.\n",
"\n",
"We apply this to a sample alignment."
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"from cogent3.app import io, evo\n",
"\n",
"loader = io.load_aligned(format=\"fasta\", moltype=\"dna\")\n",
"aln = loader(\"../data/primate_brca1.fasta\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The model is specified using it's abbreviation."
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"
\n",
"\n",
"GNC\n",
"\n",
"key | \n",
"lnL | \n",
"nfp | \n",
"DLC | \n",
"unique_Q | \n",
"\n",
"\n",
"\n",
" | \n",
"-6707.1856 | \n",
"83 | \n",
"True | \n",
" | \n",
"
\n",
"\n",
"
\n"
],
"text/plain": [
"GNC\n",
"============================================\n",
"key lnL nfp DLC unique_Q\n",
"--------------------------------------------\n",
" -6707.1856 83 True \n",
"--------------------------------------------\n",
"\n",
"1 rows x 5 columns"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"model = evo.model(\"GNC\", tree=\"../data/primate_brca1.tree\")\n",
"result = model(aln)\n",
"result"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"GNC
\n",
"log-likelihood = -6707.1856
\n",
"number of free parameters = 83
\n",
"\n",
"\n",
"Global params\n",
"\n",
"A>C | \n",
"A>G | \n",
"A>T | \n",
"C>A | \n",
"C>G | \n",
"C>T | \n",
"G>A | \n",
"G>C | \n",
"G>T | \n",
"T>A | \n",
"\n",
"\n",
"\n",
"0.8618 | \n",
"3.5392 | \n",
"0.9785 | \n",
"1.6710 | \n",
"2.2023 | \n",
"6.2632 | \n",
"7.8953 | \n",
"1.2215 | \n",
"0.7983 | \n",
"1.2838 | \n",
"
\n",
"\n",
"
\n",
"\n",
"\n",
"T>C | \n",
"omega | \n",
"\n",
"\n",
"\n",
"3.0618 | \n",
"0.8201 | \n",
"
\n",
"\n",
"
\n",
"\n",
"\n",
"\n",
"Edge params\n",
"\n",
"edge | \n",
"parent | \n",
"length | \n",
"\n",
"\n",
"\n",
"Galago | \n",
"root | \n",
"0.5233 | \n",
"
\n",
"\n",
"HowlerMon | \n",
"root | \n",
"0.1331 | \n",
"
\n",
"\n",
"Rhesus | \n",
"edge.3 | \n",
"0.0639 | \n",
"
\n",
"\n",
"Orangutan | \n",
"edge.2 | \n",
"0.0234 | \n",
"
\n",
"\n",
"Gorilla | \n",
"edge.1 | \n",
"0.0075 | \n",
"
\n",
"\n",
"Human | \n",
"edge.0 | \n",
"0.0182 | \n",
"
\n",
"\n",
"Chimpanzee | \n",
"edge.0 | \n",
"0.0085 | \n",
"
\n",
"\n",
"edge.0 | \n",
"edge.1 | \n",
"0.0000 | \n",
"
\n",
"\n",
"edge.1 | \n",
"edge.2 | \n",
"0.0100 | \n",
"
\n",
"\n",
"edge.2 | \n",
"edge.3 | \n",
"0.0368 | \n",
"
\n",
"\n",
"edge.3 | \n",
"root | \n",
"0.0246 | \n",
"
\n",
"\n",
"
\n",
"\n",
"\n",
"\n",
"Motif params\n",
"\n",
"AAA | \n",
"AAC | \n",
"AAG | \n",
"AAT | \n",
"ACA | \n",
"ACC | \n",
"ACG | \n",
"ACT | \n",
"AGA | \n",
"AGC | \n",
"\n",
"\n",
"\n",
"0.0557 | \n",
"0.0228 | \n",
"0.0352 | \n",
"0.0548 | \n",
"0.0234 | \n",
"0.0032 | \n",
"0.0000 | \n",
"0.0320 | \n",
"0.0224 | \n",
"0.0285 | \n",
"
\n",
"\n",
"
\n",
"\n",
"\n",
"AGG | \n",
"AGT | \n",
"ATA | \n",
"ATC | \n",
"ATG | \n",
"ATT | \n",
"CAA | \n",
"CAC | \n",
"CAG | \n",
"CAT | \n",
"\n",
"\n",
"\n",
"0.0146 | \n",
"0.0379 | \n",
"0.0184 | \n",
"0.0074 | \n",
"0.0120 | \n",
"0.0181 | \n",
"0.0194 | \n",
"0.0053 | \n",
"0.0254 | \n",
"0.0236 | \n",
"
\n",
"\n",
"
\n",
"\n",
"\n",
"CCA | \n",
"CCC | \n",
"CCG | \n",
"CCT | \n",
"CGA | \n",
"CGC | \n",
"CGG | \n",
"CGT | \n",
"CTA | \n",
"CTC | \n",
"\n",
"\n",
"\n",
"0.0213 | \n",
"0.0065 | \n",
"0.0000 | \n",
"0.0280 | \n",
"0.0000 | \n",
"0.0011 | \n",
"0.0011 | \n",
"0.0021 | \n",
"0.0154 | \n",
"0.0073 | \n",
"
\n",
"\n",
"
\n",
"\n",
"\n",
"CTG | \n",
"CTT | \n",
"GAA | \n",
"GAC | \n",
"GAG | \n",
"GAT | \n",
"GCA | \n",
"GCC | \n",
"GCG | \n",
"GCT | \n",
"\n",
"\n",
"\n",
"0.0135 | \n",
"0.0107 | \n",
"0.0772 | \n",
"0.0088 | \n",
"0.0298 | \n",
"0.0318 | \n",
"0.0169 | \n",
"0.0107 | \n",
"0.0010 | \n",
"0.0130 | \n",
"
\n",
"\n",
"
\n",
"\n",
"\n",
"GGA | \n",
"GGC | \n",
"GGG | \n",
"GGT | \n",
"GTA | \n",
"GTC | \n",
"GTG | \n",
"GTT | \n",
"TAC | \n",
"TAT | \n",
"\n",
"\n",
"\n",
"0.0147 | \n",
"0.0099 | \n",
"0.0079 | \n",
"0.0112 | \n",
"0.0148 | \n",
"0.0064 | \n",
"0.0073 | \n",
"0.0207 | \n",
"0.0021 | \n",
"0.0086 | \n",
"
\n",
"\n",
"
\n",
"\n",
"\n",
"TCA | \n",
"TCC | \n",
"TCG | \n",
"TCT | \n",
"TGC | \n",
"TGG | \n",
"TGT | \n",
"TTA | \n",
"TTC | \n",
"TTG | \n",
"\n",
"\n",
"\n",
"0.0224 | \n",
"0.0074 | \n",
"0.0000 | \n",
"0.0275 | \n",
"0.0011 | \n",
"0.0043 | \n",
"0.0212 | \n",
"0.0198 | \n",
"0.0085 | \n",
"0.0102 | \n",
"
\n",
"\n",
"
\n",
"\n",
"\n",
"TTT | \n",
"\n",
"\n",
"\n",
"0.0181 | \n",
"
\n",
"\n",
"
\n"
],
"text/plain": [
"GNC\n",
"log-likelihood = -6707.1856\n",
"number of free parameters = 83\n",
"============================================================================\n",
" A>C A>G A>T C>A C>G C>T G>A G>C\n",
"----------------------------------------------------------------------------\n",
"0.8618 3.5392 0.9785 1.6710 2.2023 6.2632 7.8953 1.2215\n",
"----------------------------------------------------------------------------\n",
"\n",
"continued: \n",
"====================================\n",
" G>T T>A T>C omega\n",
"------------------------------------\n",
"0.7983 1.2838 3.0618 0.8201\n",
"------------------------------------\n",
"\n",
"==============================\n",
" edge parent length\n",
"------------------------------\n",
" Galago root 0.5233\n",
" HowlerMon root 0.1331\n",
" Rhesus edge.3 0.0639\n",
" Orangutan edge.2 0.0234\n",
" Gorilla edge.1 0.0075\n",
" Human edge.0 0.0182\n",
"Chimpanzee edge.0 0.0085\n",
" edge.0 edge.1 0.0000\n",
" edge.1 edge.2 0.0100\n",
" edge.2 edge.3 0.0368\n",
" edge.3 root 0.0246\n",
"------------------------------\n",
"============================================================================\n",
" AAA AAC AAG AAT ACA ACC ACG ACT\n",
"----------------------------------------------------------------------------\n",
"0.0557 0.0228 0.0352 0.0548 0.0234 0.0032 0.0000 0.0320\n",
"----------------------------------------------------------------------------\n",
"\n",
"continued: \n",
"============================================================================\n",
" AGA AGC AGG AGT ATA ATC ATG ATT\n",
"----------------------------------------------------------------------------\n",
"0.0224 0.0285 0.0146 0.0379 0.0184 0.0074 0.0120 0.0181\n",
"----------------------------------------------------------------------------\n",
"\n",
"continued: \n",
"============================================================================\n",
" CAA CAC CAG CAT CCA CCC CCG CCT\n",
"----------------------------------------------------------------------------\n",
"0.0194 0.0053 0.0254 0.0236 0.0213 0.0065 0.0000 0.0280\n",
"----------------------------------------------------------------------------\n",
"\n",
"continued: \n",
"============================================================================\n",
" CGA CGC CGG CGT CTA CTC CTG CTT\n",
"----------------------------------------------------------------------------\n",
"0.0000 0.0011 0.0011 0.0021 0.0154 0.0073 0.0135 0.0107\n",
"----------------------------------------------------------------------------\n",
"\n",
"continued: \n",
"============================================================================\n",
" GAA GAC GAG GAT GCA GCC GCG GCT\n",
"----------------------------------------------------------------------------\n",
"0.0772 0.0088 0.0298 0.0318 0.0169 0.0107 0.0010 0.0130\n",
"----------------------------------------------------------------------------\n",
"\n",
"continued: \n",
"============================================================================\n",
" GGA GGC GGG GGT GTA GTC GTG GTT\n",
"----------------------------------------------------------------------------\n",
"0.0147 0.0099 0.0079 0.0112 0.0148 0.0064 0.0073 0.0207\n",
"----------------------------------------------------------------------------\n",
"\n",
"continued: \n",
"============================================================================\n",
" TAC TAT TCA TCC TCG TCT TGC TGG\n",
"----------------------------------------------------------------------------\n",
"0.0021 0.0086 0.0224 0.0074 0.0000 0.0275 0.0011 0.0043\n",
"----------------------------------------------------------------------------\n",
"\n",
"continued: \n",
"==============================================\n",
" TGT TTA TTC TTG TTT\n",
"----------------------------------------------\n",
"0.0212 0.0198 0.0085 0.0102 0.0181\n",
"----------------------------------------------"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"result.lf"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## We can obtain the tree with branch lengths as ENS\n",
"\n",
"If this tree is written to newick (using the `write()` method), the lengths will now be ENS."
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
" \n",
" "
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.plotly.v1+json": {
"config": {
"plotlyServerURL": "https://plot.ly"
},
"data": [
{
"line": {
"color": "black",
"shape": "spline",
"smoothing": 1.3,
"width": 1.25
},
"mode": "lines",
"showlegend": false,
"type": "scatter",
"x": [
null,
null,
0,
0,
null,
0,
0.02454694919222931,
null,
0.02454694919222931,
0.02454694919222931,
null,
0.02454694919222931,
0.06129274291389185,
null,
0.06129274291389185,
0.06129274291389185,
null,
0.06129274291389185,
0.07124690317126423,
null,
0.07124690317126423,
0.07124690317126423,
null,
0.07124690317126423,
0.07124690317582229,
null,
0.07124690317582229,
0.07124690317582229,
null,
0.07124690317582229,
0.0797665675480732,
null,
0.07124690317582229,
0.07124690317582229,
null,
0.07124690317582229,
0.08940681655490382,
null,
0.07124690317126423,
0.07124690317126423,
null,
0.07124690317126423,
0.07870267595544249,
null,
0.06129274291389185,
0.06129274291389185,
null,
0.06129274291389185,
0.08461824421871442,
null,
0.02454694919222931,
0.02454694919222931,
null,
0.02454694919222931,
0.08832353597608736,
null,
0,
0,
null,
0,
0.1327221209228062,
null,
0,
0,
null,
0,
0.5179696016707567,
null
],
"y": [
null,
null,
-2.6,
-0.08125000000000004,
null,
-0.08125000000000004,
-0.08125000000000004,
null,
-0.08125000000000004,
1.1375,
null,
1.1375,
1.1375,
null,
1.1375,
2.275,
null,
2.275,
2.275,
null,
2.275,
3.25,
null,
3.25,
3.25,
null,
3.25,
3.9000000000000004,
null,
3.9000000000000004,
3.9000000000000004,
null,
3.25,
2.6,
null,
2.6,
2.6,
null,
2.275,
1.3,
null,
1.3,
1.3,
null,
1.1375,
0.0,
null,
0.0,
0.0,
null,
-0.08125000000000004,
-1.3,
null,
-1.3,
-1.3,
null,
-2.6,
-2.6,
null,
-2.6,
-2.6,
null,
-2.6,
-3.9000000000000004,
null,
-3.9000000000000004,
-3.9000000000000004,
null
]
},
{
"hoverinfo": "text",
"marker": {
"color": "black",
"size": 3,
"symbol": "circle"
},
"mode": "markers",
"showlegend": false,
"text": [
"root",
"edge.3",
"edge.2",
"edge.1",
"edge.0",
"Chimpanzee",
"Human",
"Gorilla",
"Orangutan",
"Rhesus",
"HowlerMon",
"Galago"
],
"type": "scatter",
"x": [
0,
0.02454694919222931,
0.06129274291389185,
0.07124690317126423,
0.07124690317582229,
0.0797665675480732,
0.08940681655490382,
0.07870267595544249,
0.08461824421871442,
0.08832353597608736,
0.1327221209228062,
0.5179696016707567
],
"y": [
-2.6,
-0.08125000000000004,
1.1375,
2.275,
3.25,
3.9000000000000004,
2.6,
1.3,
0.0,
-1.3,
-2.6,
-3.9000000000000004
]
}
],
"layout": {
"annotations": [
{
"font": {
"family": "Inconsolata, monospace",
"size": 12
},
"showarrow": false,
"text": "Chimpanzee",
"textangle": 0,
"x": 0.09271580758984212,
"xanchor": "left",
"xref": "x",
"y": 3.9000000000000004,
"yref": "y"
},
{
"font": {
"family": "Inconsolata, monospace",
"size": 12
},
"showarrow": false,
"text": "Human",
"textangle": 0,
"x": 0.10235605659667274,
"xanchor": "left",
"xref": "x",
"y": 2.6,
"yref": "y"
},
{
"font": {
"family": "Inconsolata, monospace",
"size": 12
},
"showarrow": false,
"text": "Gorilla",
"textangle": 0,
"x": 0.09165191599721141,
"xanchor": "left",
"xref": "x",
"y": 1.3,
"yref": "y"
},
{
"font": {
"family": "Inconsolata, monospace",
"size": 12
},
"showarrow": false,
"text": "Orangutan",
"textangle": 0,
"x": 0.09756748426048334,
"xanchor": "left",
"xref": "x",
"y": 0.0,
"yref": "y"
},
{
"font": {
"family": "Inconsolata, monospace",
"size": 12
},
"showarrow": false,
"text": "Rhesus",
"textangle": 0,
"x": 0.10127277601785628,
"xanchor": "left",
"xref": "x",
"y": -1.3,
"yref": "y"
},
{
"font": {
"family": "Inconsolata, monospace",
"size": 12
},
"showarrow": false,
"text": "HowlerMon",
"textangle": 0,
"x": 0.14567136096457511,
"xanchor": "left",
"xref": "x",
"y": -2.6,
"yref": "y"
},
{
"font": {
"family": "Inconsolata, monospace",
"size": 12
},
"showarrow": false,
"text": "Galago",
"textangle": 0,
"x": 0.5309188417125256,
"xanchor": "left",
"xref": "x",
"y": -3.9000000000000004,
"yref": "y"
},
{
"ax": 0,
"ay": 0,
"showarrow": false,
"text": "0.05",
"x": 0.5438680817542945,
"xref": "x",
"y": 3.9000000000000004,
"yref": "y",
"yshift": 10
}
],
"autosize": true,
"font": {
"family": "Balto",
"size": 14
},
"height": 500,
"hovermode": "closest",
"margin": {
"b": 50,
"l": 50,
"pad": 4,
"r": 50,
"t": 50
},
"shapes": [
{
"line": {
"color": "black",
"width": 1.25
},
"type": "line",
"x0": 0.5179696016707567,
"x1": 0.5697665618378324,
"y0": 3.9000000000000004,
"y1": 3.9000000000000004
}
],
"showlegend": false,
"template": {
"data": {
"bar": [
{
"error_x": {
"color": "#2a3f5f"
},
"error_y": {
"color": "#2a3f5f"
},
"marker": {
"line": {
"color": "#E5ECF6",
"width": 0.5
}
},
"type": "bar"
}
],
"barpolar": [
{
"marker": {
"line": {
"color": "#E5ECF6",
"width": 0.5
}
},
"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.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"
]
],
"type": "contour"
}
],
"contourcarpet": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"type": "contourcarpet"
}
],
"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"
]
],
"type": "heatmap"
}
],
"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"
]
],
"type": "heatmapgl"
}
],
"histogram": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "histogram"
}
],
"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"
]
],
"type": "histogram2d"
}
],
"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"
]
],
"type": "histogram2dcontour"
}
],
"mesh3d": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"type": "mesh3d"
}
],
"parcoords": [
{
"line": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "parcoords"
}
],
"pie": [
{
"automargin": true,
"type": "pie"
}
],
"scatter": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"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.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"
]
],
"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
},
"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.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"
]
]
},
"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
}
}
},
"width": 500,
"xaxis": {
"visible": false
},
"yaxis": {
"visible": false
}
}
},
"text/html": [
"\n",
" \n",
" \n",
"
\n",
" \n",
"
"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"tree = result.tree\n",
"fig = tree.get_figure()\n",
"fig.scale_bar = \"top right\"\n",
"fig.show(width=500, height=500)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python [conda env:c3dev] *",
"language": "python",
"name": "conda-env-c3dev-py"
},
"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.8.1"
},
"widgets": {
"application/vnd.jupyter.widget-state+json": {
"state": {},
"version_major": 2,
"version_minor": 0
}
}
},
"nbformat": 4,
"nbformat_minor": 4
}