{ "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", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
GNC
keylnLnfpDLCunique_Q
-6707.185683True
\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", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
Global params
A>CA>GA>TC>AC>GC>TG>AG>CG>TT>A
0.86183.53920.97851.67102.20236.26327.89531.22150.79831.2838
\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
T>Comega
3.06180.8201
\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
Edge params
edgeparentlength
Galagoroot0.5233
HowlerMonroot0.1331
Rhesusedge.30.0639
Orangutanedge.20.0234
Gorillaedge.10.0075
Humanedge.00.0182
Chimpanzeeedge.00.0085
edge.0edge.10.0000
edge.1edge.20.0100
edge.2edge.30.0368
edge.3root0.0246
\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
Motif params
AAAAACAAGAATACAACCACGACTAGAAGC
0.05570.02280.03520.05480.02340.00320.00000.03200.02240.0285
\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
AGGAGTATAATCATGATTCAACACCAGCAT
0.01460.03790.01840.00740.01200.01810.01940.00530.02540.0236
\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
CCACCCCCGCCTCGACGCCGGCGTCTACTC
0.02130.00650.00000.02800.00000.00110.00110.00210.01540.0073
\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
CTGCTTGAAGACGAGGATGCAGCCGCGGCT
0.01350.01070.07720.00880.02980.03180.01690.01070.00100.0130
\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
GGAGGCGGGGGTGTAGTCGTGGTTTACTAT
0.01470.00990.00790.01120.01480.00640.00730.02070.00210.0086
\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
TCATCCTCGTCTTGCTGGTGTTTATTCTTG
0.02240.00740.00000.02750.00110.00430.02120.01980.00850.0102
\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
TTT
0.0181
\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 }