{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pygor3 as igor"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Generate sequences\n",
    "Use a IgorModel and generate sequences"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## An IGoR default model can be used to generate sequences"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "modelpath :  /home/olivares/.local/share/igor/models\n",
      "modelpath :  /home/olivares/.local/share/igor/models\n",
      "Parms filename:  /home/olivares/.local/share/igor/models/human/tcr_beta/models/model_parms.txt\n",
      "Marginals filename:  /home/olivares/.local/share/igor/models/human/tcr_beta/models/model_marginals.txt\n",
      "modelpath :  /home/olivares/.local/share/igor/models\n"
     ]
    }
   ],
   "source": [
    "hb_mdl = igor.get_default_IgorModel(\"human\", \"tcr_beta\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Writing model parms in file  ./igor_generating_w8xncmff/dataIGoRm3vNo02aij_mdldata/models/model_parms.txt\n",
      "Writing model marginals in file  ./igor_generating_w8xncmff/dataIGoRm3vNo02aij_mdldata/models/model_marginals.txt\n",
      "Writing model parms in file  ./igor_generating_w8xncmff/dataIGoRm3vNo02aij_mdldata//models/model_parms.txt\n",
      "Writing model marginals in file  ./igor_generating_w8xncmff/dataIGoRm3vNo02aij_mdldata//models/model_marginals.txt\n",
      "/home/olivares/.local/bin/igor -set_wd ./igor_generating_w8xncmff -batch dataIGoRm3vNo02aij -set_custom_model ./igor_generating_w8xncmff/dataIGoRm3vNo02aij_mdldata//models/model_parms.txt ./igor_generating_w8xncmff/dataIGoRm3vNo02aij_mdldata//models/model_marginals.txt -set_CDR3_anchors  --V ./igor_generating_w8xncmff/dataIGoRm3vNo02aij_mdldata//ref_genome/V_gene_CDR3_anchors.csv --J ./igor_generating_w8xncmff/dataIGoRm3vNo02aij_mdldata//ref_genome/J_gene_CDR3_anchors.csv -generate 10 \n"
     ]
    }
   ],
   "source": [
    "sequences = igor.generate(10, hb_mdl)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "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>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>ATTGCTGGGATCACCCAGGCACCAACATCTCAGATCCTGGCAGCAG...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>GGTGCTGGAGTCTCCCAGACCCCCAGTAACAAGGTCACAGAGAAGG...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>CATGCCAAAGTCACACAGACTCCAGGACATTTGGTCAAAGGAAAAG...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>AAGGCTGGAGTCACTCAAACTCCAAGATATCTGATCAAAACGAGAG...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>GATGCTGAAATCACCCAGAGCCCAAGACACAAGATCACAGAGACAG...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>GAGACTGGAGTCACCCAAAGTCCCACACACCTGATCAAAACGAGAG...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>AAGGCTGGAGTCACTCAAACTCCAAGATATCTGATCAAAACGAGAG...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>GGTGCTGTCGTCTCTCAACATCCGAGCTGGGTTATCTGTAAGAGTG...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>GATGCTGGAGTTATCCAGTCACCCCGGCACGAGGTGACAGAGATGG...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>GGTGCTGGAGTCTCCCAGACCCCCAGTAACAAGGTCACAGAGAAGG...</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                 nt_sequence\n",
       "seq_index                                                   \n",
       "0          ATTGCTGGGATCACCCAGGCACCAACATCTCAGATCCTGGCAGCAG...\n",
       "1          GGTGCTGGAGTCTCCCAGACCCCCAGTAACAAGGTCACAGAGAAGG...\n",
       "2          CATGCCAAAGTCACACAGACTCCAGGACATTTGGTCAAAGGAAAAG...\n",
       "3          AAGGCTGGAGTCACTCAAACTCCAAGATATCTGATCAAAACGAGAG...\n",
       "4          GATGCTGAAATCACCCAGAGCCCAAGACACAAGATCACAGAGACAG...\n",
       "5          GAGACTGGAGTCACCCAAAGTCCCACACACCTGATCAAAACGAGAG...\n",
       "6          AAGGCTGGAGTCACTCAAACTCCAAGATATCTGATCAAAACGAGAG...\n",
       "7          GGTGCTGTCGTCTCTCAACATCCGAGCTGGGTTATCTGTAAGAGTG...\n",
       "8          GATGCTGGAGTTATCCAGTCACCCCGGCACGAGGTGACAGAGATGG...\n",
       "9          GGTGCTGGAGTCTCCCAGACCCCCAGTAACAAGGTCACAGAGAAGG..."
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sequences"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Download gene templates\n",
    "Get the list of available species in IMGT website"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['',\n",
       " 'Macaca+nemestrina',\n",
       " 'Mustela+putorius+furo',\n",
       " 'Danio+rerio',\n",
       " 'Rattus+rattus',\n",
       " 'Capra+hircus',\n",
       " 'Equus+caballus',\n",
       " 'Felis+catus',\n",
       " 'Sus+scrofa',\n",
       " 'Tursiops+truncatus',\n",
       " 'Ornithorhynchus+anatinus',\n",
       " 'Gallus+gallus',\n",
       " 'Oryctolagus+cuniculus',\n",
       " 'Homo+sapiens',\n",
       " 'Vicugna+pacos',\n",
       " 'Macaca+fascicularis',\n",
       " 'Camelus+dromedarius',\n",
       " 'Mus+musculus',\n",
       " 'Mus+cookii',\n",
       " 'Cercocebus+atys',\n",
       " 'Mus+pahari',\n",
       " 'Papio+anubis+anubis',\n",
       " 'Bos+taurus',\n",
       " 'Macaca+mulatta',\n",
       " 'Oncorhynchus+mykiss',\n",
       " 'Canis+lupus+familiaris',\n",
       " 'Ovis+aries',\n",
       " 'Mus+spretus',\n",
       " 'Rattus+norvegicus',\n",
       " 'Mus+saxicola',\n",
       " 'Salmo+salar',\n",
       " 'Mus+minutoides']"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "igor.get_imgt_list_species()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Homo+sapiens TRBV http://www.imgt.org/genedb/GENElect?query=7.2+TRBV&species=Homo+sapiens\n",
      "http://www.imgt.org/genedb/GENElect?query=7.2+TRBV&species=Homo+sapiens\n",
      "Homo+sapiens TRBD http://www.imgt.org/genedb/GENElect?query=7.2+TRBD&species=Homo+sapiens\n",
      "http://www.imgt.org/genedb/GENElect?query=7.2+TRBD&species=Homo+sapiens\n",
      "Homo+sapiens TRBJ http://www.imgt.org/genedb/GENElect?query=7.2+TRBJ&species=Homo+sapiens\n",
      "http://www.imgt.org/genedb/GENElect?query=7.2+TRBJ&species=Homo+sapiens\n",
      "http://www.imgt.org/genedb/GENElect?query=8.1+TRBV&species=Homo+sapiens&IMGTlabel=2nd-CYS\n",
      "http://www.imgt.org/genedb/GENElect?query=8.1+TRBJ&species=Homo+sapiens&IMGTlabel=J-PHE\n",
      "http://www.imgt.org/genedb/GENElect?query=8.1+TRBJ&species=Homo+sapiens&IMGTlabel=J-TRP\n",
      "http://www.imgt.org/genedb/GENElect?query=8.1+TRBV&species=Homo+sapiens&IMGTlabel=2nd-CYS\n",
      "http://www.imgt.org/genedb/GENElect?query=8.1+Homo+sapiensJ&species=Homo+sapiens&IMGTlabel=J-PHE\n",
      "http://www.imgt.org/genedb/GENElect?query=8.1+Homo+sapiensJ&species=Homo+sapiens&IMGTlabel=J-TRP\n"
     ]
    }
   ],
   "source": [
    "#ref_genome = IgorRefGenome.load_VDJ_from_IMGT_website(\"Homo+sapiens\", \"TRB\")\n",
    "ref_genome = igor.get_IgorRefGenome_VDJ_from_IMGT(\"Homo+sapiens\", \"TRB\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Check dataframes of downloaded sequences"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'V':                name                                              value  \\\n",
       " id                                                                       \n",
       " 0          TRBV1*01  GATACTGGAATTACCCAGACACCAAAATACCTGGTCACAGCAATGG...   \n",
       " 1       TRBV10-1*01  GATGCTGAAATCACCCAGAGCCCAAGACACAAGATCACAGAGACAG...   \n",
       " 2       TRBV10-1*02  GATGCTGAAATCACCCAGAGCCCAAGACACAAGATCACAGAGACAG...   \n",
       " 3       TRBV10-1*03  AGGCAGGTGACCTTGGCGTGTCACCAGACTTGGAACCACAACAATA...   \n",
       " 4       TRBV10-2*01  GATGCTGGAATCACCCAGAGCCCAAGATACAAGATCACAGAGACAG...   \n",
       " ..              ...                                                ...   \n",
       " 163        TRBVA*02  GAAGCTGAAGCCACCTAGACTCTAAGACACCTGATTGCAGAGACAG...   \n",
       " 164  TRBVA/OR9-2*01  GAAGCTGAAGTCACCTAGACTCCAAGACACCTGATTGTAGAGACAG...   \n",
       " 165        TRBVB*01  AATGTCAAAGTAACACAGACCCTGAGATGAGGCAGGAAAGTTGTAT...   \n",
       " 166        TRBVB*02  AATGTCAAAGTAACACAGACCCTGAGATGAGGCAGGAAAGTTGTAT...   \n",
       " 167        TRBVC*01  CTTCTAAATTGGTCTATGAAGGAGAATCTCCCCCATTCCTGGAGTC...   \n",
       " \n",
       "      anchor_index gfunction  \n",
       " id                           \n",
       " 0           267.0         P  \n",
       " 1           270.0         F  \n",
       " 2           270.0         F  \n",
       " 3             NaN       NaN  \n",
       " 4           270.0         F  \n",
       " ..            ...       ...  \n",
       " 163           NaN       NaN  \n",
       " 164           NaN       NaN  \n",
       " 165           NaN       NaN  \n",
       " 166           NaN       NaN  \n",
       " 167           NaN       NaN  \n",
       " \n",
       " [168 rows x 4 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                                              value  \\\n",
       " id                                                                   \n",
       " 0    TRBJ1-1*01   TGAACACTGAAGCTTTCTTTGGACAAGGCACCAGACTCACAGTTGTAG   \n",
       " 1    TRBJ1-2*01   CTAACTATGGCTACACCTTCGGTTCGGGGACCAGGTTAACCGTTGTAG   \n",
       " 2    TRBJ1-3*01  CTCTGGAAACACCATATATTTTGGAGAGGGAAGTTGGCTCACTGTT...   \n",
       " 3    TRBJ1-4*01  CAACTAATGAAAAACTGTTTTTTGGCAGTGGAACCCAGCTCTCTGT...   \n",
       " 4    TRBJ1-5*01  TAGCAATCAGCCCCAGCATTTTGGTGATGGGACTCGACTCTCCATC...   \n",
       " 5    TRBJ1-6*01  CTCCTATAATTCACCCCTCCACTTTGGGAATGGGACCAGGCTCACT...   \n",
       " 6    TRBJ1-6*02  CTCCTATAATTCACCCCTCCACTTTGGGAACGGGACCAGGCTCACT...   \n",
       " 7    TRBJ2-1*01  CTCCTACAATGAGCAGTTCTTCGGGCCAGGGACACGGCTCACCGTG...   \n",
       " 8    TRBJ2-2*01  CGAACACCGGGGAGCTGTTTTTTGGAGAAGGCTCTAGGCTGACCGT...   \n",
       " 9   TRBJ2-2P*01     CTGAGAGGCGCTGCTGGGCGTCTGGGCGGAGGACTCCTGGTTCTGG   \n",
       " 10   TRBJ2-3*01  AGCACAGATACGCAGTATTTTGGCCCAGGCACCCGGCTGACAGTGCTCG   \n",
       " 11   TRBJ2-4*01  AGCCAAAAACATTCAGTACTTCGGCGCCGGGACCCGGCTCTCAGTG...   \n",
       " 12   TRBJ2-5*01   ACCAAGAGACCCAGTACTTCGGGCCAGGCACGCGGCTCCTGGTGCTCG   \n",
       " 13   TRBJ2-6*01  CTCTGGGGCCAACGTCCTGACTTTCGGGGCCGGCAGCAGGCTGACC...   \n",
       " 14   TRBJ2-7*01    CTCCTACGAGCAGTACTTCGGGCCGGGCACCAGGCTCACGGTCACAG   \n",
       " 15   TRBJ2-7*02    CTCCTACGAGCAGTACGTCGGGCCGGGCACCAGGCTCACGGTCACAG   \n",
       " \n",
       "     anchor_index function  \n",
       " id                         \n",
       " 0           17.0        F  \n",
       " 1           17.0        F  \n",
       " 2           19.0        F  \n",
       " 3           20.0        F  \n",
       " 4           19.0        F  \n",
       " 5           22.0        F  \n",
       " 6           22.0        F  \n",
       " 7           19.0        F  \n",
       " 8           20.0        F  \n",
       " 9            NaN      NaN  \n",
       " 10          18.0        F  \n",
       " 11          19.0        F  \n",
       " 12          17.0        F  \n",
       " 13          22.0        F  \n",
       " 14          16.0        F  \n",
       " 15           NaN      NaN  }"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ref_genome.to_dict()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Remove gene V and J templates without CDR3 anchors"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'V':             name                                              value  \\\n",
       " id                                                                    \n",
       " 0       TRBV1*01  GATACTGGAATTACCCAGACACCAAAATACCTGGTCACAGCAATGG...   \n",
       " 1    TRBV10-1*01  GATGCTGAAATCACCCAGAGCCCAAGACACAAGATCACAGAGACAG...   \n",
       " 2    TRBV10-1*02  GATGCTGAAATCACCCAGAGCCCAAGACACAAGATCACAGAGACAG...   \n",
       " 3    TRBV10-2*01  GATGCTGGAATCACCCAGAGCCCAAGATACAAGATCACAGAGACAG...   \n",
       " 4    TRBV10-2*02  GATGCTGGAATCACCCAGAGCCCAAGATACAAGATCACAGAGACAG...   \n",
       " ..           ...                                                ...   \n",
       " 140   TRBV8-1*02  GAGGCAGGGATCAGCCAGATACCAAGATATCACAGACACACAGGGA...   \n",
       " 141   TRBV8-2*02  GATGCTGGGATCACCCAGATGCCAAGATATCACATTGTACAGAAGA...   \n",
       " 142     TRBV9*01  GATTCTGGAGTCACACAAACCCCAAAGCACCTGATCACAGCAACTG...   \n",
       " 143     TRBV9*02  GATTCTGGAGTCACACAAACCCCAAAGCACCTGATCACAGCAACTG...   \n",
       " 144     TRBV9*03  GATTCTGGAGTCACACAAACCCCAAAGCACCTGATCACAGCAACTG...   \n",
       " \n",
       "      anchor_index gfunction  \n",
       " id                           \n",
       " 0             267         P  \n",
       " 1             270         F  \n",
       " 2             270         F  \n",
       " 3             270         F  \n",
       " 4             270         F  \n",
       " ..            ...       ...  \n",
       " 140           265         P  \n",
       " 141           257         P  \n",
       " 142           270         F  \n",
       " 143           270         F  \n",
       " 144           270       (F)  \n",
       " \n",
       " [145 rows x 4 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                                              value  \\\n",
       " id                                                                  \n",
       " 0   TRBJ1-1*01   TGAACACTGAAGCTTTCTTTGGACAAGGCACCAGACTCACAGTTGTAG   \n",
       " 1   TRBJ1-2*01   CTAACTATGGCTACACCTTCGGTTCGGGGACCAGGTTAACCGTTGTAG   \n",
       " 2   TRBJ1-3*01  CTCTGGAAACACCATATATTTTGGAGAGGGAAGTTGGCTCACTGTT...   \n",
       " 3   TRBJ1-4*01  CAACTAATGAAAAACTGTTTTTTGGCAGTGGAACCCAGCTCTCTGT...   \n",
       " 4   TRBJ1-5*01  TAGCAATCAGCCCCAGCATTTTGGTGATGGGACTCGACTCTCCATC...   \n",
       " 5   TRBJ1-6*01  CTCCTATAATTCACCCCTCCACTTTGGGAATGGGACCAGGCTCACT...   \n",
       " 6   TRBJ1-6*02  CTCCTATAATTCACCCCTCCACTTTGGGAACGGGACCAGGCTCACT...   \n",
       " 7   TRBJ2-1*01  CTCCTACAATGAGCAGTTCTTCGGGCCAGGGACACGGCTCACCGTG...   \n",
       " 8   TRBJ2-2*01  CGAACACCGGGGAGCTGTTTTTTGGAGAAGGCTCTAGGCTGACCGT...   \n",
       " 9   TRBJ2-3*01  AGCACAGATACGCAGTATTTTGGCCCAGGCACCCGGCTGACAGTGCTCG   \n",
       " 10  TRBJ2-4*01  AGCCAAAAACATTCAGTACTTCGGCGCCGGGACCCGGCTCTCAGTG...   \n",
       " 11  TRBJ2-5*01   ACCAAGAGACCCAGTACTTCGGGCCAGGCACGCGGCTCCTGGTGCTCG   \n",
       " 12  TRBJ2-6*01  CTCTGGGGCCAACGTCCTGACTTTCGGGGCCGGCAGCAGGCTGACC...   \n",
       " 13  TRBJ2-7*01    CTCCTACGAGCAGTACTTCGGGCCGGGCACCAGGCTCACGGTCACAG   \n",
       " \n",
       "     anchor_index function  \n",
       " id                         \n",
       " 0             17        F  \n",
       " 1             17        F  \n",
       " 2             19        F  \n",
       " 3             20        F  \n",
       " 4             19        F  \n",
       " 5             22        F  \n",
       " 6             22        F  \n",
       " 7             19        F  \n",
       " 8             20        F  \n",
       " 9             18        F  \n",
       " 10            19        F  \n",
       " 11            17        F  \n",
       " 12            22        F  \n",
       " 13            16        F  }"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# TODO: Add flag with default\n",
    "ref_genome.clean_empty_anchors()\n",
    "ref_genome.to_dict()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Make a model using a IgorRefGenome instance\n",
    "This method generate a new IgorModel with uniform distribution for the conditional probabilities. If IgorRefGenome instance has D gene, then VDJ default model will be generated otherwise VJ model."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      ".xdata['v_3_del', 'v_choice', 'vd_ins', 'dj_dinucl', 'd_gene', 'd_5_del', 'vd_dinucl', 'j_5_del', 'd_3_del', 'j_choice', 'dj_ins']\n"
     ]
    }
   ],
   "source": [
    "mdl_ini = igor.Model.make_default_model_from_IgorRefGenome(ref_genome)\n",
    "print(mdl_ini)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "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: 145)&gt;\n",
       "array([0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655])\n",
       "Coordinates:\n",
       "  * v_choice       (v_choice) int64 0 1 2 3 4 5 6 ... 139 140 141 142 143 144\n",
       "    lbl__v_choice  (v_choice) object &#x27;TRBV1*01&#x27; &#x27;TRBV10-1*01&#x27; ... &#x27;TRBV9*03&#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;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>: 145</li></ul></div><ul class='xr-sections'><li class='xr-section-item'><div class='xr-array-wrap'><input id='section-41e354ed-571f-4971-a010-4e4fbd3002c6' class='xr-array-in' type='checkbox' checked><label for='section-41e354ed-571f-4971-a010-4e4fbd3002c6' 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.006897 0.006897 0.006897 0.006897 ... 0.006897 0.006897 0.006897</span></div><div class='xr-array-data'><pre>array([0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655])</pre></div></div></li><li class='xr-section-item'><input id='section-a80a7d08-2f62-43f5-800d-df00e28a5f59' class='xr-section-summary-in' type='checkbox'  checked><label for='section-a80a7d08-2f62-43f5-800d-df00e28a5f59' 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 ... 140 141 142 143 144</div><input id='attrs-cb6930a9-6f13-4722-8080-a40513741c7f' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-cb6930a9-6f13-4722-8080-a40513741c7f' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-89afffe0-45a6-44b0-b2b3-f8242144d508' class='xr-var-data-in' type='checkbox'><label for='data-89afffe0-45a6-44b0-b2b3-f8242144d508' 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,\n",
       "        14,  15,  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,\n",
       "        28,  29,  30,  31,  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,\n",
       "        42,  43,  44,  45,  46,  47,  48,  49,  50,  51,  52,  53,  54,  55,\n",
       "        56,  57,  58,  59,  60,  61,  62,  63,  64,  65,  66,  67,  68,  69,\n",
       "        70,  71,  72,  73,  74,  75,  76,  77,  78,  79,  80,  81,  82,  83,\n",
       "        84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,  96,  97,\n",
       "        98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,\n",
       "       112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125,\n",
       "       126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139,\n",
       "       140, 141, 142, 143, 144])</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*03&#x27;</div><input id='attrs-832dd0c8-c080-49d9-91ad-1e802d7d8856' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-832dd0c8-c080-49d9-91ad-1e802d7d8856' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-4e407ddb-f197-4f24-b816-17851fba723a' class='xr-var-data-in' type='checkbox'><label for='data-4e407ddb-f197-4f24-b816-17851fba723a' 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-2*01&#x27;,\n",
       "       &#x27;TRBV10-2*02&#x27;, &#x27;TRBV10-3*01&#x27;, &#x27;TRBV10-3*02&#x27;, &#x27;TRBV10-3*03&#x27;,\n",
       "       &#x27;TRBV10-3*04&#x27;, &#x27;TRBV11-1*01&#x27;, &#x27;TRBV11-2*01&#x27;, &#x27;TRBV11-2*02&#x27;,\n",
       "       &#x27;TRBV11-2*03&#x27;, &#x27;TRBV11-3*01&#x27;, &#x27;TRBV11-3*02&#x27;, &#x27;TRBV11-3*03&#x27;,\n",
       "       &#x27;TRBV11-3*04&#x27;, &#x27;TRBV12-1*01&#x27;, &#x27;TRBV12-2*01&#x27;, &#x27;TRBV12-3*01&#x27;,\n",
       "       &#x27;TRBV12-4*01&#x27;, &#x27;TRBV12-4*02&#x27;, &#x27;TRBV12-5*01&#x27;, &#x27;TRBV13*01&#x27;,\n",
       "       &#x27;TRBV13*02&#x27;, &#x27;TRBV14*01&#x27;, &#x27;TRBV14*02&#x27;, &#x27;TRBV15*01&#x27;, &#x27;TRBV15*02&#x27;,\n",
       "       &#x27;TRBV15*03&#x27;, &#x27;TRBV16*01&#x27;, &#x27;TRBV16*02&#x27;, &#x27;TRBV16*03&#x27;, &#x27;TRBV18*01&#x27;,\n",
       "       &#x27;TRBV19*01&#x27;, &#x27;TRBV19*02&#x27;, &#x27;TRBV19*03&#x27;, &#x27;TRBV2*01&#x27;, &#x27;TRBV2*02&#x27;,\n",
       "       &#x27;TRBV2*03&#x27;, &#x27;TRBV20-1*01&#x27;, &#x27;TRBV20-1*02&#x27;, &#x27;TRBV20-1*03&#x27;,\n",
       "       &#x27;TRBV20-1*04&#x27;, &#x27;TRBV20-1*05&#x27;, &#x27;TRBV20-1*06&#x27;, &#x27;TRBV20-1*07&#x27;,\n",
       "       &#x27;TRBV20/OR9-2*01&#x27;, &#x27;TRBV20/OR9-2*02&#x27;, &#x27;TRBV20/OR9-2*03&#x27;,\n",
       "       &#x27;TRBV21-1*01&#x27;, &#x27;TRBV21-1*02&#x27;, &#x27;TRBV21/OR9-2*01&#x27;, &#x27;TRBV23-1*01&#x27;,\n",
       "       &#x27;TRBV23/OR9-2*01&#x27;, &#x27;TRBV24-1*01&#x27;, &#x27;TRBV24-1*02&#x27;, &#x27;TRBV24/OR9-2*01&#x27;,\n",
       "       &#x27;TRBV25-1*01&#x27;, &#x27;TRBV25/OR9-2*01&#x27;, &#x27;TRBV26/OR9-2*01&#x27;,\n",
       "       &#x27;TRBV26/OR9-2*02&#x27;, &#x27;TRBV27*01&#x27;, &#x27;TRBV28*01&#x27;, &#x27;TRBV29-1*01&#x27;,\n",
       "       &#x27;TRBV29-1*02&#x27;, &#x27;TRBV29-1*03&#x27;, &#x27;TRBV29/OR9-2*01&#x27;, &#x27;TRBV29/OR9-2*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;TRBV3-2*03&#x27;, &#x27;TRBV30*01&#x27;, &#x27;TRBV30*02&#x27;, &#x27;TRBV30*03&#x27;, &#x27;TRBV30*04&#x27;,\n",
       "       &#x27;TRBV30*05&#x27;, &#x27;TRBV4-1*01&#x27;, &#x27;TRBV4-1*02&#x27;, &#x27;TRBV4-2*01&#x27;,\n",
       "       &#x27;TRBV4-2*02&#x27;, &#x27;TRBV4-3*01&#x27;, &#x27;TRBV4-3*02&#x27;, &#x27;TRBV4-3*03&#x27;,\n",
       "       &#x27;TRBV4-3*04&#x27;, &#x27;TRBV5-1*01&#x27;, &#x27;TRBV5-1*02&#x27;, &#x27;TRBV5-2*01&#x27;,\n",
       "       &#x27;TRBV5-3*01&#x27;, &#x27;TRBV5-3*02&#x27;, &#x27;TRBV5-4*01&#x27;, &#x27;TRBV5-4*02&#x27;,\n",
       "       &#x27;TRBV5-4*03&#x27;, &#x27;TRBV5-4*04&#x27;, &#x27;TRBV5-5*01&#x27;, &#x27;TRBV5-5*02&#x27;,\n",
       "       &#x27;TRBV5-5*03&#x27;, &#x27;TRBV5-6*01&#x27;, &#x27;TRBV5-7*01&#x27;, &#x27;TRBV5-8*01&#x27;,\n",
       "       &#x27;TRBV5-8*02&#x27;, &#x27;TRBV6-1*01&#x27;, &#x27;TRBV6-2*01&#x27;, &#x27;TRBV6-3*01&#x27;,\n",
       "       &#x27;TRBV6-4*01&#x27;, &#x27;TRBV6-4*02&#x27;, &#x27;TRBV6-5*01&#x27;, &#x27;TRBV6-6*01&#x27;,\n",
       "       &#x27;TRBV6-6*02&#x27;, &#x27;TRBV6-6*03&#x27;, &#x27;TRBV6-6*04&#x27;, &#x27;TRBV6-6*05&#x27;,\n",
       "       &#x27;TRBV6-7*01&#x27;, &#x27;TRBV6-8*01&#x27;, &#x27;TRBV6-9*01&#x27;, &#x27;TRBV7-1*01&#x27;,\n",
       "       &#x27;TRBV7-2*01&#x27;, &#x27;TRBV7-2*02&#x27;, &#x27;TRBV7-2*03&#x27;, &#x27;TRBV7-2*04&#x27;,\n",
       "       &#x27;TRBV7-3*01&#x27;, &#x27;TRBV7-3*04&#x27;, &#x27;TRBV7-3*05&#x27;, &#x27;TRBV7-4*01&#x27;,\n",
       "       &#x27;TRBV7-6*01&#x27;, &#x27;TRBV7-6*02&#x27;, &#x27;TRBV7-7*01&#x27;, &#x27;TRBV7-7*02&#x27;,\n",
       "       &#x27;TRBV7-8*01&#x27;, &#x27;TRBV7-8*02&#x27;, &#x27;TRBV7-8*03&#x27;, &#x27;TRBV7-9*01&#x27;,\n",
       "       &#x27;TRBV7-9*02&#x27;, &#x27;TRBV7-9*03&#x27;, &#x27;TRBV7-9*04&#x27;, &#x27;TRBV7-9*05&#x27;,\n",
       "       &#x27;TRBV7-9*06&#x27;, &#x27;TRBV7-9*07&#x27;, &#x27;TRBV8-1*02&#x27;, &#x27;TRBV8-2*02&#x27;, &#x27;TRBV9*01&#x27;,\n",
       "       &#x27;TRBV9*02&#x27;, &#x27;TRBV9*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'>(v_choice)</div><div class='xr-var-dtype'>object</div><div class='xr-var-preview xr-preview'>&#x27;GATACTGGAATTACCCAGACACCAAAATACC...</div><input id='attrs-16f9c9d5-280a-46cf-9466-8b10de0f5c6c' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-16f9c9d5-280a-46cf-9466-8b10de0f5c6c' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-508b2c01-129f-4a99-b649-e2942126d454' class='xr-var-data-in' type='checkbox'><label for='data-508b2c01-129f-4a99-b649-e2942126d454' 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;GATGCTGGAATCACCCAGAGCCCAAGATACAAGATCACAGAGACAGGAAGGCAGGTGACCTTGATGTGTCACCAGACTTGGAGCCACAGCTATATGTTCTGGTATCGACAAGACCTGGGACATGGGCTGAGGCTGATCTATTACTCAGCAGCTGCTGATATTACAGATAAAGGAGAAGTCCCCGATGGCTATGTTGTCTCCAGATCCAAGACAGAGAATTTCCCCCTCACTCTGGAGTCAGCTACCCGCTCCCAGACATCTGTGTATTTCTGCGCCAGCAGTGAGTC&#x27;,\n",
       "       &#x27;GATGCTGGAATCACCCAGAGCCCAAGATACAAGATCACAGAGACAGGAAGGCAGGTGACCTTGATGTGTCACCAGACTTGGAGCCACAGCTATATGTTCTGGTATCGACAAGACCTGGGACATGGGCTGAGGCTGATCTATTACTCAGCAGCTGCTGATATTACAGATAAAGGAGAAGTCCCCGATGGCTACGTTGTCTCCAGATCCAAGACAGAGAATTTCCCCCTCACTCTGGAGTCAGCTACCCGCTCCCAGACATCTGTGTATTTCTGCGCCAGCAGTGAGTC&#x27;,\n",
       "       &#x27;GATGCTGGAATCACCCAGAGCCCAAGACACAAGGTCACAGAGACAGGAACACCAGTGACTCTGAGATGTCACCAGACTGAGAACCACCGCTATATGTACTGGTATCGACAAGACCCGGGGCATGGGCTGAGGCTGATCCATTACTCATATGGTGTTAAAGATACTGACAAAGGAGAAGTCTCAGATGGCTATAGTGTCTCTAGATCAAAGACAGAGGATTTCCTCCTCACTCTGGAGTCCGCTACCAGCTCCCAGACATCTGTGTACTTCTGTGCCATCAGTGAGTC&#x27;,\n",
       "       &#x27;GATGCTGGAATCACCCAGAGCCCAAGACACAAGGTCACAGAGACAGGAACACCAGTGACTCTGAGATGTCATCAGACTGAGAACCACCGCTATATGTACTGGTATCGACAAGACCCGGGGCATGGGCTGAGGCTGATCCATTACTCATATGGTGTTAAAGATACTGACAAAGGAGAAGTCTCAGATGGCTATAGTGTCTCTAGATCAAAGACAGAGGATTTCCTCCTCACTCTGGAGTCCGCTACCAGCTCCCAGACATCTGTGTACTTCTGTGCCATCAGTGAGTC&#x27;,\n",
       "       &#x27;GATGCTGGAATCACCCAGAGCCCAAGACACAAGGTCACAGAGACAGGAACACCAGTGACTCTGAGATGTCACCAGACTGAGAACCACCGCTACATGTACTGGTATCGACAAGACCCGGGGCATGGGCTGAGGCTAATCCATTACTCATATGGTGTTAAAGATACTGACAAAGGAGAAGTCTCAGATGGCTATAGTGTCTCTAGATCAAAGACAGAGGATTTCCTCCTCACTCTGGAGTCCGCTACCAGCTCCCAGACATCTGTGTACTTCTGT&#x27;,\n",
       "       &#x27;GATGCTGGAATCACCCAGAGCCCAAGACACAAGGTCACAGAGACAGGAACACCAGTGACTCTGAGATGTCACCAGACTGAGAACCACCGCTACATGTACTGGTATCGACAAGACCCGGGGCATGGGCTGAGGCTGATCCATTACTCATATGGTGTTAAAGATACTGACAAAGGAGAAGTCTCAGATGGCTATAGTGTCTCTAGATCAAAGACAGAGGATTTCCTCCTCACTCTGGAGTCCGCTACCAGCTCCCAGACATCTGTGTACTTCTGT&#x27;,\n",
       "       &#x27;GAAGCTGAAGTTGCCCAGTCCCCCAGATATAAGATTACAGAGAAAAGCCAGGCTGTGGCTTTTTGGTGTGATCCTATTTCTGGCCATGCTACCCTTTACTGGTACCGGCAGATCCTGGGACAGGGCCCGGAGCTTCTGGTTCAATTTCAGGATGAGAGTGTAGTAGATGATTCACAGTTGCCTAAGGATCGATTTTCTGCAGAGAGGCTCAAAGGAGTAGACTCCACTCTCAAGATCCAGCCTGCAGAGCTTGGGGACTCGGCCATGTATCTCTGTGCCAGCAGCTTAGC&#x27;,\n",
       "       &#x27;GAAGCTGGAGTTGCCCAGTCTCCCAGATATAAGATTATAGAGAAAAGGCAGAGTGTGGCTTTTTGGTGCAATCCTATATCTGGCCATGCTACCCTTTACTGGTACCAGCAGATCCTGGGACAGGGCCCAAAGCTTCTGATTCAGTTTCAGAATAACGGTGTAGTGGATGATTCACAGTTGCCTAAGGATCGATTTTCTGCAGAGAGGCTCAAAGGAGTAGACTCCACTCTCAAGATCCAGCCTGCAAAGCTTGAGGACTCGGCCGTGTATCTCTGTGCCAGCAGCTTAGA&#x27;,\n",
       "       &#x27;GAAGCTGGAGTTGCCCAGTCTCCCAGATATAAGATTATAGAGAAAAGGCAGAGTGTGGCTTTTTGGTGCAATCCTATATCTGGCCATGCTACCCTTTACTGGTACCAGCAGATCCTGGGACAGGGCCCAAAGCTTCTGATTCAGTTTCAGAATAACGGTGTAGTGGATGATTCACAGTTGCCTAAGGATCGATTTTCTGCAGAGAGGCTCAAAGGAGTAGACTCCACTCTCAAGATCCAGCCTGCAAAGCTTGAGAACTCGGCCGTGTATCTCTGTGCCAGCAGT&#x27;,\n",
       "       &#x27;GAAGCTGGAGTTGCCCAGTCTCCCAGATATAAGATTATAGAGAAAAGGCAGAGTGTGGCTTTTTGGTGCAATCCTATATCTGGCCATGCTACCCTTTACTGGTACCAGCAGATCCTGGGACAGGGCCCAAAGCTTCTGATTCAGTTTCAGAATAACGGTGTAGTGGATGATTCACAGTTGCCTAAGGATCGATTTTCTGCAGAGAGGCTCAAAGGAGTAGACTCCACTCTCAAGATCCAACCTGCAAAGCTTGAGGACTCGGCCGTGTATCTCTGTGCCAGCAGCTTAGA&#x27;,\n",
       "       &#x27;GAAGCTGGAGTGGTTCAGTCTCCCAGATATAAGATTATAGAGAAAAAACAGCCTGTGGCTTTTTGGTGCAATCCTATTTCTGGCCACAATACCCTTTACTGGTACCTGCAGAACTTGGGACAGGGCCCGGAGCTTCTGATTCGATATGAGAATGAGGAAGCAGTAGACGATTCACAGTTGCCTAAGGATCGATTTTCTGCAGAGAGGCTCAAAGGAGTAGACTCCACTCTCAAGATCCAGCCTGCAGAGCTTGGGGACTCGGCCGTGTATCTCTGTGCCAGCAGCTTAGA&#x27;,\n",
       "       &#x27;GAAGCTGGAGTGGTTCAGTCTCCCAGATATAAGATTATAGAGAAAAAGCAGCCTGTGGCTTTTTGGTGCAATCCTATTTCTGGCCACAATACCCTTTACTGGTACCGGCAGAACTTGGGACAGGGCCCGGAGCTTCTGATTCGATATGAGAATGAGGAAGCAGTAGACGATTCACAGTTGCCTAAGGATCGATTTTCTGCAGAGAGGCTCAAAGGAGTAGACTCCACTCTCAAGATCCAGCCTGCAGAGCTTGGGGACTCGGCCGTGTATCTCTGTGCCAGCAGC&#x27;,\n",
       "       &#x27;GGTCTCCCAGATATAAGATTATAGAGAAGAAACAGCCTGTGGCTTTTTGGTGCAATCCAATTTCTGGCCACAATACCCTTTACTGGTACCTGCAGAACTTGGGACAGGGCCCGGAGCTTCTGATTCGATATGAGAATGAGGAAGCAGTAGACGATTCACAGTTGCCTAAGGATCGATTTTCTGCAGAGAGGCTCAAAGGAGTAGACTCCACTCTCAAGATCCAGCCAGCAGAGCTTGGGGACTCGGCCATGTATCTCTGTGCCAGCAGC&#x27;,\n",
       "       &#x27;GAAGCTGGAGTGGTTCAGTCTCCCAGATATAAGATTATAGAGAAAAAACAGCCTGTGGCTTTTTGGTGCAATCCTATTTCTGGCCACAATACCCTTTACTGGTACCGGCAGAACTTGGGACAGGGCCCGGAGCTTCTGATTCGATATGAGAATGAGGAAGCAGTAGACGATTCACAGTTGCCTAAGGATCGATTTTCTGCAGAGAGGCTCAAAGGAGTAGACTCCACTCTCAAGATCCAGCCTGCAGAGCTTGGGGACTCGGCCGTGTATCTCTGTGCCAGCAGCTTAG&#x27;,\n",
       "       &#x27;GATGCTGGTGTTATCCAGTCACCCAGGCACAAAGTGACAGAGATGGGACAATCAGTAACTCTGAGATGCGAACCAATTTCAGGCCACAATGATCTTCTCTGGTACAGACAGACCTTTGTGCAGGGACTGGAATTGCTGAATTACTTCTGCAGCTGGACCCTCGTAGATGACTCAGGAGTGTCCAAGGATTGATTCTCAGCACAGATGCCTGATGTATCATTCTCCACTCTGAGGATCCAGCCCATGGAACCCAGGGACTTGGGCCTATATTTCTGTGCCAGCAGCTTTGC&#x27;,\n",
       "       &#x27;GATGCTGGCATTATCCAGTCACCCAAGCATGAGGTGACAGAAATGGGACAAACAGTGACTCTGAGATGTGAGCCAATTTTTGGCCACAATTTCCTTTTCTGGTACAGAGATACCTTCGTGCAGGGACTGGAATTGCTGAGTTACTTCCGGAGCTGATCTATTATAGATAATGCAGGTATGCCCACAGAGCGATTCTCAGCTGAGAGGCCTGATGGATCATTCTCTACTCTGAAGATCCAGCCTGCAGAGCAGGGGGACTCGGCCGTGTATGTCTGTGCAAGTCGCTTAGC&#x27;,\n",
       "       &#x27;GATGCTGGAGTTATCCAGTCACCCCGCCATGAGGTGACAGAGATGGGACAAGAAGTGACTCTGAGATGTAAACCAATTTCAGGCCACAACTCCCTTTTCTGGTACAGACAGACCATGATGCGGGGACTGGAGTTGCTCATTTACTTTAACAACAACGTTCCGATAGATGATTCAGGGATGCCCGAGGATCGATTCTCAGCTAAGATGCCTAATGCATCATTCTCCACTCTGAAGATCCAGCCCTCAGAACCCAGGGACTCAGCTGTGTACTTCTGTGCCAGCAGTTTAGC&#x27;,\n",
       "...\n",
       "       &#x27;GGTGCTGGAGTCTCCCAGTCTCCCAGGTACAAAGTCACAAAGAGGGGACAGGATGTAGCTCTCAGGTGTGATCCAATTTCGGGTCATGTATCCCTTTATTGGTACCGACAGGCCCTGGGGCAGGGCCCAGAGTTTCTGACTTACTTCAATTATGAAGCCCAACAAGACAAATCAGGGCTGCCCAATGATCGGTTCTCTGCAGAGAGGCCTGAGGGATCCATCTCCACTCTGACGATCCAGCGCACAGAGCAGCGGGACTCGGCCATGTATCGCTGTGCCAGCAGCTTAGC&#x27;,\n",
       "       &#x27;GGTGCTGGAGTCTCCCAGTCTCCCAGGTACAAAGTCACAAAGAGGGGACAGGATGTAGCTCTCAGGTGTGATCCAATCTCGGGTCATGTATCCCTTTATTGGTACCGACAGGCCCTGGGGCAGGGCCCAGAGTTTCTGACTTACTTCAATTATGAAGCCCAACAAGACAAATCAGGGCTGCCCAATGATCGGTTCTCTGCAGAGAGGCCTGAGGGATCCATCTCCACTCTGACGATCCAGCGCACAGAGCAGCGGGACTCGGCCATGTATCGCTGTGCCAGCAGC&#x27;,\n",
       "       &#x27;GGTGCTGGAGTCTCCCAGTCTCCCAGGTACAAAGTCACAAAGAGGGGACAGGATGTAACTCTCAGGTGTGATCCAATTTCGAGTCATGCAACCCTTTATTGGTATCAACAGGCCCTGGGGCAGGGCCCAGAGTTTCTGACTTACTTCAATTATGAAGCTCAACCAGACAAATCAGGGCTGCCCAGTGATCGGTTCTCTGCAGAGAGGCCTGAGGGATCCATCTCCACTCTGACGATTCAGCGCACAGAGCAGCGGGACTCAGCCATGTATCGCTGTGCCAGCAGCTTAGC&#x27;,\n",
       "       &#x27;GGTGCTGGAGTCTCCCAGTCTCCCAGGTACAAAGTCACAAAGAGGGGACAGGATGTAACTCTCAGGTGTGATCCAATTTCGAGTCATGTAACCCTTTATTGGTATCAACAGGCCCTGGGGCAGGGCCCAGAGTTTCTGACTTACTTCAATTATGAAGCTCAACCAGACAAATCAGGGCTGCCCAGTGATCGGTTCTCTGCAGAGAGGCCTGAGGGATCCATCTCCACTCTGACGATTCAGCGCACAGAGCAGCGGGACTCAGCCATGTATCGCTGTGCCAGCAGC&#x27;,\n",
       "       &#x27;GGTGCTGGAGTCTCCCAGTCCCCTAGGTACAAAGTCGCAAAGAGAGGACAGGATGTAGCTCTCAGGTGTGATCCAATTTCGGGTCATGTATCCCTTTTTTGGTACCAACAGGCCCTGGGGCAGGGGCCAGAGTTTCTGACTTATTTCCAGAATGAAGCTCAACTAGACAAATCGGGGCTGCCCAGTGATCGCTTCTTTGCAGAAAGGCCTGAGGGATCCGTCTCCACTCTGAAGATCCAGCGCACACAGCAGGAGGACTCCGCCGTGTATCTCTGTGCCAGCAGCTTAGC&#x27;,\n",
       "       &#x27;GGTGCTGGAGTCTCCCAGTCCCCTAGGTACAAAGTCGCAAAGAGAGGACAGGATGTAGCTCTCAGGTGTGATCCAATTTCGGGTCATGTATCCCTTTTTTGGTACCAACAGGCCCTGGGGCAGGGGCCAGAGTTTCTGACTTATTTCCAGAATGAAGCTCAACTAGACAAATCGGGGCTGCCCAGTGATCGCTTCTTTGCAGAAAGGCCTGAGGGATCCGTCTCCACTCTGAAGATCCAGCGCACACAGAAGGAGGACTCCGCCGTGTATCTCTGTGCCAGCAGCTTAGC&#x27;,\n",
       "       &#x27;GGTGCTGGAGTCTCCCAGTCCCCTAGGTACAAAGTCGCAAAGAGAGGACAGGATGTAGCTCTCAGGTGTGATCCAATTTCGGGTCATGTATCCCTTTTTTGGTACCAACAGGCCCTCGGGCAGGGGCCAGAGTTTCTGACTTATTTCCAGAATGAAGCTCAACTAGACAAATCGGGGCTGCCCAGTGATCGCTTCTTTGCAGAAAGGCCTGAGGGATCCGTCTCCACTCTGAAGATCCAGCGCACACAGCAGGAGGACTCCGCCGTGTATCTCTGTGCCAGCAGCCGA&#x27;,\n",
       "       &#x27;GATACTGGAGTCTCCCAGAACCCCAGACACAAGATCACAAAGAGGGGACAGAATGTAACTTTCAGGTGTGATCCAATTTCTGAACACAACCGCCTTTATTGGTACCGACAGACCCTGGGGCAGGGCCCAGAGTTTCTGACTTACTTCCAGAATGAAGCTCAACTAGAAAAATCAAGGCTGCTCAGTGATCGGTTCTCTGCAGAGAGGCCTAAGGGATCTTTCTCCACCTTGGAGATCCAGCGCACAGAGCAGGGGGACTCGGCCATGTATCTCTGTGCCAGCAGCTTAGC&#x27;,\n",
       "       &#x27;GATACTGGAGTCTCCCAGAACCCCAGACACAACATCACAAAGAGGGGACAGAATGTAACTTTCAGGTGTGATCCAATTTCTGAACACAACCGCCTTTATTGGTACCGACAGACCCTGGGGCAGGGCCCAGAGTTTCTGACTTACTTCCAGAATGAAGCTCAACTAGAAAAATCAAGGCTGCTCAGTGATCGGTTCTCTGCAGAGAGGCCTAAGGGATCTTTCTCCACCTTGGAGATCCAGCGCACAGAGCAGGGGGACTCGGCCATGTATCTCTGTGCCAGCAGCTTAGC&#x27;,\n",
       "       &#x27;GATACTGGAGTCTCCCAGGACCCCAGACACAAGATCACAAAGAGGGGACAGAATGTAACTTTCAGGTGTGATCCAATTTCTGAACACAACCGCCTTTATTGGTACCGACAGACCCTGGGGCAGGGCCCAGAGTTTCTGACTTACTTCCAGAATGAAGCTCAACTAGAAAAATCAAGGCTGCTCAGTGATCGGTTCTCTGCAGAGAGGCCTAAGGGATCTTTCTCCACCTTGGAGATCCAGCGCACAGAGCAGGGGGACTCGGCCATGTATCTCTGTGCCAGCAGCTTAGC&#x27;,\n",
       "       &#x27;ATATCTGGAGTCTCCCACAACCCCAGACACAAGATCACAAAGAGGGGACAGAATGTAACTTTCAGGTGTGATCCAATTTCTGAACACAACCGCCTTTATTGGTACCGACAGAACCCTGGGCAGGGCCCAGAGTTTCTGACTTACTTCCAGAATGAAGCTCAACTGGAAAAATCAGGGCTGCTCAGTGATCGGATCTCTGCAGAGAGGCCTAAGGGATCTTTCTCCACCTTGGAGATCCAGCGCACAGAGCAGGGGGACTCGGCCATGTATCTCTGTGCCAGCAGC&#x27;,\n",
       "       &#x27;GATACTGGAGTCTCCCAGAACCCCAGACACAAGATCACAAAGAGGGGACAGAATGTAACTTTCAGGTGTGATCCAATTTCTGAACACAACCGCCTTTATTGGTACCGACAGACCCTGGGGCAGGGCCCAGAGTTTCTGACTTACTTCCAGAATGAAGCTCAACTAGAAAAATCAAGGCTGCTCAGTGATCGGTTCTCTGCAGAGAGGCCTAAGGGATCTCTCTCCACCTTGGAGATCCAGCGCACAGAGCAGGGGGACTCGGCCATGTATCTCTGTGCCAGCACCAAA&#x27;,\n",
       "       &#x27;GATACTGGAGTCTCCCAGAACCCCAGACACAAGATCACAAAGAGGGGACAGAATGTAACTTTCAGGTGTGATCCAATTTCTGAACACAACCGCCTTTATTGGTACCGACAGACCCTGGGGCAGGGCCCAGAGTTTCTGACTTACTTCCAGAATGAAGCTCAACTAGAAAAATCAAGGCTGCTCAGTGATCGGTTCTCTGCAGAGAGGCCTAAGGGATCTCTTTCCACCTTGGAGATCCAGCGCACAGAGCAGGGGGACTCGGCCATGTATCTCTGTGCCAGCACGTTG&#x27;,\n",
       "       &#x27;CACAACCGCCTTTATTGGTACCGACAGACCCTGGGGCAGGGCCCAGAGTTTCTGACTTACTTCCAGAATGAAGCTCAACTAGAAAAATCAAGGCTGCTCAGTGATCGGTTCTCTGCAGAGAGGCCTAAGGGATCTTTCTCCACCTTGGAGATCCAGCGCACAGAGGAGGGGGACTCGGCCATGTATCTCTGTGCCAGCAGCAG&#x27;,\n",
       "       &#x27;GAGGCAGGGATCAGCCAGATACCAAGATATCACAGACACACAGGGAAAAAGATCATCCTGAAATTTGCTCAGATTAGGAACCATTATTCAGTGTTCTGTTATCAATAAGACCAAGAATAGGGGCTGAGGCTGATCCATTATTCAGGTAGTATTGGCAGCATGACCAAAGGCGGTGCCAAGGAAGGGTACAATGTCTCTGGAAACAAGCTCAAGCATTTTCCCTCAACCCTGGAGTCTACTAGCACCAGCCAGACCTCTGTACCTCTGTGGCAGTGCATC&#x27;,\n",
       "       &#x27;GATGCTGGGATCACCCAGATGCCAAGATATCACATTGTACAGAAGAAAGAGATGATCCTGGAATGTGCTCAGGTTAGGAACAGTGTTCTGATATCGACAAGACCCAAGACGGGGGCTGAAGCTTATCCACTATTCAGGCAGTGGTCACAGCAGGACCAAAGTTGATGTCACAGAGGGGTACTGTGTCTCTTGAAACAAGCTTGAGCATTTCCCCAATCCTGGCATCCACCAGCACCAGCCAGACCTATCTGTACCACTGTGGCAGCACATCCG&#x27;,\n",
       "       &#x27;GATTCTGGAGTCACACAAACCCCAAAGCACCTGATCACAGCAACTGGACAGCGAGTGACGCTGAGATGCTCCCCTAGGTCTGGAGACCTCTCTGTGTACTGGTACCAACAGAGCCTGGACCAGGGCCTCCAGTTCCTCATTCAGTATTATAATGGAGAAGAGAGAGCAAAAGGAAACATTCTTGAACGATTCTCCGCACAACAGTTCCCTGACTTGCACTCTGAACTAAACCTGAGCTCTCTGGAGCTGGGGGACTCAGCTTTGTATTTCTGTGCCAGCAGCGTAG&#x27;,\n",
       "       &#x27;GATTCTGGAGTCACACAAACCCCAAAGCACCTGATCACAGCAACTGGACAGCGAGTGACGCTGAGATGCTCCCCTAGGTCTGGAGACCTCTCTGTGTACTGGTACCAACAGAGCCTGGACCAGGGCCTCCAGTTCCTCATTCACTATTATAATGGAGAAGAGAGAGCAAAAGGAAACATTCTTGAACGATTCTCCGCACAACAGTTCCCTGACTTGCACTCTGAACTAAACCTGAGCTCTCTGGAGCTGGGGGACTCAGCTTTGTATTTCTGTGCCAGCAGCGTAG&#x27;,\n",
       "       &#x27;GATTCTGGAGTCACACAAACCCCAAAGCACCTGATCACAGCAACTGGACAGCGAGTGACGCTGAGATGCTCCCCTAGGTCTGGAGACCTCTCTGTGTACTGGTACCAACAGAGCCTGGACCAGGGCCTCCAGTTCCTCATTCAATATTATAATGGAGAAGAGAGAGCAAAAGGAAACATTCTTGAACGATTCTCCGCACAACAGTTCCCTGACTTGCACTCTGAACTAAACCTGAGCTCTCTGGAGCTGGGGGACTCAGCTTTGTATTTCTGTGCCAGCAGC&#x27;],\n",
       "      dtype=object)</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-ad792015-224b-439d-b71e-31ee6237024c' class='xr-section-summary-in' type='checkbox'  checked><label for='section-ad792015-224b-439d-b71e-31ee6237024c' 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: 145)>\n",
       "array([0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655,\n",
       "       0.00689655, 0.00689655, 0.00689655, 0.00689655, 0.00689655])\n",
       "Coordinates:\n",
       "  * v_choice       (v_choice) int64 0 1 2 3 4 5 6 ... 139 140 141 142 143 144\n",
       "    lbl__v_choice  (v_choice) object 'TRBV1*01' 'TRBV10-1*01' ... 'TRBV9*03'\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:      ['j_choice', 'd_gene', 'v_3_del']"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mdl_ini['v_choice']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Writing model parms in file  ./igor_inferring_lwaw96hu/dataIGoRh16Qv3twGh_mdldata/models/model_parms.txt\n",
      "Writing model marginals in file  ./igor_inferring_lwaw96hu/dataIGoRh16Qv3twGh_mdldata/models/model_marginals.txt\n",
      "/home/olivares/.local/bin/igor -set_wd ./igor_inferring_lwaw96hu -batch dataIGoRh16Qv3twGh -read_seqs ./igor_inferring_lwaw96hu/dataIGoRh16Qv3twGhinput_sequences.csv\n",
      "/home/olivares/.local/bin/igor -set_wd ./igor_inferring_lwaw96hu -batch dataIGoRh16Qv3twGh -set_genomic  --V ./igor_inferring_lwaw96hu/dataIGoRh16Qv3twGh_mdldata/ref_genome/genomicVs.fasta --D ./igor_inferring_lwaw96hu/dataIGoRh16Qv3twGh_mdldata/ref_genome/genomicDs.fasta --J ./igor_inferring_lwaw96hu/dataIGoRh16Qv3twGh_mdldata/ref_genome/genomicJs.fasta -set_CDR3_anchors  --V ./igor_inferring_lwaw96hu/dataIGoRh16Qv3twGh_mdldata/ref_genome/V_gene_CDR3_anchors.csv --J ./igor_inferring_lwaw96hu/dataIGoRh16Qv3twGh_mdldata/ref_genome/J_gene_CDR3_anchors.csv -align  --all  \n",
      "== Alignment finished! ==\n",
      "Writing model parms in file  ./igor_inferring_lwaw96hu/dataIGoRh16Qv3twGh_mdldata//models/model_parms.txt\n",
      "Writing model marginals in file  ./igor_inferring_lwaw96hu/dataIGoRh16Qv3twGh_mdldata//models/model_marginals.txt\n",
      "/home/olivares/.local/bin/igor -set_wd ./igor_inferring_lwaw96hu -batch dataIGoRh16Qv3twGh -set_custom_model ./igor_inferring_lwaw96hu/dataIGoRh16Qv3twGh_mdldata//models/model_parms.txt ./igor_inferring_lwaw96hu/dataIGoRh16Qv3twGh_mdldata//models/model_marginals.txt -set_CDR3_anchors  --V ./igor_inferring_lwaw96hu/dataIGoRh16Qv3twGh_mdldata//ref_genome/V_gene_CDR3_anchors.csv --J ./igor_inferring_lwaw96hu/dataIGoRh16Qv3twGh_mdldata//ref_genome/J_gene_CDR3_anchors.csv -infer  \n",
      "Parms filename:  ./igor_inferring_lwaw96hu/dataIGoRh16Qv3twGh_inference/final_parms.txt\n",
      "Marginals filename:  ./igor_inferring_lwaw96hu/dataIGoRh16Qv3twGh_inference/final_marginals.txt\n",
      "Parms filename:  ./igor_inferring_lwaw96hu/dataIGoRh16Qv3twGh_inference/final_parms.txt\n",
      "Marginals filename:  ./igor_inferring_lwaw96hu/dataIGoRh16Qv3twGh_inference/final_marginals.txt\n"
     ]
    }
   ],
   "source": [
    "mdl_new, df_likelihood = igor.infer(sequences, mdl_ini)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "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>iteration</th>\n",
       "      <th>mean_log_Likelihood</th>\n",
       "      <th>n_seq</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>-17.13000</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>-9.37992</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>-8.49343</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "      <td>-8.12628</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5</td>\n",
       "      <td>-8.03973</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   iteration  mean_log_Likelihood  n_seq\n",
       "0          1            -17.13000     10\n",
       "1          2             -9.37992     10\n",
       "2          3             -8.49343     10\n",
       "3          4             -8.12628     10\n",
       "4          5             -8.03973     10"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_likelihood"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<AxesSubplot:>"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "[encoded data, 16520 characters]\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "mdl_new.plot_Bayes_network()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "[encoded data, 63240 characters]\n",
      "text/plain": [
       "<Figure size 1296x1440 with 3 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "figura = mdl_new.plot_GeneChoice_Pmarginal()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "[encoded data, 79284 characters]\n",
      "text/plain": [
       "<Figure size 1152x432 with 2 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "figura = mdl_new.plot_InsertionsDeletions_Pmarginal()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Direct access to anchors by id"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "id\n",
       "0      267\n",
       "1      270\n",
       "2      270\n",
       "3      270\n",
       "4      270\n",
       "      ... \n",
       "140    265\n",
       "141    257\n",
       "142    270\n",
       "143    270\n",
       "144    270\n",
       "Name: anchor_index, Length: 145, dtype: int64"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mdl_ini.V_anchors"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "id\n",
       "0      267\n",
       "1      270\n",
       "2      270\n",
       "3      270\n",
       "4      270\n",
       "      ... \n",
       "140    265\n",
       "141    257\n",
       "142    270\n",
       "143    270\n",
       "144    270\n",
       "Name: anchor_index, Length: 145, dtype: int64"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mdl_new.V_anchors"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "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>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>ATTGCTGGGATCACCCAGGCACCAACATCTCAGATCCTGGCAGCAG...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>GGTGCTGGAGTCTCCCAGACCCCCAGTAACAAGGTCACAGAGAAGG...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>CATGCCAAAGTCACACAGACTCCAGGACATTTGGTCAAAGGAAAAG...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>AAGGCTGGAGTCACTCAAACTCCAAGATATCTGATCAAAACGAGAG...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>GATGCTGAAATCACCCAGAGCCCAAGACACAAGATCACAGAGACAG...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>GAGACTGGAGTCACCCAAAGTCCCACACACCTGATCAAAACGAGAG...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>AAGGCTGGAGTCACTCAAACTCCAAGATATCTGATCAAAACGAGAG...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>GGTGCTGTCGTCTCTCAACATCCGAGCTGGGTTATCTGTAAGAGTG...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>GATGCTGGAGTTATCCAGTCACCCCGGCACGAGGTGACAGAGATGG...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>GGTGCTGGAGTCTCCCAGACCCCCAGTAACAAGGTCACAGAGAAGG...</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                 nt_sequence\n",
       "seq_index                                                   \n",
       "0          ATTGCTGGGATCACCCAGGCACCAACATCTCAGATCCTGGCAGCAG...\n",
       "1          GGTGCTGGAGTCTCCCAGACCCCCAGTAACAAGGTCACAGAGAAGG...\n",
       "2          CATGCCAAAGTCACACAGACTCCAGGACATTTGGTCAAAGGAAAAG...\n",
       "3          AAGGCTGGAGTCACTCAAACTCCAAGATATCTGATCAAAACGAGAG...\n",
       "4          GATGCTGAAATCACCCAGAGCCCAAGACACAAGATCACAGAGACAG...\n",
       "5          GAGACTGGAGTCACCCAAAGTCCCACACACCTGATCAAAACGAGAG...\n",
       "6          AAGGCTGGAGTCACTCAAACTCCAAGATATCTGATCAAAACGAGAG...\n",
       "7          GGTGCTGTCGTCTCTCAACATCCGAGCTGGGTTATCTGTAAGAGTG...\n",
       "8          GATGCTGGAGTTATCCAGTCACCCCGGCACGAGGTGACAGAGATGG...\n",
       "9          GGTGCTGGAGTCTCCCAGACCCCCAGTAACAAGGTCACAGAGAAGG..."
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sequences"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Writing model parms in file  ./igor_evaluating_1hzyeljx/dataIGoR39mPgNHdw8_mdldata/models/model_parms.txt\n",
      "Writing model marginals in file  ./igor_evaluating_1hzyeljx/dataIGoR39mPgNHdw8_mdldata/models/model_marginals.txt\n",
      "/home/olivares/.local/bin/igor -set_wd ./igor_evaluating_1hzyeljx -batch dataIGoR39mPgNHdw8 -read_seqs ./igor_evaluating_1hzyeljx/dataIGoR39mPgNHdw8input_sequences.csv\n",
      "/home/olivares/.local/bin/igor -set_wd ./igor_evaluating_1hzyeljx -batch dataIGoR39mPgNHdw8 -set_genomic  --V ./igor_evaluating_1hzyeljx/dataIGoR39mPgNHdw8_mdldata/ref_genome/genomicVs.fasta --D ./igor_evaluating_1hzyeljx/dataIGoR39mPgNHdw8_mdldata/ref_genome/genomicDs.fasta --J ./igor_evaluating_1hzyeljx/dataIGoR39mPgNHdw8_mdldata/ref_genome/genomicJs.fasta -set_CDR3_anchors  --V ./igor_evaluating_1hzyeljx/dataIGoR39mPgNHdw8_mdldata/ref_genome/V_gene_CDR3_anchors.csv --J ./igor_evaluating_1hzyeljx/dataIGoR39mPgNHdw8_mdldata/ref_genome/J_gene_CDR3_anchors.csv -align  --all  \n",
      "/home/olivares/.local/bin/igor -set_wd ./igor_evaluating_1hzyeljx -batch dataIGoR39mPgNHdw8 -set_custom_model ./igor_evaluating_1hzyeljx/dataIGoR39mPgNHdw8_mdldata/models/model_parms.txt ./igor_evaluating_1hzyeljx/dataIGoR39mPgNHdw8_mdldata/models/model_marginals.txt -evaluate  -output  --scenarios 5  --Pgen  \n",
      "./igor_evaluating_1hzyeljx/aligns/dataIGoR39mPgNHdw8_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_1hzyeljx/dataIGoR39mPgNHdw8_mdldata/ref_genome/genomicVs.fasta\n",
      "J ./igor_evaluating_1hzyeljx/dataIGoR39mPgNHdw8_mdldata/ref_genome/genomicJs.fasta\n",
      "D ./igor_evaluating_1hzyeljx/dataIGoR39mPgNHdw8_mdldata/ref_genome/genomicDs.fasta\n",
      "loading Anchors data ...\n",
      "Loading Gene Anchors from  ./igor_evaluating_1hzyeljx/dataIGoR39mPgNHdw8_mdldata/ref_genome/V_gene_CDR3_anchors.csv\n",
      "Loading Gene Anchors from  ./igor_evaluating_1hzyeljx/dataIGoR39mPgNHdw8_mdldata/ref_genome/J_gene_CDR3_anchors.csv\n",
      "./igor_evaluating_1hzyeljx/aligns/dataIGoR39mPgNHdw8_V_alignments.csv\n",
      "['']\n",
      "['']\n",
      "['']\n",
      "Alignments loaded in database in ./igor_evaluating_1hzyeljx/dataIGoR39mPgNHdw8.db\n",
      "Parms filename:  ./igor_evaluating_1hzyeljx/dataIGoR39mPgNHdw8_mdldata/models/model_parms.txt\n",
      "Marginals filename:  ./igor_evaluating_1hzyeljx/dataIGoR39mPgNHdw8_mdldata/models/model_marginals.txt\n",
      "Model loaded\n",
      "Loading parms to database\n",
      "('v_choice', 'j_choice')\n",
      "('v_choice', 'd_gene')\n",
      "('v_choice', 'v_3_del')\n",
      "('j_choice', 'd_gene')\n",
      "('j_choice', 'j_5_del')\n",
      "('d_gene', 'd_5_del')\n",
      "('d_gene', 'd_3_del')\n",
      "('d_5_del', 'd_3_del')\n",
      "Loading marginals to database\n",
      "./igor_evaluating_1hzyeljx/dataIGoR39mPgNHdw8_output/best_scenarios_counts.csv\n",
      "events_name_nickname_dict {'GeneChoice_V_gene_Undefined_side_prio7_size145': 'v_choice', 'GeneChoice_J_gene_Undefined_side_prio7_size14': '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_size21': 'j_5_del', 'Deletion_D_gene_Three_prime_prio5_size21': 'd_3_del', 'Insertion_VD_genes_Undefined_side_prio4_size41': 'vd_ins', 'DinucMarkov_VD_genes_Undefined_side_prio3_size16': 'vd_dinucl', 'Insertion_DJ_gene_Undefined_side_prio2_size41': 'dj_ins', 'DinucMarkov_DJ_gene_Undefined_side_prio1_size16': 'dj_dinucl'}\n",
      "./igor_evaluating_1hzyeljx/dataIGoR39mPgNHdw8_output/Pgen_counts.csv\n",
      "./igor_evaluating_1hzyeljx/dataIGoR39mPgNHdw8_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"
     ]
    }
   ],
   "source": [
    "# Evaluate sequences\n",
    "df_airr_sequences = igor.evaluate(sequences, mdl_new, N_scenarios=5)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "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>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>ATTGCTGGGATCACCCAGGCACCAACATCTCAGATCCTGGCAGCAG...</td>\n",
       "      <td>F</td>\n",
       "      <td>NaN</td>\n",
       "      <td>TRBV6-4*01</td>\n",
       "      <td>TRBD2*01</td>\n",
       "      <td>TRBJ2-1*01</td>\n",
       "      <td>ATTGCTGGGATCACCCAGGCACCAACATCTCAGATCCTGGCAGCAG...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>TGTGCCAGCAGTGACCTTTCCCGGGGAAAGCTCCTACAATGAGCAG...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>285M</td>\n",
       "      <td>3M</td>\n",
       "      <td>50M</td>\n",
       "      <td>1425</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2</td>\n",
       "      <td>285</td>\n",
       "      <td>1</td>\n",
       "      <td>283</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>15</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>287</td>\n",
       "      <td>288</td>\n",
       "      <td>2</td>\n",
       "      <td>4</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>250</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>9</td>\n",
       "      <td>57</td>\n",
       "      <td>2</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>3</td>\n",
       "      <td>CTT</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3</td>\n",
       "      <td>3</td>\n",
       "      <td>GAA</td>\n",
       "      <td>NaN</td>\n",
       "      <td>7</td>\n",
       "      <td>0</td>\n",
       "      <td>4</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>9.998680e-01</td>\n",
       "      <td>0.000001</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0</td>\n",
       "      <td>ATTGCTGGGATCACCCAGGCACCAACATCTCAGATCCTGGCAGCAG...</td>\n",
       "      <td>F</td>\n",
       "      <td>NaN</td>\n",
       "      <td>TRBV6-4*01</td>\n",
       "      <td>TRBD2*02</td>\n",
       "      <td>TRBJ2-1*01</td>\n",
       "      <td>ATTGCTGGGATCACCCAGGCACCAACATCTCAGATCCTGGCAGCAG...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>TGTGCCAGCAGTGACCTTTCCCGGGGAAAGCTCCTACAATGAGCAG...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>285M</td>\n",
       "      <td>3M</td>\n",
       "      <td>50M</td>\n",
       "      <td>1425</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2</td>\n",
       "      <td>285</td>\n",
       "      <td>1</td>\n",
       "      <td>283</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>15</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>287</td>\n",
       "      <td>288</td>\n",
       "      <td>2</td>\n",
       "      <td>4</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>250</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>9</td>\n",
       "      <td>57</td>\n",
       "      <td>2</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>3</td>\n",
       "      <td>CTT</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3</td>\n",
       "      <td>3</td>\n",
       "      <td>GAA</td>\n",
       "      <td>NaN</td>\n",
       "      <td>7</td>\n",
       "      <td>0</td>\n",
       "      <td>4</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>1.314840e-04</td>\n",
       "      <td>0.000001</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0</td>\n",
       "      <td>ATTGCTGGGATCACCCAGGCACCAACATCTCAGATCCTGGCAGCAG...</td>\n",
       "      <td>F</td>\n",
       "      <td>NaN</td>\n",
       "      <td>TRBV6-4*01</td>\n",
       "      <td>TRBD2*01</td>\n",
       "      <td>TRBJ2-1*01</td>\n",
       "      <td>ATTGCTGGGATCACCCAGGCACCAACATCTCAGATCCTGGCAGCAG...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>TGTGCCAGCAGTGACCTTTCCCGGGGAAAGCTCCTACAATGAGCAG...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>285M</td>\n",
       "      <td>3M</td>\n",
       "      <td>50M</td>\n",
       "      <td>1425</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2</td>\n",
       "      <td>285</td>\n",
       "      <td>1</td>\n",
       "      <td>283</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>15</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>287</td>\n",
       "      <td>288</td>\n",
       "      <td>2</td>\n",
       "      <td>4</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>250</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>11</td>\n",
       "      <td>59</td>\n",
       "      <td>2</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>3</td>\n",
       "      <td>CTT</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3</td>\n",
       "      <td>5</td>\n",
       "      <td>GAAAG</td>\n",
       "      <td>NaN</td>\n",
       "      <td>9</td>\n",
       "      <td>0</td>\n",
       "      <td>4</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>1.313840e-07</td>\n",
       "      <td>0.000001</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0</td>\n",
       "      <td>ATTGCTGGGATCACCCAGGCACCAACATCTCAGATCCTGGCAGCAG...</td>\n",
       "      <td>F</td>\n",
       "      <td>NaN</td>\n",
       "      <td>TRBV6-4*01</td>\n",
       "      <td>TRBD2*01</td>\n",
       "      <td>TRBJ2-1*01</td>\n",
       "      <td>ATTGCTGGGATCACCCAGGCACCAACATCTCAGATCCTGGCAGCAG...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>TGTGCCAGCAGTGACCTTTCCCGGGGAAAGCTCCTACAATGAGCAG...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>285M</td>\n",
       "      <td>1M</td>\n",
       "      <td>50M</td>\n",
       "      <td>1425</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2</td>\n",
       "      <td>285</td>\n",
       "      <td>1</td>\n",
       "      <td>283</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>287</td>\n",
       "      <td>286</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>250</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>9</td>\n",
       "      <td>57</td>\n",
       "      <td>2</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>3</td>\n",
       "      <td>CTT</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3</td>\n",
       "      <td>5</td>\n",
       "      <td>GGGAA</td>\n",
       "      <td>NaN</td>\n",
       "      <td>9</td>\n",
       "      <td>0</td>\n",
       "      <td>4</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>4</td>\n",
       "      <td>4.807220e-09</td>\n",
       "      <td>0.000001</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "      <td>ATTGCTGGGATCACCCAGGCACCAACATCTCAGATCCTGGCAGCAG...</td>\n",
       "      <td>F</td>\n",
       "      <td>NaN</td>\n",
       "      <td>TRBV6-4*01</td>\n",
       "      <td>TRBD2*02</td>\n",
       "      <td>TRBJ2-1*01</td>\n",
       "      <td>ATTGCTGGGATCACCCAGGCACCAACATCTCAGATCCTGGCAGCAG...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>TGTGCCAGCAGTGACCTTTCCCGGGGAAAGCTCCTACAATGAGCAG...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>285M</td>\n",
       "      <td>1M</td>\n",
       "      <td>50M</td>\n",
       "      <td>1425</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2</td>\n",
       "      <td>285</td>\n",
       "      <td>1</td>\n",
       "      <td>283</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>287</td>\n",
       "      <td>286</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>250</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>9</td>\n",
       "      <td>57</td>\n",
       "      <td>2</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>3</td>\n",
       "      <td>CTT</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3</td>\n",
       "      <td>5</td>\n",
       "      <td>GGGAA</td>\n",
       "      <td>NaN</td>\n",
       "      <td>9</td>\n",
       "      <td>0</td>\n",
       "      <td>4</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>5</td>\n",
       "      <td>2.847810e-11</td>\n",
       "      <td>0.000001</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  ATTGCTGGGATCACCCAGGCACCAACATCTCAGATCCTGGCAGCAG...        F   \n",
       "1            0  ATTGCTGGGATCACCCAGGCACCAACATCTCAGATCCTGGCAGCAG...        F   \n",
       "2            0  ATTGCTGGGATCACCCAGGCACCAACATCTCAGATCCTGGCAGCAG...        F   \n",
       "3            0  ATTGCTGGGATCACCCAGGCACCAACATCTCAGATCCTGGCAGCAG...        F   \n",
       "4            0  ATTGCTGGGATCACCCAGGCACCAACATCTCAGATCCTGGCAGCAG...        F   \n",
       "\n",
       "   productive      v_call    d_call      j_call  \\\n",
       "0         NaN  TRBV6-4*01  TRBD2*01  TRBJ2-1*01   \n",
       "1         NaN  TRBV6-4*01  TRBD2*02  TRBJ2-1*01   \n",
       "2         NaN  TRBV6-4*01  TRBD2*01  TRBJ2-1*01   \n",
       "3         NaN  TRBV6-4*01  TRBD2*01  TRBJ2-1*01   \n",
       "4         NaN  TRBV6-4*01  TRBD2*02  TRBJ2-1*01   \n",
       "\n",
       "                                  sequence_alignment  germline_alignment  \\\n",
       "0  ATTGCTGGGATCACCCAGGCACCAACATCTCAGATCCTGGCAGCAG...                 NaN   \n",
       "1  ATTGCTGGGATCACCCAGGCACCAACATCTCAGATCCTGGCAGCAG...                 NaN   \n",
       "2  ATTGCTGGGATCACCCAGGCACCAACATCTCAGATCCTGGCAGCAG...                 NaN   \n",
       "3  ATTGCTGGGATCACCCAGGCACCAACATCTCAGATCCTGGCAGCAG...                 NaN   \n",
       "4  ATTGCTGGGATCACCCAGGCACCAACATCTCAGATCCTGGCAGCAG...                 NaN   \n",
       "\n",
       "                                            junction junction_aa v_cigar  \\\n",
       "0  TGTGCCAGCAGTGACCTTTCCCGGGGAAAGCTCCTACAATGAGCAG...         NaN    285M   \n",
       "1  TGTGCCAGCAGTGACCTTTCCCGGGGAAAGCTCCTACAATGAGCAG...         NaN    285M   \n",
       "2  TGTGCCAGCAGTGACCTTTCCCGGGGAAAGCTCCTACAATGAGCAG...         NaN    285M   \n",
       "3  TGTGCCAGCAGTGACCTTTCCCGGGGAAAGCTCCTACAATGAGCAG...         NaN    285M   \n",
       "4  TGTGCCAGCAGTGACCTTTCCCGGGGAAAGCTCCTACAATGAGCAG...         NaN    285M   \n",
       "\n",
       "  d_cigar j_cigar  v_score  v_identity  v_support  v_sequence_start  \\\n",
       "0      3M     50M     1425         NaN        NaN                 2   \n",
       "1      3M     50M     1425         NaN        NaN                 2   \n",
       "2      3M     50M     1425         NaN        NaN                 2   \n",
       "3      1M     50M     1425         NaN        NaN                 2   \n",
       "4      1M     50M     1425         NaN        NaN                 2   \n",
       "\n",
       "   v_sequence_end  v_germline_start  v_germline_end  v_alignment_start  \\\n",
       "0             285                 1             283                NaN   \n",
       "1             285                 1             283                NaN   \n",
       "2             285                 1             283                NaN   \n",
       "3             285                 1             283                NaN   \n",
       "4             285                 1             283                NaN   \n",
       "\n",
       "   v_alignment_end  d_score  d_identity  d_support  d_sequence_start  \\\n",
       "0              NaN       15         NaN        NaN               287   \n",
       "1              NaN       15         NaN        NaN               287   \n",
       "2              NaN       15         NaN        NaN               287   \n",
       "3              NaN        5         NaN        NaN               287   \n",
       "4              NaN        5         NaN        NaN               287   \n",
       "\n",
       "   d_sequence_end  d_germline_start  d_germline_end  d_alignment_start  \\\n",
       "0             288                 2               4                NaN   \n",
       "1             288                 2               4                NaN   \n",
       "2             288                 2               4                NaN   \n",
       "3             286                 2               2                NaN   \n",
       "4             286                 2               2                NaN   \n",
       "\n",
       "   d_alignment_end  j_score  j_identity  j_support  j_sequence_start  \\\n",
       "0              NaN      250         NaN        NaN                 9   \n",
       "1              NaN      250         NaN        NaN                 9   \n",
       "2              NaN      250         NaN        NaN                11   \n",
       "3              NaN      250         NaN        NaN                 9   \n",
       "4              NaN      250         NaN        NaN                 9   \n",
       "\n",
       "   j_sequence_end  j_germline_start  j_germline_end  j_alignment_start  \\\n",
       "0              57                 2              51                NaN   \n",
       "1              57                 2              51                NaN   \n",
       "2              59                 2              51                NaN   \n",
       "3              57                 2              51                NaN   \n",
       "4              57                 2              51                NaN   \n",
       "\n",
       "   j_alignment_end  sequence_aa  vj_in_frame  stop_codon  complete_vdj  locus  \\\n",
       "0              NaN          NaN          NaN         NaN           NaN    NaN   \n",
       "1              NaN          NaN          NaN         NaN           NaN    NaN   \n",
       "2              NaN          NaN          NaN         NaN           NaN    NaN   \n",
       "3              NaN          NaN          NaN         NaN           NaN    NaN   \n",
       "4              NaN          NaN          NaN         NaN           NaN    NaN   \n",
       "\n",
       "   sequence_alignment_aa  n1_length  np1  np1_aa  np1_length  n2_length  \\\n",
       "0                    NaN          3  CTT     NaN           3          3   \n",
       "1                    NaN          3  CTT     NaN           3          3   \n",
       "2                    NaN          3  CTT     NaN           3          5   \n",
       "3                    NaN          3  CTT     NaN           3          5   \n",
       "4                    NaN          3  CTT     NaN           3          5   \n",
       "\n",
       "     np2  np2_aa  np2_length  p3v_length  p5d_length  p3d_length  p5j_length  \\\n",
       "0    GAA     NaN           7           0           4           0           2   \n",
       "1    GAA     NaN           7           0           4           0           2   \n",
       "2  GAAAG     NaN           9           0           4           0           0   \n",
       "3  GGGAA     NaN           9           0           4           0           2   \n",
       "4  GGGAA     NaN           9           0           4           0           2   \n",
       "\n",
       "   scenario_rank  scenario_proba_cond_seq      pgen  quality  \\\n",
       "0              1             9.998680e-01  0.000001      NaN   \n",
       "1              2             1.314840e-04  0.000001      NaN   \n",
       "2              3             1.313840e-07  0.000001      NaN   \n",
       "3              4             4.807220e-09  0.000001      NaN   \n",
       "4              5             2.847810e-11  0.000001      NaN   \n",
       "\n",
       "   quality_alignment  \n",
       "0                NaN  \n",
       "1                NaN  \n",
       "2                NaN  \n",
       "3                NaN  \n",
       "4                NaN  "
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_airr_sequences.head() #[['sequence_id','pgen', 'scenario_prob_cond_seq' ]]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Index(['sequence_id', 'sequence', 'rev_comp', 'productive', 'v_call', 'd_call',\n",
       "       'j_call', 'sequence_alignment', 'germline_alignment', 'junction',\n",
       "       'junction_aa', 'v_cigar', 'd_cigar', 'j_cigar', 'v_score', 'v_identity',\n",
       "       'v_support', 'v_sequence_start', 'v_sequence_end', 'v_germline_start',\n",
       "       'v_germline_end', 'v_alignment_start', 'v_alignment_end', 'd_score',\n",
       "       'd_identity', 'd_support', 'd_sequence_start', 'd_sequence_end',\n",
       "       'd_germline_start', 'd_germline_end', 'd_alignment_start',\n",
       "       'd_alignment_end', 'j_score', 'j_identity', 'j_support',\n",
       "       'j_sequence_start', 'j_sequence_end', 'j_germline_start',\n",
       "       'j_germline_end', 'j_alignment_start', 'j_alignment_end', 'sequence_aa',\n",
       "       'vj_in_frame', 'stop_codon', 'complete_vdj', 'locus',\n",
       "       'sequence_alignment_aa', 'n1_length', 'np1', 'np1_aa', 'np1_length',\n",
       "       'n2_length', 'np2', 'np2_aa', 'np2_length', 'p3v_length', 'p5d_length',\n",
       "       'p3d_length', 'p5j_length', 'scenario_rank', 'scenario_proba_cond_seq',\n",
       "       'pgen', 'quality', 'quality_alignment'],\n",
       "      dtype='object')"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_airr_sequences.columns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "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>sequence_id</th>\n",
       "      <th>sequence</th>\n",
       "      <th>v_call</th>\n",
       "      <th>d_call</th>\n",
       "      <th>j_call</th>\n",
       "      <th>pgen</th>\n",
       "      <th>scenario_rank</th>\n",
       "      <th>scenario_proba_cond_seq</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>ATTGCTGGGATCACCCAGGCACCAACATCTCAGATCCTGGCAGCAG...</td>\n",
       "      <td>TRBV6-4*01</td>\n",
       "      <td>TRBD2*01</td>\n",
       "      <td>TRBJ2-1*01</td>\n",
       "      <td>0.000001</td>\n",
       "      <td>1</td>\n",
       "      <td>9.998680e-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0</td>\n",
       "      <td>ATTGCTGGGATCACCCAGGCACCAACATCTCAGATCCTGGCAGCAG...</td>\n",
       "      <td>TRBV6-4*01</td>\n",
       "      <td>TRBD2*02</td>\n",
       "      <td>TRBJ2-1*01</td>\n",
       "      <td>0.000001</td>\n",
       "      <td>2</td>\n",
       "      <td>1.314840e-04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0</td>\n",
       "      <td>ATTGCTGGGATCACCCAGGCACCAACATCTCAGATCCTGGCAGCAG...</td>\n",
       "      <td>TRBV6-4*01</td>\n",
       "      <td>TRBD2*01</td>\n",
       "      <td>TRBJ2-1*01</td>\n",
       "      <td>0.000001</td>\n",
       "      <td>3</td>\n",
       "      <td>1.313840e-07</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0</td>\n",
       "      <td>ATTGCTGGGATCACCCAGGCACCAACATCTCAGATCCTGGCAGCAG...</td>\n",
       "      <td>TRBV6-4*01</td>\n",
       "      <td>TRBD2*01</td>\n",
       "      <td>TRBJ2-1*01</td>\n",
       "      <td>0.000001</td>\n",
       "      <td>4</td>\n",
       "      <td>4.807220e-09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "      <td>ATTGCTGGGATCACCCAGGCACCAACATCTCAGATCCTGGCAGCAG...</td>\n",
       "      <td>TRBV6-4*01</td>\n",
       "      <td>TRBD2*02</td>\n",
       "      <td>TRBJ2-1*01</td>\n",
       "      <td>0.000001</td>\n",
       "      <td>5</td>\n",
       "      <td>2.847810e-11</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   sequence_id                                           sequence      v_call  \\\n",
       "0            0  ATTGCTGGGATCACCCAGGCACCAACATCTCAGATCCTGGCAGCAG...  TRBV6-4*01   \n",
       "1            0  ATTGCTGGGATCACCCAGGCACCAACATCTCAGATCCTGGCAGCAG...  TRBV6-4*01   \n",
       "2            0  ATTGCTGGGATCACCCAGGCACCAACATCTCAGATCCTGGCAGCAG...  TRBV6-4*01   \n",
       "3            0  ATTGCTGGGATCACCCAGGCACCAACATCTCAGATCCTGGCAGCAG...  TRBV6-4*01   \n",
       "4            0  ATTGCTGGGATCACCCAGGCACCAACATCTCAGATCCTGGCAGCAG...  TRBV6-4*01   \n",
       "\n",
       "     d_call      j_call      pgen  scenario_rank  scenario_proba_cond_seq  \n",
       "0  TRBD2*01  TRBJ2-1*01  0.000001              1             9.998680e-01  \n",
       "1  TRBD2*02  TRBJ2-1*01  0.000001              2             1.314840e-04  \n",
       "2  TRBD2*01  TRBJ2-1*01  0.000001              3             1.313840e-07  \n",
       "3  TRBD2*01  TRBJ2-1*01  0.000001              4             4.807220e-09  \n",
       "4  TRBD2*02  TRBJ2-1*01  0.000001              5             2.847810e-11  "
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_airr_sequences[['sequence_id', 'sequence', 'v_call', 'd_call', 'j_call', 'pgen', 'scenario_rank', 'scenario_proba_cond_seq']].head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "id\n",
       "0      267\n",
       "1      270\n",
       "2      270\n",
       "3      270\n",
       "4      270\n",
       "      ... \n",
       "140    265\n",
       "141    257\n",
       "142    270\n",
       "143    270\n",
       "144    270\n",
       "Name: anchor_index, Length: 145, dtype: int64"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# mdl_ini.parms.df_V_anchors\n",
    "mdl_ini.V_anchors"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "id\n",
       "0      267\n",
       "1      270\n",
       "2      270\n",
       "3      270\n",
       "4      270\n",
       "      ... \n",
       "140    265\n",
       "141    257\n",
       "142    270\n",
       "143    270\n",
       "144    270\n",
       "Name: anchor_index, Length: 145, dtype: int64"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# mdl_new.parms.df_V_anchors\n",
    "mdl_new.V_anchors"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Writing model parms in file  ./igor_evaluating_qq0unf6s/dataIGoR5a5Jv3kiHW_mdldata/models/model_parms.txt\n",
      "Writing model marginals in file  ./igor_evaluating_qq0unf6s/dataIGoR5a5Jv3kiHW_mdldata/models/model_marginals.txt\n",
      "/home/olivares/.local/bin/igor -set_wd ./igor_evaluating_qq0unf6s -batch dataIGoR5a5Jv3kiHW -read_seqs ./igor_evaluating_qq0unf6s/dataIGoR5a5Jv3kiHWinput_sequences.csv\n",
      "/home/olivares/.local/bin/igor -set_wd ./igor_evaluating_qq0unf6s -batch dataIGoR5a5Jv3kiHW -set_genomic  --V ./igor_evaluating_qq0unf6s/dataIGoR5a5Jv3kiHW_mdldata/ref_genome/genomicVs.fasta --D ./igor_evaluating_qq0unf6s/dataIGoR5a5Jv3kiHW_mdldata/ref_genome/genomicDs.fasta --J ./igor_evaluating_qq0unf6s/dataIGoR5a5Jv3kiHW_mdldata/ref_genome/genomicJs.fasta -set_CDR3_anchors  --V ./igor_evaluating_qq0unf6s/dataIGoR5a5Jv3kiHW_mdldata/ref_genome/V_gene_CDR3_anchors.csv --J ./igor_evaluating_qq0unf6s/dataIGoR5a5Jv3kiHW_mdldata/ref_genome/J_gene_CDR3_anchors.csv -align  --all  \n",
      "/home/olivares/.local/bin/igor -set_wd ./igor_evaluating_qq0unf6s -batch dataIGoR5a5Jv3kiHW -set_custom_model ./igor_evaluating_qq0unf6s/dataIGoR5a5Jv3kiHW_mdldata/models/model_parms.txt ./igor_evaluating_qq0unf6s/dataIGoR5a5Jv3kiHW_mdldata/models/model_marginals.txt -evaluate  -output  --scenarios 1  --Pgen  \n",
      "./igor_evaluating_qq0unf6s/aligns/dataIGoR5a5Jv3kiHW_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_qq0unf6s/dataIGoR5a5Jv3kiHW_mdldata/ref_genome/genomicVs.fasta\n",
      "J ./igor_evaluating_qq0unf6s/dataIGoR5a5Jv3kiHW_mdldata/ref_genome/genomicJs.fasta\n",
      "D ./igor_evaluating_qq0unf6s/dataIGoR5a5Jv3kiHW_mdldata/ref_genome/genomicDs.fasta\n",
      "loading Anchors data ...\n",
      "Loading Gene Anchors from  ./igor_evaluating_qq0unf6s/dataIGoR5a5Jv3kiHW_mdldata/ref_genome/V_gene_CDR3_anchors.csv\n",
      "Loading Gene Anchors from  ./igor_evaluating_qq0unf6s/dataIGoR5a5Jv3kiHW_mdldata/ref_genome/J_gene_CDR3_anchors.csv\n",
      "./igor_evaluating_qq0unf6s/aligns/dataIGoR5a5Jv3kiHW_V_alignments.csv\n",
      "['']\n",
      "['']\n",
      "['']\n",
      "Alignments loaded in database in ./igor_evaluating_qq0unf6s/dataIGoR5a5Jv3kiHW.db\n",
      "Parms filename:  ./igor_evaluating_qq0unf6s/dataIGoR5a5Jv3kiHW_mdldata/models/model_parms.txt\n",
      "Marginals filename:  ./igor_evaluating_qq0unf6s/dataIGoR5a5Jv3kiHW_mdldata/models/model_marginals.txt\n",
      "Model loaded\n",
      "Loading parms to database\n",
      "('v_choice', 'j_choice')\n",
      "('v_choice', 'd_gene')\n",
      "('v_choice', 'v_3_del')\n",
      "('j_choice', 'd_gene')\n",
      "('j_choice', 'j_5_del')\n",
      "('d_gene', 'd_5_del')\n",
      "('d_gene', 'd_3_del')\n",
      "('d_5_del', 'd_3_del')\n",
      "Loading marginals to database\n",
      "./igor_evaluating_qq0unf6s/dataIGoR5a5Jv3kiHW_output/best_scenarios_counts.csv\n",
      "events_name_nickname_dict {'GeneChoice_V_gene_Undefined_side_prio7_size145': 'v_choice', 'GeneChoice_J_gene_Undefined_side_prio7_size14': '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_size21': 'j_5_del', 'Deletion_D_gene_Three_prime_prio5_size21': 'd_3_del', 'Insertion_VD_genes_Undefined_side_prio4_size41': 'vd_ins', 'DinucMarkov_VD_genes_Undefined_side_prio3_size16': 'vd_dinucl', 'Insertion_DJ_gene_Undefined_side_prio2_size41': 'dj_ins', 'DinucMarkov_DJ_gene_Undefined_side_prio1_size16': 'dj_dinucl'}\n",
      "./igor_evaluating_qq0unf6s/dataIGoR5a5Jv3kiHW_output/Pgen_counts.csv\n",
      "./igor_evaluating_qq0unf6s/dataIGoR5a5Jv3kiHW_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"
     ]
    }
   ],
   "source": [
    "seqs_pgen = igor.evaluate_pgen(sequences, mdl_new)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "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>sequence_id</th>\n",
       "      <th>sequence</th>\n",
       "      <th>v_call</th>\n",
       "      <th>d_call</th>\n",
       "      <th>j_call</th>\n",
       "      <th>pgen</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>ATTGCTGGGATCACCCAGGCACCAACATCTCAGATCCTGGCAGCAG...</td>\n",
       "      <td>TRBV6-4*01</td>\n",
       "      <td>TRBD2*01</td>\n",
       "      <td>TRBJ2-1*01</td>\n",
       "      <td>1.006100e-06</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>GGTGCTGGAGTCTCCCAGACCCCCAGTAACAAGGTCACAGAGAAGG...</td>\n",
       "      <td>TRBV7-3*01</td>\n",
       "      <td>TRBD2*02</td>\n",
       "      <td>TRBJ1-5*01</td>\n",
       "      <td>3.241680e-05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2</td>\n",
       "      <td>CATGCCAAAGTCACACAGACTCCAGGACATTTGGTCAAAGGAAAAG...</td>\n",
       "      <td>TRBV23-1*01</td>\n",
       "      <td>TRBD1*01</td>\n",
       "      <td>TRBJ2-4*01</td>\n",
       "      <td>4.075670e-08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>3</td>\n",
       "      <td>AAGGCTGGAGTCACTCAAACTCCAAGATATCTGATCAAAACGAGAG...</td>\n",
       "      <td>TRBV5-1*01</td>\n",
       "      <td>TRBD2*02</td>\n",
       "      <td>TRBJ1-2*01</td>\n",
       "      <td>4.256170e-12</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>4</td>\n",
       "      <td>GATGCTGAAATCACCCAGAGCCCAAGACACAAGATCACAGAGACAG...</td>\n",
       "      <td>TRBV10-1*01</td>\n",
       "      <td>TRBD1*01</td>\n",
       "      <td>TRBJ2-5*01</td>\n",
       "      <td>3.701530e-05</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   sequence_id                                           sequence  \\\n",
       "0            0  ATTGCTGGGATCACCCAGGCACCAACATCTCAGATCCTGGCAGCAG...   \n",
       "1            1  GGTGCTGGAGTCTCCCAGACCCCCAGTAACAAGGTCACAGAGAAGG...   \n",
       "2            2  CATGCCAAAGTCACACAGACTCCAGGACATTTGGTCAAAGGAAAAG...   \n",
       "3            3  AAGGCTGGAGTCACTCAAACTCCAAGATATCTGATCAAAACGAGAG...   \n",
       "4            4  GATGCTGAAATCACCCAGAGCCCAAGACACAAGATCACAGAGACAG...   \n",
       "\n",
       "        v_call    d_call      j_call          pgen  \n",
       "0   TRBV6-4*01  TRBD2*01  TRBJ2-1*01  1.006100e-06  \n",
       "1   TRBV7-3*01  TRBD2*02  TRBJ1-5*01  3.241680e-05  \n",
       "2  TRBV23-1*01  TRBD1*01  TRBJ2-4*01  4.075670e-08  \n",
       "3   TRBV5-1*01  TRBD2*02  TRBJ1-2*01  4.256170e-12  \n",
       "4  TRBV10-1*01  TRBD1*01  TRBJ2-5*01  3.701530e-05  "
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "seqs_pgen.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## One sequence only"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'ATTGCTGGGATCACCCAGGCACCAACATCTCAGATCCTGGCAGCAGGACGGCGCATGACACTGAGATGTACCCAGGATATGAGACATAATGCCATGTACTGGTATAGACAAGATCTAGGACTGGGGCTAAGGCTCATCCATTATTCAAATACTGCAGGTACCACTGGCAAAGGAGAAGTCCCTGATGGTTATAGTGTCTCCAGAGCAAACACAGATGATTTCCTCCTCACGTTGGCGTCTGCTGTACCCTCTCAGACATCTGTGTACTTCTGTGCCAGCAGTGACCTTTCCCGGGGAAAGCTCCTACAATGAGCAGTTCTTCGGGCCAGGGACACGGCTCACCGTGCTAG'"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "one_sequence = sequences.loc[0]['nt_sequence']\n",
    "one_sequence"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Writing model parms in file  ./igor_evaluating_z0xzw321/dataIGoRYVwTWkkzIi_mdldata/models/model_parms.txt\n",
      "Writing model marginals in file  ./igor_evaluating_z0xzw321/dataIGoRYVwTWkkzIi_mdldata/models/model_marginals.txt\n",
      "/home/olivares/.local/bin/igor -set_wd ./igor_evaluating_z0xzw321 -batch dataIGoRYVwTWkkzIi -read_seqs ./igor_evaluating_z0xzw321/dataIGoRYVwTWkkzIiinput_sequences.csv\n",
      "/home/olivares/.local/bin/igor -set_wd ./igor_evaluating_z0xzw321 -batch dataIGoRYVwTWkkzIi -set_genomic  --V ./igor_evaluating_z0xzw321/dataIGoRYVwTWkkzIi_mdldata/ref_genome/genomicVs.fasta --D ./igor_evaluating_z0xzw321/dataIGoRYVwTWkkzIi_mdldata/ref_genome/genomicDs.fasta --J ./igor_evaluating_z0xzw321/dataIGoRYVwTWkkzIi_mdldata/ref_genome/genomicJs.fasta -set_CDR3_anchors  --V ./igor_evaluating_z0xzw321/dataIGoRYVwTWkkzIi_mdldata/ref_genome/V_gene_CDR3_anchors.csv --J ./igor_evaluating_z0xzw321/dataIGoRYVwTWkkzIi_mdldata/ref_genome/J_gene_CDR3_anchors.csv -align  --all  \n",
      "/home/olivares/.local/bin/igor -set_wd ./igor_evaluating_z0xzw321 -batch dataIGoRYVwTWkkzIi -set_custom_model ./igor_evaluating_z0xzw321/dataIGoRYVwTWkkzIi_mdldata/models/model_parms.txt ./igor_evaluating_z0xzw321/dataIGoRYVwTWkkzIi_mdldata/models/model_marginals.txt -evaluate  -output  --scenarios 1  --Pgen  \n",
      "./igor_evaluating_z0xzw321/aligns/dataIGoRYVwTWkkzIi_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_z0xzw321/dataIGoRYVwTWkkzIi_mdldata/ref_genome/genomicVs.fasta\n",
      "J ./igor_evaluating_z0xzw321/dataIGoRYVwTWkkzIi_mdldata/ref_genome/genomicJs.fasta\n",
      "D ./igor_evaluating_z0xzw321/dataIGoRYVwTWkkzIi_mdldata/ref_genome/genomicDs.fasta\n",
      "loading Anchors data ...\n",
      "Loading Gene Anchors from  ./igor_evaluating_z0xzw321/dataIGoRYVwTWkkzIi_mdldata/ref_genome/V_gene_CDR3_anchors.csv\n",
      "Loading Gene Anchors from  ./igor_evaluating_z0xzw321/dataIGoRYVwTWkkzIi_mdldata/ref_genome/J_gene_CDR3_anchors.csv\n",
      "./igor_evaluating_z0xzw321/aligns/dataIGoRYVwTWkkzIi_V_alignments.csv\n",
      "['']\n",
      "['']\n",
      "['']\n",
      "Alignments loaded in database in ./igor_evaluating_z0xzw321/dataIGoRYVwTWkkzIi.db\n",
      "Parms filename:  ./igor_evaluating_z0xzw321/dataIGoRYVwTWkkzIi_mdldata/models/model_parms.txt\n",
      "Marginals filename:  ./igor_evaluating_z0xzw321/dataIGoRYVwTWkkzIi_mdldata/models/model_marginals.txt\n",
      "Model loaded\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_z0xzw321/dataIGoRYVwTWkkzIi_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_z0xzw321/dataIGoRYVwTWkkzIi_output/Pgen_counts.csv\n",
      "./igor_evaluating_z0xzw321/dataIGoRYVwTWkkzIi_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"
     ]
    }
   ],
   "source": [
    "seqs = igor.evaluate(one_sequence[20:], hb_mdl, N_scenarios=1)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "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>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>ACCAACATCTCAGATCCTGGCAGCAGGACGGCGCATGACACTGAGA...</td>\n",
       "      <td>F</td>\n",
       "      <td>NaN</td>\n",
       "      <td>X61653|TRBV6-4*01|Homo sapiens|F|V-REGION|426....</td>\n",
       "      <td>TRBD2*01</td>\n",
       "      <td>X02987|TRBJ2-1*01|Homo sapiens|F|J-REGION|800....</td>\n",
       "      <td>ATTGCTGGGATCACCCAGGCACCAACATCTCAGATCCTGGCAGCAG...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>TGTGCCAGCAGTGACCTTTCCCGGGGAAAGCTCCTACAATGAGCAG...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>285M</td>\n",
       "      <td>5M</td>\n",
       "      <td>50M</td>\n",
       "      <td>1425</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2</td>\n",
       "      <td>285</td>\n",
       "      <td>21</td>\n",
       "      <td>283</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>25</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>290</td>\n",
       "      <td>293</td>\n",
       "      <td>10</td>\n",
       "      <td>14</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>250</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>6</td>\n",
       "      <td>54</td>\n",
       "      <td>2</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>CTTTCC</td>\n",
       "      <td>NaN</td>\n",
       "      <td>6</td>\n",
       "      <td>2</td>\n",
       "      <td>AA</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>0.291515</td>\n",
       "      <td>7.937280e-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  ACCAACATCTCAGATCCTGGCAGCAGGACGGCGCATGACACTGAGA...        F   \n",
       "\n",
       "   productive                                             v_call     d_call  \\\n",
       "0         NaN  X61653|TRBV6-4*01|Homo sapiens|F|V-REGION|426....   TRBD2*01   \n",
       "\n",
       "                                              j_call  \\\n",
       "0  X02987|TRBJ2-1*01|Homo sapiens|F|J-REGION|800....   \n",
       "\n",
       "                                  sequence_alignment  germline_alignment  \\\n",
       "0  ATTGCTGGGATCACCCAGGCACCAACATCTCAGATCCTGGCAGCAG...                 NaN   \n",
       "\n",
       "                                            junction  junction_aa v_cigar  \\\n",
       "0  TGTGCCAGCAGTGACCTTTCCCGGGGAAAGCTCCTACAATGAGCAG...          NaN    285M   \n",
       "\n",
       "  d_cigar j_cigar  v_score  v_identity  v_support  v_sequence_start  \\\n",
       "0      5M     50M     1425         NaN        NaN                 2   \n",
       "\n",
       "   v_sequence_end  v_germline_start  v_germline_end  v_alignment_start  \\\n",
       "0             285                21             283                NaN   \n",
       "\n",
       "   v_alignment_end  d_score  d_identity  d_support  d_sequence_start  \\\n",
       "0              NaN       25         NaN        NaN               290   \n",
       "\n",
       "   d_sequence_end  d_germline_start  d_germline_end  d_alignment_start  \\\n",
       "0             293                10              14                NaN   \n",
       "\n",
       "   d_alignment_end  j_score  j_identity  j_support  j_sequence_start  \\\n",
       "0              NaN      250         NaN        NaN                 6   \n",
       "\n",
       "   j_sequence_end  j_germline_start  j_germline_end  j_alignment_start  \\\n",
       "0              54                 2              51                NaN   \n",
       "\n",
       "   j_alignment_end  sequence_aa  vj_in_frame  stop_codon  complete_vdj  locus  \\\n",
       "0              NaN          NaN          NaN         NaN           NaN    NaN   \n",
       "\n",
       "   sequence_alignment_aa  n1_length     np1  np1_aa  np1_length  n2_length  \\\n",
       "0                    NaN          6  CTTTCC     NaN           6          2   \n",
       "\n",
       "  np2  np2_aa  np2_length  p3v_length  p5d_length  p3d_length  p5j_length  \\\n",
       "0  AA     NaN           2           0           0           0           2   \n",
       "\n",
       "   scenario_rank  scenario_proba_cond_seq          pgen  quality  \\\n",
       "0              1                 0.291515  7.937280e-13      NaN   \n",
       "\n",
       "   quality_alignment  \n",
       "0                NaN  "
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "seqs.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [],
   "source": [
    "# TODO: ADD PRODUCTIVE AND CDR3 "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Writing model parms in file  ./igor_evaluating_soglflzp/dataIGoRCnq4BQJnS8_mdldata/models/model_parms.txt\n",
      "Writing model marginals in file  ./igor_evaluating_soglflzp/dataIGoRCnq4BQJnS8_mdldata/models/model_marginals.txt\n",
      "/home/olivares/.local/bin/igor -set_wd ./igor_evaluating_soglflzp -batch dataIGoRCnq4BQJnS8 -read_seqs ./igor_evaluating_soglflzp/dataIGoRCnq4BQJnS8input_sequences.csv\n",
      "/home/olivares/.local/bin/igor -set_wd ./igor_evaluating_soglflzp -batch dataIGoRCnq4BQJnS8 -set_genomic  --V ./igor_evaluating_soglflzp/dataIGoRCnq4BQJnS8_mdldata/ref_genome/genomicVs.fasta --D ./igor_evaluating_soglflzp/dataIGoRCnq4BQJnS8_mdldata/ref_genome/genomicDs.fasta --J ./igor_evaluating_soglflzp/dataIGoRCnq4BQJnS8_mdldata/ref_genome/genomicJs.fasta -set_CDR3_anchors  --V ./igor_evaluating_soglflzp/dataIGoRCnq4BQJnS8_mdldata/ref_genome/V_gene_CDR3_anchors.csv --J ./igor_evaluating_soglflzp/dataIGoRCnq4BQJnS8_mdldata/ref_genome/J_gene_CDR3_anchors.csv -align  --all  \n",
      "/home/olivares/.local/bin/igor -set_wd ./igor_evaluating_soglflzp -batch dataIGoRCnq4BQJnS8 -set_custom_model ./igor_evaluating_soglflzp/dataIGoRCnq4BQJnS8_mdldata/models/model_parms.txt ./igor_evaluating_soglflzp/dataIGoRCnq4BQJnS8_mdldata/models/model_marginals.txt -evaluate  -output  --scenarios 1  --Pgen  \n",
      "./igor_evaluating_soglflzp/aligns/dataIGoRCnq4BQJnS8_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_soglflzp/dataIGoRCnq4BQJnS8_mdldata/ref_genome/genomicVs.fasta\n",
      "J ./igor_evaluating_soglflzp/dataIGoRCnq4BQJnS8_mdldata/ref_genome/genomicJs.fasta\n",
      "D ./igor_evaluating_soglflzp/dataIGoRCnq4BQJnS8_mdldata/ref_genome/genomicDs.fasta\n",
      "loading Anchors data ...\n",
      "Loading Gene Anchors from  ./igor_evaluating_soglflzp/dataIGoRCnq4BQJnS8_mdldata/ref_genome/V_gene_CDR3_anchors.csv\n",
      "Loading Gene Anchors from  ./igor_evaluating_soglflzp/dataIGoRCnq4BQJnS8_mdldata/ref_genome/J_gene_CDR3_anchors.csv\n",
      "./igor_evaluating_soglflzp/aligns/dataIGoRCnq4BQJnS8_V_alignments.csv\n",
      "['']\n",
      "['']\n",
      "['']\n",
      "Alignments loaded in database in ./igor_evaluating_soglflzp/dataIGoRCnq4BQJnS8.db\n",
      "Parms filename:  ./igor_evaluating_soglflzp/dataIGoRCnq4BQJnS8_mdldata/models/model_parms.txt\n",
      "Marginals filename:  ./igor_evaluating_soglflzp/dataIGoRCnq4BQJnS8_mdldata/models/model_marginals.txt\n",
      "Model loaded\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_soglflzp/dataIGoRCnq4BQJnS8_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_soglflzp/dataIGoRCnq4BQJnS8_output/Pgen_counts.csv\n",
      "./igor_evaluating_soglflzp/dataIGoRCnq4BQJnS8_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"
     ]
    }
   ],
   "source": [
    "one_seq_airr = igor.evaluate(one_sequence, hb_mdl , N_scenarios=1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "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>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>ATTGCTGGGATCACCCAGGCACCAACATCTCAGATCCTGGCAGCAG...</td>\n",
       "      <td>F</td>\n",
       "      <td>NaN</td>\n",
       "      <td>X61653|TRBV6-4*01|Homo sapiens|F|V-REGION|426....</td>\n",
       "      <td>TRBD2*01</td>\n",
       "      <td>X02987|TRBJ2-1*01|Homo sapiens|F|J-REGION|800....</td>\n",
       "      <td>ATTGCTGGGATCACCCAGGCACCAACATCTCAGATCCTGGCAGCAG...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>TGTGCCAGCAGTGACCTTTCCCGGGGAAAGCTCCTACAATGAGCAG...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>285M</td>\n",
       "      <td>5M</td>\n",
       "      <td>50M</td>\n",
       "      <td>1425</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2</td>\n",
       "      <td>285</td>\n",
       "      <td>1</td>\n",
       "      <td>283</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>25</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>290</td>\n",
       "      <td>293</td>\n",
       "      <td>10</td>\n",
       "      <td>14</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>250</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>6</td>\n",
       "      <td>54</td>\n",
       "      <td>2</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>CTTTCC</td>\n",
       "      <td>NaN</td>\n",
       "      <td>6</td>\n",
       "      <td>2</td>\n",
       "      <td>AA</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>0.291515</td>\n",
       "      <td>7.937280e-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  ATTGCTGGGATCACCCAGGCACCAACATCTCAGATCCTGGCAGCAG...        F   \n",
       "\n",
       "   productive                                             v_call     d_call  \\\n",
       "0         NaN  X61653|TRBV6-4*01|Homo sapiens|F|V-REGION|426....   TRBD2*01   \n",
       "\n",
       "                                              j_call  \\\n",
       "0  X02987|TRBJ2-1*01|Homo sapiens|F|J-REGION|800....   \n",
       "\n",
       "                                  sequence_alignment  germline_alignment  \\\n",
       "0  ATTGCTGGGATCACCCAGGCACCAACATCTCAGATCCTGGCAGCAG...                 NaN   \n",
       "\n",
       "                                            junction  junction_aa v_cigar  \\\n",
       "0  TGTGCCAGCAGTGACCTTTCCCGGGGAAAGCTCCTACAATGAGCAG...          NaN    285M   \n",
       "\n",
       "  d_cigar j_cigar  v_score  v_identity  v_support  v_sequence_start  \\\n",
       "0      5M     50M     1425         NaN        NaN                 2   \n",
       "\n",
       "   v_sequence_end  v_germline_start  v_germline_end  v_alignment_start  \\\n",
       "0             285                 1             283                NaN   \n",
       "\n",
       "   v_alignment_end  d_score  d_identity  d_support  d_sequence_start  \\\n",
       "0              NaN       25         NaN        NaN               290   \n",
       "\n",
       "   d_sequence_end  d_germline_start  d_germline_end  d_alignment_start  \\\n",
       "0             293                10              14                NaN   \n",
       "\n",
       "   d_alignment_end  j_score  j_identity  j_support  j_sequence_start  \\\n",
       "0              NaN      250         NaN        NaN                 6   \n",
       "\n",
       "   j_sequence_end  j_germline_start  j_germline_end  j_alignment_start  \\\n",
       "0              54                 2              51                NaN   \n",
       "\n",
       "   j_alignment_end  sequence_aa  vj_in_frame  stop_codon  complete_vdj  locus  \\\n",
       "0              NaN          NaN          NaN         NaN           NaN    NaN   \n",
       "\n",
       "   sequence_alignment_aa  n1_length     np1  np1_aa  np1_length  n2_length  \\\n",
       "0                    NaN          6  CTTTCC     NaN           6          2   \n",
       "\n",
       "  np2  np2_aa  np2_length  p3v_length  p5d_length  p3d_length  p5j_length  \\\n",
       "0  AA     NaN           2           0           0           0           2   \n",
       "\n",
       "   scenario_rank  scenario_proba_cond_seq          pgen  quality  \\\n",
       "0              1                 0.291515  7.937280e-13      NaN   \n",
       "\n",
       "   quality_alignment  \n",
       "0                NaN  "
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "one_seq_airr"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'ATTGCTGGGATCACCCAGGCACCAACATCTCAGATCCTGGCAGCAGGACGGCGCATGACACTGAGATGTACCCAGGATATGAGACATAATGCCATGTACTGGTATAGACAAGATCTAGGACTGGGGCTAAGGCTCATCCATTATTCAAATACTGCAGGTACCACTGGCAAAGGAGAAGTCCCTGATGGTTATAGTGTCTCCAGAGCAAACACAGATGATTTCCTCCTCACGTTGGCGTCTGCTGTACCCTCTCAGACATCTGTGTACTTCTGTGCCAGCAGTGACCTTTCCCGGGGAAAGCTCCTACAATGAGCAGTTCTTCGGGCCAGGGACACGGCTCACCGTGCTAG'"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sequences.loc[0]['nt_sequence']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "one_pgen = igor.evaluate_pgen(one_sequence, mdl_new)\n",
    "one_pgen"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "range(0, 10)"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "range(10)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0\n",
      "1\n",
      "2\n",
      "3\n",
      "4\n",
      "5\n",
      "6\n",
      "7\n",
      "8\n",
      "9\n"
     ]
    }
   ],
   "source": [
    "for item in aa:\n",
    "    print(item)"
   ]
  },
  {
   "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": []
  },
  {
   "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": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pygor3 as igor\n",
    "task = igor.IgorTask()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 70,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'--all': {'active': True, 'value': '', 'dict_options': {'---thresh': {'active': False, 'value': '15', 'dict_options': {}}, '---matrix': {'active': False, 'value': 'path/to/file', 'dict_options': {}}, '---gap_penalty': {'active': False, 'value': 'X', 'dict_options': {}}, '---best_align_only': {'active': False, 'value': '', 'dict_options': {}}}}, '--V': {'active': False, 'value': '', 'dict_options': {'---thresh': {'active': False, 'value': '50', 'dict_options': {}}, '---matrix': {'active': False, 'value': 'path/to/file', 'dict_options': {}}, '---gap_penalty': {'active': False, 'value': 'X', 'dict_options': {}}, '---best_align_only': {'active': False, 'value': '', 'dict_options': {}}}}, '--D': {'active': False, 'value': '', 'dict_options': {'---thresh': {'active': False, 'value': '15', 'dict_options': {}}, '---matrix': {'active': False, 'value': 'path/to/file', 'dict_options': {}}, '---gap_penalty': {'active': False, 'value': 'X', 'dict_options': {}}, '---best_align_only': {'active': False, 'value': '', 'dict_options': {}}}}, '--J': {'active': False, 'value': '', 'dict_options': {'---thresh': {'active': False, 'value': '15', 'dict_options': {}}, '---matrix': {'active': False, 'value': 'path/to/file', 'dict_options': {}}, '---gap_penalty': {'active': False, 'value': 'X', 'dict_options': {}}, '---best_align_only': {'active': False, 'value': '', 'dict_options': {}}}}}\n"
     ]
    }
   ],
   "source": [
    "print(task.igor_align_dict_options)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "task.igor_evaluate_dict_options['--N_iter']['value'] = 8\n",
    "task.igor_evaluate_dict_options"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "task.igor_output_dict_options"
   ]
  },
  {
   "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
}
