{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "\n",
      "Attaching package: ‘dplyr’\n",
      "\n",
      "\n",
      "The following objects are masked from ‘package:stats’:\n",
      "\n",
      "    filter, lag\n",
      "\n",
      "\n",
      "The following objects are masked from ‘package:base’:\n",
      "\n",
      "    intersect, setdiff, setequal, union\n",
      "\n",
      "\n"
     ]
    }
   ],
   "source": [
    "# set up the model\n",
    "setwd('/lustre/scratch117/cellgen/team297/kt16/newcastle_covid')\n",
    "library(dplyr)\n",
    "\n",
    "bcell.df <- read.csv(\"h5ad/covid_jan_2021_bcells_obs.csv\")\n",
    "clinical_info = read.csv('other_analyses/final_metadata_feb21.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "covid.meta <- bcell.df[,c('sample_id', 'patient_id', 'Status_on_day_collection_summary_v2', 'Age', 'Sex', 'Collection_Day')] %>% distinct()\n",
    "rownames(covid.meta) <- covid.meta$sample_id\n",
    "covid.meta$Age = clinical_info$Age[match(covid.meta$patient_id, clinical_info$patient_id)]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "bcell.meta <- covid.meta[!covid.meta$Status_on_day_collection_summary_v2 %in% c(\"Non_covid\", \"LPS\", 'Healthy'),]\n",
    "bcell.meta$OrderedSeverity <- ordered(bcell.meta$Status_on_day_collection_summary_v2, levels=c(\"Asymptomatic\", \"Mild\", \"Moderate\", \"Severe\", \"Critical\"))\n",
    "\n",
    "bcell.model <- model.matrix(~ Sex + Age + OrderedSeverity, data=bcell.meta[bcell.meta$Collection_Day %in% c(\"D0\"), ])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "# count cells\n",
    "cell.freq.tab <- t(table(bcell.df$sample_id[bcell.df$Collection_Day %in% c(\"D0\") &\n",
    "                                                        !bcell.df$Status_on_day_collection_summary_v2 %in% c(\"LPS\", \"Non_covid\", 'Healthy')],\n",
    "                         bcell.df$celltype_B[bcell.df$Collection_Day %in% c(\"D0\") &\n",
    "                                                        !bcell.df$Status_on_day_collection_summary_v2 %in% c(\"LPS\", \"Non_covid\", 'Healthy')]))\n",
    "cell.freq.tab <- cell.freq.tab[,colSums(cell.freq.tab) != 0]\n",
    "bcell.model <- bcell.model[colnames(cell.freq.tab), ]\n",
    "n.cell.vecc <- table(bcell.df$sample_id)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Loading required package: limma\n",
      "\n"
     ]
    }
   ],
   "source": [
    "library(edgeR)\n",
    "bcell.dge <- DGEList(cell.freq.tab, lib.size=log(n.cell.vecc[colnames(cell.freq.tab)]))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "#estimate dispersions and fit model\n",
    "bcell.dge <- estimateDisp(bcell.dge, design=bcell.model)\n",
    "bcell.linear.fit <- glmQLFit(bcell.dge, bcell.model, robust=TRUE)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<table>\n",
       "<caption>A data.frame: 9 × 8</caption>\n",
       "<thead>\n",
       "\t<tr><th></th><th scope=col>logFC</th><th scope=col>logCPM</th><th scope=col>F</th><th scope=col>PValue</th><th scope=col>FDR</th><th scope=col>CellType</th><th scope=col>Sig</th><th scope=col>Diff</th></tr>\n",
       "\t<tr><th></th><th scope=col>&lt;dbl&gt;</th><th scope=col>&lt;dbl&gt;</th><th scope=col>&lt;dbl&gt;</th><th scope=col>&lt;dbl&gt;</th><th scope=col>&lt;dbl&gt;</th><th scope=col>&lt;chr&gt;</th><th scope=col>&lt;dbl&gt;</th><th scope=col>&lt;dbl&gt;</th></tr>\n",
       "</thead>\n",
       "<tbody>\n",
       "\t<tr><th scope=row>B_exhausted</th><td> 0.22131785</td><td>15.45372</td><td> 0.48290881</td><td>0.488932038</td><td>0.714852856</td><td>B_exhausted          </td><td>0</td><td>0</td></tr>\n",
       "\t<tr><th scope=row>B_immature</th><td>-0.11593271</td><td>16.09162</td><td> 0.20070521</td><td>0.655249345</td><td>0.737155514</td><td>B_immature           </td><td>0</td><td>0</td></tr>\n",
       "\t<tr><th scope=row>B_naive</th><td>-0.08529095</td><td>19.18145</td><td> 0.72738516</td><td>0.396039264</td><td>0.712870675</td><td>B_naive              </td><td>0</td><td>0</td></tr>\n",
       "\t<tr><th scope=row>B_non-switched_memory</th><td>-0.05386057</td><td>15.53769</td><td> 0.05029615</td><td>0.851077066</td><td>0.851077066</td><td>B_non-switched_memory</td><td>0</td><td>0</td></tr>\n",
       "\t<tr><th scope=row>B_switched_memory</th><td>-0.20204907</td><td>16.56326</td><td> 0.90466635</td><td>0.344129434</td><td>0.712870675</td><td>B_switched_memory    </td><td>0</td><td>0</td></tr>\n",
       "\t<tr><th scope=row>Plasma_cell_IgA</th><td> 0.20072384</td><td>15.45036</td><td> 0.34934011</td><td>0.555996665</td><td>0.714852856</td><td>Plasma_cell_IgA      </td><td>0</td><td>0</td></tr>\n",
       "\t<tr><th scope=row>Plasma_cell_IgG</th><td> 0.65730324</td><td>15.62127</td><td> 3.22947933</td><td>0.075742078</td><td>0.227226234</td><td>Plasma_cell_IgG      </td><td>0</td><td>0</td></tr>\n",
       "\t<tr><th scope=row>Plasma_cell_IgM</th><td> 1.28896504</td><td>14.22155</td><td>11.38713040</td><td>0.001100284</td><td>0.009902554</td><td>Plasma_cell_IgM      </td><td>1</td><td>1</td></tr>\n",
       "\t<tr><th scope=row>Plasmablast</th><td> 1.13575466</td><td>15.67385</td><td> 6.24262114</td><td>0.014322106</td><td>0.064449477</td><td>Plasmablast          </td><td>1</td><td>1</td></tr>\n",
       "</tbody>\n",
       "</table>\n"
      ],
      "text/latex": [
       "A data.frame: 9 × 8\n",
       "\\begin{tabular}{r|llllllll}\n",
       "  & logFC & logCPM & F & PValue & FDR & CellType & Sig & Diff\\\\\n",
       "  & <dbl> & <dbl> & <dbl> & <dbl> & <dbl> & <chr> & <dbl> & <dbl>\\\\\n",
       "\\hline\n",
       "\tB\\_exhausted &  0.22131785 & 15.45372 &  0.48290881 & 0.488932038 & 0.714852856 & B\\_exhausted           & 0 & 0\\\\\n",
       "\tB\\_immature & -0.11593271 & 16.09162 &  0.20070521 & 0.655249345 & 0.737155514 & B\\_immature            & 0 & 0\\\\\n",
       "\tB\\_naive & -0.08529095 & 19.18145 &  0.72738516 & 0.396039264 & 0.712870675 & B\\_naive               & 0 & 0\\\\\n",
       "\tB\\_non-switched\\_memory & -0.05386057 & 15.53769 &  0.05029615 & 0.851077066 & 0.851077066 & B\\_non-switched\\_memory & 0 & 0\\\\\n",
       "\tB\\_switched\\_memory & -0.20204907 & 16.56326 &  0.90466635 & 0.344129434 & 0.712870675 & B\\_switched\\_memory     & 0 & 0\\\\\n",
       "\tPlasma\\_cell\\_IgA &  0.20072384 & 15.45036 &  0.34934011 & 0.555996665 & 0.714852856 & Plasma\\_cell\\_IgA       & 0 & 0\\\\\n",
       "\tPlasma\\_cell\\_IgG &  0.65730324 & 15.62127 &  3.22947933 & 0.075742078 & 0.227226234 & Plasma\\_cell\\_IgG       & 0 & 0\\\\\n",
       "\tPlasma\\_cell\\_IgM &  1.28896504 & 14.22155 & 11.38713040 & 0.001100284 & 0.009902554 & Plasma\\_cell\\_IgM       & 1 & 1\\\\\n",
       "\tPlasmablast &  1.13575466 & 15.67385 &  6.24262114 & 0.014322106 & 0.064449477 & Plasmablast           & 1 & 1\\\\\n",
       "\\end{tabular}\n"
      ],
      "text/markdown": [
       "\n",
       "A data.frame: 9 × 8\n",
       "\n",
       "| <!--/--> | logFC &lt;dbl&gt; | logCPM &lt;dbl&gt; | F &lt;dbl&gt; | PValue &lt;dbl&gt; | FDR &lt;dbl&gt; | CellType &lt;chr&gt; | Sig &lt;dbl&gt; | Diff &lt;dbl&gt; |\n",
       "|---|---|---|---|---|---|---|---|---|\n",
       "| B_exhausted |  0.22131785 | 15.45372 |  0.48290881 | 0.488932038 | 0.714852856 | B_exhausted           | 0 | 0 |\n",
       "| B_immature | -0.11593271 | 16.09162 |  0.20070521 | 0.655249345 | 0.737155514 | B_immature            | 0 | 0 |\n",
       "| B_naive | -0.08529095 | 19.18145 |  0.72738516 | 0.396039264 | 0.712870675 | B_naive               | 0 | 0 |\n",
       "| B_non-switched_memory | -0.05386057 | 15.53769 |  0.05029615 | 0.851077066 | 0.851077066 | B_non-switched_memory | 0 | 0 |\n",
       "| B_switched_memory | -0.20204907 | 16.56326 |  0.90466635 | 0.344129434 | 0.712870675 | B_switched_memory     | 0 | 0 |\n",
       "| Plasma_cell_IgA |  0.20072384 | 15.45036 |  0.34934011 | 0.555996665 | 0.714852856 | Plasma_cell_IgA       | 0 | 0 |\n",
       "| Plasma_cell_IgG |  0.65730324 | 15.62127 |  3.22947933 | 0.075742078 | 0.227226234 | Plasma_cell_IgG       | 0 | 0 |\n",
       "| Plasma_cell_IgM |  1.28896504 | 14.22155 | 11.38713040 | 0.001100284 | 0.009902554 | Plasma_cell_IgM       | 1 | 1 |\n",
       "| Plasmablast |  1.13575466 | 15.67385 |  6.24262114 | 0.014322106 | 0.064449477 | Plasmablast           | 1 | 1 |\n",
       "\n"
      ],
      "text/plain": [
       "                      logFC       logCPM   F           PValue      FDR        \n",
       "B_exhausted            0.22131785 15.45372  0.48290881 0.488932038 0.714852856\n",
       "B_immature            -0.11593271 16.09162  0.20070521 0.655249345 0.737155514\n",
       "B_naive               -0.08529095 19.18145  0.72738516 0.396039264 0.712870675\n",
       "B_non-switched_memory -0.05386057 15.53769  0.05029615 0.851077066 0.851077066\n",
       "B_switched_memory     -0.20204907 16.56326  0.90466635 0.344129434 0.712870675\n",
       "Plasma_cell_IgA        0.20072384 15.45036  0.34934011 0.555996665 0.714852856\n",
       "Plasma_cell_IgG        0.65730324 15.62127  3.22947933 0.075742078 0.227226234\n",
       "Plasma_cell_IgM        1.28896504 14.22155 11.38713040 0.001100284 0.009902554\n",
       "Plasmablast            1.13575466 15.67385  6.24262114 0.014322106 0.064449477\n",
       "                      CellType              Sig Diff\n",
       "B_exhausted           B_exhausted           0   0   \n",
       "B_immature            B_immature            0   0   \n",
       "B_naive               B_naive               0   0   \n",
       "B_non-switched_memory B_non-switched_memory 0   0   \n",
       "B_switched_memory     B_switched_memory     0   0   \n",
       "Plasma_cell_IgA       Plasma_cell_IgA       0   0   \n",
       "Plasma_cell_IgG       Plasma_cell_IgG       0   0   \n",
       "Plasma_cell_IgM       Plasma_cell_IgM       1   1   \n",
       "Plasmablast           Plasmablast           1   1   "
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# linear changes\n",
    "bcell.res <- as.data.frame(topTags(glmQLFTest(bcell.linear.fit, coef=4), sort.by='none', n=Inf))\n",
    "bcell.res$CellType <- rownames(bcell.res)\n",
    "bcell.res$Sig <- as.numeric(bcell.res$FDR < 0.1 & bcell.res$PValue < 0.05)\n",
    "bcell.res$Diff <- sign(bcell.res$logFC)\n",
    "bcell.res$Diff[bcell.res$FDR >= 0.1 | bcell.res$PValue >= 0.05] <- 0\n",
    "bcell.res"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<table>\n",
       "<caption>A data.frame: 9 × 8</caption>\n",
       "<thead>\n",
       "\t<tr><th></th><th scope=col>logFC</th><th scope=col>logCPM</th><th scope=col>F</th><th scope=col>PValue</th><th scope=col>FDR</th><th scope=col>CellType</th><th scope=col>Sig</th><th scope=col>Diff</th></tr>\n",
       "\t<tr><th></th><th scope=col>&lt;dbl&gt;</th><th scope=col>&lt;dbl&gt;</th><th scope=col>&lt;dbl&gt;</th><th scope=col>&lt;dbl&gt;</th><th scope=col>&lt;dbl&gt;</th><th scope=col>&lt;chr&gt;</th><th scope=col>&lt;dbl&gt;</th><th scope=col>&lt;dbl&gt;</th></tr>\n",
       "</thead>\n",
       "<tbody>\n",
       "\t<tr><th scope=row>B_exhausted</th><td>-0.03071614</td><td>15.45372</td><td> 0.01148359</td><td>9.149039e-01</td><td>9.149039e-01</td><td>B_exhausted          </td><td>0</td><td> 0</td></tr>\n",
       "\t<tr><th scope=row>B_immature</th><td> 0.25124007</td><td>16.09162</td><td> 1.21253545</td><td>2.738228e-01</td><td>4.107342e-01</td><td>B_immature           </td><td>0</td><td> 0</td></tr>\n",
       "\t<tr><th scope=row>B_naive</th><td> 0.14133277</td><td>19.18145</td><td> 2.53577183</td><td>1.148657e-01</td><td>2.584478e-01</td><td>B_naive              </td><td>0</td><td> 0</td></tr>\n",
       "\t<tr><th scope=row>B_non-switched_memory</th><td> 0.03428311</td><td>15.53769</td><td> 0.02586696</td><td>8.725930e-01</td><td>9.149039e-01</td><td>B_non-switched_memory</td><td>0</td><td> 0</td></tr>\n",
       "\t<tr><th scope=row>B_switched_memory</th><td> 0.10268311</td><td>16.56326</td><td> 0.29037912</td><td>5.913335e-01</td><td>7.602859e-01</td><td>B_switched_memory    </td><td>0</td><td> 0</td></tr>\n",
       "\t<tr><th scope=row>Plasma_cell_IgA</th><td>-0.40145452</td><td>15.45036</td><td> 1.66887306</td><td>1.997801e-01</td><td>3.596042e-01</td><td>Plasma_cell_IgA      </td><td>0</td><td> 0</td></tr>\n",
       "\t<tr><th scope=row>Plasma_cell_IgG</th><td>-0.97788472</td><td>15.62127</td><td> 8.47653017</td><td>4.553699e-03</td><td>2.049165e-02</td><td>Plasma_cell_IgG      </td><td>1</td><td>-1</td></tr>\n",
       "\t<tr><th scope=row>Plasma_cell_IgM</th><td>-1.61677950</td><td>14.22155</td><td>22.93464450</td><td>6.703430e-06</td><td>6.033087e-05</td><td>Plasma_cell_IgM      </td><td>1</td><td>-1</td></tr>\n",
       "\t<tr><th scope=row>Plasmablast</th><td>-1.08776530</td><td>15.67385</td><td> 6.87280962</td><td>1.030522e-02</td><td>3.091567e-02</td><td>Plasmablast          </td><td>1</td><td>-1</td></tr>\n",
       "</tbody>\n",
       "</table>\n"
      ],
      "text/latex": [
       "A data.frame: 9 × 8\n",
       "\\begin{tabular}{r|llllllll}\n",
       "  & logFC & logCPM & F & PValue & FDR & CellType & Sig & Diff\\\\\n",
       "  & <dbl> & <dbl> & <dbl> & <dbl> & <dbl> & <chr> & <dbl> & <dbl>\\\\\n",
       "\\hline\n",
       "\tB\\_exhausted & -0.03071614 & 15.45372 &  0.01148359 & 9.149039e-01 & 9.149039e-01 & B\\_exhausted           & 0 &  0\\\\\n",
       "\tB\\_immature &  0.25124007 & 16.09162 &  1.21253545 & 2.738228e-01 & 4.107342e-01 & B\\_immature            & 0 &  0\\\\\n",
       "\tB\\_naive &  0.14133277 & 19.18145 &  2.53577183 & 1.148657e-01 & 2.584478e-01 & B\\_naive               & 0 &  0\\\\\n",
       "\tB\\_non-switched\\_memory &  0.03428311 & 15.53769 &  0.02586696 & 8.725930e-01 & 9.149039e-01 & B\\_non-switched\\_memory & 0 &  0\\\\\n",
       "\tB\\_switched\\_memory &  0.10268311 & 16.56326 &  0.29037912 & 5.913335e-01 & 7.602859e-01 & B\\_switched\\_memory     & 0 &  0\\\\\n",
       "\tPlasma\\_cell\\_IgA & -0.40145452 & 15.45036 &  1.66887306 & 1.997801e-01 & 3.596042e-01 & Plasma\\_cell\\_IgA       & 0 &  0\\\\\n",
       "\tPlasma\\_cell\\_IgG & -0.97788472 & 15.62127 &  8.47653017 & 4.553699e-03 & 2.049165e-02 & Plasma\\_cell\\_IgG       & 1 & -1\\\\\n",
       "\tPlasma\\_cell\\_IgM & -1.61677950 & 14.22155 & 22.93464450 & 6.703430e-06 & 6.033087e-05 & Plasma\\_cell\\_IgM       & 1 & -1\\\\\n",
       "\tPlasmablast & -1.08776530 & 15.67385 &  6.87280962 & 1.030522e-02 & 3.091567e-02 & Plasmablast           & 1 & -1\\\\\n",
       "\\end{tabular}\n"
      ],
      "text/markdown": [
       "\n",
       "A data.frame: 9 × 8\n",
       "\n",
       "| <!--/--> | logFC &lt;dbl&gt; | logCPM &lt;dbl&gt; | F &lt;dbl&gt; | PValue &lt;dbl&gt; | FDR &lt;dbl&gt; | CellType &lt;chr&gt; | Sig &lt;dbl&gt; | Diff &lt;dbl&gt; |\n",
       "|---|---|---|---|---|---|---|---|---|\n",
       "| B_exhausted | -0.03071614 | 15.45372 |  0.01148359 | 9.149039e-01 | 9.149039e-01 | B_exhausted           | 0 |  0 |\n",
       "| B_immature |  0.25124007 | 16.09162 |  1.21253545 | 2.738228e-01 | 4.107342e-01 | B_immature            | 0 |  0 |\n",
       "| B_naive |  0.14133277 | 19.18145 |  2.53577183 | 1.148657e-01 | 2.584478e-01 | B_naive               | 0 |  0 |\n",
       "| B_non-switched_memory |  0.03428311 | 15.53769 |  0.02586696 | 8.725930e-01 | 9.149039e-01 | B_non-switched_memory | 0 |  0 |\n",
       "| B_switched_memory |  0.10268311 | 16.56326 |  0.29037912 | 5.913335e-01 | 7.602859e-01 | B_switched_memory     | 0 |  0 |\n",
       "| Plasma_cell_IgA | -0.40145452 | 15.45036 |  1.66887306 | 1.997801e-01 | 3.596042e-01 | Plasma_cell_IgA       | 0 |  0 |\n",
       "| Plasma_cell_IgG | -0.97788472 | 15.62127 |  8.47653017 | 4.553699e-03 | 2.049165e-02 | Plasma_cell_IgG       | 1 | -1 |\n",
       "| Plasma_cell_IgM | -1.61677950 | 14.22155 | 22.93464450 | 6.703430e-06 | 6.033087e-05 | Plasma_cell_IgM       | 1 | -1 |\n",
       "| Plasmablast | -1.08776530 | 15.67385 |  6.87280962 | 1.030522e-02 | 3.091567e-02 | Plasmablast           | 1 | -1 |\n",
       "\n"
      ],
      "text/plain": [
       "                      logFC       logCPM   F           PValue      \n",
       "B_exhausted           -0.03071614 15.45372  0.01148359 9.149039e-01\n",
       "B_immature             0.25124007 16.09162  1.21253545 2.738228e-01\n",
       "B_naive                0.14133277 19.18145  2.53577183 1.148657e-01\n",
       "B_non-switched_memory  0.03428311 15.53769  0.02586696 8.725930e-01\n",
       "B_switched_memory      0.10268311 16.56326  0.29037912 5.913335e-01\n",
       "Plasma_cell_IgA       -0.40145452 15.45036  1.66887306 1.997801e-01\n",
       "Plasma_cell_IgG       -0.97788472 15.62127  8.47653017 4.553699e-03\n",
       "Plasma_cell_IgM       -1.61677950 14.22155 22.93464450 6.703430e-06\n",
       "Plasmablast           -1.08776530 15.67385  6.87280962 1.030522e-02\n",
       "                      FDR          CellType              Sig Diff\n",
       "B_exhausted           9.149039e-01 B_exhausted           0    0  \n",
       "B_immature            4.107342e-01 B_immature            0    0  \n",
       "B_naive               2.584478e-01 B_naive               0    0  \n",
       "B_non-switched_memory 9.149039e-01 B_non-switched_memory 0    0  \n",
       "B_switched_memory     7.602859e-01 B_switched_memory     0    0  \n",
       "Plasma_cell_IgA       3.596042e-01 Plasma_cell_IgA       0    0  \n",
       "Plasma_cell_IgG       2.049165e-02 Plasma_cell_IgG       1   -1  \n",
       "Plasma_cell_IgM       6.033087e-05 Plasma_cell_IgM       1   -1  \n",
       "Plasmablast           3.091567e-02 Plasmablast           1   -1  "
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Quadratic changes.\n",
    "bcell.quad.res <- as.data.frame(topTags(glmQLFTest(bcell.linear.fit, coef=5), sort.by='none', n=Inf))\n",
    "bcell.quad.res$CellType <- rownames(bcell.quad.res)\n",
    "bcell.quad.res$Sig <- as.numeric(bcell.quad.res$FDR < 0.1 & bcell.quad.res$PValue < 0.05)\n",
    "bcell.quad.res$Diff <- sign(bcell.quad.res$logFC)\n",
    "bcell.quad.res$Diff[bcell.quad.res$FDR >= 0.1 | bcell.quad.res$PValue >= 0.05] <- 0\n",
    "bcell.quad.res"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "R",
   "language": "R",
   "name": "ir"
  },
  "language_info": {
   "codemirror_mode": "r",
   "file_extension": ".r",
   "mimetype": "text/x-r-source",
   "name": "R",
   "pygments_lexer": "r",
   "version": "3.6.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
