{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {
    "tags": []
   },
   "source": [
    "# Pygor Tutorial"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Welcome to the pygor3 Tutorial.\n",
    "\n",
    "Pygor3 is an open source project and Python package that allows to analyze infer, evaluate and generate V(D)J sequences, by using IGoR's.\n",
    "\n",
    "Pygor3 could help you to get simple calculations and visualizations of the statistics in VDJ recombination"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# IgorModel"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "An IGoR model's encapsulates the Bayesian network probabilistic parameters of a V(D)J recombination process. \n",
    "IGoR is shipped with a set of default models.\n",
    "\n",
    "As an example lets load the recombination model for a human $\\beta$ T-cell receptor"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Reading Parms filename from:  /home/olivares/.local/share/igor/models/human/tcr_beta/models/model_parms.txt\n",
      "Reading Marginals filename from:  /home/olivares/.local/share/igor/models/human/tcr_beta/models/model_marginals.txt\n"
     ]
    }
   ],
   "source": [
    "import pygor3 as p3\n",
    "mdl_hb = p3.get_default_IgorModel(\"human\", \"tcr_beta\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><svg style=\"position: absolute; width: 0; height: 0; overflow: hidden\">\n",
       "<defs>\n",
       "<symbol id=\"icon-database\" viewBox=\"0 0 32 32\">\n",
       "<path d=\"M16 0c-8.837 0-16 2.239-16 5v4c0 2.761 7.163 5 16 5s16-2.239 16-5v-4c0-2.761-7.163-5-16-5z\"></path>\n",
       "<path d=\"M16 17c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
       "<path d=\"M16 26c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
       "</symbol>\n",
       "<symbol id=\"icon-file-text2\" viewBox=\"0 0 32 32\">\n",
       "<path d=\"M28.681 7.159c-0.694-0.947-1.662-2.053-2.724-3.116s-2.169-2.030-3.116-2.724c-1.612-1.182-2.393-1.319-2.841-1.319h-15.5c-1.378 0-2.5 1.121-2.5 2.5v27c0 1.378 1.122 2.5 2.5 2.5h23c1.378 0 2.5-1.122 2.5-2.5v-19.5c0-0.448-0.137-1.23-1.319-2.841zM24.543 5.457c0.959 0.959 1.712 1.825 2.268 2.543h-4.811v-4.811c0.718 0.556 1.584 1.309 2.543 2.268zM28 29.5c0 0.271-0.229 0.5-0.5 0.5h-23c-0.271 0-0.5-0.229-0.5-0.5v-27c0-0.271 0.229-0.5 0.5-0.5 0 0 15.499-0 15.5 0v7c0 0.552 0.448 1 1 1h7v19.5z\"></path>\n",
       "<path d=\"M23 26h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
       "<path d=\"M23 22h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
       "<path d=\"M23 18h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
       "</symbol>\n",
       "</defs>\n",
       "</svg>\n",
       "<style>/* CSS stylesheet for displaying xarray objects in jupyterlab.\n",
       " *\n",
       " */\n",
       "\n",
       ":root {\n",
       "  --xr-font-color0: var(--jp-content-font-color0, rgba(0, 0, 0, 1));\n",
       "  --xr-font-color2: var(--jp-content-font-color2, rgba(0, 0, 0, 0.54));\n",
       "  --xr-font-color3: var(--jp-content-font-color3, rgba(0, 0, 0, 0.38));\n",
       "  --xr-border-color: var(--jp-border-color2, #e0e0e0);\n",
       "  --xr-disabled-color: var(--jp-layout-color3, #bdbdbd);\n",
       "  --xr-background-color: var(--jp-layout-color0, white);\n",
       "  --xr-background-color-row-even: var(--jp-layout-color1, white);\n",
       "  --xr-background-color-row-odd: var(--jp-layout-color2, #eeeeee);\n",
       "}\n",
       "\n",
       "html[theme=dark],\n",
       "body.vscode-dark {\n",
       "  --xr-font-color0: rgba(255, 255, 255, 1);\n",
       "  --xr-font-color2: rgba(255, 255, 255, 0.54);\n",
       "  --xr-font-color3: rgba(255, 255, 255, 0.38);\n",
       "  --xr-border-color: #1F1F1F;\n",
       "  --xr-disabled-color: #515151;\n",
       "  --xr-background-color: #111111;\n",
       "  --xr-background-color-row-even: #111111;\n",
       "  --xr-background-color-row-odd: #313131;\n",
       "}\n",
       "\n",
       ".xr-wrap {\n",
       "  display: block;\n",
       "  min-width: 300px;\n",
       "  max-width: 700px;\n",
       "}\n",
       "\n",
       ".xr-text-repr-fallback {\n",
       "  /* fallback to plain text repr when CSS is not injected (untrusted notebook) */\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-header {\n",
       "  padding-top: 6px;\n",
       "  padding-bottom: 6px;\n",
       "  margin-bottom: 4px;\n",
       "  border-bottom: solid 1px var(--xr-border-color);\n",
       "}\n",
       "\n",
       ".xr-header > div,\n",
       ".xr-header > ul {\n",
       "  display: inline;\n",
       "  margin-top: 0;\n",
       "  margin-bottom: 0;\n",
       "}\n",
       "\n",
       ".xr-obj-type,\n",
       ".xr-array-name {\n",
       "  margin-left: 2px;\n",
       "  margin-right: 10px;\n",
       "}\n",
       "\n",
       ".xr-obj-type {\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-sections {\n",
       "  padding-left: 0 !important;\n",
       "  display: grid;\n",
       "  grid-template-columns: 150px auto auto 1fr 20px 20px;\n",
       "}\n",
       "\n",
       ".xr-section-item {\n",
       "  display: contents;\n",
       "}\n",
       "\n",
       ".xr-section-item input {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-section-item input + label {\n",
       "  color: var(--xr-disabled-color);\n",
       "}\n",
       "\n",
       ".xr-section-item input:enabled + label {\n",
       "  cursor: pointer;\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-section-item input:enabled + label:hover {\n",
       "  color: var(--xr-font-color0);\n",
       "}\n",
       "\n",
       ".xr-section-summary {\n",
       "  grid-column: 1;\n",
       "  color: var(--xr-font-color2);\n",
       "  font-weight: 500;\n",
       "}\n",
       "\n",
       ".xr-section-summary > span {\n",
       "  display: inline-block;\n",
       "  padding-left: 0.5em;\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:disabled + label {\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-section-summary-in + label:before {\n",
       "  display: inline-block;\n",
       "  content: '►';\n",
       "  font-size: 11px;\n",
       "  width: 15px;\n",
       "  text-align: center;\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:disabled + label:before {\n",
       "  color: var(--xr-disabled-color);\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:checked + label:before {\n",
       "  content: '▼';\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:checked + label > span {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-section-summary,\n",
       ".xr-section-inline-details {\n",
       "  padding-top: 4px;\n",
       "  padding-bottom: 4px;\n",
       "}\n",
       "\n",
       ".xr-section-inline-details {\n",
       "  grid-column: 2 / -1;\n",
       "}\n",
       "\n",
       ".xr-section-details {\n",
       "  display: none;\n",
       "  grid-column: 1 / -1;\n",
       "  margin-bottom: 5px;\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:checked ~ .xr-section-details {\n",
       "  display: contents;\n",
       "}\n",
       "\n",
       ".xr-array-wrap {\n",
       "  grid-column: 1 / -1;\n",
       "  display: grid;\n",
       "  grid-template-columns: 20px auto;\n",
       "}\n",
       "\n",
       ".xr-array-wrap > label {\n",
       "  grid-column: 1;\n",
       "  vertical-align: top;\n",
       "}\n",
       "\n",
       ".xr-preview {\n",
       "  color: var(--xr-font-color3);\n",
       "}\n",
       "\n",
       ".xr-array-preview,\n",
       ".xr-array-data {\n",
       "  padding: 0 5px !important;\n",
       "  grid-column: 2;\n",
       "}\n",
       "\n",
       ".xr-array-data,\n",
       ".xr-array-in:checked ~ .xr-array-preview {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-array-in:checked ~ .xr-array-data,\n",
       ".xr-array-preview {\n",
       "  display: inline-block;\n",
       "}\n",
       "\n",
       ".xr-dim-list {\n",
       "  display: inline-block !important;\n",
       "  list-style: none;\n",
       "  padding: 0 !important;\n",
       "  margin: 0;\n",
       "}\n",
       "\n",
       ".xr-dim-list li {\n",
       "  display: inline-block;\n",
       "  padding: 0;\n",
       "  margin: 0;\n",
       "}\n",
       "\n",
       ".xr-dim-list:before {\n",
       "  content: '(';\n",
       "}\n",
       "\n",
       ".xr-dim-list:after {\n",
       "  content: ')';\n",
       "}\n",
       "\n",
       ".xr-dim-list li:not(:last-child):after {\n",
       "  content: ',';\n",
       "  padding-right: 5px;\n",
       "}\n",
       "\n",
       ".xr-has-index {\n",
       "  font-weight: bold;\n",
       "}\n",
       "\n",
       ".xr-var-list,\n",
       ".xr-var-item {\n",
       "  display: contents;\n",
       "}\n",
       "\n",
       ".xr-var-item > div,\n",
       ".xr-var-item label,\n",
       ".xr-var-item > .xr-var-name span {\n",
       "  background-color: var(--xr-background-color-row-even);\n",
       "  margin-bottom: 0;\n",
       "}\n",
       "\n",
       ".xr-var-item > .xr-var-name:hover span {\n",
       "  padding-right: 5px;\n",
       "}\n",
       "\n",
       ".xr-var-list > li:nth-child(odd) > div,\n",
       ".xr-var-list > li:nth-child(odd) > label,\n",
       ".xr-var-list > li:nth-child(odd) > .xr-var-name span {\n",
       "  background-color: var(--xr-background-color-row-odd);\n",
       "}\n",
       "\n",
       ".xr-var-name {\n",
       "  grid-column: 1;\n",
       "}\n",
       "\n",
       ".xr-var-dims {\n",
       "  grid-column: 2;\n",
       "}\n",
       "\n",
       ".xr-var-dtype {\n",
       "  grid-column: 3;\n",
       "  text-align: right;\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-var-preview {\n",
       "  grid-column: 4;\n",
       "}\n",
       "\n",
       ".xr-var-name,\n",
       ".xr-var-dims,\n",
       ".xr-var-dtype,\n",
       ".xr-preview,\n",
       ".xr-attrs dt {\n",
       "  white-space: nowrap;\n",
       "  overflow: hidden;\n",
       "  text-overflow: ellipsis;\n",
       "  padding-right: 10px;\n",
       "}\n",
       "\n",
       ".xr-var-name:hover,\n",
       ".xr-var-dims:hover,\n",
       ".xr-var-dtype:hover,\n",
       ".xr-attrs dt:hover {\n",
       "  overflow: visible;\n",
       "  width: auto;\n",
       "  z-index: 1;\n",
       "}\n",
       "\n",
       ".xr-var-attrs,\n",
       ".xr-var-data {\n",
       "  display: none;\n",
       "  background-color: var(--xr-background-color) !important;\n",
       "  padding-bottom: 5px !important;\n",
       "}\n",
       "\n",
       ".xr-var-attrs-in:checked ~ .xr-var-attrs,\n",
       ".xr-var-data-in:checked ~ .xr-var-data {\n",
       "  display: block;\n",
       "}\n",
       "\n",
       ".xr-var-data > table {\n",
       "  float: right;\n",
       "}\n",
       "\n",
       ".xr-var-name span,\n",
       ".xr-var-data,\n",
       ".xr-attrs {\n",
       "  padding-left: 25px !important;\n",
       "}\n",
       "\n",
       ".xr-attrs,\n",
       ".xr-var-attrs,\n",
       ".xr-var-data {\n",
       "  grid-column: 1 / -1;\n",
       "}\n",
       "\n",
       "dl.xr-attrs {\n",
       "  padding: 0;\n",
       "  margin: 0;\n",
       "  display: grid;\n",
       "  grid-template-columns: 125px auto;\n",
       "}\n",
       "\n",
       ".xr-attrs dt,\n",
       ".xr-attrs dd {\n",
       "  padding: 0;\n",
       "  margin: 0;\n",
       "  float: left;\n",
       "  padding-right: 10px;\n",
       "  width: auto;\n",
       "}\n",
       "\n",
       ".xr-attrs dt {\n",
       "  font-weight: normal;\n",
       "  grid-column: 1;\n",
       "}\n",
       "\n",
       ".xr-attrs dt:hover span {\n",
       "  display: inline-block;\n",
       "  background: var(--xr-background-color);\n",
       "  padding-right: 10px;\n",
       "}\n",
       "\n",
       ".xr-attrs dd {\n",
       "  grid-column: 2;\n",
       "  white-space: pre-wrap;\n",
       "  word-break: break-all;\n",
       "}\n",
       "\n",
       ".xr-icon-database,\n",
       ".xr-icon-file-text2 {\n",
       "  display: inline-block;\n",
       "  vertical-align: middle;\n",
       "  width: 1em;\n",
       "  height: 1.5em !important;\n",
       "  stroke-width: 0;\n",
       "  stroke: currentColor;\n",
       "  fill: currentColor;\n",
       "}\n",
       "</style><pre class='xr-text-repr-fallback'>&lt;xarray.DataArray (d_gene: 3, d_5_del: 21, d_3_del: 21)&gt;\n",
       "array([[[0.00000e+00, 0.00000e+00, 0.00000e+00, ..., 3.19224e-01,\n",
       "         2.89631e-01, 2.11165e-01],\n",
       "        [0.00000e+00, 0.00000e+00, 6.86291e-08, ..., 1.38170e-01,\n",
       "         3.02534e-01, 0.00000e+00],\n",
       "        [0.00000e+00, 0.00000e+00, 1.09220e-03, ..., 4.41026e-02,\n",
       "         0.00000e+00, 0.00000e+00],\n",
       "        ...,\n",
       "        [0.00000e+00, 0.00000e+00, 0.00000e+00, ..., 0.00000e+00,\n",
       "         0.00000e+00, 0.00000e+00],\n",
       "        [0.00000e+00, 0.00000e+00, 0.00000e+00, ..., 0.00000e+00,\n",
       "         0.00000e+00, 0.00000e+00],\n",
       "        [0.00000e+00, 0.00000e+00, 0.00000e+00, ..., 0.00000e+00,\n",
       "         0.00000e+00, 0.00000e+00]],\n",
       "\n",
       "       [[0.00000e+00, 0.00000e+00, 0.00000e+00, ..., 2.11468e-03,\n",
       "         5.71094e-03, 7.95666e-02],\n",
       "        [0.00000e+00, 0.00000e+00, 0.00000e+00, ..., 1.50811e-02,\n",
       "         8.09057e-02, 7.76708e-01],\n",
       "        [0.00000e+00, 0.00000e+00, 3.94418e-06, ..., 2.35577e-03,\n",
       "         5.88810e-02, 7.62736e-02],\n",
       "...\n",
       "        [0.00000e+00, 0.00000e+00, 1.25405e-01, ..., 0.00000e+00,\n",
       "         0.00000e+00, 0.00000e+00],\n",
       "        [0.00000e+00, 0.00000e+00, 0.00000e+00, ..., 0.00000e+00,\n",
       "         0.00000e+00, 0.00000e+00],\n",
       "        [0.00000e+00, 0.00000e+00, 0.00000e+00, ..., 0.00000e+00,\n",
       "         0.00000e+00, 0.00000e+00]],\n",
       "\n",
       "       [[0.00000e+00, 0.00000e+00, 0.00000e+00, ..., 1.51398e-04,\n",
       "         1.89857e-02, 6.63111e-01],\n",
       "        [0.00000e+00, 0.00000e+00, 0.00000e+00, ..., 1.29730e-02,\n",
       "         2.58015e-02, 9.39715e-01],\n",
       "        [0.00000e+00, 0.00000e+00, 0.00000e+00, ..., 1.20776e-02,\n",
       "         1.25424e-01, 1.52907e-01],\n",
       "        ...,\n",
       "        [0.00000e+00, 0.00000e+00, 1.62236e-01, ..., 0.00000e+00,\n",
       "         0.00000e+00, 0.00000e+00],\n",
       "        [0.00000e+00, 0.00000e+00, 0.00000e+00, ..., 0.00000e+00,\n",
       "         0.00000e+00, 0.00000e+00],\n",
       "        [0.00000e+00, 0.00000e+00, 0.00000e+00, ..., 0.00000e+00,\n",
       "         0.00000e+00, 0.00000e+00]]])\n",
       "Coordinates:\n",
       "  * d_gene        (d_gene) int64 0 1 2\n",
       "    lbl__d_gene   (d_gene) object &#x27; TRBD1*01&#x27; &#x27; TRBD2*01&#x27; &#x27; TRBD2*02&#x27;\n",
       "    seq__d_gene   (d_gene) object &#x27;GGGACAGGGGGC&#x27; ... &#x27;GGGACTAGCGGGAGGG&#x27;\n",
       "  * d_5_del       (d_5_del) int64 0 1 2 3 4 5 6 7 8 ... 13 14 15 16 17 18 19 20\n",
       "    lbl__d_5_del  (d_5_del) int64 -4 -3 -2 -1 0 1 2 3 ... 9 10 11 12 13 14 15 16\n",
       "  * d_3_del       (d_3_del) int64 0 1 2 3 4 5 6 7 8 ... 13 14 15 16 17 18 19 20\n",
       "    lbl__d_3_del  (d_3_del) int64 -4 -3 -2 -1 0 1 2 3 ... 9 10 11 12 13 14 15 16\n",
       "Attributes:\n",
       "    nickname:    d_3_del\n",
       "    event_type:  Deletion\n",
       "    seq_type:    D_gene\n",
       "    seq_side:    Three_prime\n",
       "    priority:    5\n",
       "    parents:     [&#x27;d_gene&#x27;, &#x27;d_5_del&#x27;]\n",
       "    childs:      []</pre><div class='xr-wrap' hidden><div class='xr-header'><div class='xr-obj-type'>xarray.DataArray</div><div class='xr-array-name'></div><ul class='xr-dim-list'><li><span class='xr-has-index'>d_gene</span>: 3</li><li><span class='xr-has-index'>d_5_del</span>: 21</li><li><span class='xr-has-index'>d_3_del</span>: 21</li></ul></div><ul class='xr-sections'><li class='xr-section-item'><div class='xr-array-wrap'><input id='section-8fbfbfed-21e1-4f4d-baec-0e718f7a12f8' class='xr-array-in' type='checkbox' checked><label for='section-8fbfbfed-21e1-4f4d-baec-0e718f7a12f8' title='Show/hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-array-preview xr-preview'><span>0.0 0.0 0.0 1.647e-08 0.004823 1.081e-09 ... 0.0 0.0 0.0 0.0 0.0 0.0</span></div><div class='xr-array-data'><pre>array([[[0.00000e+00, 0.00000e+00, 0.00000e+00, ..., 3.19224e-01,\n",
       "         2.89631e-01, 2.11165e-01],\n",
       "        [0.00000e+00, 0.00000e+00, 6.86291e-08, ..., 1.38170e-01,\n",
       "         3.02534e-01, 0.00000e+00],\n",
       "        [0.00000e+00, 0.00000e+00, 1.09220e-03, ..., 4.41026e-02,\n",
       "         0.00000e+00, 0.00000e+00],\n",
       "        ...,\n",
       "        [0.00000e+00, 0.00000e+00, 0.00000e+00, ..., 0.00000e+00,\n",
       "         0.00000e+00, 0.00000e+00],\n",
       "        [0.00000e+00, 0.00000e+00, 0.00000e+00, ..., 0.00000e+00,\n",
       "         0.00000e+00, 0.00000e+00],\n",
       "        [0.00000e+00, 0.00000e+00, 0.00000e+00, ..., 0.00000e+00,\n",
       "         0.00000e+00, 0.00000e+00]],\n",
       "\n",
       "       [[0.00000e+00, 0.00000e+00, 0.00000e+00, ..., 2.11468e-03,\n",
       "         5.71094e-03, 7.95666e-02],\n",
       "        [0.00000e+00, 0.00000e+00, 0.00000e+00, ..., 1.50811e-02,\n",
       "         8.09057e-02, 7.76708e-01],\n",
       "        [0.00000e+00, 0.00000e+00, 3.94418e-06, ..., 2.35577e-03,\n",
       "         5.88810e-02, 7.62736e-02],\n",
       "...\n",
       "        [0.00000e+00, 0.00000e+00, 1.25405e-01, ..., 0.00000e+00,\n",
       "         0.00000e+00, 0.00000e+00],\n",
       "        [0.00000e+00, 0.00000e+00, 0.00000e+00, ..., 0.00000e+00,\n",
       "         0.00000e+00, 0.00000e+00],\n",
       "        [0.00000e+00, 0.00000e+00, 0.00000e+00, ..., 0.00000e+00,\n",
       "         0.00000e+00, 0.00000e+00]],\n",
       "\n",
       "       [[0.00000e+00, 0.00000e+00, 0.00000e+00, ..., 1.51398e-04,\n",
       "         1.89857e-02, 6.63111e-01],\n",
       "        [0.00000e+00, 0.00000e+00, 0.00000e+00, ..., 1.29730e-02,\n",
       "         2.58015e-02, 9.39715e-01],\n",
       "        [0.00000e+00, 0.00000e+00, 0.00000e+00, ..., 1.20776e-02,\n",
       "         1.25424e-01, 1.52907e-01],\n",
       "        ...,\n",
       "        [0.00000e+00, 0.00000e+00, 1.62236e-01, ..., 0.00000e+00,\n",
       "         0.00000e+00, 0.00000e+00],\n",
       "        [0.00000e+00, 0.00000e+00, 0.00000e+00, ..., 0.00000e+00,\n",
       "         0.00000e+00, 0.00000e+00],\n",
       "        [0.00000e+00, 0.00000e+00, 0.00000e+00, ..., 0.00000e+00,\n",
       "         0.00000e+00, 0.00000e+00]]])</pre></div></div></li><li class='xr-section-item'><input id='section-9c16ed3c-107e-4e95-bbf9-49eb94305598' class='xr-section-summary-in' type='checkbox'  checked><label for='section-9c16ed3c-107e-4e95-bbf9-49eb94305598' class='xr-section-summary' >Coordinates: <span>(7)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>d_gene</span></div><div class='xr-var-dims'>(d_gene)</div><div class='xr-var-dtype'>int64</div><div class='xr-var-preview xr-preview'>0 1 2</div><input id='attrs-e21a8dee-0068-4c28-8fa0-d38a3345ca6c' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-e21a8dee-0068-4c28-8fa0-d38a3345ca6c' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-6c5bf00b-9e43-4435-aa3a-a1969cc00c28' class='xr-var-data-in' type='checkbox'><label for='data-6c5bf00b-9e43-4435-aa3a-a1969cc00c28' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([0, 1, 2])</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>lbl__d_gene</span></div><div class='xr-var-dims'>(d_gene)</div><div class='xr-var-dtype'>object</div><div class='xr-var-preview xr-preview'>&#x27; TRBD1*01&#x27; &#x27; TRBD2*01&#x27; &#x27; TRBD2*02&#x27;</div><input id='attrs-f1045410-c4e4-4baa-97b5-472dd98b47d9' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-f1045410-c4e4-4baa-97b5-472dd98b47d9' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-2637686a-4698-4908-b49d-a39a9e1b93e1' class='xr-var-data-in' type='checkbox'><label for='data-2637686a-4698-4908-b49d-a39a9e1b93e1' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([&#x27; TRBD1*01&#x27;, &#x27; TRBD2*01&#x27;, &#x27; TRBD2*02&#x27;], dtype=object)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>seq__d_gene</span></div><div class='xr-var-dims'>(d_gene)</div><div class='xr-var-dtype'>object</div><div class='xr-var-preview xr-preview'>&#x27;GGGACAGGGGGC&#x27; ... &#x27;GGGACTAGCGGG...</div><input id='attrs-ed8fb216-ce12-4e27-9bd8-cbfb2918936d' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-ed8fb216-ce12-4e27-9bd8-cbfb2918936d' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-fe3c49ef-f9e6-4a3e-bcb5-42910bf582f7' class='xr-var-data-in' type='checkbox'><label for='data-fe3c49ef-f9e6-4a3e-bcb5-42910bf582f7' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([&#x27;GGGACAGGGGGC&#x27;, &#x27;GGGACTAGCGGGGGGG&#x27;, &#x27;GGGACTAGCGGGAGGG&#x27;],\n",
       "      dtype=object)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>d_5_del</span></div><div class='xr-var-dims'>(d_5_del)</div><div class='xr-var-dtype'>int64</div><div class='xr-var-preview xr-preview'>0 1 2 3 4 5 6 ... 15 16 17 18 19 20</div><input id='attrs-3f2c55c2-9849-434d-b0be-28dcba549a60' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-3f2c55c2-9849-434d-b0be-28dcba549a60' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-d7704af9-a504-4f61-b02c-0ca6fa457491' class='xr-var-data-in' type='checkbox'><label for='data-d7704af9-a504-4f61-b02c-0ca6fa457491' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16, 17,\n",
       "       18, 19, 20])</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>lbl__d_5_del</span></div><div class='xr-var-dims'>(d_5_del)</div><div class='xr-var-dtype'>int64</div><div class='xr-var-preview xr-preview'>-4 -3 -2 -1 0 1 ... 12 13 14 15 16</div><input id='attrs-99e186c7-8cec-404c-b345-c79d36b15f00' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-99e186c7-8cec-404c-b345-c79d36b15f00' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-77fc2eb7-558c-42e3-8516-3eaef807d431' class='xr-var-data-in' type='checkbox'><label for='data-77fc2eb7-558c-42e3-8516-3eaef807d431' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([-4, -3, -2, -1,  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12,\n",
       "       13, 14, 15, 16])</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>d_3_del</span></div><div class='xr-var-dims'>(d_3_del)</div><div class='xr-var-dtype'>int64</div><div class='xr-var-preview xr-preview'>0 1 2 3 4 5 6 ... 15 16 17 18 19 20</div><input id='attrs-b2d40e54-0cf8-4b3a-b604-2e16f424c7fd' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-b2d40e54-0cf8-4b3a-b604-2e16f424c7fd' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-b48a04be-5cbd-4cb0-abf4-869a6f259122' class='xr-var-data-in' type='checkbox'><label for='data-b48a04be-5cbd-4cb0-abf4-869a6f259122' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16, 17,\n",
       "       18, 19, 20])</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>lbl__d_3_del</span></div><div class='xr-var-dims'>(d_3_del)</div><div class='xr-var-dtype'>int64</div><div class='xr-var-preview xr-preview'>-4 -3 -2 -1 0 1 ... 12 13 14 15 16</div><input id='attrs-cfb4349f-db80-4492-a807-7176bd9cdc6d' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-cfb4349f-db80-4492-a807-7176bd9cdc6d' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-3ad68428-084b-4ce4-8573-deb80250fda9' class='xr-var-data-in' type='checkbox'><label for='data-3ad68428-084b-4ce4-8573-deb80250fda9' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([-4, -3, -2, -1,  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12,\n",
       "       13, 14, 15, 16])</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-fbc22f59-64e6-4d5a-984f-4079435eeee7' class='xr-section-summary-in' type='checkbox'  checked><label for='section-fbc22f59-64e6-4d5a-984f-4079435eeee7' class='xr-section-summary' >Attributes: <span>(7)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><dl class='xr-attrs'><dt><span>nickname :</span></dt><dd>d_3_del</dd><dt><span>event_type :</span></dt><dd>Deletion</dd><dt><span>seq_type :</span></dt><dd>D_gene</dd><dt><span>seq_side :</span></dt><dd>Three_prime</dd><dt><span>priority :</span></dt><dd>5</dd><dt><span>parents :</span></dt><dd>[&#x27;d_gene&#x27;, &#x27;d_5_del&#x27;]</dd><dt><span>childs :</span></dt><dd>[]</dd></dl></div></li></ul></div></div>"
      ],
      "text/plain": [
       "<xarray.DataArray (d_gene: 3, d_5_del: 21, d_3_del: 21)>\n",
       "array([[[0.00000e+00, 0.00000e+00, 0.00000e+00, ..., 3.19224e-01,\n",
       "         2.89631e-01, 2.11165e-01],\n",
       "        [0.00000e+00, 0.00000e+00, 6.86291e-08, ..., 1.38170e-01,\n",
       "         3.02534e-01, 0.00000e+00],\n",
       "        [0.00000e+00, 0.00000e+00, 1.09220e-03, ..., 4.41026e-02,\n",
       "         0.00000e+00, 0.00000e+00],\n",
       "        ...,\n",
       "        [0.00000e+00, 0.00000e+00, 0.00000e+00, ..., 0.00000e+00,\n",
       "         0.00000e+00, 0.00000e+00],\n",
       "        [0.00000e+00, 0.00000e+00, 0.00000e+00, ..., 0.00000e+00,\n",
       "         0.00000e+00, 0.00000e+00],\n",
       "        [0.00000e+00, 0.00000e+00, 0.00000e+00, ..., 0.00000e+00,\n",
       "         0.00000e+00, 0.00000e+00]],\n",
       "\n",
       "       [[0.00000e+00, 0.00000e+00, 0.00000e+00, ..., 2.11468e-03,\n",
       "         5.71094e-03, 7.95666e-02],\n",
       "        [0.00000e+00, 0.00000e+00, 0.00000e+00, ..., 1.50811e-02,\n",
       "         8.09057e-02, 7.76708e-01],\n",
       "        [0.00000e+00, 0.00000e+00, 3.94418e-06, ..., 2.35577e-03,\n",
       "         5.88810e-02, 7.62736e-02],\n",
       "...\n",
       "        [0.00000e+00, 0.00000e+00, 1.25405e-01, ..., 0.00000e+00,\n",
       "         0.00000e+00, 0.00000e+00],\n",
       "        [0.00000e+00, 0.00000e+00, 0.00000e+00, ..., 0.00000e+00,\n",
       "         0.00000e+00, 0.00000e+00],\n",
       "        [0.00000e+00, 0.00000e+00, 0.00000e+00, ..., 0.00000e+00,\n",
       "         0.00000e+00, 0.00000e+00]],\n",
       "\n",
       "       [[0.00000e+00, 0.00000e+00, 0.00000e+00, ..., 1.51398e-04,\n",
       "         1.89857e-02, 6.63111e-01],\n",
       "        [0.00000e+00, 0.00000e+00, 0.00000e+00, ..., 1.29730e-02,\n",
       "         2.58015e-02, 9.39715e-01],\n",
       "        [0.00000e+00, 0.00000e+00, 0.00000e+00, ..., 1.20776e-02,\n",
       "         1.25424e-01, 1.52907e-01],\n",
       "        ...,\n",
       "        [0.00000e+00, 0.00000e+00, 1.62236e-01, ..., 0.00000e+00,\n",
       "         0.00000e+00, 0.00000e+00],\n",
       "        [0.00000e+00, 0.00000e+00, 0.00000e+00, ..., 0.00000e+00,\n",
       "         0.00000e+00, 0.00000e+00],\n",
       "        [0.00000e+00, 0.00000e+00, 0.00000e+00, ..., 0.00000e+00,\n",
       "         0.00000e+00, 0.00000e+00]]])\n",
       "Coordinates:\n",
       "  * d_gene        (d_gene) int64 0 1 2\n",
       "    lbl__d_gene   (d_gene) object ' TRBD1*01' ' TRBD2*01' ' TRBD2*02'\n",
       "    seq__d_gene   (d_gene) object 'GGGACAGGGGGC' ... 'GGGACTAGCGGGAGGG'\n",
       "  * d_5_del       (d_5_del) int64 0 1 2 3 4 5 6 7 8 ... 13 14 15 16 17 18 19 20\n",
       "    lbl__d_5_del  (d_5_del) int64 -4 -3 -2 -1 0 1 2 3 ... 9 10 11 12 13 14 15 16\n",
       "  * d_3_del       (d_3_del) int64 0 1 2 3 4 5 6 7 8 ... 13 14 15 16 17 18 19 20\n",
       "    lbl__d_3_del  (d_3_del) int64 -4 -3 -2 -1 0 1 2 3 ... 9 10 11 12 13 14 15 16\n",
       "Attributes:\n",
       "    nickname:    d_3_del\n",
       "    event_type:  Deletion\n",
       "    seq_type:    D_gene\n",
       "    seq_side:    Three_prime\n",
       "    priority:    5\n",
       "    parents:     ['d_gene', 'd_5_del']\n",
       "    childs:      []"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mdl_hb['d_3_del']"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Bayesian Network"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "To visualize the composition of the Bayesina network we can use"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<AxesSubplot:>"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "[encoded data, 23180 characters]\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "mdl_hb.plot_Bayes_network()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Similarly we can do the same for a human $\\alpha$ T-cell receptor"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Reading Parms filename from:  /home/olivares/.local/share/igor/models/human/tcr_alpha/models/model_parms.txt\n",
      "Reading Marginals filename from:  /home/olivares/.local/share/igor/models/human/tcr_alpha/models/model_marginals.txt\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "<AxesSubplot:>"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "[encoded data, 13980 characters]\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "mdl_ha = p3.get_default_IgorModel(\"human\", \"tcr_alpha\")\n",
    "mdl_ha.plot_Bayes_network()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Notice that for a $\\beta$ T-cell receptor we get a VDJ model and for the $\\alpha$ only a VJ."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "An IgorModel internally has two structure based in IGoR's model files:\n",
    " - model_parms.txt that contains the information about the events name, nickname, priority, and the dependencies between each other.\n",
    " - model_marginals.txt which contains the conditional probabilities for each event.\n",
    " - CDR3 anchors files."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## IgorModel_Parms"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      ".xdata['v_3_del', 'j_choice', 'd_5_del', 'vd_dinucl', 'dj_dinucl', 'd_gene', 'v_choice', 'd_3_del', 'j_5_del', 'dj_ins', 'vd_ins']\n"
     ]
    }
   ],
   "source": [
    "print(mdl_hb)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(<pygor3.IgorIO.IgorModel_Parms at 0x7fac64302950>,\n",
       " <pygor3.IgorIO.IgorModel_Marginals at 0x7fac6459d710>)"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mdl_hb.parms, mdl_hb.marginals"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "To get a pandas dataframe of the realizations of an event just use the nickname of the event."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "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>value</th>\n",
       "      <th>name</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>id</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>GGGACAGGGGGC</td>\n",
       "      <td>TRBD1*01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>GGGACTAGCGGGGGGG</td>\n",
       "      <td>TRBD2*01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>GGGACTAGCGGGAGGG</td>\n",
       "      <td>TRBD2*02</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "               value       name\n",
       "id                             \n",
       "0       GGGACAGGGGGC   TRBD1*01\n",
       "1   GGGACTAGCGGGGGGG   TRBD2*01\n",
       "2   GGGACTAGCGGGAGGG   TRBD2*02"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mdl_hb.parms['d_gene']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'event_type': 'GeneChoice',\n",
       " 'seq_type': 'D_gene',\n",
       " 'seq_side': 'Undefined_side',\n",
       " 'priority': 6,\n",
       " 'realizations': [{'id': 0, 'value': 'GGGACAGGGGGC', 'name': ' TRBD1*01'},\n",
       "  {'id': 1, 'value': 'GGGACTAGCGGGGGGG', 'name': ' TRBD2*01'},\n",
       "  {'id': 2, 'value': 'GGGACTAGCGGGAGGG', 'name': ' TRBD2*02'}],\n",
       " 'name': 'GeneChoice_D_gene_Undefined_side_prio6_size3',\n",
       " 'nickname': 'd_gene'}"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "event = mdl_hb.parms.get_Event('d_gene')\n",
    "event.to_dict()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "All parameters of the events have 3 columns id, value and name. For the GeneChoice events like 'd_gene'(above) the value is the sequence and the name the description of the sequence and for Deletion events like 'd_3_del' the value is an integer of the posible deletions. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "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>value</th>\n",
       "      <th>name</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>id</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>-4</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>-3</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>-2</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>-1</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>1</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>2</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>3</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>4</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>5</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>6</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>7</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>8</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>9</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>10</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>11</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>12</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>13</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>14</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>15</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>16</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    value name\n",
       "id            \n",
       "0      -4     \n",
       "1      -3     \n",
       "2      -2     \n",
       "3      -1     \n",
       "4       0     \n",
       "5       1     \n",
       "6       2     \n",
       "7       3     \n",
       "8       4     \n",
       "9       5     \n",
       "10      6     \n",
       "11      7     \n",
       "12      8     \n",
       "13      9     \n",
       "14     10     \n",
       "15     11     \n",
       "16     12     \n",
       "17     13     \n",
       "18     14     \n",
       "19     15     \n",
       "20     16     "
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mdl_hb.parms['d_3_del']"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Notice that for Deletion event negative values mean palidromic insertions"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Aditionally the anchors dataframe are stores in parms.df_V_anchors for CDR3 V anchors and parms.df_J_anchors for J with gene (gene name) as index in"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "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>anchor_index</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>gene</th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>K02545|TRBJ1-1*01|Homo sapiens|F|J-REGION|749..796|48 nt|3| | | | |48+0=48| | |</th>\n",
       "      <td>17</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>K02545|TRBJ1-2*01|Homo sapiens|F|J-REGION|886..933|48 nt|3| | | | |48+0=48| | |</th>\n",
       "      <td>17</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>M14158|TRBJ1-3*01|Homo sapiens|F|J-REGION|1499..1548|50 nt|2| | | | |50+0=50| | |</th>\n",
       "      <td>19</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>M14158|TRBJ1-4*01|Homo sapiens|F|J-REGION|2095..2145|51 nt|3| | | | |51+0=51| | |</th>\n",
       "      <td>20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>M14158|TRBJ1-5*01|Homo sapiens|F|J-REGION|2368..2417|50 nt|2| | | | |50+0=50| | |</th>\n",
       "      <td>19</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>M14158|TRBJ1-6*01|Homo sapiens|F|J-REGION|2859..2911|53 nt|2| | | | |53+0=53| | |</th>\n",
       "      <td>22</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>L36092|TRBJ1-6*02|Homo sapiens|F|J-REGION|643043..643095|53 nt|2| | | | |53+0=53| | |</th>\n",
       "      <td>22</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>X02987|TRBJ2-1*01|Homo sapiens|F|J-REGION|800..849|50 nt|2| | | | |50+0=50| | |</th>\n",
       "      <td>19</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>X02987|TRBJ2-2*01|Homo sapiens|F|J-REGION|995..1045|51 nt|3| | | | |51+0=51| | |</th>\n",
       "      <td>20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>X02987|TRBJ2-3*01|Homo sapiens|F|J-REGION|1282..1330|49 nt|1| | | | |49+0=49| | |</th>\n",
       "      <td>18</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>X02987|TRBJ2-4*01|Homo sapiens|F|J-REGION|1432..1481|50 nt|2| | | | |50+0=50| | |</th>\n",
       "      <td>19</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>X02987|TRBJ2-5*01|Homo sapiens|F|J-REGION|1553..1600|48 nt|3| | | | |48+0=48| | |</th>\n",
       "      <td>17</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>X02987|TRBJ2-6*01|Homo sapiens|F|J-REGION|1673..1725|53 nt|2| | | | |53+0=53| | |</th>\n",
       "      <td>22</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>M14159|TRBJ2-7*01|Homo sapiens|F|J-REGION|2316..2362|47 nt|2| | | | |47+0=47| | |</th>\n",
       "      <td>16</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>X02987|TRBJ2-7*02|Homo sapiens|ORF|J-REGION|1890..1936|47 nt|2| | | | |47+0=47| | |</th>\n",
       "      <td>16</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                    anchor_index\n",
       "gene                                                            \n",
       "K02545|TRBJ1-1*01|Homo sapiens|F|J-REGION|749.....            17\n",
       "K02545|TRBJ1-2*01|Homo sapiens|F|J-REGION|886.....            17\n",
       "M14158|TRBJ1-3*01|Homo sapiens|F|J-REGION|1499....            19\n",
       "M14158|TRBJ1-4*01|Homo sapiens|F|J-REGION|2095....            20\n",
       "M14158|TRBJ1-5*01|Homo sapiens|F|J-REGION|2368....            19\n",
       "M14158|TRBJ1-6*01|Homo sapiens|F|J-REGION|2859....            22\n",
       "L36092|TRBJ1-6*02|Homo sapiens|F|J-REGION|64304...            22\n",
       "X02987|TRBJ2-1*01|Homo sapiens|F|J-REGION|800.....            19\n",
       "X02987|TRBJ2-2*01|Homo sapiens|F|J-REGION|995.....            20\n",
       "X02987|TRBJ2-3*01|Homo sapiens|F|J-REGION|1282....            18\n",
       "X02987|TRBJ2-4*01|Homo sapiens|F|J-REGION|1432....            19\n",
       "X02987|TRBJ2-5*01|Homo sapiens|F|J-REGION|1553....            17\n",
       "X02987|TRBJ2-6*01|Homo sapiens|F|J-REGION|1673....            22\n",
       "M14159|TRBJ2-7*01|Homo sapiens|F|J-REGION|2316....            16\n",
       "X02987|TRBJ2-7*02|Homo sapiens|ORF|J-REGION|189...            16"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mdl_hb.parms.df_J_anchors"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## IgorModel_Marginals"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "IgorModel_Marginals contains the conditional probabilities for each event. \n",
    "\n",
    "> :ATTENTION: **IGoR's model_marginals.txt stores conditional probabilities of the defined events, not marginals probabilities.**\n",
    "\n",
    "The conditional probability as a numpy array can be access with"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[1.28586e-01, 1.04003e-01, 4.10916e-02, ..., 0.00000e+00,\n",
       "        5.36364e-02, 3.73186e-02],\n",
       "       [1.66126e-01, 7.89615e-02, 1.13701e-02, ..., 2.46074e-02,\n",
       "        6.49049e-02, 7.46140e-02],\n",
       "       [1.66156e-01, 7.90103e-02, 1.13744e-02, ..., 2.45354e-02,\n",
       "        6.49334e-02, 7.46554e-02],\n",
       "       ...,\n",
       "       [1.24050e-01, 4.76394e-02, 0.00000e+00, ..., 3.52196e-02,\n",
       "        5.51254e-02, 6.01472e-02],\n",
       "       [3.64941e-06, 2.04721e-09, 0.00000e+00, ..., 3.41728e-01,\n",
       "        6.84855e-02, 8.22442e-02],\n",
       "       [1.06077e-01, 1.13773e-01, 4.03129e-02, ..., 2.20679e-02,\n",
       "        7.16947e-02, 5.81105e-02]])"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mdl_hb.marginals['j_choice']"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## DataArrays with parms and marginals"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The mdl_hb object encapsulates the information about IGoR's model, like the Bayes network and the corresponding conditional probabilities for each event and the information about the parms and marginals can be access directly from the xarray in IgorModel without using IgorModel_Parms and IgorModel_Marginals like"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Conditional probabilities"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "To get the conditional probabilities associated with this model we can the DataArray as\n",
    "\n",
    "IgorModel['event_nickname']\n",
    "\n",
    "For instance from this Bayesian network, we can see that for this model the choice of V ('v_choice') or the number of insertions between the V and D segments are independent of the rest of events. Hence, \n",
    "\n",
    "$P(\\text{v_choice})$ = mdl_hb['v_choice']\n",
    "\n",
    "However, for events like 'd_gene' or 'j_5_del' there are some conditional dependencies, therefore the notation in pygor \n",
    "\n",
    "$P(\\text{d_gene}| \\text{v_choice}, \\text{j_choice})$ = mdl_hb['d_gene']\n",
    "\n",
    "The get the dependencies information there is variable parents as attribute"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><svg style=\"position: absolute; width: 0; height: 0; overflow: hidden\">\n",
       "<defs>\n",
       "<symbol id=\"icon-database\" viewBox=\"0 0 32 32\">\n",
       "<path d=\"M16 0c-8.837 0-16 2.239-16 5v4c0 2.761 7.163 5 16 5s16-2.239 16-5v-4c0-2.761-7.163-5-16-5z\"></path>\n",
       "<path d=\"M16 17c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
       "<path d=\"M16 26c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
       "</symbol>\n",
       "<symbol id=\"icon-file-text2\" viewBox=\"0 0 32 32\">\n",
       "<path d=\"M28.681 7.159c-0.694-0.947-1.662-2.053-2.724-3.116s-2.169-2.030-3.116-2.724c-1.612-1.182-2.393-1.319-2.841-1.319h-15.5c-1.378 0-2.5 1.121-2.5 2.5v27c0 1.378 1.122 2.5 2.5 2.5h23c1.378 0 2.5-1.122 2.5-2.5v-19.5c0-0.448-0.137-1.23-1.319-2.841zM24.543 5.457c0.959 0.959 1.712 1.825 2.268 2.543h-4.811v-4.811c0.718 0.556 1.584 1.309 2.543 2.268zM28 29.5c0 0.271-0.229 0.5-0.5 0.5h-23c-0.271 0-0.5-0.229-0.5-0.5v-27c0-0.271 0.229-0.5 0.5-0.5 0 0 15.499-0 15.5 0v7c0 0.552 0.448 1 1 1h7v19.5z\"></path>\n",
       "<path d=\"M23 26h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
       "<path d=\"M23 22h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
       "<path d=\"M23 18h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
       "</symbol>\n",
       "</defs>\n",
       "</svg>\n",
       "<style>/* CSS stylesheet for displaying xarray objects in jupyterlab.\n",
       " *\n",
       " */\n",
       "\n",
       ":root {\n",
       "  --xr-font-color0: var(--jp-content-font-color0, rgba(0, 0, 0, 1));\n",
       "  --xr-font-color2: var(--jp-content-font-color2, rgba(0, 0, 0, 0.54));\n",
       "  --xr-font-color3: var(--jp-content-font-color3, rgba(0, 0, 0, 0.38));\n",
       "  --xr-border-color: var(--jp-border-color2, #e0e0e0);\n",
       "  --xr-disabled-color: var(--jp-layout-color3, #bdbdbd);\n",
       "  --xr-background-color: var(--jp-layout-color0, white);\n",
       "  --xr-background-color-row-even: var(--jp-layout-color1, white);\n",
       "  --xr-background-color-row-odd: var(--jp-layout-color2, #eeeeee);\n",
       "}\n",
       "\n",
       "html[theme=dark],\n",
       "body.vscode-dark {\n",
       "  --xr-font-color0: rgba(255, 255, 255, 1);\n",
       "  --xr-font-color2: rgba(255, 255, 255, 0.54);\n",
       "  --xr-font-color3: rgba(255, 255, 255, 0.38);\n",
       "  --xr-border-color: #1F1F1F;\n",
       "  --xr-disabled-color: #515151;\n",
       "  --xr-background-color: #111111;\n",
       "  --xr-background-color-row-even: #111111;\n",
       "  --xr-background-color-row-odd: #313131;\n",
       "}\n",
       "\n",
       ".xr-wrap {\n",
       "  display: block;\n",
       "  min-width: 300px;\n",
       "  max-width: 700px;\n",
       "}\n",
       "\n",
       ".xr-text-repr-fallback {\n",
       "  /* fallback to plain text repr when CSS is not injected (untrusted notebook) */\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-header {\n",
       "  padding-top: 6px;\n",
       "  padding-bottom: 6px;\n",
       "  margin-bottom: 4px;\n",
       "  border-bottom: solid 1px var(--xr-border-color);\n",
       "}\n",
       "\n",
       ".xr-header > div,\n",
       ".xr-header > ul {\n",
       "  display: inline;\n",
       "  margin-top: 0;\n",
       "  margin-bottom: 0;\n",
       "}\n",
       "\n",
       ".xr-obj-type,\n",
       ".xr-array-name {\n",
       "  margin-left: 2px;\n",
       "  margin-right: 10px;\n",
       "}\n",
       "\n",
       ".xr-obj-type {\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-sections {\n",
       "  padding-left: 0 !important;\n",
       "  display: grid;\n",
       "  grid-template-columns: 150px auto auto 1fr 20px 20px;\n",
       "}\n",
       "\n",
       ".xr-section-item {\n",
       "  display: contents;\n",
       "}\n",
       "\n",
       ".xr-section-item input {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-section-item input + label {\n",
       "  color: var(--xr-disabled-color);\n",
       "}\n",
       "\n",
       ".xr-section-item input:enabled + label {\n",
       "  cursor: pointer;\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-section-item input:enabled + label:hover {\n",
       "  color: var(--xr-font-color0);\n",
       "}\n",
       "\n",
       ".xr-section-summary {\n",
       "  grid-column: 1;\n",
       "  color: var(--xr-font-color2);\n",
       "  font-weight: 500;\n",
       "}\n",
       "\n",
       ".xr-section-summary > span {\n",
       "  display: inline-block;\n",
       "  padding-left: 0.5em;\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:disabled + label {\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-section-summary-in + label:before {\n",
       "  display: inline-block;\n",
       "  content: '►';\n",
       "  font-size: 11px;\n",
       "  width: 15px;\n",
       "  text-align: center;\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:disabled + label:before {\n",
       "  color: var(--xr-disabled-color);\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:checked + label:before {\n",
       "  content: '▼';\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:checked + label > span {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-section-summary,\n",
       ".xr-section-inline-details {\n",
       "  padding-top: 4px;\n",
       "  padding-bottom: 4px;\n",
       "}\n",
       "\n",
       ".xr-section-inline-details {\n",
       "  grid-column: 2 / -1;\n",
       "}\n",
       "\n",
       ".xr-section-details {\n",
       "  display: none;\n",
       "  grid-column: 1 / -1;\n",
       "  margin-bottom: 5px;\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:checked ~ .xr-section-details {\n",
       "  display: contents;\n",
       "}\n",
       "\n",
       ".xr-array-wrap {\n",
       "  grid-column: 1 / -1;\n",
       "  display: grid;\n",
       "  grid-template-columns: 20px auto;\n",
       "}\n",
       "\n",
       ".xr-array-wrap > label {\n",
       "  grid-column: 1;\n",
       "  vertical-align: top;\n",
       "}\n",
       "\n",
       ".xr-preview {\n",
       "  color: var(--xr-font-color3);\n",
       "}\n",
       "\n",
       ".xr-array-preview,\n",
       ".xr-array-data {\n",
       "  padding: 0 5px !important;\n",
       "  grid-column: 2;\n",
       "}\n",
       "\n",
       ".xr-array-data,\n",
       ".xr-array-in:checked ~ .xr-array-preview {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-array-in:checked ~ .xr-array-data,\n",
       ".xr-array-preview {\n",
       "  display: inline-block;\n",
       "}\n",
       "\n",
       ".xr-dim-list {\n",
       "  display: inline-block !important;\n",
       "  list-style: none;\n",
       "  padding: 0 !important;\n",
       "  margin: 0;\n",
       "}\n",
       "\n",
       ".xr-dim-list li {\n",
       "  display: inline-block;\n",
       "  padding: 0;\n",
       "  margin: 0;\n",
       "}\n",
       "\n",
       ".xr-dim-list:before {\n",
       "  content: '(';\n",
       "}\n",
       "\n",
       ".xr-dim-list:after {\n",
       "  content: ')';\n",
       "}\n",
       "\n",
       ".xr-dim-list li:not(:last-child):after {\n",
       "  content: ',';\n",
       "  padding-right: 5px;\n",
       "}\n",
       "\n",
       ".xr-has-index {\n",
       "  font-weight: bold;\n",
       "}\n",
       "\n",
       ".xr-var-list,\n",
       ".xr-var-item {\n",
       "  display: contents;\n",
       "}\n",
       "\n",
       ".xr-var-item > div,\n",
       ".xr-var-item label,\n",
       ".xr-var-item > .xr-var-name span {\n",
       "  background-color: var(--xr-background-color-row-even);\n",
       "  margin-bottom: 0;\n",
       "}\n",
       "\n",
       ".xr-var-item > .xr-var-name:hover span {\n",
       "  padding-right: 5px;\n",
       "}\n",
       "\n",
       ".xr-var-list > li:nth-child(odd) > div,\n",
       ".xr-var-list > li:nth-child(odd) > label,\n",
       ".xr-var-list > li:nth-child(odd) > .xr-var-name span {\n",
       "  background-color: var(--xr-background-color-row-odd);\n",
       "}\n",
       "\n",
       ".xr-var-name {\n",
       "  grid-column: 1;\n",
       "}\n",
       "\n",
       ".xr-var-dims {\n",
       "  grid-column: 2;\n",
       "}\n",
       "\n",
       ".xr-var-dtype {\n",
       "  grid-column: 3;\n",
       "  text-align: right;\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-var-preview {\n",
       "  grid-column: 4;\n",
       "}\n",
       "\n",
       ".xr-var-name,\n",
       ".xr-var-dims,\n",
       ".xr-var-dtype,\n",
       ".xr-preview,\n",
       ".xr-attrs dt {\n",
       "  white-space: nowrap;\n",
       "  overflow: hidden;\n",
       "  text-overflow: ellipsis;\n",
       "  padding-right: 10px;\n",
       "}\n",
       "\n",
       ".xr-var-name:hover,\n",
       ".xr-var-dims:hover,\n",
       ".xr-var-dtype:hover,\n",
       ".xr-attrs dt:hover {\n",
       "  overflow: visible;\n",
       "  width: auto;\n",
       "  z-index: 1;\n",
       "}\n",
       "\n",
       ".xr-var-attrs,\n",
       ".xr-var-data {\n",
       "  display: none;\n",
       "  background-color: var(--xr-background-color) !important;\n",
       "  padding-bottom: 5px !important;\n",
       "}\n",
       "\n",
       ".xr-var-attrs-in:checked ~ .xr-var-attrs,\n",
       ".xr-var-data-in:checked ~ .xr-var-data {\n",
       "  display: block;\n",
       "}\n",
       "\n",
       ".xr-var-data > table {\n",
       "  float: right;\n",
       "}\n",
       "\n",
       ".xr-var-name span,\n",
       ".xr-var-data,\n",
       ".xr-attrs {\n",
       "  padding-left: 25px !important;\n",
       "}\n",
       "\n",
       ".xr-attrs,\n",
       ".xr-var-attrs,\n",
       ".xr-var-data {\n",
       "  grid-column: 1 / -1;\n",
       "}\n",
       "\n",
       "dl.xr-attrs {\n",
       "  padding: 0;\n",
       "  margin: 0;\n",
       "  display: grid;\n",
       "  grid-template-columns: 125px auto;\n",
       "}\n",
       "\n",
       ".xr-attrs dt,\n",
       ".xr-attrs dd {\n",
       "  padding: 0;\n",
       "  margin: 0;\n",
       "  float: left;\n",
       "  padding-right: 10px;\n",
       "  width: auto;\n",
       "}\n",
       "\n",
       ".xr-attrs dt {\n",
       "  font-weight: normal;\n",
       "  grid-column: 1;\n",
       "}\n",
       "\n",
       ".xr-attrs dt:hover span {\n",
       "  display: inline-block;\n",
       "  background: var(--xr-background-color);\n",
       "  padding-right: 10px;\n",
       "}\n",
       "\n",
       ".xr-attrs dd {\n",
       "  grid-column: 2;\n",
       "  white-space: pre-wrap;\n",
       "  word-break: break-all;\n",
       "}\n",
       "\n",
       ".xr-icon-database,\n",
       ".xr-icon-file-text2 {\n",
       "  display: inline-block;\n",
       "  vertical-align: middle;\n",
       "  width: 1em;\n",
       "  height: 1.5em !important;\n",
       "  stroke-width: 0;\n",
       "  stroke: currentColor;\n",
       "  fill: currentColor;\n",
       "}\n",
       "</style><pre class='xr-text-repr-fallback'>&lt;xarray.DataArray (v_choice: 89)&gt;\n",
       "array([4.88741e-03, 9.32369e-03, 9.32259e-03, 1.30320e-02, 3.43430e-04,\n",
       "       8.50694e-03, 7.71250e-03, 6.12276e-04, 5.06104e-03, 4.59289e-05,\n",
       "       4.48245e-03, 8.16181e-03, 7.00053e-04, 7.77164e-03, 1.16174e-02,\n",
       "       1.16158e-02, 1.13872e-02, 1.06555e-02, 2.36870e-03, 2.28368e-02,\n",
       "       1.56715e-04, 4.58447e-03, 0.00000e+00, 4.88782e-05, 0.00000e+00,\n",
       "       1.54500e-02, 2.74050e-02, 5.18979e-03, 4.80289e-03, 1.62765e-01,\n",
       "       6.61229e-02, 2.07174e-02, 7.36226e-04, 2.47846e-37, 1.07472e-02,\n",
       "       2.03820e-02, 9.53245e-03, 9.53006e-03, 2.35607e-03, 2.39208e-03,\n",
       "       2.39208e-03, 2.45219e-03, 1.66904e-02, 2.98807e-03, 2.98804e-03,\n",
       "       1.59156e-02, 1.25468e-02, 9.06711e-03, 9.06936e-03, 9.76534e-02,\n",
       "       9.57746e-03, 9.17011e-03, 1.14472e-02, 1.14458e-02, 9.77554e-03,\n",
       "       1.89924e-02, 3.97949e-04, 1.70242e-03, 8.91336e-03, 6.73926e-03,\n",
       "       6.69167e-03, 2.94257e-02, 1.38534e-02, 4.19227e-03, 4.19275e-03,\n",
       "       2.48630e-03, 4.83399e-04, 1.29795e-07, 6.49975e-05, 1.94736e-02,\n",
       "       1.94728e-02, 0.00000e+00, 3.91595e-03, 3.96230e-02, 0.00000e+00,\n",
       "       0.00000e+00, 6.73805e-05, 2.90073e-02, 9.28490e-03, 5.32118e-03,\n",
       "       8.18432e-03, 1.07035e-03, 3.64764e-04, 3.26790e-03, 3.26801e-03,\n",
       "       3.26801e-03, 3.26809e-03, 8.23600e-04, 1.56399e-02])\n",
       "Coordinates:\n",
       "  * v_choice       (v_choice) int64 0 1 2 3 4 5 6 7 ... 81 82 83 84 85 86 87 88\n",
       "    lbl__v_choice  (v_choice) object &#x27;U66059|TRBV1*01|Homo sapiens|P|V-REGION...\n",
       "    seq__v_choice  (v_choice) object &#x27;GATACTGGAATTACCCAGACACCAAAATACCTGGTCACA...\n",
       "Attributes:\n",
       "    nickname:    v_choice\n",
       "    event_type:  GeneChoice\n",
       "    seq_type:    V_gene\n",
       "    seq_side:    Undefined_side\n",
       "    priority:    7\n",
       "    parents:     []\n",
       "    childs:      [&#x27;v_3_del&#x27;, &#x27;d_gene&#x27;, &#x27;j_choice&#x27;]</pre><div class='xr-wrap' hidden><div class='xr-header'><div class='xr-obj-type'>xarray.DataArray</div><div class='xr-array-name'></div><ul class='xr-dim-list'><li><span class='xr-has-index'>v_choice</span>: 89</li></ul></div><ul class='xr-sections'><li class='xr-section-item'><div class='xr-array-wrap'><input id='section-ebb71c22-ae5e-46df-9b04-85cf732aa008' class='xr-array-in' type='checkbox' checked><label for='section-ebb71c22-ae5e-46df-9b04-85cf732aa008' title='Show/hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-array-preview xr-preview'><span>0.004887 0.009324 0.009323 0.01303 ... 0.003268 0.0008236 0.01564</span></div><div class='xr-array-data'><pre>array([4.88741e-03, 9.32369e-03, 9.32259e-03, 1.30320e-02, 3.43430e-04,\n",
       "       8.50694e-03, 7.71250e-03, 6.12276e-04, 5.06104e-03, 4.59289e-05,\n",
       "       4.48245e-03, 8.16181e-03, 7.00053e-04, 7.77164e-03, 1.16174e-02,\n",
       "       1.16158e-02, 1.13872e-02, 1.06555e-02, 2.36870e-03, 2.28368e-02,\n",
       "       1.56715e-04, 4.58447e-03, 0.00000e+00, 4.88782e-05, 0.00000e+00,\n",
       "       1.54500e-02, 2.74050e-02, 5.18979e-03, 4.80289e-03, 1.62765e-01,\n",
       "       6.61229e-02, 2.07174e-02, 7.36226e-04, 2.47846e-37, 1.07472e-02,\n",
       "       2.03820e-02, 9.53245e-03, 9.53006e-03, 2.35607e-03, 2.39208e-03,\n",
       "       2.39208e-03, 2.45219e-03, 1.66904e-02, 2.98807e-03, 2.98804e-03,\n",
       "       1.59156e-02, 1.25468e-02, 9.06711e-03, 9.06936e-03, 9.76534e-02,\n",
       "       9.57746e-03, 9.17011e-03, 1.14472e-02, 1.14458e-02, 9.77554e-03,\n",
       "       1.89924e-02, 3.97949e-04, 1.70242e-03, 8.91336e-03, 6.73926e-03,\n",
       "       6.69167e-03, 2.94257e-02, 1.38534e-02, 4.19227e-03, 4.19275e-03,\n",
       "       2.48630e-03, 4.83399e-04, 1.29795e-07, 6.49975e-05, 1.94736e-02,\n",
       "       1.94728e-02, 0.00000e+00, 3.91595e-03, 3.96230e-02, 0.00000e+00,\n",
       "       0.00000e+00, 6.73805e-05, 2.90073e-02, 9.28490e-03, 5.32118e-03,\n",
       "       8.18432e-03, 1.07035e-03, 3.64764e-04, 3.26790e-03, 3.26801e-03,\n",
       "       3.26801e-03, 3.26809e-03, 8.23600e-04, 1.56399e-02])</pre></div></div></li><li class='xr-section-item'><input id='section-55f1b53c-435f-4b0a-9472-3f357dc250ac' class='xr-section-summary-in' type='checkbox'  checked><label for='section-55f1b53c-435f-4b0a-9472-3f357dc250ac' class='xr-section-summary' >Coordinates: <span>(3)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>v_choice</span></div><div class='xr-var-dims'>(v_choice)</div><div class='xr-var-dtype'>int64</div><div class='xr-var-preview xr-preview'>0 1 2 3 4 5 6 ... 83 84 85 86 87 88</div><input id='attrs-09bc0c74-a081-4dfe-b320-3cefd5c62f45' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-09bc0c74-a081-4dfe-b320-3cefd5c62f45' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-fca23e1b-37bd-4f87-9658-cc38c747193c' class='xr-var-data-in' type='checkbox'><label for='data-fca23e1b-37bd-4f87-9658-cc38c747193c' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16, 17,\n",
       "       18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,\n",
       "       36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,\n",
       "       54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71,\n",
       "       72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88])</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>lbl__v_choice</span></div><div class='xr-var-dims'>(v_choice)</div><div class='xr-var-dtype'>object</div><div class='xr-var-preview xr-preview'>&#x27;U66059|TRBV1*01|Homo sapiens|P|...</div><input id='attrs-02f1862b-fe2b-4593-82da-fa370d9c88e2' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-02f1862b-fe2b-4593-82da-fa370d9c88e2' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-1709c532-b852-401a-9bbd-ab68e88fba37' class='xr-var-data-in' type='checkbox'><label for='data-1709c532-b852-401a-9bbd-ab68e88fba37' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([&#x27;U66059|TRBV1*01|Homo sapiens|P|V-REGION|91723..92006|284 nt|1| | | | |284+0=284| | |&#x27;,\n",
       "       &#x27;U66059|TRBV10-1*01|Homo sapiens|F|V-REGION|214801..215087|287 nt|1| | | | |287+0=287| | |&#x27;,\n",
       "       &#x27;AF009660|TRBV10-1*02|Homo sapiens|F|V-REGION|54913..55199|287 nt|1| | | | |287+0=287| | |&#x27;,\n",
       "       &#x27;AF009660|TRBV10-1*04|Homo sapiens|F|V-REGION|54913..55199|287 nt|1| Found in Data! Indiv 7. Also found by BLAST | | | |287+0=287| | |&#x27;,\n",
       "       &#x27;U66059|TRBV10-2*01|Homo sapiens|F|V-REGION|239867..240153|287 nt|1| | | | |287+0=287| | |&#x27;,\n",
       "       &#x27;U03115|TRBV10-3*01|Homo sapiens|F|V-REGION|14880..15166|287 nt|1| | | | |287+0=287| | |&#x27;,\n",
       "       &#x27;U17047|TRBV10-3*02|Homo sapiens|F|V-REGION|84..365|282 nt|1| | | | |282+0=282| Extended by 2 | |&#x27;,\n",
       "       &#x27;M33233|TRBV11-1*01|Homo sapiens|F|V-REGION|747..1036|290 nt|1| | | | |290+0=290| | |&#x27;,\n",
       "       &#x27;U66059|TRBV11-2*01|Homo sapiens|F|V-REGION|248813..249102|290 nt|1| | | | |290+0=290| | |&#x27;,\n",
       "       &quot;M33235|TRBV11-2*02|Homo sapiens|[F]|V-REGION|171..455|285 nt|1| | | | |285+0=285| Edited and Extended, partial in 3&#x27;| |&quot;,\n",
       "       &#x27;X58796|TRBV11-2*03|Homo sapiens|(F)|V-REGION|81..365|285 nt|1| | | | |285+0=285| | |&#x27;,\n",
       "       &#x27;U03115|TRBV11-3*01|Homo sapiens|F|V-REGION|25513..25802|290 nt|1| | | | |290+0=290| | |&#x27;,\n",
       "       &quot;X07224|TRBV12-1*01|Homo sapiens|P|V-REGION|381..667|287 nt|1| | | | |287+0=287|partial in 5&#x27;| |&quot;,\n",
       "       &quot;X06936|TRBV12-2*01|Homo sapiens|P|V-REGION|391..677|287 nt|1| | | | |287+0=287|partial in 5&#x27;| |&quot;,\n",
       "       &#x27;X07192|TRBV12-3*01|Homo sapiens|F|V-REGION|426..715|290 nt|1| | | | |290+0=290| | |&#x27;,\n",
       "       &#x27;K02546|TRBV12-4*01|Homo sapiens|F|V-REGION|158..447|290 nt|1| | | | |290+0=290| | |&#x27;,\n",
       "       &#x27;M14264|TRBV12-4*02|Homo sapiens|(F)|V-REGION|58..345|288 nt|1| | | | |288+0=288| | |&#x27;,\n",
       "       &#x27;X07223|TRBV12-5*01|Homo sapiens|F|V-REGION|392..681|290 nt|1| | | | |290+0=290| | |&#x27;,\n",
       "       &#x27;U03115|TRBV13*01|Homo sapiens|F|V-REGION|6502..6788|287 nt|1| | | | |287+0=287| | |&#x27;,\n",
       "       &#x27;X06154|TRBV14*01|Homo sapiens|F|V-REGION|283..572|290 nt|1| | | | |290+0=290| | |&#x27;,\n",
       "...\n",
       "       &#x27;X61443|TRBV7-2*02|Homo sapiens|F|V-REGION|192..475|284 nt|1| | | | |284+0=284| Extended by 6 | |&#x27;,\n",
       "       &#x27;U07975|TRBV7-2*03|Homo sapiens|F|V-REGION|7806..8090|285 nt|1| | | | |285+0=285| Extended by 2 | |&#x27;,\n",
       "       &#x27;X61443|TRBV7-2*05|Homo sapiens|F|V-REGION|192..475|284 nt|1| | | | |284+0=284| Discovered in Data, Possible Error, Not found in BLAST | |&#x27;,\n",
       "       &#x27;X61440|TRBV7-3*01|Homo sapiens|F|V-REGION|748..1037|290 nt|1| | | | |290+0=290| | |&#x27;,\n",
       "       &#x27;M97943|TRBV7-3*02|Homo sapiens|ORF|V-REGION|404..693|290 nt|1| | | | |290+0=290| | |&#x27;,\n",
       "       &#x27;AF009660|TRBV7-3*03|Homo sapiens|ORF|V-REGION|39374..39663|290 nt|1| | | | |290+0=290| | |&#x27;,\n",
       "       &#x27;X74843|TRBV7-3*04|Homo sapiens|(F)|V-REGION|140..426|287 nt|1| | | | |287+0=287| Extended by 3 | |&#x27;,\n",
       "       &#x27;L36092|TRBV7-4*01|Homo sapiens|F|V-REGION|270051..270340|290 nt|1| | | | |290+0=290| | |&#x27;,\n",
       "       &#x27;L36092|TRBV7-6*01|Homo sapiens|F|V-REGION|307097..307386|290 nt|1| | | | |290+0=290| | |&#x27;,\n",
       "       &#x27;L36092|TRBV7-7*01|Homo sapiens|F|V-REGION|326549..326838|290 nt|1| | | | |290+0=290| | |&#x27;,\n",
       "       &#x27;L36092|TRBV7-7*03|Homo sapiens|F|V-REGION|326549..326838|290 nt|1| | | | |290+0=290| Discovered Allele in Data | Found by BLAST |&#x27;,\n",
       "       &#x27;M11953|TRBV7-8*01|Homo sapiens|F|V-REGION|215..504|290 nt|1| | | | |290+0=290| | |&#x27;,\n",
       "       &#x27;X61441|TRBV7-8*02|Homo sapiens|F|V-REGION|497..786|290 nt|1| | | | |290+0=290| | |&#x27;,\n",
       "       &#x27;L36092|TRBV7-9*01|Homo sapiens|F|V-REGION|364320..364609|290 nt|1| | | | |290+0=290| | |&#x27;,\n",
       "       &#x27;M14261|TRBV7-9*04|Homo sapiens|(F)|V-REGION|58..342|285 nt|1| | | | |285+0=285| | |&#x27;,\n",
       "       &#x27;M27385|TRBV7-9*05|Homo sapiens|(F)|V-REGION|34..321|288 nt|1| | | | |288+0=288| Edited | |&#x27;,\n",
       "       &#x27;X74844|TRBV7-9*06|Homo sapiens|(F)|V-REGION|100..387|288 nt|1| | | | |288+0=288| Edited | |&#x27;,\n",
       "       &#x27;L14854|TRBV7-9*07|Homo sapiens|(F)|V-REGION|1..203|203 nt|1| | | | |203+0=203| Edited | |&#x27;,\n",
       "       &#x27;U66059|TRBV9*01|Homo sapiens|F|V-REGION|206836..207121|286 nt|1| | | | |286+0=286| | |&#x27;],\n",
       "      dtype=object)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>seq__v_choice</span></div><div class='xr-var-dims'>(v_choice)</div><div class='xr-var-dtype'>object</div><div class='xr-var-preview xr-preview'>&#x27;GATACTGGAATTACCCAGACACCAAAATACC...</div><input id='attrs-eeac2b9a-4a6a-48fd-a633-64d2e0a50f62' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-eeac2b9a-4a6a-48fd-a633-64d2e0a50f62' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-d95edb20-52d3-40c5-a3fe-c022ee87d542' class='xr-var-data-in' type='checkbox'><label for='data-d95edb20-52d3-40c5-a3fe-c022ee87d542' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([&#x27;GATACTGGAATTACCCAGACACCAAAATACCTGGTCACAGCAATGGGGAGTAAAAGGACAATGAAACGTGAGCATCTGGGACATGATTCTATGTATTGGTACAGACAGAAAGCTAAGAAATCCCTGGAGTTCATGTTTTACTACAACTGTAAGGAATTCATTGAAAACAAGACTGTGCCAAATCACTTCACACCTGAATGCCCTGACAGCTCTCGCTTATACCTTCATGTGGTCGCACTGCAGCAAGAAGACTCAGCTGCGTATCTCTGCACCAGCAGCCAAGA&#x27;,\n",
       "       &#x27;GATGCTGAAATCACCCAGAGCCCAAGACACAAGATCACAGAGACAGGAAGGCAGGTGACCTTGGCGTGTCACCAGACTTGGAACCACAACAATATGTTCTGGTATCGACAAGACCTGGGACATGGGCTGAGGCTGATCCATTACTCATATGGTGTTCAAGACACTAACAAAGGAGAAGTCTCAGATGGCTACAGTGTCTCTAGATCAAACACAGAGGACCTCCCCCTCACTCTGGAGTCTGCTGCCTCCTCCCAGACATCTGTATATTTCTGCGCCAGCAGTGAGTC&#x27;,\n",
       "       &#x27;GATGCTGAAATCACCCAGAGCCCAAGACACAAGATCACAGAGACAGGAAGGCAGGTGACCTTGGCGTGTCACCAGACTTGGAACCACAACAATATGTTCTGGTATCGACAAGACCTGGGACATGGGCTGAGGCTGATCCATTACTCATATGGTGTTCACGACACTAACAAAGGAGAAGTCTCAGATGGCTACAGTGTCTCTAGATCAAACACAGAGGACCTCCCCCTCACTCTGGAGTCTGCTGCCTCCTCCCAGACATCTGTATATTTCTGCGCCAGCAGTGAGTC&#x27;,\n",
       "       &#x27;GATGCTGAAATCACCCAGAGCCCAAGACACAAGATCACAGAGACAGGAAGGCAGGTGACCTTGGCGTGTCACCAGACTTGGAACCACAACAATATGTTCTGGTATCGACAAGACCTGGGACATGGGCTGAGGCTGATCCATTACTCATATGGTGTTCACGACACTAACAAAGGAGAAGTCTCAGATGGCTACAGTGTCTCTAGATCAAACACAGAGGACCTCCCCCTCACTCTGTAGTCTGCTGCCTCCTCCCAGACATCTGTATATTTCTGCGCCAGCAGTGAGTC&#x27;,\n",
       "       &#x27;GATGCTGGAATCACCCAGAGCCCAAGATACAAGATCACAGAGACAGGAAGGCAGGTGACCTTGATGTGTCACCAGACTTGGAGCCACAGCTATATGTTCTGGTATCGACAAGACCTGGGACATGGGCTGAGGCTGATCTATTACTCAGCAGCTGCTGATATTACAGATAAAGGAGAAGTCCCCGATGGCTATGTTGTCTCCAGATCCAAGACAGAGAATTTCCCCCTCACTCTGGAGTCAGCTACCCGCTCCCAGACATCTGTGTATTTCTGCGCCAGCAGTGAGTC&#x27;,\n",
       "       &#x27;GATGCTGGAATCACCCAGAGCCCAAGACACAAGGTCACAGAGACAGGAACACCAGTGACTCTGAGATGTCACCAGACTGAGAACCACCGCTATATGTACTGGTATCGACAAGACCCGGGGCATGGGCTGAGGCTGATCCATTACTCATATGGTGTTAAAGATACTGACAAAGGAGAAGTCTCAGATGGCTATAGTGTCTCTAGATCAAAGACAGAGGATTTCCTCCTCACTCTGGAGTCCGCTACCAGCTCCCAGACATCTGTGTACTTCTGTGCCATCAGTGAGTC&#x27;,\n",
       "       &#x27;GCTGGAATCACCCAGAGCCCAAGACACAAGGTCACAGAGACAGGAACACCAGTGACTCTGAGATGTCATCAGACTGAGAACCACCGCTATATGTACTGGTATCGACAAGACCCGGGGCATGGGCTGAGGCTGATCCATTACTCATATGGTGTTAAAGATACTGACAAAGGAGAAGTCTCAGATGGCTATAGTGTCTCTAGATCAAAGACAGAGGATTTCCTCCTCACTCTGGAGTCCGCTACCAGCTCCCAGACATCTGTGTACTTCTGTGCCATCAGTGAGTC&#x27;,\n",
       "       &#x27;GAAGCTGAAGTTGCCCAGTCCCCCAGATATAAGATTACAGAGAAAAGCCAGGCTGTGGCTTTTTGGTGTGATCCTATTTCTGGCCATGCTACCCTTTACTGGTACCGGCAGATCCTGGGACAGGGCCCGGAGCTTCTGGTTCAATTTCAGGATGAGAGTGTAGTAGATGATTCACAGTTGCCTAAGGATCGATTTTCTGCAGAGAGGCTCAAAGGAGTAGACTCCACTCTCAAGATCCAGCCTGCAGAGCTTGGGGACTCGGCCATGTATCTCTGTGCCAGCAGCTTAGC&#x27;,\n",
       "       &#x27;GAAGCTGGAGTTGCCCAGTCTCCCAGATATAAGATTATAGAGAAAAGGCAGAGTGTGGCTTTTTGGTGCAATCCTATATCTGGCCATGCTACCCTTTACTGGTACCAGCAGATCCTGGGACAGGGCCCAAAGCTTCTGATTCAGTTTCAGAATAACGGTGTAGTGGATGATTCACAGTTGCCTAAGGATCGATTTTCTGCAGAGAGGCTCAAAGGAGTAGACTCCACTCTCAAGATCCAGCCTGCAAAGCTTGAGGACTCGGCCGTGTATCTCTGTGCCAGCAGCTTAGA&#x27;,\n",
       "       &#x27;GAAGCTGGAGTTGCCCAGTCTCCCAGATATAAGATTATAGAGAAAAGGCAGAGTGTGGCTTTTTGGTGCAATCCTATATCTGGCCATGCTACCCTTTACTGGTACCAGCAGATCCTGGGACAGGGCCCAAAGCTTCTGATTCAGTTTCAGAATAACGGTGTAGTGGATGATTCACAGTTGCCTAAGGATCGATTTTCTGCAGAGAGGCTCAAAGGAGTAGACTCCACTCTCAAGATCCAGCCTGCAAAGCTTGAGAACTCGGCCGTGTATCTCTGTGCCAGCAGCTTAGA&#x27;,\n",
       "       &#x27;GAAGCTGGAGTTGCCCAGTCTCCCAGATATAAGATTATAGAGAAAAGGCAGAGTGTGGCTTTTTGGTGCAATCCTATATCTGGCCATGCTACCCTTTACTGGTACCAGCAGATCCTGGGACAGGGCCCAAAGCTTCTGATTCAGTTTCAGAATAACGGTGTAGTGGATGATTCACAGTTGCCTAAGGATCGATTTTCTGCAGAGAGGCTCAAAGGAGTAGACTCCACTCTCAAGATCCAACCTGCAAAGCTTGAGGACTCGGCCGTGTATCTCTGTGCCAGCAGCTTAGA&#x27;,\n",
       "       &#x27;GAAGCTGGAGTGGTTCAGTCTCCCAGATATAAGATTATAGAGAAAAAACAGCCTGTGGCTTTTTGGTGCAATCCTATTTCTGGCCACAATACCCTTTACTGGTACCTGCAGAACTTGGGACAGGGCCCGGAGCTTCTGATTCGATATGAGAATGAGGAAGCAGTAGACGATTCACAGTTGCCTAAGGATCGATTTTCTGCAGAGAGGCTCAAAGGAGTAGACTCCACTCTCAAGATCCAGCCTGCAGAGCTTGGGGACTCGGCCGTGTATCTCTGTGCCAGCAGCTTAGA&#x27;,\n",
       "       &#x27;GCTGGTGTTATCCAGTCACCCAGGCACAAAGTGACAGAGATGGGACAATCAGTAACTCTGAGATGCGAACCAATTTCAGGCCACAATGATCTTCTCTGGTACAGACAGACCTTTGTGCAGGGACTGGAATTGCTGAATTACTTCTGCAGCTGGACCCTCGTAGATGACTCAGGAGTGTCCAAGGATTGATTCTCAGCACAGATGCCTGATGTATCATTCTCCACTCTGAGGATCCAGCCCATGGAACCCAGGGACTTGGGCCTATATTTCTGTGCCAGCAGCTTTGC&#x27;,\n",
       "       &#x27;GCTGGCATTATCCAGTCACCCAAGCATGAGGTGACAGAAATGGGACAAACAGTGACTCTGAGATGTGAGCCAATTTTTGGCCACAATTTCCTTTTCTGGTACAGAGATACCTTCGTGCAGGGACTGGAATTGCTGAGTTACTTCCGGAGCTGATCTATTATAGATAATGCAGGTATGCCCACAGAGCGATTCTCAGCTGAGAGGCCTGATGGATCATTCTCTACTCTGAAGATCCAGCCTGCAGAGCAGGGGGACTCGGCCGTGTATGTCTGTGCAAGTCGCTTAGC&#x27;,\n",
       "       &#x27;GATGCTGGAGTTATCCAGTCACCCCGCCATGAGGTGACAGAGATGGGACAAGAAGTGACTCTGAGATGTAAACCAATTTCAGGCCACAACTCCCTTTTCTGGTACAGACAGACCATGATGCGGGGACTGGAGTTGCTCATTTACTTTAACAACAACGTTCCGATAGATGATTCAGGGATGCCCGAGGATCGATTCTCAGCTAAGATGCCTAATGCATCATTCTCCACTCTGAAGATCCAGCCCTCAGAACCCAGGGACTCAGCTGTGTACTTCTGTGCCAGCAGTTTAGC&#x27;,\n",
       "       &#x27;GATGCTGGAGTTATCCAGTCACCCCGGCACGAGGTGACAGAGATGGGACAAGAAGTGACTCTGAGATGTAAACCAATTTCAGGACACGACTACCTTTTCTGGTACAGACAGACCATGATGCGGGGACTGGAGTTGCTCATTTACTTTAACAACAACGTTCCGATAGATGATTCAGGGATGCCCGAGGATCGATTCTCAGCTAAGATGCCTAATGCATCATTCTCCACTCTGAAGATCCAGCCCTCAGAACCCAGGGACTCAGCTGTGTACTTCTGTGCCAGCAGTTTAGC&#x27;,\n",
       "       &#x27;GATGCTGGAGTTATCCAGTCACCCCGGCACGAGGTGACAGAGATGGGACAAGAAGTGACTCTGAGATGTAAACCAATTTCAGGACATGACTACCTTTTCTGGTACAGACAGACCATGATGCGGGGACTGGAGTTGCTCATTTACTTTAACAACAACGTTCCGATAGATGATTCAGGGATGCCCGAGGATCGATTCTCAGCTAAGATGCCTAATGCATCATTCTCCACTCTGAGGATCCAGCCCTCAGAACCCAGGGACTCAGCTGTGTACTTCTGTGCCAGCAGTTTAGC&#x27;,\n",
       "       &#x27;GATGCTAGAGTCACCCAGACACCAAGGCACAAGGTGACAGAGATGGGACAAGAAGTAACAATGAGATGTCAGCCAATTTTAGGCCACAATACTGTTTTCTGGTACAGACAGACCATGATGCAAGGACTGGAGTTGCTGGCTTACTTCCGCAACCGGGCTCCTCTAGATGATTCGGGGATGCCGAAGGATCGATTCTCAGCAGAGATGCCTGATGCAACTTTAGCCACTCTGAAGATCCAGCCCTCAGAACCCAGGGACTCAGCTGTGTATTTTTGTGCTAGTGGTTTGGT&#x27;,\n",
       "       &#x27;GCTGCTGGAGTCATCCAGTCCCCAAGACATCTGATCAAAGAAAAGAGGGAAACAGCCACTCTGAAATGCTATCCTATCCCTAGACACGACACTGTCTACTGGTACCAGCAGGGTCCAGGTCAGGACCCCCAGTTCCTCATTTCGTTTTATGAAAAGATGCAGAGCGATAAAGGAAGCATCCCTGATCGATTCTCAGCTCAACAGTTCAGTGACTATCATTCTGAACTGAACATGAGCTCCTTGGAGCTGGGGGACTCAGCCCTGTACTTCTGTGCCAGCAGCTTAGG&#x27;,\n",
       "       &#x27;GAAGCTGGAGTTACTCAGTTCCCCAGCCACAGCGTAATAGAGAAGGGCCAGACTGTGACTCTGAGATGTGACCCAATTTCTGGACATGATAATCTTTATTGGTATCGACGTGTTATGGGAAAAGAAATAAAATTTCTGTTACATTTTGTGAAAGAGTCTAAACAGGATGAGTCCGGTATGCCCAACAATCGATTCTTAGCTGAAAGGACTGGAGGGACGTATTCTACTCTGAAGGTGCAGCCTGCAGAACTGGAGGATTCTGGAGTTTATTTCTGTGCCAGCAGCCAAGA&#x27;,\n",
       "...\n",
       "       &#x27;GGAGCTGGAGTCTCCCAGTCCCCCAGTAACAAGGTCACAGAGAAGGGAAAGGATGTAGAGCTCAGGTGTGATCCAATTTCAGGTCATACTGCCCTTTACTGGTACCGACAGAGGCTGGGGCAGGGCCTGGAGTTTTTAATTTACTTCCAAGGCAACAGTGCACCAGACAAATCAGGGCTGCCCAGTGATCGCTTCTCTGCAGAGAGGACTGGGGAATCCGTCTCCACTCTGACGATCCAGCGCACACAGCAGGAGGACTCGGCCGTGTATCTCTGTGCCAGCAGCTTAGC&#x27;,\n",
       "       &#x27;GCTGGAGTCTCCCAGTCCCCCAGTAACAAGGTCACAGAGAAGGGAAAGGATGTAGAGCTCAGGTGTGATCCAATTTCAGGTCATACTGCCCTTTACTGGTACCGACAGAGGCTGGGGCAGGGCCTGGAGTTTTTAATTTACTTCCAAGGCAACAGTGCACCAGACAAATCAGGGCTGCCCAGTGATCGCTTCTCTGCAGAGAGGACTGGGGAATCCGTCTCCACTCTGACGATCCAGCGCACACAGCAGGAGGACTCGGCCGTGTATCTCTGTACCAGCAGCTTAGC&#x27;,\n",
       "       &#x27;GGAGCTGGAGTCTCCCAGTCCCCCAGTAACAAGGTCACAGAGAAGGGAAAGGATGTAGAGCTCAGGTGTGATCCAATTTCAGGTCATACTGCCCTTTACTGGTACCGACAGAGGCTGGGGCAGGGCCTGGAGTTTTTAATTTACTTCCAAGGCAACAGTGCACCAGACAAATCAGGGCTGCCCAGTGATCGCTTCTCTGCAGAGAGGACTGGGGAATCCGTCTCCACTCTGACGATCCAGCGCACATAGCAGGAGGACTCGGCCGTGTATCTCTGTGCCAGCAGCTTAGC&#x27;,\n",
       "       &#x27;GGTGCTGGAGTCTCCCAGACCCCCAGTAACAAGGTCACAGAGAAGGGAAAATATGTAGAGCTCAGGTGTGATCCAATTTCAGGTCATACTGCCCTTTACTGGTACCGACAAAGCCTGGGGCAGGGCCCAGAGTTTCTAATTTACTTCCAAGGCACGGGTGCGGCAGATGACTCAGGGCTGCCCAACGATCGGTTCTTTGCAGTCAGGCCTGAGGGATCCGTCTCTACTCTGAAGATCCAGCGCACAGAGCGGGGGGACTCAGCCGTGTATCTCTGTGCCAGCAGCTTAAC&#x27;,\n",
       "       &#x27;GGTGCTGGAGTCTCCCAGACCCCCAGTAACAAGGTCACAGAGAAGGGAAAAGATGTAGAGCTCAGGTGTGATCCAATTTCAGGTCATACTGCCCTTTACTGGTACCGACAAAGCCTGGGGCAGGGCCCAGAGTTTCTAATTTACTTCCAAGGCACGGGTGCGGCAGATGACTCAGGGCTGCCCAAAGATCGGTTCTTTGCAGTCAGGCCTGAGGGATCCGTCTCTACTCTGAAGATCCAGCGCACAGAGCAGGGGGACTCAGCCGTGTATCTCCGTGCCAGCAGCTTAAC&#x27;,\n",
       "       &#x27;GGTGCTGGAGTCTCCCAGACCCCCAGTAACAAGGTCACAGAGAAGGGAAAAGATGTAGAGCTCAGGTGTGATCCAATTTCAGGTCATACTGCCCTTTACTGGTACCGACAAAGCCTGGGGCAGGGCCCAGAGTTTCTAATTTACTTCCAAGGCACGGGTGCGGCAGATGACTCAGGGCTGCCCAAAGATCGGTTCTTTGCAGTCAGGCCTGAGGGATCCGTCTCTACTCTGAAGATCCAGCGCACAGAGCAGGGGGACTCAGCCGCGTATCTCCGTGCCAGCAGCTTAAC&#x27;,\n",
       "       &#x27;GGTGCTGGAGTCTCCCAGACCCCCAGTAACAAGGTCACAGAGAAGGGAAAATATGTAGAGCTCAGGTGTGATCCAATTTCAGGTCATACTGCCCTTTACTGGTACCGACAAAGCCTGGGGCAGGGCCCAGAGTTTCTAATTTACTTCCAAGGCACGGGTGCGGCAGATGACTCAGGGCTGCCCAACGATCGGTTCTTTGCAGTCAGGCCTGAGGGATCCGTCTCTACTCTGAAGATCCAGCGCACAGAGCGGGGGGACTCTGCCGTGTATCTCTGTGCCAGCAGCTTAAC&#x27;,\n",
       "       &#x27;GGTGCTGGAGTCTCCCAGTCCCCAAGGTACAAAGTCGCAAAGAGGGGACGGGATGTAGCTCTCAGGTGTGATTCAATTTCGGGTCATGTAACCCTTTATTGGTACCGACAGACCCTGGGGCAGGGCTCAGAGGTTCTGACTTACTCCCAGAGTGATGCTCAACGAGACAAATCAGGGCGGCCCAGTGGTCGGTTCTCTGCAGAGAGGCCTGAGAGATCCGTCTCCACTCTGAAGATCCAGCGCACAGAGCAGGGGGACTCAGCTGTGTATCTCTGTGCCAGCAGCTTAGC&#x27;,\n",
       "       &#x27;GGTGCTGGAGTCTCCCAGTCTCCCAGGTACAAAGTCACAAAGAGGGGACAGGATGTAGCTCTCAGGTGTGATCCAATTTCGGGTCATGTATCCCTTTATTGGTACCGACAGGCCCTGGGGCAGGGCCCAGAGTTTCTGACTTACTTCAATTATGAAGCCCAACAAGACAAATCAGGGCTGCCCAATGATCGGTTCTCTGCAGAGAGGCCTGAGGGATCCATCTCCACTCTGACGATCCAGCGCACAGAGCAGCGGGACTCGGCCATGTATCGCTGTGCCAGCAGCTTAGC&#x27;,\n",
       "       &#x27;GGTGCTGGAGTCTCCCAGTCTCCCAGGTACAAAGTCACAAAGAGGGGACAGGATGTAACTCTCAGGTGTGATCCAATTTCGAGTCATGCAACCCTTTATTGGTATCAACAGGCCCTGGGGCAGGGCCCAGAGTTTCTGACTTACTTCAATTATGAAGCTCAACCAGACAAATCAGGGCTGCCCAGTGATCGGTTCTCTGCAGAGAGGCCTGAGGGATCCATCTCCACTCTGACGATTCAGCGCACAGAGCAGCGGGACTCAGCCATGTATCGCTGTGCCAGCAGCTTAGC&#x27;,\n",
       "       &#x27;GGTGCTGGAGTCTCCCAGTCTCCCAGGTACAAAGTCACAAAGAGGGGACAGGATGTAACTCTCAGGTGTGATCCAATTTCGAGTCATGCAACCCTTTATTGGTATCAACAGGCCCTGGGGCAGGGCCCAGAGTTTCTGACTTACTTCAATTATGAAGCTCAACCAGACAAATCAGGGCTGCCCAGTGATCGGTTCTCTGCAGAGAGGCCTGAGGGATCCATCTCCACTCTGACGATTCAGCGCACAGAGCAGCGGGACTCAGCCATGTATCGCTGTGCTAGCAGCTTAGC&#x27;,\n",
       "       &#x27;GGTGCTGGAGTCTCCCAGTCCCCTAGGTACAAAGTCGCAAAGAGAGGACAGGATGTAGCTCTCAGGTGTGATCCAATTTCGGGTCATGTATCCCTTTTTTGGTACCAACAGGCCCTGGGGCAGGGGCCAGAGTTTCTGACTTATTTCCAGAATGAAGCTCAACTAGACAAATCGGGGCTGCCCAGTGATCGCTTCTTTGCAGAAAGGCCTGAGGGATCCGTCTCCACTCTGAAGATCCAGCGCACACAGCAGGAGGACTCCGCCGTGTATCTCTGTGCCAGCAGCTTAGC&#x27;,\n",
       "       &#x27;GGTGCTGGAGTCTCCCAGTCCCCTAGGTACAAAGTCGCAAAGAGAGGACAGGATGTAGCTCTCAGGTGTGATCCAATTTCGGGTCATGTATCCCTTTTTTGGTACCAACAGGCCCTGGGGCAGGGGCCAGAGTTTCTGACTTATTTCCAGAATGAAGCTCAACTAGACAAATCGGGGCTGCCCAGTGATCGCTTCTTTGCAGAAAGGCCTGAGGGATCCGTCTCCACTCTGAAGATCCAGCGCACACAGAAGGAGGACTCCGCCGTGTATCTCTGTGCCAGCAGCTTAGC&#x27;,\n",
       "       &#x27;GATACTGGAGTCTCCCAGAACCCCAGACACAAGATCACAAAGAGGGGACAGAATGTAACTTTCAGGTGTGATCCAATTTCTGAACACAACCGCCTTTATTGGTACCGACAGACCCTGGGGCAGGGCCCAGAGTTTCTGACTTACTTCCAGAATGAAGCTCAACTAGAAAAATCAAGGCTGCTCAGTGATCGGTTCTCTGCAGAGAGGCCTAAGGGATCTTTCTCCACCTTGGAGATCCAGCGCACAGAGCAGGGGGACTCGGCCATGTATCTCTGTGCCAGCAGCTTAGC&#x27;,\n",
       "       &#x27;ATATCTGGAGTCTCCCACAACCCCAGACACAAGATCACAAAGAGGGGACAGAATGTAACTTTCAGGTGTGATCCAATTTCTGAACACAACCGCCTTTATTGGTACCGACAGAACCCTGGGCAGGGCCCAGAGTTTCTGACTTACTTCCAGAATGAAGCTCAACTGGAAAAATCAGGGCTGCTCAGTGATCGGATCTCTGCAGAGAGGCCTAAGGGATCTTTCTCCACCTTGGAGATCCAGCGCACAGAGCAGGGGGACTCGGCCATGTATCTCTGTGCCAGCAGCTTAGC&#x27;,\n",
       "       &#x27;GATACTGGAGTCTCCCAGAACCCCAGACACAAGATCACAAAGAGGGGACAGAATGTAACTTTCAGGTGTGATCCAATTTCTGAACACAACCGCCTTTATTGGTACCGACAGACCCTGGGGCAGGGCCCAGAGTTTCTGACTTACTTCCAGAATGAAGCTCAACTAGAAAAATCAAGGCTGCTCAGTGATCGGTTCTCTGCAGAGAGGCCTAAGGGATCTCTCTCCACCTTGGAGATCCAGCGCACAGAGCAGGGGGACTCGGCCATGTATCTCTGTGCCAGCAGCTTAGC&#x27;,\n",
       "       &#x27;GATACTGGAGTCTCCCAGAACCCCAGACACAAGATCACAAAGAGGGGACAGAATGTAACTTTCAGGTGTGATCCAATTTCTGAACACAACCGCCTTTATTGGTACCGACAGACCCTGGGGCAGGGCCCAGAGTTTCTGACTTACTTCCAGAATGAAGCTCAACTAGAAAAATCAAGGCTGCTCAGTGATCGGTTCTCTGCAGAGAGGCCTAAGGGATCTCTTTCCACCTTGGAGATCCAGCGCACAGAGCAGGGGGACTCGGCCATGTATCTCTGTGCCAGCAGCTTAGC&#x27;,\n",
       "       &#x27;CACAACCGCCTTTATTGGTACCGACAGACCCTGGGGCAGGGCCCAGAGTTTCTGACTTACTTCCAGAATGAAGCTCAACTAGAAAAATCAAGGCTGCTCAGTGATCGGTTCTCTGCAGAGAGGCCTAAGGGATCTTTCTCCACCTTGGAGATCCAGCGCACAGAGGAGGGGGACTCGGCCATGTATCTCTGTGCCAGCAGCTTAGC&#x27;,\n",
       "       &#x27;GATTCTGGAGTCACACAAACCCCAAAGCACCTGATCACAGCAACTGGACAGCGAGTGACGCTGAGATGCTCCCCTAGGTCTGGAGACCTCTCTGTGTACTGGTACCAACAGAGCCTGGACCAGGGCCTCCAGTTCCTCATTCAGTATTATAATGGAGAAGAGAGAGCAAAAGGAAACATTCTTGAACGATTCTCCGCACAACAGTTCCCTGACTTGCACTCTGAACTAAACCTGAGCTCTCTGGAGCTGGGGGACTCAGCTTTGTATTTCTGTGCCAGCAGCGTAG&#x27;],\n",
       "      dtype=object)</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-9809d889-7a70-45a8-be99-69f085195f5d' class='xr-section-summary-in' type='checkbox'  checked><label for='section-9809d889-7a70-45a8-be99-69f085195f5d' class='xr-section-summary' >Attributes: <span>(7)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><dl class='xr-attrs'><dt><span>nickname :</span></dt><dd>v_choice</dd><dt><span>event_type :</span></dt><dd>GeneChoice</dd><dt><span>seq_type :</span></dt><dd>V_gene</dd><dt><span>seq_side :</span></dt><dd>Undefined_side</dd><dt><span>priority :</span></dt><dd>7</dd><dt><span>parents :</span></dt><dd>[]</dd><dt><span>childs :</span></dt><dd>[&#x27;v_3_del&#x27;, &#x27;d_gene&#x27;, &#x27;j_choice&#x27;]</dd></dl></div></li></ul></div></div>"
      ],
      "text/plain": [
       "<xarray.DataArray (v_choice: 89)>\n",
       "array([4.88741e-03, 9.32369e-03, 9.32259e-03, 1.30320e-02, 3.43430e-04,\n",
       "       8.50694e-03, 7.71250e-03, 6.12276e-04, 5.06104e-03, 4.59289e-05,\n",
       "       4.48245e-03, 8.16181e-03, 7.00053e-04, 7.77164e-03, 1.16174e-02,\n",
       "       1.16158e-02, 1.13872e-02, 1.06555e-02, 2.36870e-03, 2.28368e-02,\n",
       "       1.56715e-04, 4.58447e-03, 0.00000e+00, 4.88782e-05, 0.00000e+00,\n",
       "       1.54500e-02, 2.74050e-02, 5.18979e-03, 4.80289e-03, 1.62765e-01,\n",
       "       6.61229e-02, 2.07174e-02, 7.36226e-04, 2.47846e-37, 1.07472e-02,\n",
       "       2.03820e-02, 9.53245e-03, 9.53006e-03, 2.35607e-03, 2.39208e-03,\n",
       "       2.39208e-03, 2.45219e-03, 1.66904e-02, 2.98807e-03, 2.98804e-03,\n",
       "       1.59156e-02, 1.25468e-02, 9.06711e-03, 9.06936e-03, 9.76534e-02,\n",
       "       9.57746e-03, 9.17011e-03, 1.14472e-02, 1.14458e-02, 9.77554e-03,\n",
       "       1.89924e-02, 3.97949e-04, 1.70242e-03, 8.91336e-03, 6.73926e-03,\n",
       "       6.69167e-03, 2.94257e-02, 1.38534e-02, 4.19227e-03, 4.19275e-03,\n",
       "       2.48630e-03, 4.83399e-04, 1.29795e-07, 6.49975e-05, 1.94736e-02,\n",
       "       1.94728e-02, 0.00000e+00, 3.91595e-03, 3.96230e-02, 0.00000e+00,\n",
       "       0.00000e+00, 6.73805e-05, 2.90073e-02, 9.28490e-03, 5.32118e-03,\n",
       "       8.18432e-03, 1.07035e-03, 3.64764e-04, 3.26790e-03, 3.26801e-03,\n",
       "       3.26801e-03, 3.26809e-03, 8.23600e-04, 1.56399e-02])\n",
       "Coordinates:\n",
       "  * v_choice       (v_choice) int64 0 1 2 3 4 5 6 7 ... 81 82 83 84 85 86 87 88\n",
       "    lbl__v_choice  (v_choice) object 'U66059|TRBV1*01|Homo sapiens|P|V-REGION...\n",
       "    seq__v_choice  (v_choice) object 'GATACTGGAATTACCCAGACACCAAAATACCTGGTCACA...\n",
       "Attributes:\n",
       "    nickname:    v_choice\n",
       "    event_type:  GeneChoice\n",
       "    seq_type:    V_gene\n",
       "    seq_side:    Undefined_side\n",
       "    priority:    7\n",
       "    parents:     []\n",
       "    childs:      ['v_3_del', 'd_gene', 'j_choice']"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mdl_hb['v_choice']"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "You can plot directly from the xarray"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x7fac3b5ef210>]"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "[encoded data, 21548 characters]\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "mdl_hb['v_choice'].plot()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Or use the a model method to get the plot with the corresponding labels."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(<Figure size 1296x1080 with 1 Axes>,\n",
       " <AxesSubplot:title={'center':'$P($v_choice$)$'}>)"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "[encoded data, 36596 characters]\n",
      "text/plain": [
       "<Figure size 1296x1080 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "mdl_hb.plot_Event('v_choice')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(<Figure size 720x1440 with 6 Axes>,\n",
       " array([<AxesSubplot:title={'center':'$P($d_gene$ = $  TRBD1*01 $|$v_choice,j_choice$)$'}, xlabel='j_choice', ylabel='v_choice'>,\n",
       "        <AxesSubplot:title={'center':'$P($d_gene$ = $  TRBD2*01 $|$v_choice,j_choice$)$'}, xlabel='j_choice', ylabel='v_choice'>,\n",
       "        <AxesSubplot:title={'center':'$P($d_gene$ = $  TRBD2*02 $|$v_choice,j_choice$)$'}, xlabel='j_choice', ylabel='v_choice'>],\n",
       "       dtype=object))"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "[encoded data, 66856 characters]\n",
      "text/plain": [
       "<Figure size 720x1440 with 6 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "mdl_hb.plot_Event('d_gene')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Marginal Probabilities"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "With IGoR provide us the conditional probabilities of the events defined in the Bayesian network. \n",
    "\n",
    "So we can calculate marginal probabilities, i.e.\n",
    "\n",
    "$P(\\text{j_choice}) = \\sum_{\\text{v_choice}}P(\\text{j_choice}, \\text{v_choice})$\n",
    "\n",
    "and using the Bayes theorem\n",
    "\n",
    "$ P(\\text{j_choice}, \\text{v_choice}) = P(\\text{j_choice} | \\text{v_choice}) \\times P(\\text{v_choice})$\n",
    "\n",
    "we get,\n",
    "\n",
    "$P(\\text{j_choice}) = \\sum_{\\text{v_choice}} P(\\text{j_choice} | \\text{v_choice}) \\times P(\\text{v_choice})$"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(<xarray.DataArray (j_choice: 15)>\n",
       " array([0.11962186, 0.10538077, 0.02016188, 0.05684014, 0.09945672,\n",
       "        0.03726745, 0.0322361 , 0.12542452, 0.05034454, 0.09853381,\n",
       "        0.01948227, 0.07500318, 0.0190534 , 0.0709002 , 0.07029376])\n",
       " Coordinates:\n",
       "   * j_choice       (j_choice) int64 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14\n",
       "     lbl__j_choice  (j_choice) object 'K02545|TRBJ1-1*01|Homo sapiens|F|J-REGI...\n",
       "     seq__j_choice  (j_choice) object 'TGAACACTGAAGCTTTCTTTGGACAAGGCACCAGACTCA...,\n",
       " [<matplotlib.lines.Line2D at 0x7fac1dacf7d0>])"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "[encoded data, 22880 characters]\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "import xarray as xr\n",
    "P_marginal_j_choice = xr.dot(mdl_hb['j_choice'], mdl_hb['v_choice'])\n",
    "P_marginal_j_choice, P_marginal_j_choice.plot()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "But when a model is loaded with pygor3 the marginals are calculated automatically using a variable elimination process\n",
    "and are store in the Pmarginal variable\n",
    "\n",
    "IgorModel.Pmarginal['event_nickname']\n",
    "\n",
    "For this case\n",
    "\n",
    "$ P(\\text{'j_choice'}) = $ mdl_hb.Pmarginal['j_choice']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><svg style=\"position: absolute; width: 0; height: 0; overflow: hidden\">\n",
       "<defs>\n",
       "<symbol id=\"icon-database\" viewBox=\"0 0 32 32\">\n",
       "<path d=\"M16 0c-8.837 0-16 2.239-16 5v4c0 2.761 7.163 5 16 5s16-2.239 16-5v-4c0-2.761-7.163-5-16-5z\"></path>\n",
       "<path d=\"M16 17c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
       "<path d=\"M16 26c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
       "</symbol>\n",
       "<symbol id=\"icon-file-text2\" viewBox=\"0 0 32 32\">\n",
       "<path d=\"M28.681 7.159c-0.694-0.947-1.662-2.053-2.724-3.116s-2.169-2.030-3.116-2.724c-1.612-1.182-2.393-1.319-2.841-1.319h-15.5c-1.378 0-2.5 1.121-2.5 2.5v27c0 1.378 1.122 2.5 2.5 2.5h23c1.378 0 2.5-1.122 2.5-2.5v-19.5c0-0.448-0.137-1.23-1.319-2.841zM24.543 5.457c0.959 0.959 1.712 1.825 2.268 2.543h-4.811v-4.811c0.718 0.556 1.584 1.309 2.543 2.268zM28 29.5c0 0.271-0.229 0.5-0.5 0.5h-23c-0.271 0-0.5-0.229-0.5-0.5v-27c0-0.271 0.229-0.5 0.5-0.5 0 0 15.499-0 15.5 0v7c0 0.552 0.448 1 1 1h7v19.5z\"></path>\n",
       "<path d=\"M23 26h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
       "<path d=\"M23 22h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
       "<path d=\"M23 18h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
       "</symbol>\n",
       "</defs>\n",
       "</svg>\n",
       "<style>/* CSS stylesheet for displaying xarray objects in jupyterlab.\n",
       " *\n",
       " */\n",
       "\n",
       ":root {\n",
       "  --xr-font-color0: var(--jp-content-font-color0, rgba(0, 0, 0, 1));\n",
       "  --xr-font-color2: var(--jp-content-font-color2, rgba(0, 0, 0, 0.54));\n",
       "  --xr-font-color3: var(--jp-content-font-color3, rgba(0, 0, 0, 0.38));\n",
       "  --xr-border-color: var(--jp-border-color2, #e0e0e0);\n",
       "  --xr-disabled-color: var(--jp-layout-color3, #bdbdbd);\n",
       "  --xr-background-color: var(--jp-layout-color0, white);\n",
       "  --xr-background-color-row-even: var(--jp-layout-color1, white);\n",
       "  --xr-background-color-row-odd: var(--jp-layout-color2, #eeeeee);\n",
       "}\n",
       "\n",
       "html[theme=dark],\n",
       "body.vscode-dark {\n",
       "  --xr-font-color0: rgba(255, 255, 255, 1);\n",
       "  --xr-font-color2: rgba(255, 255, 255, 0.54);\n",
       "  --xr-font-color3: rgba(255, 255, 255, 0.38);\n",
       "  --xr-border-color: #1F1F1F;\n",
       "  --xr-disabled-color: #515151;\n",
       "  --xr-background-color: #111111;\n",
       "  --xr-background-color-row-even: #111111;\n",
       "  --xr-background-color-row-odd: #313131;\n",
       "}\n",
       "\n",
       ".xr-wrap {\n",
       "  display: block;\n",
       "  min-width: 300px;\n",
       "  max-width: 700px;\n",
       "}\n",
       "\n",
       ".xr-text-repr-fallback {\n",
       "  /* fallback to plain text repr when CSS is not injected (untrusted notebook) */\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-header {\n",
       "  padding-top: 6px;\n",
       "  padding-bottom: 6px;\n",
       "  margin-bottom: 4px;\n",
       "  border-bottom: solid 1px var(--xr-border-color);\n",
       "}\n",
       "\n",
       ".xr-header > div,\n",
       ".xr-header > ul {\n",
       "  display: inline;\n",
       "  margin-top: 0;\n",
       "  margin-bottom: 0;\n",
       "}\n",
       "\n",
       ".xr-obj-type,\n",
       ".xr-array-name {\n",
       "  margin-left: 2px;\n",
       "  margin-right: 10px;\n",
       "}\n",
       "\n",
       ".xr-obj-type {\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-sections {\n",
       "  padding-left: 0 !important;\n",
       "  display: grid;\n",
       "  grid-template-columns: 150px auto auto 1fr 20px 20px;\n",
       "}\n",
       "\n",
       ".xr-section-item {\n",
       "  display: contents;\n",
       "}\n",
       "\n",
       ".xr-section-item input {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-section-item input + label {\n",
       "  color: var(--xr-disabled-color);\n",
       "}\n",
       "\n",
       ".xr-section-item input:enabled + label {\n",
       "  cursor: pointer;\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-section-item input:enabled + label:hover {\n",
       "  color: var(--xr-font-color0);\n",
       "}\n",
       "\n",
       ".xr-section-summary {\n",
       "  grid-column: 1;\n",
       "  color: var(--xr-font-color2);\n",
       "  font-weight: 500;\n",
       "}\n",
       "\n",
       ".xr-section-summary > span {\n",
       "  display: inline-block;\n",
       "  padding-left: 0.5em;\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:disabled + label {\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-section-summary-in + label:before {\n",
       "  display: inline-block;\n",
       "  content: '►';\n",
       "  font-size: 11px;\n",
       "  width: 15px;\n",
       "  text-align: center;\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:disabled + label:before {\n",
       "  color: var(--xr-disabled-color);\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:checked + label:before {\n",
       "  content: '▼';\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:checked + label > span {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-section-summary,\n",
       ".xr-section-inline-details {\n",
       "  padding-top: 4px;\n",
       "  padding-bottom: 4px;\n",
       "}\n",
       "\n",
       ".xr-section-inline-details {\n",
       "  grid-column: 2 / -1;\n",
       "}\n",
       "\n",
       ".xr-section-details {\n",
       "  display: none;\n",
       "  grid-column: 1 / -1;\n",
       "  margin-bottom: 5px;\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:checked ~ .xr-section-details {\n",
       "  display: contents;\n",
       "}\n",
       "\n",
       ".xr-array-wrap {\n",
       "  grid-column: 1 / -1;\n",
       "  display: grid;\n",
       "  grid-template-columns: 20px auto;\n",
       "}\n",
       "\n",
       ".xr-array-wrap > label {\n",
       "  grid-column: 1;\n",
       "  vertical-align: top;\n",
       "}\n",
       "\n",
       ".xr-preview {\n",
       "  color: var(--xr-font-color3);\n",
       "}\n",
       "\n",
       ".xr-array-preview,\n",
       ".xr-array-data {\n",
       "  padding: 0 5px !important;\n",
       "  grid-column: 2;\n",
       "}\n",
       "\n",
       ".xr-array-data,\n",
       ".xr-array-in:checked ~ .xr-array-preview {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-array-in:checked ~ .xr-array-data,\n",
       ".xr-array-preview {\n",
       "  display: inline-block;\n",
       "}\n",
       "\n",
       ".xr-dim-list {\n",
       "  display: inline-block !important;\n",
       "  list-style: none;\n",
       "  padding: 0 !important;\n",
       "  margin: 0;\n",
       "}\n",
       "\n",
       ".xr-dim-list li {\n",
       "  display: inline-block;\n",
       "  padding: 0;\n",
       "  margin: 0;\n",
       "}\n",
       "\n",
       ".xr-dim-list:before {\n",
       "  content: '(';\n",
       "}\n",
       "\n",
       ".xr-dim-list:after {\n",
       "  content: ')';\n",
       "}\n",
       "\n",
       ".xr-dim-list li:not(:last-child):after {\n",
       "  content: ',';\n",
       "  padding-right: 5px;\n",
       "}\n",
       "\n",
       ".xr-has-index {\n",
       "  font-weight: bold;\n",
       "}\n",
       "\n",
       ".xr-var-list,\n",
       ".xr-var-item {\n",
       "  display: contents;\n",
       "}\n",
       "\n",
       ".xr-var-item > div,\n",
       ".xr-var-item label,\n",
       ".xr-var-item > .xr-var-name span {\n",
       "  background-color: var(--xr-background-color-row-even);\n",
       "  margin-bottom: 0;\n",
       "}\n",
       "\n",
       ".xr-var-item > .xr-var-name:hover span {\n",
       "  padding-right: 5px;\n",
       "}\n",
       "\n",
       ".xr-var-list > li:nth-child(odd) > div,\n",
       ".xr-var-list > li:nth-child(odd) > label,\n",
       ".xr-var-list > li:nth-child(odd) > .xr-var-name span {\n",
       "  background-color: var(--xr-background-color-row-odd);\n",
       "}\n",
       "\n",
       ".xr-var-name {\n",
       "  grid-column: 1;\n",
       "}\n",
       "\n",
       ".xr-var-dims {\n",
       "  grid-column: 2;\n",
       "}\n",
       "\n",
       ".xr-var-dtype {\n",
       "  grid-column: 3;\n",
       "  text-align: right;\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-var-preview {\n",
       "  grid-column: 4;\n",
       "}\n",
       "\n",
       ".xr-var-name,\n",
       ".xr-var-dims,\n",
       ".xr-var-dtype,\n",
       ".xr-preview,\n",
       ".xr-attrs dt {\n",
       "  white-space: nowrap;\n",
       "  overflow: hidden;\n",
       "  text-overflow: ellipsis;\n",
       "  padding-right: 10px;\n",
       "}\n",
       "\n",
       ".xr-var-name:hover,\n",
       ".xr-var-dims:hover,\n",
       ".xr-var-dtype:hover,\n",
       ".xr-attrs dt:hover {\n",
       "  overflow: visible;\n",
       "  width: auto;\n",
       "  z-index: 1;\n",
       "}\n",
       "\n",
       ".xr-var-attrs,\n",
       ".xr-var-data {\n",
       "  display: none;\n",
       "  background-color: var(--xr-background-color) !important;\n",
       "  padding-bottom: 5px !important;\n",
       "}\n",
       "\n",
       ".xr-var-attrs-in:checked ~ .xr-var-attrs,\n",
       ".xr-var-data-in:checked ~ .xr-var-data {\n",
       "  display: block;\n",
       "}\n",
       "\n",
       ".xr-var-data > table {\n",
       "  float: right;\n",
       "}\n",
       "\n",
       ".xr-var-name span,\n",
       ".xr-var-data,\n",
       ".xr-attrs {\n",
       "  padding-left: 25px !important;\n",
       "}\n",
       "\n",
       ".xr-attrs,\n",
       ".xr-var-attrs,\n",
       ".xr-var-data {\n",
       "  grid-column: 1 / -1;\n",
       "}\n",
       "\n",
       "dl.xr-attrs {\n",
       "  padding: 0;\n",
       "  margin: 0;\n",
       "  display: grid;\n",
       "  grid-template-columns: 125px auto;\n",
       "}\n",
       "\n",
       ".xr-attrs dt,\n",
       ".xr-attrs dd {\n",
       "  padding: 0;\n",
       "  margin: 0;\n",
       "  float: left;\n",
       "  padding-right: 10px;\n",
       "  width: auto;\n",
       "}\n",
       "\n",
       ".xr-attrs dt {\n",
       "  font-weight: normal;\n",
       "  grid-column: 1;\n",
       "}\n",
       "\n",
       ".xr-attrs dt:hover span {\n",
       "  display: inline-block;\n",
       "  background: var(--xr-background-color);\n",
       "  padding-right: 10px;\n",
       "}\n",
       "\n",
       ".xr-attrs dd {\n",
       "  grid-column: 2;\n",
       "  white-space: pre-wrap;\n",
       "  word-break: break-all;\n",
       "}\n",
       "\n",
       ".xr-icon-database,\n",
       ".xr-icon-file-text2 {\n",
       "  display: inline-block;\n",
       "  vertical-align: middle;\n",
       "  width: 1em;\n",
       "  height: 1.5em !important;\n",
       "  stroke-width: 0;\n",
       "  stroke: currentColor;\n",
       "  fill: currentColor;\n",
       "}\n",
       "</style><pre class='xr-text-repr-fallback'>&lt;xarray.DataArray (d_gene: 3)&gt;\n",
       "array([0.56140871, 0.2361217 , 0.20247255])\n",
       "Coordinates:\n",
       "  * d_gene       (d_gene) int64 0 1 2\n",
       "    lbl__d_gene  (d_gene) object &#x27; TRBD1*01&#x27; &#x27; TRBD2*01&#x27; &#x27; TRBD2*02&#x27;\n",
       "    seq__d_gene  (d_gene) object &#x27;GGGACAGGGGGC&#x27; ... &#x27;GGGACTAGCGGGAGGG&#x27;</pre><div class='xr-wrap' hidden><div class='xr-header'><div class='xr-obj-type'>xarray.DataArray</div><div class='xr-array-name'></div><ul class='xr-dim-list'><li><span class='xr-has-index'>d_gene</span>: 3</li></ul></div><ul class='xr-sections'><li class='xr-section-item'><div class='xr-array-wrap'><input id='section-34d8700f-4c6c-4860-bd6b-2380142e0447' class='xr-array-in' type='checkbox' checked><label for='section-34d8700f-4c6c-4860-bd6b-2380142e0447' title='Show/hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-array-preview xr-preview'><span>0.5614 0.2361 0.2025</span></div><div class='xr-array-data'><pre>array([0.56140871, 0.2361217 , 0.20247255])</pre></div></div></li><li class='xr-section-item'><input id='section-d921445d-eb85-4c35-8d34-60811f4c6961' class='xr-section-summary-in' type='checkbox'  checked><label for='section-d921445d-eb85-4c35-8d34-60811f4c6961' class='xr-section-summary' >Coordinates: <span>(3)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>d_gene</span></div><div class='xr-var-dims'>(d_gene)</div><div class='xr-var-dtype'>int64</div><div class='xr-var-preview xr-preview'>0 1 2</div><input id='attrs-8d6ae773-9eff-4c9d-9e64-1d484a08aade' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-8d6ae773-9eff-4c9d-9e64-1d484a08aade' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-f364e921-631f-4d34-8e43-0b3e37605782' class='xr-var-data-in' type='checkbox'><label for='data-f364e921-631f-4d34-8e43-0b3e37605782' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([0, 1, 2])</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>lbl__d_gene</span></div><div class='xr-var-dims'>(d_gene)</div><div class='xr-var-dtype'>object</div><div class='xr-var-preview xr-preview'>&#x27; TRBD1*01&#x27; &#x27; TRBD2*01&#x27; &#x27; TRBD2*02&#x27;</div><input id='attrs-0218506a-444e-475f-a16d-0e8266e47ee3' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-0218506a-444e-475f-a16d-0e8266e47ee3' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-638c47d2-10d4-4dbc-ad4a-55239d07f523' class='xr-var-data-in' type='checkbox'><label for='data-638c47d2-10d4-4dbc-ad4a-55239d07f523' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([&#x27; TRBD1*01&#x27;, &#x27; TRBD2*01&#x27;, &#x27; TRBD2*02&#x27;], dtype=object)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>seq__d_gene</span></div><div class='xr-var-dims'>(d_gene)</div><div class='xr-var-dtype'>object</div><div class='xr-var-preview xr-preview'>&#x27;GGGACAGGGGGC&#x27; ... &#x27;GGGACTAGCGGG...</div><input id='attrs-c15dfc35-5b70-4728-81da-7abc3eabf1ff' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-c15dfc35-5b70-4728-81da-7abc3eabf1ff' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-d446803a-0453-4e9b-91bd-19ca138e672f' class='xr-var-data-in' type='checkbox'><label for='data-d446803a-0453-4e9b-91bd-19ca138e672f' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([&#x27;GGGACAGGGGGC&#x27;, &#x27;GGGACTAGCGGGGGGG&#x27;, &#x27;GGGACTAGCGGGAGGG&#x27;],\n",
       "      dtype=object)</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-581bba75-12b3-499a-93b7-16211b702f25' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-581bba75-12b3-499a-93b7-16211b702f25' class='xr-section-summary'  title='Expand/collapse section'>Attributes: <span>(0)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><dl class='xr-attrs'></dl></div></li></ul></div></div>"
      ],
      "text/plain": [
       "<xarray.DataArray (d_gene: 3)>\n",
       "array([0.56140871, 0.2361217 , 0.20247255])\n",
       "Coordinates:\n",
       "  * d_gene       (d_gene) int64 0 1 2\n",
       "    lbl__d_gene  (d_gene) object ' TRBD1*01' ' TRBD2*01' ' TRBD2*02'\n",
       "    seq__d_gene  (d_gene) object 'GGGACAGGGGGC' ... 'GGGACTAGCGGGAGGG'"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "[encoded data, 6288 characters]\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "mdl_hb.plot_Event_Marginal('d_gene')\n",
    "mdl_hb.Pmarginal['d_gene']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<AxesSubplot:xlabel='d 3 del', ylabel='P'>"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "[encoded data, 14260 characters]\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "mdl_hb.plot_Event_Marginal('d_3_del')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "If you modifiy the conditional probabilities, to re-calculate the marginals, use the method generate_Pmarginals()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [],
   "source": [
    "mdl_hb.generate_Pmarginals()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Joint Probabilities\n",
    "Pygor3 also have a method to calculate the joint probabilities of events\n",
    "\n",
    "IgorModel.get_P_joint(['event_nickname_1', 'event_nickname_2', ...])\n",
    "\n",
    "> :WARNING: **Be carefull with this function a the computer memory consumption could increase if more than 2 events are requested**.\n",
    "\n",
    "$P(\\text{'v_choice'}, \\text{'j_choice'}) = $mdl_hb.get_P_joint(['v_choice', 'j_choice'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><svg style=\"position: absolute; width: 0; height: 0; overflow: hidden\">\n",
       "<defs>\n",
       "<symbol id=\"icon-database\" viewBox=\"0 0 32 32\">\n",
       "<path d=\"M16 0c-8.837 0-16 2.239-16 5v4c0 2.761 7.163 5 16 5s16-2.239 16-5v-4c0-2.761-7.163-5-16-5z\"></path>\n",
       "<path d=\"M16 17c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
       "<path d=\"M16 26c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
       "</symbol>\n",
       "<symbol id=\"icon-file-text2\" viewBox=\"0 0 32 32\">\n",
       "<path d=\"M28.681 7.159c-0.694-0.947-1.662-2.053-2.724-3.116s-2.169-2.030-3.116-2.724c-1.612-1.182-2.393-1.319-2.841-1.319h-15.5c-1.378 0-2.5 1.121-2.5 2.5v27c0 1.378 1.122 2.5 2.5 2.5h23c1.378 0 2.5-1.122 2.5-2.5v-19.5c0-0.448-0.137-1.23-1.319-2.841zM24.543 5.457c0.959 0.959 1.712 1.825 2.268 2.543h-4.811v-4.811c0.718 0.556 1.584 1.309 2.543 2.268zM28 29.5c0 0.271-0.229 0.5-0.5 0.5h-23c-0.271 0-0.5-0.229-0.5-0.5v-27c0-0.271 0.229-0.5 0.5-0.5 0 0 15.499-0 15.5 0v7c0 0.552 0.448 1 1 1h7v19.5z\"></path>\n",
       "<path d=\"M23 26h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
       "<path d=\"M23 22h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
       "<path d=\"M23 18h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
       "</symbol>\n",
       "</defs>\n",
       "</svg>\n",
       "<style>/* CSS stylesheet for displaying xarray objects in jupyterlab.\n",
       " *\n",
       " */\n",
       "\n",
       ":root {\n",
       "  --xr-font-color0: var(--jp-content-font-color0, rgba(0, 0, 0, 1));\n",
       "  --xr-font-color2: var(--jp-content-font-color2, rgba(0, 0, 0, 0.54));\n",
       "  --xr-font-color3: var(--jp-content-font-color3, rgba(0, 0, 0, 0.38));\n",
       "  --xr-border-color: var(--jp-border-color2, #e0e0e0);\n",
       "  --xr-disabled-color: var(--jp-layout-color3, #bdbdbd);\n",
       "  --xr-background-color: var(--jp-layout-color0, white);\n",
       "  --xr-background-color-row-even: var(--jp-layout-color1, white);\n",
       "  --xr-background-color-row-odd: var(--jp-layout-color2, #eeeeee);\n",
       "}\n",
       "\n",
       "html[theme=dark],\n",
       "body.vscode-dark {\n",
       "  --xr-font-color0: rgba(255, 255, 255, 1);\n",
       "  --xr-font-color2: rgba(255, 255, 255, 0.54);\n",
       "  --xr-font-color3: rgba(255, 255, 255, 0.38);\n",
       "  --xr-border-color: #1F1F1F;\n",
       "  --xr-disabled-color: #515151;\n",
       "  --xr-background-color: #111111;\n",
       "  --xr-background-color-row-even: #111111;\n",
       "  --xr-background-color-row-odd: #313131;\n",
       "}\n",
       "\n",
       ".xr-wrap {\n",
       "  display: block;\n",
       "  min-width: 300px;\n",
       "  max-width: 700px;\n",
       "}\n",
       "\n",
       ".xr-text-repr-fallback {\n",
       "  /* fallback to plain text repr when CSS is not injected (untrusted notebook) */\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-header {\n",
       "  padding-top: 6px;\n",
       "  padding-bottom: 6px;\n",
       "  margin-bottom: 4px;\n",
       "  border-bottom: solid 1px var(--xr-border-color);\n",
       "}\n",
       "\n",
       ".xr-header > div,\n",
       ".xr-header > ul {\n",
       "  display: inline;\n",
       "  margin-top: 0;\n",
       "  margin-bottom: 0;\n",
       "}\n",
       "\n",
       ".xr-obj-type,\n",
       ".xr-array-name {\n",
       "  margin-left: 2px;\n",
       "  margin-right: 10px;\n",
       "}\n",
       "\n",
       ".xr-obj-type {\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-sections {\n",
       "  padding-left: 0 !important;\n",
       "  display: grid;\n",
       "  grid-template-columns: 150px auto auto 1fr 20px 20px;\n",
       "}\n",
       "\n",
       ".xr-section-item {\n",
       "  display: contents;\n",
       "}\n",
       "\n",
       ".xr-section-item input {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-section-item input + label {\n",
       "  color: var(--xr-disabled-color);\n",
       "}\n",
       "\n",
       ".xr-section-item input:enabled + label {\n",
       "  cursor: pointer;\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-section-item input:enabled + label:hover {\n",
       "  color: var(--xr-font-color0);\n",
       "}\n",
       "\n",
       ".xr-section-summary {\n",
       "  grid-column: 1;\n",
       "  color: var(--xr-font-color2);\n",
       "  font-weight: 500;\n",
       "}\n",
       "\n",
       ".xr-section-summary > span {\n",
       "  display: inline-block;\n",
       "  padding-left: 0.5em;\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:disabled + label {\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-section-summary-in + label:before {\n",
       "  display: inline-block;\n",
       "  content: '►';\n",
       "  font-size: 11px;\n",
       "  width: 15px;\n",
       "  text-align: center;\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:disabled + label:before {\n",
       "  color: var(--xr-disabled-color);\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:checked + label:before {\n",
       "  content: '▼';\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:checked + label > span {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-section-summary,\n",
       ".xr-section-inline-details {\n",
       "  padding-top: 4px;\n",
       "  padding-bottom: 4px;\n",
       "}\n",
       "\n",
       ".xr-section-inline-details {\n",
       "  grid-column: 2 / -1;\n",
       "}\n",
       "\n",
       ".xr-section-details {\n",
       "  display: none;\n",
       "  grid-column: 1 / -1;\n",
       "  margin-bottom: 5px;\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:checked ~ .xr-section-details {\n",
       "  display: contents;\n",
       "}\n",
       "\n",
       ".xr-array-wrap {\n",
       "  grid-column: 1 / -1;\n",
       "  display: grid;\n",
       "  grid-template-columns: 20px auto;\n",
       "}\n",
       "\n",
       ".xr-array-wrap > label {\n",
       "  grid-column: 1;\n",
       "  vertical-align: top;\n",
       "}\n",
       "\n",
       ".xr-preview {\n",
       "  color: var(--xr-font-color3);\n",
       "}\n",
       "\n",
       ".xr-array-preview,\n",
       ".xr-array-data {\n",
       "  padding: 0 5px !important;\n",
       "  grid-column: 2;\n",
       "}\n",
       "\n",
       ".xr-array-data,\n",
       ".xr-array-in:checked ~ .xr-array-preview {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-array-in:checked ~ .xr-array-data,\n",
       ".xr-array-preview {\n",
       "  display: inline-block;\n",
       "}\n",
       "\n",
       ".xr-dim-list {\n",
       "  display: inline-block !important;\n",
       "  list-style: none;\n",
       "  padding: 0 !important;\n",
       "  margin: 0;\n",
       "}\n",
       "\n",
       ".xr-dim-list li {\n",
       "  display: inline-block;\n",
       "  padding: 0;\n",
       "  margin: 0;\n",
       "}\n",
       "\n",
       ".xr-dim-list:before {\n",
       "  content: '(';\n",
       "}\n",
       "\n",
       ".xr-dim-list:after {\n",
       "  content: ')';\n",
       "}\n",
       "\n",
       ".xr-dim-list li:not(:last-child):after {\n",
       "  content: ',';\n",
       "  padding-right: 5px;\n",
       "}\n",
       "\n",
       ".xr-has-index {\n",
       "  font-weight: bold;\n",
       "}\n",
       "\n",
       ".xr-var-list,\n",
       ".xr-var-item {\n",
       "  display: contents;\n",
       "}\n",
       "\n",
       ".xr-var-item > div,\n",
       ".xr-var-item label,\n",
       ".xr-var-item > .xr-var-name span {\n",
       "  background-color: var(--xr-background-color-row-even);\n",
       "  margin-bottom: 0;\n",
       "}\n",
       "\n",
       ".xr-var-item > .xr-var-name:hover span {\n",
       "  padding-right: 5px;\n",
       "}\n",
       "\n",
       ".xr-var-list > li:nth-child(odd) > div,\n",
       ".xr-var-list > li:nth-child(odd) > label,\n",
       ".xr-var-list > li:nth-child(odd) > .xr-var-name span {\n",
       "  background-color: var(--xr-background-color-row-odd);\n",
       "}\n",
       "\n",
       ".xr-var-name {\n",
       "  grid-column: 1;\n",
       "}\n",
       "\n",
       ".xr-var-dims {\n",
       "  grid-column: 2;\n",
       "}\n",
       "\n",
       ".xr-var-dtype {\n",
       "  grid-column: 3;\n",
       "  text-align: right;\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-var-preview {\n",
       "  grid-column: 4;\n",
       "}\n",
       "\n",
       ".xr-var-name,\n",
       ".xr-var-dims,\n",
       ".xr-var-dtype,\n",
       ".xr-preview,\n",
       ".xr-attrs dt {\n",
       "  white-space: nowrap;\n",
       "  overflow: hidden;\n",
       "  text-overflow: ellipsis;\n",
       "  padding-right: 10px;\n",
       "}\n",
       "\n",
       ".xr-var-name:hover,\n",
       ".xr-var-dims:hover,\n",
       ".xr-var-dtype:hover,\n",
       ".xr-attrs dt:hover {\n",
       "  overflow: visible;\n",
       "  width: auto;\n",
       "  z-index: 1;\n",
       "}\n",
       "\n",
       ".xr-var-attrs,\n",
       ".xr-var-data {\n",
       "  display: none;\n",
       "  background-color: var(--xr-background-color) !important;\n",
       "  padding-bottom: 5px !important;\n",
       "}\n",
       "\n",
       ".xr-var-attrs-in:checked ~ .xr-var-attrs,\n",
       ".xr-var-data-in:checked ~ .xr-var-data {\n",
       "  display: block;\n",
       "}\n",
       "\n",
       ".xr-var-data > table {\n",
       "  float: right;\n",
       "}\n",
       "\n",
       ".xr-var-name span,\n",
       ".xr-var-data,\n",
       ".xr-attrs {\n",
       "  padding-left: 25px !important;\n",
       "}\n",
       "\n",
       ".xr-attrs,\n",
       ".xr-var-attrs,\n",
       ".xr-var-data {\n",
       "  grid-column: 1 / -1;\n",
       "}\n",
       "\n",
       "dl.xr-attrs {\n",
       "  padding: 0;\n",
       "  margin: 0;\n",
       "  display: grid;\n",
       "  grid-template-columns: 125px auto;\n",
       "}\n",
       "\n",
       ".xr-attrs dt,\n",
       ".xr-attrs dd {\n",
       "  padding: 0;\n",
       "  margin: 0;\n",
       "  float: left;\n",
       "  padding-right: 10px;\n",
       "  width: auto;\n",
       "}\n",
       "\n",
       ".xr-attrs dt {\n",
       "  font-weight: normal;\n",
       "  grid-column: 1;\n",
       "}\n",
       "\n",
       ".xr-attrs dt:hover span {\n",
       "  display: inline-block;\n",
       "  background: var(--xr-background-color);\n",
       "  padding-right: 10px;\n",
       "}\n",
       "\n",
       ".xr-attrs dd {\n",
       "  grid-column: 2;\n",
       "  white-space: pre-wrap;\n",
       "  word-break: break-all;\n",
       "}\n",
       "\n",
       ".xr-icon-database,\n",
       ".xr-icon-file-text2 {\n",
       "  display: inline-block;\n",
       "  vertical-align: middle;\n",
       "  width: 1em;\n",
       "  height: 1.5em !important;\n",
       "  stroke-width: 0;\n",
       "  stroke: currentColor;\n",
       "  fill: currentColor;\n",
       "}\n",
       "</style><pre class='xr-text-repr-fallback'>&lt;xarray.DataArray (v_choice: 89, j_choice: 15)&gt;\n",
       "array([[6.28453463e-04, 5.08306114e-04, 2.00831906e-04, ...,\n",
       "        0.00000000e+00, 2.62143710e-04, 1.82391677e-04],\n",
       "       [1.54890932e-03, 7.36213918e-04, 1.06011576e-04, ...,\n",
       "        2.29432410e-04, 6.05154843e-04, 6.95679479e-04],\n",
       "       [1.54900602e-03, 7.36581450e-04, 1.06039046e-04, ...,\n",
       "        2.28733827e-04, 6.05348578e-04, 6.95983268e-04],\n",
       "       ...,\n",
       "       [4.05407259e-04, 1.55690174e-04, 0.00000000e+00, ...,\n",
       "        1.15101267e-04, 1.80155267e-04, 1.96566942e-04],\n",
       "       [3.00565952e-09, 1.68608515e-12, 0.00000000e+00, ...,\n",
       "        2.81447867e-04, 5.64048061e-05, 6.77364474e-05],\n",
       "       [1.65903669e-03, 1.77940202e-03, 6.30491475e-04, ...,\n",
       "        3.45140763e-04, 1.12130116e-03, 9.08844648e-04]])\n",
       "Coordinates:\n",
       "  * v_choice       (v_choice) int64 0 1 2 3 4 5 6 7 ... 81 82 83 84 85 86 87 88\n",
       "    seq__v_choice  (v_choice) object &#x27;GATACTGGAATTACCCAGACACCAAAATACCTGGTCACA...\n",
       "  * j_choice       (j_choice) int64 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14\n",
       "    seq__j_choice  (j_choice) object &#x27;TGAACACTGAAGCTTTCTTTGGACAAGGCACCAGACTCA...</pre><div class='xr-wrap' hidden><div class='xr-header'><div class='xr-obj-type'>xarray.DataArray</div><div class='xr-array-name'></div><ul class='xr-dim-list'><li><span class='xr-has-index'>v_choice</span>: 89</li><li><span class='xr-has-index'>j_choice</span>: 15</li></ul></div><ul class='xr-sections'><li class='xr-section-item'><div class='xr-array-wrap'><input id='section-3e5de63f-86fb-4cf7-b818-9d18f12a8d4d' class='xr-array-in' type='checkbox' checked><label for='section-3e5de63f-86fb-4cf7-b818-9d18f12a8d4d' title='Show/hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-array-preview xr-preview'><span>0.0006285 0.0005083 0.0002008 ... 0.0003451 0.001121 0.0009088</span></div><div class='xr-array-data'><pre>array([[6.28453463e-04, 5.08306114e-04, 2.00831906e-04, ...,\n",
       "        0.00000000e+00, 2.62143710e-04, 1.82391677e-04],\n",
       "       [1.54890932e-03, 7.36213918e-04, 1.06011576e-04, ...,\n",
       "        2.29432410e-04, 6.05154843e-04, 6.95679479e-04],\n",
       "       [1.54900602e-03, 7.36581450e-04, 1.06039046e-04, ...,\n",
       "        2.28733827e-04, 6.05348578e-04, 6.95983268e-04],\n",
       "       ...,\n",
       "       [4.05407259e-04, 1.55690174e-04, 0.00000000e+00, ...,\n",
       "        1.15101267e-04, 1.80155267e-04, 1.96566942e-04],\n",
       "       [3.00565952e-09, 1.68608515e-12, 0.00000000e+00, ...,\n",
       "        2.81447867e-04, 5.64048061e-05, 6.77364474e-05],\n",
       "       [1.65903669e-03, 1.77940202e-03, 6.30491475e-04, ...,\n",
       "        3.45140763e-04, 1.12130116e-03, 9.08844648e-04]])</pre></div></div></li><li class='xr-section-item'><input id='section-0e1a1b14-15e6-4ec6-9d90-833eee3319dc' class='xr-section-summary-in' type='checkbox'  checked><label for='section-0e1a1b14-15e6-4ec6-9d90-833eee3319dc' class='xr-section-summary' >Coordinates: <span>(4)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>v_choice</span></div><div class='xr-var-dims'>(v_choice)</div><div class='xr-var-dtype'>int64</div><div class='xr-var-preview xr-preview'>0 1 2 3 4 5 6 ... 83 84 85 86 87 88</div><input id='attrs-f1ac24da-5712-475e-82c3-6e8f2b14a6cd' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-f1ac24da-5712-475e-82c3-6e8f2b14a6cd' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-232a412f-f6db-4d68-8157-09bb47c2b8d4' class='xr-var-data-in' type='checkbox'><label for='data-232a412f-f6db-4d68-8157-09bb47c2b8d4' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16, 17,\n",
       "       18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,\n",
       "       36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,\n",
       "       54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71,\n",
       "       72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88])</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>seq__v_choice</span></div><div class='xr-var-dims'>(v_choice)</div><div class='xr-var-dtype'>object</div><div class='xr-var-preview xr-preview'>&#x27;GATACTGGAATTACCCAGACACCAAAATACC...</div><input id='attrs-f91ab3a0-71de-43ae-96ba-31d3ffc4bfa6' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-f91ab3a0-71de-43ae-96ba-31d3ffc4bfa6' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-6ab72f89-b30c-416b-811a-66cf2a6cda26' class='xr-var-data-in' type='checkbox'><label for='data-6ab72f89-b30c-416b-811a-66cf2a6cda26' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([&#x27;GATACTGGAATTACCCAGACACCAAAATACCTGGTCACAGCAATGGGGAGTAAAAGGACAATGAAACGTGAGCATCTGGGACATGATTCTATGTATTGGTACAGACAGAAAGCTAAGAAATCCCTGGAGTTCATGTTTTACTACAACTGTAAGGAATTCATTGAAAACAAGACTGTGCCAAATCACTTCACACCTGAATGCCCTGACAGCTCTCGCTTATACCTTCATGTGGTCGCACTGCAGCAAGAAGACTCAGCTGCGTATCTCTGCACCAGCAGCCAAGA&#x27;,\n",
       "       &#x27;GATGCTGAAATCACCCAGAGCCCAAGACACAAGATCACAGAGACAGGAAGGCAGGTGACCTTGGCGTGTCACCAGACTTGGAACCACAACAATATGTTCTGGTATCGACAAGACCTGGGACATGGGCTGAGGCTGATCCATTACTCATATGGTGTTCAAGACACTAACAAAGGAGAAGTCTCAGATGGCTACAGTGTCTCTAGATCAAACACAGAGGACCTCCCCCTCACTCTGGAGTCTGCTGCCTCCTCCCAGACATCTGTATATTTCTGCGCCAGCAGTGAGTC&#x27;,\n",
       "       &#x27;GATGCTGAAATCACCCAGAGCCCAAGACACAAGATCACAGAGACAGGAAGGCAGGTGACCTTGGCGTGTCACCAGACTTGGAACCACAACAATATGTTCTGGTATCGACAAGACCTGGGACATGGGCTGAGGCTGATCCATTACTCATATGGTGTTCACGACACTAACAAAGGAGAAGTCTCAGATGGCTACAGTGTCTCTAGATCAAACACAGAGGACCTCCCCCTCACTCTGGAGTCTGCTGCCTCCTCCCAGACATCTGTATATTTCTGCGCCAGCAGTGAGTC&#x27;,\n",
       "       &#x27;GATGCTGAAATCACCCAGAGCCCAAGACACAAGATCACAGAGACAGGAAGGCAGGTGACCTTGGCGTGTCACCAGACTTGGAACCACAACAATATGTTCTGGTATCGACAAGACCTGGGACATGGGCTGAGGCTGATCCATTACTCATATGGTGTTCACGACACTAACAAAGGAGAAGTCTCAGATGGCTACAGTGTCTCTAGATCAAACACAGAGGACCTCCCCCTCACTCTGTAGTCTGCTGCCTCCTCCCAGACATCTGTATATTTCTGCGCCAGCAGTGAGTC&#x27;,\n",
       "       &#x27;GATGCTGGAATCACCCAGAGCCCAAGATACAAGATCACAGAGACAGGAAGGCAGGTGACCTTGATGTGTCACCAGACTTGGAGCCACAGCTATATGTTCTGGTATCGACAAGACCTGGGACATGGGCTGAGGCTGATCTATTACTCAGCAGCTGCTGATATTACAGATAAAGGAGAAGTCCCCGATGGCTATGTTGTCTCCAGATCCAAGACAGAGAATTTCCCCCTCACTCTGGAGTCAGCTACCCGCTCCCAGACATCTGTGTATTTCTGCGCCAGCAGTGAGTC&#x27;,\n",
       "       &#x27;GATGCTGGAATCACCCAGAGCCCAAGACACAAGGTCACAGAGACAGGAACACCAGTGACTCTGAGATGTCACCAGACTGAGAACCACCGCTATATGTACTGGTATCGACAAGACCCGGGGCATGGGCTGAGGCTGATCCATTACTCATATGGTGTTAAAGATACTGACAAAGGAGAAGTCTCAGATGGCTATAGTGTCTCTAGATCAAAGACAGAGGATTTCCTCCTCACTCTGGAGTCCGCTACCAGCTCCCAGACATCTGTGTACTTCTGTGCCATCAGTGAGTC&#x27;,\n",
       "       &#x27;GCTGGAATCACCCAGAGCCCAAGACACAAGGTCACAGAGACAGGAACACCAGTGACTCTGAGATGTCATCAGACTGAGAACCACCGCTATATGTACTGGTATCGACAAGACCCGGGGCATGGGCTGAGGCTGATCCATTACTCATATGGTGTTAAAGATACTGACAAAGGAGAAGTCTCAGATGGCTATAGTGTCTCTAGATCAAAGACAGAGGATTTCCTCCTCACTCTGGAGTCCGCTACCAGCTCCCAGACATCTGTGTACTTCTGTGCCATCAGTGAGTC&#x27;,\n",
       "       &#x27;GAAGCTGAAGTTGCCCAGTCCCCCAGATATAAGATTACAGAGAAAAGCCAGGCTGTGGCTTTTTGGTGTGATCCTATTTCTGGCCATGCTACCCTTTACTGGTACCGGCAGATCCTGGGACAGGGCCCGGAGCTTCTGGTTCAATTTCAGGATGAGAGTGTAGTAGATGATTCACAGTTGCCTAAGGATCGATTTTCTGCAGAGAGGCTCAAAGGAGTAGACTCCACTCTCAAGATCCAGCCTGCAGAGCTTGGGGACTCGGCCATGTATCTCTGTGCCAGCAGCTTAGC&#x27;,\n",
       "       &#x27;GAAGCTGGAGTTGCCCAGTCTCCCAGATATAAGATTATAGAGAAAAGGCAGAGTGTGGCTTTTTGGTGCAATCCTATATCTGGCCATGCTACCCTTTACTGGTACCAGCAGATCCTGGGACAGGGCCCAAAGCTTCTGATTCAGTTTCAGAATAACGGTGTAGTGGATGATTCACAGTTGCCTAAGGATCGATTTTCTGCAGAGAGGCTCAAAGGAGTAGACTCCACTCTCAAGATCCAGCCTGCAAAGCTTGAGGACTCGGCCGTGTATCTCTGTGCCAGCAGCTTAGA&#x27;,\n",
       "       &#x27;GAAGCTGGAGTTGCCCAGTCTCCCAGATATAAGATTATAGAGAAAAGGCAGAGTGTGGCTTTTTGGTGCAATCCTATATCTGGCCATGCTACCCTTTACTGGTACCAGCAGATCCTGGGACAGGGCCCAAAGCTTCTGATTCAGTTTCAGAATAACGGTGTAGTGGATGATTCACAGTTGCCTAAGGATCGATTTTCTGCAGAGAGGCTCAAAGGAGTAGACTCCACTCTCAAGATCCAGCCTGCAAAGCTTGAGAACTCGGCCGTGTATCTCTGTGCCAGCAGCTTAGA&#x27;,\n",
       "       &#x27;GAAGCTGGAGTTGCCCAGTCTCCCAGATATAAGATTATAGAGAAAAGGCAGAGTGTGGCTTTTTGGTGCAATCCTATATCTGGCCATGCTACCCTTTACTGGTACCAGCAGATCCTGGGACAGGGCCCAAAGCTTCTGATTCAGTTTCAGAATAACGGTGTAGTGGATGATTCACAGTTGCCTAAGGATCGATTTTCTGCAGAGAGGCTCAAAGGAGTAGACTCCACTCTCAAGATCCAACCTGCAAAGCTTGAGGACTCGGCCGTGTATCTCTGTGCCAGCAGCTTAGA&#x27;,\n",
       "       &#x27;GAAGCTGGAGTGGTTCAGTCTCCCAGATATAAGATTATAGAGAAAAAACAGCCTGTGGCTTTTTGGTGCAATCCTATTTCTGGCCACAATACCCTTTACTGGTACCTGCAGAACTTGGGACAGGGCCCGGAGCTTCTGATTCGATATGAGAATGAGGAAGCAGTAGACGATTCACAGTTGCCTAAGGATCGATTTTCTGCAGAGAGGCTCAAAGGAGTAGACTCCACTCTCAAGATCCAGCCTGCAGAGCTTGGGGACTCGGCCGTGTATCTCTGTGCCAGCAGCTTAGA&#x27;,\n",
       "       &#x27;GCTGGTGTTATCCAGTCACCCAGGCACAAAGTGACAGAGATGGGACAATCAGTAACTCTGAGATGCGAACCAATTTCAGGCCACAATGATCTTCTCTGGTACAGACAGACCTTTGTGCAGGGACTGGAATTGCTGAATTACTTCTGCAGCTGGACCCTCGTAGATGACTCAGGAGTGTCCAAGGATTGATTCTCAGCACAGATGCCTGATGTATCATTCTCCACTCTGAGGATCCAGCCCATGGAACCCAGGGACTTGGGCCTATATTTCTGTGCCAGCAGCTTTGC&#x27;,\n",
       "       &#x27;GCTGGCATTATCCAGTCACCCAAGCATGAGGTGACAGAAATGGGACAAACAGTGACTCTGAGATGTGAGCCAATTTTTGGCCACAATTTCCTTTTCTGGTACAGAGATACCTTCGTGCAGGGACTGGAATTGCTGAGTTACTTCCGGAGCTGATCTATTATAGATAATGCAGGTATGCCCACAGAGCGATTCTCAGCTGAGAGGCCTGATGGATCATTCTCTACTCTGAAGATCCAGCCTGCAGAGCAGGGGGACTCGGCCGTGTATGTCTGTGCAAGTCGCTTAGC&#x27;,\n",
       "       &#x27;GATGCTGGAGTTATCCAGTCACCCCGCCATGAGGTGACAGAGATGGGACAAGAAGTGACTCTGAGATGTAAACCAATTTCAGGCCACAACTCCCTTTTCTGGTACAGACAGACCATGATGCGGGGACTGGAGTTGCTCATTTACTTTAACAACAACGTTCCGATAGATGATTCAGGGATGCCCGAGGATCGATTCTCAGCTAAGATGCCTAATGCATCATTCTCCACTCTGAAGATCCAGCCCTCAGAACCCAGGGACTCAGCTGTGTACTTCTGTGCCAGCAGTTTAGC&#x27;,\n",
       "       &#x27;GATGCTGGAGTTATCCAGTCACCCCGGCACGAGGTGACAGAGATGGGACAAGAAGTGACTCTGAGATGTAAACCAATTTCAGGACACGACTACCTTTTCTGGTACAGACAGACCATGATGCGGGGACTGGAGTTGCTCATTTACTTTAACAACAACGTTCCGATAGATGATTCAGGGATGCCCGAGGATCGATTCTCAGCTAAGATGCCTAATGCATCATTCTCCACTCTGAAGATCCAGCCCTCAGAACCCAGGGACTCAGCTGTGTACTTCTGTGCCAGCAGTTTAGC&#x27;,\n",
       "       &#x27;GATGCTGGAGTTATCCAGTCACCCCGGCACGAGGTGACAGAGATGGGACAAGAAGTGACTCTGAGATGTAAACCAATTTCAGGACATGACTACCTTTTCTGGTACAGACAGACCATGATGCGGGGACTGGAGTTGCTCATTTACTTTAACAACAACGTTCCGATAGATGATTCAGGGATGCCCGAGGATCGATTCTCAGCTAAGATGCCTAATGCATCATTCTCCACTCTGAGGATCCAGCCCTCAGAACCCAGGGACTCAGCTGTGTACTTCTGTGCCAGCAGTTTAGC&#x27;,\n",
       "       &#x27;GATGCTAGAGTCACCCAGACACCAAGGCACAAGGTGACAGAGATGGGACAAGAAGTAACAATGAGATGTCAGCCAATTTTAGGCCACAATACTGTTTTCTGGTACAGACAGACCATGATGCAAGGACTGGAGTTGCTGGCTTACTTCCGCAACCGGGCTCCTCTAGATGATTCGGGGATGCCGAAGGATCGATTCTCAGCAGAGATGCCTGATGCAACTTTAGCCACTCTGAAGATCCAGCCCTCAGAACCCAGGGACTCAGCTGTGTATTTTTGTGCTAGTGGTTTGGT&#x27;,\n",
       "       &#x27;GCTGCTGGAGTCATCCAGTCCCCAAGACATCTGATCAAAGAAAAGAGGGAAACAGCCACTCTGAAATGCTATCCTATCCCTAGACACGACACTGTCTACTGGTACCAGCAGGGTCCAGGTCAGGACCCCCAGTTCCTCATTTCGTTTTATGAAAAGATGCAGAGCGATAAAGGAAGCATCCCTGATCGATTCTCAGCTCAACAGTTCAGTGACTATCATTCTGAACTGAACATGAGCTCCTTGGAGCTGGGGGACTCAGCCCTGTACTTCTGTGCCAGCAGCTTAGG&#x27;,\n",
       "       &#x27;GAAGCTGGAGTTACTCAGTTCCCCAGCCACAGCGTAATAGAGAAGGGCCAGACTGTGACTCTGAGATGTGACCCAATTTCTGGACATGATAATCTTTATTGGTATCGACGTGTTATGGGAAAAGAAATAAAATTTCTGTTACATTTTGTGAAAGAGTCTAAACAGGATGAGTCCGGTATGCCCAACAATCGATTCTTAGCTGAAAGGACTGGAGGGACGTATTCTACTCTGAAGGTGCAGCCTGCAGAACTGGAGGATTCTGGAGTTTATTTCTGTGCCAGCAGCCAAGA&#x27;,\n",
       "...\n",
       "       &#x27;GGAGCTGGAGTCTCCCAGTCCCCCAGTAACAAGGTCACAGAGAAGGGAAAGGATGTAGAGCTCAGGTGTGATCCAATTTCAGGTCATACTGCCCTTTACTGGTACCGACAGAGGCTGGGGCAGGGCCTGGAGTTTTTAATTTACTTCCAAGGCAACAGTGCACCAGACAAATCAGGGCTGCCCAGTGATCGCTTCTCTGCAGAGAGGACTGGGGAATCCGTCTCCACTCTGACGATCCAGCGCACACAGCAGGAGGACTCGGCCGTGTATCTCTGTGCCAGCAGCTTAGC&#x27;,\n",
       "       &#x27;GCTGGAGTCTCCCAGTCCCCCAGTAACAAGGTCACAGAGAAGGGAAAGGATGTAGAGCTCAGGTGTGATCCAATTTCAGGTCATACTGCCCTTTACTGGTACCGACAGAGGCTGGGGCAGGGCCTGGAGTTTTTAATTTACTTCCAAGGCAACAGTGCACCAGACAAATCAGGGCTGCCCAGTGATCGCTTCTCTGCAGAGAGGACTGGGGAATCCGTCTCCACTCTGACGATCCAGCGCACACAGCAGGAGGACTCGGCCGTGTATCTCTGTACCAGCAGCTTAGC&#x27;,\n",
       "       &#x27;GGAGCTGGAGTCTCCCAGTCCCCCAGTAACAAGGTCACAGAGAAGGGAAAGGATGTAGAGCTCAGGTGTGATCCAATTTCAGGTCATACTGCCCTTTACTGGTACCGACAGAGGCTGGGGCAGGGCCTGGAGTTTTTAATTTACTTCCAAGGCAACAGTGCACCAGACAAATCAGGGCTGCCCAGTGATCGCTTCTCTGCAGAGAGGACTGGGGAATCCGTCTCCACTCTGACGATCCAGCGCACATAGCAGGAGGACTCGGCCGTGTATCTCTGTGCCAGCAGCTTAGC&#x27;,\n",
       "       &#x27;GGTGCTGGAGTCTCCCAGACCCCCAGTAACAAGGTCACAGAGAAGGGAAAATATGTAGAGCTCAGGTGTGATCCAATTTCAGGTCATACTGCCCTTTACTGGTACCGACAAAGCCTGGGGCAGGGCCCAGAGTTTCTAATTTACTTCCAAGGCACGGGTGCGGCAGATGACTCAGGGCTGCCCAACGATCGGTTCTTTGCAGTCAGGCCTGAGGGATCCGTCTCTACTCTGAAGATCCAGCGCACAGAGCGGGGGGACTCAGCCGTGTATCTCTGTGCCAGCAGCTTAAC&#x27;,\n",
       "       &#x27;GGTGCTGGAGTCTCCCAGACCCCCAGTAACAAGGTCACAGAGAAGGGAAAAGATGTAGAGCTCAGGTGTGATCCAATTTCAGGTCATACTGCCCTTTACTGGTACCGACAAAGCCTGGGGCAGGGCCCAGAGTTTCTAATTTACTTCCAAGGCACGGGTGCGGCAGATGACTCAGGGCTGCCCAAAGATCGGTTCTTTGCAGTCAGGCCTGAGGGATCCGTCTCTACTCTGAAGATCCAGCGCACAGAGCAGGGGGACTCAGCCGTGTATCTCCGTGCCAGCAGCTTAAC&#x27;,\n",
       "       &#x27;GGTGCTGGAGTCTCCCAGACCCCCAGTAACAAGGTCACAGAGAAGGGAAAAGATGTAGAGCTCAGGTGTGATCCAATTTCAGGTCATACTGCCCTTTACTGGTACCGACAAAGCCTGGGGCAGGGCCCAGAGTTTCTAATTTACTTCCAAGGCACGGGTGCGGCAGATGACTCAGGGCTGCCCAAAGATCGGTTCTTTGCAGTCAGGCCTGAGGGATCCGTCTCTACTCTGAAGATCCAGCGCACAGAGCAGGGGGACTCAGCCGCGTATCTCCGTGCCAGCAGCTTAAC&#x27;,\n",
       "       &#x27;GGTGCTGGAGTCTCCCAGACCCCCAGTAACAAGGTCACAGAGAAGGGAAAATATGTAGAGCTCAGGTGTGATCCAATTTCAGGTCATACTGCCCTTTACTGGTACCGACAAAGCCTGGGGCAGGGCCCAGAGTTTCTAATTTACTTCCAAGGCACGGGTGCGGCAGATGACTCAGGGCTGCCCAACGATCGGTTCTTTGCAGTCAGGCCTGAGGGATCCGTCTCTACTCTGAAGATCCAGCGCACAGAGCGGGGGGACTCTGCCGTGTATCTCTGTGCCAGCAGCTTAAC&#x27;,\n",
       "       &#x27;GGTGCTGGAGTCTCCCAGTCCCCAAGGTACAAAGTCGCAAAGAGGGGACGGGATGTAGCTCTCAGGTGTGATTCAATTTCGGGTCATGTAACCCTTTATTGGTACCGACAGACCCTGGGGCAGGGCTCAGAGGTTCTGACTTACTCCCAGAGTGATGCTCAACGAGACAAATCAGGGCGGCCCAGTGGTCGGTTCTCTGCAGAGAGGCCTGAGAGATCCGTCTCCACTCTGAAGATCCAGCGCACAGAGCAGGGGGACTCAGCTGTGTATCTCTGTGCCAGCAGCTTAGC&#x27;,\n",
       "       &#x27;GGTGCTGGAGTCTCCCAGTCTCCCAGGTACAAAGTCACAAAGAGGGGACAGGATGTAGCTCTCAGGTGTGATCCAATTTCGGGTCATGTATCCCTTTATTGGTACCGACAGGCCCTGGGGCAGGGCCCAGAGTTTCTGACTTACTTCAATTATGAAGCCCAACAAGACAAATCAGGGCTGCCCAATGATCGGTTCTCTGCAGAGAGGCCTGAGGGATCCATCTCCACTCTGACGATCCAGCGCACAGAGCAGCGGGACTCGGCCATGTATCGCTGTGCCAGCAGCTTAGC&#x27;,\n",
       "       &#x27;GGTGCTGGAGTCTCCCAGTCTCCCAGGTACAAAGTCACAAAGAGGGGACAGGATGTAACTCTCAGGTGTGATCCAATTTCGAGTCATGCAACCCTTTATTGGTATCAACAGGCCCTGGGGCAGGGCCCAGAGTTTCTGACTTACTTCAATTATGAAGCTCAACCAGACAAATCAGGGCTGCCCAGTGATCGGTTCTCTGCAGAGAGGCCTGAGGGATCCATCTCCACTCTGACGATTCAGCGCACAGAGCAGCGGGACTCAGCCATGTATCGCTGTGCCAGCAGCTTAGC&#x27;,\n",
       "       &#x27;GGTGCTGGAGTCTCCCAGTCTCCCAGGTACAAAGTCACAAAGAGGGGACAGGATGTAACTCTCAGGTGTGATCCAATTTCGAGTCATGCAACCCTTTATTGGTATCAACAGGCCCTGGGGCAGGGCCCAGAGTTTCTGACTTACTTCAATTATGAAGCTCAACCAGACAAATCAGGGCTGCCCAGTGATCGGTTCTCTGCAGAGAGGCCTGAGGGATCCATCTCCACTCTGACGATTCAGCGCACAGAGCAGCGGGACTCAGCCATGTATCGCTGTGCTAGCAGCTTAGC&#x27;,\n",
       "       &#x27;GGTGCTGGAGTCTCCCAGTCCCCTAGGTACAAAGTCGCAAAGAGAGGACAGGATGTAGCTCTCAGGTGTGATCCAATTTCGGGTCATGTATCCCTTTTTTGGTACCAACAGGCCCTGGGGCAGGGGCCAGAGTTTCTGACTTATTTCCAGAATGAAGCTCAACTAGACAAATCGGGGCTGCCCAGTGATCGCTTCTTTGCAGAAAGGCCTGAGGGATCCGTCTCCACTCTGAAGATCCAGCGCACACAGCAGGAGGACTCCGCCGTGTATCTCTGTGCCAGCAGCTTAGC&#x27;,\n",
       "       &#x27;GGTGCTGGAGTCTCCCAGTCCCCTAGGTACAAAGTCGCAAAGAGAGGACAGGATGTAGCTCTCAGGTGTGATCCAATTTCGGGTCATGTATCCCTTTTTTGGTACCAACAGGCCCTGGGGCAGGGGCCAGAGTTTCTGACTTATTTCCAGAATGAAGCTCAACTAGACAAATCGGGGCTGCCCAGTGATCGCTTCTTTGCAGAAAGGCCTGAGGGATCCGTCTCCACTCTGAAGATCCAGCGCACACAGAAGGAGGACTCCGCCGTGTATCTCTGTGCCAGCAGCTTAGC&#x27;,\n",
       "       &#x27;GATACTGGAGTCTCCCAGAACCCCAGACACAAGATCACAAAGAGGGGACAGAATGTAACTTTCAGGTGTGATCCAATTTCTGAACACAACCGCCTTTATTGGTACCGACAGACCCTGGGGCAGGGCCCAGAGTTTCTGACTTACTTCCAGAATGAAGCTCAACTAGAAAAATCAAGGCTGCTCAGTGATCGGTTCTCTGCAGAGAGGCCTAAGGGATCTTTCTCCACCTTGGAGATCCAGCGCACAGAGCAGGGGGACTCGGCCATGTATCTCTGTGCCAGCAGCTTAGC&#x27;,\n",
       "       &#x27;ATATCTGGAGTCTCCCACAACCCCAGACACAAGATCACAAAGAGGGGACAGAATGTAACTTTCAGGTGTGATCCAATTTCTGAACACAACCGCCTTTATTGGTACCGACAGAACCCTGGGCAGGGCCCAGAGTTTCTGACTTACTTCCAGAATGAAGCTCAACTGGAAAAATCAGGGCTGCTCAGTGATCGGATCTCTGCAGAGAGGCCTAAGGGATCTTTCTCCACCTTGGAGATCCAGCGCACAGAGCAGGGGGACTCGGCCATGTATCTCTGTGCCAGCAGCTTAGC&#x27;,\n",
       "       &#x27;GATACTGGAGTCTCCCAGAACCCCAGACACAAGATCACAAAGAGGGGACAGAATGTAACTTTCAGGTGTGATCCAATTTCTGAACACAACCGCCTTTATTGGTACCGACAGACCCTGGGGCAGGGCCCAGAGTTTCTGACTTACTTCCAGAATGAAGCTCAACTAGAAAAATCAAGGCTGCTCAGTGATCGGTTCTCTGCAGAGAGGCCTAAGGGATCTCTCTCCACCTTGGAGATCCAGCGCACAGAGCAGGGGGACTCGGCCATGTATCTCTGTGCCAGCAGCTTAGC&#x27;,\n",
       "       &#x27;GATACTGGAGTCTCCCAGAACCCCAGACACAAGATCACAAAGAGGGGACAGAATGTAACTTTCAGGTGTGATCCAATTTCTGAACACAACCGCCTTTATTGGTACCGACAGACCCTGGGGCAGGGCCCAGAGTTTCTGACTTACTTCCAGAATGAAGCTCAACTAGAAAAATCAAGGCTGCTCAGTGATCGGTTCTCTGCAGAGAGGCCTAAGGGATCTCTTTCCACCTTGGAGATCCAGCGCACAGAGCAGGGGGACTCGGCCATGTATCTCTGTGCCAGCAGCTTAGC&#x27;,\n",
       "       &#x27;CACAACCGCCTTTATTGGTACCGACAGACCCTGGGGCAGGGCCCAGAGTTTCTGACTTACTTCCAGAATGAAGCTCAACTAGAAAAATCAAGGCTGCTCAGTGATCGGTTCTCTGCAGAGAGGCCTAAGGGATCTTTCTCCACCTTGGAGATCCAGCGCACAGAGGAGGGGGACTCGGCCATGTATCTCTGTGCCAGCAGCTTAGC&#x27;,\n",
       "       &#x27;GATTCTGGAGTCACACAAACCCCAAAGCACCTGATCACAGCAACTGGACAGCGAGTGACGCTGAGATGCTCCCCTAGGTCTGGAGACCTCTCTGTGTACTGGTACCAACAGAGCCTGGACCAGGGCCTCCAGTTCCTCATTCAGTATTATAATGGAGAAGAGAGAGCAAAAGGAAACATTCTTGAACGATTCTCCGCACAACAGTTCCCTGACTTGCACTCTGAACTAAACCTGAGCTCTCTGGAGCTGGGGGACTCAGCTTTGTATTTCTGTGCCAGCAGCGTAG&#x27;],\n",
       "      dtype=object)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>j_choice</span></div><div class='xr-var-dims'>(j_choice)</div><div class='xr-var-dtype'>int64</div><div class='xr-var-preview xr-preview'>0 1 2 3 4 5 6 7 8 9 10 11 12 13 14</div><input id='attrs-66c8b885-626a-4094-afa4-8363b904a981' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-66c8b885-626a-4094-afa4-8363b904a981' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-c4f2ebcc-caca-4b7c-b27a-bb3b4e9b67cd' class='xr-var-data-in' type='checkbox'><label for='data-c4f2ebcc-caca-4b7c-b27a-bb3b4e9b67cd' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14])</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>seq__j_choice</span></div><div class='xr-var-dims'>(j_choice)</div><div class='xr-var-dtype'>object</div><div class='xr-var-preview xr-preview'>&#x27;TGAACACTGAAGCTTTCTTTGGACAAGGCAC...</div><input id='attrs-bf911862-70ce-4601-bc2f-d17670294cff' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-bf911862-70ce-4601-bc2f-d17670294cff' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-c06cdaa2-7e27-41e1-a5d2-f225124f5b02' class='xr-var-data-in' type='checkbox'><label for='data-c06cdaa2-7e27-41e1-a5d2-f225124f5b02' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([&#x27;TGAACACTGAAGCTTTCTTTGGACAAGGCACCAGACTCACAGTTGTAG&#x27;,\n",
       "       &#x27;CTAACTATGGCTACACCTTCGGTTCGGGGACCAGGTTAACCGTTGTAG&#x27;,\n",
       "       &#x27;CTCTGGAAACACCATATATTTTGGAGAGGGAAGTTGGCTCACTGTTGTAG&#x27;,\n",
       "       &#x27;CAACTAATGAAAAACTGTTTTTTGGCAGTGGAACCCAGCTCTCTGTCTTGG&#x27;,\n",
       "       &#x27;TAGCAATCAGCCCCAGCATTTTGGTGATGGGACTCGACTCTCCATCCTAG&#x27;,\n",
       "       &#x27;CTCCTATAATTCACCCCTCCACTTTGGGAATGGGACCAGGCTCACTGTGACAG&#x27;,\n",
       "       &#x27;CTCCTATAATTCACCCCTCCACTTTGGGAACGGGACCAGGCTCACTGTGACAG&#x27;,\n",
       "       &#x27;CTCCTACAATGAGCAGTTCTTCGGGCCAGGGACACGGCTCACCGTGCTAG&#x27;,\n",
       "       &#x27;CGAACACCGGGGAGCTGTTTTTTGGAGAAGGCTCTAGGCTGACCGTACTGG&#x27;,\n",
       "       &#x27;AGCACAGATACGCAGTATTTTGGCCCAGGCACCCGGCTGACAGTGCTCG&#x27;,\n",
       "       &#x27;AGCCAAAAACATTCAGTACTTCGGCGCCGGGACCCGGCTCTCAGTGCTGG&#x27;,\n",
       "       &#x27;ACCAAGAGACCCAGTACTTCGGGCCAGGCACGCGGCTCCTGGTGCTCG&#x27;,\n",
       "       &#x27;CTCTGGGGCCAACGTCCTGACTTTCGGGGCCGGCAGCAGGCTGACCGTGCTGG&#x27;,\n",
       "       &#x27;CTCCTACGAGCAGTACTTCGGGCCGGGCACCAGGCTCACGGTCACAG&#x27;,\n",
       "       &#x27;CTCCTACGAGCAGTACGTCGGGCCGGGCACCAGGCTCACGGTCACAG&#x27;], dtype=object)</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-48d7ca67-5ee9-4533-b21f-fafbfaf657b9' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-48d7ca67-5ee9-4533-b21f-fafbfaf657b9' class='xr-section-summary'  title='Expand/collapse section'>Attributes: <span>(0)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><dl class='xr-attrs'></dl></div></li></ul></div></div>"
      ],
      "text/plain": [
       "<xarray.DataArray (v_choice: 89, j_choice: 15)>\n",
       "array([[6.28453463e-04, 5.08306114e-04, 2.00831906e-04, ...,\n",
       "        0.00000000e+00, 2.62143710e-04, 1.82391677e-04],\n",
       "       [1.54890932e-03, 7.36213918e-04, 1.06011576e-04, ...,\n",
       "        2.29432410e-04, 6.05154843e-04, 6.95679479e-04],\n",
       "       [1.54900602e-03, 7.36581450e-04, 1.06039046e-04, ...,\n",
       "        2.28733827e-04, 6.05348578e-04, 6.95983268e-04],\n",
       "       ...,\n",
       "       [4.05407259e-04, 1.55690174e-04, 0.00000000e+00, ...,\n",
       "        1.15101267e-04, 1.80155267e-04, 1.96566942e-04],\n",
       "       [3.00565952e-09, 1.68608515e-12, 0.00000000e+00, ...,\n",
       "        2.81447867e-04, 5.64048061e-05, 6.77364474e-05],\n",
       "       [1.65903669e-03, 1.77940202e-03, 6.30491475e-04, ...,\n",
       "        3.45140763e-04, 1.12130116e-03, 9.08844648e-04]])\n",
       "Coordinates:\n",
       "  * v_choice       (v_choice) int64 0 1 2 3 4 5 6 7 ... 81 82 83 84 85 86 87 88\n",
       "    seq__v_choice  (v_choice) object 'GATACTGGAATTACCCAGACACCAAAATACCTGGTCACA...\n",
       "  * j_choice       (j_choice) int64 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14\n",
       "    seq__j_choice  (j_choice) object 'TGAACACTGAAGCTTTCTTTGGACAAGGCACCAGACTCA..."
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "P_V_J = mdl_hb.get_P_joint(['v_choice', 'j_choice'])\n",
    "P_V_J"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.collections.QuadMesh at 0x7fac1c1fc8d0>"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "[encoded data, 18276 characters]\n",
      "text/plain": [
       "<Figure size 432x288 with 2 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "P_V_J.plot()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.collections.QuadMesh at 0x7fac1c0e7310>"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "[encoded data, 15724 characters]\n",
      "text/plain": [
       "<Figure size 432x288 with 2 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "mdl_hb['j_choice'].plot()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Editing a model"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "A model can be edited manually if necessary. In cases like a long gene description or to add new anchors to the existing genomic templates"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'V':                                                  name  \\\n",
       " id                                                      \n",
       " 0   U66059|TRBV1*01|Homo sapiens|P|V-REGION|91723....   \n",
       " 1   U66059|TRBV10-1*01|Homo sapiens|F|V-REGION|214...   \n",
       " 2   AF009660|TRBV10-1*02|Homo sapiens|F|V-REGION|5...   \n",
       " 3   AF009660|TRBV10-1*04|Homo sapiens|F|V-REGION|5...   \n",
       " 4   U66059|TRBV10-2*01|Homo sapiens|F|V-REGION|239...   \n",
       " ..                                                ...   \n",
       " 84  M14261|TRBV7-9*04|Homo sapiens|(F)|V-REGION|58...   \n",
       " 85  M27385|TRBV7-9*05|Homo sapiens|(F)|V-REGION|34...   \n",
       " 86  X74844|TRBV7-9*06|Homo sapiens|(F)|V-REGION|10...   \n",
       " 87  L14854|TRBV7-9*07|Homo sapiens|(F)|V-REGION|1....   \n",
       " 88  U66059|TRBV9*01|Homo sapiens|F|V-REGION|206836...   \n",
       " \n",
       "                                                 value  anchor_index  \n",
       " id                                                                   \n",
       " 0   GATACTGGAATTACCCAGACACCAAAATACCTGGTCACAGCAATGG...           NaN  \n",
       " 1   GATGCTGAAATCACCCAGAGCCCAAGACACAAGATCACAGAGACAG...         270.0  \n",
       " 2   GATGCTGAAATCACCCAGAGCCCAAGACACAAGATCACAGAGACAG...         270.0  \n",
       " 3   GATGCTGAAATCACCCAGAGCCCAAGACACAAGATCACAGAGACAG...         270.0  \n",
       " 4   GATGCTGGAATCACCCAGAGCCCAAGATACAAGATCACAGAGACAG...         270.0  \n",
       " ..                                                ...           ...  \n",
       " 84  ATATCTGGAGTCTCCCACAACCCCAGACACAAGATCACAAAGAGGG...         273.0  \n",
       " 85  GATACTGGAGTCTCCCAGAACCCCAGACACAAGATCACAAAGAGGG...         273.0  \n",
       " 86  GATACTGGAGTCTCCCAGAACCCCAGACACAAGATCACAAAGAGGG...         273.0  \n",
       " 87  CACAACCGCCTTTATTGGTACCGACAGACCCTGGGGCAGGGCCCAG...         189.0  \n",
       " 88  GATTCTGGAGTCACACAAACCCCAAAGCACCTGATCACAGCAACTG...         270.0  \n",
       " \n",
       " [89 rows x 3 columns],\n",
       " 'D':          name             value\n",
       " id                             \n",
       " 0    TRBD1*01      GGGACAGGGGGC\n",
       " 1    TRBD2*01  GGGACTAGCGGGGGGG\n",
       " 2    TRBD2*02  GGGACTAGCGGGAGGG,\n",
       " 'J':                                                  name  \\\n",
       " id                                                      \n",
       " 0   K02545|TRBJ1-1*01|Homo sapiens|F|J-REGION|749....   \n",
       " 1   K02545|TRBJ1-2*01|Homo sapiens|F|J-REGION|886....   \n",
       " 2   M14158|TRBJ1-3*01|Homo sapiens|F|J-REGION|1499...   \n",
       " 3   M14158|TRBJ1-4*01|Homo sapiens|F|J-REGION|2095...   \n",
       " 4   M14158|TRBJ1-5*01|Homo sapiens|F|J-REGION|2368...   \n",
       " 5   M14158|TRBJ1-6*01|Homo sapiens|F|J-REGION|2859...   \n",
       " 6   L36092|TRBJ1-6*02|Homo sapiens|F|J-REGION|6430...   \n",
       " 7   X02987|TRBJ2-1*01|Homo sapiens|F|J-REGION|800....   \n",
       " 8   X02987|TRBJ2-2*01|Homo sapiens|F|J-REGION|995....   \n",
       " 9   X02987|TRBJ2-3*01|Homo sapiens|F|J-REGION|1282...   \n",
       " 10  X02987|TRBJ2-4*01|Homo sapiens|F|J-REGION|1432...   \n",
       " 11  X02987|TRBJ2-5*01|Homo sapiens|F|J-REGION|1553...   \n",
       " 12  X02987|TRBJ2-6*01|Homo sapiens|F|J-REGION|1673...   \n",
       " 13  M14159|TRBJ2-7*01|Homo sapiens|F|J-REGION|2316...   \n",
       " 14  X02987|TRBJ2-7*02|Homo sapiens|ORF|J-REGION|18...   \n",
       " \n",
       "                                                 value  anchor_index  \n",
       " id                                                                   \n",
       " 0    TGAACACTGAAGCTTTCTTTGGACAAGGCACCAGACTCACAGTTGTAG            17  \n",
       " 1    CTAACTATGGCTACACCTTCGGTTCGGGGACCAGGTTAACCGTTGTAG            17  \n",
       " 2   CTCTGGAAACACCATATATTTTGGAGAGGGAAGTTGGCTCACTGTT...            19  \n",
       " 3   CAACTAATGAAAAACTGTTTTTTGGCAGTGGAACCCAGCTCTCTGT...            20  \n",
       " 4   TAGCAATCAGCCCCAGCATTTTGGTGATGGGACTCGACTCTCCATC...            19  \n",
       " 5   CTCCTATAATTCACCCCTCCACTTTGGGAATGGGACCAGGCTCACT...            22  \n",
       " 6   CTCCTATAATTCACCCCTCCACTTTGGGAACGGGACCAGGCTCACT...            22  \n",
       " 7   CTCCTACAATGAGCAGTTCTTCGGGCCAGGGACACGGCTCACCGTG...            19  \n",
       " 8   CGAACACCGGGGAGCTGTTTTTTGGAGAAGGCTCTAGGCTGACCGT...            20  \n",
       " 9   AGCACAGATACGCAGTATTTTGGCCCAGGCACCCGGCTGACAGTGCTCG            18  \n",
       " 10  AGCCAAAAACATTCAGTACTTCGGCGCCGGGACCCGGCTCTCAGTG...            19  \n",
       " 11   ACCAAGAGACCCAGTACTTCGGGCCAGGCACGCGGCTCCTGGTGCTCG            17  \n",
       " 12  CTCTGGGGCCAACGTCCTGACTTTCGGGGCCGGCAGCAGGCTGACC...            22  \n",
       " 13    CTCCTACGAGCAGTACTTCGGGCCGGGCACCAGGCTCACGGTCACAG            16  \n",
       " 14    CTCCTACGAGCAGTACGTCGGGCCGGGCACCAGGCTCACGGTCACAG            16  }"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mdl_hb.genomic_dataframe_dict"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "First we make a copy of genomic_dataframe_dict"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "id\n",
       "0     U66059|TRBV1*01|Homo sapiens|P|V-REGION|91723....\n",
       "1     U66059|TRBV10-1*01|Homo sapiens|F|V-REGION|214...\n",
       "2     AF009660|TRBV10-1*02|Homo sapiens|F|V-REGION|5...\n",
       "3     AF009660|TRBV10-1*04|Homo sapiens|F|V-REGION|5...\n",
       "4     U66059|TRBV10-2*01|Homo sapiens|F|V-REGION|239...\n",
       "                            ...                        \n",
       "84    M14261|TRBV7-9*04|Homo sapiens|(F)|V-REGION|58...\n",
       "85    M27385|TRBV7-9*05|Homo sapiens|(F)|V-REGION|34...\n",
       "86    X74844|TRBV7-9*06|Homo sapiens|(F)|V-REGION|10...\n",
       "87    L14854|TRBV7-9*07|Homo sapiens|(F)|V-REGION|1....\n",
       "88    U66059|TRBV9*01|Homo sapiens|F|V-REGION|206836...\n",
       "Name: name, Length: 89, dtype: object"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import copy\n",
    "genomic_dict = copy.deepcopy(mdl_hb.genomic_dataframe_dict)\n",
    "genomic_dict['V']['name']"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Then we change the long description names using v_genLabel function."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [],
   "source": [
    "genomic_dict['V']['name'] = p3.v_genLabel(genomic_dict['V']['name'])\n",
    "genomic_dict['J']['name'] = p3.v_genLabel(genomic_dict['J']['name'])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Finally, update the the genomic_dataframe_dict with this new dict, by using the set_genomic_dataframe_dict method."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [],
   "source": [
    "mdl_hb.set_genomic_dataframe_dict(genomic_dict)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "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>value</th>\n",
       "      <th>name</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>id</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>GATACTGGAATTACCCAGACACCAAAATACCTGGTCACAGCAATGG...</td>\n",
       "      <td>TRBV1*01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>GATGCTGAAATCACCCAGAGCCCAAGACACAAGATCACAGAGACAG...</td>\n",
       "      <td>TRBV10-1*01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>GATGCTGAAATCACCCAGAGCCCAAGACACAAGATCACAGAGACAG...</td>\n",
       "      <td>TRBV10-1*02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>GATGCTGAAATCACCCAGAGCCCAAGACACAAGATCACAGAGACAG...</td>\n",
       "      <td>TRBV10-1*04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>GATGCTGGAATCACCCAGAGCCCAAGATACAAGATCACAGAGACAG...</td>\n",
       "      <td>TRBV10-2*01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>84</th>\n",
       "      <td>ATATCTGGAGTCTCCCACAACCCCAGACACAAGATCACAAAGAGGG...</td>\n",
       "      <td>TRBV7-9*04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>85</th>\n",
       "      <td>GATACTGGAGTCTCCCAGAACCCCAGACACAAGATCACAAAGAGGG...</td>\n",
       "      <td>TRBV7-9*05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>86</th>\n",
       "      <td>GATACTGGAGTCTCCCAGAACCCCAGACACAAGATCACAAAGAGGG...</td>\n",
       "      <td>TRBV7-9*06</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>87</th>\n",
       "      <td>CACAACCGCCTTTATTGGTACCGACAGACCCTGGGGCAGGGCCCAG...</td>\n",
       "      <td>TRBV7-9*07</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>88</th>\n",
       "      <td>GATTCTGGAGTCACACAAACCCCAAAGCACCTGATCACAGCAACTG...</td>\n",
       "      <td>TRBV9*01</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>89 rows × 2 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                value         name\n",
       "id                                                                \n",
       "0   GATACTGGAATTACCCAGACACCAAAATACCTGGTCACAGCAATGG...     TRBV1*01\n",
       "1   GATGCTGAAATCACCCAGAGCCCAAGACACAAGATCACAGAGACAG...  TRBV10-1*01\n",
       "2   GATGCTGAAATCACCCAGAGCCCAAGACACAAGATCACAGAGACAG...  TRBV10-1*02\n",
       "3   GATGCTGAAATCACCCAGAGCCCAAGACACAAGATCACAGAGACAG...  TRBV10-1*04\n",
       "4   GATGCTGGAATCACCCAGAGCCCAAGATACAAGATCACAGAGACAG...  TRBV10-2*01\n",
       "..                                                ...          ...\n",
       "84  ATATCTGGAGTCTCCCACAACCCCAGACACAAGATCACAAAGAGGG...   TRBV7-9*04\n",
       "85  GATACTGGAGTCTCCCAGAACCCCAGACACAAGATCACAAAGAGGG...   TRBV7-9*05\n",
       "86  GATACTGGAGTCTCCCAGAACCCCAGACACAAGATCACAAAGAGGG...   TRBV7-9*06\n",
       "87  CACAACCGCCTTTATTGGTACCGACAGACCCTGGGGCAGGGCCCAG...   TRBV7-9*07\n",
       "88  GATTCTGGAGTCACACAAACCCCAAAGCACCTGATCACAGCAACTG...     TRBV9*01\n",
       "\n",
       "[89 rows x 2 columns]"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mdl_hb.parms['v_choice']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><svg style=\"position: absolute; width: 0; height: 0; overflow: hidden\">\n",
       "<defs>\n",
       "<symbol id=\"icon-database\" viewBox=\"0 0 32 32\">\n",
       "<path d=\"M16 0c-8.837 0-16 2.239-16 5v4c0 2.761 7.163 5 16 5s16-2.239 16-5v-4c0-2.761-7.163-5-16-5z\"></path>\n",
       "<path d=\"M16 17c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
       "<path d=\"M16 26c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
       "</symbol>\n",
       "<symbol id=\"icon-file-text2\" viewBox=\"0 0 32 32\">\n",
       "<path d=\"M28.681 7.159c-0.694-0.947-1.662-2.053-2.724-3.116s-2.169-2.030-3.116-2.724c-1.612-1.182-2.393-1.319-2.841-1.319h-15.5c-1.378 0-2.5 1.121-2.5 2.5v27c0 1.378 1.122 2.5 2.5 2.5h23c1.378 0 2.5-1.122 2.5-2.5v-19.5c0-0.448-0.137-1.23-1.319-2.841zM24.543 5.457c0.959 0.959 1.712 1.825 2.268 2.543h-4.811v-4.811c0.718 0.556 1.584 1.309 2.543 2.268zM28 29.5c0 0.271-0.229 0.5-0.5 0.5h-23c-0.271 0-0.5-0.229-0.5-0.5v-27c0-0.271 0.229-0.5 0.5-0.5 0 0 15.499-0 15.5 0v7c0 0.552 0.448 1 1 1h7v19.5z\"></path>\n",
       "<path d=\"M23 26h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
       "<path d=\"M23 22h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
       "<path d=\"M23 18h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
       "</symbol>\n",
       "</defs>\n",
       "</svg>\n",
       "<style>/* CSS stylesheet for displaying xarray objects in jupyterlab.\n",
       " *\n",
       " */\n",
       "\n",
       ":root {\n",
       "  --xr-font-color0: var(--jp-content-font-color0, rgba(0, 0, 0, 1));\n",
       "  --xr-font-color2: var(--jp-content-font-color2, rgba(0, 0, 0, 0.54));\n",
       "  --xr-font-color3: var(--jp-content-font-color3, rgba(0, 0, 0, 0.38));\n",
       "  --xr-border-color: var(--jp-border-color2, #e0e0e0);\n",
       "  --xr-disabled-color: var(--jp-layout-color3, #bdbdbd);\n",
       "  --xr-background-color: var(--jp-layout-color0, white);\n",
       "  --xr-background-color-row-even: var(--jp-layout-color1, white);\n",
       "  --xr-background-color-row-odd: var(--jp-layout-color2, #eeeeee);\n",
       "}\n",
       "\n",
       "html[theme=dark],\n",
       "body.vscode-dark {\n",
       "  --xr-font-color0: rgba(255, 255, 255, 1);\n",
       "  --xr-font-color2: rgba(255, 255, 255, 0.54);\n",
       "  --xr-font-color3: rgba(255, 255, 255, 0.38);\n",
       "  --xr-border-color: #1F1F1F;\n",
       "  --xr-disabled-color: #515151;\n",
       "  --xr-background-color: #111111;\n",
       "  --xr-background-color-row-even: #111111;\n",
       "  --xr-background-color-row-odd: #313131;\n",
       "}\n",
       "\n",
       ".xr-wrap {\n",
       "  display: block;\n",
       "  min-width: 300px;\n",
       "  max-width: 700px;\n",
       "}\n",
       "\n",
       ".xr-text-repr-fallback {\n",
       "  /* fallback to plain text repr when CSS is not injected (untrusted notebook) */\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-header {\n",
       "  padding-top: 6px;\n",
       "  padding-bottom: 6px;\n",
       "  margin-bottom: 4px;\n",
       "  border-bottom: solid 1px var(--xr-border-color);\n",
       "}\n",
       "\n",
       ".xr-header > div,\n",
       ".xr-header > ul {\n",
       "  display: inline;\n",
       "  margin-top: 0;\n",
       "  margin-bottom: 0;\n",
       "}\n",
       "\n",
       ".xr-obj-type,\n",
       ".xr-array-name {\n",
       "  margin-left: 2px;\n",
       "  margin-right: 10px;\n",
       "}\n",
       "\n",
       ".xr-obj-type {\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-sections {\n",
       "  padding-left: 0 !important;\n",
       "  display: grid;\n",
       "  grid-template-columns: 150px auto auto 1fr 20px 20px;\n",
       "}\n",
       "\n",
       ".xr-section-item {\n",
       "  display: contents;\n",
       "}\n",
       "\n",
       ".xr-section-item input {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-section-item input + label {\n",
       "  color: var(--xr-disabled-color);\n",
       "}\n",
       "\n",
       ".xr-section-item input:enabled + label {\n",
       "  cursor: pointer;\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-section-item input:enabled + label:hover {\n",
       "  color: var(--xr-font-color0);\n",
       "}\n",
       "\n",
       ".xr-section-summary {\n",
       "  grid-column: 1;\n",
       "  color: var(--xr-font-color2);\n",
       "  font-weight: 500;\n",
       "}\n",
       "\n",
       ".xr-section-summary > span {\n",
       "  display: inline-block;\n",
       "  padding-left: 0.5em;\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:disabled + label {\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-section-summary-in + label:before {\n",
       "  display: inline-block;\n",
       "  content: '►';\n",
       "  font-size: 11px;\n",
       "  width: 15px;\n",
       "  text-align: center;\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:disabled + label:before {\n",
       "  color: var(--xr-disabled-color);\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:checked + label:before {\n",
       "  content: '▼';\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:checked + label > span {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-section-summary,\n",
       ".xr-section-inline-details {\n",
       "  padding-top: 4px;\n",
       "  padding-bottom: 4px;\n",
       "}\n",
       "\n",
       ".xr-section-inline-details {\n",
       "  grid-column: 2 / -1;\n",
       "}\n",
       "\n",
       ".xr-section-details {\n",
       "  display: none;\n",
       "  grid-column: 1 / -1;\n",
       "  margin-bottom: 5px;\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:checked ~ .xr-section-details {\n",
       "  display: contents;\n",
       "}\n",
       "\n",
       ".xr-array-wrap {\n",
       "  grid-column: 1 / -1;\n",
       "  display: grid;\n",
       "  grid-template-columns: 20px auto;\n",
       "}\n",
       "\n",
       ".xr-array-wrap > label {\n",
       "  grid-column: 1;\n",
       "  vertical-align: top;\n",
       "}\n",
       "\n",
       ".xr-preview {\n",
       "  color: var(--xr-font-color3);\n",
       "}\n",
       "\n",
       ".xr-array-preview,\n",
       ".xr-array-data {\n",
       "  padding: 0 5px !important;\n",
       "  grid-column: 2;\n",
       "}\n",
       "\n",
       ".xr-array-data,\n",
       ".xr-array-in:checked ~ .xr-array-preview {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-array-in:checked ~ .xr-array-data,\n",
       ".xr-array-preview {\n",
       "  display: inline-block;\n",
       "}\n",
       "\n",
       ".xr-dim-list {\n",
       "  display: inline-block !important;\n",
       "  list-style: none;\n",
       "  padding: 0 !important;\n",
       "  margin: 0;\n",
       "}\n",
       "\n",
       ".xr-dim-list li {\n",
       "  display: inline-block;\n",
       "  padding: 0;\n",
       "  margin: 0;\n",
       "}\n",
       "\n",
       ".xr-dim-list:before {\n",
       "  content: '(';\n",
       "}\n",
       "\n",
       ".xr-dim-list:after {\n",
       "  content: ')';\n",
       "}\n",
       "\n",
       ".xr-dim-list li:not(:last-child):after {\n",
       "  content: ',';\n",
       "  padding-right: 5px;\n",
       "}\n",
       "\n",
       ".xr-has-index {\n",
       "  font-weight: bold;\n",
       "}\n",
       "\n",
       ".xr-var-list,\n",
       ".xr-var-item {\n",
       "  display: contents;\n",
       "}\n",
       "\n",
       ".xr-var-item > div,\n",
       ".xr-var-item label,\n",
       ".xr-var-item > .xr-var-name span {\n",
       "  background-color: var(--xr-background-color-row-even);\n",
       "  margin-bottom: 0;\n",
       "}\n",
       "\n",
       ".xr-var-item > .xr-var-name:hover span {\n",
       "  padding-right: 5px;\n",
       "}\n",
       "\n",
       ".xr-var-list > li:nth-child(odd) > div,\n",
       ".xr-var-list > li:nth-child(odd) > label,\n",
       ".xr-var-list > li:nth-child(odd) > .xr-var-name span {\n",
       "  background-color: var(--xr-background-color-row-odd);\n",
       "}\n",
       "\n",
       ".xr-var-name {\n",
       "  grid-column: 1;\n",
       "}\n",
       "\n",
       ".xr-var-dims {\n",
       "  grid-column: 2;\n",
       "}\n",
       "\n",
       ".xr-var-dtype {\n",
       "  grid-column: 3;\n",
       "  text-align: right;\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-var-preview {\n",
       "  grid-column: 4;\n",
       "}\n",
       "\n",
       ".xr-var-name,\n",
       ".xr-var-dims,\n",
       ".xr-var-dtype,\n",
       ".xr-preview,\n",
       ".xr-attrs dt {\n",
       "  white-space: nowrap;\n",
       "  overflow: hidden;\n",
       "  text-overflow: ellipsis;\n",
       "  padding-right: 10px;\n",
       "}\n",
       "\n",
       ".xr-var-name:hover,\n",
       ".xr-var-dims:hover,\n",
       ".xr-var-dtype:hover,\n",
       ".xr-attrs dt:hover {\n",
       "  overflow: visible;\n",
       "  width: auto;\n",
       "  z-index: 1;\n",
       "}\n",
       "\n",
       ".xr-var-attrs,\n",
       ".xr-var-data {\n",
       "  display: none;\n",
       "  background-color: var(--xr-background-color) !important;\n",
       "  padding-bottom: 5px !important;\n",
       "}\n",
       "\n",
       ".xr-var-attrs-in:checked ~ .xr-var-attrs,\n",
       ".xr-var-data-in:checked ~ .xr-var-data {\n",
       "  display: block;\n",
       "}\n",
       "\n",
       ".xr-var-data > table {\n",
       "  float: right;\n",
       "}\n",
       "\n",
       ".xr-var-name span,\n",
       ".xr-var-data,\n",
       ".xr-attrs {\n",
       "  padding-left: 25px !important;\n",
       "}\n",
       "\n",
       ".xr-attrs,\n",
       ".xr-var-attrs,\n",
       ".xr-var-data {\n",
       "  grid-column: 1 / -1;\n",
       "}\n",
       "\n",
       "dl.xr-attrs {\n",
       "  padding: 0;\n",
       "  margin: 0;\n",
       "  display: grid;\n",
       "  grid-template-columns: 125px auto;\n",
       "}\n",
       "\n",
       ".xr-attrs dt,\n",
       ".xr-attrs dd {\n",
       "  padding: 0;\n",
       "  margin: 0;\n",
       "  float: left;\n",
       "  padding-right: 10px;\n",
       "  width: auto;\n",
       "}\n",
       "\n",
       ".xr-attrs dt {\n",
       "  font-weight: normal;\n",
       "  grid-column: 1;\n",
       "}\n",
       "\n",
       ".xr-attrs dt:hover span {\n",
       "  display: inline-block;\n",
       "  background: var(--xr-background-color);\n",
       "  padding-right: 10px;\n",
       "}\n",
       "\n",
       ".xr-attrs dd {\n",
       "  grid-column: 2;\n",
       "  white-space: pre-wrap;\n",
       "  word-break: break-all;\n",
       "}\n",
       "\n",
       ".xr-icon-database,\n",
       ".xr-icon-file-text2 {\n",
       "  display: inline-block;\n",
       "  vertical-align: middle;\n",
       "  width: 1em;\n",
       "  height: 1.5em !important;\n",
       "  stroke-width: 0;\n",
       "  stroke: currentColor;\n",
       "  fill: currentColor;\n",
       "}\n",
       "</style><pre class='xr-text-repr-fallback'>&lt;xarray.DataArray (v_choice: 89)&gt;\n",
       "array([4.88741e-03, 9.32369e-03, 9.32259e-03, 1.30320e-02, 3.43430e-04,\n",
       "       8.50694e-03, 7.71250e-03, 6.12276e-04, 5.06104e-03, 4.59289e-05,\n",
       "       4.48245e-03, 8.16181e-03, 7.00053e-04, 7.77164e-03, 1.16174e-02,\n",
       "       1.16158e-02, 1.13872e-02, 1.06555e-02, 2.36870e-03, 2.28368e-02,\n",
       "       1.56715e-04, 4.58447e-03, 0.00000e+00, 4.88782e-05, 0.00000e+00,\n",
       "       1.54500e-02, 2.74050e-02, 5.18979e-03, 4.80289e-03, 1.62765e-01,\n",
       "       6.61229e-02, 2.07174e-02, 7.36226e-04, 2.47846e-37, 1.07472e-02,\n",
       "       2.03820e-02, 9.53245e-03, 9.53006e-03, 2.35607e-03, 2.39208e-03,\n",
       "       2.39208e-03, 2.45219e-03, 1.66904e-02, 2.98807e-03, 2.98804e-03,\n",
       "       1.59156e-02, 1.25468e-02, 9.06711e-03, 9.06936e-03, 9.76534e-02,\n",
       "       9.57746e-03, 9.17011e-03, 1.14472e-02, 1.14458e-02, 9.77554e-03,\n",
       "       1.89924e-02, 3.97949e-04, 1.70242e-03, 8.91336e-03, 6.73926e-03,\n",
       "       6.69167e-03, 2.94257e-02, 1.38534e-02, 4.19227e-03, 4.19275e-03,\n",
       "       2.48630e-03, 4.83399e-04, 1.29795e-07, 6.49975e-05, 1.94736e-02,\n",
       "       1.94728e-02, 0.00000e+00, 3.91595e-03, 3.96230e-02, 0.00000e+00,\n",
       "       0.00000e+00, 6.73805e-05, 2.90073e-02, 9.28490e-03, 5.32118e-03,\n",
       "       8.18432e-03, 1.07035e-03, 3.64764e-04, 3.26790e-03, 3.26801e-03,\n",
       "       3.26801e-03, 3.26809e-03, 8.23600e-04, 1.56399e-02])\n",
       "Coordinates:\n",
       "  * v_choice       (v_choice) int64 0 1 2 3 4 5 6 7 ... 81 82 83 84 85 86 87 88\n",
       "    lbl__v_choice  (v_choice) object &#x27;TRBV1*01&#x27; &#x27;TRBV10-1*01&#x27; ... &#x27;TRBV9*01&#x27;\n",
       "    seq__v_choice  (v_choice) object &#x27;GATACTGGAATTACCCAGACACCAAAATACCTGGTCACA...\n",
       "Attributes:\n",
       "    nickname:    v_choice\n",
       "    event_type:  GeneChoice\n",
       "    seq_type:    V_gene\n",
       "    seq_side:    Undefined_side\n",
       "    priority:    7\n",
       "    parents:     []\n",
       "    childs:      [&#x27;v_3_del&#x27;, &#x27;d_gene&#x27;, &#x27;j_choice&#x27;]</pre><div class='xr-wrap' hidden><div class='xr-header'><div class='xr-obj-type'>xarray.DataArray</div><div class='xr-array-name'></div><ul class='xr-dim-list'><li><span class='xr-has-index'>v_choice</span>: 89</li></ul></div><ul class='xr-sections'><li class='xr-section-item'><div class='xr-array-wrap'><input id='section-0d068411-73b9-4243-8f22-294e06c6bce4' class='xr-array-in' type='checkbox' checked><label for='section-0d068411-73b9-4243-8f22-294e06c6bce4' title='Show/hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-array-preview xr-preview'><span>0.004887 0.009324 0.009323 0.01303 ... 0.003268 0.0008236 0.01564</span></div><div class='xr-array-data'><pre>array([4.88741e-03, 9.32369e-03, 9.32259e-03, 1.30320e-02, 3.43430e-04,\n",
       "       8.50694e-03, 7.71250e-03, 6.12276e-04, 5.06104e-03, 4.59289e-05,\n",
       "       4.48245e-03, 8.16181e-03, 7.00053e-04, 7.77164e-03, 1.16174e-02,\n",
       "       1.16158e-02, 1.13872e-02, 1.06555e-02, 2.36870e-03, 2.28368e-02,\n",
       "       1.56715e-04, 4.58447e-03, 0.00000e+00, 4.88782e-05, 0.00000e+00,\n",
       "       1.54500e-02, 2.74050e-02, 5.18979e-03, 4.80289e-03, 1.62765e-01,\n",
       "       6.61229e-02, 2.07174e-02, 7.36226e-04, 2.47846e-37, 1.07472e-02,\n",
       "       2.03820e-02, 9.53245e-03, 9.53006e-03, 2.35607e-03, 2.39208e-03,\n",
       "       2.39208e-03, 2.45219e-03, 1.66904e-02, 2.98807e-03, 2.98804e-03,\n",
       "       1.59156e-02, 1.25468e-02, 9.06711e-03, 9.06936e-03, 9.76534e-02,\n",
       "       9.57746e-03, 9.17011e-03, 1.14472e-02, 1.14458e-02, 9.77554e-03,\n",
       "       1.89924e-02, 3.97949e-04, 1.70242e-03, 8.91336e-03, 6.73926e-03,\n",
       "       6.69167e-03, 2.94257e-02, 1.38534e-02, 4.19227e-03, 4.19275e-03,\n",
       "       2.48630e-03, 4.83399e-04, 1.29795e-07, 6.49975e-05, 1.94736e-02,\n",
       "       1.94728e-02, 0.00000e+00, 3.91595e-03, 3.96230e-02, 0.00000e+00,\n",
       "       0.00000e+00, 6.73805e-05, 2.90073e-02, 9.28490e-03, 5.32118e-03,\n",
       "       8.18432e-03, 1.07035e-03, 3.64764e-04, 3.26790e-03, 3.26801e-03,\n",
       "       3.26801e-03, 3.26809e-03, 8.23600e-04, 1.56399e-02])</pre></div></div></li><li class='xr-section-item'><input id='section-0d740624-b2ed-422e-82e0-e01cdeb03fe4' class='xr-section-summary-in' type='checkbox'  checked><label for='section-0d740624-b2ed-422e-82e0-e01cdeb03fe4' class='xr-section-summary' >Coordinates: <span>(3)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>v_choice</span></div><div class='xr-var-dims'>(v_choice)</div><div class='xr-var-dtype'>int64</div><div class='xr-var-preview xr-preview'>0 1 2 3 4 5 6 ... 83 84 85 86 87 88</div><input id='attrs-0956ad3f-0f6a-42a1-851a-60653c2d77b0' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-0956ad3f-0f6a-42a1-851a-60653c2d77b0' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-68ac2d9f-5e22-4336-881e-1e72a1526c01' class='xr-var-data-in' type='checkbox'><label for='data-68ac2d9f-5e22-4336-881e-1e72a1526c01' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16, 17,\n",
       "       18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,\n",
       "       36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,\n",
       "       54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71,\n",
       "       72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88])</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>lbl__v_choice</span></div><div class='xr-var-dims'>(v_choice)</div><div class='xr-var-dtype'>object</div><div class='xr-var-preview xr-preview'>&#x27;TRBV1*01&#x27; ... &#x27;TRBV9*01&#x27;</div><input id='attrs-a8a44b06-1127-441e-a0f5-a72a62bc7ecc' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-a8a44b06-1127-441e-a0f5-a72a62bc7ecc' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-e965abfd-4b5f-40d8-b810-562f8c314086' class='xr-var-data-in' type='checkbox'><label for='data-e965abfd-4b5f-40d8-b810-562f8c314086' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([&#x27;TRBV1*01&#x27;, &#x27;TRBV10-1*01&#x27;, &#x27;TRBV10-1*02&#x27;, &#x27;TRBV10-1*04&#x27;,\n",
       "       &#x27;TRBV10-2*01&#x27;, &#x27;TRBV10-3*01&#x27;, &#x27;TRBV10-3*02&#x27;, &#x27;TRBV11-1*01&#x27;,\n",
       "       &#x27;TRBV11-2*01&#x27;, &#x27;TRBV11-2*02&#x27;, &#x27;TRBV11-2*03&#x27;, &#x27;TRBV11-3*01&#x27;,\n",
       "       &#x27;TRBV12-1*01&#x27;, &#x27;TRBV12-2*01&#x27;, &#x27;TRBV12-3*01&#x27;, &#x27;TRBV12-4*01&#x27;,\n",
       "       &#x27;TRBV12-4*02&#x27;, &#x27;TRBV12-5*01&#x27;, &#x27;TRBV13*01&#x27;, &#x27;TRBV14*01&#x27;,\n",
       "       &#x27;TRBV15*01&#x27;, &#x27;TRBV15*02&#x27;, &#x27;TRBV15*03&#x27;, &#x27;TRBV16*01&#x27;, &#x27;TRBV17*01&#x27;,\n",
       "       &#x27;TRBV18*01&#x27;, &#x27;TRBV19*01&#x27;, &#x27;TRBV2*01&#x27;, &#x27;TRBV2*03&#x27;, &#x27;TRBV20-1*01&#x27;,\n",
       "       &#x27;TRBV23-1*01&#x27;, &#x27;TRBV24-1*01&#x27;, &#x27;TRBV25-1*01&#x27;, &#x27;TRBV26*01&#x27;,\n",
       "       &#x27;TRBV27*01&#x27;, &#x27;TRBV28*01&#x27;, &#x27;TRBV29-1*01&#x27;, &#x27;TRBV29-1*02&#x27;,\n",
       "       &#x27;TRBV3-1*01&#x27;, &#x27;TRBV3-1*02&#x27;, &#x27;TRBV3-2*01&#x27;, &#x27;TRBV3-2*02&#x27;,\n",
       "       &#x27;TRBV30*01&#x27;, &#x27;TRBV30*02&#x27;, &#x27;TRBV30*04&#x27;, &#x27;TRBV4-1*01&#x27;, &#x27;TRBV4-2*01&#x27;,\n",
       "       &#x27;TRBV4-3*01&#x27;, &#x27;TRBV4-3*02&#x27;, &#x27;TRBV5-1*01&#x27;, &#x27;TRBV5-3*01&#x27;,\n",
       "       &#x27;TRBV5-3*02&#x27;, &#x27;TRBV5-4*01&#x27;, &#x27;TRBV5-4*02&#x27;, &#x27;TRBV5-5*01&#x27;,\n",
       "       &#x27;TRBV5-6*01&#x27;, &#x27;TRBV5-7*01&#x27;, &#x27;TRBV5-8*01&#x27;, &#x27;TRBV6-1*01&#x27;,\n",
       "       &#x27;TRBV6-2*01&#x27;, &#x27;TRBV6-3*01&#x27;, &#x27;TRBV6-4*01&#x27;, &#x27;TRBV6-5*01&#x27;,\n",
       "       &#x27;TRBV6-6*01&#x27;, &#x27;TRBV6-6*02&#x27;, &#x27;TRBV6-7*01&#x27;, &#x27;TRBV6-8*01&#x27;,\n",
       "       &#x27;TRBV6-9*01&#x27;, &#x27;TRBV7-1*01&#x27;, &#x27;TRBV7-2*01&#x27;, &#x27;TRBV7-2*02&#x27;,\n",
       "       &#x27;TRBV7-2*03&#x27;, &#x27;TRBV7-2*05&#x27;, &#x27;TRBV7-3*01&#x27;, &#x27;TRBV7-3*02&#x27;,\n",
       "       &#x27;TRBV7-3*03&#x27;, &#x27;TRBV7-3*04&#x27;, &#x27;TRBV7-4*01&#x27;, &#x27;TRBV7-6*01&#x27;,\n",
       "       &#x27;TRBV7-7*01&#x27;, &#x27;TRBV7-7*03&#x27;, &#x27;TRBV7-8*01&#x27;, &#x27;TRBV7-8*02&#x27;,\n",
       "       &#x27;TRBV7-9*01&#x27;, &#x27;TRBV7-9*04&#x27;, &#x27;TRBV7-9*05&#x27;, &#x27;TRBV7-9*06&#x27;,\n",
       "       &#x27;TRBV7-9*07&#x27;, &#x27;TRBV9*01&#x27;], dtype=object)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>seq__v_choice</span></div><div class='xr-var-dims'>(v_choice)</div><div class='xr-var-dtype'>object</div><div class='xr-var-preview xr-preview'>&#x27;GATACTGGAATTACCCAGACACCAAAATACC...</div><input id='attrs-7aa10157-bace-4cd8-bb98-63b51dd05e6c' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-7aa10157-bace-4cd8-bb98-63b51dd05e6c' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-4fbfa7c5-80d5-4d18-9c50-b33702d4ca9f' class='xr-var-data-in' type='checkbox'><label for='data-4fbfa7c5-80d5-4d18-9c50-b33702d4ca9f' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([&#x27;GATACTGGAATTACCCAGACACCAAAATACCTGGTCACAGCAATGGGGAGTAAAAGGACAATGAAACGTGAGCATCTGGGACATGATTCTATGTATTGGTACAGACAGAAAGCTAAGAAATCCCTGGAGTTCATGTTTTACTACAACTGTAAGGAATTCATTGAAAACAAGACTGTGCCAAATCACTTCACACCTGAATGCCCTGACAGCTCTCGCTTATACCTTCATGTGGTCGCACTGCAGCAAGAAGACTCAGCTGCGTATCTCTGCACCAGCAGCCAAGA&#x27;,\n",
       "       &#x27;GATGCTGAAATCACCCAGAGCCCAAGACACAAGATCACAGAGACAGGAAGGCAGGTGACCTTGGCGTGTCACCAGACTTGGAACCACAACAATATGTTCTGGTATCGACAAGACCTGGGACATGGGCTGAGGCTGATCCATTACTCATATGGTGTTCAAGACACTAACAAAGGAGAAGTCTCAGATGGCTACAGTGTCTCTAGATCAAACACAGAGGACCTCCCCCTCACTCTGGAGTCTGCTGCCTCCTCCCAGACATCTGTATATTTCTGCGCCAGCAGTGAGTC&#x27;,\n",
       "       &#x27;GATGCTGAAATCACCCAGAGCCCAAGACACAAGATCACAGAGACAGGAAGGCAGGTGACCTTGGCGTGTCACCAGACTTGGAACCACAACAATATGTTCTGGTATCGACAAGACCTGGGACATGGGCTGAGGCTGATCCATTACTCATATGGTGTTCACGACACTAACAAAGGAGAAGTCTCAGATGGCTACAGTGTCTCTAGATCAAACACAGAGGACCTCCCCCTCACTCTGGAGTCTGCTGCCTCCTCCCAGACATCTGTATATTTCTGCGCCAGCAGTGAGTC&#x27;,\n",
       "       &#x27;GATGCTGAAATCACCCAGAGCCCAAGACACAAGATCACAGAGACAGGAAGGCAGGTGACCTTGGCGTGTCACCAGACTTGGAACCACAACAATATGTTCTGGTATCGACAAGACCTGGGACATGGGCTGAGGCTGATCCATTACTCATATGGTGTTCACGACACTAACAAAGGAGAAGTCTCAGATGGCTACAGTGTCTCTAGATCAAACACAGAGGACCTCCCCCTCACTCTGTAGTCTGCTGCCTCCTCCCAGACATCTGTATATTTCTGCGCCAGCAGTGAGTC&#x27;,\n",
       "       &#x27;GATGCTGGAATCACCCAGAGCCCAAGATACAAGATCACAGAGACAGGAAGGCAGGTGACCTTGATGTGTCACCAGACTTGGAGCCACAGCTATATGTTCTGGTATCGACAAGACCTGGGACATGGGCTGAGGCTGATCTATTACTCAGCAGCTGCTGATATTACAGATAAAGGAGAAGTCCCCGATGGCTATGTTGTCTCCAGATCCAAGACAGAGAATTTCCCCCTCACTCTGGAGTCAGCTACCCGCTCCCAGACATCTGTGTATTTCTGCGCCAGCAGTGAGTC&#x27;,\n",
       "       &#x27;GATGCTGGAATCACCCAGAGCCCAAGACACAAGGTCACAGAGACAGGAACACCAGTGACTCTGAGATGTCACCAGACTGAGAACCACCGCTATATGTACTGGTATCGACAAGACCCGGGGCATGGGCTGAGGCTGATCCATTACTCATATGGTGTTAAAGATACTGACAAAGGAGAAGTCTCAGATGGCTATAGTGTCTCTAGATCAAAGACAGAGGATTTCCTCCTCACTCTGGAGTCCGCTACCAGCTCCCAGACATCTGTGTACTTCTGTGCCATCAGTGAGTC&#x27;,\n",
       "       &#x27;GCTGGAATCACCCAGAGCCCAAGACACAAGGTCACAGAGACAGGAACACCAGTGACTCTGAGATGTCATCAGACTGAGAACCACCGCTATATGTACTGGTATCGACAAGACCCGGGGCATGGGCTGAGGCTGATCCATTACTCATATGGTGTTAAAGATACTGACAAAGGAGAAGTCTCAGATGGCTATAGTGTCTCTAGATCAAAGACAGAGGATTTCCTCCTCACTCTGGAGTCCGCTACCAGCTCCCAGACATCTGTGTACTTCTGTGCCATCAGTGAGTC&#x27;,\n",
       "       &#x27;GAAGCTGAAGTTGCCCAGTCCCCCAGATATAAGATTACAGAGAAAAGCCAGGCTGTGGCTTTTTGGTGTGATCCTATTTCTGGCCATGCTACCCTTTACTGGTACCGGCAGATCCTGGGACAGGGCCCGGAGCTTCTGGTTCAATTTCAGGATGAGAGTGTAGTAGATGATTCACAGTTGCCTAAGGATCGATTTTCTGCAGAGAGGCTCAAAGGAGTAGACTCCACTCTCAAGATCCAGCCTGCAGAGCTTGGGGACTCGGCCATGTATCTCTGTGCCAGCAGCTTAGC&#x27;,\n",
       "       &#x27;GAAGCTGGAGTTGCCCAGTCTCCCAGATATAAGATTATAGAGAAAAGGCAGAGTGTGGCTTTTTGGTGCAATCCTATATCTGGCCATGCTACCCTTTACTGGTACCAGCAGATCCTGGGACAGGGCCCAAAGCTTCTGATTCAGTTTCAGAATAACGGTGTAGTGGATGATTCACAGTTGCCTAAGGATCGATTTTCTGCAGAGAGGCTCAAAGGAGTAGACTCCACTCTCAAGATCCAGCCTGCAAAGCTTGAGGACTCGGCCGTGTATCTCTGTGCCAGCAGCTTAGA&#x27;,\n",
       "       &#x27;GAAGCTGGAGTTGCCCAGTCTCCCAGATATAAGATTATAGAGAAAAGGCAGAGTGTGGCTTTTTGGTGCAATCCTATATCTGGCCATGCTACCCTTTACTGGTACCAGCAGATCCTGGGACAGGGCCCAAAGCTTCTGATTCAGTTTCAGAATAACGGTGTAGTGGATGATTCACAGTTGCCTAAGGATCGATTTTCTGCAGAGAGGCTCAAAGGAGTAGACTCCACTCTCAAGATCCAGCCTGCAAAGCTTGAGAACTCGGCCGTGTATCTCTGTGCCAGCAGCTTAGA&#x27;,\n",
       "       &#x27;GAAGCTGGAGTTGCCCAGTCTCCCAGATATAAGATTATAGAGAAAAGGCAGAGTGTGGCTTTTTGGTGCAATCCTATATCTGGCCATGCTACCCTTTACTGGTACCAGCAGATCCTGGGACAGGGCCCAAAGCTTCTGATTCAGTTTCAGAATAACGGTGTAGTGGATGATTCACAGTTGCCTAAGGATCGATTTTCTGCAGAGAGGCTCAAAGGAGTAGACTCCACTCTCAAGATCCAACCTGCAAAGCTTGAGGACTCGGCCGTGTATCTCTGTGCCAGCAGCTTAGA&#x27;,\n",
       "       &#x27;GAAGCTGGAGTGGTTCAGTCTCCCAGATATAAGATTATAGAGAAAAAACAGCCTGTGGCTTTTTGGTGCAATCCTATTTCTGGCCACAATACCCTTTACTGGTACCTGCAGAACTTGGGACAGGGCCCGGAGCTTCTGATTCGATATGAGAATGAGGAAGCAGTAGACGATTCACAGTTGCCTAAGGATCGATTTTCTGCAGAGAGGCTCAAAGGAGTAGACTCCACTCTCAAGATCCAGCCTGCAGAGCTTGGGGACTCGGCCGTGTATCTCTGTGCCAGCAGCTTAGA&#x27;,\n",
       "       &#x27;GCTGGTGTTATCCAGTCACCCAGGCACAAAGTGACAGAGATGGGACAATCAGTAACTCTGAGATGCGAACCAATTTCAGGCCACAATGATCTTCTCTGGTACAGACAGACCTTTGTGCAGGGACTGGAATTGCTGAATTACTTCTGCAGCTGGACCCTCGTAGATGACTCAGGAGTGTCCAAGGATTGATTCTCAGCACAGATGCCTGATGTATCATTCTCCACTCTGAGGATCCAGCCCATGGAACCCAGGGACTTGGGCCTATATTTCTGTGCCAGCAGCTTTGC&#x27;,\n",
       "       &#x27;GCTGGCATTATCCAGTCACCCAAGCATGAGGTGACAGAAATGGGACAAACAGTGACTCTGAGATGTGAGCCAATTTTTGGCCACAATTTCCTTTTCTGGTACAGAGATACCTTCGTGCAGGGACTGGAATTGCTGAGTTACTTCCGGAGCTGATCTATTATAGATAATGCAGGTATGCCCACAGAGCGATTCTCAGCTGAGAGGCCTGATGGATCATTCTCTACTCTGAAGATCCAGCCTGCAGAGCAGGGGGACTCGGCCGTGTATGTCTGTGCAAGTCGCTTAGC&#x27;,\n",
       "       &#x27;GATGCTGGAGTTATCCAGTCACCCCGCCATGAGGTGACAGAGATGGGACAAGAAGTGACTCTGAGATGTAAACCAATTTCAGGCCACAACTCCCTTTTCTGGTACAGACAGACCATGATGCGGGGACTGGAGTTGCTCATTTACTTTAACAACAACGTTCCGATAGATGATTCAGGGATGCCCGAGGATCGATTCTCAGCTAAGATGCCTAATGCATCATTCTCCACTCTGAAGATCCAGCCCTCAGAACCCAGGGACTCAGCTGTGTACTTCTGTGCCAGCAGTTTAGC&#x27;,\n",
       "       &#x27;GATGCTGGAGTTATCCAGTCACCCCGGCACGAGGTGACAGAGATGGGACAAGAAGTGACTCTGAGATGTAAACCAATTTCAGGACACGACTACCTTTTCTGGTACAGACAGACCATGATGCGGGGACTGGAGTTGCTCATTTACTTTAACAACAACGTTCCGATAGATGATTCAGGGATGCCCGAGGATCGATTCTCAGCTAAGATGCCTAATGCATCATTCTCCACTCTGAAGATCCAGCCCTCAGAACCCAGGGACTCAGCTGTGTACTTCTGTGCCAGCAGTTTAGC&#x27;,\n",
       "       &#x27;GATGCTGGAGTTATCCAGTCACCCCGGCACGAGGTGACAGAGATGGGACAAGAAGTGACTCTGAGATGTAAACCAATTTCAGGACATGACTACCTTTTCTGGTACAGACAGACCATGATGCGGGGACTGGAGTTGCTCATTTACTTTAACAACAACGTTCCGATAGATGATTCAGGGATGCCCGAGGATCGATTCTCAGCTAAGATGCCTAATGCATCATTCTCCACTCTGAGGATCCAGCCCTCAGAACCCAGGGACTCAGCTGTGTACTTCTGTGCCAGCAGTTTAGC&#x27;,\n",
       "       &#x27;GATGCTAGAGTCACCCAGACACCAAGGCACAAGGTGACAGAGATGGGACAAGAAGTAACAATGAGATGTCAGCCAATTTTAGGCCACAATACTGTTTTCTGGTACAGACAGACCATGATGCAAGGACTGGAGTTGCTGGCTTACTTCCGCAACCGGGCTCCTCTAGATGATTCGGGGATGCCGAAGGATCGATTCTCAGCAGAGATGCCTGATGCAACTTTAGCCACTCTGAAGATCCAGCCCTCAGAACCCAGGGACTCAGCTGTGTATTTTTGTGCTAGTGGTTTGGT&#x27;,\n",
       "       &#x27;GCTGCTGGAGTCATCCAGTCCCCAAGACATCTGATCAAAGAAAAGAGGGAAACAGCCACTCTGAAATGCTATCCTATCCCTAGACACGACACTGTCTACTGGTACCAGCAGGGTCCAGGTCAGGACCCCCAGTTCCTCATTTCGTTTTATGAAAAGATGCAGAGCGATAAAGGAAGCATCCCTGATCGATTCTCAGCTCAACAGTTCAGTGACTATCATTCTGAACTGAACATGAGCTCCTTGGAGCTGGGGGACTCAGCCCTGTACTTCTGTGCCAGCAGCTTAGG&#x27;,\n",
       "       &#x27;GAAGCTGGAGTTACTCAGTTCCCCAGCCACAGCGTAATAGAGAAGGGCCAGACTGTGACTCTGAGATGTGACCCAATTTCTGGACATGATAATCTTTATTGGTATCGACGTGTTATGGGAAAAGAAATAAAATTTCTGTTACATTTTGTGAAAGAGTCTAAACAGGATGAGTCCGGTATGCCCAACAATCGATTCTTAGCTGAAAGGACTGGAGGGACGTATTCTACTCTGAAGGTGCAGCCTGCAGAACTGGAGGATTCTGGAGTTTATTTCTGTGCCAGCAGCCAAGA&#x27;,\n",
       "...\n",
       "       &#x27;GGAGCTGGAGTCTCCCAGTCCCCCAGTAACAAGGTCACAGAGAAGGGAAAGGATGTAGAGCTCAGGTGTGATCCAATTTCAGGTCATACTGCCCTTTACTGGTACCGACAGAGGCTGGGGCAGGGCCTGGAGTTTTTAATTTACTTCCAAGGCAACAGTGCACCAGACAAATCAGGGCTGCCCAGTGATCGCTTCTCTGCAGAGAGGACTGGGGAATCCGTCTCCACTCTGACGATCCAGCGCACACAGCAGGAGGACTCGGCCGTGTATCTCTGTGCCAGCAGCTTAGC&#x27;,\n",
       "       &#x27;GCTGGAGTCTCCCAGTCCCCCAGTAACAAGGTCACAGAGAAGGGAAAGGATGTAGAGCTCAGGTGTGATCCAATTTCAGGTCATACTGCCCTTTACTGGTACCGACAGAGGCTGGGGCAGGGCCTGGAGTTTTTAATTTACTTCCAAGGCAACAGTGCACCAGACAAATCAGGGCTGCCCAGTGATCGCTTCTCTGCAGAGAGGACTGGGGAATCCGTCTCCACTCTGACGATCCAGCGCACACAGCAGGAGGACTCGGCCGTGTATCTCTGTACCAGCAGCTTAGC&#x27;,\n",
       "       &#x27;GGAGCTGGAGTCTCCCAGTCCCCCAGTAACAAGGTCACAGAGAAGGGAAAGGATGTAGAGCTCAGGTGTGATCCAATTTCAGGTCATACTGCCCTTTACTGGTACCGACAGAGGCTGGGGCAGGGCCTGGAGTTTTTAATTTACTTCCAAGGCAACAGTGCACCAGACAAATCAGGGCTGCCCAGTGATCGCTTCTCTGCAGAGAGGACTGGGGAATCCGTCTCCACTCTGACGATCCAGCGCACATAGCAGGAGGACTCGGCCGTGTATCTCTGTGCCAGCAGCTTAGC&#x27;,\n",
       "       &#x27;GGTGCTGGAGTCTCCCAGACCCCCAGTAACAAGGTCACAGAGAAGGGAAAATATGTAGAGCTCAGGTGTGATCCAATTTCAGGTCATACTGCCCTTTACTGGTACCGACAAAGCCTGGGGCAGGGCCCAGAGTTTCTAATTTACTTCCAAGGCACGGGTGCGGCAGATGACTCAGGGCTGCCCAACGATCGGTTCTTTGCAGTCAGGCCTGAGGGATCCGTCTCTACTCTGAAGATCCAGCGCACAGAGCGGGGGGACTCAGCCGTGTATCTCTGTGCCAGCAGCTTAAC&#x27;,\n",
       "       &#x27;GGTGCTGGAGTCTCCCAGACCCCCAGTAACAAGGTCACAGAGAAGGGAAAAGATGTAGAGCTCAGGTGTGATCCAATTTCAGGTCATACTGCCCTTTACTGGTACCGACAAAGCCTGGGGCAGGGCCCAGAGTTTCTAATTTACTTCCAAGGCACGGGTGCGGCAGATGACTCAGGGCTGCCCAAAGATCGGTTCTTTGCAGTCAGGCCTGAGGGATCCGTCTCTACTCTGAAGATCCAGCGCACAGAGCAGGGGGACTCAGCCGTGTATCTCCGTGCCAGCAGCTTAAC&#x27;,\n",
       "       &#x27;GGTGCTGGAGTCTCCCAGACCCCCAGTAACAAGGTCACAGAGAAGGGAAAAGATGTAGAGCTCAGGTGTGATCCAATTTCAGGTCATACTGCCCTTTACTGGTACCGACAAAGCCTGGGGCAGGGCCCAGAGTTTCTAATTTACTTCCAAGGCACGGGTGCGGCAGATGACTCAGGGCTGCCCAAAGATCGGTTCTTTGCAGTCAGGCCTGAGGGATCCGTCTCTACTCTGAAGATCCAGCGCACAGAGCAGGGGGACTCAGCCGCGTATCTCCGTGCCAGCAGCTTAAC&#x27;,\n",
       "       &#x27;GGTGCTGGAGTCTCCCAGACCCCCAGTAACAAGGTCACAGAGAAGGGAAAATATGTAGAGCTCAGGTGTGATCCAATTTCAGGTCATACTGCCCTTTACTGGTACCGACAAAGCCTGGGGCAGGGCCCAGAGTTTCTAATTTACTTCCAAGGCACGGGTGCGGCAGATGACTCAGGGCTGCCCAACGATCGGTTCTTTGCAGTCAGGCCTGAGGGATCCGTCTCTACTCTGAAGATCCAGCGCACAGAGCGGGGGGACTCTGCCGTGTATCTCTGTGCCAGCAGCTTAAC&#x27;,\n",
       "       &#x27;GGTGCTGGAGTCTCCCAGTCCCCAAGGTACAAAGTCGCAAAGAGGGGACGGGATGTAGCTCTCAGGTGTGATTCAATTTCGGGTCATGTAACCCTTTATTGGTACCGACAGACCCTGGGGCAGGGCTCAGAGGTTCTGACTTACTCCCAGAGTGATGCTCAACGAGACAAATCAGGGCGGCCCAGTGGTCGGTTCTCTGCAGAGAGGCCTGAGAGATCCGTCTCCACTCTGAAGATCCAGCGCACAGAGCAGGGGGACTCAGCTGTGTATCTCTGTGCCAGCAGCTTAGC&#x27;,\n",
       "       &#x27;GGTGCTGGAGTCTCCCAGTCTCCCAGGTACAAAGTCACAAAGAGGGGACAGGATGTAGCTCTCAGGTGTGATCCAATTTCGGGTCATGTATCCCTTTATTGGTACCGACAGGCCCTGGGGCAGGGCCCAGAGTTTCTGACTTACTTCAATTATGAAGCCCAACAAGACAAATCAGGGCTGCCCAATGATCGGTTCTCTGCAGAGAGGCCTGAGGGATCCATCTCCACTCTGACGATCCAGCGCACAGAGCAGCGGGACTCGGCCATGTATCGCTGTGCCAGCAGCTTAGC&#x27;,\n",
       "       &#x27;GGTGCTGGAGTCTCCCAGTCTCCCAGGTACAAAGTCACAAAGAGGGGACAGGATGTAACTCTCAGGTGTGATCCAATTTCGAGTCATGCAACCCTTTATTGGTATCAACAGGCCCTGGGGCAGGGCCCAGAGTTTCTGACTTACTTCAATTATGAAGCTCAACCAGACAAATCAGGGCTGCCCAGTGATCGGTTCTCTGCAGAGAGGCCTGAGGGATCCATCTCCACTCTGACGATTCAGCGCACAGAGCAGCGGGACTCAGCCATGTATCGCTGTGCCAGCAGCTTAGC&#x27;,\n",
       "       &#x27;GGTGCTGGAGTCTCCCAGTCTCCCAGGTACAAAGTCACAAAGAGGGGACAGGATGTAACTCTCAGGTGTGATCCAATTTCGAGTCATGCAACCCTTTATTGGTATCAACAGGCCCTGGGGCAGGGCCCAGAGTTTCTGACTTACTTCAATTATGAAGCTCAACCAGACAAATCAGGGCTGCCCAGTGATCGGTTCTCTGCAGAGAGGCCTGAGGGATCCATCTCCACTCTGACGATTCAGCGCACAGAGCAGCGGGACTCAGCCATGTATCGCTGTGCTAGCAGCTTAGC&#x27;,\n",
       "       &#x27;GGTGCTGGAGTCTCCCAGTCCCCTAGGTACAAAGTCGCAAAGAGAGGACAGGATGTAGCTCTCAGGTGTGATCCAATTTCGGGTCATGTATCCCTTTTTTGGTACCAACAGGCCCTGGGGCAGGGGCCAGAGTTTCTGACTTATTTCCAGAATGAAGCTCAACTAGACAAATCGGGGCTGCCCAGTGATCGCTTCTTTGCAGAAAGGCCTGAGGGATCCGTCTCCACTCTGAAGATCCAGCGCACACAGCAGGAGGACTCCGCCGTGTATCTCTGTGCCAGCAGCTTAGC&#x27;,\n",
       "       &#x27;GGTGCTGGAGTCTCCCAGTCCCCTAGGTACAAAGTCGCAAAGAGAGGACAGGATGTAGCTCTCAGGTGTGATCCAATTTCGGGTCATGTATCCCTTTTTTGGTACCAACAGGCCCTGGGGCAGGGGCCAGAGTTTCTGACTTATTTCCAGAATGAAGCTCAACTAGACAAATCGGGGCTGCCCAGTGATCGCTTCTTTGCAGAAAGGCCTGAGGGATCCGTCTCCACTCTGAAGATCCAGCGCACACAGAAGGAGGACTCCGCCGTGTATCTCTGTGCCAGCAGCTTAGC&#x27;,\n",
       "       &#x27;GATACTGGAGTCTCCCAGAACCCCAGACACAAGATCACAAAGAGGGGACAGAATGTAACTTTCAGGTGTGATCCAATTTCTGAACACAACCGCCTTTATTGGTACCGACAGACCCTGGGGCAGGGCCCAGAGTTTCTGACTTACTTCCAGAATGAAGCTCAACTAGAAAAATCAAGGCTGCTCAGTGATCGGTTCTCTGCAGAGAGGCCTAAGGGATCTTTCTCCACCTTGGAGATCCAGCGCACAGAGCAGGGGGACTCGGCCATGTATCTCTGTGCCAGCAGCTTAGC&#x27;,\n",
       "       &#x27;ATATCTGGAGTCTCCCACAACCCCAGACACAAGATCACAAAGAGGGGACAGAATGTAACTTTCAGGTGTGATCCAATTTCTGAACACAACCGCCTTTATTGGTACCGACAGAACCCTGGGCAGGGCCCAGAGTTTCTGACTTACTTCCAGAATGAAGCTCAACTGGAAAAATCAGGGCTGCTCAGTGATCGGATCTCTGCAGAGAGGCCTAAGGGATCTTTCTCCACCTTGGAGATCCAGCGCACAGAGCAGGGGGACTCGGCCATGTATCTCTGTGCCAGCAGCTTAGC&#x27;,\n",
       "       &#x27;GATACTGGAGTCTCCCAGAACCCCAGACACAAGATCACAAAGAGGGGACAGAATGTAACTTTCAGGTGTGATCCAATTTCTGAACACAACCGCCTTTATTGGTACCGACAGACCCTGGGGCAGGGCCCAGAGTTTCTGACTTACTTCCAGAATGAAGCTCAACTAGAAAAATCAAGGCTGCTCAGTGATCGGTTCTCTGCAGAGAGGCCTAAGGGATCTCTCTCCACCTTGGAGATCCAGCGCACAGAGCAGGGGGACTCGGCCATGTATCTCTGTGCCAGCAGCTTAGC&#x27;,\n",
       "       &#x27;GATACTGGAGTCTCCCAGAACCCCAGACACAAGATCACAAAGAGGGGACAGAATGTAACTTTCAGGTGTGATCCAATTTCTGAACACAACCGCCTTTATTGGTACCGACAGACCCTGGGGCAGGGCCCAGAGTTTCTGACTTACTTCCAGAATGAAGCTCAACTAGAAAAATCAAGGCTGCTCAGTGATCGGTTCTCTGCAGAGAGGCCTAAGGGATCTCTTTCCACCTTGGAGATCCAGCGCACAGAGCAGGGGGACTCGGCCATGTATCTCTGTGCCAGCAGCTTAGC&#x27;,\n",
       "       &#x27;CACAACCGCCTTTATTGGTACCGACAGACCCTGGGGCAGGGCCCAGAGTTTCTGACTTACTTCCAGAATGAAGCTCAACTAGAAAAATCAAGGCTGCTCAGTGATCGGTTCTCTGCAGAGAGGCCTAAGGGATCTTTCTCCACCTTGGAGATCCAGCGCACAGAGGAGGGGGACTCGGCCATGTATCTCTGTGCCAGCAGCTTAGC&#x27;,\n",
       "       &#x27;GATTCTGGAGTCACACAAACCCCAAAGCACCTGATCACAGCAACTGGACAGCGAGTGACGCTGAGATGCTCCCCTAGGTCTGGAGACCTCTCTGTGTACTGGTACCAACAGAGCCTGGACCAGGGCCTCCAGTTCCTCATTCAGTATTATAATGGAGAAGAGAGAGCAAAAGGAAACATTCTTGAACGATTCTCCGCACAACAGTTCCCTGACTTGCACTCTGAACTAAACCTGAGCTCTCTGGAGCTGGGGGACTCAGCTTTGTATTTCTGTGCCAGCAGCGTAG&#x27;],\n",
       "      dtype=object)</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-37c09478-d2b9-4114-a983-682f5fe30f04' class='xr-section-summary-in' type='checkbox'  checked><label for='section-37c09478-d2b9-4114-a983-682f5fe30f04' class='xr-section-summary' >Attributes: <span>(7)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><dl class='xr-attrs'><dt><span>nickname :</span></dt><dd>v_choice</dd><dt><span>event_type :</span></dt><dd>GeneChoice</dd><dt><span>seq_type :</span></dt><dd>V_gene</dd><dt><span>seq_side :</span></dt><dd>Undefined_side</dd><dt><span>priority :</span></dt><dd>7</dd><dt><span>parents :</span></dt><dd>[]</dd><dt><span>childs :</span></dt><dd>[&#x27;v_3_del&#x27;, &#x27;d_gene&#x27;, &#x27;j_choice&#x27;]</dd></dl></div></li></ul></div></div>"
      ],
      "text/plain": [
       "<xarray.DataArray (v_choice: 89)>\n",
       "array([4.88741e-03, 9.32369e-03, 9.32259e-03, 1.30320e-02, 3.43430e-04,\n",
       "       8.50694e-03, 7.71250e-03, 6.12276e-04, 5.06104e-03, 4.59289e-05,\n",
       "       4.48245e-03, 8.16181e-03, 7.00053e-04, 7.77164e-03, 1.16174e-02,\n",
       "       1.16158e-02, 1.13872e-02, 1.06555e-02, 2.36870e-03, 2.28368e-02,\n",
       "       1.56715e-04, 4.58447e-03, 0.00000e+00, 4.88782e-05, 0.00000e+00,\n",
       "       1.54500e-02, 2.74050e-02, 5.18979e-03, 4.80289e-03, 1.62765e-01,\n",
       "       6.61229e-02, 2.07174e-02, 7.36226e-04, 2.47846e-37, 1.07472e-02,\n",
       "       2.03820e-02, 9.53245e-03, 9.53006e-03, 2.35607e-03, 2.39208e-03,\n",
       "       2.39208e-03, 2.45219e-03, 1.66904e-02, 2.98807e-03, 2.98804e-03,\n",
       "       1.59156e-02, 1.25468e-02, 9.06711e-03, 9.06936e-03, 9.76534e-02,\n",
       "       9.57746e-03, 9.17011e-03, 1.14472e-02, 1.14458e-02, 9.77554e-03,\n",
       "       1.89924e-02, 3.97949e-04, 1.70242e-03, 8.91336e-03, 6.73926e-03,\n",
       "       6.69167e-03, 2.94257e-02, 1.38534e-02, 4.19227e-03, 4.19275e-03,\n",
       "       2.48630e-03, 4.83399e-04, 1.29795e-07, 6.49975e-05, 1.94736e-02,\n",
       "       1.94728e-02, 0.00000e+00, 3.91595e-03, 3.96230e-02, 0.00000e+00,\n",
       "       0.00000e+00, 6.73805e-05, 2.90073e-02, 9.28490e-03, 5.32118e-03,\n",
       "       8.18432e-03, 1.07035e-03, 3.64764e-04, 3.26790e-03, 3.26801e-03,\n",
       "       3.26801e-03, 3.26809e-03, 8.23600e-04, 1.56399e-02])\n",
       "Coordinates:\n",
       "  * v_choice       (v_choice) int64 0 1 2 3 4 5 6 7 ... 81 82 83 84 85 86 87 88\n",
       "    lbl__v_choice  (v_choice) object 'TRBV1*01' 'TRBV10-1*01' ... 'TRBV9*01'\n",
       "    seq__v_choice  (v_choice) object 'GATACTGGAATTACCCAGACACCAAAATACCTGGTCACA...\n",
       "Attributes:\n",
       "    nickname:    v_choice\n",
       "    event_type:  GeneChoice\n",
       "    seq_type:    V_gene\n",
       "    seq_side:    Undefined_side\n",
       "    priority:    7\n",
       "    parents:     []\n",
       "    childs:      ['v_3_del', 'd_gene', 'j_choice']"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mdl_hb['v_choice']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'error_type': 'SingleErrorRate', 'error_values': '0.000396072'}"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mdl_hb.ErrorRate_dict"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## New models"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Pygor has a methods to create default VDJ and VJ models from a dataframes."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [],
   "source": [
    "new_V_gene_dict = {\n",
    "    'name':'my_pseudo_TRBV',\n",
    "    'value':'AAACCCTTTGGGACCCAGAGCCCAAGACACAAGATCACAGAGACAGGAAGGCAGGTGACCTTGGCGTGTCACCAGACTTGGAACCACAACAATATGTTCTGGTATCGACAAGACCTGGGACATGGGCTGAGGCTGATCCATTACTCATATGGTGTTCACGACACTAACAAAGGAGAAGTCTCAGATGGCTACAGTGTCTCTAGATCAAACACAGAGGACCTCCCCCTCACTCTGTAGTCTGCTGCCTCCTCCCAGACATCTGTATATTTCTGCGCCAGCAGTGAGTC',\n",
    "    'anchor_index': 270\n",
    "}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "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>name</th>\n",
       "      <th>value</th>\n",
       "      <th>anchor_index</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>id</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>TRBV11-2*03</td>\n",
       "      <td>GAAGCTGGAGTTGCCCAGTCTCCCAGATATAAGATTATAGAGAAAA...</td>\n",
       "      <td>273.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>TRBV11-3*01</td>\n",
       "      <td>GAAGCTGGAGTGGTTCAGTCTCCCAGATATAAGATTATAGAGAAAA...</td>\n",
       "      <td>273.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>TRBV12-1*01</td>\n",
       "      <td>GCTGGTGTTATCCAGTCACCCAGGCACAAAGTGACAGAGATGGGAC...</td>\n",
       "      <td>270.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>TRBV12-2*01</td>\n",
       "      <td>GCTGGCATTATCCAGTCACCCAAGCATGAGGTGACAGAAATGGGAC...</td>\n",
       "      <td>270.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>TRBV12-3*01</td>\n",
       "      <td>GATGCTGGAGTTATCCAGTCACCCCGCCATGAGGTGACAGAGATGG...</td>\n",
       "      <td>273.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>TRBV12-4*01</td>\n",
       "      <td>GATGCTGGAGTTATCCAGTCACCCCGGCACGAGGTGACAGAGATGG...</td>\n",
       "      <td>273.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>my_pseudo_TRBV</td>\n",
       "      <td>AAACCCTTTGGGACCCAGAGCCCAAGACACAAGATCACAGAGACAG...</td>\n",
       "      <td>270.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "              name                                              value  \\\n",
       "id                                                                      \n",
       "0      TRBV11-2*03  GAAGCTGGAGTTGCCCAGTCTCCCAGATATAAGATTATAGAGAAAA...   \n",
       "1      TRBV11-3*01  GAAGCTGGAGTGGTTCAGTCTCCCAGATATAAGATTATAGAGAAAA...   \n",
       "2      TRBV12-1*01  GCTGGTGTTATCCAGTCACCCAGGCACAAAGTGACAGAGATGGGAC...   \n",
       "3      TRBV12-2*01  GCTGGCATTATCCAGTCACCCAAGCATGAGGTGACAGAAATGGGAC...   \n",
       "4      TRBV12-3*01  GATGCTGGAGTTATCCAGTCACCCCGCCATGAGGTGACAGAGATGG...   \n",
       "5      TRBV12-4*01  GATGCTGGAGTTATCCAGTCACCCCGGCACGAGGTGACAGAGATGG...   \n",
       "6   my_pseudo_TRBV  AAACCCTTTGGGACCCAGAGCCCAAGACACAAGATCACAGAGACAG...   \n",
       "\n",
       "    anchor_index  \n",
       "id                \n",
       "0          273.0  \n",
       "1          273.0  \n",
       "2          270.0  \n",
       "3          270.0  \n",
       "4          273.0  \n",
       "5          273.0  \n",
       "6          270.0  "
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_V = genomic_dict['V'].loc[10:15]\n",
    "df_V = df_V.append(new_V_gene_dict, ignore_index=True)\n",
    "df_V.index.name='id'\n",
    "df_V"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now we can use this new genomic templates to create a new model"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<pygor3.IgorIO.IgorModel at 0x7fac17fdd490>"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "new_mdl_0 = p3.IgorModel.make_default_VDJ(df_V, genomic_dict['D'], genomic_dict['J'])\n",
    "new_mdl_0"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(<Figure size 1296x1080 with 1 Axes>,\n",
       " <AxesSubplot:title={'center':'$P($v_choice$)$'}>)"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "[encoded data, 21416 characters]\n",
      "text/plain": [
       "<Figure size 1296x1080 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "new_mdl_0.plot_Event('v_choice')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "By default the new model will initiate with a uniform probability, that can be used to infer a new model from data"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Exporting a Model"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Conditional and marginal probabilities can be exported as pdf files with plots"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "fln_output_prefix = \"mdl_hb\"\n",
    "mdl_hb.export_plot_Pconditionals(fln_output_prefix+\"_CP\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [],
   "source": [
    "mdl_hb.export_plot_Pmarginals(fln_output_prefix+\"_MP\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "A model can be exported in IGoR's format with write_model method"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Writing model parms in file  new_model_parms.txt\n",
      "Writing model marginals in file  new_model_marginals.txt\n",
      "Writing gene anchor's in file  new_V_anchors.csv\n",
      "Writing gene anchor's in file  new_J_anchors.csv\n"
     ]
    }
   ],
   "source": [
    "new_mdl_0.write_model('new_model_parms.txt', 'new_model_marginals.txt',\n",
    "                      fln_V_gene_CDR3_anchors='new_V_anchors.csv', \n",
    "                      fln_J_gene_CDR3_anchors='new_J_anchors.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "@Event_list\n",
      "#GeneChoice;V_gene;Undefined_side;7;v_choice\n",
      "%TRBV11-2*03;GAAGCTGGAGTTGCCCAGTCTCCCAGATATAAGATTATAGAGAAAAGGCAGAGTGTGGCTTTTTGGTGCAATCCTATATCTGGCCATGCTACCCTTTACTGGTACCAGCAGATCCTGGGACAGGGCCCAAAGCTTCTGATTCAGTTTCAGAATAACGGTGTAGTGGATGATTCACAGTTGCCTAAGGATCGATTTTCTGCAGAGAGGCTCAAAGGAGTAGACTCCACTCTCAAGATCCAACCTGCAAAGCTTGAGGACTCGGCCGTGTATCTCTGTGCCAGCAGCTTAGA;0\n",
      "%TRBV11-3*01;GAAGCTGGAGTGGTTCAGTCTCCCAGATATAAGATTATAGAGAAAAAACAGCCTGTGGCTTTTTGGTGCAATCCTATTTCTGGCCACAATACCCTTTACTGGTACCTGCAGAACTTGGGACAGGGCCCGGAGCTTCTGATTCGATATGAGAATGAGGAAGCAGTAGACGATTCACAGTTGCCTAAGGATCGATTTTCTGCAGAGAGGCTCAAAGGAGTAGACTCCACTCTCAAGATCCAGCCTGCAGAGCTTGGGGACTCGGCCGTGTATCTCTGTGCCAGCAGCTTAGA;1\n",
      "%TRBV12-1*01;GCTGGTGTTATCCAGTCACCCAGGCACAAAGTGACAGAGATGGGACAATCAGTAACTCTGAGATGCGAACCAATTTCAGGCCACAATGATCTTCTCTGGTACAGACAGACCTTTGTGCAGGGACTGGAATTGCTGAATTACTTCTGCAGCTGGACCCTCGTAGATGACTCAGGAGTGTCCAAGGATTGATTCTCAGCACAGATGCCTGATGTATCATTCTCCACTCTGAGGATCCAGCCCATGGAACCCAGGGACTTGGGCCTATATTTCTGTGCCAGCAGCTTTGC;2\n",
      "%TRBV12-2*01;GCTGGCATTATCCAGTCACCCAAGCATGAGGTGACAGAAATGGGACAAACAGTGACTCTGAGATGTGAGCCAATTTTTGGCCACAATTTCCTTTTCTGGTACAGAGATACCTTCGTGCAGGGACTGGAATTGCTGAGTTACTTCCGGAGCTGATCTATTATAGATAATGCAGGTATGCCCACAGAGCGATTCTCAGCTGAGAGGCCTGATGGATCATTCTCTACTCTGAAGATCCAGCCTGCAGAGCAGGGGGACTCGGCCGTGTATGTCTGTGCAAGTCGCTTAGC;3\n",
      "%TRBV12-3*01;GATGCTGGAGTTATCCAGTCACCCCGCCATGAGGTGACAGAGATGGGACAAGAAGTGACTCTGAGATGTAAACCAATTTCAGGCCACAACTCCCTTTTCTGGTACAGACAGACCATGATGCGGGGACTGGAGTTGCTCATTTACTTTAACAACAACGTTCCGATAGATGATTCAGGGATGCCCGAGGATCGATTCTCAGCTAAGATGCCTAATGCATCATTCTCCACTCTGAAGATCCAGCCCTCAGAACCCAGGGACTCAGCTGTGTACTTCTGTGCCAGCAGTTTAGC;4\n",
      "%TRBV12-4*01;GATGCTGGAGTTATCCAGTCACCCCGGCACGAGGTGACAGAGATGGGACAAGAAGTGACTCTGAGATGTAAACCAATTTCAGGACACGACTACCTTTTCTGGTACAGACAGACCATGATGCGGGGACTGGAGTTGCTCATTTACTTTAACAACAACGTTCCGATAGATGATTCAGGGATGCCCGAGGATCGATTCTCAGCTAAGATGCCTAATGCATCATTCTCCACTCTGAAGATCCAGCCCTCAGAACCCAGGGACTCAGCTGTGTACTTCTGTGCCAGCAGTTTAGC;5\n",
      "%my_pseudo_TRBV;AAACCCTTTGGGACCCAGAGCCCAAGACACAAGATCACAGAGACAGGAAGGCAGGTGACCTTGGCGTGTCACCAGACTTGGAACCACAACAATATGTTCTGGTATCGACAAGACCTGGGACATGGGCTGAGGCTGATCCATTACTCATATGGTGTTCACGACACTAACAAAGGAGAAGTCTCAGATGGCTACAGTGTCTCTAGATCAAACACAGAGGACCTCCCCCTCACTCTGTAGTCTGCTGCCTCCTCCCAGACATCTGTATATTTCTGCGCCAGCAGTGAGTC;6\n",
      "#GeneChoice;J_gene;Undefined_side;7;j_choice\n"
     ]
    }
   ],
   "source": [
    "!head new_model_parms.txt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "gene;anchor_index\n",
      "TRBV11-2*03;273\n",
      "TRBV11-3*01;273\n",
      "TRBV12-1*01;270\n",
      "TRBV12-2*01;270\n",
      "TRBV12-3*01;273\n",
      "TRBV12-4*01;273\n",
      "my_pseudo_TRBV;270\n"
     ]
    }
   ],
   "source": [
    "!head new_V_anchors.csv"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Reading Parms filename from:  new_model_parms.txt\n",
      "Reading Marginals filename from:  new_model_marginals.txt\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div><svg style=\"position: absolute; width: 0; height: 0; overflow: hidden\">\n",
       "<defs>\n",
       "<symbol id=\"icon-database\" viewBox=\"0 0 32 32\">\n",
       "<path d=\"M16 0c-8.837 0-16 2.239-16 5v4c0 2.761 7.163 5 16 5s16-2.239 16-5v-4c0-2.761-7.163-5-16-5z\"></path>\n",
       "<path d=\"M16 17c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
       "<path d=\"M16 26c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
       "</symbol>\n",
       "<symbol id=\"icon-file-text2\" viewBox=\"0 0 32 32\">\n",
       "<path d=\"M28.681 7.159c-0.694-0.947-1.662-2.053-2.724-3.116s-2.169-2.030-3.116-2.724c-1.612-1.182-2.393-1.319-2.841-1.319h-15.5c-1.378 0-2.5 1.121-2.5 2.5v27c0 1.378 1.122 2.5 2.5 2.5h23c1.378 0 2.5-1.122 2.5-2.5v-19.5c0-0.448-0.137-1.23-1.319-2.841zM24.543 5.457c0.959 0.959 1.712 1.825 2.268 2.543h-4.811v-4.811c0.718 0.556 1.584 1.309 2.543 2.268zM28 29.5c0 0.271-0.229 0.5-0.5 0.5h-23c-0.271 0-0.5-0.229-0.5-0.5v-27c0-0.271 0.229-0.5 0.5-0.5 0 0 15.499-0 15.5 0v7c0 0.552 0.448 1 1 1h7v19.5z\"></path>\n",
       "<path d=\"M23 26h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
       "<path d=\"M23 22h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
       "<path d=\"M23 18h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
       "</symbol>\n",
       "</defs>\n",
       "</svg>\n",
       "<style>/* CSS stylesheet for displaying xarray objects in jupyterlab.\n",
       " *\n",
       " */\n",
       "\n",
       ":root {\n",
       "  --xr-font-color0: var(--jp-content-font-color0, rgba(0, 0, 0, 1));\n",
       "  --xr-font-color2: var(--jp-content-font-color2, rgba(0, 0, 0, 0.54));\n",
       "  --xr-font-color3: var(--jp-content-font-color3, rgba(0, 0, 0, 0.38));\n",
       "  --xr-border-color: var(--jp-border-color2, #e0e0e0);\n",
       "  --xr-disabled-color: var(--jp-layout-color3, #bdbdbd);\n",
       "  --xr-background-color: var(--jp-layout-color0, white);\n",
       "  --xr-background-color-row-even: var(--jp-layout-color1, white);\n",
       "  --xr-background-color-row-odd: var(--jp-layout-color2, #eeeeee);\n",
       "}\n",
       "\n",
       "html[theme=dark],\n",
       "body.vscode-dark {\n",
       "  --xr-font-color0: rgba(255, 255, 255, 1);\n",
       "  --xr-font-color2: rgba(255, 255, 255, 0.54);\n",
       "  --xr-font-color3: rgba(255, 255, 255, 0.38);\n",
       "  --xr-border-color: #1F1F1F;\n",
       "  --xr-disabled-color: #515151;\n",
       "  --xr-background-color: #111111;\n",
       "  --xr-background-color-row-even: #111111;\n",
       "  --xr-background-color-row-odd: #313131;\n",
       "}\n",
       "\n",
       ".xr-wrap {\n",
       "  display: block;\n",
       "  min-width: 300px;\n",
       "  max-width: 700px;\n",
       "}\n",
       "\n",
       ".xr-text-repr-fallback {\n",
       "  /* fallback to plain text repr when CSS is not injected (untrusted notebook) */\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-header {\n",
       "  padding-top: 6px;\n",
       "  padding-bottom: 6px;\n",
       "  margin-bottom: 4px;\n",
       "  border-bottom: solid 1px var(--xr-border-color);\n",
       "}\n",
       "\n",
       ".xr-header > div,\n",
       ".xr-header > ul {\n",
       "  display: inline;\n",
       "  margin-top: 0;\n",
       "  margin-bottom: 0;\n",
       "}\n",
       "\n",
       ".xr-obj-type,\n",
       ".xr-array-name {\n",
       "  margin-left: 2px;\n",
       "  margin-right: 10px;\n",
       "}\n",
       "\n",
       ".xr-obj-type {\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-sections {\n",
       "  padding-left: 0 !important;\n",
       "  display: grid;\n",
       "  grid-template-columns: 150px auto auto 1fr 20px 20px;\n",
       "}\n",
       "\n",
       ".xr-section-item {\n",
       "  display: contents;\n",
       "}\n",
       "\n",
       ".xr-section-item input {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-section-item input + label {\n",
       "  color: var(--xr-disabled-color);\n",
       "}\n",
       "\n",
       ".xr-section-item input:enabled + label {\n",
       "  cursor: pointer;\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-section-item input:enabled + label:hover {\n",
       "  color: var(--xr-font-color0);\n",
       "}\n",
       "\n",
       ".xr-section-summary {\n",
       "  grid-column: 1;\n",
       "  color: var(--xr-font-color2);\n",
       "  font-weight: 500;\n",
       "}\n",
       "\n",
       ".xr-section-summary > span {\n",
       "  display: inline-block;\n",
       "  padding-left: 0.5em;\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:disabled + label {\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-section-summary-in + label:before {\n",
       "  display: inline-block;\n",
       "  content: '►';\n",
       "  font-size: 11px;\n",
       "  width: 15px;\n",
       "  text-align: center;\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:disabled + label:before {\n",
       "  color: var(--xr-disabled-color);\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:checked + label:before {\n",
       "  content: '▼';\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:checked + label > span {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-section-summary,\n",
       ".xr-section-inline-details {\n",
       "  padding-top: 4px;\n",
       "  padding-bottom: 4px;\n",
       "}\n",
       "\n",
       ".xr-section-inline-details {\n",
       "  grid-column: 2 / -1;\n",
       "}\n",
       "\n",
       ".xr-section-details {\n",
       "  display: none;\n",
       "  grid-column: 1 / -1;\n",
       "  margin-bottom: 5px;\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:checked ~ .xr-section-details {\n",
       "  display: contents;\n",
       "}\n",
       "\n",
       ".xr-array-wrap {\n",
       "  grid-column: 1 / -1;\n",
       "  display: grid;\n",
       "  grid-template-columns: 20px auto;\n",
       "}\n",
       "\n",
       ".xr-array-wrap > label {\n",
       "  grid-column: 1;\n",
       "  vertical-align: top;\n",
       "}\n",
       "\n",
       ".xr-preview {\n",
       "  color: var(--xr-font-color3);\n",
       "}\n",
       "\n",
       ".xr-array-preview,\n",
       ".xr-array-data {\n",
       "  padding: 0 5px !important;\n",
       "  grid-column: 2;\n",
       "}\n",
       "\n",
       ".xr-array-data,\n",
       ".xr-array-in:checked ~ .xr-array-preview {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-array-in:checked ~ .xr-array-data,\n",
       ".xr-array-preview {\n",
       "  display: inline-block;\n",
       "}\n",
       "\n",
       ".xr-dim-list {\n",
       "  display: inline-block !important;\n",
       "  list-style: none;\n",
       "  padding: 0 !important;\n",
       "  margin: 0;\n",
       "}\n",
       "\n",
       ".xr-dim-list li {\n",
       "  display: inline-block;\n",
       "  padding: 0;\n",
       "  margin: 0;\n",
       "}\n",
       "\n",
       ".xr-dim-list:before {\n",
       "  content: '(';\n",
       "}\n",
       "\n",
       ".xr-dim-list:after {\n",
       "  content: ')';\n",
       "}\n",
       "\n",
       ".xr-dim-list li:not(:last-child):after {\n",
       "  content: ',';\n",
       "  padding-right: 5px;\n",
       "}\n",
       "\n",
       ".xr-has-index {\n",
       "  font-weight: bold;\n",
       "}\n",
       "\n",
       ".xr-var-list,\n",
       ".xr-var-item {\n",
       "  display: contents;\n",
       "}\n",
       "\n",
       ".xr-var-item > div,\n",
       ".xr-var-item label,\n",
       ".xr-var-item > .xr-var-name span {\n",
       "  background-color: var(--xr-background-color-row-even);\n",
       "  margin-bottom: 0;\n",
       "}\n",
       "\n",
       ".xr-var-item > .xr-var-name:hover span {\n",
       "  padding-right: 5px;\n",
       "}\n",
       "\n",
       ".xr-var-list > li:nth-child(odd) > div,\n",
       ".xr-var-list > li:nth-child(odd) > label,\n",
       ".xr-var-list > li:nth-child(odd) > .xr-var-name span {\n",
       "  background-color: var(--xr-background-color-row-odd);\n",
       "}\n",
       "\n",
       ".xr-var-name {\n",
       "  grid-column: 1;\n",
       "}\n",
       "\n",
       ".xr-var-dims {\n",
       "  grid-column: 2;\n",
       "}\n",
       "\n",
       ".xr-var-dtype {\n",
       "  grid-column: 3;\n",
       "  text-align: right;\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-var-preview {\n",
       "  grid-column: 4;\n",
       "}\n",
       "\n",
       ".xr-var-name,\n",
       ".xr-var-dims,\n",
       ".xr-var-dtype,\n",
       ".xr-preview,\n",
       ".xr-attrs dt {\n",
       "  white-space: nowrap;\n",
       "  overflow: hidden;\n",
       "  text-overflow: ellipsis;\n",
       "  padding-right: 10px;\n",
       "}\n",
       "\n",
       ".xr-var-name:hover,\n",
       ".xr-var-dims:hover,\n",
       ".xr-var-dtype:hover,\n",
       ".xr-attrs dt:hover {\n",
       "  overflow: visible;\n",
       "  width: auto;\n",
       "  z-index: 1;\n",
       "}\n",
       "\n",
       ".xr-var-attrs,\n",
       ".xr-var-data {\n",
       "  display: none;\n",
       "  background-color: var(--xr-background-color) !important;\n",
       "  padding-bottom: 5px !important;\n",
       "}\n",
       "\n",
       ".xr-var-attrs-in:checked ~ .xr-var-attrs,\n",
       ".xr-var-data-in:checked ~ .xr-var-data {\n",
       "  display: block;\n",
       "}\n",
       "\n",
       ".xr-var-data > table {\n",
       "  float: right;\n",
       "}\n",
       "\n",
       ".xr-var-name span,\n",
       ".xr-var-data,\n",
       ".xr-attrs {\n",
       "  padding-left: 25px !important;\n",
       "}\n",
       "\n",
       ".xr-attrs,\n",
       ".xr-var-attrs,\n",
       ".xr-var-data {\n",
       "  grid-column: 1 / -1;\n",
       "}\n",
       "\n",
       "dl.xr-attrs {\n",
       "  padding: 0;\n",
       "  margin: 0;\n",
       "  display: grid;\n",
       "  grid-template-columns: 125px auto;\n",
       "}\n",
       "\n",
       ".xr-attrs dt,\n",
       ".xr-attrs dd {\n",
       "  padding: 0;\n",
       "  margin: 0;\n",
       "  float: left;\n",
       "  padding-right: 10px;\n",
       "  width: auto;\n",
       "}\n",
       "\n",
       ".xr-attrs dt {\n",
       "  font-weight: normal;\n",
       "  grid-column: 1;\n",
       "}\n",
       "\n",
       ".xr-attrs dt:hover span {\n",
       "  display: inline-block;\n",
       "  background: var(--xr-background-color);\n",
       "  padding-right: 10px;\n",
       "}\n",
       "\n",
       ".xr-attrs dd {\n",
       "  grid-column: 2;\n",
       "  white-space: pre-wrap;\n",
       "  word-break: break-all;\n",
       "}\n",
       "\n",
       ".xr-icon-database,\n",
       ".xr-icon-file-text2 {\n",
       "  display: inline-block;\n",
       "  vertical-align: middle;\n",
       "  width: 1em;\n",
       "  height: 1.5em !important;\n",
       "  stroke-width: 0;\n",
       "  stroke: currentColor;\n",
       "  fill: currentColor;\n",
       "}\n",
       "</style><pre class='xr-text-repr-fallback'>&lt;xarray.DataArray (v_choice: 7)&gt;\n",
       "array([0.14285714, 0.14285714, 0.14285714, 0.14285714, 0.14285714,\n",
       "       0.14285714, 0.14285714])\n",
       "Coordinates:\n",
       "  * v_choice       (v_choice) int64 0 1 2 3 4 5 6\n",
       "    lbl__v_choice  (v_choice) object &#x27;TRBV11-2*03&#x27; ... &#x27;my_pseudo_TRBV&#x27;\n",
       "    seq__v_choice  (v_choice) object &#x27;GAAGCTGGAGTTGCCCAGTCTCCCAGATATAAGATTATA...\n",
       "Attributes:\n",
       "    nickname:    v_choice\n",
       "    event_type:  GeneChoice\n",
       "    seq_type:    V_gene\n",
       "    seq_side:    Undefined_side\n",
       "    priority:    7\n",
       "    parents:     []\n",
       "    childs:      [&#x27;j_choice&#x27;, &#x27;d_gene&#x27;, &#x27;v_3_del&#x27;]</pre><div class='xr-wrap' hidden><div class='xr-header'><div class='xr-obj-type'>xarray.DataArray</div><div class='xr-array-name'></div><ul class='xr-dim-list'><li><span class='xr-has-index'>v_choice</span>: 7</li></ul></div><ul class='xr-sections'><li class='xr-section-item'><div class='xr-array-wrap'><input id='section-5a304ac1-6268-4c58-b3ee-f725a291fd1a' class='xr-array-in' type='checkbox' checked><label for='section-5a304ac1-6268-4c58-b3ee-f725a291fd1a' title='Show/hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-array-preview xr-preview'><span>0.1429 0.1429 0.1429 0.1429 0.1429 0.1429 0.1429</span></div><div class='xr-array-data'><pre>array([0.14285714, 0.14285714, 0.14285714, 0.14285714, 0.14285714,\n",
       "       0.14285714, 0.14285714])</pre></div></div></li><li class='xr-section-item'><input id='section-a24f6077-8087-4223-a6ff-c2e690119bcb' class='xr-section-summary-in' type='checkbox'  checked><label for='section-a24f6077-8087-4223-a6ff-c2e690119bcb' class='xr-section-summary' >Coordinates: <span>(3)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>v_choice</span></div><div class='xr-var-dims'>(v_choice)</div><div class='xr-var-dtype'>int64</div><div class='xr-var-preview xr-preview'>0 1 2 3 4 5 6</div><input id='attrs-bae3c500-2bbd-4bc2-a0cc-ed54db364987' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-bae3c500-2bbd-4bc2-a0cc-ed54db364987' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-07a2ebf9-f9f9-4c3b-9f26-587842f66dc0' class='xr-var-data-in' type='checkbox'><label for='data-07a2ebf9-f9f9-4c3b-9f26-587842f66dc0' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([0, 1, 2, 3, 4, 5, 6])</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>lbl__v_choice</span></div><div class='xr-var-dims'>(v_choice)</div><div class='xr-var-dtype'>object</div><div class='xr-var-preview xr-preview'>&#x27;TRBV11-2*03&#x27; ... &#x27;my_pseudo_TRBV&#x27;</div><input id='attrs-1c66a853-d00f-4795-8059-22baec86cc99' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-1c66a853-d00f-4795-8059-22baec86cc99' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-42d368d3-63a1-4023-a5ab-ce2b0a8f4f7f' class='xr-var-data-in' type='checkbox'><label for='data-42d368d3-63a1-4023-a5ab-ce2b0a8f4f7f' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([&#x27;TRBV11-2*03&#x27;, &#x27;TRBV11-3*01&#x27;, &#x27;TRBV12-1*01&#x27;, &#x27;TRBV12-2*01&#x27;,\n",
       "       &#x27;TRBV12-3*01&#x27;, &#x27;TRBV12-4*01&#x27;, &#x27;my_pseudo_TRBV&#x27;], dtype=object)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>seq__v_choice</span></div><div class='xr-var-dims'>(v_choice)</div><div class='xr-var-dtype'>object</div><div class='xr-var-preview xr-preview'>&#x27;GAAGCTGGAGTTGCCCAGTCTCCCAGATATA...</div><input id='attrs-d447ec51-e3c9-4caf-83e4-9846e0b26a32' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-d447ec51-e3c9-4caf-83e4-9846e0b26a32' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-7aa74caa-9030-4efe-87cb-e05ae32dab2a' class='xr-var-data-in' type='checkbox'><label for='data-7aa74caa-9030-4efe-87cb-e05ae32dab2a' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([&#x27;GAAGCTGGAGTTGCCCAGTCTCCCAGATATAAGATTATAGAGAAAAGGCAGAGTGTGGCTTTTTGGTGCAATCCTATATCTGGCCATGCTACCCTTTACTGGTACCAGCAGATCCTGGGACAGGGCCCAAAGCTTCTGATTCAGTTTCAGAATAACGGTGTAGTGGATGATTCACAGTTGCCTAAGGATCGATTTTCTGCAGAGAGGCTCAAAGGAGTAGACTCCACTCTCAAGATCCAACCTGCAAAGCTTGAGGACTCGGCCGTGTATCTCTGTGCCAGCAGCTTAGA&#x27;,\n",
       "       &#x27;GAAGCTGGAGTGGTTCAGTCTCCCAGATATAAGATTATAGAGAAAAAACAGCCTGTGGCTTTTTGGTGCAATCCTATTTCTGGCCACAATACCCTTTACTGGTACCTGCAGAACTTGGGACAGGGCCCGGAGCTTCTGATTCGATATGAGAATGAGGAAGCAGTAGACGATTCACAGTTGCCTAAGGATCGATTTTCTGCAGAGAGGCTCAAAGGAGTAGACTCCACTCTCAAGATCCAGCCTGCAGAGCTTGGGGACTCGGCCGTGTATCTCTGTGCCAGCAGCTTAGA&#x27;,\n",
       "       &#x27;GCTGGTGTTATCCAGTCACCCAGGCACAAAGTGACAGAGATGGGACAATCAGTAACTCTGAGATGCGAACCAATTTCAGGCCACAATGATCTTCTCTGGTACAGACAGACCTTTGTGCAGGGACTGGAATTGCTGAATTACTTCTGCAGCTGGACCCTCGTAGATGACTCAGGAGTGTCCAAGGATTGATTCTCAGCACAGATGCCTGATGTATCATTCTCCACTCTGAGGATCCAGCCCATGGAACCCAGGGACTTGGGCCTATATTTCTGTGCCAGCAGCTTTGC&#x27;,\n",
       "       &#x27;GCTGGCATTATCCAGTCACCCAAGCATGAGGTGACAGAAATGGGACAAACAGTGACTCTGAGATGTGAGCCAATTTTTGGCCACAATTTCCTTTTCTGGTACAGAGATACCTTCGTGCAGGGACTGGAATTGCTGAGTTACTTCCGGAGCTGATCTATTATAGATAATGCAGGTATGCCCACAGAGCGATTCTCAGCTGAGAGGCCTGATGGATCATTCTCTACTCTGAAGATCCAGCCTGCAGAGCAGGGGGACTCGGCCGTGTATGTCTGTGCAAGTCGCTTAGC&#x27;,\n",
       "       &#x27;GATGCTGGAGTTATCCAGTCACCCCGCCATGAGGTGACAGAGATGGGACAAGAAGTGACTCTGAGATGTAAACCAATTTCAGGCCACAACTCCCTTTTCTGGTACAGACAGACCATGATGCGGGGACTGGAGTTGCTCATTTACTTTAACAACAACGTTCCGATAGATGATTCAGGGATGCCCGAGGATCGATTCTCAGCTAAGATGCCTAATGCATCATTCTCCACTCTGAAGATCCAGCCCTCAGAACCCAGGGACTCAGCTGTGTACTTCTGTGCCAGCAGTTTAGC&#x27;,\n",
       "       &#x27;GATGCTGGAGTTATCCAGTCACCCCGGCACGAGGTGACAGAGATGGGACAAGAAGTGACTCTGAGATGTAAACCAATTTCAGGACACGACTACCTTTTCTGGTACAGACAGACCATGATGCGGGGACTGGAGTTGCTCATTTACTTTAACAACAACGTTCCGATAGATGATTCAGGGATGCCCGAGGATCGATTCTCAGCTAAGATGCCTAATGCATCATTCTCCACTCTGAAGATCCAGCCCTCAGAACCCAGGGACTCAGCTGTGTACTTCTGTGCCAGCAGTTTAGC&#x27;,\n",
       "       &#x27;AAACCCTTTGGGACCCAGAGCCCAAGACACAAGATCACAGAGACAGGAAGGCAGGTGACCTTGGCGTGTCACCAGACTTGGAACCACAACAATATGTTCTGGTATCGACAAGACCTGGGACATGGGCTGAGGCTGATCCATTACTCATATGGTGTTCACGACACTAACAAAGGAGAAGTCTCAGATGGCTACAGTGTCTCTAGATCAAACACAGAGGACCTCCCCCTCACTCTGTAGTCTGCTGCCTCCTCCCAGACATCTGTATATTTCTGCGCCAGCAGTGAGTC&#x27;],\n",
       "      dtype=object)</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-6fc4da7d-82b2-4735-a527-27652ca1a7d4' class='xr-section-summary-in' type='checkbox'  checked><label for='section-6fc4da7d-82b2-4735-a527-27652ca1a7d4' class='xr-section-summary' >Attributes: <span>(7)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><dl class='xr-attrs'><dt><span>nickname :</span></dt><dd>v_choice</dd><dt><span>event_type :</span></dt><dd>GeneChoice</dd><dt><span>seq_type :</span></dt><dd>V_gene</dd><dt><span>seq_side :</span></dt><dd>Undefined_side</dd><dt><span>priority :</span></dt><dd>7</dd><dt><span>parents :</span></dt><dd>[]</dd><dt><span>childs :</span></dt><dd>[&#x27;j_choice&#x27;, &#x27;d_gene&#x27;, &#x27;v_3_del&#x27;]</dd></dl></div></li></ul></div></div>"
      ],
      "text/plain": [
       "<xarray.DataArray (v_choice: 7)>\n",
       "array([0.14285714, 0.14285714, 0.14285714, 0.14285714, 0.14285714,\n",
       "       0.14285714, 0.14285714])\n",
       "Coordinates:\n",
       "  * v_choice       (v_choice) int64 0 1 2 3 4 5 6\n",
       "    lbl__v_choice  (v_choice) object 'TRBV11-2*03' ... 'my_pseudo_TRBV'\n",
       "    seq__v_choice  (v_choice) object 'GAAGCTGGAGTTGCCCAGTCTCCCAGATATAAGATTATA...\n",
       "Attributes:\n",
       "    nickname:    v_choice\n",
       "    event_type:  GeneChoice\n",
       "    seq_type:    V_gene\n",
       "    seq_side:    Undefined_side\n",
       "    priority:    7\n",
       "    parents:     []\n",
       "    childs:      ['j_choice', 'd_gene', 'v_3_del']"
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mdl_0 = p3.IgorModel('new_model_parms.txt', 'new_model_marginals.txt',\n",
    "                      fln_V_gene_CDR3_anchors='new_V_anchors.csv', \n",
    "                      fln_J_gene_CDR3_anchors='new_J_anchors.csv')\n",
    "mdl_0['v_choice']"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "IgorModel can also be exported in separated csv files"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [],
   "source": [
    "mdl_0.export_csv('initial_')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Insertions;P(vd_ins);P(dj_ins)\n",
      "0;0.024390243902439025;0.024390243902439025\n",
      "1;0.024390243902439025;0.024390243902439025\n",
      "2;0.024390243902439025;0.024390243902439025\n",
      "3;0.024390243902439025;0.024390243902439025\n",
      "4;0.024390243902439025;0.024390243902439025\n",
      "5;0.024390243902439025;0.024390243902439025\n",
      "6;0.024390243902439025;0.024390243902439025\n",
      "7;0.024390243902439025;0.024390243902439025\n",
      "8;0.024390243902439025;0.024390243902439025\n"
     ]
    }
   ],
   "source": [
    "!head initial_P__insertions.csv"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      ";TRBJ1-1*01;TRBJ1-2*01;TRBJ1-3*01;TRBJ1-4*01;TRBJ1-5*01;TRBJ1-6*01;TRBJ1-6*02;TRBJ2-1*01;TRBJ2-2*01;TRBJ2-3*01;TRBJ2-4*01;TRBJ2-5*01;TRBJ2-6*01;TRBJ2-7*01;TRBJ2-7*02\n",
      "TRBV11-2*03;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667\n",
      "TRBV11-3*01;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667\n",
      "TRBV12-1*01;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667\n",
      "TRBV12-2*01;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667\n",
      "TRBV12-3*01;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667\n",
      "TRBV12-4*01;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667\n",
      "my_pseudo_TRBV;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667;0.06666666666666667\n"
     ]
    }
   ],
   "source": [
    "!head initial_P__j_choice__G__v_choice.csv"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Entropy\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "$ H = - \\sum_x P_(x) \\log(P(x)) $ "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/olivares/anaconda3/envs/statbiophys-dev/lib/python3.7/site-packages/xarray/core/computation.py:739: RuntimeWarning: divide by zero encountered in log2\n",
      "  result_data = func(*input_data)\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "5.252905287497762"
      ]
     },
     "execution_count": 43,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import numpy as np\n",
    "-np.dot(mdl_hb['v_choice'], np.nan_to_num(np.log2(mdl_hb['v_choice']), neginf=0, nan=0) )"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><svg style=\"position: absolute; width: 0; height: 0; overflow: hidden\">\n",
       "<defs>\n",
       "<symbol id=\"icon-database\" viewBox=\"0 0 32 32\">\n",
       "<path d=\"M16 0c-8.837 0-16 2.239-16 5v4c0 2.761 7.163 5 16 5s16-2.239 16-5v-4c0-2.761-7.163-5-16-5z\"></path>\n",
       "<path d=\"M16 17c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
       "<path d=\"M16 26c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
       "</symbol>\n",
       "<symbol id=\"icon-file-text2\" viewBox=\"0 0 32 32\">\n",
       "<path d=\"M28.681 7.159c-0.694-0.947-1.662-2.053-2.724-3.116s-2.169-2.030-3.116-2.724c-1.612-1.182-2.393-1.319-2.841-1.319h-15.5c-1.378 0-2.5 1.121-2.5 2.5v27c0 1.378 1.122 2.5 2.5 2.5h23c1.378 0 2.5-1.122 2.5-2.5v-19.5c0-0.448-0.137-1.23-1.319-2.841zM24.543 5.457c0.959 0.959 1.712 1.825 2.268 2.543h-4.811v-4.811c0.718 0.556 1.584 1.309 2.543 2.268zM28 29.5c0 0.271-0.229 0.5-0.5 0.5h-23c-0.271 0-0.5-0.229-0.5-0.5v-27c0-0.271 0.229-0.5 0.5-0.5 0 0 15.499-0 15.5 0v7c0 0.552 0.448 1 1 1h7v19.5z\"></path>\n",
       "<path d=\"M23 26h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
       "<path d=\"M23 22h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
       "<path d=\"M23 18h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
       "</symbol>\n",
       "</defs>\n",
       "</svg>\n",
       "<style>/* CSS stylesheet for displaying xarray objects in jupyterlab.\n",
       " *\n",
       " */\n",
       "\n",
       ":root {\n",
       "  --xr-font-color0: var(--jp-content-font-color0, rgba(0, 0, 0, 1));\n",
       "  --xr-font-color2: var(--jp-content-font-color2, rgba(0, 0, 0, 0.54));\n",
       "  --xr-font-color3: var(--jp-content-font-color3, rgba(0, 0, 0, 0.38));\n",
       "  --xr-border-color: var(--jp-border-color2, #e0e0e0);\n",
       "  --xr-disabled-color: var(--jp-layout-color3, #bdbdbd);\n",
       "  --xr-background-color: var(--jp-layout-color0, white);\n",
       "  --xr-background-color-row-even: var(--jp-layout-color1, white);\n",
       "  --xr-background-color-row-odd: var(--jp-layout-color2, #eeeeee);\n",
       "}\n",
       "\n",
       "html[theme=dark],\n",
       "body.vscode-dark {\n",
       "  --xr-font-color0: rgba(255, 255, 255, 1);\n",
       "  --xr-font-color2: rgba(255, 255, 255, 0.54);\n",
       "  --xr-font-color3: rgba(255, 255, 255, 0.38);\n",
       "  --xr-border-color: #1F1F1F;\n",
       "  --xr-disabled-color: #515151;\n",
       "  --xr-background-color: #111111;\n",
       "  --xr-background-color-row-even: #111111;\n",
       "  --xr-background-color-row-odd: #313131;\n",
       "}\n",
       "\n",
       ".xr-wrap {\n",
       "  display: block;\n",
       "  min-width: 300px;\n",
       "  max-width: 700px;\n",
       "}\n",
       "\n",
       ".xr-text-repr-fallback {\n",
       "  /* fallback to plain text repr when CSS is not injected (untrusted notebook) */\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-header {\n",
       "  padding-top: 6px;\n",
       "  padding-bottom: 6px;\n",
       "  margin-bottom: 4px;\n",
       "  border-bottom: solid 1px var(--xr-border-color);\n",
       "}\n",
       "\n",
       ".xr-header > div,\n",
       ".xr-header > ul {\n",
       "  display: inline;\n",
       "  margin-top: 0;\n",
       "  margin-bottom: 0;\n",
       "}\n",
       "\n",
       ".xr-obj-type,\n",
       ".xr-array-name {\n",
       "  margin-left: 2px;\n",
       "  margin-right: 10px;\n",
       "}\n",
       "\n",
       ".xr-obj-type {\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-sections {\n",
       "  padding-left: 0 !important;\n",
       "  display: grid;\n",
       "  grid-template-columns: 150px auto auto 1fr 20px 20px;\n",
       "}\n",
       "\n",
       ".xr-section-item {\n",
       "  display: contents;\n",
       "}\n",
       "\n",
       ".xr-section-item input {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-section-item input + label {\n",
       "  color: var(--xr-disabled-color);\n",
       "}\n",
       "\n",
       ".xr-section-item input:enabled + label {\n",
       "  cursor: pointer;\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-section-item input:enabled + label:hover {\n",
       "  color: var(--xr-font-color0);\n",
       "}\n",
       "\n",
       ".xr-section-summary {\n",
       "  grid-column: 1;\n",
       "  color: var(--xr-font-color2);\n",
       "  font-weight: 500;\n",
       "}\n",
       "\n",
       ".xr-section-summary > span {\n",
       "  display: inline-block;\n",
       "  padding-left: 0.5em;\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:disabled + label {\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-section-summary-in + label:before {\n",
       "  display: inline-block;\n",
       "  content: '►';\n",
       "  font-size: 11px;\n",
       "  width: 15px;\n",
       "  text-align: center;\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:disabled + label:before {\n",
       "  color: var(--xr-disabled-color);\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:checked + label:before {\n",
       "  content: '▼';\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:checked + label > span {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-section-summary,\n",
       ".xr-section-inline-details {\n",
       "  padding-top: 4px;\n",
       "  padding-bottom: 4px;\n",
       "}\n",
       "\n",
       ".xr-section-inline-details {\n",
       "  grid-column: 2 / -1;\n",
       "}\n",
       "\n",
       ".xr-section-details {\n",
       "  display: none;\n",
       "  grid-column: 1 / -1;\n",
       "  margin-bottom: 5px;\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:checked ~ .xr-section-details {\n",
       "  display: contents;\n",
       "}\n",
       "\n",
       ".xr-array-wrap {\n",
       "  grid-column: 1 / -1;\n",
       "  display: grid;\n",
       "  grid-template-columns: 20px auto;\n",
       "}\n",
       "\n",
       ".xr-array-wrap > label {\n",
       "  grid-column: 1;\n",
       "  vertical-align: top;\n",
       "}\n",
       "\n",
       ".xr-preview {\n",
       "  color: var(--xr-font-color3);\n",
       "}\n",
       "\n",
       ".xr-array-preview,\n",
       ".xr-array-data {\n",
       "  padding: 0 5px !important;\n",
       "  grid-column: 2;\n",
       "}\n",
       "\n",
       ".xr-array-data,\n",
       ".xr-array-in:checked ~ .xr-array-preview {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-array-in:checked ~ .xr-array-data,\n",
       ".xr-array-preview {\n",
       "  display: inline-block;\n",
       "}\n",
       "\n",
       ".xr-dim-list {\n",
       "  display: inline-block !important;\n",
       "  list-style: none;\n",
       "  padding: 0 !important;\n",
       "  margin: 0;\n",
       "}\n",
       "\n",
       ".xr-dim-list li {\n",
       "  display: inline-block;\n",
       "  padding: 0;\n",
       "  margin: 0;\n",
       "}\n",
       "\n",
       ".xr-dim-list:before {\n",
       "  content: '(';\n",
       "}\n",
       "\n",
       ".xr-dim-list:after {\n",
       "  content: ')';\n",
       "}\n",
       "\n",
       ".xr-dim-list li:not(:last-child):after {\n",
       "  content: ',';\n",
       "  padding-right: 5px;\n",
       "}\n",
       "\n",
       ".xr-has-index {\n",
       "  font-weight: bold;\n",
       "}\n",
       "\n",
       ".xr-var-list,\n",
       ".xr-var-item {\n",
       "  display: contents;\n",
       "}\n",
       "\n",
       ".xr-var-item > div,\n",
       ".xr-var-item label,\n",
       ".xr-var-item > .xr-var-name span {\n",
       "  background-color: var(--xr-background-color-row-even);\n",
       "  margin-bottom: 0;\n",
       "}\n",
       "\n",
       ".xr-var-item > .xr-var-name:hover span {\n",
       "  padding-right: 5px;\n",
       "}\n",
       "\n",
       ".xr-var-list > li:nth-child(odd) > div,\n",
       ".xr-var-list > li:nth-child(odd) > label,\n",
       ".xr-var-list > li:nth-child(odd) > .xr-var-name span {\n",
       "  background-color: var(--xr-background-color-row-odd);\n",
       "}\n",
       "\n",
       ".xr-var-name {\n",
       "  grid-column: 1;\n",
       "}\n",
       "\n",
       ".xr-var-dims {\n",
       "  grid-column: 2;\n",
       "}\n",
       "\n",
       ".xr-var-dtype {\n",
       "  grid-column: 3;\n",
       "  text-align: right;\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-var-preview {\n",
       "  grid-column: 4;\n",
       "}\n",
       "\n",
       ".xr-var-name,\n",
       ".xr-var-dims,\n",
       ".xr-var-dtype,\n",
       ".xr-preview,\n",
       ".xr-attrs dt {\n",
       "  white-space: nowrap;\n",
       "  overflow: hidden;\n",
       "  text-overflow: ellipsis;\n",
       "  padding-right: 10px;\n",
       "}\n",
       "\n",
       ".xr-var-name:hover,\n",
       ".xr-var-dims:hover,\n",
       ".xr-var-dtype:hover,\n",
       ".xr-attrs dt:hover {\n",
       "  overflow: visible;\n",
       "  width: auto;\n",
       "  z-index: 1;\n",
       "}\n",
       "\n",
       ".xr-var-attrs,\n",
       ".xr-var-data {\n",
       "  display: none;\n",
       "  background-color: var(--xr-background-color) !important;\n",
       "  padding-bottom: 5px !important;\n",
       "}\n",
       "\n",
       ".xr-var-attrs-in:checked ~ .xr-var-attrs,\n",
       ".xr-var-data-in:checked ~ .xr-var-data {\n",
       "  display: block;\n",
       "}\n",
       "\n",
       ".xr-var-data > table {\n",
       "  float: right;\n",
       "}\n",
       "\n",
       ".xr-var-name span,\n",
       ".xr-var-data,\n",
       ".xr-attrs {\n",
       "  padding-left: 25px !important;\n",
       "}\n",
       "\n",
       ".xr-attrs,\n",
       ".xr-var-attrs,\n",
       ".xr-var-data {\n",
       "  grid-column: 1 / -1;\n",
       "}\n",
       "\n",
       "dl.xr-attrs {\n",
       "  padding: 0;\n",
       "  margin: 0;\n",
       "  display: grid;\n",
       "  grid-template-columns: 125px auto;\n",
       "}\n",
       "\n",
       ".xr-attrs dt,\n",
       ".xr-attrs dd {\n",
       "  padding: 0;\n",
       "  margin: 0;\n",
       "  float: left;\n",
       "  padding-right: 10px;\n",
       "  width: auto;\n",
       "}\n",
       "\n",
       ".xr-attrs dt {\n",
       "  font-weight: normal;\n",
       "  grid-column: 1;\n",
       "}\n",
       "\n",
       ".xr-attrs dt:hover span {\n",
       "  display: inline-block;\n",
       "  background: var(--xr-background-color);\n",
       "  padding-right: 10px;\n",
       "}\n",
       "\n",
       ".xr-attrs dd {\n",
       "  grid-column: 2;\n",
       "  white-space: pre-wrap;\n",
       "  word-break: break-all;\n",
       "}\n",
       "\n",
       ".xr-icon-database,\n",
       ".xr-icon-file-text2 {\n",
       "  display: inline-block;\n",
       "  vertical-align: middle;\n",
       "  width: 1em;\n",
       "  height: 1.5em !important;\n",
       "  stroke-width: 0;\n",
       "  stroke: currentColor;\n",
       "  fill: currentColor;\n",
       "}\n",
       "</style><pre class='xr-text-repr-fallback'>&lt;xarray.DataArray ()&gt;\n",
       "array(5.25291424)</pre><div class='xr-wrap' hidden><div class='xr-header'><div class='xr-obj-type'>xarray.DataArray</div><div class='xr-array-name'></div></div><ul class='xr-sections'><li class='xr-section-item'><div class='xr-array-wrap'><input id='section-a48b3c0e-70a7-4135-bc09-9ef6c63c3dbb' class='xr-array-in' type='checkbox' checked><label for='section-a48b3c0e-70a7-4135-bc09-9ef6c63c3dbb' title='Show/hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-array-preview xr-preview'><span>5.253</span></div><div class='xr-array-data'><pre>array(5.25291424)</pre></div></div></li><li class='xr-section-item'><input id='section-66b64360-ac06-4bff-92e6-31f6b42d6561' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-66b64360-ac06-4bff-92e6-31f6b42d6561' class='xr-section-summary'  title='Expand/collapse section'>Coordinates: <span>(0)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'></ul></div></li><li class='xr-section-item'><input id='section-421d939a-b47a-43b8-96ff-96ebbf629683' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-421d939a-b47a-43b8-96ff-96ebbf629683' class='xr-section-summary'  title='Expand/collapse section'>Attributes: <span>(0)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><dl class='xr-attrs'></dl></div></li></ul></div></div>"
      ],
      "text/plain": [
       "<xarray.DataArray ()>\n",
       "array(5.25291424)"
      ]
     },
     "execution_count": 44,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mdl_hb.get_entropy_event('v_choice')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Mutual Information"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/olivares/anaconda3/envs/statbiophys-dev/lib/python3.7/site-packages/xarray/core/computation.py:739: RuntimeWarning: divide by zero encountered in log2\n",
      "  result_data = func(*input_data)\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div><svg style=\"position: absolute; width: 0; height: 0; overflow: hidden\">\n",
       "<defs>\n",
       "<symbol id=\"icon-database\" viewBox=\"0 0 32 32\">\n",
       "<path d=\"M16 0c-8.837 0-16 2.239-16 5v4c0 2.761 7.163 5 16 5s16-2.239 16-5v-4c0-2.761-7.163-5-16-5z\"></path>\n",
       "<path d=\"M16 17c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
       "<path d=\"M16 26c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
       "</symbol>\n",
       "<symbol id=\"icon-file-text2\" viewBox=\"0 0 32 32\">\n",
       "<path d=\"M28.681 7.159c-0.694-0.947-1.662-2.053-2.724-3.116s-2.169-2.030-3.116-2.724c-1.612-1.182-2.393-1.319-2.841-1.319h-15.5c-1.378 0-2.5 1.121-2.5 2.5v27c0 1.378 1.122 2.5 2.5 2.5h23c1.378 0 2.5-1.122 2.5-2.5v-19.5c0-0.448-0.137-1.23-1.319-2.841zM24.543 5.457c0.959 0.959 1.712 1.825 2.268 2.543h-4.811v-4.811c0.718 0.556 1.584 1.309 2.543 2.268zM28 29.5c0 0.271-0.229 0.5-0.5 0.5h-23c-0.271 0-0.5-0.229-0.5-0.5v-27c0-0.271 0.229-0.5 0.5-0.5 0 0 15.499-0 15.5 0v7c0 0.552 0.448 1 1 1h7v19.5z\"></path>\n",
       "<path d=\"M23 26h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
       "<path d=\"M23 22h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
       "<path d=\"M23 18h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
       "</symbol>\n",
       "</defs>\n",
       "</svg>\n",
       "<style>/* CSS stylesheet for displaying xarray objects in jupyterlab.\n",
       " *\n",
       " */\n",
       "\n",
       ":root {\n",
       "  --xr-font-color0: var(--jp-content-font-color0, rgba(0, 0, 0, 1));\n",
       "  --xr-font-color2: var(--jp-content-font-color2, rgba(0, 0, 0, 0.54));\n",
       "  --xr-font-color3: var(--jp-content-font-color3, rgba(0, 0, 0, 0.38));\n",
       "  --xr-border-color: var(--jp-border-color2, #e0e0e0);\n",
       "  --xr-disabled-color: var(--jp-layout-color3, #bdbdbd);\n",
       "  --xr-background-color: var(--jp-layout-color0, white);\n",
       "  --xr-background-color-row-even: var(--jp-layout-color1, white);\n",
       "  --xr-background-color-row-odd: var(--jp-layout-color2, #eeeeee);\n",
       "}\n",
       "\n",
       "html[theme=dark],\n",
       "body.vscode-dark {\n",
       "  --xr-font-color0: rgba(255, 255, 255, 1);\n",
       "  --xr-font-color2: rgba(255, 255, 255, 0.54);\n",
       "  --xr-font-color3: rgba(255, 255, 255, 0.38);\n",
       "  --xr-border-color: #1F1F1F;\n",
       "  --xr-disabled-color: #515151;\n",
       "  --xr-background-color: #111111;\n",
       "  --xr-background-color-row-even: #111111;\n",
       "  --xr-background-color-row-odd: #313131;\n",
       "}\n",
       "\n",
       ".xr-wrap {\n",
       "  display: block;\n",
       "  min-width: 300px;\n",
       "  max-width: 700px;\n",
       "}\n",
       "\n",
       ".xr-text-repr-fallback {\n",
       "  /* fallback to plain text repr when CSS is not injected (untrusted notebook) */\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-header {\n",
       "  padding-top: 6px;\n",
       "  padding-bottom: 6px;\n",
       "  margin-bottom: 4px;\n",
       "  border-bottom: solid 1px var(--xr-border-color);\n",
       "}\n",
       "\n",
       ".xr-header > div,\n",
       ".xr-header > ul {\n",
       "  display: inline;\n",
       "  margin-top: 0;\n",
       "  margin-bottom: 0;\n",
       "}\n",
       "\n",
       ".xr-obj-type,\n",
       ".xr-array-name {\n",
       "  margin-left: 2px;\n",
       "  margin-right: 10px;\n",
       "}\n",
       "\n",
       ".xr-obj-type {\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-sections {\n",
       "  padding-left: 0 !important;\n",
       "  display: grid;\n",
       "  grid-template-columns: 150px auto auto 1fr 20px 20px;\n",
       "}\n",
       "\n",
       ".xr-section-item {\n",
       "  display: contents;\n",
       "}\n",
       "\n",
       ".xr-section-item input {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-section-item input + label {\n",
       "  color: var(--xr-disabled-color);\n",
       "}\n",
       "\n",
       ".xr-section-item input:enabled + label {\n",
       "  cursor: pointer;\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-section-item input:enabled + label:hover {\n",
       "  color: var(--xr-font-color0);\n",
       "}\n",
       "\n",
       ".xr-section-summary {\n",
       "  grid-column: 1;\n",
       "  color: var(--xr-font-color2);\n",
       "  font-weight: 500;\n",
       "}\n",
       "\n",
       ".xr-section-summary > span {\n",
       "  display: inline-block;\n",
       "  padding-left: 0.5em;\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:disabled + label {\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-section-summary-in + label:before {\n",
       "  display: inline-block;\n",
       "  content: '►';\n",
       "  font-size: 11px;\n",
       "  width: 15px;\n",
       "  text-align: center;\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:disabled + label:before {\n",
       "  color: var(--xr-disabled-color);\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:checked + label:before {\n",
       "  content: '▼';\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:checked + label > span {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-section-summary,\n",
       ".xr-section-inline-details {\n",
       "  padding-top: 4px;\n",
       "  padding-bottom: 4px;\n",
       "}\n",
       "\n",
       ".xr-section-inline-details {\n",
       "  grid-column: 2 / -1;\n",
       "}\n",
       "\n",
       ".xr-section-details {\n",
       "  display: none;\n",
       "  grid-column: 1 / -1;\n",
       "  margin-bottom: 5px;\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:checked ~ .xr-section-details {\n",
       "  display: contents;\n",
       "}\n",
       "\n",
       ".xr-array-wrap {\n",
       "  grid-column: 1 / -1;\n",
       "  display: grid;\n",
       "  grid-template-columns: 20px auto;\n",
       "}\n",
       "\n",
       ".xr-array-wrap > label {\n",
       "  grid-column: 1;\n",
       "  vertical-align: top;\n",
       "}\n",
       "\n",
       ".xr-preview {\n",
       "  color: var(--xr-font-color3);\n",
       "}\n",
       "\n",
       ".xr-array-preview,\n",
       ".xr-array-data {\n",
       "  padding: 0 5px !important;\n",
       "  grid-column: 2;\n",
       "}\n",
       "\n",
       ".xr-array-data,\n",
       ".xr-array-in:checked ~ .xr-array-preview {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-array-in:checked ~ .xr-array-data,\n",
       ".xr-array-preview {\n",
       "  display: inline-block;\n",
       "}\n",
       "\n",
       ".xr-dim-list {\n",
       "  display: inline-block !important;\n",
       "  list-style: none;\n",
       "  padding: 0 !important;\n",
       "  margin: 0;\n",
       "}\n",
       "\n",
       ".xr-dim-list li {\n",
       "  display: inline-block;\n",
       "  padding: 0;\n",
       "  margin: 0;\n",
       "}\n",
       "\n",
       ".xr-dim-list:before {\n",
       "  content: '(';\n",
       "}\n",
       "\n",
       ".xr-dim-list:after {\n",
       "  content: ')';\n",
       "}\n",
       "\n",
       ".xr-dim-list li:not(:last-child):after {\n",
       "  content: ',';\n",
       "  padding-right: 5px;\n",
       "}\n",
       "\n",
       ".xr-has-index {\n",
       "  font-weight: bold;\n",
       "}\n",
       "\n",
       ".xr-var-list,\n",
       ".xr-var-item {\n",
       "  display: contents;\n",
       "}\n",
       "\n",
       ".xr-var-item > div,\n",
       ".xr-var-item label,\n",
       ".xr-var-item > .xr-var-name span {\n",
       "  background-color: var(--xr-background-color-row-even);\n",
       "  margin-bottom: 0;\n",
       "}\n",
       "\n",
       ".xr-var-item > .xr-var-name:hover span {\n",
       "  padding-right: 5px;\n",
       "}\n",
       "\n",
       ".xr-var-list > li:nth-child(odd) > div,\n",
       ".xr-var-list > li:nth-child(odd) > label,\n",
       ".xr-var-list > li:nth-child(odd) > .xr-var-name span {\n",
       "  background-color: var(--xr-background-color-row-odd);\n",
       "}\n",
       "\n",
       ".xr-var-name {\n",
       "  grid-column: 1;\n",
       "}\n",
       "\n",
       ".xr-var-dims {\n",
       "  grid-column: 2;\n",
       "}\n",
       "\n",
       ".xr-var-dtype {\n",
       "  grid-column: 3;\n",
       "  text-align: right;\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-var-preview {\n",
       "  grid-column: 4;\n",
       "}\n",
       "\n",
       ".xr-var-name,\n",
       ".xr-var-dims,\n",
       ".xr-var-dtype,\n",
       ".xr-preview,\n",
       ".xr-attrs dt {\n",
       "  white-space: nowrap;\n",
       "  overflow: hidden;\n",
       "  text-overflow: ellipsis;\n",
       "  padding-right: 10px;\n",
       "}\n",
       "\n",
       ".xr-var-name:hover,\n",
       ".xr-var-dims:hover,\n",
       ".xr-var-dtype:hover,\n",
       ".xr-attrs dt:hover {\n",
       "  overflow: visible;\n",
       "  width: auto;\n",
       "  z-index: 1;\n",
       "}\n",
       "\n",
       ".xr-var-attrs,\n",
       ".xr-var-data {\n",
       "  display: none;\n",
       "  background-color: var(--xr-background-color) !important;\n",
       "  padding-bottom: 5px !important;\n",
       "}\n",
       "\n",
       ".xr-var-attrs-in:checked ~ .xr-var-attrs,\n",
       ".xr-var-data-in:checked ~ .xr-var-data {\n",
       "  display: block;\n",
       "}\n",
       "\n",
       ".xr-var-data > table {\n",
       "  float: right;\n",
       "}\n",
       "\n",
       ".xr-var-name span,\n",
       ".xr-var-data,\n",
       ".xr-attrs {\n",
       "  padding-left: 25px !important;\n",
       "}\n",
       "\n",
       ".xr-attrs,\n",
       ".xr-var-attrs,\n",
       ".xr-var-data {\n",
       "  grid-column: 1 / -1;\n",
       "}\n",
       "\n",
       "dl.xr-attrs {\n",
       "  padding: 0;\n",
       "  margin: 0;\n",
       "  display: grid;\n",
       "  grid-template-columns: 125px auto;\n",
       "}\n",
       "\n",
       ".xr-attrs dt,\n",
       ".xr-attrs dd {\n",
       "  padding: 0;\n",
       "  margin: 0;\n",
       "  float: left;\n",
       "  padding-right: 10px;\n",
       "  width: auto;\n",
       "}\n",
       "\n",
       ".xr-attrs dt {\n",
       "  font-weight: normal;\n",
       "  grid-column: 1;\n",
       "}\n",
       "\n",
       ".xr-attrs dt:hover span {\n",
       "  display: inline-block;\n",
       "  background: var(--xr-background-color);\n",
       "  padding-right: 10px;\n",
       "}\n",
       "\n",
       ".xr-attrs dd {\n",
       "  grid-column: 2;\n",
       "  white-space: pre-wrap;\n",
       "  word-break: break-all;\n",
       "}\n",
       "\n",
       ".xr-icon-database,\n",
       ".xr-icon-file-text2 {\n",
       "  display: inline-block;\n",
       "  vertical-align: middle;\n",
       "  width: 1em;\n",
       "  height: 1.5em !important;\n",
       "  stroke-width: 0;\n",
       "  stroke: currentColor;\n",
       "  fill: currentColor;\n",
       "}\n",
       "</style><pre class='xr-text-repr-fallback'>&lt;xarray.DataArray ()&gt;\n",
       "array(0.0779008)</pre><div class='xr-wrap' hidden><div class='xr-header'><div class='xr-obj-type'>xarray.DataArray</div><div class='xr-array-name'></div></div><ul class='xr-sections'><li class='xr-section-item'><div class='xr-array-wrap'><input id='section-e40c57a9-ec57-4038-beb5-b743f2722c7a' class='xr-array-in' type='checkbox' checked><label for='section-e40c57a9-ec57-4038-beb5-b743f2722c7a' title='Show/hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-array-preview xr-preview'><span>0.0779</span></div><div class='xr-array-data'><pre>array(0.0779008)</pre></div></div></li><li class='xr-section-item'><input id='section-59bbeaed-323a-4b92-a004-4e8814579f45' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-59bbeaed-323a-4b92-a004-4e8814579f45' class='xr-section-summary'  title='Expand/collapse section'>Coordinates: <span>(0)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'></ul></div></li><li class='xr-section-item'><input id='section-df7604b4-6221-460b-a220-c9ab85224ff1' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-df7604b4-6221-460b-a220-c9ab85224ff1' class='xr-section-summary'  title='Expand/collapse section'>Attributes: <span>(0)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><dl class='xr-attrs'></dl></div></li></ul></div></div>"
      ],
      "text/plain": [
       "<xarray.DataArray ()>\n",
       "array(0.0779008)"
      ]
     },
     "execution_count": 45,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "I_V_J = mdl_hb.get_mutual_information_events('v_choice', 'j_choice')\n",
    "I_V_J"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/olivares/anaconda3/envs/statbiophys-dev/lib/python3.7/site-packages/xarray/core/computation.py:739: RuntimeWarning: divide by zero encountered in log2\n",
      "  result_data = func(*input_data)\n",
      "/home/olivares/anaconda3/envs/statbiophys-dev/lib/python3.7/site-packages/xarray/core/computation.py:739: RuntimeWarning: divide by zero encountered in log2\n",
      "  result_data = func(*input_data)\n",
      "/home/olivares/anaconda3/envs/statbiophys-dev/lib/python3.7/site-packages/xarray/core/computation.py:739: RuntimeWarning: divide by zero encountered in log2\n",
      "  result_data = func(*input_data)\n",
      "/home/olivares/anaconda3/envs/statbiophys-dev/lib/python3.7/site-packages/xarray/core/computation.py:739: RuntimeWarning: divide by zero encountered in log2\n",
      "  result_data = func(*input_data)\n",
      "/home/olivares/anaconda3/envs/statbiophys-dev/lib/python3.7/site-packages/xarray/core/computation.py:739: RuntimeWarning: divide by zero encountered in log2\n",
      "  result_data = func(*input_data)\n",
      "/home/olivares/anaconda3/envs/statbiophys-dev/lib/python3.7/site-packages/xarray/core/computation.py:739: RuntimeWarning: divide by zero encountered in log2\n",
      "  result_data = func(*input_data)\n",
      "/home/olivares/anaconda3/envs/statbiophys-dev/lib/python3.7/site-packages/xarray/core/computation.py:739: RuntimeWarning: divide by zero encountered in log2\n",
      "  result_data = func(*input_data)\n",
      "/home/olivares/anaconda3/envs/statbiophys-dev/lib/python3.7/site-packages/xarray/core/computation.py:739: RuntimeWarning: divide by zero encountered in log2\n",
      "  result_data = func(*input_data)\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div><svg style=\"position: absolute; width: 0; height: 0; overflow: hidden\">\n",
       "<defs>\n",
       "<symbol id=\"icon-database\" viewBox=\"0 0 32 32\">\n",
       "<path d=\"M16 0c-8.837 0-16 2.239-16 5v4c0 2.761 7.163 5 16 5s16-2.239 16-5v-4c0-2.761-7.163-5-16-5z\"></path>\n",
       "<path d=\"M16 17c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
       "<path d=\"M16 26c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
       "</symbol>\n",
       "<symbol id=\"icon-file-text2\" viewBox=\"0 0 32 32\">\n",
       "<path d=\"M28.681 7.159c-0.694-0.947-1.662-2.053-2.724-3.116s-2.169-2.030-3.116-2.724c-1.612-1.182-2.393-1.319-2.841-1.319h-15.5c-1.378 0-2.5 1.121-2.5 2.5v27c0 1.378 1.122 2.5 2.5 2.5h23c1.378 0 2.5-1.122 2.5-2.5v-19.5c0-0.448-0.137-1.23-1.319-2.841zM24.543 5.457c0.959 0.959 1.712 1.825 2.268 2.543h-4.811v-4.811c0.718 0.556 1.584 1.309 2.543 2.268zM28 29.5c0 0.271-0.229 0.5-0.5 0.5h-23c-0.271 0-0.5-0.229-0.5-0.5v-27c0-0.271 0.229-0.5 0.5-0.5 0 0 15.499-0 15.5 0v7c0 0.552 0.448 1 1 1h7v19.5z\"></path>\n",
       "<path d=\"M23 26h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
       "<path d=\"M23 22h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
       "<path d=\"M23 18h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
       "</symbol>\n",
       "</defs>\n",
       "</svg>\n",
       "<style>/* CSS stylesheet for displaying xarray objects in jupyterlab.\n",
       " *\n",
       " */\n",
       "\n",
       ":root {\n",
       "  --xr-font-color0: var(--jp-content-font-color0, rgba(0, 0, 0, 1));\n",
       "  --xr-font-color2: var(--jp-content-font-color2, rgba(0, 0, 0, 0.54));\n",
       "  --xr-font-color3: var(--jp-content-font-color3, rgba(0, 0, 0, 0.38));\n",
       "  --xr-border-color: var(--jp-border-color2, #e0e0e0);\n",
       "  --xr-disabled-color: var(--jp-layout-color3, #bdbdbd);\n",
       "  --xr-background-color: var(--jp-layout-color0, white);\n",
       "  --xr-background-color-row-even: var(--jp-layout-color1, white);\n",
       "  --xr-background-color-row-odd: var(--jp-layout-color2, #eeeeee);\n",
       "}\n",
       "\n",
       "html[theme=dark],\n",
       "body.vscode-dark {\n",
       "  --xr-font-color0: rgba(255, 255, 255, 1);\n",
       "  --xr-font-color2: rgba(255, 255, 255, 0.54);\n",
       "  --xr-font-color3: rgba(255, 255, 255, 0.38);\n",
       "  --xr-border-color: #1F1F1F;\n",
       "  --xr-disabled-color: #515151;\n",
       "  --xr-background-color: #111111;\n",
       "  --xr-background-color-row-even: #111111;\n",
       "  --xr-background-color-row-odd: #313131;\n",
       "}\n",
       "\n",
       ".xr-wrap {\n",
       "  display: block;\n",
       "  min-width: 300px;\n",
       "  max-width: 700px;\n",
       "}\n",
       "\n",
       ".xr-text-repr-fallback {\n",
       "  /* fallback to plain text repr when CSS is not injected (untrusted notebook) */\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-header {\n",
       "  padding-top: 6px;\n",
       "  padding-bottom: 6px;\n",
       "  margin-bottom: 4px;\n",
       "  border-bottom: solid 1px var(--xr-border-color);\n",
       "}\n",
       "\n",
       ".xr-header > div,\n",
       ".xr-header > ul {\n",
       "  display: inline;\n",
       "  margin-top: 0;\n",
       "  margin-bottom: 0;\n",
       "}\n",
       "\n",
       ".xr-obj-type,\n",
       ".xr-array-name {\n",
       "  margin-left: 2px;\n",
       "  margin-right: 10px;\n",
       "}\n",
       "\n",
       ".xr-obj-type {\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-sections {\n",
       "  padding-left: 0 !important;\n",
       "  display: grid;\n",
       "  grid-template-columns: 150px auto auto 1fr 20px 20px;\n",
       "}\n",
       "\n",
       ".xr-section-item {\n",
       "  display: contents;\n",
       "}\n",
       "\n",
       ".xr-section-item input {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-section-item input + label {\n",
       "  color: var(--xr-disabled-color);\n",
       "}\n",
       "\n",
       ".xr-section-item input:enabled + label {\n",
       "  cursor: pointer;\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-section-item input:enabled + label:hover {\n",
       "  color: var(--xr-font-color0);\n",
       "}\n",
       "\n",
       ".xr-section-summary {\n",
       "  grid-column: 1;\n",
       "  color: var(--xr-font-color2);\n",
       "  font-weight: 500;\n",
       "}\n",
       "\n",
       ".xr-section-summary > span {\n",
       "  display: inline-block;\n",
       "  padding-left: 0.5em;\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:disabled + label {\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-section-summary-in + label:before {\n",
       "  display: inline-block;\n",
       "  content: '►';\n",
       "  font-size: 11px;\n",
       "  width: 15px;\n",
       "  text-align: center;\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:disabled + label:before {\n",
       "  color: var(--xr-disabled-color);\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:checked + label:before {\n",
       "  content: '▼';\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:checked + label > span {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-section-summary,\n",
       ".xr-section-inline-details {\n",
       "  padding-top: 4px;\n",
       "  padding-bottom: 4px;\n",
       "}\n",
       "\n",
       ".xr-section-inline-details {\n",
       "  grid-column: 2 / -1;\n",
       "}\n",
       "\n",
       ".xr-section-details {\n",
       "  display: none;\n",
       "  grid-column: 1 / -1;\n",
       "  margin-bottom: 5px;\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:checked ~ .xr-section-details {\n",
       "  display: contents;\n",
       "}\n",
       "\n",
       ".xr-array-wrap {\n",
       "  grid-column: 1 / -1;\n",
       "  display: grid;\n",
       "  grid-template-columns: 20px auto;\n",
       "}\n",
       "\n",
       ".xr-array-wrap > label {\n",
       "  grid-column: 1;\n",
       "  vertical-align: top;\n",
       "}\n",
       "\n",
       ".xr-preview {\n",
       "  color: var(--xr-font-color3);\n",
       "}\n",
       "\n",
       ".xr-array-preview,\n",
       ".xr-array-data {\n",
       "  padding: 0 5px !important;\n",
       "  grid-column: 2;\n",
       "}\n",
       "\n",
       ".xr-array-data,\n",
       ".xr-array-in:checked ~ .xr-array-preview {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-array-in:checked ~ .xr-array-data,\n",
       ".xr-array-preview {\n",
       "  display: inline-block;\n",
       "}\n",
       "\n",
       ".xr-dim-list {\n",
       "  display: inline-block !important;\n",
       "  list-style: none;\n",
       "  padding: 0 !important;\n",
       "  margin: 0;\n",
       "}\n",
       "\n",
       ".xr-dim-list li {\n",
       "  display: inline-block;\n",
       "  padding: 0;\n",
       "  margin: 0;\n",
       "}\n",
       "\n",
       ".xr-dim-list:before {\n",
       "  content: '(';\n",
       "}\n",
       "\n",
       ".xr-dim-list:after {\n",
       "  content: ')';\n",
       "}\n",
       "\n",
       ".xr-dim-list li:not(:last-child):after {\n",
       "  content: ',';\n",
       "  padding-right: 5px;\n",
       "}\n",
       "\n",
       ".xr-has-index {\n",
       "  font-weight: bold;\n",
       "}\n",
       "\n",
       ".xr-var-list,\n",
       ".xr-var-item {\n",
       "  display: contents;\n",
       "}\n",
       "\n",
       ".xr-var-item > div,\n",
       ".xr-var-item label,\n",
       ".xr-var-item > .xr-var-name span {\n",
       "  background-color: var(--xr-background-color-row-even);\n",
       "  margin-bottom: 0;\n",
       "}\n",
       "\n",
       ".xr-var-item > .xr-var-name:hover span {\n",
       "  padding-right: 5px;\n",
       "}\n",
       "\n",
       ".xr-var-list > li:nth-child(odd) > div,\n",
       ".xr-var-list > li:nth-child(odd) > label,\n",
       ".xr-var-list > li:nth-child(odd) > .xr-var-name span {\n",
       "  background-color: var(--xr-background-color-row-odd);\n",
       "}\n",
       "\n",
       ".xr-var-name {\n",
       "  grid-column: 1;\n",
       "}\n",
       "\n",
       ".xr-var-dims {\n",
       "  grid-column: 2;\n",
       "}\n",
       "\n",
       ".xr-var-dtype {\n",
       "  grid-column: 3;\n",
       "  text-align: right;\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-var-preview {\n",
       "  grid-column: 4;\n",
       "}\n",
       "\n",
       ".xr-var-name,\n",
       ".xr-var-dims,\n",
       ".xr-var-dtype,\n",
       ".xr-preview,\n",
       ".xr-attrs dt {\n",
       "  white-space: nowrap;\n",
       "  overflow: hidden;\n",
       "  text-overflow: ellipsis;\n",
       "  padding-right: 10px;\n",
       "}\n",
       "\n",
       ".xr-var-name:hover,\n",
       ".xr-var-dims:hover,\n",
       ".xr-var-dtype:hover,\n",
       ".xr-attrs dt:hover {\n",
       "  overflow: visible;\n",
       "  width: auto;\n",
       "  z-index: 1;\n",
       "}\n",
       "\n",
       ".xr-var-attrs,\n",
       ".xr-var-data {\n",
       "  display: none;\n",
       "  background-color: var(--xr-background-color) !important;\n",
       "  padding-bottom: 5px !important;\n",
       "}\n",
       "\n",
       ".xr-var-attrs-in:checked ~ .xr-var-attrs,\n",
       ".xr-var-data-in:checked ~ .xr-var-data {\n",
       "  display: block;\n",
       "}\n",
       "\n",
       ".xr-var-data > table {\n",
       "  float: right;\n",
       "}\n",
       "\n",
       ".xr-var-name span,\n",
       ".xr-var-data,\n",
       ".xr-attrs {\n",
       "  padding-left: 25px !important;\n",
       "}\n",
       "\n",
       ".xr-attrs,\n",
       ".xr-var-attrs,\n",
       ".xr-var-data {\n",
       "  grid-column: 1 / -1;\n",
       "}\n",
       "\n",
       "dl.xr-attrs {\n",
       "  padding: 0;\n",
       "  margin: 0;\n",
       "  display: grid;\n",
       "  grid-template-columns: 125px auto;\n",
       "}\n",
       "\n",
       ".xr-attrs dt,\n",
       ".xr-attrs dd {\n",
       "  padding: 0;\n",
       "  margin: 0;\n",
       "  float: left;\n",
       "  padding-right: 10px;\n",
       "  width: auto;\n",
       "}\n",
       "\n",
       ".xr-attrs dt {\n",
       "  font-weight: normal;\n",
       "  grid-column: 1;\n",
       "}\n",
       "\n",
       ".xr-attrs dt:hover span {\n",
       "  display: inline-block;\n",
       "  background: var(--xr-background-color);\n",
       "  padding-right: 10px;\n",
       "}\n",
       "\n",
       ".xr-attrs dd {\n",
       "  grid-column: 2;\n",
       "  white-space: pre-wrap;\n",
       "  word-break: break-all;\n",
       "}\n",
       "\n",
       ".xr-icon-database,\n",
       ".xr-icon-file-text2 {\n",
       "  display: inline-block;\n",
       "  vertical-align: middle;\n",
       "  width: 1em;\n",
       "  height: 1.5em !important;\n",
       "  stroke-width: 0;\n",
       "  stroke: currentColor;\n",
       "  fill: currentColor;\n",
       "}\n",
       "</style><pre class='xr-text-repr-fallback'>&lt;xarray.DataArray &#x27;mutual_information&#x27; (x: 9, y: 9)&gt;\n",
       "array([[0.00000000e+00, 2.74757454e-02, 7.79007955e-02, 3.34244341e-01,\n",
       "        2.42224927e-03, 3.84618632e-03, 3.11240332e-03, 0.00000000e+00,\n",
       "        0.00000000e+00],\n",
       "       [2.74757454e-02, 0.00000000e+00, 1.54509182e-01, 7.40373019e-04,\n",
       "        1.50139212e-01, 2.66774661e-01, 4.92915719e-03, 0.00000000e+00,\n",
       "        0.00000000e+00],\n",
       "       [7.79007955e-02, 1.54509182e-01, 0.00000000e+00, 7.48363481e-04,\n",
       "        9.41603438e-03, 8.72144895e-03, 3.15006638e-01, 0.00000000e+00,\n",
       "        0.00000000e+00],\n",
       "       [3.34244341e-01, 7.40373019e-04, 7.48363481e-04, 0.00000000e+00,\n",
       "        5.45436417e-05, 7.33990325e-05, 2.35845118e-05, 0.00000000e+00,\n",
       "        0.00000000e+00],\n",
       "       [2.42224927e-03, 1.50139212e-01, 9.41603438e-03, 5.45436417e-05,\n",
       "        0.00000000e+00, 4.49012987e-01, 2.87003080e-04, 0.00000000e+00,\n",
       "        0.00000000e+00],\n",
       "       [3.84618632e-03, 2.66774661e-01, 8.72144895e-03, 7.33990325e-05,\n",
       "        4.49012987e-01, 0.00000000e+00, 2.74201841e-04, 0.00000000e+00,\n",
       "        0.00000000e+00],\n",
       "       [3.11240332e-03, 4.92915719e-03, 3.15006638e-01, 2.35845118e-05,\n",
       "        2.87003080e-04, 2.74201841e-04, 0.00000000e+00, 0.00000000e+00,\n",
       "        0.00000000e+00],\n",
       "       [0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,\n",
       "        0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,\n",
       "        0.00000000e+00],\n",
       "       [0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,\n",
       "        0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,\n",
       "        0.00000000e+00]])\n",
       "Coordinates:\n",
       "  * x        (x) &lt;U8 &#x27;v_choice&#x27; &#x27;d_gene&#x27; &#x27;j_choice&#x27; ... &#x27;vd_ins&#x27; &#x27;dj_ins&#x27;\n",
       "  * y        (y) &lt;U8 &#x27;v_choice&#x27; &#x27;d_gene&#x27; &#x27;j_choice&#x27; ... &#x27;vd_ins&#x27; &#x27;dj_ins&#x27;</pre><div class='xr-wrap' hidden><div class='xr-header'><div class='xr-obj-type'>xarray.DataArray</div><div class='xr-array-name'>'mutual_information'</div><ul class='xr-dim-list'><li><span class='xr-has-index'>x</span>: 9</li><li><span class='xr-has-index'>y</span>: 9</li></ul></div><ul class='xr-sections'><li class='xr-section-item'><div class='xr-array-wrap'><input id='section-6668fe8e-4038-45ff-96c9-51e3d6e37742' class='xr-array-in' type='checkbox' checked><label for='section-6668fe8e-4038-45ff-96c9-51e3d6e37742' title='Show/hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-array-preview xr-preview'><span>0.0 0.02748 0.0779 0.3342 0.002422 0.003846 ... 0.0 0.0 0.0 0.0 0.0</span></div><div class='xr-array-data'><pre>array([[0.00000000e+00, 2.74757454e-02, 7.79007955e-02, 3.34244341e-01,\n",
       "        2.42224927e-03, 3.84618632e-03, 3.11240332e-03, 0.00000000e+00,\n",
       "        0.00000000e+00],\n",
       "       [2.74757454e-02, 0.00000000e+00, 1.54509182e-01, 7.40373019e-04,\n",
       "        1.50139212e-01, 2.66774661e-01, 4.92915719e-03, 0.00000000e+00,\n",
       "        0.00000000e+00],\n",
       "       [7.79007955e-02, 1.54509182e-01, 0.00000000e+00, 7.48363481e-04,\n",
       "        9.41603438e-03, 8.72144895e-03, 3.15006638e-01, 0.00000000e+00,\n",
       "        0.00000000e+00],\n",
       "       [3.34244341e-01, 7.40373019e-04, 7.48363481e-04, 0.00000000e+00,\n",
       "        5.45436417e-05, 7.33990325e-05, 2.35845118e-05, 0.00000000e+00,\n",
       "        0.00000000e+00],\n",
       "       [2.42224927e-03, 1.50139212e-01, 9.41603438e-03, 5.45436417e-05,\n",
       "        0.00000000e+00, 4.49012987e-01, 2.87003080e-04, 0.00000000e+00,\n",
       "        0.00000000e+00],\n",
       "       [3.84618632e-03, 2.66774661e-01, 8.72144895e-03, 7.33990325e-05,\n",
       "        4.49012987e-01, 0.00000000e+00, 2.74201841e-04, 0.00000000e+00,\n",
       "        0.00000000e+00],\n",
       "       [3.11240332e-03, 4.92915719e-03, 3.15006638e-01, 2.35845118e-05,\n",
       "        2.87003080e-04, 2.74201841e-04, 0.00000000e+00, 0.00000000e+00,\n",
       "        0.00000000e+00],\n",
       "       [0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,\n",
       "        0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,\n",
       "        0.00000000e+00],\n",
       "       [0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,\n",
       "        0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,\n",
       "        0.00000000e+00]])</pre></div></div></li><li class='xr-section-item'><input id='section-c59d2a15-583a-4792-8277-dedce9110806' class='xr-section-summary-in' type='checkbox'  checked><label for='section-c59d2a15-583a-4792-8277-dedce9110806' class='xr-section-summary' >Coordinates: <span>(2)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>x</span></div><div class='xr-var-dims'>(x)</div><div class='xr-var-dtype'>&lt;U8</div><div class='xr-var-preview xr-preview'>&#x27;v_choice&#x27; &#x27;d_gene&#x27; ... &#x27;dj_ins&#x27;</div><input id='attrs-2e0e75c5-540d-41a5-ada1-2b9d232ffab9' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-2e0e75c5-540d-41a5-ada1-2b9d232ffab9' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-a6d530dc-e2f7-4450-8d0a-56325b34d4d7' class='xr-var-data-in' type='checkbox'><label for='data-a6d530dc-e2f7-4450-8d0a-56325b34d4d7' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([&#x27;v_choice&#x27;, &#x27;d_gene&#x27;, &#x27;j_choice&#x27;, &#x27;v_3_del&#x27;, &#x27;d_3_del&#x27;, &#x27;d_5_del&#x27;,\n",
       "       &#x27;j_5_del&#x27;, &#x27;vd_ins&#x27;, &#x27;dj_ins&#x27;], dtype=&#x27;&lt;U8&#x27;)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>y</span></div><div class='xr-var-dims'>(y)</div><div class='xr-var-dtype'>&lt;U8</div><div class='xr-var-preview xr-preview'>&#x27;v_choice&#x27; &#x27;d_gene&#x27; ... &#x27;dj_ins&#x27;</div><input id='attrs-267180a5-75e0-4170-bb9a-be4379c2ad4f' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-267180a5-75e0-4170-bb9a-be4379c2ad4f' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-c9b4056a-c654-479e-9c63-4f1a3b186d9e' class='xr-var-data-in' type='checkbox'><label for='data-c9b4056a-c654-479e-9c63-4f1a3b186d9e' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([&#x27;v_choice&#x27;, &#x27;d_gene&#x27;, &#x27;j_choice&#x27;, &#x27;v_3_del&#x27;, &#x27;d_3_del&#x27;, &#x27;d_5_del&#x27;,\n",
       "       &#x27;j_5_del&#x27;, &#x27;vd_ins&#x27;, &#x27;dj_ins&#x27;], dtype=&#x27;&lt;U8&#x27;)</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-20d01690-a2a8-46d4-988c-c5f0af079f0d' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-20d01690-a2a8-46d4-988c-c5f0af079f0d' class='xr-section-summary'  title='Expand/collapse section'>Attributes: <span>(0)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><dl class='xr-attrs'></dl></div></li></ul></div></div>"
      ],
      "text/plain": [
       "<xarray.DataArray 'mutual_information' (x: 9, y: 9)>\n",
       "array([[0.00000000e+00, 2.74757454e-02, 7.79007955e-02, 3.34244341e-01,\n",
       "        2.42224927e-03, 3.84618632e-03, 3.11240332e-03, 0.00000000e+00,\n",
       "        0.00000000e+00],\n",
       "       [2.74757454e-02, 0.00000000e+00, 1.54509182e-01, 7.40373019e-04,\n",
       "        1.50139212e-01, 2.66774661e-01, 4.92915719e-03, 0.00000000e+00,\n",
       "        0.00000000e+00],\n",
       "       [7.79007955e-02, 1.54509182e-01, 0.00000000e+00, 7.48363481e-04,\n",
       "        9.41603438e-03, 8.72144895e-03, 3.15006638e-01, 0.00000000e+00,\n",
       "        0.00000000e+00],\n",
       "       [3.34244341e-01, 7.40373019e-04, 7.48363481e-04, 0.00000000e+00,\n",
       "        5.45436417e-05, 7.33990325e-05, 2.35845118e-05, 0.00000000e+00,\n",
       "        0.00000000e+00],\n",
       "       [2.42224927e-03, 1.50139212e-01, 9.41603438e-03, 5.45436417e-05,\n",
       "        0.00000000e+00, 4.49012987e-01, 2.87003080e-04, 0.00000000e+00,\n",
       "        0.00000000e+00],\n",
       "       [3.84618632e-03, 2.66774661e-01, 8.72144895e-03, 7.33990325e-05,\n",
       "        4.49012987e-01, 0.00000000e+00, 2.74201841e-04, 0.00000000e+00,\n",
       "        0.00000000e+00],\n",
       "       [3.11240332e-03, 4.92915719e-03, 3.15006638e-01, 2.35845118e-05,\n",
       "        2.87003080e-04, 2.74201841e-04, 0.00000000e+00, 0.00000000e+00,\n",
       "        0.00000000e+00],\n",
       "       [0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,\n",
       "        0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,\n",
       "        0.00000000e+00],\n",
       "       [0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,\n",
       "        0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,\n",
       "        0.00000000e+00]])\n",
       "Coordinates:\n",
       "  * x        (x) <U8 'v_choice' 'd_gene' 'j_choice' ... 'vd_ins' 'dj_ins'\n",
       "  * y        (y) <U8 'v_choice' 'd_gene' 'j_choice' ... 'vd_ins' 'dj_ins'"
      ]
     },
     "execution_count": 46,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "da_mi = mdl_hb.get_mutual_information()\n",
    "da_mi"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<AxesSubplot:>"
      ]
     },
     "execution_count": 47,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "[encoded data, 20192 characters]\n",
      "text/plain": [
       "<Figure size 720x720 with 2 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "mdl_hb.plot_mutual_information(da_mi)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Reading Parms filename from:  /home/olivares/.local/share/igor/models/human/tcr_beta/models/model_parms.txt\n",
      "Reading Marginals filename from:  /home/olivares/.local/share/igor/models/human/tcr_beta/models/model_marginals.txt\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/olivares/anaconda3/envs/statbiophys-dev/lib/python3.7/site-packages/xarray/core/computation.py:739: RuntimeWarning: divide by zero encountered in log2\n",
      "  result_data = func(*input_data)\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div><svg style=\"position: absolute; width: 0; height: 0; overflow: hidden\">\n",
       "<defs>\n",
       "<symbol id=\"icon-database\" viewBox=\"0 0 32 32\">\n",
       "<path d=\"M16 0c-8.837 0-16 2.239-16 5v4c0 2.761 7.163 5 16 5s16-2.239 16-5v-4c0-2.761-7.163-5-16-5z\"></path>\n",
       "<path d=\"M16 17c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
       "<path d=\"M16 26c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
       "</symbol>\n",
       "<symbol id=\"icon-file-text2\" viewBox=\"0 0 32 32\">\n",
       "<path d=\"M28.681 7.159c-0.694-0.947-1.662-2.053-2.724-3.116s-2.169-2.030-3.116-2.724c-1.612-1.182-2.393-1.319-2.841-1.319h-15.5c-1.378 0-2.5 1.121-2.5 2.5v27c0 1.378 1.122 2.5 2.5 2.5h23c1.378 0 2.5-1.122 2.5-2.5v-19.5c0-0.448-0.137-1.23-1.319-2.841zM24.543 5.457c0.959 0.959 1.712 1.825 2.268 2.543h-4.811v-4.811c0.718 0.556 1.584 1.309 2.543 2.268zM28 29.5c0 0.271-0.229 0.5-0.5 0.5h-23c-0.271 0-0.5-0.229-0.5-0.5v-27c0-0.271 0.229-0.5 0.5-0.5 0 0 15.499-0 15.5 0v7c0 0.552 0.448 1 1 1h7v19.5z\"></path>\n",
       "<path d=\"M23 26h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
       "<path d=\"M23 22h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
       "<path d=\"M23 18h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
       "</symbol>\n",
       "</defs>\n",
       "</svg>\n",
       "<style>/* CSS stylesheet for displaying xarray objects in jupyterlab.\n",
       " *\n",
       " */\n",
       "\n",
       ":root {\n",
       "  --xr-font-color0: var(--jp-content-font-color0, rgba(0, 0, 0, 1));\n",
       "  --xr-font-color2: var(--jp-content-font-color2, rgba(0, 0, 0, 0.54));\n",
       "  --xr-font-color3: var(--jp-content-font-color3, rgba(0, 0, 0, 0.38));\n",
       "  --xr-border-color: var(--jp-border-color2, #e0e0e0);\n",
       "  --xr-disabled-color: var(--jp-layout-color3, #bdbdbd);\n",
       "  --xr-background-color: var(--jp-layout-color0, white);\n",
       "  --xr-background-color-row-even: var(--jp-layout-color1, white);\n",
       "  --xr-background-color-row-odd: var(--jp-layout-color2, #eeeeee);\n",
       "}\n",
       "\n",
       "html[theme=dark],\n",
       "body.vscode-dark {\n",
       "  --xr-font-color0: rgba(255, 255, 255, 1);\n",
       "  --xr-font-color2: rgba(255, 255, 255, 0.54);\n",
       "  --xr-font-color3: rgba(255, 255, 255, 0.38);\n",
       "  --xr-border-color: #1F1F1F;\n",
       "  --xr-disabled-color: #515151;\n",
       "  --xr-background-color: #111111;\n",
       "  --xr-background-color-row-even: #111111;\n",
       "  --xr-background-color-row-odd: #313131;\n",
       "}\n",
       "\n",
       ".xr-wrap {\n",
       "  display: block;\n",
       "  min-width: 300px;\n",
       "  max-width: 700px;\n",
       "}\n",
       "\n",
       ".xr-text-repr-fallback {\n",
       "  /* fallback to plain text repr when CSS is not injected (untrusted notebook) */\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-header {\n",
       "  padding-top: 6px;\n",
       "  padding-bottom: 6px;\n",
       "  margin-bottom: 4px;\n",
       "  border-bottom: solid 1px var(--xr-border-color);\n",
       "}\n",
       "\n",
       ".xr-header > div,\n",
       ".xr-header > ul {\n",
       "  display: inline;\n",
       "  margin-top: 0;\n",
       "  margin-bottom: 0;\n",
       "}\n",
       "\n",
       ".xr-obj-type,\n",
       ".xr-array-name {\n",
       "  margin-left: 2px;\n",
       "  margin-right: 10px;\n",
       "}\n",
       "\n",
       ".xr-obj-type {\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-sections {\n",
       "  padding-left: 0 !important;\n",
       "  display: grid;\n",
       "  grid-template-columns: 150px auto auto 1fr 20px 20px;\n",
       "}\n",
       "\n",
       ".xr-section-item {\n",
       "  display: contents;\n",
       "}\n",
       "\n",
       ".xr-section-item input {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-section-item input + label {\n",
       "  color: var(--xr-disabled-color);\n",
       "}\n",
       "\n",
       ".xr-section-item input:enabled + label {\n",
       "  cursor: pointer;\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-section-item input:enabled + label:hover {\n",
       "  color: var(--xr-font-color0);\n",
       "}\n",
       "\n",
       ".xr-section-summary {\n",
       "  grid-column: 1;\n",
       "  color: var(--xr-font-color2);\n",
       "  font-weight: 500;\n",
       "}\n",
       "\n",
       ".xr-section-summary > span {\n",
       "  display: inline-block;\n",
       "  padding-left: 0.5em;\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:disabled + label {\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-section-summary-in + label:before {\n",
       "  display: inline-block;\n",
       "  content: '►';\n",
       "  font-size: 11px;\n",
       "  width: 15px;\n",
       "  text-align: center;\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:disabled + label:before {\n",
       "  color: var(--xr-disabled-color);\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:checked + label:before {\n",
       "  content: '▼';\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:checked + label > span {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-section-summary,\n",
       ".xr-section-inline-details {\n",
       "  padding-top: 4px;\n",
       "  padding-bottom: 4px;\n",
       "}\n",
       "\n",
       ".xr-section-inline-details {\n",
       "  grid-column: 2 / -1;\n",
       "}\n",
       "\n",
       ".xr-section-details {\n",
       "  display: none;\n",
       "  grid-column: 1 / -1;\n",
       "  margin-bottom: 5px;\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:checked ~ .xr-section-details {\n",
       "  display: contents;\n",
       "}\n",
       "\n",
       ".xr-array-wrap {\n",
       "  grid-column: 1 / -1;\n",
       "  display: grid;\n",
       "  grid-template-columns: 20px auto;\n",
       "}\n",
       "\n",
       ".xr-array-wrap > label {\n",
       "  grid-column: 1;\n",
       "  vertical-align: top;\n",
       "}\n",
       "\n",
       ".xr-preview {\n",
       "  color: var(--xr-font-color3);\n",
       "}\n",
       "\n",
       ".xr-array-preview,\n",
       ".xr-array-data {\n",
       "  padding: 0 5px !important;\n",
       "  grid-column: 2;\n",
       "}\n",
       "\n",
       ".xr-array-data,\n",
       ".xr-array-in:checked ~ .xr-array-preview {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-array-in:checked ~ .xr-array-data,\n",
       ".xr-array-preview {\n",
       "  display: inline-block;\n",
       "}\n",
       "\n",
       ".xr-dim-list {\n",
       "  display: inline-block !important;\n",
       "  list-style: none;\n",
       "  padding: 0 !important;\n",
       "  margin: 0;\n",
       "}\n",
       "\n",
       ".xr-dim-list li {\n",
       "  display: inline-block;\n",
       "  padding: 0;\n",
       "  margin: 0;\n",
       "}\n",
       "\n",
       ".xr-dim-list:before {\n",
       "  content: '(';\n",
       "}\n",
       "\n",
       ".xr-dim-list:after {\n",
       "  content: ')';\n",
       "}\n",
       "\n",
       ".xr-dim-list li:not(:last-child):after {\n",
       "  content: ',';\n",
       "  padding-right: 5px;\n",
       "}\n",
       "\n",
       ".xr-has-index {\n",
       "  font-weight: bold;\n",
       "}\n",
       "\n",
       ".xr-var-list,\n",
       ".xr-var-item {\n",
       "  display: contents;\n",
       "}\n",
       "\n",
       ".xr-var-item > div,\n",
       ".xr-var-item label,\n",
       ".xr-var-item > .xr-var-name span {\n",
       "  background-color: var(--xr-background-color-row-even);\n",
       "  margin-bottom: 0;\n",
       "}\n",
       "\n",
       ".xr-var-item > .xr-var-name:hover span {\n",
       "  padding-right: 5px;\n",
       "}\n",
       "\n",
       ".xr-var-list > li:nth-child(odd) > div,\n",
       ".xr-var-list > li:nth-child(odd) > label,\n",
       ".xr-var-list > li:nth-child(odd) > .xr-var-name span {\n",
       "  background-color: var(--xr-background-color-row-odd);\n",
       "}\n",
       "\n",
       ".xr-var-name {\n",
       "  grid-column: 1;\n",
       "}\n",
       "\n",
       ".xr-var-dims {\n",
       "  grid-column: 2;\n",
       "}\n",
       "\n",
       ".xr-var-dtype {\n",
       "  grid-column: 3;\n",
       "  text-align: right;\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-var-preview {\n",
       "  grid-column: 4;\n",
       "}\n",
       "\n",
       ".xr-var-name,\n",
       ".xr-var-dims,\n",
       ".xr-var-dtype,\n",
       ".xr-preview,\n",
       ".xr-attrs dt {\n",
       "  white-space: nowrap;\n",
       "  overflow: hidden;\n",
       "  text-overflow: ellipsis;\n",
       "  padding-right: 10px;\n",
       "}\n",
       "\n",
       ".xr-var-name:hover,\n",
       ".xr-var-dims:hover,\n",
       ".xr-var-dtype:hover,\n",
       ".xr-attrs dt:hover {\n",
       "  overflow: visible;\n",
       "  width: auto;\n",
       "  z-index: 1;\n",
       "}\n",
       "\n",
       ".xr-var-attrs,\n",
       ".xr-var-data {\n",
       "  display: none;\n",
       "  background-color: var(--xr-background-color) !important;\n",
       "  padding-bottom: 5px !important;\n",
       "}\n",
       "\n",
       ".xr-var-attrs-in:checked ~ .xr-var-attrs,\n",
       ".xr-var-data-in:checked ~ .xr-var-data {\n",
       "  display: block;\n",
       "}\n",
       "\n",
       ".xr-var-data > table {\n",
       "  float: right;\n",
       "}\n",
       "\n",
       ".xr-var-name span,\n",
       ".xr-var-data,\n",
       ".xr-attrs {\n",
       "  padding-left: 25px !important;\n",
       "}\n",
       "\n",
       ".xr-attrs,\n",
       ".xr-var-attrs,\n",
       ".xr-var-data {\n",
       "  grid-column: 1 / -1;\n",
       "}\n",
       "\n",
       "dl.xr-attrs {\n",
       "  padding: 0;\n",
       "  margin: 0;\n",
       "  display: grid;\n",
       "  grid-template-columns: 125px auto;\n",
       "}\n",
       "\n",
       ".xr-attrs dt,\n",
       ".xr-attrs dd {\n",
       "  padding: 0;\n",
       "  margin: 0;\n",
       "  float: left;\n",
       "  padding-right: 10px;\n",
       "  width: auto;\n",
       "}\n",
       "\n",
       ".xr-attrs dt {\n",
       "  font-weight: normal;\n",
       "  grid-column: 1;\n",
       "}\n",
       "\n",
       ".xr-attrs dt:hover span {\n",
       "  display: inline-block;\n",
       "  background: var(--xr-background-color);\n",
       "  padding-right: 10px;\n",
       "}\n",
       "\n",
       ".xr-attrs dd {\n",
       "  grid-column: 2;\n",
       "  white-space: pre-wrap;\n",
       "  word-break: break-all;\n",
       "}\n",
       "\n",
       ".xr-icon-database,\n",
       ".xr-icon-file-text2 {\n",
       "  display: inline-block;\n",
       "  vertical-align: middle;\n",
       "  width: 1em;\n",
       "  height: 1.5em !important;\n",
       "  stroke-width: 0;\n",
       "  stroke: currentColor;\n",
       "  fill: currentColor;\n",
       "}\n",
       "</style><pre class='xr-text-repr-fallback'>&lt;xarray.DataArray ()&gt;\n",
       "array(0.0779008)</pre><div class='xr-wrap' hidden><div class='xr-header'><div class='xr-obj-type'>xarray.DataArray</div><div class='xr-array-name'></div></div><ul class='xr-sections'><li class='xr-section-item'><div class='xr-array-wrap'><input id='section-56b7bbef-f8d7-41e9-bce7-338c9d727434' class='xr-array-in' type='checkbox' checked><label for='section-56b7bbef-f8d7-41e9-bce7-338c9d727434' title='Show/hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-array-preview xr-preview'><span>0.0779</span></div><div class='xr-array-data'><pre>array(0.0779008)</pre></div></div></li><li class='xr-section-item'><input id='section-fbc1ba12-eff6-40cc-9876-b45a1bb33c21' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-fbc1ba12-eff6-40cc-9876-b45a1bb33c21' class='xr-section-summary'  title='Expand/collapse section'>Coordinates: <span>(0)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'></ul></div></li><li class='xr-section-item'><input id='section-99d2cab5-035f-447c-ad4a-9fea7fd94079' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-99d2cab5-035f-447c-ad4a-9fea7fd94079' class='xr-section-summary'  title='Expand/collapse section'>Attributes: <span>(0)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><dl class='xr-attrs'></dl></div></li></ul></div></div>"
      ],
      "text/plain": [
       "<xarray.DataArray ()>\n",
       "array(0.0779008)"
      ]
     },
     "execution_count": 48,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "event_nickname1 = 'v_choice'\n",
    "event_nickname2 = 'j_choice'\n",
    "\n",
    "mdl = p3.get_default_IgorModel(\"human\", \"tcr_beta\")\n",
    "\n",
    "da_P_x_y = mdl.get_P_joint([event_nickname1, event_nickname2])\n",
    "da_P_x = mdl.Pmarginal[event_nickname1]\n",
    "da_P_y = mdl.Pmarginal[event_nickname2]\n",
    "\n",
    "da_P_x_times_P_y = (da_P_x*da_P_y)\n",
    "da_P_x_times_P_y\n",
    "\n",
    "da_log_P_ratio = xr.zeros_like(da_P_x_y)\n",
    "\n",
    "da_log_P_ratio.values = np.nan_to_num(\n",
    "    np.log2(da_P_x_y / da_P_x_times_P_y), nan=0.0, neginf=0.0\n",
    ")\n",
    "\n",
    "# da_log_Value.values = np_log_Value\n",
    "xr.dot( da_P_x_y, da_log_P_ratio )"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/olivares/anaconda3/envs/statbiophys-dev/lib/python3.7/site-packages/xarray/core/computation.py:739: RuntimeWarning: divide by zero encountered in log2\n",
      "  result_data = func(*input_data)\n",
      "/home/olivares/anaconda3/envs/statbiophys-dev/lib/python3.7/site-packages/xarray/core/computation.py:739: RuntimeWarning: divide by zero encountered in log2\n",
      "  result_data = func(*input_data)\n",
      "/home/olivares/anaconda3/envs/statbiophys-dev/lib/python3.7/site-packages/xarray/core/computation.py:739: RuntimeWarning: divide by zero encountered in log2\n",
      "  result_data = func(*input_data)\n",
      "/home/olivares/anaconda3/envs/statbiophys-dev/lib/python3.7/site-packages/xarray/core/computation.py:739: RuntimeWarning: divide by zero encountered in log2\n",
      "  result_data = func(*input_data)\n",
      "/home/olivares/anaconda3/envs/statbiophys-dev/lib/python3.7/site-packages/xarray/core/computation.py:739: RuntimeWarning: divide by zero encountered in log2\n",
      "  result_data = func(*input_data)\n",
      "/home/olivares/anaconda3/envs/statbiophys-dev/lib/python3.7/site-packages/xarray/core/computation.py:739: RuntimeWarning: divide by zero encountered in log2\n",
      "  result_data = func(*input_data)\n",
      "/home/olivares/anaconda3/envs/statbiophys-dev/lib/python3.7/site-packages/xarray/core/computation.py:739: RuntimeWarning: divide by zero encountered in log2\n",
      "  result_data = func(*input_data)\n",
      "/home/olivares/anaconda3/envs/statbiophys-dev/lib/python3.7/site-packages/xarray/core/computation.py:739: RuntimeWarning: divide by zero encountered in log2\n",
      "  result_data = func(*input_data)\n"
     ]
    }
   ],
   "source": [
    "da_mi = mdl_hb.get_mutual_information()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<AxesSubplot:>"
      ]
     },
     "execution_count": 50,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "[encoded data, 20192 characters]\n",
      "text/plain": [
       "<Figure size 720x720 with 2 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "mdl_hb.plot_mutual_information(da_mi)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/olivares/anaconda3/envs/statbiophys-dev/lib/python3.7/site-packages/xarray/core/computation.py:739: RuntimeWarning: divide by zero encountered in log2\n",
      "  result_data = func(*input_data)\n",
      "/home/olivares/anaconda3/envs/statbiophys-dev/lib/python3.7/site-packages/xarray/core/computation.py:739: RuntimeWarning: divide by zero encountered in log2\n",
      "  result_data = func(*input_data)\n",
      "/home/olivares/anaconda3/envs/statbiophys-dev/lib/python3.7/site-packages/xarray/core/computation.py:739: RuntimeWarning: divide by zero encountered in log2\n",
      "  result_data = func(*input_data)\n",
      "/home/olivares/anaconda3/envs/statbiophys-dev/lib/python3.7/site-packages/xarray/core/computation.py:739: RuntimeWarning: divide by zero encountered in log2\n",
      "  result_data = func(*input_data)\n",
      "/home/olivares/anaconda3/envs/statbiophys-dev/lib/python3.7/site-packages/xarray/core/computation.py:739: RuntimeWarning: divide by zero encountered in log2\n",
      "  result_data = func(*input_data)\n",
      "/home/olivares/anaconda3/envs/statbiophys-dev/lib/python3.7/site-packages/xarray/core/computation.py:739: RuntimeWarning: divide by zero encountered in log2\n",
      "  result_data = func(*input_data)\n",
      "/home/olivares/anaconda3/envs/statbiophys-dev/lib/python3.7/site-packages/xarray/core/computation.py:739: RuntimeWarning: divide by zero encountered in log2\n",
      "  result_data = func(*input_data)\n",
      "/home/olivares/anaconda3/envs/statbiophys-dev/lib/python3.7/site-packages/xarray/core/computation.py:739: RuntimeWarning: divide by zero encountered in log2\n",
      "  result_data = func(*input_data)\n"
     ]
    }
   ],
   "source": [
    "da_mi = mdl_hb.get_mutual_information()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<AxesSubplot:>"
      ]
     },
     "execution_count": 52,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "[encoded data, 20192 characters]\n",
      "text/plain": [
       "<Figure size 720x720 with 2 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "mdl_hb.plot_mutual_information(da_mi)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "As can be seen in the Bayesian network, the number of deletions in V depends on choosen V"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Select events by probability"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Here we can see which combinations of V and D are not possible, for our model"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "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></th>\n",
       "      <th>lbl__v_choice</th>\n",
       "      <th>seq__v_choice</th>\n",
       "      <th>lbl__d_gene</th>\n",
       "      <th>seq__d_gene</th>\n",
       "      <th>P_joint_V_D</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>v_choice</th>\n",
       "      <th>d_gene</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th rowspan=\"3\" valign=\"top\">22</th>\n",
       "      <th>0</th>\n",
       "      <td>TRBV15*03</td>\n",
       "      <td>GATGCCATGGTCATCCAGAACCCAAGATACCGGGTTACCCAGTTTG...</td>\n",
       "      <td>TRBD1*01</td>\n",
       "      <td>GGGACAGGGGGC</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>TRBV15*03</td>\n",
       "      <td>GATGCCATGGTCATCCAGAACCCAAGATACCGGGTTACCCAGTTTG...</td>\n",
       "      <td>TRBD2*01</td>\n",
       "      <td>GGGACTAGCGGGGGGG</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>TRBV15*03</td>\n",
       "      <td>GATGCCATGGTCATCCAGAACCCAAGATACCGGGTTACCCAGTTTG...</td>\n",
       "      <td>TRBD2*02</td>\n",
       "      <td>GGGACTAGCGGGAGGG</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"3\" valign=\"top\">24</th>\n",
       "      <th>0</th>\n",
       "      <td>TRBV17*01</td>\n",
       "      <td>GAGCCTGGAGTCAGCCAGACCCCCAGACACAAGGTCACCAACATGG...</td>\n",
       "      <td>TRBD1*01</td>\n",
       "      <td>GGGACAGGGGGC</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>TRBV17*01</td>\n",
       "      <td>GAGCCTGGAGTCAGCCAGACCCCCAGACACAAGGTCACCAACATGG...</td>\n",
       "      <td>TRBD2*01</td>\n",
       "      <td>GGGACTAGCGGGGGGG</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>TRBV17*01</td>\n",
       "      <td>GAGCCTGGAGTCAGCCAGACCCCCAGACACAAGGTCACCAACATGG...</td>\n",
       "      <td>TRBD2*02</td>\n",
       "      <td>GGGACTAGCGGGAGGG</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"2\" valign=\"top\">33</th>\n",
       "      <th>1</th>\n",
       "      <td>TRBV26*01</td>\n",
       "      <td>GATGCTGTAGTTACACAATTCCCAAGACACAGAATCATTGGGACAG...</td>\n",
       "      <td>TRBD2*01</td>\n",
       "      <td>GGGACTAGCGGGGGGG</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>TRBV26*01</td>\n",
       "      <td>GATGCTGTAGTTACACAATTCCCAAGACACAGAATCATTGGGACAG...</td>\n",
       "      <td>TRBD2*02</td>\n",
       "      <td>GGGACTAGCGGGAGGG</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"2\" valign=\"top\">67</th>\n",
       "      <th>0</th>\n",
       "      <td>TRBV6-9*01</td>\n",
       "      <td>AATGCTGGTGTCACTCAGACCCCAAAATTCCACATCCTGAAGACAG...</td>\n",
       "      <td>TRBD1*01</td>\n",
       "      <td>GGGACAGGGGGC</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>TRBV6-9*01</td>\n",
       "      <td>AATGCTGGTGTCACTCAGACCCCAAAATTCCACATCCTGAAGACAG...</td>\n",
       "      <td>TRBD2*02</td>\n",
       "      <td>GGGACTAGCGGGAGGG</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"3\" valign=\"top\">71</th>\n",
       "      <th>0</th>\n",
       "      <td>TRBV7-2*03</td>\n",
       "      <td>GCTGGAGTCTCCCAGTCCCCCAGTAACAAGGTCACAGAGAAGGGAA...</td>\n",
       "      <td>TRBD1*01</td>\n",
       "      <td>GGGACAGGGGGC</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>TRBV7-2*03</td>\n",
       "      <td>GCTGGAGTCTCCCAGTCCCCCAGTAACAAGGTCACAGAGAAGGGAA...</td>\n",
       "      <td>TRBD2*01</td>\n",
       "      <td>GGGACTAGCGGGGGGG</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>TRBV7-2*03</td>\n",
       "      <td>GCTGGAGTCTCCCAGTCCCCCAGTAACAAGGTCACAGAGAAGGGAA...</td>\n",
       "      <td>TRBD2*02</td>\n",
       "      <td>GGGACTAGCGGGAGGG</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"3\" valign=\"top\">74</th>\n",
       "      <th>0</th>\n",
       "      <td>TRBV7-3*02</td>\n",
       "      <td>GGTGCTGGAGTCTCCCAGACCCCCAGTAACAAGGTCACAGAGAAGG...</td>\n",
       "      <td>TRBD1*01</td>\n",
       "      <td>GGGACAGGGGGC</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>TRBV7-3*02</td>\n",
       "      <td>GGTGCTGGAGTCTCCCAGACCCCCAGTAACAAGGTCACAGAGAAGG...</td>\n",
       "      <td>TRBD2*01</td>\n",
       "      <td>GGGACTAGCGGGGGGG</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>TRBV7-3*02</td>\n",
       "      <td>GGTGCTGGAGTCTCCCAGACCCCCAGTAACAAGGTCACAGAGAAGG...</td>\n",
       "      <td>TRBD2*02</td>\n",
       "      <td>GGGACTAGCGGGAGGG</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"3\" valign=\"top\">75</th>\n",
       "      <th>0</th>\n",
       "      <td>TRBV7-3*03</td>\n",
       "      <td>GGTGCTGGAGTCTCCCAGACCCCCAGTAACAAGGTCACAGAGAAGG...</td>\n",
       "      <td>TRBD1*01</td>\n",
       "      <td>GGGACAGGGGGC</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>TRBV7-3*03</td>\n",
       "      <td>GGTGCTGGAGTCTCCCAGACCCCCAGTAACAAGGTCACAGAGAAGG...</td>\n",
       "      <td>TRBD2*01</td>\n",
       "      <td>GGGACTAGCGGGGGGG</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>TRBV7-3*03</td>\n",
       "      <td>GGTGCTGGAGTCTCCCAGACCCCCAGTAACAAGGTCACAGAGAAGG...</td>\n",
       "      <td>TRBD2*02</td>\n",
       "      <td>GGGACTAGCGGGAGGG</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                lbl__v_choice  \\\n",
       "v_choice d_gene                 \n",
       "22       0          TRBV15*03   \n",
       "         1          TRBV15*03   \n",
       "         2          TRBV15*03   \n",
       "24       0          TRBV17*01   \n",
       "         1          TRBV17*01   \n",
       "         2          TRBV17*01   \n",
       "33       1          TRBV26*01   \n",
       "         2          TRBV26*01   \n",
       "67       0         TRBV6-9*01   \n",
       "         2         TRBV6-9*01   \n",
       "71       0         TRBV7-2*03   \n",
       "         1         TRBV7-2*03   \n",
       "         2         TRBV7-2*03   \n",
       "74       0         TRBV7-3*02   \n",
       "         1         TRBV7-3*02   \n",
       "         2         TRBV7-3*02   \n",
       "75       0         TRBV7-3*03   \n",
       "         1         TRBV7-3*03   \n",
       "         2         TRBV7-3*03   \n",
       "\n",
       "                                                     seq__v_choice  \\\n",
       "v_choice d_gene                                                      \n",
       "22       0       GATGCCATGGTCATCCAGAACCCAAGATACCGGGTTACCCAGTTTG...   \n",
       "         1       GATGCCATGGTCATCCAGAACCCAAGATACCGGGTTACCCAGTTTG...   \n",
       "         2       GATGCCATGGTCATCCAGAACCCAAGATACCGGGTTACCCAGTTTG...   \n",
       "24       0       GAGCCTGGAGTCAGCCAGACCCCCAGACACAAGGTCACCAACATGG...   \n",
       "         1       GAGCCTGGAGTCAGCCAGACCCCCAGACACAAGGTCACCAACATGG...   \n",
       "         2       GAGCCTGGAGTCAGCCAGACCCCCAGACACAAGGTCACCAACATGG...   \n",
       "33       1       GATGCTGTAGTTACACAATTCCCAAGACACAGAATCATTGGGACAG...   \n",
       "         2       GATGCTGTAGTTACACAATTCCCAAGACACAGAATCATTGGGACAG...   \n",
       "67       0       AATGCTGGTGTCACTCAGACCCCAAAATTCCACATCCTGAAGACAG...   \n",
       "         2       AATGCTGGTGTCACTCAGACCCCAAAATTCCACATCCTGAAGACAG...   \n",
       "71       0       GCTGGAGTCTCCCAGTCCCCCAGTAACAAGGTCACAGAGAAGGGAA...   \n",
       "         1       GCTGGAGTCTCCCAGTCCCCCAGTAACAAGGTCACAGAGAAGGGAA...   \n",
       "         2       GCTGGAGTCTCCCAGTCCCCCAGTAACAAGGTCACAGAGAAGGGAA...   \n",
       "74       0       GGTGCTGGAGTCTCCCAGACCCCCAGTAACAAGGTCACAGAGAAGG...   \n",
       "         1       GGTGCTGGAGTCTCCCAGACCCCCAGTAACAAGGTCACAGAGAAGG...   \n",
       "         2       GGTGCTGGAGTCTCCCAGACCCCCAGTAACAAGGTCACAGAGAAGG...   \n",
       "75       0       GGTGCTGGAGTCTCCCAGACCCCCAGTAACAAGGTCACAGAGAAGG...   \n",
       "         1       GGTGCTGGAGTCTCCCAGACCCCCAGTAACAAGGTCACAGAGAAGG...   \n",
       "         2       GGTGCTGGAGTCTCCCAGACCCCCAGTAACAAGGTCACAGAGAAGG...   \n",
       "\n",
       "                lbl__d_gene       seq__d_gene  P_joint_V_D  \n",
       "v_choice d_gene                                             \n",
       "22       0         TRBD1*01      GGGACAGGGGGC          0.0  \n",
       "         1         TRBD2*01  GGGACTAGCGGGGGGG          0.0  \n",
       "         2         TRBD2*02  GGGACTAGCGGGAGGG          0.0  \n",
       "24       0         TRBD1*01      GGGACAGGGGGC          0.0  \n",
       "         1         TRBD2*01  GGGACTAGCGGGGGGG          0.0  \n",
       "         2         TRBD2*02  GGGACTAGCGGGAGGG          0.0  \n",
       "33       1         TRBD2*01  GGGACTAGCGGGGGGG          0.0  \n",
       "         2         TRBD2*02  GGGACTAGCGGGAGGG          0.0  \n",
       "67       0         TRBD1*01      GGGACAGGGGGC          0.0  \n",
       "         2         TRBD2*02  GGGACTAGCGGGAGGG          0.0  \n",
       "71       0         TRBD1*01      GGGACAGGGGGC          0.0  \n",
       "         1         TRBD2*01  GGGACTAGCGGGGGGG          0.0  \n",
       "         2         TRBD2*02  GGGACTAGCGGGAGGG          0.0  \n",
       "74       0         TRBD1*01      GGGACAGGGGGC          0.0  \n",
       "         1         TRBD2*01  GGGACTAGCGGGGGGG          0.0  \n",
       "         2         TRBD2*02  GGGACTAGCGGGAGGG          0.0  \n",
       "75       0         TRBD1*01      GGGACAGGGGGC          0.0  \n",
       "         1         TRBD2*01  GGGACTAGCGGGGGGG          0.0  \n",
       "         2         TRBD2*02  GGGACTAGCGGGAGGG          0.0  "
      ]
     },
     "execution_count": 53,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Pjoint_V_D = mdl_hb.get_P_joint(['v_choice', 'd_gene'])\n",
    "\n",
    "da_tmp = Pjoint_V_D.where(Pjoint_V_D == 0)\n",
    "\n",
    "df = da_tmp.to_dataframe('P_joint_V_D').dropna()\n",
    "df #.to_csv('bibibi.csv', sep=';')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><svg style=\"position: absolute; width: 0; height: 0; overflow: hidden\">\n",
       "<defs>\n",
       "<symbol id=\"icon-database\" viewBox=\"0 0 32 32\">\n",
       "<path d=\"M16 0c-8.837 0-16 2.239-16 5v4c0 2.761 7.163 5 16 5s16-2.239 16-5v-4c0-2.761-7.163-5-16-5z\"></path>\n",
       "<path d=\"M16 17c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
       "<path d=\"M16 26c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
       "</symbol>\n",
       "<symbol id=\"icon-file-text2\" viewBox=\"0 0 32 32\">\n",
       "<path d=\"M28.681 7.159c-0.694-0.947-1.662-2.053-2.724-3.116s-2.169-2.030-3.116-2.724c-1.612-1.182-2.393-1.319-2.841-1.319h-15.5c-1.378 0-2.5 1.121-2.5 2.5v27c0 1.378 1.122 2.5 2.5 2.5h23c1.378 0 2.5-1.122 2.5-2.5v-19.5c0-0.448-0.137-1.23-1.319-2.841zM24.543 5.457c0.959 0.959 1.712 1.825 2.268 2.543h-4.811v-4.811c0.718 0.556 1.584 1.309 2.543 2.268zM28 29.5c0 0.271-0.229 0.5-0.5 0.5h-23c-0.271 0-0.5-0.229-0.5-0.5v-27c0-0.271 0.229-0.5 0.5-0.5 0 0 15.499-0 15.5 0v7c0 0.552 0.448 1 1 1h7v19.5z\"></path>\n",
       "<path d=\"M23 26h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
       "<path d=\"M23 22h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
       "<path d=\"M23 18h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
       "</symbol>\n",
       "</defs>\n",
       "</svg>\n",
       "<style>/* CSS stylesheet for displaying xarray objects in jupyterlab.\n",
       " *\n",
       " */\n",
       "\n",
       ":root {\n",
       "  --xr-font-color0: var(--jp-content-font-color0, rgba(0, 0, 0, 1));\n",
       "  --xr-font-color2: var(--jp-content-font-color2, rgba(0, 0, 0, 0.54));\n",
       "  --xr-font-color3: var(--jp-content-font-color3, rgba(0, 0, 0, 0.38));\n",
       "  --xr-border-color: var(--jp-border-color2, #e0e0e0);\n",
       "  --xr-disabled-color: var(--jp-layout-color3, #bdbdbd);\n",
       "  --xr-background-color: var(--jp-layout-color0, white);\n",
       "  --xr-background-color-row-even: var(--jp-layout-color1, white);\n",
       "  --xr-background-color-row-odd: var(--jp-layout-color2, #eeeeee);\n",
       "}\n",
       "\n",
       "html[theme=dark],\n",
       "body.vscode-dark {\n",
       "  --xr-font-color0: rgba(255, 255, 255, 1);\n",
       "  --xr-font-color2: rgba(255, 255, 255, 0.54);\n",
       "  --xr-font-color3: rgba(255, 255, 255, 0.38);\n",
       "  --xr-border-color: #1F1F1F;\n",
       "  --xr-disabled-color: #515151;\n",
       "  --xr-background-color: #111111;\n",
       "  --xr-background-color-row-even: #111111;\n",
       "  --xr-background-color-row-odd: #313131;\n",
       "}\n",
       "\n",
       ".xr-wrap {\n",
       "  display: block;\n",
       "  min-width: 300px;\n",
       "  max-width: 700px;\n",
       "}\n",
       "\n",
       ".xr-text-repr-fallback {\n",
       "  /* fallback to plain text repr when CSS is not injected (untrusted notebook) */\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-header {\n",
       "  padding-top: 6px;\n",
       "  padding-bottom: 6px;\n",
       "  margin-bottom: 4px;\n",
       "  border-bottom: solid 1px var(--xr-border-color);\n",
       "}\n",
       "\n",
       ".xr-header > div,\n",
       ".xr-header > ul {\n",
       "  display: inline;\n",
       "  margin-top: 0;\n",
       "  margin-bottom: 0;\n",
       "}\n",
       "\n",
       ".xr-obj-type,\n",
       ".xr-array-name {\n",
       "  margin-left: 2px;\n",
       "  margin-right: 10px;\n",
       "}\n",
       "\n",
       ".xr-obj-type {\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-sections {\n",
       "  padding-left: 0 !important;\n",
       "  display: grid;\n",
       "  grid-template-columns: 150px auto auto 1fr 20px 20px;\n",
       "}\n",
       "\n",
       ".xr-section-item {\n",
       "  display: contents;\n",
       "}\n",
       "\n",
       ".xr-section-item input {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-section-item input + label {\n",
       "  color: var(--xr-disabled-color);\n",
       "}\n",
       "\n",
       ".xr-section-item input:enabled + label {\n",
       "  cursor: pointer;\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-section-item input:enabled + label:hover {\n",
       "  color: var(--xr-font-color0);\n",
       "}\n",
       "\n",
       ".xr-section-summary {\n",
       "  grid-column: 1;\n",
       "  color: var(--xr-font-color2);\n",
       "  font-weight: 500;\n",
       "}\n",
       "\n",
       ".xr-section-summary > span {\n",
       "  display: inline-block;\n",
       "  padding-left: 0.5em;\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:disabled + label {\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-section-summary-in + label:before {\n",
       "  display: inline-block;\n",
       "  content: '►';\n",
       "  font-size: 11px;\n",
       "  width: 15px;\n",
       "  text-align: center;\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:disabled + label:before {\n",
       "  color: var(--xr-disabled-color);\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:checked + label:before {\n",
       "  content: '▼';\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:checked + label > span {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-section-summary,\n",
       ".xr-section-inline-details {\n",
       "  padding-top: 4px;\n",
       "  padding-bottom: 4px;\n",
       "}\n",
       "\n",
       ".xr-section-inline-details {\n",
       "  grid-column: 2 / -1;\n",
       "}\n",
       "\n",
       ".xr-section-details {\n",
       "  display: none;\n",
       "  grid-column: 1 / -1;\n",
       "  margin-bottom: 5px;\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:checked ~ .xr-section-details {\n",
       "  display: contents;\n",
       "}\n",
       "\n",
       ".xr-array-wrap {\n",
       "  grid-column: 1 / -1;\n",
       "  display: grid;\n",
       "  grid-template-columns: 20px auto;\n",
       "}\n",
       "\n",
       ".xr-array-wrap > label {\n",
       "  grid-column: 1;\n",
       "  vertical-align: top;\n",
       "}\n",
       "\n",
       ".xr-preview {\n",
       "  color: var(--xr-font-color3);\n",
       "}\n",
       "\n",
       ".xr-array-preview,\n",
       ".xr-array-data {\n",
       "  padding: 0 5px !important;\n",
       "  grid-column: 2;\n",
       "}\n",
       "\n",
       ".xr-array-data,\n",
       ".xr-array-in:checked ~ .xr-array-preview {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-array-in:checked ~ .xr-array-data,\n",
       ".xr-array-preview {\n",
       "  display: inline-block;\n",
       "}\n",
       "\n",
       ".xr-dim-list {\n",
       "  display: inline-block !important;\n",
       "  list-style: none;\n",
       "  padding: 0 !important;\n",
       "  margin: 0;\n",
       "}\n",
       "\n",
       ".xr-dim-list li {\n",
       "  display: inline-block;\n",
       "  padding: 0;\n",
       "  margin: 0;\n",
       "}\n",
       "\n",
       ".xr-dim-list:before {\n",
       "  content: '(';\n",
       "}\n",
       "\n",
       ".xr-dim-list:after {\n",
       "  content: ')';\n",
       "}\n",
       "\n",
       ".xr-dim-list li:not(:last-child):after {\n",
       "  content: ',';\n",
       "  padding-right: 5px;\n",
       "}\n",
       "\n",
       ".xr-has-index {\n",
       "  font-weight: bold;\n",
       "}\n",
       "\n",
       ".xr-var-list,\n",
       ".xr-var-item {\n",
       "  display: contents;\n",
       "}\n",
       "\n",
       ".xr-var-item > div,\n",
       ".xr-var-item label,\n",
       ".xr-var-item > .xr-var-name span {\n",
       "  background-color: var(--xr-background-color-row-even);\n",
       "  margin-bottom: 0;\n",
       "}\n",
       "\n",
       ".xr-var-item > .xr-var-name:hover span {\n",
       "  padding-right: 5px;\n",
       "}\n",
       "\n",
       ".xr-var-list > li:nth-child(odd) > div,\n",
       ".xr-var-list > li:nth-child(odd) > label,\n",
       ".xr-var-list > li:nth-child(odd) > .xr-var-name span {\n",
       "  background-color: var(--xr-background-color-row-odd);\n",
       "}\n",
       "\n",
       ".xr-var-name {\n",
       "  grid-column: 1;\n",
       "}\n",
       "\n",
       ".xr-var-dims {\n",
       "  grid-column: 2;\n",
       "}\n",
       "\n",
       ".xr-var-dtype {\n",
       "  grid-column: 3;\n",
       "  text-align: right;\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-var-preview {\n",
       "  grid-column: 4;\n",
       "}\n",
       "\n",
       ".xr-var-name,\n",
       ".xr-var-dims,\n",
       ".xr-var-dtype,\n",
       ".xr-preview,\n",
       ".xr-attrs dt {\n",
       "  white-space: nowrap;\n",
       "  overflow: hidden;\n",
       "  text-overflow: ellipsis;\n",
       "  padding-right: 10px;\n",
       "}\n",
       "\n",
       ".xr-var-name:hover,\n",
       ".xr-var-dims:hover,\n",
       ".xr-var-dtype:hover,\n",
       ".xr-attrs dt:hover {\n",
       "  overflow: visible;\n",
       "  width: auto;\n",
       "  z-index: 1;\n",
       "}\n",
       "\n",
       ".xr-var-attrs,\n",
       ".xr-var-data {\n",
       "  display: none;\n",
       "  background-color: var(--xr-background-color) !important;\n",
       "  padding-bottom: 5px !important;\n",
       "}\n",
       "\n",
       ".xr-var-attrs-in:checked ~ .xr-var-attrs,\n",
       ".xr-var-data-in:checked ~ .xr-var-data {\n",
       "  display: block;\n",
       "}\n",
       "\n",
       ".xr-var-data > table {\n",
       "  float: right;\n",
       "}\n",
       "\n",
       ".xr-var-name span,\n",
       ".xr-var-data,\n",
       ".xr-attrs {\n",
       "  padding-left: 25px !important;\n",
       "}\n",
       "\n",
       ".xr-attrs,\n",
       ".xr-var-attrs,\n",
       ".xr-var-data {\n",
       "  grid-column: 1 / -1;\n",
       "}\n",
       "\n",
       "dl.xr-attrs {\n",
       "  padding: 0;\n",
       "  margin: 0;\n",
       "  display: grid;\n",
       "  grid-template-columns: 125px auto;\n",
       "}\n",
       "\n",
       ".xr-attrs dt,\n",
       ".xr-attrs dd {\n",
       "  padding: 0;\n",
       "  margin: 0;\n",
       "  float: left;\n",
       "  padding-right: 10px;\n",
       "  width: auto;\n",
       "}\n",
       "\n",
       ".xr-attrs dt {\n",
       "  font-weight: normal;\n",
       "  grid-column: 1;\n",
       "}\n",
       "\n",
       ".xr-attrs dt:hover span {\n",
       "  display: inline-block;\n",
       "  background: var(--xr-background-color);\n",
       "  padding-right: 10px;\n",
       "}\n",
       "\n",
       ".xr-attrs dd {\n",
       "  grid-column: 2;\n",
       "  white-space: pre-wrap;\n",
       "  word-break: break-all;\n",
       "}\n",
       "\n",
       ".xr-icon-database,\n",
       ".xr-icon-file-text2 {\n",
       "  display: inline-block;\n",
       "  vertical-align: middle;\n",
       "  width: 1em;\n",
       "  height: 1.5em !important;\n",
       "  stroke-width: 0;\n",
       "  stroke: currentColor;\n",
       "  fill: currentColor;\n",
       "}\n",
       "</style><pre class='xr-text-repr-fallback'>&lt;xarray.DataArray ()&gt;\n",
       "array(0.)\n",
       "Coordinates:\n",
       "    v_choice       int64 22\n",
       "    lbl__v_choice  object &#x27;TRBV15*03&#x27;\n",
       "    seq__v_choice  object &#x27;GATGCCATGGTCATCCAGAACCCAAGATACCGGGTTACCCAGTTTGGAAA...\n",
       "Attributes:\n",
       "    nickname:    v_choice\n",
       "    event_type:  GeneChoice\n",
       "    seq_type:    V_gene\n",
       "    seq_side:    Undefined_side\n",
       "    priority:    7\n",
       "    parents:     []\n",
       "    childs:      [&#x27;v_3_del&#x27;, &#x27;d_gene&#x27;, &#x27;j_choice&#x27;]</pre><div class='xr-wrap' hidden><div class='xr-header'><div class='xr-obj-type'>xarray.DataArray</div><div class='xr-array-name'></div></div><ul class='xr-sections'><li class='xr-section-item'><div class='xr-array-wrap'><input id='section-6690305f-27ad-45a7-8c21-137cfcd1586b' class='xr-array-in' type='checkbox' checked><label for='section-6690305f-27ad-45a7-8c21-137cfcd1586b' title='Show/hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-array-preview xr-preview'><span>0.0</span></div><div class='xr-array-data'><pre>array(0.)</pre></div></div></li><li class='xr-section-item'><input id='section-c362e709-176b-42f4-a968-e4e7fd497445' class='xr-section-summary-in' type='checkbox'  checked><label for='section-c362e709-176b-42f4-a968-e4e7fd497445' class='xr-section-summary' >Coordinates: <span>(3)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span>v_choice</span></div><div class='xr-var-dims'>()</div><div class='xr-var-dtype'>int64</div><div class='xr-var-preview xr-preview'>22</div><input id='attrs-72509d5f-0f1f-4575-bb3f-281ac969fe1d' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-72509d5f-0f1f-4575-bb3f-281ac969fe1d' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-4fcc40d1-4ccc-40f2-9ec1-479bbc8cd07d' class='xr-var-data-in' type='checkbox'><label for='data-4fcc40d1-4ccc-40f2-9ec1-479bbc8cd07d' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array(22)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>lbl__v_choice</span></div><div class='xr-var-dims'>()</div><div class='xr-var-dtype'>object</div><div class='xr-var-preview xr-preview'>&#x27;TRBV15*03&#x27;</div><input id='attrs-660eb168-70ec-41eb-b4da-e42beeb8d53e' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-660eb168-70ec-41eb-b4da-e42beeb8d53e' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-8577fa0c-52b8-4fd6-a278-8f9956d8a96c' class='xr-var-data-in' type='checkbox'><label for='data-8577fa0c-52b8-4fd6-a278-8f9956d8a96c' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array(&#x27;TRBV15*03&#x27;, dtype=object)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>seq__v_choice</span></div><div class='xr-var-dims'>()</div><div class='xr-var-dtype'>object</div><div class='xr-var-preview xr-preview'>&#x27;GATGCCATGGTCATCCAGAACCCAAGATACC...</div><input id='attrs-ed224ce6-2c03-409c-ab88-dea82b05d2ac' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-ed224ce6-2c03-409c-ab88-dea82b05d2ac' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-eaa6efa4-4206-408d-8d4a-9783ce61c148' class='xr-var-data-in' type='checkbox'><label for='data-eaa6efa4-4206-408d-8d4a-9783ce61c148' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array(&#x27;GATGCCATGGTCATCCAGAACCCAAGATACCGGGTTACCCAGTTTGGAAAGCCAGTGACCCTGAGTTGTTCTCAGACTTTGAACCATAACGTCATGTACTGGTACCAGCAGAAGTCAAGTCAGGCCCCAAAGCTGCTGTTCCACTACTATAACAAAGATTTTAACAATGAAGCAGACACCCCTGATAACTTCCAATCCAGGAGGCCGAACACTTCTTTCTGCTTTCTAGACATCCGCTCACCAGGCCTGGGGGACGCAGCCATGTACCAGTGTGCCACCAGCAGAGA&#x27;,\n",
       "      dtype=object)</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-b37a16d0-2cbd-4c3c-9788-8b692eb98501' class='xr-section-summary-in' type='checkbox'  checked><label for='section-b37a16d0-2cbd-4c3c-9788-8b692eb98501' class='xr-section-summary' >Attributes: <span>(7)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><dl class='xr-attrs'><dt><span>nickname :</span></dt><dd>v_choice</dd><dt><span>event_type :</span></dt><dd>GeneChoice</dd><dt><span>seq_type :</span></dt><dd>V_gene</dd><dt><span>seq_side :</span></dt><dd>Undefined_side</dd><dt><span>priority :</span></dt><dd>7</dd><dt><span>parents :</span></dt><dd>[]</dd><dt><span>childs :</span></dt><dd>[&#x27;v_3_del&#x27;, &#x27;d_gene&#x27;, &#x27;j_choice&#x27;]</dd></dl></div></li></ul></div></div>"
      ],
      "text/plain": [
       "<xarray.DataArray ()>\n",
       "array(0.)\n",
       "Coordinates:\n",
       "    v_choice       int64 22\n",
       "    lbl__v_choice  object 'TRBV15*03'\n",
       "    seq__v_choice  object 'GATGCCATGGTCATCCAGAACCCAAGATACCGGGTTACCCAGTTTGGAAA...\n",
       "Attributes:\n",
       "    nickname:    v_choice\n",
       "    event_type:  GeneChoice\n",
       "    seq_type:    V_gene\n",
       "    seq_side:    Undefined_side\n",
       "    priority:    7\n",
       "    parents:     []\n",
       "    childs:      ['v_3_del', 'd_gene', 'j_choice']"
      ]
     },
     "execution_count": 54,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mdl_hb['v_choice'].loc[22] #, mdl_hb['v_choice'].loc[67] "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "name                                                    TRBV15*03\n",
       "value           GATGCCATGGTCATCCAGAACCCAAGATACCGGGTTACCCAGTTTG...\n",
       "anchor_index                                                270.0\n",
       "Name: 22, dtype: object"
      ]
     },
     "execution_count": 55,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mdl_hb.genomic_dataframe_dict['V'].loc[22]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Use a default IGoR's model to generate sequences"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Writing model parms in file  ./igor_generating_3z_y24jv/dataIGoRBTnea5JaoG_mdldata/models/model_parms.txt\n",
      "Writing model marginals in file  ./igor_generating_3z_y24jv/dataIGoRBTnea5JaoG_mdldata/models/model_marginals.txt\n",
      "Writing gene anchor's in file  ./igor_generating_3z_y24jv/dataIGoRBTnea5JaoG_mdldata/ref_genome/V_gene_CDR3_anchors.csv\n",
      "Writing gene anchor's in file  ./igor_generating_3z_y24jv/dataIGoRBTnea5JaoG_mdldata/ref_genome/J_gene_CDR3_anchors.csv\n",
      "Writing model parms in file  ./igor_generating_3z_y24jv/dataIGoRBTnea5JaoG_mdldata//models/model_parms.txt\n",
      "Writing model marginals in file  ./igor_generating_3z_y24jv/dataIGoRBTnea5JaoG_mdldata//models/model_marginals.txt\n",
      "Writing gene anchor's in file  ./igor_generating_3z_y24jv/dataIGoRBTnea5JaoG_mdldata//ref_genome/V_gene_CDR3_anchors.csv\n",
      "Writing gene anchor's in file  ./igor_generating_3z_y24jv/dataIGoRBTnea5JaoG_mdldata//ref_genome/J_gene_CDR3_anchors.csv\n",
      "/home/olivares/.local/bin/igor -set_wd ./igor_generating_3z_y24jv -batch dataIGoRBTnea5JaoG -set_custom_model ./igor_generating_3z_y24jv/dataIGoRBTnea5JaoG_mdldata//models/model_parms.txt ./igor_generating_3z_y24jv/dataIGoRBTnea5JaoG_mdldata//models/model_marginals.txt -set_CDR3_anchors  --V ./igor_generating_3z_y24jv/dataIGoRBTnea5JaoG_mdldata//ref_genome/V_gene_CDR3_anchors.csv --J ./igor_generating_3z_y24jv/dataIGoRBTnea5JaoG_mdldata//ref_genome/J_gene_CDR3_anchors.csv -generate 10 \n"
     ]
    },
    {
     "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>nt_sequence</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>seq_index</th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>AAGGCTGGAGTCACTCAAACTCCAAGATATCTGATCAAAACGAGAG...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>GAAGCTGGAGTTACTCAGTTCCCCAGCCACAGCGTAATAGAGAAGG...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>GGTGCTGTCGTCTCTCAACATCCGAGCTGGGTTATCTGTAAGAGTG...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>GGAGCTGGAGTCTCCCAGTCCCCCAGTAACAAGGTCACAGAGAAGG...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>GAAGCTGGAGTTGCCCAGTCTCCCAGATATAAGATTATAGAGAAAA...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>GGTGCTGGAGTCTCCCAGACCCCCAGTAACAAGGTCACAGAGAAGG...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>GATGCTGATGTTACCCAGACCCCAAGGAATAGGATCACAAAGACAG...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>AAGGCTGGAGTCACTCAAACTCCAAGATATCTGATCAAAACGAGAG...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>GAAACGGGAGTTACGCAGACACCAAGACACCTGGTCATGGGAATGA...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>CATGCCAAAGTCACACAGACTCCAGGACATTTGGTCAAAGGAAAAG...</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                 nt_sequence\n",
       "seq_index                                                   \n",
       "0          AAGGCTGGAGTCACTCAAACTCCAAGATATCTGATCAAAACGAGAG...\n",
       "1          GAAGCTGGAGTTACTCAGTTCCCCAGCCACAGCGTAATAGAGAAGG...\n",
       "2          GGTGCTGTCGTCTCTCAACATCCGAGCTGGGTTATCTGTAAGAGTG...\n",
       "3          GGAGCTGGAGTCTCCCAGTCCCCCAGTAACAAGGTCACAGAGAAGG...\n",
       "4          GAAGCTGGAGTTGCCCAGTCTCCCAGATATAAGATTATAGAGAAAA...\n",
       "5          GGTGCTGGAGTCTCCCAGACCCCCAGTAACAAGGTCACAGAGAAGG...\n",
       "6          GATGCTGATGTTACCCAGACCCCAAGGAATAGGATCACAAAGACAG...\n",
       "7          AAGGCTGGAGTCACTCAAACTCCAAGATATCTGATCAAAACGAGAG...\n",
       "8          GAAACGGGAGTTACGCAGACACCAAGACACCTGGTCATGGGAATGA...\n",
       "9          CATGCCAAAGTCACACAGACTCCAGGACATTTGGTCAAAGGAAAAG..."
      ]
     },
     "execution_count": 56,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_seqs = p3.generate(10, mdl_hb)\n",
    "df_seqs"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## One sequence evaluation\n",
    "Let's consider that we have a sequence of a TCR $\\beta$ receptor"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "metadata": {},
   "outputs": [],
   "source": [
    "str_seq_hb = \"ATCGAGTGCCGTTCCCTGGACTTTCAGGCCACAACTATGTTTTGGTATCGTCAGTTCCCGAAACAGAGTCTCATGCTGATGGCAACTTCCAATGAGGGCTCCAAGGCCACATACGAGCAAGGCGTCGAGAAGGACAAGTTTCTCATCAACCATGCAAGCCTGACCTTGTCCACTCTGACAGTGACCAGTGCCCATCCTGAAGACAGCAGCTTCTACATCTGCAGTGCTGGGGAAGGGCAGCCTGGAAACACCATATATTTTGGAG\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "A classical approach would be make alignments of the VDJ segments and consider the maximun alignment of the segments as uniquely determinated construction."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "metadata": {},
   "outputs": [],
   "source": [
    "## TODO: SHOW NAIVE ALIGNMENT"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "metadata": {},
   "outputs": [],
   "source": [
    "## TODO: Simple explantion of the inference process "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Evaluate VDJ model"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Reading Parms filename from:  /home/olivares/.local/share/igor/models/human/tcr_beta/models/model_parms.txt\n",
      "Reading Marginals filename from:  /home/olivares/.local/share/igor/models/human/tcr_beta/models/model_marginals.txt\n"
     ]
    }
   ],
   "source": [
    "mdl = p3.get_default_IgorModel(\"human\", \"tcr_beta\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on function evaluate in module pygor3.IgorIO:\n",
      "\n",
      "evaluate(input_sequences: Union[str, pandas.core.frame.DataFrame, numpy.ndarray, pathlib.Path], mdl: pygor3.IgorIO.IgorModel, N_scenarios=None, igor_wd=None, airr_format=True, batch_clean=True)\n",
      "    Evaluate input sequences with provided model\n",
      "    :param input_sequences:Union[str, pd.DataFrame, np.ndarray, Path]\n",
      "    :param mdl:IgorModel\n",
      "    :param batch_clean: Remove all temporary files True by default.\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(p3.evaluate)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Evaluation AIRR format"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Writing model parms in file  ./igor_evaluating_1b6e6i7z/dataIGoRyNbbuLilFX_mdldata/models/model_parms.txt\n",
      "Writing model marginals in file  ./igor_evaluating_1b6e6i7z/dataIGoRyNbbuLilFX_mdldata/models/model_marginals.txt\n",
      "Writing gene anchor's in file  ./igor_evaluating_1b6e6i7z/dataIGoRyNbbuLilFX_mdldata/ref_genome/V_gene_CDR3_anchors.csv\n",
      "Writing gene anchor's in file  ./igor_evaluating_1b6e6i7z/dataIGoRyNbbuLilFX_mdldata/ref_genome/J_gene_CDR3_anchors.csv\n",
      "/home/olivares/.local/bin/igor -set_wd ./igor_evaluating_1b6e6i7z -batch dataIGoRyNbbuLilFX -read_seqs ./igor_evaluating_1b6e6i7z/dataIGoRyNbbuLilFXinput_sequences.csv\n",
      "/home/olivares/.local/bin/igor -set_wd ./igor_evaluating_1b6e6i7z -batch dataIGoRyNbbuLilFX -set_genomic  --V ./igor_evaluating_1b6e6i7z/dataIGoRyNbbuLilFX_mdldata/ref_genome/genomicVs.fasta --D ./igor_evaluating_1b6e6i7z/dataIGoRyNbbuLilFX_mdldata/ref_genome/genomicDs.fasta --J ./igor_evaluating_1b6e6i7z/dataIGoRyNbbuLilFX_mdldata/ref_genome/genomicJs.fasta -set_CDR3_anchors  --V ./igor_evaluating_1b6e6i7z/dataIGoRyNbbuLilFX_mdldata/ref_genome/V_gene_CDR3_anchors.csv --J ./igor_evaluating_1b6e6i7z/dataIGoRyNbbuLilFX_mdldata/ref_genome/J_gene_CDR3_anchors.csv -align  --all  \n",
      "/home/olivares/.local/bin/igor -set_wd ./igor_evaluating_1b6e6i7z -batch dataIGoRyNbbuLilFX -set_custom_model ./igor_evaluating_1b6e6i7z/dataIGoRyNbbuLilFX_mdldata/models/model_parms.txt ./igor_evaluating_1b6e6i7z/dataIGoRyNbbuLilFX_mdldata/models/model_marginals.txt -evaluate  -output  --scenarios 10  --Pgen  \n",
      "./igor_evaluating_1b6e6i7z/aligns/dataIGoRyNbbuLilFX_indexed_CDR3s.csv\n",
      "('',)\n",
      "Incorrect number of bindings supplied. The current statement uses 5, and there are 1 supplied.\n",
      "Loading Gene templates ...\n",
      "V ./igor_evaluating_1b6e6i7z/dataIGoRyNbbuLilFX_mdldata/ref_genome/genomicVs.fasta\n",
      "J ./igor_evaluating_1b6e6i7z/dataIGoRyNbbuLilFX_mdldata/ref_genome/genomicJs.fasta\n",
      "D ./igor_evaluating_1b6e6i7z/dataIGoRyNbbuLilFX_mdldata/ref_genome/genomicDs.fasta\n",
      "loading Anchors data ...\n",
      "Loading Gene Anchors from  ./igor_evaluating_1b6e6i7z/dataIGoRyNbbuLilFX_mdldata/ref_genome/V_gene_CDR3_anchors.csv\n",
      "Loading Gene Anchors from  ./igor_evaluating_1b6e6i7z/dataIGoRyNbbuLilFX_mdldata/ref_genome/J_gene_CDR3_anchors.csv\n",
      "./igor_evaluating_1b6e6i7z/aligns/dataIGoRyNbbuLilFX_V_alignments.csv\n",
      "['']\n",
      "['']\n",
      "['']\n",
      "Alignments loaded in database in ./igor_evaluating_1b6e6i7z/dataIGoRyNbbuLilFX.db\n",
      "Reading Parms filename from:  ./igor_evaluating_1b6e6i7z/dataIGoRyNbbuLilFX_mdldata/models/model_parms.txt\n",
      "Reading Marginals filename from:  ./igor_evaluating_1b6e6i7z/dataIGoRyNbbuLilFX_mdldata/models/model_marginals.txt\n",
      "Loading parms to database\n",
      "('v_choice', 'v_3_del')\n",
      "('v_choice', 'd_gene')\n",
      "('v_choice', 'j_choice')\n",
      "('d_gene', 'd_3_del')\n",
      "('d_gene', 'd_5_del')\n",
      "('j_choice', 'j_5_del')\n",
      "('j_choice', 'd_gene')\n",
      "('d_5_del', 'd_3_del')\n",
      "Loading marginals to database\n",
      "./igor_evaluating_1b6e6i7z/dataIGoRyNbbuLilFX_output/best_scenarios_counts.csv\n",
      "events_name_nickname_dict {'GeneChoice_V_gene_Undefined_side_prio7_size89': 'v_choice', 'GeneChoice_J_gene_Undefined_side_prio7_size15': 'j_choice', 'GeneChoice_D_gene_Undefined_side_prio6_size3': 'd_gene', 'Deletion_V_gene_Three_prime_prio5_size21': 'v_3_del', 'Deletion_D_gene_Five_prime_prio5_size21': 'd_5_del', 'Deletion_J_gene_Five_prime_prio5_size23': 'j_5_del', 'Deletion_D_gene_Three_prime_prio5_size21': 'd_3_del', 'Insertion_VD_genes_Undefined_side_prio4_size31': 'vd_ins', 'DinucMarkov_VD_genes_Undefined_side_prio3_size16': 'vd_dinucl', 'Insertion_DJ_gene_Undefined_side_prio2_size31': 'dj_ins', 'DinucMarkov_DJ_gene_Undefined_side_prio1_size16': 'dj_dinucl'}\n",
      "./igor_evaluating_1b6e6i7z/dataIGoRyNbbuLilFX_output/Pgen_counts.csv\n",
      "./igor_evaluating_1b6e6i7z/dataIGoRyNbbuLilFX_output/Pgen_counts.csv\n",
      "('',)\n",
      "Incorrect number of bindings supplied. The current statement uses 2, and there are 1 supplied.\n",
      "----- Marginals -----\n",
      "d_3_del\n",
      "d_5_del\n",
      "d_gene\n",
      "dj_dinucl\n",
      "dj_ins\n",
      "j_5_del\n",
      "j_choice\n",
      "v_3_del\n",
      "v_choice\n",
      "vd_dinucl\n",
      "vd_ins\n"
     ]
    },
    {
     "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>sequence_id</th>\n",
       "      <th>sequence</th>\n",
       "      <th>rev_comp</th>\n",
       "      <th>productive</th>\n",
       "      <th>v_call</th>\n",
       "      <th>d_call</th>\n",
       "      <th>j_call</th>\n",
       "      <th>sequence_alignment</th>\n",
       "      <th>germline_alignment</th>\n",
       "      <th>junction</th>\n",
       "      <th>junction_aa</th>\n",
       "      <th>v_cigar</th>\n",
       "      <th>d_cigar</th>\n",
       "      <th>j_cigar</th>\n",
       "      <th>v_score</th>\n",
       "      <th>v_identity</th>\n",
       "      <th>v_support</th>\n",
       "      <th>v_sequence_start</th>\n",
       "      <th>v_sequence_end</th>\n",
       "      <th>v_germline_start</th>\n",
       "      <th>v_germline_end</th>\n",
       "      <th>v_alignment_start</th>\n",
       "      <th>v_alignment_end</th>\n",
       "      <th>d_score</th>\n",
       "      <th>d_identity</th>\n",
       "      <th>d_support</th>\n",
       "      <th>d_sequence_start</th>\n",
       "      <th>d_sequence_end</th>\n",
       "      <th>d_germline_start</th>\n",
       "      <th>d_germline_end</th>\n",
       "      <th>d_alignment_start</th>\n",
       "      <th>d_alignment_end</th>\n",
       "      <th>j_score</th>\n",
       "      <th>j_identity</th>\n",
       "      <th>j_support</th>\n",
       "      <th>j_sequence_start</th>\n",
       "      <th>j_sequence_end</th>\n",
       "      <th>j_germline_start</th>\n",
       "      <th>j_germline_end</th>\n",
       "      <th>j_alignment_start</th>\n",
       "      <th>j_alignment_end</th>\n",
       "      <th>sequence_aa</th>\n",
       "      <th>vj_in_frame</th>\n",
       "      <th>stop_codon</th>\n",
       "      <th>complete_vdj</th>\n",
       "      <th>locus</th>\n",
       "      <th>sequence_alignment_aa</th>\n",
       "      <th>n1_length</th>\n",
       "      <th>np1</th>\n",
       "      <th>np1_aa</th>\n",
       "      <th>np1_length</th>\n",
       "      <th>n2_length</th>\n",
       "      <th>np2</th>\n",
       "      <th>np2_aa</th>\n",
       "      <th>np2_length</th>\n",
       "      <th>p3v_length</th>\n",
       "      <th>p5d_length</th>\n",
       "      <th>p3d_length</th>\n",
       "      <th>p5j_length</th>\n",
       "      <th>scenario_rank</th>\n",
       "      <th>scenario_proba_cond_seq</th>\n",
       "      <th>pgen</th>\n",
       "      <th>quality</th>\n",
       "      <th>quality_alignment</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>ATCGAGTGCCGTTCCCTGGACTTTCAGGCCACAACTATGTTTTGGT...</td>\n",
       "      <td>F</td>\n",
       "      <td>NaN</td>\n",
       "      <td>M11955|TRBV20-1*01|Homo sapiens|F|V-REGION|427...</td>\n",
       "      <td>TRBD1*01</td>\n",
       "      <td>M14158|TRBJ1-3*01|Homo sapiens|F|J-REGION|1499...</td>\n",
       "      <td>GGTGCTGTCGTCTCTCAACATCCGAGCTGGGTTATCTGTAAGAGTG...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>TGCAGTGCTGGGGAAGGGCAGCCTGGAAACACCATATATTTT</td>\n",
       "      <td>CSAGEGQPGNTIYF</td>\n",
       "      <td>288M</td>\n",
       "      <td>4M</td>\n",
       "      <td>48M</td>\n",
       "      <td>1440</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2</td>\n",
       "      <td>288</td>\n",
       "      <td>61</td>\n",
       "      <td>286</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>20</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>292</td>\n",
       "      <td>294</td>\n",
       "      <td>7</td>\n",
       "      <td>10</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>240</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>7</td>\n",
       "      <td>53</td>\n",
       "      <td>4</td>\n",
       "      <td>51</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>5</td>\n",
       "      <td>GGGGA</td>\n",
       "      <td>NaN</td>\n",
       "      <td>5</td>\n",
       "      <td>4</td>\n",
       "      <td>CAGC</td>\n",
       "      <td>NaN</td>\n",
       "      <td>4</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0.146984</td>\n",
       "      <td>4.871310e-13</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0</td>\n",
       "      <td>ATCGAGTGCCGTTCCCTGGACTTTCAGGCCACAACTATGTTTTGGT...</td>\n",
       "      <td>F</td>\n",
       "      <td>NaN</td>\n",
       "      <td>M11955|TRBV20-1*01|Homo sapiens|F|V-REGION|427...</td>\n",
       "      <td>TRBD2*02</td>\n",
       "      <td>M14158|TRBJ1-3*01|Homo sapiens|F|J-REGION|1499...</td>\n",
       "      <td>GGTGCTGTCGTCTCTCAACATCCGAGCTGGGTTATCTGTAAGAGTG...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>TGCAGTGCTGGGGAAGGGCAGCCTGGAAACACCATATATTTT</td>\n",
       "      <td>CSAGEGQPGNTIYF</td>\n",
       "      <td>288M</td>\n",
       "      <td>4M</td>\n",
       "      <td>48M</td>\n",
       "      <td>1440</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2</td>\n",
       "      <td>288</td>\n",
       "      <td>61</td>\n",
       "      <td>286</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>20</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>292</td>\n",
       "      <td>294</td>\n",
       "      <td>14</td>\n",
       "      <td>17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>240</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>7</td>\n",
       "      <td>53</td>\n",
       "      <td>4</td>\n",
       "      <td>51</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>5</td>\n",
       "      <td>GGGGA</td>\n",
       "      <td>NaN</td>\n",
       "      <td>5</td>\n",
       "      <td>4</td>\n",
       "      <td>CAGC</td>\n",
       "      <td>NaN</td>\n",
       "      <td>4</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>0.112527</td>\n",
       "      <td>4.871310e-13</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0</td>\n",
       "      <td>ATCGAGTGCCGTTCCCTGGACTTTCAGGCCACAACTATGTTTTGGT...</td>\n",
       "      <td>F</td>\n",
       "      <td>NaN</td>\n",
       "      <td>M11955|TRBV20-1*01|Homo sapiens|F|V-REGION|427...</td>\n",
       "      <td>TRBD1*01</td>\n",
       "      <td>M14158|TRBJ1-3*01|Homo sapiens|F|J-REGION|1499...</td>\n",
       "      <td>GGTGCTGTCGTCTCTCAACATCCGAGCTGGGTTATCTGTAAGAGTG...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>TGCAGTGCTGGGGAAGGGCAGCCTGGAAACACCATATATTTT</td>\n",
       "      <td>CSAGEGQPGNTIYF</td>\n",
       "      <td>288M</td>\n",
       "      <td>3M</td>\n",
       "      <td>48M</td>\n",
       "      <td>1440</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2</td>\n",
       "      <td>288</td>\n",
       "      <td>61</td>\n",
       "      <td>286</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>15</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>296</td>\n",
       "      <td>297</td>\n",
       "      <td>6</td>\n",
       "      <td>8</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>240</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3</td>\n",
       "      <td>49</td>\n",
       "      <td>4</td>\n",
       "      <td>51</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>9</td>\n",
       "      <td>GGGGAAGGG</td>\n",
       "      <td>NaN</td>\n",
       "      <td>9</td>\n",
       "      <td>1</td>\n",
       "      <td>C</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>0.062955</td>\n",
       "      <td>4.871310e-13</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0</td>\n",
       "      <td>ATCGAGTGCCGTTCCCTGGACTTTCAGGCCACAACTATGTTTTGGT...</td>\n",
       "      <td>F</td>\n",
       "      <td>NaN</td>\n",
       "      <td>M11955|TRBV20-1*01|Homo sapiens|F|V-REGION|427...</td>\n",
       "      <td>TRBD2*02</td>\n",
       "      <td>M14158|TRBJ1-3*01|Homo sapiens|F|J-REGION|1499...</td>\n",
       "      <td>GGTGCTGTCGTCTCTCAACATCCGAGCTGGGTTATCTGTAAGAGTG...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>TGCAGTGCTGGGGAAGGGCAGCCTGGAAACACCATATATTTT</td>\n",
       "      <td>CSAGEGQPGNTIYF</td>\n",
       "      <td>288M</td>\n",
       "      <td>3M</td>\n",
       "      <td>48M</td>\n",
       "      <td>1440</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2</td>\n",
       "      <td>288</td>\n",
       "      <td>61</td>\n",
       "      <td>286</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>15</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>293</td>\n",
       "      <td>294</td>\n",
       "      <td>15</td>\n",
       "      <td>17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>240</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>6</td>\n",
       "      <td>52</td>\n",
       "      <td>4</td>\n",
       "      <td>51</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>6</td>\n",
       "      <td>GGGGAA</td>\n",
       "      <td>NaN</td>\n",
       "      <td>6</td>\n",
       "      <td>3</td>\n",
       "      <td>AGC</td>\n",
       "      <td>NaN</td>\n",
       "      <td>4</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>4</td>\n",
       "      <td>0.060409</td>\n",
       "      <td>4.871310e-13</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "      <td>ATCGAGTGCCGTTCCCTGGACTTTCAGGCCACAACTATGTTTTGGT...</td>\n",
       "      <td>F</td>\n",
       "      <td>NaN</td>\n",
       "      <td>M11955|TRBV20-1*01|Homo sapiens|F|V-REGION|427...</td>\n",
       "      <td>TRBD1*01</td>\n",
       "      <td>M14158|TRBJ1-3*01|Homo sapiens|F|J-REGION|1499...</td>\n",
       "      <td>GGTGCTGTCGTCTCTCAACATCCGAGCTGGGTTATCTGTAAGAGTG...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>TGCAGTGCTGGGGAAGGGCAGCCTGGAAACACCATATATTTT</td>\n",
       "      <td>CSAGEGQPGNTIYF</td>\n",
       "      <td>288M</td>\n",
       "      <td>4M</td>\n",
       "      <td>48M</td>\n",
       "      <td>1440</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2</td>\n",
       "      <td>288</td>\n",
       "      <td>61</td>\n",
       "      <td>286</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>20</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>293</td>\n",
       "      <td>295</td>\n",
       "      <td>10</td>\n",
       "      <td>13</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>240</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>6</td>\n",
       "      <td>52</td>\n",
       "      <td>4</td>\n",
       "      <td>51</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>6</td>\n",
       "      <td>GGGGAA</td>\n",
       "      <td>NaN</td>\n",
       "      <td>6</td>\n",
       "      <td>3</td>\n",
       "      <td>AGC</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>5</td>\n",
       "      <td>0.034684</td>\n",
       "      <td>4.871310e-13</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>0</td>\n",
       "      <td>ATCGAGTGCCGTTCCCTGGACTTTCAGGCCACAACTATGTTTTGGT...</td>\n",
       "      <td>F</td>\n",
       "      <td>NaN</td>\n",
       "      <td>M11955|TRBV20-1*01|Homo sapiens|F|V-REGION|427...</td>\n",
       "      <td>TRBD1*01</td>\n",
       "      <td>M14158|TRBJ1-3*01|Homo sapiens|F|J-REGION|1499...</td>\n",
       "      <td>GGTGCTGTCGTCTCTCAACATCCGAGCTGGGTTATCTGTAAGAGTG...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>TGCAGTGCTGGGGAAGGGCAGCCTGGAAACACCATATATTTT</td>\n",
       "      <td>CSAGEGQPGNTIYF</td>\n",
       "      <td>287M</td>\n",
       "      <td>4M</td>\n",
       "      <td>48M</td>\n",
       "      <td>1435</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2</td>\n",
       "      <td>287</td>\n",
       "      <td>61</td>\n",
       "      <td>285</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>20</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>292</td>\n",
       "      <td>294</td>\n",
       "      <td>7</td>\n",
       "      <td>10</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>240</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>7</td>\n",
       "      <td>53</td>\n",
       "      <td>4</td>\n",
       "      <td>51</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>6</td>\n",
       "      <td>TGGGGA</td>\n",
       "      <td>NaN</td>\n",
       "      <td>6</td>\n",
       "      <td>4</td>\n",
       "      <td>CAGC</td>\n",
       "      <td>NaN</td>\n",
       "      <td>4</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>6</td>\n",
       "      <td>0.028806</td>\n",
       "      <td>4.871310e-13</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>0</td>\n",
       "      <td>ATCGAGTGCCGTTCCCTGGACTTTCAGGCCACAACTATGTTTTGGT...</td>\n",
       "      <td>F</td>\n",
       "      <td>NaN</td>\n",
       "      <td>M11955|TRBV20-1*01|Homo sapiens|F|V-REGION|427...</td>\n",
       "      <td>TRBD2*02</td>\n",
       "      <td>M14158|TRBJ1-3*01|Homo sapiens|F|J-REGION|1499...</td>\n",
       "      <td>GGTGCTGTCGTCTCTCAACATCCGAGCTGGGTTATCTGTAAGAGTG...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>TGCAGTGCTGGGGAAGGGCAGCCTGGAAACACCATATATTTT</td>\n",
       "      <td>CSAGEGQPGNTIYF</td>\n",
       "      <td>288M</td>\n",
       "      <td>3M</td>\n",
       "      <td>48M</td>\n",
       "      <td>1440</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2</td>\n",
       "      <td>288</td>\n",
       "      <td>61</td>\n",
       "      <td>286</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>15</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>293</td>\n",
       "      <td>294</td>\n",
       "      <td>11</td>\n",
       "      <td>13</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>240</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>6</td>\n",
       "      <td>52</td>\n",
       "      <td>4</td>\n",
       "      <td>51</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>6</td>\n",
       "      <td>GGGGAA</td>\n",
       "      <td>NaN</td>\n",
       "      <td>6</td>\n",
       "      <td>4</td>\n",
       "      <td>CAGC</td>\n",
       "      <td>NaN</td>\n",
       "      <td>4</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>7</td>\n",
       "      <td>0.023637</td>\n",
       "      <td>4.871310e-13</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>0</td>\n",
       "      <td>ATCGAGTGCCGTTCCCTGGACTTTCAGGCCACAACTATGTTTTGGT...</td>\n",
       "      <td>F</td>\n",
       "      <td>NaN</td>\n",
       "      <td>M11955|TRBV20-1*01|Homo sapiens|F|V-REGION|427...</td>\n",
       "      <td>TRBD2*02</td>\n",
       "      <td>M14158|TRBJ1-3*01|Homo sapiens|F|J-REGION|1499...</td>\n",
       "      <td>GGTGCTGTCGTCTCTCAACATCCGAGCTGGGTTATCTGTAAGAGTG...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>TGCAGTGCTGGGGAAGGGCAGCCTGGAAACACCATATATTTT</td>\n",
       "      <td>CSAGEGQPGNTIYF</td>\n",
       "      <td>287M</td>\n",
       "      <td>4M</td>\n",
       "      <td>48M</td>\n",
       "      <td>1435</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2</td>\n",
       "      <td>287</td>\n",
       "      <td>61</td>\n",
       "      <td>285</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>20</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>292</td>\n",
       "      <td>294</td>\n",
       "      <td>14</td>\n",
       "      <td>17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>240</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>7</td>\n",
       "      <td>53</td>\n",
       "      <td>4</td>\n",
       "      <td>51</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>6</td>\n",
       "      <td>TGGGGA</td>\n",
       "      <td>NaN</td>\n",
       "      <td>6</td>\n",
       "      <td>4</td>\n",
       "      <td>CAGC</td>\n",
       "      <td>NaN</td>\n",
       "      <td>4</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>8</td>\n",
       "      <td>0.022053</td>\n",
       "      <td>4.871310e-13</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>0</td>\n",
       "      <td>ATCGAGTGCCGTTCCCTGGACTTTCAGGCCACAACTATGTTTTGGT...</td>\n",
       "      <td>F</td>\n",
       "      <td>NaN</td>\n",
       "      <td>M11955|TRBV20-1*01|Homo sapiens|F|V-REGION|427...</td>\n",
       "      <td>TRBD2*02</td>\n",
       "      <td>M14158|TRBJ1-3*01|Homo sapiens|F|J-REGION|1499...</td>\n",
       "      <td>GGTGCTGTCGTCTCTCAACATCCGAGCTGGGTTATCTGTAAGAGTG...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>TGCAGTGCTGGGGAAGGGCAGCCTGGAAACACCATATATTTT</td>\n",
       "      <td>CSAGEGQPGNTIYF</td>\n",
       "      <td>288M</td>\n",
       "      <td>4M</td>\n",
       "      <td>48M</td>\n",
       "      <td>1440</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2</td>\n",
       "      <td>288</td>\n",
       "      <td>61</td>\n",
       "      <td>286</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>20</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>288</td>\n",
       "      <td>290</td>\n",
       "      <td>11</td>\n",
       "      <td>14</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>240</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>11</td>\n",
       "      <td>57</td>\n",
       "      <td>4</td>\n",
       "      <td>51</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>G</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>8</td>\n",
       "      <td>AGGGCAGC</td>\n",
       "      <td>NaN</td>\n",
       "      <td>8</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>9</td>\n",
       "      <td>0.017562</td>\n",
       "      <td>4.871310e-13</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>0</td>\n",
       "      <td>ATCGAGTGCCGTTCCCTGGACTTTCAGGCCACAACTATGTTTTGGT...</td>\n",
       "      <td>F</td>\n",
       "      <td>NaN</td>\n",
       "      <td>M11955|TRBV20-1*01|Homo sapiens|F|V-REGION|427...</td>\n",
       "      <td>TRBD2*02</td>\n",
       "      <td>M14158|TRBJ1-3*01|Homo sapiens|F|J-REGION|1499...</td>\n",
       "      <td>GGTGCTGTCGTCTCTCAACATCCGAGCTGGGTTATCTGTAAGAGTG...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>TGCAGTGCTGGGGAAGGGCAGCCTGGAAACACCATATATTTT</td>\n",
       "      <td>CSAGEGQPGNTIYF</td>\n",
       "      <td>288M</td>\n",
       "      <td>3M</td>\n",
       "      <td>48M</td>\n",
       "      <td>1440</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2</td>\n",
       "      <td>288</td>\n",
       "      <td>61</td>\n",
       "      <td>286</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>15</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>292</td>\n",
       "      <td>293</td>\n",
       "      <td>14</td>\n",
       "      <td>16</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>240</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>7</td>\n",
       "      <td>53</td>\n",
       "      <td>4</td>\n",
       "      <td>51</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>5</td>\n",
       "      <td>GGGGA</td>\n",
       "      <td>NaN</td>\n",
       "      <td>5</td>\n",
       "      <td>5</td>\n",
       "      <td>GCAGC</td>\n",
       "      <td>NaN</td>\n",
       "      <td>5</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>10</td>\n",
       "      <td>0.015878</td>\n",
       "      <td>4.871310e-13</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   sequence_id                                           sequence rev_comp  \\\n",
       "0            0  ATCGAGTGCCGTTCCCTGGACTTTCAGGCCACAACTATGTTTTGGT...        F   \n",
       "1            0  ATCGAGTGCCGTTCCCTGGACTTTCAGGCCACAACTATGTTTTGGT...        F   \n",
       "2            0  ATCGAGTGCCGTTCCCTGGACTTTCAGGCCACAACTATGTTTTGGT...        F   \n",
       "3            0  ATCGAGTGCCGTTCCCTGGACTTTCAGGCCACAACTATGTTTTGGT...        F   \n",
       "4            0  ATCGAGTGCCGTTCCCTGGACTTTCAGGCCACAACTATGTTTTGGT...        F   \n",
       "5            0  ATCGAGTGCCGTTCCCTGGACTTTCAGGCCACAACTATGTTTTGGT...        F   \n",
       "6            0  ATCGAGTGCCGTTCCCTGGACTTTCAGGCCACAACTATGTTTTGGT...        F   \n",
       "7            0  ATCGAGTGCCGTTCCCTGGACTTTCAGGCCACAACTATGTTTTGGT...        F   \n",
       "8            0  ATCGAGTGCCGTTCCCTGGACTTTCAGGCCACAACTATGTTTTGGT...        F   \n",
       "9            0  ATCGAGTGCCGTTCCCTGGACTTTCAGGCCACAACTATGTTTTGGT...        F   \n",
       "\n",
       "   productive                                             v_call     d_call  \\\n",
       "0         NaN  M11955|TRBV20-1*01|Homo sapiens|F|V-REGION|427...   TRBD1*01   \n",
       "1         NaN  M11955|TRBV20-1*01|Homo sapiens|F|V-REGION|427...   TRBD2*02   \n",
       "2         NaN  M11955|TRBV20-1*01|Homo sapiens|F|V-REGION|427...   TRBD1*01   \n",
       "3         NaN  M11955|TRBV20-1*01|Homo sapiens|F|V-REGION|427...   TRBD2*02   \n",
       "4         NaN  M11955|TRBV20-1*01|Homo sapiens|F|V-REGION|427...   TRBD1*01   \n",
       "5         NaN  M11955|TRBV20-1*01|Homo sapiens|F|V-REGION|427...   TRBD1*01   \n",
       "6         NaN  M11955|TRBV20-1*01|Homo sapiens|F|V-REGION|427...   TRBD2*02   \n",
       "7         NaN  M11955|TRBV20-1*01|Homo sapiens|F|V-REGION|427...   TRBD2*02   \n",
       "8         NaN  M11955|TRBV20-1*01|Homo sapiens|F|V-REGION|427...   TRBD2*02   \n",
       "9         NaN  M11955|TRBV20-1*01|Homo sapiens|F|V-REGION|427...   TRBD2*02   \n",
       "\n",
       "                                              j_call  \\\n",
       "0  M14158|TRBJ1-3*01|Homo sapiens|F|J-REGION|1499...   \n",
       "1  M14158|TRBJ1-3*01|Homo sapiens|F|J-REGION|1499...   \n",
       "2  M14158|TRBJ1-3*01|Homo sapiens|F|J-REGION|1499...   \n",
       "3  M14158|TRBJ1-3*01|Homo sapiens|F|J-REGION|1499...   \n",
       "4  M14158|TRBJ1-3*01|Homo sapiens|F|J-REGION|1499...   \n",
       "5  M14158|TRBJ1-3*01|Homo sapiens|F|J-REGION|1499...   \n",
       "6  M14158|TRBJ1-3*01|Homo sapiens|F|J-REGION|1499...   \n",
       "7  M14158|TRBJ1-3*01|Homo sapiens|F|J-REGION|1499...   \n",
       "8  M14158|TRBJ1-3*01|Homo sapiens|F|J-REGION|1499...   \n",
       "9  M14158|TRBJ1-3*01|Homo sapiens|F|J-REGION|1499...   \n",
       "\n",
       "                                  sequence_alignment  germline_alignment  \\\n",
       "0  GGTGCTGTCGTCTCTCAACATCCGAGCTGGGTTATCTGTAAGAGTG...                 NaN   \n",
       "1  GGTGCTGTCGTCTCTCAACATCCGAGCTGGGTTATCTGTAAGAGTG...                 NaN   \n",
       "2  GGTGCTGTCGTCTCTCAACATCCGAGCTGGGTTATCTGTAAGAGTG...                 NaN   \n",
       "3  GGTGCTGTCGTCTCTCAACATCCGAGCTGGGTTATCTGTAAGAGTG...                 NaN   \n",
       "4  GGTGCTGTCGTCTCTCAACATCCGAGCTGGGTTATCTGTAAGAGTG...                 NaN   \n",
       "5  GGTGCTGTCGTCTCTCAACATCCGAGCTGGGTTATCTGTAAGAGTG...                 NaN   \n",
       "6  GGTGCTGTCGTCTCTCAACATCCGAGCTGGGTTATCTGTAAGAGTG...                 NaN   \n",
       "7  GGTGCTGTCGTCTCTCAACATCCGAGCTGGGTTATCTGTAAGAGTG...                 NaN   \n",
       "8  GGTGCTGTCGTCTCTCAACATCCGAGCTGGGTTATCTGTAAGAGTG...                 NaN   \n",
       "9  GGTGCTGTCGTCTCTCAACATCCGAGCTGGGTTATCTGTAAGAGTG...                 NaN   \n",
       "\n",
       "                                     junction     junction_aa v_cigar d_cigar  \\\n",
       "0  TGCAGTGCTGGGGAAGGGCAGCCTGGAAACACCATATATTTT  CSAGEGQPGNTIYF    288M      4M   \n",
       "1  TGCAGTGCTGGGGAAGGGCAGCCTGGAAACACCATATATTTT  CSAGEGQPGNTIYF    288M      4M   \n",
       "2  TGCAGTGCTGGGGAAGGGCAGCCTGGAAACACCATATATTTT  CSAGEGQPGNTIYF    288M      3M   \n",
       "3  TGCAGTGCTGGGGAAGGGCAGCCTGGAAACACCATATATTTT  CSAGEGQPGNTIYF    288M      3M   \n",
       "4  TGCAGTGCTGGGGAAGGGCAGCCTGGAAACACCATATATTTT  CSAGEGQPGNTIYF    288M      4M   \n",
       "5  TGCAGTGCTGGGGAAGGGCAGCCTGGAAACACCATATATTTT  CSAGEGQPGNTIYF    287M      4M   \n",
       "6  TGCAGTGCTGGGGAAGGGCAGCCTGGAAACACCATATATTTT  CSAGEGQPGNTIYF    288M      3M   \n",
       "7  TGCAGTGCTGGGGAAGGGCAGCCTGGAAACACCATATATTTT  CSAGEGQPGNTIYF    287M      4M   \n",
       "8  TGCAGTGCTGGGGAAGGGCAGCCTGGAAACACCATATATTTT  CSAGEGQPGNTIYF    288M      4M   \n",
       "9  TGCAGTGCTGGGGAAGGGCAGCCTGGAAACACCATATATTTT  CSAGEGQPGNTIYF    288M      3M   \n",
       "\n",
       "  j_cigar  v_score  v_identity  v_support  v_sequence_start  v_sequence_end  \\\n",
       "0     48M     1440         NaN        NaN                 2             288   \n",
       "1     48M     1440         NaN        NaN                 2             288   \n",
       "2     48M     1440         NaN        NaN                 2             288   \n",
       "3     48M     1440         NaN        NaN                 2             288   \n",
       "4     48M     1440         NaN        NaN                 2             288   \n",
       "5     48M     1435         NaN        NaN                 2             287   \n",
       "6     48M     1440         NaN        NaN                 2             288   \n",
       "7     48M     1435         NaN        NaN                 2             287   \n",
       "8     48M     1440         NaN        NaN                 2             288   \n",
       "9     48M     1440         NaN        NaN                 2             288   \n",
       "\n",
       "   v_germline_start  v_germline_end  v_alignment_start  v_alignment_end  \\\n",
       "0                61             286                NaN              NaN   \n",
       "1                61             286                NaN              NaN   \n",
       "2                61             286                NaN              NaN   \n",
       "3                61             286                NaN              NaN   \n",
       "4                61             286                NaN              NaN   \n",
       "5                61             285                NaN              NaN   \n",
       "6                61             286                NaN              NaN   \n",
       "7                61             285                NaN              NaN   \n",
       "8                61             286                NaN              NaN   \n",
       "9                61             286                NaN              NaN   \n",
       "\n",
       "   d_score  d_identity  d_support  d_sequence_start  d_sequence_end  \\\n",
       "0       20         NaN        NaN               292             294   \n",
       "1       20         NaN        NaN               292             294   \n",
       "2       15         NaN        NaN               296             297   \n",
       "3       15         NaN        NaN               293             294   \n",
       "4       20         NaN        NaN               293             295   \n",
       "5       20         NaN        NaN               292             294   \n",
       "6       15         NaN        NaN               293             294   \n",
       "7       20         NaN        NaN               292             294   \n",
       "8       20         NaN        NaN               288             290   \n",
       "9       15         NaN        NaN               292             293   \n",
       "\n",
       "   d_germline_start  d_germline_end  d_alignment_start  d_alignment_end  \\\n",
       "0                 7              10                NaN              NaN   \n",
       "1                14              17                NaN              NaN   \n",
       "2                 6               8                NaN              NaN   \n",
       "3                15              17                NaN              NaN   \n",
       "4                10              13                NaN              NaN   \n",
       "5                 7              10                NaN              NaN   \n",
       "6                11              13                NaN              NaN   \n",
       "7                14              17                NaN              NaN   \n",
       "8                11              14                NaN              NaN   \n",
       "9                14              16                NaN              NaN   \n",
       "\n",
       "   j_score  j_identity  j_support  j_sequence_start  j_sequence_end  \\\n",
       "0      240         NaN        NaN                 7              53   \n",
       "1      240         NaN        NaN                 7              53   \n",
       "2      240         NaN        NaN                 3              49   \n",
       "3      240         NaN        NaN                 6              52   \n",
       "4      240         NaN        NaN                 6              52   \n",
       "5      240         NaN        NaN                 7              53   \n",
       "6      240         NaN        NaN                 6              52   \n",
       "7      240         NaN        NaN                 7              53   \n",
       "8      240         NaN        NaN                11              57   \n",
       "9      240         NaN        NaN                 7              53   \n",
       "\n",
       "   j_germline_start  j_germline_end  j_alignment_start  j_alignment_end  \\\n",
       "0                 4              51                NaN              NaN   \n",
       "1                 4              51                NaN              NaN   \n",
       "2                 4              51                NaN              NaN   \n",
       "3                 4              51                NaN              NaN   \n",
       "4                 4              51                NaN              NaN   \n",
       "5                 4              51                NaN              NaN   \n",
       "6                 4              51                NaN              NaN   \n",
       "7                 4              51                NaN              NaN   \n",
       "8                 4              51                NaN              NaN   \n",
       "9                 4              51                NaN              NaN   \n",
       "\n",
       "   sequence_aa  vj_in_frame  stop_codon  complete_vdj  locus  \\\n",
       "0          NaN          NaN         NaN           NaN    NaN   \n",
       "1          NaN          NaN         NaN           NaN    NaN   \n",
       "2          NaN          NaN         NaN           NaN    NaN   \n",
       "3          NaN          NaN         NaN           NaN    NaN   \n",
       "4          NaN          NaN         NaN           NaN    NaN   \n",
       "5          NaN          NaN         NaN           NaN    NaN   \n",
       "6          NaN          NaN         NaN           NaN    NaN   \n",
       "7          NaN          NaN         NaN           NaN    NaN   \n",
       "8          NaN          NaN         NaN           NaN    NaN   \n",
       "9          NaN          NaN         NaN           NaN    NaN   \n",
       "\n",
       "   sequence_alignment_aa  n1_length        np1  np1_aa  np1_length  n2_length  \\\n",
       "0                    NaN          5      GGGGA     NaN           5          4   \n",
       "1                    NaN          5      GGGGA     NaN           5          4   \n",
       "2                    NaN          9  GGGGAAGGG     NaN           9          1   \n",
       "3                    NaN          6     GGGGAA     NaN           6          3   \n",
       "4                    NaN          6     GGGGAA     NaN           6          3   \n",
       "5                    NaN          6     TGGGGA     NaN           6          4   \n",
       "6                    NaN          6     GGGGAA     NaN           6          4   \n",
       "7                    NaN          6     TGGGGA     NaN           6          4   \n",
       "8                    NaN          1          G     NaN           1          8   \n",
       "9                    NaN          5      GGGGA     NaN           5          5   \n",
       "\n",
       "        np2  np2_aa  np2_length  p3v_length  p5d_length  p3d_length  \\\n",
       "0      CAGC     NaN           4           0           0           0   \n",
       "1      CAGC     NaN           4           0           0           0   \n",
       "2         C     NaN           1           0           0           0   \n",
       "3       AGC     NaN           4           0           0           1   \n",
       "4       AGC     NaN           3           0           0           0   \n",
       "5      CAGC     NaN           4           0           0           0   \n",
       "6      CAGC     NaN           4           0           0           0   \n",
       "7      CAGC     NaN           4           0           0           0   \n",
       "8  AGGGCAGC     NaN           8           0           0           0   \n",
       "9     GCAGC     NaN           5           0           0           0   \n",
       "\n",
       "   p5j_length  scenario_rank  scenario_proba_cond_seq          pgen  quality  \\\n",
       "0           0              1                 0.146984  4.871310e-13      NaN   \n",
       "1           0              2                 0.112527  4.871310e-13      NaN   \n",
       "2           0              3                 0.062955  4.871310e-13      NaN   \n",
       "3           0              4                 0.060409  4.871310e-13      NaN   \n",
       "4           0              5                 0.034684  4.871310e-13      NaN   \n",
       "5           0              6                 0.028806  4.871310e-13      NaN   \n",
       "6           0              7                 0.023637  4.871310e-13      NaN   \n",
       "7           0              8                 0.022053  4.871310e-13      NaN   \n",
       "8           0              9                 0.017562  4.871310e-13      NaN   \n",
       "9           0             10                 0.015878  4.871310e-13      NaN   \n",
       "\n",
       "   quality_alignment  \n",
       "0                NaN  \n",
       "1                NaN  \n",
       "2                NaN  \n",
       "3                NaN  \n",
       "4                NaN  \n",
       "5                NaN  \n",
       "6                NaN  \n",
       "7                NaN  \n",
       "8                NaN  \n",
       "9                NaN  "
      ]
     },
     "execution_count": 62,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_scenarios = p3.evaluate(str_seq_hb, mdl) # , N_scenarios=20\n",
    "df_scenarios"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Evaluation IGoR format"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Writing model parms in file  ./igor_evaluating_mdsvldqo/dataIGoRQVzl4XnKII_mdldata/models/model_parms.txt\n",
      "Writing model marginals in file  ./igor_evaluating_mdsvldqo/dataIGoRQVzl4XnKII_mdldata/models/model_marginals.txt\n",
      "Writing gene anchor's in file  ./igor_evaluating_mdsvldqo/dataIGoRQVzl4XnKII_mdldata/ref_genome/V_gene_CDR3_anchors.csv\n",
      "Writing gene anchor's in file  ./igor_evaluating_mdsvldqo/dataIGoRQVzl4XnKII_mdldata/ref_genome/J_gene_CDR3_anchors.csv\n",
      "/home/olivares/.local/bin/igor -set_wd ./igor_evaluating_mdsvldqo -batch dataIGoRQVzl4XnKII -read_seqs ./igor_evaluating_mdsvldqo/dataIGoRQVzl4XnKIIinput_sequences.csv\n",
      "/home/olivares/.local/bin/igor -set_wd ./igor_evaluating_mdsvldqo -batch dataIGoRQVzl4XnKII -set_genomic  --V ./igor_evaluating_mdsvldqo/dataIGoRQVzl4XnKII_mdldata/ref_genome/genomicVs.fasta --D ./igor_evaluating_mdsvldqo/dataIGoRQVzl4XnKII_mdldata/ref_genome/genomicDs.fasta --J ./igor_evaluating_mdsvldqo/dataIGoRQVzl4XnKII_mdldata/ref_genome/genomicJs.fasta -set_CDR3_anchors  --V ./igor_evaluating_mdsvldqo/dataIGoRQVzl4XnKII_mdldata/ref_genome/V_gene_CDR3_anchors.csv --J ./igor_evaluating_mdsvldqo/dataIGoRQVzl4XnKII_mdldata/ref_genome/J_gene_CDR3_anchors.csv -align  --all  \n",
      "/home/olivares/.local/bin/igor -set_wd ./igor_evaluating_mdsvldqo -batch dataIGoRQVzl4XnKII -set_custom_model ./igor_evaluating_mdsvldqo/dataIGoRQVzl4XnKII_mdldata/models/model_parms.txt ./igor_evaluating_mdsvldqo/dataIGoRQVzl4XnKII_mdldata/models/model_marginals.txt -evaluate  -output  --scenarios 10  --Pgen  \n",
      "igor_fln_generated_realizations_werr:  ./igor_evaluating_mdsvldqo/dataIGoRQVzl4XnKII_output/best_scenarios_counts.csv\n"
     ]
    },
    {
     "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>scenario_rank</th>\n",
       "      <th>scenario_proba_cond_seq</th>\n",
       "      <th>v_choice</th>\n",
       "      <th>j_choice</th>\n",
       "      <th>d_gene</th>\n",
       "      <th>v_3_del</th>\n",
       "      <th>d_5_del</th>\n",
       "      <th>j_5_del</th>\n",
       "      <th>d_3_del</th>\n",
       "      <th>vd_ins</th>\n",
       "      <th>vd_dinucl</th>\n",
       "      <th>dj_ins</th>\n",
       "      <th>dj_dinucl</th>\n",
       "      <th>Mismatches</th>\n",
       "      <th>Pgen_estimate</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>seq_index</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>0.146984</td>\n",
       "      <td>29</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>9</td>\n",
       "      <td>9</td>\n",
       "      <td>6</td>\n",
       "      <td>7</td>\n",
       "      <td>5</td>\n",
       "      <td>[2, 2, 2, 2, 0]</td>\n",
       "      <td>4</td>\n",
       "      <td>[1, 2, 0, 1]</td>\n",
       "      <td>[]</td>\n",
       "      <td>4.871310e-13</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2</td>\n",
       "      <td>0.112527</td>\n",
       "      <td>29</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>9</td>\n",
       "      <td>16</td>\n",
       "      <td>6</td>\n",
       "      <td>4</td>\n",
       "      <td>5</td>\n",
       "      <td>[2, 2, 2, 2, 0]</td>\n",
       "      <td>4</td>\n",
       "      <td>[1, 2, 0, 1]</td>\n",
       "      <td>[]</td>\n",
       "      <td>4.871310e-13</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>3</td>\n",
       "      <td>0.062955</td>\n",
       "      <td>29</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>9</td>\n",
       "      <td>8</td>\n",
       "      <td>6</td>\n",
       "      <td>9</td>\n",
       "      <td>9</td>\n",
       "      <td>[2, 2, 2, 2, 0, 0, 2, 2, 2]</td>\n",
       "      <td>1</td>\n",
       "      <td>[1]</td>\n",
       "      <td>[]</td>\n",
       "      <td>4.871310e-13</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>4</td>\n",
       "      <td>0.060409</td>\n",
       "      <td>29</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>9</td>\n",
       "      <td>17</td>\n",
       "      <td>6</td>\n",
       "      <td>3</td>\n",
       "      <td>6</td>\n",
       "      <td>[2, 2, 2, 2, 0, 0]</td>\n",
       "      <td>3</td>\n",
       "      <td>[1, 2, 0]</td>\n",
       "      <td>[]</td>\n",
       "      <td>4.871310e-13</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>5</td>\n",
       "      <td>0.034684</td>\n",
       "      <td>29</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>9</td>\n",
       "      <td>12</td>\n",
       "      <td>6</td>\n",
       "      <td>4</td>\n",
       "      <td>6</td>\n",
       "      <td>[2, 2, 2, 2, 0, 0]</td>\n",
       "      <td>3</td>\n",
       "      <td>[1, 2, 0]</td>\n",
       "      <td>[]</td>\n",
       "      <td>4.871310e-13</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>6</td>\n",
       "      <td>0.028806</td>\n",
       "      <td>29</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>10</td>\n",
       "      <td>9</td>\n",
       "      <td>6</td>\n",
       "      <td>7</td>\n",
       "      <td>6</td>\n",
       "      <td>[3, 2, 2, 2, 2, 0]</td>\n",
       "      <td>4</td>\n",
       "      <td>[1, 2, 0, 1]</td>\n",
       "      <td>[]</td>\n",
       "      <td>4.871310e-13</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>7</td>\n",
       "      <td>0.023637</td>\n",
       "      <td>29</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>9</td>\n",
       "      <td>13</td>\n",
       "      <td>6</td>\n",
       "      <td>8</td>\n",
       "      <td>6</td>\n",
       "      <td>[2, 2, 2, 2, 0, 0]</td>\n",
       "      <td>4</td>\n",
       "      <td>[1, 2, 0, 1]</td>\n",
       "      <td>[]</td>\n",
       "      <td>4.871310e-13</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>8</td>\n",
       "      <td>0.022053</td>\n",
       "      <td>29</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>10</td>\n",
       "      <td>16</td>\n",
       "      <td>6</td>\n",
       "      <td>4</td>\n",
       "      <td>6</td>\n",
       "      <td>[3, 2, 2, 2, 2, 0]</td>\n",
       "      <td>4</td>\n",
       "      <td>[1, 2, 0, 1]</td>\n",
       "      <td>[]</td>\n",
       "      <td>4.871310e-13</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>9</td>\n",
       "      <td>0.017562</td>\n",
       "      <td>29</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>9</td>\n",
       "      <td>13</td>\n",
       "      <td>6</td>\n",
       "      <td>7</td>\n",
       "      <td>1</td>\n",
       "      <td>[2]</td>\n",
       "      <td>8</td>\n",
       "      <td>[1, 2, 0, 1, 2, 2, 2, 0]</td>\n",
       "      <td>[]</td>\n",
       "      <td>4.871310e-13</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>10</td>\n",
       "      <td>0.015878</td>\n",
       "      <td>29</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>9</td>\n",
       "      <td>16</td>\n",
       "      <td>6</td>\n",
       "      <td>5</td>\n",
       "      <td>5</td>\n",
       "      <td>[2, 2, 2, 2, 0]</td>\n",
       "      <td>5</td>\n",
       "      <td>[1, 2, 0, 1, 2]</td>\n",
       "      <td>[]</td>\n",
       "      <td>4.871310e-13</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "           scenario_rank  scenario_proba_cond_seq  v_choice  j_choice  d_gene  \\\n",
       "seq_index                                                                       \n",
       "0                      1                 0.146984        29         2       0   \n",
       "0                      2                 0.112527        29         2       2   \n",
       "0                      3                 0.062955        29         2       0   \n",
       "0                      4                 0.060409        29         2       2   \n",
       "0                      5                 0.034684        29         2       0   \n",
       "0                      6                 0.028806        29         2       0   \n",
       "0                      7                 0.023637        29         2       2   \n",
       "0                      8                 0.022053        29         2       2   \n",
       "0                      9                 0.017562        29         2       2   \n",
       "0                     10                 0.015878        29         2       2   \n",
       "\n",
       "           v_3_del  d_5_del  j_5_del  d_3_del  vd_ins  \\\n",
       "seq_index                                               \n",
       "0                9        9        6        7       5   \n",
       "0                9       16        6        4       5   \n",
       "0                9        8        6        9       9   \n",
       "0                9       17        6        3       6   \n",
       "0                9       12        6        4       6   \n",
       "0               10        9        6        7       6   \n",
       "0                9       13        6        8       6   \n",
       "0               10       16        6        4       6   \n",
       "0                9       13        6        7       1   \n",
       "0                9       16        6        5       5   \n",
       "\n",
       "                             vd_dinucl  dj_ins                 dj_dinucl  \\\n",
       "seq_index                                                                  \n",
       "0                      [2, 2, 2, 2, 0]       4              [1, 2, 0, 1]   \n",
       "0                      [2, 2, 2, 2, 0]       4              [1, 2, 0, 1]   \n",
       "0          [2, 2, 2, 2, 0, 0, 2, 2, 2]       1                       [1]   \n",
       "0                   [2, 2, 2, 2, 0, 0]       3                 [1, 2, 0]   \n",
       "0                   [2, 2, 2, 2, 0, 0]       3                 [1, 2, 0]   \n",
       "0                   [3, 2, 2, 2, 2, 0]       4              [1, 2, 0, 1]   \n",
       "0                   [2, 2, 2, 2, 0, 0]       4              [1, 2, 0, 1]   \n",
       "0                   [3, 2, 2, 2, 2, 0]       4              [1, 2, 0, 1]   \n",
       "0                                  [2]       8  [1, 2, 0, 1, 2, 2, 2, 0]   \n",
       "0                      [2, 2, 2, 2, 0]       5           [1, 2, 0, 1, 2]   \n",
       "\n",
       "          Mismatches  Pgen_estimate  \n",
       "seq_index                            \n",
       "0                 []   4.871310e-13  \n",
       "0                 []   4.871310e-13  \n",
       "0                 []   4.871310e-13  \n",
       "0                 []   4.871310e-13  \n",
       "0                 []   4.871310e-13  \n",
       "0                 []   4.871310e-13  \n",
       "0                 []   4.871310e-13  \n",
       "0                 []   4.871310e-13  \n",
       "0                 []   4.871310e-13  \n",
       "0                 []   4.871310e-13  "
      ]
     },
     "execution_count": 63,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_scenarios = p3.evaluate(str_seq_hb, mdl_hb, airr_format=False) # , N_scenarios=20\n",
    "df_scenarios"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Visualize scenarios"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "[encoded data, 20896 characters]\n",
      "text/plain": [
       "<Figure size 1440x720 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "[encoded data, 20760 characters]\n",
      "text/plain": [
       "<Figure size 1440x720 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "[encoded data, 20588 characters]\n",
      "text/plain": [
       "<Figure size 1440x720 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "[encoded data, 20708 characters]\n",
      "text/plain": [
       "<Figure size 1440x720 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "[encoded data, 20560 characters]\n",
      "text/plain": [
       "<Figure size 1440x720 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "[encoded data, 21080 characters]\n",
      "text/plain": [
       "<Figure size 1440x720 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "[encoded data, 20548 characters]\n",
      "text/plain": [
       "<Figure size 1440x720 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "[encoded data, 20944 characters]\n",
      "text/plain": [
       "<Figure size 1440x720 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "[encoded data, 20528 characters]\n",
      "text/plain": [
       "<Figure size 1440x720 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "[encoded data, 20744 characters]\n",
      "text/plain": [
       "<Figure size 1440x720 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "for ii, ps_scenario in df_scenarios.iterrows():\n",
    "    mdl_hb.plot_scenario(ps_scenario) #, nt_lim=(200,340))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(<Figure size 1440x720 with 1 Axes>, <AxesSubplot:>)"
      ]
     },
     "execution_count": 65,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "[encoded data, 20424 characters]\n",
      "text/plain": [
       "<Figure size 1440x720 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "import pandas as pd\n",
    "dict_scenario_fict = {\n",
    "            'scenario_rank' : 1,\n",
    "            'scenario_proba_cond_seq' : 0.9999,\n",
    "            'v_choice' : 61,\n",
    "            'j_choice' : 1,\n",
    "            'd_gene' : 0,\n",
    "            'v_3_del': 0,\n",
    "            'd_5_del': 1,\n",
    "            'j_5_del': 8,\n",
    "            'd_3_del': 6,\n",
    "            'vd_ins' : 1,\n",
    "            'vd_dinucl': [1],\n",
    "            'dj_ins': 2,\n",
    "            'dj_dinucl': [0, 3],\n",
    "            'Mismatches' : [],\n",
    "            'norm_scenario_proba_cond_seq': 0.000225\n",
    "        }\n",
    "ps_scenario_fict = pd.Series(dict_scenario_fict)\n",
    "mdl_hb.plot_scenario(ps_scenario_fict)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "OrderedDict([('gene_template',\n",
       "              'GGTGCTGTCGTCTCTCAACATCCGAGCTGGGTTATCTGTAAGAGTGGAACCTCTGTGAAGATCGAGTGCCGTTCCCTGGACTTTCAGGCCACAACTATGTTTTGGTATCGTCAGTTCCCGAAACAGAGTCTCATGCTGATGGCAACTTCCAATGAGGGCTCCAAGGCCACATACGAGCAAGGCGTCGAGAAGGACAAGTTTCTCATCAACCATGCAAGCCTGACCTTGTCCACTCTGACAGTGACCAGTGCCCATCCTGAAGACAGCAGCTTCTACATCTGCAGTGCTAGAGA'),\n",
       "             ('int_gene_5_del', 0),\n",
       "             ('int_gene_3_del', 5),\n",
       "             ('palindrome_5_end', ''),\n",
       "             ('gene_ini', 0),\n",
       "             ('gene_end', 288),\n",
       "             ('gene_cut',\n",
       "              'GGTGCTGTCGTCTCTCAACATCCGAGCTGGGTTATCTGTAAGAGTGGAACCTCTGTGAAGATCGAGTGCCGTTCCCTGGACTTTCAGGCCACAACTATGTTTTGGTATCGTCAGTTCCCGAAACAGAGTCTCATGCTGATGGCAACTTCCAATGAGGGCTCCAAGGCCACATACGAGCAAGGCGTCGAGAAGGACAAGTTTCTCATCAACCATGCAAGCCTGACCTTGTCCACTCTGACAGTGACCAGTGCCCATCCTGAAGACAGCAGCTTCTACATCTGCAGTGCT'),\n",
       "             ('palindrome_3_end', ''),\n",
       "             ('gene_segment',\n",
       "              'GGTGCTGTCGTCTCTCAACATCCGAGCTGGGTTATCTGTAAGAGTGGAACCTCTGTGAAGATCGAGTGCCGTTCCCTGGACTTTCAGGCCACAACTATGTTTTGGTATCGTCAGTTCCCGAAACAGAGTCTCATGCTGATGGCAACTTCCAATGAGGGCTCCAAGGCCACATACGAGCAAGGCGTCGAGAAGGACAAGTTTCTCATCAACCATGCAAGCCTGACCTTGTCCACTCTGACAGTGACCAGTGCCCATCCTGAAGACAGCAGCTTCTACATCTGCAGTGCT'),\n",
       "             ('gene_description',\n",
       "              \"TRBV20-1*01 (v_choice: 29) (v_3_del: 9), 3'del : 5\")])"
      ]
     },
     "execution_count": 66,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_scenario_aln_fict = mdl_hb.get_df_scenario_aln_from_scenario(ps_scenario_fict)\n",
    "df_scenario_aln_fict\n",
    "mdl_hb.get_gene_segment_dict('V', ps_scenario)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 67,
   "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>value</th>\n",
       "      <th>name</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>id</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>GGGACAGGGGGC</td>\n",
       "      <td>TRBD1*01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>GGGACTAGCGGGGGGG</td>\n",
       "      <td>TRBD2*01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>GGGACTAGCGGGAGGG</td>\n",
       "      <td>TRBD2*02</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "               value       name\n",
       "id                             \n",
       "0       GGGACAGGGGGC   TRBD1*01\n",
       "1   GGGACTAGCGGGGGGG   TRBD2*01\n",
       "2   GGGACTAGCGGGAGGG   TRBD2*02"
      ]
     },
     "execution_count": 67,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mdl_hb.parms['d_gene']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 68,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on method plot_scenario in module pygor3.IgorIO:\n",
      "\n",
      "plot_scenario(ps_scenario, nt_lim: Union[NoneType, tuple, list] = None, show_CDR3=True, ax=None) method of pygor3.IgorIO.IgorModel instance\n",
      "    Return matplotlib fig, ax\n",
      "    :param ps_scenario: Pandas Series scenario\n",
      "    :param nt_lim:Union[None,tuple,list] region limits to show the scenario alignment\n",
      "    default give boundaries around CDR3, if no anchors in model, show the whole scenario\n",
      "    :param show_CDR3: Show CDR3 lines default(=True)\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(mdl_hb.plot_scenario)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Observables from scenarios"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Predefine Functions for Scenarios"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 69,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "igor_fln_generated_realizations_werr:  best_scenarios_counts.csv\n"
     ]
    }
   ],
   "source": [
    "fln_scenarios = \"best_scenarios_counts.csv\"\n",
    "df_scenarios_many = mdl_hb.get_dataframe_scenarios(fln_scenarios)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Pairwise Probabilities"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 70,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on method get_P_from_scenarios_cols in module pygor3.IgorIO:\n",
      "\n",
      "get_P_from_scenarios_cols(df_scenarios, colname_list) method of pygor3.IgorIO.IgorModel instance\n",
      "    Return xarray with marginalize probabilities of listed columns in dataframe scenarios df_scenarios\n",
      "    :param df_scenarios: Scenarios with normalize probability. Loaded with self.get_dataframe_scenarios()\n",
      "    :param colname_list: List of variables preserve for marginalization\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(mdl_hb.get_P_from_scenarios_cols)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 71,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.collections.QuadMesh at 0x7fac14e44f10>"
      ]
     },
     "execution_count": 71,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "[encoded data, 16496 characters]\n",
      "text/plain": [
       "<Figure size 432x288 with 2 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "Pjoint_V_J_scens = mdl_hb.get_P_from_scenarios_cols(df_scenarios_many, ['v_choice', 'j_choice'])\n",
    "Pjoint_V_J_scens.plot(cmap='gnuplot2_r')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 72,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.collections.QuadMesh at 0x7fac14d4ef50>"
      ]
     },
     "execution_count": 72,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "[encoded data, 17176 characters]\n",
      "text/plain": [
       "<Figure size 432x288 with 2 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "mdl_hb.get_P_joint(['v_choice', 'j_choice']).plot(cmap='gnuplot2_r')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Mutual Information from scenarios"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 73,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on method get_mutual_information_events_from_df_scenarios in module pygor3.IgorIO:\n",
      "\n",
      "get_mutual_information_events_from_df_scenarios(df_scenarios, event_nickname_x, event_nickname_y) method of pygor3.IgorIO.IgorModel instance\n",
      "    Return mutual information in log10 of the desired events\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(mdl_hb.get_mutual_information_events_from_df_scenarios)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 74,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "mutual_information ( v_choice ,  j_choice ):  0.6392623620052954\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div><svg style=\"position: absolute; width: 0; height: 0; overflow: hidden\">\n",
       "<defs>\n",
       "<symbol id=\"icon-database\" viewBox=\"0 0 32 32\">\n",
       "<path d=\"M16 0c-8.837 0-16 2.239-16 5v4c0 2.761 7.163 5 16 5s16-2.239 16-5v-4c0-2.761-7.163-5-16-5z\"></path>\n",
       "<path d=\"M16 17c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
       "<path d=\"M16 26c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
       "</symbol>\n",
       "<symbol id=\"icon-file-text2\" viewBox=\"0 0 32 32\">\n",
       "<path d=\"M28.681 7.159c-0.694-0.947-1.662-2.053-2.724-3.116s-2.169-2.030-3.116-2.724c-1.612-1.182-2.393-1.319-2.841-1.319h-15.5c-1.378 0-2.5 1.121-2.5 2.5v27c0 1.378 1.122 2.5 2.5 2.5h23c1.378 0 2.5-1.122 2.5-2.5v-19.5c0-0.448-0.137-1.23-1.319-2.841zM24.543 5.457c0.959 0.959 1.712 1.825 2.268 2.543h-4.811v-4.811c0.718 0.556 1.584 1.309 2.543 2.268zM28 29.5c0 0.271-0.229 0.5-0.5 0.5h-23c-0.271 0-0.5-0.229-0.5-0.5v-27c0-0.271 0.229-0.5 0.5-0.5 0 0 15.499-0 15.5 0v7c0 0.552 0.448 1 1 1h7v19.5z\"></path>\n",
       "<path d=\"M23 26h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
       "<path d=\"M23 22h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
       "<path d=\"M23 18h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
       "</symbol>\n",
       "</defs>\n",
       "</svg>\n",
       "<style>/* CSS stylesheet for displaying xarray objects in jupyterlab.\n",
       " *\n",
       " */\n",
       "\n",
       ":root {\n",
       "  --xr-font-color0: var(--jp-content-font-color0, rgba(0, 0, 0, 1));\n",
       "  --xr-font-color2: var(--jp-content-font-color2, rgba(0, 0, 0, 0.54));\n",
       "  --xr-font-color3: var(--jp-content-font-color3, rgba(0, 0, 0, 0.38));\n",
       "  --xr-border-color: var(--jp-border-color2, #e0e0e0);\n",
       "  --xr-disabled-color: var(--jp-layout-color3, #bdbdbd);\n",
       "  --xr-background-color: var(--jp-layout-color0, white);\n",
       "  --xr-background-color-row-even: var(--jp-layout-color1, white);\n",
       "  --xr-background-color-row-odd: var(--jp-layout-color2, #eeeeee);\n",
       "}\n",
       "\n",
       "html[theme=dark],\n",
       "body.vscode-dark {\n",
       "  --xr-font-color0: rgba(255, 255, 255, 1);\n",
       "  --xr-font-color2: rgba(255, 255, 255, 0.54);\n",
       "  --xr-font-color3: rgba(255, 255, 255, 0.38);\n",
       "  --xr-border-color: #1F1F1F;\n",
       "  --xr-disabled-color: #515151;\n",
       "  --xr-background-color: #111111;\n",
       "  --xr-background-color-row-even: #111111;\n",
       "  --xr-background-color-row-odd: #313131;\n",
       "}\n",
       "\n",
       ".xr-wrap {\n",
       "  display: block;\n",
       "  min-width: 300px;\n",
       "  max-width: 700px;\n",
       "}\n",
       "\n",
       ".xr-text-repr-fallback {\n",
       "  /* fallback to plain text repr when CSS is not injected (untrusted notebook) */\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-header {\n",
       "  padding-top: 6px;\n",
       "  padding-bottom: 6px;\n",
       "  margin-bottom: 4px;\n",
       "  border-bottom: solid 1px var(--xr-border-color);\n",
       "}\n",
       "\n",
       ".xr-header > div,\n",
       ".xr-header > ul {\n",
       "  display: inline;\n",
       "  margin-top: 0;\n",
       "  margin-bottom: 0;\n",
       "}\n",
       "\n",
       ".xr-obj-type,\n",
       ".xr-array-name {\n",
       "  margin-left: 2px;\n",
       "  margin-right: 10px;\n",
       "}\n",
       "\n",
       ".xr-obj-type {\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-sections {\n",
       "  padding-left: 0 !important;\n",
       "  display: grid;\n",
       "  grid-template-columns: 150px auto auto 1fr 20px 20px;\n",
       "}\n",
       "\n",
       ".xr-section-item {\n",
       "  display: contents;\n",
       "}\n",
       "\n",
       ".xr-section-item input {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-section-item input + label {\n",
       "  color: var(--xr-disabled-color);\n",
       "}\n",
       "\n",
       ".xr-section-item input:enabled + label {\n",
       "  cursor: pointer;\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-section-item input:enabled + label:hover {\n",
       "  color: var(--xr-font-color0);\n",
       "}\n",
       "\n",
       ".xr-section-summary {\n",
       "  grid-column: 1;\n",
       "  color: var(--xr-font-color2);\n",
       "  font-weight: 500;\n",
       "}\n",
       "\n",
       ".xr-section-summary > span {\n",
       "  display: inline-block;\n",
       "  padding-left: 0.5em;\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:disabled + label {\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-section-summary-in + label:before {\n",
       "  display: inline-block;\n",
       "  content: '►';\n",
       "  font-size: 11px;\n",
       "  width: 15px;\n",
       "  text-align: center;\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:disabled + label:before {\n",
       "  color: var(--xr-disabled-color);\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:checked + label:before {\n",
       "  content: '▼';\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:checked + label > span {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-section-summary,\n",
       ".xr-section-inline-details {\n",
       "  padding-top: 4px;\n",
       "  padding-bottom: 4px;\n",
       "}\n",
       "\n",
       ".xr-section-inline-details {\n",
       "  grid-column: 2 / -1;\n",
       "}\n",
       "\n",
       ".xr-section-details {\n",
       "  display: none;\n",
       "  grid-column: 1 / -1;\n",
       "  margin-bottom: 5px;\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:checked ~ .xr-section-details {\n",
       "  display: contents;\n",
       "}\n",
       "\n",
       ".xr-array-wrap {\n",
       "  grid-column: 1 / -1;\n",
       "  display: grid;\n",
       "  grid-template-columns: 20px auto;\n",
       "}\n",
       "\n",
       ".xr-array-wrap > label {\n",
       "  grid-column: 1;\n",
       "  vertical-align: top;\n",
       "}\n",
       "\n",
       ".xr-preview {\n",
       "  color: var(--xr-font-color3);\n",
       "}\n",
       "\n",
       ".xr-array-preview,\n",
       ".xr-array-data {\n",
       "  padding: 0 5px !important;\n",
       "  grid-column: 2;\n",
       "}\n",
       "\n",
       ".xr-array-data,\n",
       ".xr-array-in:checked ~ .xr-array-preview {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-array-in:checked ~ .xr-array-data,\n",
       ".xr-array-preview {\n",
       "  display: inline-block;\n",
       "}\n",
       "\n",
       ".xr-dim-list {\n",
       "  display: inline-block !important;\n",
       "  list-style: none;\n",
       "  padding: 0 !important;\n",
       "  margin: 0;\n",
       "}\n",
       "\n",
       ".xr-dim-list li {\n",
       "  display: inline-block;\n",
       "  padding: 0;\n",
       "  margin: 0;\n",
       "}\n",
       "\n",
       ".xr-dim-list:before {\n",
       "  content: '(';\n",
       "}\n",
       "\n",
       ".xr-dim-list:after {\n",
       "  content: ')';\n",
       "}\n",
       "\n",
       ".xr-dim-list li:not(:last-child):after {\n",
       "  content: ',';\n",
       "  padding-right: 5px;\n",
       "}\n",
       "\n",
       ".xr-has-index {\n",
       "  font-weight: bold;\n",
       "}\n",
       "\n",
       ".xr-var-list,\n",
       ".xr-var-item {\n",
       "  display: contents;\n",
       "}\n",
       "\n",
       ".xr-var-item > div,\n",
       ".xr-var-item label,\n",
       ".xr-var-item > .xr-var-name span {\n",
       "  background-color: var(--xr-background-color-row-even);\n",
       "  margin-bottom: 0;\n",
       "}\n",
       "\n",
       ".xr-var-item > .xr-var-name:hover span {\n",
       "  padding-right: 5px;\n",
       "}\n",
       "\n",
       ".xr-var-list > li:nth-child(odd) > div,\n",
       ".xr-var-list > li:nth-child(odd) > label,\n",
       ".xr-var-list > li:nth-child(odd) > .xr-var-name span {\n",
       "  background-color: var(--xr-background-color-row-odd);\n",
       "}\n",
       "\n",
       ".xr-var-name {\n",
       "  grid-column: 1;\n",
       "}\n",
       "\n",
       ".xr-var-dims {\n",
       "  grid-column: 2;\n",
       "}\n",
       "\n",
       ".xr-var-dtype {\n",
       "  grid-column: 3;\n",
       "  text-align: right;\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-var-preview {\n",
       "  grid-column: 4;\n",
       "}\n",
       "\n",
       ".xr-var-name,\n",
       ".xr-var-dims,\n",
       ".xr-var-dtype,\n",
       ".xr-preview,\n",
       ".xr-attrs dt {\n",
       "  white-space: nowrap;\n",
       "  overflow: hidden;\n",
       "  text-overflow: ellipsis;\n",
       "  padding-right: 10px;\n",
       "}\n",
       "\n",
       ".xr-var-name:hover,\n",
       ".xr-var-dims:hover,\n",
       ".xr-var-dtype:hover,\n",
       ".xr-attrs dt:hover {\n",
       "  overflow: visible;\n",
       "  width: auto;\n",
       "  z-index: 1;\n",
       "}\n",
       "\n",
       ".xr-var-attrs,\n",
       ".xr-var-data {\n",
       "  display: none;\n",
       "  background-color: var(--xr-background-color) !important;\n",
       "  padding-bottom: 5px !important;\n",
       "}\n",
       "\n",
       ".xr-var-attrs-in:checked ~ .xr-var-attrs,\n",
       ".xr-var-data-in:checked ~ .xr-var-data {\n",
       "  display: block;\n",
       "}\n",
       "\n",
       ".xr-var-data > table {\n",
       "  float: right;\n",
       "}\n",
       "\n",
       ".xr-var-name span,\n",
       ".xr-var-data,\n",
       ".xr-attrs {\n",
       "  padding-left: 25px !important;\n",
       "}\n",
       "\n",
       ".xr-attrs,\n",
       ".xr-var-attrs,\n",
       ".xr-var-data {\n",
       "  grid-column: 1 / -1;\n",
       "}\n",
       "\n",
       "dl.xr-attrs {\n",
       "  padding: 0;\n",
       "  margin: 0;\n",
       "  display: grid;\n",
       "  grid-template-columns: 125px auto;\n",
       "}\n",
       "\n",
       ".xr-attrs dt,\n",
       ".xr-attrs dd {\n",
       "  padding: 0;\n",
       "  margin: 0;\n",
       "  float: left;\n",
       "  padding-right: 10px;\n",
       "  width: auto;\n",
       "}\n",
       "\n",
       ".xr-attrs dt {\n",
       "  font-weight: normal;\n",
       "  grid-column: 1;\n",
       "}\n",
       "\n",
       ".xr-attrs dt:hover span {\n",
       "  display: inline-block;\n",
       "  background: var(--xr-background-color);\n",
       "  padding-right: 10px;\n",
       "}\n",
       "\n",
       ".xr-attrs dd {\n",
       "  grid-column: 2;\n",
       "  white-space: pre-wrap;\n",
       "  word-break: break-all;\n",
       "}\n",
       "\n",
       ".xr-icon-database,\n",
       ".xr-icon-file-text2 {\n",
       "  display: inline-block;\n",
       "  vertical-align: middle;\n",
       "  width: 1em;\n",
       "  height: 1.5em !important;\n",
       "  stroke-width: 0;\n",
       "  stroke: currentColor;\n",
       "  fill: currentColor;\n",
       "}\n",
       "</style><pre class='xr-text-repr-fallback'>&lt;xarray.DataArray &#x27;norm_scenario_proba_cond_seq&#x27; ()&gt;\n",
       "array(0.63926236)</pre><div class='xr-wrap' hidden><div class='xr-header'><div class='xr-obj-type'>xarray.DataArray</div><div class='xr-array-name'>'norm_scenario_proba_cond_seq'</div></div><ul class='xr-sections'><li class='xr-section-item'><div class='xr-array-wrap'><input id='section-5bc9f9ca-76be-4d5e-a7e6-3113ab67a0a2' class='xr-array-in' type='checkbox' checked><label for='section-5bc9f9ca-76be-4d5e-a7e6-3113ab67a0a2' title='Show/hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-array-preview xr-preview'><span>0.6393</span></div><div class='xr-array-data'><pre>array(0.63926236)</pre></div></div></li><li class='xr-section-item'><input id='section-58b16542-941d-4c08-a9b3-191d7676c84a' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-58b16542-941d-4c08-a9b3-191d7676c84a' class='xr-section-summary'  title='Expand/collapse section'>Coordinates: <span>(0)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'></ul></div></li><li class='xr-section-item'><input id='section-4c357fd9-23ed-4db7-8a38-ca4faf6ae021' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-4c357fd9-23ed-4db7-8a38-ca4faf6ae021' class='xr-section-summary'  title='Expand/collapse section'>Attributes: <span>(0)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><dl class='xr-attrs'></dl></div></li></ul></div></div>"
      ],
      "text/plain": [
       "<xarray.DataArray 'norm_scenario_proba_cond_seq' ()>\n",
       "array(0.63926236)"
      ]
     },
     "execution_count": 74,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mdl_hb.get_mutual_information_events_from_df_scenarios(df_scenarios_many, 'v_choice', 'j_choice')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 75,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "mutual_information ( v_choice ,  j_choice ):  0.6392623620052954\n",
      "mutual_information ( v_choice ,  d_gene ):  0.08894391386660068\n",
      "mutual_information ( v_choice ,  v_3_del ):  0.7021801087511944\n",
      "mutual_information ( v_choice ,  d_5_del ):  0.35886454309758736\n",
      "mutual_information ( v_choice ,  j_5_del ):  0.4667910640736827\n",
      "mutual_information ( v_choice ,  d_3_del ):  0.3381390129055559\n",
      "mutual_information ( v_choice ,  vd_ins ):  0.36950632876861056\n",
      "mutual_information ( v_choice ,  dj_ins ):  0.34050716113668833\n",
      "mutual_information ( j_choice ,  d_gene ):  0.16839619808892387\n",
      "mutual_information ( j_choice ,  v_3_del ):  0.1373839342864651\n",
      "mutual_information ( j_choice ,  d_5_del ):  0.11353204598699257\n",
      "mutual_information ( j_choice ,  j_5_del ):  0.44550937210770414\n",
      "mutual_information ( j_choice ,  d_3_del ):  0.11443530326748617\n",
      "mutual_information ( j_choice ,  vd_ins ):  0.11203857283894578\n",
      "mutual_information ( j_choice ,  dj_ins ):  0.09776360260846355\n",
      "mutual_information ( d_gene ,  v_3_del ):  0.017241089783731553\n",
      "mutual_information ( d_gene ,  d_5_del ):  0.36172414085319887\n",
      "mutual_information ( d_gene ,  j_5_del ):  0.021864784540005937\n",
      "mutual_information ( d_gene ,  d_3_del ):  0.22353112818847967\n",
      "mutual_information ( d_gene ,  vd_ins ):  0.013194437391113211\n",
      "mutual_information ( d_gene ,  dj_ins ):  0.01294449164566809\n",
      "mutual_information ( v_3_del ,  d_5_del ):  0.06598437525781697\n",
      "mutual_information ( v_3_del ,  j_5_del ):  0.09843108497391649\n",
      "mutual_information ( v_3_del ,  d_3_del ):  0.06941838791192181\n",
      "mutual_information ( v_3_del ,  vd_ins ):  0.10582382685367009\n",
      "mutual_information ( v_3_del ,  dj_ins ):  0.07374102134403618\n",
      "mutual_information ( d_5_del ,  j_5_del ):  0.08378406617127063\n",
      "mutual_information ( d_5_del ,  d_3_del ):  0.4950198124493378\n",
      "mutual_information ( d_5_del ,  vd_ins ):  0.10780812230061945\n",
      "mutual_information ( d_5_del ,  dj_ins ):  0.07617536406698441\n",
      "mutual_information ( j_5_del ,  d_3_del ):  0.08559953020573469\n",
      "mutual_information ( j_5_del ,  vd_ins ):  0.07299823195715721\n",
      "mutual_information ( j_5_del ,  dj_ins ):  0.10957597446165623\n",
      "mutual_information ( d_3_del ,  vd_ins ):  0.06822031197593291\n",
      "mutual_information ( d_3_del ,  dj_ins ):  0.08640307827393552\n",
      "mutual_information ( vd_ins ,  dj_ins ):  0.06747319489954777\n"
     ]
    }
   ],
   "source": [
    "da_mi_scenarios = mdl_hb.get_mutual_information_from_df_scenarios(df_scenarios_many)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 76,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><svg style=\"position: absolute; width: 0; height: 0; overflow: hidden\">\n",
       "<defs>\n",
       "<symbol id=\"icon-database\" viewBox=\"0 0 32 32\">\n",
       "<path d=\"M16 0c-8.837 0-16 2.239-16 5v4c0 2.761 7.163 5 16 5s16-2.239 16-5v-4c0-2.761-7.163-5-16-5z\"></path>\n",
       "<path d=\"M16 17c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
       "<path d=\"M16 26c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
       "</symbol>\n",
       "<symbol id=\"icon-file-text2\" viewBox=\"0 0 32 32\">\n",
       "<path d=\"M28.681 7.159c-0.694-0.947-1.662-2.053-2.724-3.116s-2.169-2.030-3.116-2.724c-1.612-1.182-2.393-1.319-2.841-1.319h-15.5c-1.378 0-2.5 1.121-2.5 2.5v27c0 1.378 1.122 2.5 2.5 2.5h23c1.378 0 2.5-1.122 2.5-2.5v-19.5c0-0.448-0.137-1.23-1.319-2.841zM24.543 5.457c0.959 0.959 1.712 1.825 2.268 2.543h-4.811v-4.811c0.718 0.556 1.584 1.309 2.543 2.268zM28 29.5c0 0.271-0.229 0.5-0.5 0.5h-23c-0.271 0-0.5-0.229-0.5-0.5v-27c0-0.271 0.229-0.5 0.5-0.5 0 0 15.499-0 15.5 0v7c0 0.552 0.448 1 1 1h7v19.5z\"></path>\n",
       "<path d=\"M23 26h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
       "<path d=\"M23 22h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
       "<path d=\"M23 18h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
       "</symbol>\n",
       "</defs>\n",
       "</svg>\n",
       "<style>/* CSS stylesheet for displaying xarray objects in jupyterlab.\n",
       " *\n",
       " */\n",
       "\n",
       ":root {\n",
       "  --xr-font-color0: var(--jp-content-font-color0, rgba(0, 0, 0, 1));\n",
       "  --xr-font-color2: var(--jp-content-font-color2, rgba(0, 0, 0, 0.54));\n",
       "  --xr-font-color3: var(--jp-content-font-color3, rgba(0, 0, 0, 0.38));\n",
       "  --xr-border-color: var(--jp-border-color2, #e0e0e0);\n",
       "  --xr-disabled-color: var(--jp-layout-color3, #bdbdbd);\n",
       "  --xr-background-color: var(--jp-layout-color0, white);\n",
       "  --xr-background-color-row-even: var(--jp-layout-color1, white);\n",
       "  --xr-background-color-row-odd: var(--jp-layout-color2, #eeeeee);\n",
       "}\n",
       "\n",
       "html[theme=dark],\n",
       "body.vscode-dark {\n",
       "  --xr-font-color0: rgba(255, 255, 255, 1);\n",
       "  --xr-font-color2: rgba(255, 255, 255, 0.54);\n",
       "  --xr-font-color3: rgba(255, 255, 255, 0.38);\n",
       "  --xr-border-color: #1F1F1F;\n",
       "  --xr-disabled-color: #515151;\n",
       "  --xr-background-color: #111111;\n",
       "  --xr-background-color-row-even: #111111;\n",
       "  --xr-background-color-row-odd: #313131;\n",
       "}\n",
       "\n",
       ".xr-wrap {\n",
       "  display: block;\n",
       "  min-width: 300px;\n",
       "  max-width: 700px;\n",
       "}\n",
       "\n",
       ".xr-text-repr-fallback {\n",
       "  /* fallback to plain text repr when CSS is not injected (untrusted notebook) */\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-header {\n",
       "  padding-top: 6px;\n",
       "  padding-bottom: 6px;\n",
       "  margin-bottom: 4px;\n",
       "  border-bottom: solid 1px var(--xr-border-color);\n",
       "}\n",
       "\n",
       ".xr-header > div,\n",
       ".xr-header > ul {\n",
       "  display: inline;\n",
       "  margin-top: 0;\n",
       "  margin-bottom: 0;\n",
       "}\n",
       "\n",
       ".xr-obj-type,\n",
       ".xr-array-name {\n",
       "  margin-left: 2px;\n",
       "  margin-right: 10px;\n",
       "}\n",
       "\n",
       ".xr-obj-type {\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-sections {\n",
       "  padding-left: 0 !important;\n",
       "  display: grid;\n",
       "  grid-template-columns: 150px auto auto 1fr 20px 20px;\n",
       "}\n",
       "\n",
       ".xr-section-item {\n",
       "  display: contents;\n",
       "}\n",
       "\n",
       ".xr-section-item input {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-section-item input + label {\n",
       "  color: var(--xr-disabled-color);\n",
       "}\n",
       "\n",
       ".xr-section-item input:enabled + label {\n",
       "  cursor: pointer;\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-section-item input:enabled + label:hover {\n",
       "  color: var(--xr-font-color0);\n",
       "}\n",
       "\n",
       ".xr-section-summary {\n",
       "  grid-column: 1;\n",
       "  color: var(--xr-font-color2);\n",
       "  font-weight: 500;\n",
       "}\n",
       "\n",
       ".xr-section-summary > span {\n",
       "  display: inline-block;\n",
       "  padding-left: 0.5em;\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:disabled + label {\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-section-summary-in + label:before {\n",
       "  display: inline-block;\n",
       "  content: '►';\n",
       "  font-size: 11px;\n",
       "  width: 15px;\n",
       "  text-align: center;\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:disabled + label:before {\n",
       "  color: var(--xr-disabled-color);\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:checked + label:before {\n",
       "  content: '▼';\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:checked + label > span {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-section-summary,\n",
       ".xr-section-inline-details {\n",
       "  padding-top: 4px;\n",
       "  padding-bottom: 4px;\n",
       "}\n",
       "\n",
       ".xr-section-inline-details {\n",
       "  grid-column: 2 / -1;\n",
       "}\n",
       "\n",
       ".xr-section-details {\n",
       "  display: none;\n",
       "  grid-column: 1 / -1;\n",
       "  margin-bottom: 5px;\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:checked ~ .xr-section-details {\n",
       "  display: contents;\n",
       "}\n",
       "\n",
       ".xr-array-wrap {\n",
       "  grid-column: 1 / -1;\n",
       "  display: grid;\n",
       "  grid-template-columns: 20px auto;\n",
       "}\n",
       "\n",
       ".xr-array-wrap > label {\n",
       "  grid-column: 1;\n",
       "  vertical-align: top;\n",
       "}\n",
       "\n",
       ".xr-preview {\n",
       "  color: var(--xr-font-color3);\n",
       "}\n",
       "\n",
       ".xr-array-preview,\n",
       ".xr-array-data {\n",
       "  padding: 0 5px !important;\n",
       "  grid-column: 2;\n",
       "}\n",
       "\n",
       ".xr-array-data,\n",
       ".xr-array-in:checked ~ .xr-array-preview {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-array-in:checked ~ .xr-array-data,\n",
       ".xr-array-preview {\n",
       "  display: inline-block;\n",
       "}\n",
       "\n",
       ".xr-dim-list {\n",
       "  display: inline-block !important;\n",
       "  list-style: none;\n",
       "  padding: 0 !important;\n",
       "  margin: 0;\n",
       "}\n",
       "\n",
       ".xr-dim-list li {\n",
       "  display: inline-block;\n",
       "  padding: 0;\n",
       "  margin: 0;\n",
       "}\n",
       "\n",
       ".xr-dim-list:before {\n",
       "  content: '(';\n",
       "}\n",
       "\n",
       ".xr-dim-list:after {\n",
       "  content: ')';\n",
       "}\n",
       "\n",
       ".xr-dim-list li:not(:last-child):after {\n",
       "  content: ',';\n",
       "  padding-right: 5px;\n",
       "}\n",
       "\n",
       ".xr-has-index {\n",
       "  font-weight: bold;\n",
       "}\n",
       "\n",
       ".xr-var-list,\n",
       ".xr-var-item {\n",
       "  display: contents;\n",
       "}\n",
       "\n",
       ".xr-var-item > div,\n",
       ".xr-var-item label,\n",
       ".xr-var-item > .xr-var-name span {\n",
       "  background-color: var(--xr-background-color-row-even);\n",
       "  margin-bottom: 0;\n",
       "}\n",
       "\n",
       ".xr-var-item > .xr-var-name:hover span {\n",
       "  padding-right: 5px;\n",
       "}\n",
       "\n",
       ".xr-var-list > li:nth-child(odd) > div,\n",
       ".xr-var-list > li:nth-child(odd) > label,\n",
       ".xr-var-list > li:nth-child(odd) > .xr-var-name span {\n",
       "  background-color: var(--xr-background-color-row-odd);\n",
       "}\n",
       "\n",
       ".xr-var-name {\n",
       "  grid-column: 1;\n",
       "}\n",
       "\n",
       ".xr-var-dims {\n",
       "  grid-column: 2;\n",
       "}\n",
       "\n",
       ".xr-var-dtype {\n",
       "  grid-column: 3;\n",
       "  text-align: right;\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-var-preview {\n",
       "  grid-column: 4;\n",
       "}\n",
       "\n",
       ".xr-var-name,\n",
       ".xr-var-dims,\n",
       ".xr-var-dtype,\n",
       ".xr-preview,\n",
       ".xr-attrs dt {\n",
       "  white-space: nowrap;\n",
       "  overflow: hidden;\n",
       "  text-overflow: ellipsis;\n",
       "  padding-right: 10px;\n",
       "}\n",
       "\n",
       ".xr-var-name:hover,\n",
       ".xr-var-dims:hover,\n",
       ".xr-var-dtype:hover,\n",
       ".xr-attrs dt:hover {\n",
       "  overflow: visible;\n",
       "  width: auto;\n",
       "  z-index: 1;\n",
       "}\n",
       "\n",
       ".xr-var-attrs,\n",
       ".xr-var-data {\n",
       "  display: none;\n",
       "  background-color: var(--xr-background-color) !important;\n",
       "  padding-bottom: 5px !important;\n",
       "}\n",
       "\n",
       ".xr-var-attrs-in:checked ~ .xr-var-attrs,\n",
       ".xr-var-data-in:checked ~ .xr-var-data {\n",
       "  display: block;\n",
       "}\n",
       "\n",
       ".xr-var-data > table {\n",
       "  float: right;\n",
       "}\n",
       "\n",
       ".xr-var-name span,\n",
       ".xr-var-data,\n",
       ".xr-attrs {\n",
       "  padding-left: 25px !important;\n",
       "}\n",
       "\n",
       ".xr-attrs,\n",
       ".xr-var-attrs,\n",
       ".xr-var-data {\n",
       "  grid-column: 1 / -1;\n",
       "}\n",
       "\n",
       "dl.xr-attrs {\n",
       "  padding: 0;\n",
       "  margin: 0;\n",
       "  display: grid;\n",
       "  grid-template-columns: 125px auto;\n",
       "}\n",
       "\n",
       ".xr-attrs dt,\n",
       ".xr-attrs dd {\n",
       "  padding: 0;\n",
       "  margin: 0;\n",
       "  float: left;\n",
       "  padding-right: 10px;\n",
       "  width: auto;\n",
       "}\n",
       "\n",
       ".xr-attrs dt {\n",
       "  font-weight: normal;\n",
       "  grid-column: 1;\n",
       "}\n",
       "\n",
       ".xr-attrs dt:hover span {\n",
       "  display: inline-block;\n",
       "  background: var(--xr-background-color);\n",
       "  padding-right: 10px;\n",
       "}\n",
       "\n",
       ".xr-attrs dd {\n",
       "  grid-column: 2;\n",
       "  white-space: pre-wrap;\n",
       "  word-break: break-all;\n",
       "}\n",
       "\n",
       ".xr-icon-database,\n",
       ".xr-icon-file-text2 {\n",
       "  display: inline-block;\n",
       "  vertical-align: middle;\n",
       "  width: 1em;\n",
       "  height: 1.5em !important;\n",
       "  stroke-width: 0;\n",
       "  stroke: currentColor;\n",
       "  fill: currentColor;\n",
       "}\n",
       "</style><pre class='xr-text-repr-fallback'>&lt;xarray.DataArray &#x27;mutual_information&#x27; (x: 9, y: 9)&gt;\n",
       "array([[0.        , 0.63926236, 0.08894391, 0.70218011, 0.35886454,\n",
       "        0.46679106, 0.33813901, 0.36950633, 0.34050716],\n",
       "       [0.63926236, 0.        , 0.1683962 , 0.13738393, 0.11353205,\n",
       "        0.44550937, 0.1144353 , 0.11203857, 0.0977636 ],\n",
       "       [0.08894391, 0.1683962 , 0.        , 0.01724109, 0.36172414,\n",
       "        0.02186478, 0.22353113, 0.01319444, 0.01294449],\n",
       "       [0.70218011, 0.13738393, 0.01724109, 0.        , 0.06598438,\n",
       "        0.09843108, 0.06941839, 0.10582383, 0.07374102],\n",
       "       [0.35886454, 0.11353205, 0.36172414, 0.06598438, 0.        ,\n",
       "        0.08378407, 0.49501981, 0.10780812, 0.07617536],\n",
       "       [0.46679106, 0.44550937, 0.02186478, 0.09843108, 0.08378407,\n",
       "        0.        , 0.08559953, 0.07299823, 0.10957597],\n",
       "       [0.33813901, 0.1144353 , 0.22353113, 0.06941839, 0.49501981,\n",
       "        0.08559953, 0.        , 0.06822031, 0.08640308],\n",
       "       [0.36950633, 0.11203857, 0.01319444, 0.10582383, 0.10780812,\n",
       "        0.07299823, 0.06822031, 0.        , 0.06747319],\n",
       "       [0.34050716, 0.0977636 , 0.01294449, 0.07374102, 0.07617536,\n",
       "        0.10957597, 0.08640308, 0.06747319, 0.        ]])\n",
       "Coordinates:\n",
       "  * x        (x) &lt;U8 &#x27;v_choice&#x27; &#x27;j_choice&#x27; &#x27;d_gene&#x27; ... &#x27;vd_ins&#x27; &#x27;dj_ins&#x27;\n",
       "  * y        (y) &lt;U8 &#x27;v_choice&#x27; &#x27;j_choice&#x27; &#x27;d_gene&#x27; ... &#x27;vd_ins&#x27; &#x27;dj_ins&#x27;</pre><div class='xr-wrap' hidden><div class='xr-header'><div class='xr-obj-type'>xarray.DataArray</div><div class='xr-array-name'>'mutual_information'</div><ul class='xr-dim-list'><li><span class='xr-has-index'>x</span>: 9</li><li><span class='xr-has-index'>y</span>: 9</li></ul></div><ul class='xr-sections'><li class='xr-section-item'><div class='xr-array-wrap'><input id='section-08b41876-bef7-4ea7-b125-79bba5b22af6' class='xr-array-in' type='checkbox' checked><label for='section-08b41876-bef7-4ea7-b125-79bba5b22af6' title='Show/hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-array-preview xr-preview'><span>0.0 0.6393 0.08894 0.7022 0.3589 ... 0.07618 0.1096 0.0864 0.06747 0.0</span></div><div class='xr-array-data'><pre>array([[0.        , 0.63926236, 0.08894391, 0.70218011, 0.35886454,\n",
       "        0.46679106, 0.33813901, 0.36950633, 0.34050716],\n",
       "       [0.63926236, 0.        , 0.1683962 , 0.13738393, 0.11353205,\n",
       "        0.44550937, 0.1144353 , 0.11203857, 0.0977636 ],\n",
       "       [0.08894391, 0.1683962 , 0.        , 0.01724109, 0.36172414,\n",
       "        0.02186478, 0.22353113, 0.01319444, 0.01294449],\n",
       "       [0.70218011, 0.13738393, 0.01724109, 0.        , 0.06598438,\n",
       "        0.09843108, 0.06941839, 0.10582383, 0.07374102],\n",
       "       [0.35886454, 0.11353205, 0.36172414, 0.06598438, 0.        ,\n",
       "        0.08378407, 0.49501981, 0.10780812, 0.07617536],\n",
       "       [0.46679106, 0.44550937, 0.02186478, 0.09843108, 0.08378407,\n",
       "        0.        , 0.08559953, 0.07299823, 0.10957597],\n",
       "       [0.33813901, 0.1144353 , 0.22353113, 0.06941839, 0.49501981,\n",
       "        0.08559953, 0.        , 0.06822031, 0.08640308],\n",
       "       [0.36950633, 0.11203857, 0.01319444, 0.10582383, 0.10780812,\n",
       "        0.07299823, 0.06822031, 0.        , 0.06747319],\n",
       "       [0.34050716, 0.0977636 , 0.01294449, 0.07374102, 0.07617536,\n",
       "        0.10957597, 0.08640308, 0.06747319, 0.        ]])</pre></div></div></li><li class='xr-section-item'><input id='section-d5e471af-de4f-4b0f-b897-34e6e5b6bb54' class='xr-section-summary-in' type='checkbox'  checked><label for='section-d5e471af-de4f-4b0f-b897-34e6e5b6bb54' class='xr-section-summary' >Coordinates: <span>(2)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>x</span></div><div class='xr-var-dims'>(x)</div><div class='xr-var-dtype'>&lt;U8</div><div class='xr-var-preview xr-preview'>&#x27;v_choice&#x27; &#x27;j_choice&#x27; ... &#x27;dj_ins&#x27;</div><input id='attrs-26ecd21c-51ae-41e3-a089-5c061b150057' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-26ecd21c-51ae-41e3-a089-5c061b150057' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-04483664-b012-454e-a4f3-8cdbb1e9c94f' class='xr-var-data-in' type='checkbox'><label for='data-04483664-b012-454e-a4f3-8cdbb1e9c94f' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([&#x27;v_choice&#x27;, &#x27;j_choice&#x27;, &#x27;d_gene&#x27;, &#x27;v_3_del&#x27;, &#x27;d_5_del&#x27;, &#x27;j_5_del&#x27;,\n",
       "       &#x27;d_3_del&#x27;, &#x27;vd_ins&#x27;, &#x27;dj_ins&#x27;], dtype=&#x27;&lt;U8&#x27;)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>y</span></div><div class='xr-var-dims'>(y)</div><div class='xr-var-dtype'>&lt;U8</div><div class='xr-var-preview xr-preview'>&#x27;v_choice&#x27; &#x27;j_choice&#x27; ... &#x27;dj_ins&#x27;</div><input id='attrs-bb3cbb4d-dc73-4a84-b633-611ce313e169' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-bb3cbb4d-dc73-4a84-b633-611ce313e169' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-bbce366e-7790-4574-a2ed-626b150d012c' class='xr-var-data-in' type='checkbox'><label for='data-bbce366e-7790-4574-a2ed-626b150d012c' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([&#x27;v_choice&#x27;, &#x27;j_choice&#x27;, &#x27;d_gene&#x27;, &#x27;v_3_del&#x27;, &#x27;d_5_del&#x27;, &#x27;j_5_del&#x27;,\n",
       "       &#x27;d_3_del&#x27;, &#x27;vd_ins&#x27;, &#x27;dj_ins&#x27;], dtype=&#x27;&lt;U8&#x27;)</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-c54740a2-55ec-4a5b-8254-f5295cb393fa' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-c54740a2-55ec-4a5b-8254-f5295cb393fa' class='xr-section-summary'  title='Expand/collapse section'>Attributes: <span>(0)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><dl class='xr-attrs'></dl></div></li></ul></div></div>"
      ],
      "text/plain": [
       "<xarray.DataArray 'mutual_information' (x: 9, y: 9)>\n",
       "array([[0.        , 0.63926236, 0.08894391, 0.70218011, 0.35886454,\n",
       "        0.46679106, 0.33813901, 0.36950633, 0.34050716],\n",
       "       [0.63926236, 0.        , 0.1683962 , 0.13738393, 0.11353205,\n",
       "        0.44550937, 0.1144353 , 0.11203857, 0.0977636 ],\n",
       "       [0.08894391, 0.1683962 , 0.        , 0.01724109, 0.36172414,\n",
       "        0.02186478, 0.22353113, 0.01319444, 0.01294449],\n",
       "       [0.70218011, 0.13738393, 0.01724109, 0.        , 0.06598438,\n",
       "        0.09843108, 0.06941839, 0.10582383, 0.07374102],\n",
       "       [0.35886454, 0.11353205, 0.36172414, 0.06598438, 0.        ,\n",
       "        0.08378407, 0.49501981, 0.10780812, 0.07617536],\n",
       "       [0.46679106, 0.44550937, 0.02186478, 0.09843108, 0.08378407,\n",
       "        0.        , 0.08559953, 0.07299823, 0.10957597],\n",
       "       [0.33813901, 0.1144353 , 0.22353113, 0.06941839, 0.49501981,\n",
       "        0.08559953, 0.        , 0.06822031, 0.08640308],\n",
       "       [0.36950633, 0.11203857, 0.01319444, 0.10582383, 0.10780812,\n",
       "        0.07299823, 0.06822031, 0.        , 0.06747319],\n",
       "       [0.34050716, 0.0977636 , 0.01294449, 0.07374102, 0.07617536,\n",
       "        0.10957597, 0.08640308, 0.06747319, 0.        ]])\n",
       "Coordinates:\n",
       "  * x        (x) <U8 'v_choice' 'j_choice' 'd_gene' ... 'vd_ins' 'dj_ins'\n",
       "  * y        (y) <U8 'v_choice' 'j_choice' 'd_gene' ... 'vd_ins' 'dj_ins'"
      ]
     },
     "execution_count": 76,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "da_mi_scenarios#.to_dataframe().dropna()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 77,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<AxesSubplot:>"
      ]
     },
     "execution_count": 77,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "[encoded data, 19420 characters]\n",
      "text/plain": [
       "<Figure size 720x720 with 2 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "mdl_hb.plot_mutual_information(da_mi_scenarios)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 78,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<AxesSubplot:>"
      ]
     },
     "execution_count": 78,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "[encoded data, 20192 characters]\n",
      "text/plain": [
       "<Figure size 720x720 with 2 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "mdl_hb.plot_mutual_information(da_mi)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Mean and Variance of values in scenarios dataframe"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The simplest way to get the realization values of events in scenario is using the function\n",
    "IgorModel.get_realization_value_from_df_scenarios(df_scenarios, 'event_nickname')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 79,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on method get_realization_value_from_df_scenarios in module pygor3.IgorIO:\n",
      "\n",
      "get_realization_value_from_df_scenarios(df_scenarios, event_nickname) method of pygor3.IgorIO.IgorModel instance\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(mdl_hb.get_realization_value_from_df_scenarios)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 80,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "seq_index\n",
       "998        GGGACAGGGGGC\n",
       "998        GGGACAGGGGGC\n",
       "998        GGGACAGGGGGC\n",
       "998        GGGACAGGGGGC\n",
       "998        GGGACAGGGGGC\n",
       "             ...       \n",
       "703    GGGACTAGCGGGGGGG\n",
       "703    GGGACTAGCGGGGGGG\n",
       "703    GGGACTAGCGGGGGGG\n",
       "703        GGGACAGGGGGC\n",
       "703        GGGACAGGGGGC\n",
       "Length: 10000, dtype: object"
      ]
     },
     "execution_count": 80,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mdl_hb.get_realization_value_from_df_scenarios(df_scenarios_many, 'd_gene')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 81,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "seq_index\n",
       "998    15\n",
       "998    15\n",
       "998    15\n",
       "998    15\n",
       "998    15\n",
       "       ..\n",
       "703     4\n",
       "703     5\n",
       "703     4\n",
       "703     4\n",
       "703     4\n",
       "Length: 10000, dtype: int64"
      ]
     },
     "execution_count": 81,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mdl_hb.get_realization_value_from_df_scenarios(df_scenarios_many, 'j_5_del')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "If the values are assigned to a column in scenarios dataframe (df_scenarios_many) the weighted average can be calculated using the IgorModel.w_mean_df_scenarios"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 82,
   "metadata": {},
   "outputs": [],
   "source": [
    "ps_j_5_del = mdl_hb.get_realization_value_from_df_scenarios(df_scenarios_many, 'j_5_del')\n",
    "df_scenarios_many['j_5_del_value'] = ps_j_5_del\n",
    "# ps_j_5_del"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 83,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on method w_mean_df_scenarios in module pygor3.IgorIO:\n",
      "\n",
      "w_mean_df_scenarios(column_name: str, df_scenarios: pandas.core.frame.DataFrame) method of pygor3.IgorIO.IgorModel instance\n",
      "    Return weighted mean with the normalized probabilities for each\n",
      "    scenario (norm_scenario_proba_cond_seq)\n",
      "    :param column_name: column name of df_scenario to calculate the average\n",
      "    :param df_scenarios: Scenarios with normalize probability. Loaded with self.get_dataframe_scenarios()\n",
      "\n",
      "Help on method w_variance_df_scenarios in module pygor3.IgorIO:\n",
      "\n",
      "w_variance_df_scenarios(colname_1: str, df_scenarios: pandas.core.frame.DataFrame) method of pygor3.IgorIO.IgorModel instance\n",
      "    Return weighted covariance with the normalized probabilities of the column names given for each\n",
      "    scenario (norm_scenario_proba_cond_seq)\n",
      "    :param colname_1: column name of df_scenario to calculate the weighted covariance\n",
      "    :param colname_2: column name of df_scenario to calculate the weighted covariance\n",
      "    :param df_scenarios: Scenarios with normalize probability. Loaded with self.get_dataframe_scenarios()\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(mdl_hb.w_mean_df_scenarios)\n",
    "help(mdl_hb.w_variance_df_scenarios)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 84,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "4.157669017539739"
      ]
     },
     "execution_count": 84,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mdl_hb.w_mean_df_scenarios('j_5_del_value', df_scenarios_many)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 85,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "10.537416194979743"
      ]
     },
     "execution_count": 85,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mdl_hb.w_variance_df_scenarios('j_5_del_value', df_scenarios_many)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 86,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on method get_observable_from_df_scenarios in module pygor3.IgorIO:\n",
      "\n",
      "get_observable_from_df_scenarios(observable_function, df_scenarios: pandas.core.frame.DataFrame) method of pygor3.IgorIO.IgorModel instance\n",
      "    Return a pandas series with the calculated observable over the df_scenarios dataframe.\n",
      "    :param observable_function: This function should use the varibles with self.realization\n",
      "    :param df_scenarios: Scenarios dataframe loaded with self.get_dataframe_scenarios.\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(mdl_hb.get_observable_from_df_scenarios)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 87,
   "metadata": {},
   "outputs": [],
   "source": [
    "def f_total_insertions(ps_scenario):\n",
    "    my_internal = np.zeros(len(mdl.parms['vd_ins']))\n",
    "    vd_ins = mdl.realization(ps_scenario, 'vd_ins')\n",
    "    dj_ins = mdl.realization(ps_scenario, 'dj_ins')\n",
    "    # my_internal[vd_ins.id] = 1\n",
    "    # return my_internal \n",
    "    return vd_ins.value + dj_ins.value\n",
    "\n",
    "def f_total_deletions(ps_scenario):\n",
    "    v_3_del = mdl.realization(ps_scenario, 'v_3_del')\n",
    "    d_5_del = mdl.realization(ps_scenario, 'd_5_del')\n",
    "    d_3_del = mdl.realization(ps_scenario, 'd_3_del')\n",
    "    j_5_del = mdl.realization(ps_scenario, 'j_5_del')\n",
    "    return v_3_del.value + d_5_del.value + d_3_del.value + j_5_del.value"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 88,
   "metadata": {},
   "outputs": [],
   "source": [
    "mean_insertions = mdl.w_average_function_df_scenarios(f_total_insertions, df_scenarios_many)\n",
    "mean_deletions = mdl.w_average_function_df_scenarios(f_total_deletions, df_scenarios_many)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 89,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(10.202437426325016, 15.645906964009958)"
      ]
     },
     "execution_count": 89,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mean_insertions, mean_deletions"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 90,
   "metadata": {},
   "outputs": [],
   "source": [
    "def f_give_thename(ps_scenario):\n",
    "    v_choice = mdl_hb.realization(ps_scenario, 'v_choice')\n",
    "    return v_choice"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 91,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "seq_index\n",
       "998    TRBV7-4*01;GGTGCTGGAGTCTCCCAGTCCCCAAGGTACAAAGT...\n",
       "998    TRBV7-4*01;GGTGCTGGAGTCTCCCAGTCCCCAAGGTACAAAGT...\n",
       "998    TRBV7-4*01;GGTGCTGGAGTCTCCCAGTCCCCAAGGTACAAAGT...\n",
       "998    TRBV7-4*01;GGTGCTGGAGTCTCCCAGTCCCCAAGGTACAAAGT...\n",
       "998    TRBV7-4*01;GGTGCTGGAGTCTCCCAGTCCCCAAGGTACAAAGT...\n",
       "                             ...                        \n",
       "703    TRBV4-1*01;ACTGAAGTTACCCAGACACCAAAACACCTGGTCAT...\n",
       "703    TRBV4-1*01;ACTGAAGTTACCCAGACACCAAAACACCTGGTCAT...\n",
       "703    TRBV4-1*01;ACTGAAGTTACCCAGACACCAAAACACCTGGTCAT...\n",
       "703    TRBV4-1*01;ACTGAAGTTACCCAGACACCAAAACACCTGGTCAT...\n",
       "703    TRBV4-1*01;ACTGAAGTTACCCAGACACCAAAACACCTGGTCAT...\n",
       "Length: 10000, dtype: object"
      ]
     },
     "execution_count": 91,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mdl_hb.get_observable_from_df_scenarios(f_give_thename, df_scenarios=df_scenarios_many)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 92,
   "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>scenario_rank</th>\n",
       "      <th>scenario_proba_cond_seq</th>\n",
       "      <th>v_choice</th>\n",
       "      <th>j_choice</th>\n",
       "      <th>d_gene</th>\n",
       "      <th>v_3_del</th>\n",
       "      <th>d_5_del</th>\n",
       "      <th>j_5_del</th>\n",
       "      <th>d_3_del</th>\n",
       "      <th>vd_ins</th>\n",
       "      <th>vd_dinucl</th>\n",
       "      <th>dj_ins</th>\n",
       "      <th>dj_dinucl</th>\n",
       "      <th>Mismatches</th>\n",
       "      <th>norm_scenario_proba_cond_seq</th>\n",
       "      <th>j_5_del_value</th>\n",
       "      <th>v_call</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>seq_index</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>998</th>\n",
       "      <td>1</td>\n",
       "      <td>0.783497</td>\n",
       "      <td>77</td>\n",
       "      <td>4</td>\n",
       "      <td>0</td>\n",
       "      <td>9</td>\n",
       "      <td>6</td>\n",
       "      <td>19</td>\n",
       "      <td>9</td>\n",
       "      <td>4</td>\n",
       "      <td>[1, 1, 2, 3]</td>\n",
       "      <td>7</td>\n",
       "      <td>[2, 2, 2, 2, 0, 2, 0]</td>\n",
       "      <td>[]</td>\n",
       "      <td>0.000801</td>\n",
       "      <td>15</td>\n",
       "      <td>TRBV7-4*01;GGTGCTGGAGTCTCCCAGTCCCCAAGGTACAAAGT...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>998</th>\n",
       "      <td>2</td>\n",
       "      <td>0.076884</td>\n",
       "      <td>77</td>\n",
       "      <td>4</td>\n",
       "      <td>0</td>\n",
       "      <td>9</td>\n",
       "      <td>6</td>\n",
       "      <td>19</td>\n",
       "      <td>10</td>\n",
       "      <td>4</td>\n",
       "      <td>[1, 1, 2, 3]</td>\n",
       "      <td>8</td>\n",
       "      <td>[2, 2, 2, 2, 0, 2, 0, 2]</td>\n",
       "      <td>[]</td>\n",
       "      <td>0.000079</td>\n",
       "      <td>15</td>\n",
       "      <td>TRBV7-4*01;GGTGCTGGAGTCTCCCAGTCCCCAAGGTACAAAGT...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>998</th>\n",
       "      <td>3</td>\n",
       "      <td>0.043634</td>\n",
       "      <td>77</td>\n",
       "      <td>4</td>\n",
       "      <td>0</td>\n",
       "      <td>9</td>\n",
       "      <td>7</td>\n",
       "      <td>19</td>\n",
       "      <td>9</td>\n",
       "      <td>5</td>\n",
       "      <td>[1, 1, 2, 3, 2]</td>\n",
       "      <td>7</td>\n",
       "      <td>[2, 2, 2, 2, 0, 2, 0]</td>\n",
       "      <td>[]</td>\n",
       "      <td>0.000045</td>\n",
       "      <td>15</td>\n",
       "      <td>TRBV7-4*01;GGTGCTGGAGTCTCCCAGTCCCCAAGGTACAAAGT...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>998</th>\n",
       "      <td>4</td>\n",
       "      <td>0.023517</td>\n",
       "      <td>77</td>\n",
       "      <td>4</td>\n",
       "      <td>0</td>\n",
       "      <td>10</td>\n",
       "      <td>6</td>\n",
       "      <td>19</td>\n",
       "      <td>9</td>\n",
       "      <td>5</td>\n",
       "      <td>[1, 1, 1, 2, 3]</td>\n",
       "      <td>7</td>\n",
       "      <td>[2, 2, 2, 2, 0, 2, 0]</td>\n",
       "      <td>[]</td>\n",
       "      <td>0.000024</td>\n",
       "      <td>15</td>\n",
       "      <td>TRBV7-4*01;GGTGCTGGAGTCTCCCAGTCCCCAAGGTACAAAGT...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>998</th>\n",
       "      <td>5</td>\n",
       "      <td>0.021809</td>\n",
       "      <td>77</td>\n",
       "      <td>4</td>\n",
       "      <td>0</td>\n",
       "      <td>9</td>\n",
       "      <td>8</td>\n",
       "      <td>19</td>\n",
       "      <td>9</td>\n",
       "      <td>6</td>\n",
       "      <td>[1, 1, 2, 3, 2, 0]</td>\n",
       "      <td>7</td>\n",
       "      <td>[2, 2, 2, 2, 0, 2, 0]</td>\n",
       "      <td>[]</td>\n",
       "      <td>0.000022</td>\n",
       "      <td>15</td>\n",
       "      <td>TRBV7-4*01;GGTGCTGGAGTCTCCCAGTCCCCAAGGTACAAAGT...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>703</th>\n",
       "      <td>6</td>\n",
       "      <td>0.021822</td>\n",
       "      <td>45</td>\n",
       "      <td>12</td>\n",
       "      <td>1</td>\n",
       "      <td>6</td>\n",
       "      <td>11</td>\n",
       "      <td>8</td>\n",
       "      <td>7</td>\n",
       "      <td>6</td>\n",
       "      <td>[2, 2, 1, 0, 3, 3]</td>\n",
       "      <td>5</td>\n",
       "      <td>[2, 0, 3, 1, 1]</td>\n",
       "      <td>[]</td>\n",
       "      <td>0.000030</td>\n",
       "      <td>4</td>\n",
       "      <td>TRBV4-1*01;ACTGAAGTTACCCAGACACCAAAACACCTGGTCAT...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>703</th>\n",
       "      <td>7</td>\n",
       "      <td>0.016150</td>\n",
       "      <td>45</td>\n",
       "      <td>12</td>\n",
       "      <td>1</td>\n",
       "      <td>5</td>\n",
       "      <td>11</td>\n",
       "      <td>9</td>\n",
       "      <td>7</td>\n",
       "      <td>5</td>\n",
       "      <td>[2, 1, 0, 3, 3]</td>\n",
       "      <td>6</td>\n",
       "      <td>[2, 2, 0, 3, 1, 1]</td>\n",
       "      <td>[]</td>\n",
       "      <td>0.000022</td>\n",
       "      <td>5</td>\n",
       "      <td>TRBV4-1*01;ACTGAAGTTACCCAGACACCAAAACACCTGGTCAT...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>703</th>\n",
       "      <td>8</td>\n",
       "      <td>0.013252</td>\n",
       "      <td>45</td>\n",
       "      <td>12</td>\n",
       "      <td>1</td>\n",
       "      <td>5</td>\n",
       "      <td>11</td>\n",
       "      <td>8</td>\n",
       "      <td>8</td>\n",
       "      <td>5</td>\n",
       "      <td>[2, 1, 0, 3, 3]</td>\n",
       "      <td>6</td>\n",
       "      <td>[2, 0, 3, 1, 1, 2]</td>\n",
       "      <td>[]</td>\n",
       "      <td>0.000018</td>\n",
       "      <td>4</td>\n",
       "      <td>TRBV4-1*01;ACTGAAGTTACCCAGACACCAAAACACCTGGTCAT...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>703</th>\n",
       "      <td>9</td>\n",
       "      <td>0.013172</td>\n",
       "      <td>45</td>\n",
       "      <td>12</td>\n",
       "      <td>0</td>\n",
       "      <td>6</td>\n",
       "      <td>11</td>\n",
       "      <td>8</td>\n",
       "      <td>4</td>\n",
       "      <td>8</td>\n",
       "      <td>[2, 2, 1, 0, 3, 3, 2, 1]</td>\n",
       "      <td>4</td>\n",
       "      <td>[2, 0, 3, 1]</td>\n",
       "      <td>[]</td>\n",
       "      <td>0.000018</td>\n",
       "      <td>4</td>\n",
       "      <td>TRBV4-1*01;ACTGAAGTTACCCAGACACCAAAACACCTGGTCAT...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>703</th>\n",
       "      <td>10</td>\n",
       "      <td>0.010846</td>\n",
       "      <td>45</td>\n",
       "      <td>12</td>\n",
       "      <td>0</td>\n",
       "      <td>5</td>\n",
       "      <td>12</td>\n",
       "      <td>8</td>\n",
       "      <td>4</td>\n",
       "      <td>8</td>\n",
       "      <td>[2, 1, 0, 3, 3, 2, 1, 2]</td>\n",
       "      <td>4</td>\n",
       "      <td>[2, 0, 3, 1]</td>\n",
       "      <td>[]</td>\n",
       "      <td>0.000015</td>\n",
       "      <td>4</td>\n",
       "      <td>TRBV4-1*01;ACTGAAGTTACCCAGACACCAAAACACCTGGTCAT...</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>10000 rows × 17 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "           scenario_rank  scenario_proba_cond_seq  v_choice  j_choice  d_gene  \\\n",
       "seq_index                                                                       \n",
       "998                    1                 0.783497        77         4       0   \n",
       "998                    2                 0.076884        77         4       0   \n",
       "998                    3                 0.043634        77         4       0   \n",
       "998                    4                 0.023517        77         4       0   \n",
       "998                    5                 0.021809        77         4       0   \n",
       "...                  ...                      ...       ...       ...     ...   \n",
       "703                    6                 0.021822        45        12       1   \n",
       "703                    7                 0.016150        45        12       1   \n",
       "703                    8                 0.013252        45        12       1   \n",
       "703                    9                 0.013172        45        12       0   \n",
       "703                   10                 0.010846        45        12       0   \n",
       "\n",
       "           v_3_del  d_5_del  j_5_del  d_3_del  vd_ins  \\\n",
       "seq_index                                               \n",
       "998              9        6       19        9       4   \n",
       "998              9        6       19       10       4   \n",
       "998              9        7       19        9       5   \n",
       "998             10        6       19        9       5   \n",
       "998              9        8       19        9       6   \n",
       "...            ...      ...      ...      ...     ...   \n",
       "703              6       11        8        7       6   \n",
       "703              5       11        9        7       5   \n",
       "703              5       11        8        8       5   \n",
       "703              6       11        8        4       8   \n",
       "703              5       12        8        4       8   \n",
       "\n",
       "                          vd_dinucl  dj_ins                 dj_dinucl  \\\n",
       "seq_index                                                               \n",
       "998                    [1, 1, 2, 3]       7     [2, 2, 2, 2, 0, 2, 0]   \n",
       "998                    [1, 1, 2, 3]       8  [2, 2, 2, 2, 0, 2, 0, 2]   \n",
       "998                 [1, 1, 2, 3, 2]       7     [2, 2, 2, 2, 0, 2, 0]   \n",
       "998                 [1, 1, 1, 2, 3]       7     [2, 2, 2, 2, 0, 2, 0]   \n",
       "998              [1, 1, 2, 3, 2, 0]       7     [2, 2, 2, 2, 0, 2, 0]   \n",
       "...                             ...     ...                       ...   \n",
       "703              [2, 2, 1, 0, 3, 3]       5           [2, 0, 3, 1, 1]   \n",
       "703                 [2, 1, 0, 3, 3]       6        [2, 2, 0, 3, 1, 1]   \n",
       "703                 [2, 1, 0, 3, 3]       6        [2, 0, 3, 1, 1, 2]   \n",
       "703        [2, 2, 1, 0, 3, 3, 2, 1]       4              [2, 0, 3, 1]   \n",
       "703        [2, 1, 0, 3, 3, 2, 1, 2]       4              [2, 0, 3, 1]   \n",
       "\n",
       "          Mismatches  norm_scenario_proba_cond_seq  j_5_del_value  \\\n",
       "seq_index                                                           \n",
       "998               []                      0.000801             15   \n",
       "998               []                      0.000079             15   \n",
       "998               []                      0.000045             15   \n",
       "998               []                      0.000024             15   \n",
       "998               []                      0.000022             15   \n",
       "...              ...                           ...            ...   \n",
       "703               []                      0.000030              4   \n",
       "703               []                      0.000022              5   \n",
       "703               []                      0.000018              4   \n",
       "703               []                      0.000018              4   \n",
       "703               []                      0.000015              4   \n",
       "\n",
       "                                                      v_call  \n",
       "seq_index                                                     \n",
       "998        TRBV7-4*01;GGTGCTGGAGTCTCCCAGTCCCCAAGGTACAAAGT...  \n",
       "998        TRBV7-4*01;GGTGCTGGAGTCTCCCAGTCCCCAAGGTACAAAGT...  \n",
       "998        TRBV7-4*01;GGTGCTGGAGTCTCCCAGTCCCCAAGGTACAAAGT...  \n",
       "998        TRBV7-4*01;GGTGCTGGAGTCTCCCAGTCCCCAAGGTACAAAGT...  \n",
       "998        TRBV7-4*01;GGTGCTGGAGTCTCCCAGTCCCCAAGGTACAAAGT...  \n",
       "...                                                      ...  \n",
       "703        TRBV4-1*01;ACTGAAGTTACCCAGACACCAAAACACCTGGTCAT...  \n",
       "703        TRBV4-1*01;ACTGAAGTTACCCAGACACCAAAACACCTGGTCAT...  \n",
       "703        TRBV4-1*01;ACTGAAGTTACCCAGACACCAAAACACCTGGTCAT...  \n",
       "703        TRBV4-1*01;ACTGAAGTTACCCAGACACCAAAACACCTGGTCAT...  \n",
       "703        TRBV4-1*01;ACTGAAGTTACCCAGACACCAAAACACCTGGTCAT...  \n",
       "\n",
       "[10000 rows x 17 columns]"
      ]
     },
     "execution_count": 92,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_scenarios_many['v_call'] = mdl_hb.get_observable_from_df_scenarios(f_give_thename, df_scenarios=df_scenarios_many)\n",
    "df_scenarios_many"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 93,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "('GGTGCTGGAGTCTCCCAGTCCCCAAGGTACAAAGTCGCAAAGAGGGGACGGGATGTAGCTCTCAGGTGTGATTCAATTTCGGGTCATGTAACCCTTTATTGGTACCGACAGACCCTGGGGCAGGGCTCAGAGGTTCTGACTTACTCCCAGAGTGATGCTCAACGAGACAAATCAGGGCGGCCCAGTGGTCGGTTCTCTGCAGAGAGGCCTGAGAGATCCGTCTCCACTCTGAAGATCCAGCGCACAGAGCAGGGGGACTCAGCTGTGTATCTCTGTGCCAGCAGCTTAGC',\n",
       " 77,\n",
       " 'TRBV7-4*01')"
      ]
     },
     "execution_count": 93,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ps_scenario = df_scenarios_many.iloc[0]\n",
    "realiz = mdl_hb.realization(ps_scenario, 'v_choice')\n",
    "realiz.value, realiz.id, realiz.name"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
