{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Interoperability with `scirpy`\n",
    "![dandelion_logo](img/dandelion_logo_illustration.png)\n",
    "\n",
    "It is now possible to convert the file formats between `dandelion>=0.1.0` and `scirpy>=0.6.2.dev104` to enhance the collaboration between the analysis toolkits.\n",
    "\n",
    "We will download the *airr_rearrangement.tsv* file from here:\n",
    "```bash\n",
    "# bash\n",
    "wget https://cf.10xgenomics.com/samples/cell-vdj/4.0.0/sc5p_v2_hs_PBMC_10k/sc5p_v2_hs_PBMC_10k_b_airr_rearrangement.tsv\n",
    "```\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**Import *dandelion* module**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "dandelion==0.1.0 pandas==1.2.3 numpy==1.20.1 matplotlib==3.3.4 networkx==2.5 scipy==1.6.1 skbio==0.5.6\n"
     ]
    }
   ],
   "source": [
    "import os\n",
    "import dandelion as ddl\n",
    "# change directory to somewhere more workable\n",
    "os.chdir(os.path.expanduser('/Users/kt16/Documents/scripts/data/dandelion_tutorial/'))\n",
    "ddl.logging.print_versions()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'0.6.2.dev105'"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import scirpy as ir\n",
    "ir.__version__"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# `dandelion`"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Dandelion class object with n_obs = 978 and n_contigs = 2093\n",
       "    data: 'cell_id', 'clone_id', 'sequence_id', 'sequence', 'sequence_aa', 'productive', 'rev_comp', 'v_call', 'v_cigar', 'd_call', 'd_cigar', 'j_call', 'j_cigar', 'c_call', 'c_cigar', 'sequence_alignment', 'germline_alignment', 'junction', 'junction_aa', 'junction_length', 'junction_aa_length', 'v_sequence_start', 'v_sequence_end', 'd_sequence_start', 'd_sequence_end', 'j_sequence_start', 'j_sequence_end', 'c_sequence_start', 'c_sequence_end', 'consensus_count', 'duplicate_count', 'is_cell', 'locus'\n",
       "    metadata: 'locus_heavy', 'locus_light', 'productive_heavy', 'productive_light', 'v_call_heavy', 'v_call_light', 'j_call_heavy', 'j_call_light', 'c_call_heavy', 'c_call_light', 'duplicate_count_heavy_0', 'duplicate_count_heavy_1', 'duplicate_count_light_0', 'duplicate_count_light_1', 'junction_aa_heavy', 'junction_aa_light', 'status', 'status_summary', 'productive', 'productive_summary', 'isotype', 'isotype_summary', 'vdj_status', 'vdj_status_summary', 'heavychain_status_summary'\n",
       "    distance: None\n",
       "    edges: None\n",
       "    layout: None\n",
       "    graph: None"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# read in the airr_rearrangement.tsv file\n",
    "file_location = 'sc5p_v2_hs_PBMC_10k/sc5p_v2_hs_PBMC_10k_b_airr_rearrangement.tsv'\n",
    "vdj = ddl.read_10x_airr(file_location)\n",
    "vdj"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The test file contains a blank `clone_id` column so we run `find_clones` to populate it first."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Finding clones based on heavy chains : 100%|██████████| 157/157 [00:00<00:00, 960.80it/s]\n",
      "Refining clone assignment based on light chain pairing : 100%|██████████| 978/978 [00:00<00:00, 295983.07it/s]\n"
     ]
    }
   ],
   "source": [
    "ddl.tl.find_clones(vdj)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## `dandelion` : Converting `dandelion` to `scirpy`"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/kt16/miniconda3/envs/dandelion/lib/python3.7/site-packages/anndata/_core/anndata.py:1192: FutureWarning: is_categorical is deprecated and will be removed in a future version.  Use is_categorical_dtype instead\n",
      "... storing 'extra_chains' as categorical\n",
      "... storing 'IR_VJ_1_c_cigar' as categorical\n",
      "... storing 'IR_VJ_2_c_cigar' as categorical\n",
      "... storing 'IR_VDJ_1_c_cigar' as categorical\n",
      "... storing 'IR_VDJ_2_c_cigar' as categorical\n",
      "... storing 'IR_VJ_1_clone_id' as categorical\n",
      "... storing 'IR_VJ_2_clone_id' as categorical\n",
      "... storing 'IR_VDJ_1_clone_id' as categorical\n",
      "... storing 'IR_VDJ_2_clone_id' as categorical\n",
      "... storing 'IR_VJ_1_d_cigar' as categorical\n",
      "... storing 'IR_VJ_2_d_cigar' as categorical\n",
      "... storing 'IR_VDJ_1_d_cigar' as categorical\n",
      "... storing 'IR_VDJ_2_d_cigar' as categorical\n",
      "... storing 'IR_VJ_1_d_sequence_end' as categorical\n",
      "... storing 'IR_VJ_2_d_sequence_end' as categorical\n",
      "... storing 'IR_VJ_1_d_sequence_start' as categorical\n",
      "... storing 'IR_VJ_2_d_sequence_start' as categorical\n",
      "... storing 'IR_VJ_1_germline_alignment' as categorical\n",
      "... storing 'IR_VJ_2_germline_alignment' as categorical\n",
      "... storing 'IR_VDJ_1_germline_alignment' as categorical\n",
      "... storing 'IR_VDJ_2_germline_alignment' as categorical\n",
      "... storing 'IR_VJ_1_is_cell' as categorical\n",
      "... storing 'IR_VJ_2_is_cell' as categorical\n",
      "... storing 'IR_VDJ_1_is_cell' as categorical\n",
      "... storing 'IR_VDJ_2_is_cell' as categorical\n",
      "... storing 'IR_VJ_1_j_cigar' as categorical\n",
      "... storing 'IR_VJ_2_j_cigar' as categorical\n",
      "... storing 'IR_VDJ_1_j_cigar' as categorical\n",
      "... storing 'IR_VDJ_2_j_cigar' as categorical\n",
      "... storing 'IR_VJ_1_junction' as categorical\n",
      "... storing 'IR_VJ_2_junction' as categorical\n",
      "... storing 'IR_VDJ_1_junction' as categorical\n",
      "... storing 'IR_VDJ_2_junction' as categorical\n",
      "... storing 'IR_VJ_1_junction_aa' as categorical\n",
      "... storing 'IR_VJ_2_junction_aa' as categorical\n",
      "... storing 'IR_VDJ_1_junction_aa' as categorical\n",
      "... storing 'IR_VDJ_2_junction_aa' as categorical\n",
      "... storing 'IR_VJ_1_productive' as categorical\n",
      "... storing 'IR_VJ_2_productive' as categorical\n",
      "... storing 'IR_VDJ_1_productive' as categorical\n",
      "... storing 'IR_VDJ_2_productive' as categorical\n",
      "... storing 'IR_VJ_1_rev_comp' as categorical\n",
      "... storing 'IR_VJ_2_rev_comp' as categorical\n",
      "... storing 'IR_VDJ_1_rev_comp' as categorical\n",
      "... storing 'IR_VDJ_2_rev_comp' as categorical\n",
      "... storing 'IR_VJ_1_sequence' as categorical\n",
      "... storing 'IR_VJ_2_sequence' as categorical\n",
      "... storing 'IR_VDJ_1_sequence' as categorical\n",
      "... storing 'IR_VDJ_2_sequence' as categorical\n",
      "... storing 'IR_VJ_1_sequence_aa' as categorical\n",
      "... storing 'IR_VJ_2_sequence_aa' as categorical\n",
      "... storing 'IR_VDJ_1_sequence_aa' as categorical\n",
      "... storing 'IR_VDJ_2_sequence_aa' as categorical\n",
      "... storing 'IR_VJ_1_sequence_alignment' as categorical\n",
      "... storing 'IR_VJ_2_sequence_alignment' as categorical\n",
      "... storing 'IR_VDJ_1_sequence_alignment' as categorical\n",
      "... storing 'IR_VDJ_2_sequence_alignment' as categorical\n",
      "... storing 'IR_VJ_1_sequence_id' as categorical\n",
      "... storing 'IR_VJ_2_sequence_id' as categorical\n",
      "... storing 'IR_VDJ_1_sequence_id' as categorical\n",
      "... storing 'IR_VDJ_2_sequence_id' as categorical\n",
      "... storing 'IR_VJ_1_v_cigar' as categorical\n",
      "... storing 'IR_VJ_2_v_cigar' as categorical\n",
      "... storing 'IR_VDJ_1_v_cigar' as categorical\n",
      "... storing 'IR_VDJ_2_v_cigar' as categorical\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "AnnData object with n_obs × n_vars = 994 × 0\n",
       "    obs: 'multi_chain', 'extra_chains', 'IR_VJ_1_c_call', 'IR_VJ_2_c_call', 'IR_VDJ_1_c_call', 'IR_VDJ_2_c_call', 'IR_VJ_1_c_cigar', 'IR_VJ_2_c_cigar', 'IR_VDJ_1_c_cigar', 'IR_VDJ_2_c_cigar', 'IR_VJ_1_c_sequence_end', 'IR_VJ_2_c_sequence_end', 'IR_VDJ_1_c_sequence_end', 'IR_VDJ_2_c_sequence_end', 'IR_VJ_1_c_sequence_start', 'IR_VJ_2_c_sequence_start', 'IR_VDJ_1_c_sequence_start', 'IR_VDJ_2_c_sequence_start', 'IR_VJ_1_clone_id', 'IR_VJ_2_clone_id', 'IR_VDJ_1_clone_id', 'IR_VDJ_2_clone_id', 'IR_VJ_1_consensus_count', 'IR_VJ_2_consensus_count', 'IR_VDJ_1_consensus_count', 'IR_VDJ_2_consensus_count', 'IR_VJ_1_d_call', 'IR_VJ_2_d_call', 'IR_VDJ_1_d_call', 'IR_VDJ_2_d_call', 'IR_VJ_1_d_cigar', 'IR_VJ_2_d_cigar', 'IR_VDJ_1_d_cigar', 'IR_VDJ_2_d_cigar', 'IR_VJ_1_d_sequence_end', 'IR_VJ_2_d_sequence_end', 'IR_VDJ_1_d_sequence_end', 'IR_VDJ_2_d_sequence_end', 'IR_VJ_1_d_sequence_start', 'IR_VJ_2_d_sequence_start', 'IR_VDJ_1_d_sequence_start', 'IR_VDJ_2_d_sequence_start', 'IR_VJ_1_duplicate_count', 'IR_VJ_2_duplicate_count', 'IR_VDJ_1_duplicate_count', 'IR_VDJ_2_duplicate_count', 'IR_VJ_1_germline_alignment', 'IR_VJ_2_germline_alignment', 'IR_VDJ_1_germline_alignment', 'IR_VDJ_2_germline_alignment', 'IR_VJ_1_is_cell', 'IR_VJ_2_is_cell', 'IR_VDJ_1_is_cell', 'IR_VDJ_2_is_cell', 'IR_VJ_1_j_call', 'IR_VJ_2_j_call', 'IR_VDJ_1_j_call', 'IR_VDJ_2_j_call', 'IR_VJ_1_j_cigar', 'IR_VJ_2_j_cigar', 'IR_VDJ_1_j_cigar', 'IR_VDJ_2_j_cigar', 'IR_VJ_1_j_sequence_end', 'IR_VJ_2_j_sequence_end', 'IR_VDJ_1_j_sequence_end', 'IR_VDJ_2_j_sequence_end', 'IR_VJ_1_j_sequence_start', 'IR_VJ_2_j_sequence_start', 'IR_VDJ_1_j_sequence_start', 'IR_VDJ_2_j_sequence_start', 'IR_VJ_1_junction', 'IR_VJ_2_junction', 'IR_VDJ_1_junction', 'IR_VDJ_2_junction', 'IR_VJ_1_junction_aa', 'IR_VJ_2_junction_aa', 'IR_VDJ_1_junction_aa', 'IR_VDJ_2_junction_aa', 'IR_VJ_1_junction_aa_length', 'IR_VJ_2_junction_aa_length', 'IR_VDJ_1_junction_aa_length', 'IR_VDJ_2_junction_aa_length', 'IR_VJ_1_junction_length', 'IR_VJ_2_junction_length', 'IR_VDJ_1_junction_length', 'IR_VDJ_2_junction_length', 'IR_VJ_1_locus', 'IR_VJ_2_locus', 'IR_VDJ_1_locus', 'IR_VDJ_2_locus', 'IR_VJ_1_productive', 'IR_VJ_2_productive', 'IR_VDJ_1_productive', 'IR_VDJ_2_productive', 'IR_VJ_1_rev_comp', 'IR_VJ_2_rev_comp', 'IR_VDJ_1_rev_comp', 'IR_VDJ_2_rev_comp', 'IR_VJ_1_sequence', 'IR_VJ_2_sequence', 'IR_VDJ_1_sequence', 'IR_VDJ_2_sequence', 'IR_VJ_1_sequence_aa', 'IR_VJ_2_sequence_aa', 'IR_VDJ_1_sequence_aa', 'IR_VDJ_2_sequence_aa', 'IR_VJ_1_sequence_alignment', 'IR_VJ_2_sequence_alignment', 'IR_VDJ_1_sequence_alignment', 'IR_VDJ_2_sequence_alignment', 'IR_VJ_1_sequence_id', 'IR_VJ_2_sequence_id', 'IR_VDJ_1_sequence_id', 'IR_VDJ_2_sequence_id', 'IR_VJ_1_v_call', 'IR_VJ_2_v_call', 'IR_VDJ_1_v_call', 'IR_VDJ_2_v_call', 'IR_VJ_1_v_cigar', 'IR_VJ_2_v_cigar', 'IR_VDJ_1_v_cigar', 'IR_VDJ_2_v_cigar', 'IR_VJ_1_v_sequence_end', 'IR_VJ_2_v_sequence_end', 'IR_VDJ_1_v_sequence_end', 'IR_VDJ_2_v_sequence_end', 'IR_VJ_1_v_sequence_start', 'IR_VJ_2_v_sequence_start', 'IR_VDJ_1_v_sequence_start', 'IR_VDJ_2_v_sequence_start', 'has_ir'"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "irdata = ddl.to_scirpy(vdj)\n",
    "irdata"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The `clone_id` is mapped to `IR_VJ_1_clone_id` column."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "`transfer = True` will perform dandelion's `tl.transfer`."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "... storing 'extra_chains' as categorical\n",
      "... storing 'IR_VJ_1_c_cigar' as categorical\n",
      "... storing 'IR_VJ_2_c_cigar' as categorical\n",
      "... storing 'IR_VDJ_1_c_cigar' as categorical\n",
      "... storing 'IR_VDJ_2_c_cigar' as categorical\n",
      "... storing 'IR_VJ_1_clone_id' as categorical\n",
      "... storing 'IR_VJ_2_clone_id' as categorical\n",
      "... storing 'IR_VDJ_1_clone_id' as categorical\n",
      "... storing 'IR_VDJ_2_clone_id' as categorical\n",
      "... storing 'IR_VJ_1_d_cigar' as categorical\n",
      "... storing 'IR_VJ_2_d_cigar' as categorical\n",
      "... storing 'IR_VDJ_1_d_cigar' as categorical\n",
      "... storing 'IR_VDJ_2_d_cigar' as categorical\n",
      "... storing 'IR_VJ_1_d_sequence_end' as categorical\n",
      "... storing 'IR_VJ_2_d_sequence_end' as categorical\n",
      "... storing 'IR_VJ_1_d_sequence_start' as categorical\n",
      "... storing 'IR_VJ_2_d_sequence_start' as categorical\n",
      "... storing 'IR_VJ_1_germline_alignment' as categorical\n",
      "... storing 'IR_VJ_2_germline_alignment' as categorical\n",
      "... storing 'IR_VDJ_1_germline_alignment' as categorical\n",
      "... storing 'IR_VDJ_2_germline_alignment' as categorical\n",
      "... storing 'IR_VJ_1_is_cell' as categorical\n",
      "... storing 'IR_VJ_2_is_cell' as categorical\n",
      "... storing 'IR_VDJ_1_is_cell' as categorical\n",
      "... storing 'IR_VDJ_2_is_cell' as categorical\n",
      "... storing 'IR_VJ_1_j_cigar' as categorical\n",
      "... storing 'IR_VJ_2_j_cigar' as categorical\n",
      "... storing 'IR_VDJ_1_j_cigar' as categorical\n",
      "... storing 'IR_VDJ_2_j_cigar' as categorical\n",
      "... storing 'IR_VJ_1_junction' as categorical\n",
      "... storing 'IR_VJ_2_junction' as categorical\n",
      "... storing 'IR_VDJ_1_junction' as categorical\n",
      "... storing 'IR_VDJ_2_junction' as categorical\n",
      "... storing 'IR_VJ_1_junction_aa' as categorical\n",
      "... storing 'IR_VJ_2_junction_aa' as categorical\n",
      "... storing 'IR_VDJ_1_junction_aa' as categorical\n",
      "... storing 'IR_VDJ_2_junction_aa' as categorical\n",
      "... storing 'IR_VJ_1_productive' as categorical\n",
      "... storing 'IR_VJ_2_productive' as categorical\n",
      "... storing 'IR_VDJ_1_productive' as categorical\n",
      "... storing 'IR_VDJ_2_productive' as categorical\n",
      "... storing 'IR_VJ_1_rev_comp' as categorical\n",
      "... storing 'IR_VJ_2_rev_comp' as categorical\n",
      "... storing 'IR_VDJ_1_rev_comp' as categorical\n",
      "... storing 'IR_VDJ_2_rev_comp' as categorical\n",
      "... storing 'IR_VJ_1_sequence' as categorical\n",
      "... storing 'IR_VJ_2_sequence' as categorical\n",
      "... storing 'IR_VDJ_1_sequence' as categorical\n",
      "... storing 'IR_VDJ_2_sequence' as categorical\n",
      "... storing 'IR_VJ_1_sequence_aa' as categorical\n",
      "... storing 'IR_VJ_2_sequence_aa' as categorical\n",
      "... storing 'IR_VDJ_1_sequence_aa' as categorical\n",
      "... storing 'IR_VDJ_2_sequence_aa' as categorical\n",
      "... storing 'IR_VJ_1_sequence_alignment' as categorical\n",
      "... storing 'IR_VJ_2_sequence_alignment' as categorical\n",
      "... storing 'IR_VDJ_1_sequence_alignment' as categorical\n",
      "... storing 'IR_VDJ_2_sequence_alignment' as categorical\n",
      "... storing 'IR_VJ_1_sequence_id' as categorical\n",
      "... storing 'IR_VJ_2_sequence_id' as categorical\n",
      "... storing 'IR_VDJ_1_sequence_id' as categorical\n",
      "... storing 'IR_VDJ_2_sequence_id' as categorical\n",
      "... storing 'IR_VJ_1_v_cigar' as categorical\n",
      "... storing 'IR_VJ_2_v_cigar' as categorical\n",
      "... storing 'IR_VDJ_1_v_cigar' as categorical\n",
      "... storing 'IR_VDJ_2_v_cigar' as categorical\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "AnnData object with n_obs × n_vars = 994 × 0\n",
       "    obs: 'multi_chain', 'extra_chains', 'IR_VJ_1_c_call', 'IR_VJ_2_c_call', 'IR_VDJ_1_c_call', 'IR_VDJ_2_c_call', 'IR_VJ_1_c_cigar', 'IR_VJ_2_c_cigar', 'IR_VDJ_1_c_cigar', 'IR_VDJ_2_c_cigar', 'IR_VJ_1_c_sequence_end', 'IR_VJ_2_c_sequence_end', 'IR_VDJ_1_c_sequence_end', 'IR_VDJ_2_c_sequence_end', 'IR_VJ_1_c_sequence_start', 'IR_VJ_2_c_sequence_start', 'IR_VDJ_1_c_sequence_start', 'IR_VDJ_2_c_sequence_start', 'IR_VJ_1_clone_id', 'IR_VJ_2_clone_id', 'IR_VDJ_1_clone_id', 'IR_VDJ_2_clone_id', 'IR_VJ_1_consensus_count', 'IR_VJ_2_consensus_count', 'IR_VDJ_1_consensus_count', 'IR_VDJ_2_consensus_count', 'IR_VJ_1_d_call', 'IR_VJ_2_d_call', 'IR_VDJ_1_d_call', 'IR_VDJ_2_d_call', 'IR_VJ_1_d_cigar', 'IR_VJ_2_d_cigar', 'IR_VDJ_1_d_cigar', 'IR_VDJ_2_d_cigar', 'IR_VJ_1_d_sequence_end', 'IR_VJ_2_d_sequence_end', 'IR_VDJ_1_d_sequence_end', 'IR_VDJ_2_d_sequence_end', 'IR_VJ_1_d_sequence_start', 'IR_VJ_2_d_sequence_start', 'IR_VDJ_1_d_sequence_start', 'IR_VDJ_2_d_sequence_start', 'IR_VJ_1_duplicate_count', 'IR_VJ_2_duplicate_count', 'IR_VDJ_1_duplicate_count', 'IR_VDJ_2_duplicate_count', 'IR_VJ_1_germline_alignment', 'IR_VJ_2_germline_alignment', 'IR_VDJ_1_germline_alignment', 'IR_VDJ_2_germline_alignment', 'IR_VJ_1_is_cell', 'IR_VJ_2_is_cell', 'IR_VDJ_1_is_cell', 'IR_VDJ_2_is_cell', 'IR_VJ_1_j_call', 'IR_VJ_2_j_call', 'IR_VDJ_1_j_call', 'IR_VDJ_2_j_call', 'IR_VJ_1_j_cigar', 'IR_VJ_2_j_cigar', 'IR_VDJ_1_j_cigar', 'IR_VDJ_2_j_cigar', 'IR_VJ_1_j_sequence_end', 'IR_VJ_2_j_sequence_end', 'IR_VDJ_1_j_sequence_end', 'IR_VDJ_2_j_sequence_end', 'IR_VJ_1_j_sequence_start', 'IR_VJ_2_j_sequence_start', 'IR_VDJ_1_j_sequence_start', 'IR_VDJ_2_j_sequence_start', 'IR_VJ_1_junction', 'IR_VJ_2_junction', 'IR_VDJ_1_junction', 'IR_VDJ_2_junction', 'IR_VJ_1_junction_aa', 'IR_VJ_2_junction_aa', 'IR_VDJ_1_junction_aa', 'IR_VDJ_2_junction_aa', 'IR_VJ_1_junction_aa_length', 'IR_VJ_2_junction_aa_length', 'IR_VDJ_1_junction_aa_length', 'IR_VDJ_2_junction_aa_length', 'IR_VJ_1_junction_length', 'IR_VJ_2_junction_length', 'IR_VDJ_1_junction_length', 'IR_VDJ_2_junction_length', 'IR_VJ_1_locus', 'IR_VJ_2_locus', 'IR_VDJ_1_locus', 'IR_VDJ_2_locus', 'IR_VJ_1_productive', 'IR_VJ_2_productive', 'IR_VDJ_1_productive', 'IR_VDJ_2_productive', 'IR_VJ_1_rev_comp', 'IR_VJ_2_rev_comp', 'IR_VDJ_1_rev_comp', 'IR_VDJ_2_rev_comp', 'IR_VJ_1_sequence', 'IR_VJ_2_sequence', 'IR_VDJ_1_sequence', 'IR_VDJ_2_sequence', 'IR_VJ_1_sequence_aa', 'IR_VJ_2_sequence_aa', 'IR_VDJ_1_sequence_aa', 'IR_VDJ_2_sequence_aa', 'IR_VJ_1_sequence_alignment', 'IR_VJ_2_sequence_alignment', 'IR_VDJ_1_sequence_alignment', 'IR_VDJ_2_sequence_alignment', 'IR_VJ_1_sequence_id', 'IR_VJ_2_sequence_id', 'IR_VDJ_1_sequence_id', 'IR_VDJ_2_sequence_id', 'IR_VJ_1_v_call', 'IR_VJ_2_v_call', 'IR_VDJ_1_v_call', 'IR_VDJ_2_v_call', 'IR_VJ_1_v_cigar', 'IR_VJ_2_v_cigar', 'IR_VDJ_1_v_cigar', 'IR_VDJ_2_v_cigar', 'IR_VJ_1_v_sequence_end', 'IR_VJ_2_v_sequence_end', 'IR_VDJ_1_v_sequence_end', 'IR_VDJ_2_v_sequence_end', 'IR_VJ_1_v_sequence_start', 'IR_VJ_2_v_sequence_start', 'IR_VDJ_1_v_sequence_start', 'IR_VDJ_2_v_sequence_start', 'has_ir', 'clone_id', 'clone_id_by_size', 'locus_heavy', 'locus_light', 'productive_heavy', 'productive_light', 'v_call_heavy', 'v_call_light', 'j_call_heavy', 'j_call_light', 'c_call_heavy', 'c_call_light', 'duplicate_count_heavy_0', 'duplicate_count_heavy_1', 'duplicate_count_light_0', 'duplicate_count_light_1', 'junction_aa_heavy', 'junction_aa_light', 'status', 'status_summary', 'productive', 'productive_summary', 'isotype', 'isotype_summary', 'vdj_status', 'vdj_status_summary', 'heavychain_status_summary'"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "irdatax = ddl.to_scirpy(vdj, transfer = True)\n",
    "irdatax"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## `dandelion` : Converting `scirpy` to `dandelion`"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Dandelion class object with n_obs = 978 and n_contigs = 2093\n",
       "    data: 'c_call', 'c_cigar', 'c_sequence_end', 'c_sequence_start', 'clone_id', 'consensus_count', 'd_call', 'd_cigar', 'd_sequence_end', 'd_sequence_start', 'germline_alignment', 'is_cell', 'j_call', 'j_cigar', 'j_sequence_end', 'j_sequence_start', 'junction', 'junction_aa', 'junction_aa_length', 'junction_length', 'locus', 'productive', 'rev_comp', 'sequence', 'sequence_aa', 'sequence_alignment', 'sequence_id', 'v_call', 'v_cigar', 'v_sequence_end', 'v_sequence_start', 'cell_id', 'umi_count'\n",
       "    metadata: 'clone_id', 'clone_id_by_size', 'locus_heavy', 'locus_light', 'productive_heavy', 'productive_light', 'v_call_heavy', 'v_call_light', 'j_call_heavy', 'j_call_light', 'c_call_heavy', 'c_call_light', 'umi_count_heavy_0', 'umi_count_heavy_1', 'umi_count_light_0', 'umi_count_light_1', 'junction_aa_heavy', 'junction_aa_light', 'status', 'status_summary', 'productive', 'productive_summary', 'isotype', 'isotype_summary', 'vdj_status', 'vdj_status_summary', 'heavychain_status_summary'\n",
       "    distance: None\n",
       "    edges: None\n",
       "    layout: None\n",
       "    graph: None"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "vdjx = ddl.from_scirpy(irdata)\n",
    "vdjx"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "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>clone_id</th>\n",
       "      <th>clone_id_by_size</th>\n",
       "      <th>locus_heavy</th>\n",
       "      <th>locus_light</th>\n",
       "      <th>productive_heavy</th>\n",
       "      <th>productive_light</th>\n",
       "      <th>v_call_heavy</th>\n",
       "      <th>v_call_light</th>\n",
       "      <th>j_call_heavy</th>\n",
       "      <th>j_call_light</th>\n",
       "      <th>...</th>\n",
       "      <th>junction_aa_light</th>\n",
       "      <th>status</th>\n",
       "      <th>status_summary</th>\n",
       "      <th>productive</th>\n",
       "      <th>productive_summary</th>\n",
       "      <th>isotype</th>\n",
       "      <th>isotype_summary</th>\n",
       "      <th>vdj_status</th>\n",
       "      <th>vdj_status_summary</th>\n",
       "      <th>heavychain_status_summary</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>AAACCTGTCCGTTGTC-1</th>\n",
       "      <td>148_3_1_266</td>\n",
       "      <td>1066</td>\n",
       "      <td>IGH</td>\n",
       "      <td>IGK</td>\n",
       "      <td>T</td>\n",
       "      <td>T</td>\n",
       "      <td>IGHV1-69D</td>\n",
       "      <td>IGKV1-8</td>\n",
       "      <td>IGHJ3</td>\n",
       "      <td>IGKJ1</td>\n",
       "      <td>...</td>\n",
       "      <td>CQQYYSYPRTF</td>\n",
       "      <td>IGH + IGK</td>\n",
       "      <td>IGH + IGK</td>\n",
       "      <td>T + T</td>\n",
       "      <td>T + T</td>\n",
       "      <td>IgM</td>\n",
       "      <td>IgM</td>\n",
       "      <td>Single + Single</td>\n",
       "      <td>Single</td>\n",
       "      <td>Single</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>AAACCTGTCGAGAACG-1</th>\n",
       "      <td>92_4_1_47</td>\n",
       "      <td>1065</td>\n",
       "      <td>IGH</td>\n",
       "      <td>IGL</td>\n",
       "      <td>T</td>\n",
       "      <td>T</td>\n",
       "      <td>IGHV1-2</td>\n",
       "      <td>IGLV5-45</td>\n",
       "      <td>IGHJ3</td>\n",
       "      <td>IGLJ3</td>\n",
       "      <td>...</td>\n",
       "      <td>CMIWHSSAWVV</td>\n",
       "      <td>IGH + IGL</td>\n",
       "      <td>IGH + IGL</td>\n",
       "      <td>T + T</td>\n",
       "      <td>T + T</td>\n",
       "      <td>IgM</td>\n",
       "      <td>IgM</td>\n",
       "      <td>Single + Single</td>\n",
       "      <td>Single</td>\n",
       "      <td>Single</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>AAACCTGTCTTGAGAC-1</th>\n",
       "      <td>149_1_2_419</td>\n",
       "      <td>166</td>\n",
       "      <td>IGH</td>\n",
       "      <td>IGK</td>\n",
       "      <td>T</td>\n",
       "      <td>T</td>\n",
       "      <td>IGHV5-51</td>\n",
       "      <td>IGKV1D-8</td>\n",
       "      <td>IGHJ3</td>\n",
       "      <td>IGKJ2</td>\n",
       "      <td>...</td>\n",
       "      <td>CQQYYSFPYTF</td>\n",
       "      <td>IGH + IGK</td>\n",
       "      <td>IGH + IGK</td>\n",
       "      <td>T + T</td>\n",
       "      <td>T + T</td>\n",
       "      <td>IgM</td>\n",
       "      <td>IgM</td>\n",
       "      <td>Single + Single</td>\n",
       "      <td>Single</td>\n",
       "      <td>Single</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>AAACGGGAGCGACGTA-1</th>\n",
       "      <td>82_1_2_2</td>\n",
       "      <td>600</td>\n",
       "      <td>IGH</td>\n",
       "      <td>IGL</td>\n",
       "      <td>T</td>\n",
       "      <td>T</td>\n",
       "      <td>IGHV4-59</td>\n",
       "      <td>IGLV3-19</td>\n",
       "      <td>IGHJ3</td>\n",
       "      <td>IGLJ2</td>\n",
       "      <td>...</td>\n",
       "      <td>CNSRDSSGNHVVF</td>\n",
       "      <td>IGH + IGL</td>\n",
       "      <td>IGH + IGL</td>\n",
       "      <td>T + T</td>\n",
       "      <td>T + T</td>\n",
       "      <td>IgM</td>\n",
       "      <td>IgM</td>\n",
       "      <td>Single + Single</td>\n",
       "      <td>Single</td>\n",
       "      <td>Single</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>AAACGGGCACTGTTAG-1</th>\n",
       "      <td>70_1_1_92</td>\n",
       "      <td>1075</td>\n",
       "      <td>IGH</td>\n",
       "      <td>IGL</td>\n",
       "      <td>T</td>\n",
       "      <td>T</td>\n",
       "      <td>IGHV4-39</td>\n",
       "      <td>IGLV3-21</td>\n",
       "      <td>IGHJ3</td>\n",
       "      <td>IGLJ2</td>\n",
       "      <td>...</td>\n",
       "      <td>CQVWDSSSDHVVF</td>\n",
       "      <td>IGH + IGL</td>\n",
       "      <td>IGH + IGL</td>\n",
       "      <td>T + T</td>\n",
       "      <td>T + T</td>\n",
       "      <td>IgM</td>\n",
       "      <td>IgM</td>\n",
       "      <td>Single + Single</td>\n",
       "      <td>Single</td>\n",
       "      <td>Single</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>TTTGCGCTCTAACGGT-1</th>\n",
       "      <td>138_3_1_217</td>\n",
       "      <td>156</td>\n",
       "      <td>IGH</td>\n",
       "      <td>IGL</td>\n",
       "      <td>T</td>\n",
       "      <td>T</td>\n",
       "      <td>IGHV3-43</td>\n",
       "      <td>IGLV2-8</td>\n",
       "      <td>IGHJ6</td>\n",
       "      <td>IGLJ3</td>\n",
       "      <td>...</td>\n",
       "      <td>CGSFAGSNIWVF</td>\n",
       "      <td>IGH + IGL</td>\n",
       "      <td>IGH + IGL</td>\n",
       "      <td>T + T</td>\n",
       "      <td>T + T</td>\n",
       "      <td>IgM</td>\n",
       "      <td>IgM</td>\n",
       "      <td>Single + Single</td>\n",
       "      <td>Single</td>\n",
       "      <td>Single</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>TTTGGTTGTAGCCTAT-1</th>\n",
       "      <td>85_1_1_240</td>\n",
       "      <td>506</td>\n",
       "      <td>IGH</td>\n",
       "      <td>IGK</td>\n",
       "      <td>T</td>\n",
       "      <td>T</td>\n",
       "      <td>IGHV4-39</td>\n",
       "      <td>IGKV6-21</td>\n",
       "      <td>IGHJ2</td>\n",
       "      <td>IGKJ4</td>\n",
       "      <td>...</td>\n",
       "      <td>CHQSSSLPLTF</td>\n",
       "      <td>IGH + IGK</td>\n",
       "      <td>IGH + IGK</td>\n",
       "      <td>T + T</td>\n",
       "      <td>T + T</td>\n",
       "      <td>IgM</td>\n",
       "      <td>IgM</td>\n",
       "      <td>Single + Single</td>\n",
       "      <td>Single</td>\n",
       "      <td>Single</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>TTTGGTTTCAGAGCTT-1</th>\n",
       "      <td>117_5_2_232</td>\n",
       "      <td>563</td>\n",
       "      <td>IGH</td>\n",
       "      <td>IGK</td>\n",
       "      <td>T</td>\n",
       "      <td>T</td>\n",
       "      <td>IGHV7-4-1</td>\n",
       "      <td>IGKV3-11</td>\n",
       "      <td>IGHJ4</td>\n",
       "      <td>IGKJ5</td>\n",
       "      <td>...</td>\n",
       "      <td>CQQRSNWLTF</td>\n",
       "      <td>IGH + IGK</td>\n",
       "      <td>IGH + IGK</td>\n",
       "      <td>T + T</td>\n",
       "      <td>T + T</td>\n",
       "      <td>IgM</td>\n",
       "      <td>IgM</td>\n",
       "      <td>Single + Single</td>\n",
       "      <td>Single</td>\n",
       "      <td>Single</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>TTTGGTTTCAGTGTTG-1</th>\n",
       "      <td>12_1_1_329</td>\n",
       "      <td>820</td>\n",
       "      <td>IGH</td>\n",
       "      <td>IGL</td>\n",
       "      <td>T</td>\n",
       "      <td>T</td>\n",
       "      <td>IGHV2-5</td>\n",
       "      <td>IGLV2-23</td>\n",
       "      <td>IGHJ4</td>\n",
       "      <td>IGLJ2</td>\n",
       "      <td>...</td>\n",
       "      <td>CCSYAGSSTFEVF</td>\n",
       "      <td>IGH + IGL</td>\n",
       "      <td>IGH + IGL</td>\n",
       "      <td>T + T</td>\n",
       "      <td>T + T</td>\n",
       "      <td>IgM</td>\n",
       "      <td>IgM</td>\n",
       "      <td>Single + Single</td>\n",
       "      <td>Single</td>\n",
       "      <td>Single</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>TTTGGTTTCGGTGTCG-1</th>\n",
       "      <td>140_1_1_82</td>\n",
       "      <td>210</td>\n",
       "      <td>IGH</td>\n",
       "      <td>IGK</td>\n",
       "      <td>T</td>\n",
       "      <td>T</td>\n",
       "      <td>IGHV3-21</td>\n",
       "      <td>IGKV3-11</td>\n",
       "      <td>IGHJ2</td>\n",
       "      <td>IGKJ4</td>\n",
       "      <td>...</td>\n",
       "      <td>CQQRSNWPRLTF</td>\n",
       "      <td>IGH + IGK</td>\n",
       "      <td>IGH + IGK</td>\n",
       "      <td>T + T</td>\n",
       "      <td>T + T</td>\n",
       "      <td>IgM</td>\n",
       "      <td>IgM</td>\n",
       "      <td>Single + Single</td>\n",
       "      <td>Single</td>\n",
       "      <td>Single</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>978 rows × 27 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                       clone_id clone_id_by_size locus_heavy locus_light  \\\n",
       "AAACCTGTCCGTTGTC-1  148_3_1_266             1066         IGH         IGK   \n",
       "AAACCTGTCGAGAACG-1    92_4_1_47             1065         IGH         IGL   \n",
       "AAACCTGTCTTGAGAC-1  149_1_2_419              166         IGH         IGK   \n",
       "AAACGGGAGCGACGTA-1     82_1_2_2              600         IGH         IGL   \n",
       "AAACGGGCACTGTTAG-1    70_1_1_92             1075         IGH         IGL   \n",
       "...                         ...              ...         ...         ...   \n",
       "TTTGCGCTCTAACGGT-1  138_3_1_217              156         IGH         IGL   \n",
       "TTTGGTTGTAGCCTAT-1   85_1_1_240              506         IGH         IGK   \n",
       "TTTGGTTTCAGAGCTT-1  117_5_2_232              563         IGH         IGK   \n",
       "TTTGGTTTCAGTGTTG-1   12_1_1_329              820         IGH         IGL   \n",
       "TTTGGTTTCGGTGTCG-1   140_1_1_82              210         IGH         IGK   \n",
       "\n",
       "                   productive_heavy productive_light v_call_heavy  \\\n",
       "AAACCTGTCCGTTGTC-1                T                T    IGHV1-69D   \n",
       "AAACCTGTCGAGAACG-1                T                T      IGHV1-2   \n",
       "AAACCTGTCTTGAGAC-1                T                T     IGHV5-51   \n",
       "AAACGGGAGCGACGTA-1                T                T     IGHV4-59   \n",
       "AAACGGGCACTGTTAG-1                T                T     IGHV4-39   \n",
       "...                             ...              ...          ...   \n",
       "TTTGCGCTCTAACGGT-1                T                T     IGHV3-43   \n",
       "TTTGGTTGTAGCCTAT-1                T                T     IGHV4-39   \n",
       "TTTGGTTTCAGAGCTT-1                T                T    IGHV7-4-1   \n",
       "TTTGGTTTCAGTGTTG-1                T                T      IGHV2-5   \n",
       "TTTGGTTTCGGTGTCG-1                T                T     IGHV3-21   \n",
       "\n",
       "                   v_call_light j_call_heavy j_call_light  ...  \\\n",
       "AAACCTGTCCGTTGTC-1      IGKV1-8        IGHJ3        IGKJ1  ...   \n",
       "AAACCTGTCGAGAACG-1     IGLV5-45        IGHJ3        IGLJ3  ...   \n",
       "AAACCTGTCTTGAGAC-1     IGKV1D-8        IGHJ3        IGKJ2  ...   \n",
       "AAACGGGAGCGACGTA-1     IGLV3-19        IGHJ3        IGLJ2  ...   \n",
       "AAACGGGCACTGTTAG-1     IGLV3-21        IGHJ3        IGLJ2  ...   \n",
       "...                         ...          ...          ...  ...   \n",
       "TTTGCGCTCTAACGGT-1      IGLV2-8        IGHJ6        IGLJ3  ...   \n",
       "TTTGGTTGTAGCCTAT-1     IGKV6-21        IGHJ2        IGKJ4  ...   \n",
       "TTTGGTTTCAGAGCTT-1     IGKV3-11        IGHJ4        IGKJ5  ...   \n",
       "TTTGGTTTCAGTGTTG-1     IGLV2-23        IGHJ4        IGLJ2  ...   \n",
       "TTTGGTTTCGGTGTCG-1     IGKV3-11        IGHJ2        IGKJ4  ...   \n",
       "\n",
       "                   junction_aa_light     status  status_summary  productive  \\\n",
       "AAACCTGTCCGTTGTC-1       CQQYYSYPRTF  IGH + IGK       IGH + IGK       T + T   \n",
       "AAACCTGTCGAGAACG-1       CMIWHSSAWVV  IGH + IGL       IGH + IGL       T + T   \n",
       "AAACCTGTCTTGAGAC-1       CQQYYSFPYTF  IGH + IGK       IGH + IGK       T + T   \n",
       "AAACGGGAGCGACGTA-1     CNSRDSSGNHVVF  IGH + IGL       IGH + IGL       T + T   \n",
       "AAACGGGCACTGTTAG-1     CQVWDSSSDHVVF  IGH + IGL       IGH + IGL       T + T   \n",
       "...                              ...        ...             ...         ...   \n",
       "TTTGCGCTCTAACGGT-1      CGSFAGSNIWVF  IGH + IGL       IGH + IGL       T + T   \n",
       "TTTGGTTGTAGCCTAT-1       CHQSSSLPLTF  IGH + IGK       IGH + IGK       T + T   \n",
       "TTTGGTTTCAGAGCTT-1        CQQRSNWLTF  IGH + IGK       IGH + IGK       T + T   \n",
       "TTTGGTTTCAGTGTTG-1     CCSYAGSSTFEVF  IGH + IGL       IGH + IGL       T + T   \n",
       "TTTGGTTTCGGTGTCG-1      CQQRSNWPRLTF  IGH + IGK       IGH + IGK       T + T   \n",
       "\n",
       "                    productive_summary  isotype isotype_summary  \\\n",
       "AAACCTGTCCGTTGTC-1               T + T      IgM             IgM   \n",
       "AAACCTGTCGAGAACG-1               T + T      IgM             IgM   \n",
       "AAACCTGTCTTGAGAC-1               T + T      IgM             IgM   \n",
       "AAACGGGAGCGACGTA-1               T + T      IgM             IgM   \n",
       "AAACGGGCACTGTTAG-1               T + T      IgM             IgM   \n",
       "...                                ...      ...             ...   \n",
       "TTTGCGCTCTAACGGT-1               T + T      IgM             IgM   \n",
       "TTTGGTTGTAGCCTAT-1               T + T      IgM             IgM   \n",
       "TTTGGTTTCAGAGCTT-1               T + T      IgM             IgM   \n",
       "TTTGGTTTCAGTGTTG-1               T + T      IgM             IgM   \n",
       "TTTGGTTTCGGTGTCG-1               T + T      IgM             IgM   \n",
       "\n",
       "                         vdj_status vdj_status_summary  \\\n",
       "AAACCTGTCCGTTGTC-1  Single + Single             Single   \n",
       "AAACCTGTCGAGAACG-1  Single + Single             Single   \n",
       "AAACCTGTCTTGAGAC-1  Single + Single             Single   \n",
       "AAACGGGAGCGACGTA-1  Single + Single             Single   \n",
       "AAACGGGCACTGTTAG-1  Single + Single             Single   \n",
       "...                             ...                ...   \n",
       "TTTGCGCTCTAACGGT-1  Single + Single             Single   \n",
       "TTTGGTTGTAGCCTAT-1  Single + Single             Single   \n",
       "TTTGGTTTCAGAGCTT-1  Single + Single             Single   \n",
       "TTTGGTTTCAGTGTTG-1  Single + Single             Single   \n",
       "TTTGGTTTCGGTGTCG-1  Single + Single             Single   \n",
       "\n",
       "                   heavychain_status_summary  \n",
       "AAACCTGTCCGTTGTC-1                    Single  \n",
       "AAACCTGTCGAGAACG-1                    Single  \n",
       "AAACCTGTCTTGAGAC-1                    Single  \n",
       "AAACGGGAGCGACGTA-1                    Single  \n",
       "AAACGGGCACTGTTAG-1                    Single  \n",
       "...                                      ...  \n",
       "TTTGCGCTCTAACGGT-1                    Single  \n",
       "TTTGGTTGTAGCCTAT-1                    Single  \n",
       "TTTGGTTTCAGAGCTT-1                    Single  \n",
       "TTTGGTTTCAGTGTTG-1                    Single  \n",
       "TTTGGTTTCGGTGTCG-1                    Single  \n",
       "\n",
       "[978 rows x 27 columns]"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "vdjx.metadata"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# `scirpy`"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## `scirpy` : Converting `dandelion` to `scirpy`"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/kt16/miniconda3/envs/dandelion/lib/python3.7/site-packages/anndata/_core/anndata.py:1192: FutureWarning: is_categorical is deprecated and will be removed in a future version.  Use is_categorical_dtype instead\n",
      "... storing 'extra_chains' as categorical\n",
      "... storing 'IR_VJ_1_c_cigar' as categorical\n",
      "... storing 'IR_VJ_2_c_cigar' as categorical\n",
      "... storing 'IR_VDJ_1_c_cigar' as categorical\n",
      "... storing 'IR_VDJ_2_c_cigar' as categorical\n",
      "... storing 'IR_VJ_1_clone_id' as categorical\n",
      "... storing 'IR_VJ_2_clone_id' as categorical\n",
      "... storing 'IR_VDJ_1_clone_id' as categorical\n",
      "... storing 'IR_VDJ_2_clone_id' as categorical\n",
      "... storing 'IR_VJ_1_d_cigar' as categorical\n",
      "... storing 'IR_VJ_2_d_cigar' as categorical\n",
      "... storing 'IR_VDJ_1_d_cigar' as categorical\n",
      "... storing 'IR_VDJ_2_d_cigar' as categorical\n",
      "... storing 'IR_VJ_1_d_sequence_end' as categorical\n",
      "... storing 'IR_VJ_2_d_sequence_end' as categorical\n",
      "... storing 'IR_VJ_1_d_sequence_start' as categorical\n",
      "... storing 'IR_VJ_2_d_sequence_start' as categorical\n",
      "... storing 'IR_VJ_1_germline_alignment' as categorical\n",
      "... storing 'IR_VJ_2_germline_alignment' as categorical\n",
      "... storing 'IR_VDJ_1_germline_alignment' as categorical\n",
      "... storing 'IR_VDJ_2_germline_alignment' as categorical\n",
      "... storing 'IR_VJ_1_is_cell' as categorical\n",
      "... storing 'IR_VJ_2_is_cell' as categorical\n",
      "... storing 'IR_VDJ_1_is_cell' as categorical\n",
      "... storing 'IR_VDJ_2_is_cell' as categorical\n",
      "... storing 'IR_VJ_1_j_cigar' as categorical\n",
      "... storing 'IR_VJ_2_j_cigar' as categorical\n",
      "... storing 'IR_VDJ_1_j_cigar' as categorical\n",
      "... storing 'IR_VDJ_2_j_cigar' as categorical\n",
      "... storing 'IR_VJ_1_junction' as categorical\n",
      "... storing 'IR_VJ_2_junction' as categorical\n",
      "... storing 'IR_VDJ_1_junction' as categorical\n",
      "... storing 'IR_VDJ_2_junction' as categorical\n",
      "... storing 'IR_VJ_1_junction_aa' as categorical\n",
      "... storing 'IR_VJ_2_junction_aa' as categorical\n",
      "... storing 'IR_VDJ_1_junction_aa' as categorical\n",
      "... storing 'IR_VDJ_2_junction_aa' as categorical\n",
      "... storing 'IR_VJ_1_productive' as categorical\n",
      "... storing 'IR_VJ_2_productive' as categorical\n",
      "... storing 'IR_VDJ_1_productive' as categorical\n",
      "... storing 'IR_VDJ_2_productive' as categorical\n",
      "... storing 'IR_VJ_1_rev_comp' as categorical\n",
      "... storing 'IR_VJ_2_rev_comp' as categorical\n",
      "... storing 'IR_VDJ_1_rev_comp' as categorical\n",
      "... storing 'IR_VDJ_2_rev_comp' as categorical\n",
      "... storing 'IR_VJ_1_sequence' as categorical\n",
      "... storing 'IR_VJ_2_sequence' as categorical\n",
      "... storing 'IR_VDJ_1_sequence' as categorical\n",
      "... storing 'IR_VDJ_2_sequence' as categorical\n",
      "... storing 'IR_VJ_1_sequence_aa' as categorical\n",
      "... storing 'IR_VJ_2_sequence_aa' as categorical\n",
      "... storing 'IR_VDJ_1_sequence_aa' as categorical\n",
      "... storing 'IR_VDJ_2_sequence_aa' as categorical\n",
      "... storing 'IR_VJ_1_sequence_alignment' as categorical\n",
      "... storing 'IR_VJ_2_sequence_alignment' as categorical\n",
      "... storing 'IR_VDJ_1_sequence_alignment' as categorical\n",
      "... storing 'IR_VDJ_2_sequence_alignment' as categorical\n",
      "... storing 'IR_VJ_1_sequence_id' as categorical\n",
      "... storing 'IR_VJ_2_sequence_id' as categorical\n",
      "... storing 'IR_VDJ_1_sequence_id' as categorical\n",
      "... storing 'IR_VDJ_2_sequence_id' as categorical\n",
      "... storing 'IR_VJ_1_v_cigar' as categorical\n",
      "... storing 'IR_VJ_2_v_cigar' as categorical\n",
      "... storing 'IR_VDJ_1_v_cigar' as categorical\n",
      "... storing 'IR_VDJ_2_v_cigar' as categorical\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "AnnData object with n_obs × n_vars = 994 × 0\n",
       "    obs: 'multi_chain', 'extra_chains', 'IR_VJ_1_c_call', 'IR_VJ_2_c_call', 'IR_VDJ_1_c_call', 'IR_VDJ_2_c_call', 'IR_VJ_1_c_cigar', 'IR_VJ_2_c_cigar', 'IR_VDJ_1_c_cigar', 'IR_VDJ_2_c_cigar', 'IR_VJ_1_c_sequence_end', 'IR_VJ_2_c_sequence_end', 'IR_VDJ_1_c_sequence_end', 'IR_VDJ_2_c_sequence_end', 'IR_VJ_1_c_sequence_start', 'IR_VJ_2_c_sequence_start', 'IR_VDJ_1_c_sequence_start', 'IR_VDJ_2_c_sequence_start', 'IR_VJ_1_clone_id', 'IR_VJ_2_clone_id', 'IR_VDJ_1_clone_id', 'IR_VDJ_2_clone_id', 'IR_VJ_1_consensus_count', 'IR_VJ_2_consensus_count', 'IR_VDJ_1_consensus_count', 'IR_VDJ_2_consensus_count', 'IR_VJ_1_d_call', 'IR_VJ_2_d_call', 'IR_VDJ_1_d_call', 'IR_VDJ_2_d_call', 'IR_VJ_1_d_cigar', 'IR_VJ_2_d_cigar', 'IR_VDJ_1_d_cigar', 'IR_VDJ_2_d_cigar', 'IR_VJ_1_d_sequence_end', 'IR_VJ_2_d_sequence_end', 'IR_VDJ_1_d_sequence_end', 'IR_VDJ_2_d_sequence_end', 'IR_VJ_1_d_sequence_start', 'IR_VJ_2_d_sequence_start', 'IR_VDJ_1_d_sequence_start', 'IR_VDJ_2_d_sequence_start', 'IR_VJ_1_duplicate_count', 'IR_VJ_2_duplicate_count', 'IR_VDJ_1_duplicate_count', 'IR_VDJ_2_duplicate_count', 'IR_VJ_1_germline_alignment', 'IR_VJ_2_germline_alignment', 'IR_VDJ_1_germline_alignment', 'IR_VDJ_2_germline_alignment', 'IR_VJ_1_is_cell', 'IR_VJ_2_is_cell', 'IR_VDJ_1_is_cell', 'IR_VDJ_2_is_cell', 'IR_VJ_1_j_call', 'IR_VJ_2_j_call', 'IR_VDJ_1_j_call', 'IR_VDJ_2_j_call', 'IR_VJ_1_j_cigar', 'IR_VJ_2_j_cigar', 'IR_VDJ_1_j_cigar', 'IR_VDJ_2_j_cigar', 'IR_VJ_1_j_sequence_end', 'IR_VJ_2_j_sequence_end', 'IR_VDJ_1_j_sequence_end', 'IR_VDJ_2_j_sequence_end', 'IR_VJ_1_j_sequence_start', 'IR_VJ_2_j_sequence_start', 'IR_VDJ_1_j_sequence_start', 'IR_VDJ_2_j_sequence_start', 'IR_VJ_1_junction', 'IR_VJ_2_junction', 'IR_VDJ_1_junction', 'IR_VDJ_2_junction', 'IR_VJ_1_junction_aa', 'IR_VJ_2_junction_aa', 'IR_VDJ_1_junction_aa', 'IR_VDJ_2_junction_aa', 'IR_VJ_1_junction_aa_length', 'IR_VJ_2_junction_aa_length', 'IR_VDJ_1_junction_aa_length', 'IR_VDJ_2_junction_aa_length', 'IR_VJ_1_junction_length', 'IR_VJ_2_junction_length', 'IR_VDJ_1_junction_length', 'IR_VDJ_2_junction_length', 'IR_VJ_1_locus', 'IR_VJ_2_locus', 'IR_VDJ_1_locus', 'IR_VDJ_2_locus', 'IR_VJ_1_productive', 'IR_VJ_2_productive', 'IR_VDJ_1_productive', 'IR_VDJ_2_productive', 'IR_VJ_1_rev_comp', 'IR_VJ_2_rev_comp', 'IR_VDJ_1_rev_comp', 'IR_VDJ_2_rev_comp', 'IR_VJ_1_sequence', 'IR_VJ_2_sequence', 'IR_VDJ_1_sequence', 'IR_VDJ_2_sequence', 'IR_VJ_1_sequence_aa', 'IR_VJ_2_sequence_aa', 'IR_VDJ_1_sequence_aa', 'IR_VDJ_2_sequence_aa', 'IR_VJ_1_sequence_alignment', 'IR_VJ_2_sequence_alignment', 'IR_VDJ_1_sequence_alignment', 'IR_VDJ_2_sequence_alignment', 'IR_VJ_1_sequence_id', 'IR_VJ_2_sequence_id', 'IR_VDJ_1_sequence_id', 'IR_VDJ_2_sequence_id', 'IR_VJ_1_v_call', 'IR_VJ_2_v_call', 'IR_VDJ_1_v_call', 'IR_VDJ_2_v_call', 'IR_VJ_1_v_cigar', 'IR_VJ_2_v_cigar', 'IR_VDJ_1_v_cigar', 'IR_VDJ_2_v_cigar', 'IR_VJ_1_v_sequence_end', 'IR_VJ_2_v_sequence_end', 'IR_VDJ_1_v_sequence_end', 'IR_VDJ_2_v_sequence_end', 'IR_VJ_1_v_sequence_start', 'IR_VJ_2_v_sequence_start', 'IR_VDJ_1_v_sequence_start', 'IR_VDJ_2_v_sequence_start', 'has_ir'"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "irdata2 = ir.io.from_dandelion(vdj)\n",
    "irdata2"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "likewise, `transfer = True` will perform dandelion's `tl.transfer`."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "... storing 'extra_chains' as categorical\n",
      "... storing 'IR_VJ_1_c_cigar' as categorical\n",
      "... storing 'IR_VJ_2_c_cigar' as categorical\n",
      "... storing 'IR_VDJ_1_c_cigar' as categorical\n",
      "... storing 'IR_VDJ_2_c_cigar' as categorical\n",
      "... storing 'IR_VJ_1_clone_id' as categorical\n",
      "... storing 'IR_VJ_2_clone_id' as categorical\n",
      "... storing 'IR_VDJ_1_clone_id' as categorical\n",
      "... storing 'IR_VDJ_2_clone_id' as categorical\n",
      "... storing 'IR_VJ_1_d_cigar' as categorical\n",
      "... storing 'IR_VJ_2_d_cigar' as categorical\n",
      "... storing 'IR_VDJ_1_d_cigar' as categorical\n",
      "... storing 'IR_VDJ_2_d_cigar' as categorical\n",
      "... storing 'IR_VJ_1_d_sequence_end' as categorical\n",
      "... storing 'IR_VJ_2_d_sequence_end' as categorical\n",
      "... storing 'IR_VJ_1_d_sequence_start' as categorical\n",
      "... storing 'IR_VJ_2_d_sequence_start' as categorical\n",
      "... storing 'IR_VJ_1_germline_alignment' as categorical\n",
      "... storing 'IR_VJ_2_germline_alignment' as categorical\n",
      "... storing 'IR_VDJ_1_germline_alignment' as categorical\n",
      "... storing 'IR_VDJ_2_germline_alignment' as categorical\n",
      "... storing 'IR_VJ_1_is_cell' as categorical\n",
      "... storing 'IR_VJ_2_is_cell' as categorical\n",
      "... storing 'IR_VDJ_1_is_cell' as categorical\n",
      "... storing 'IR_VDJ_2_is_cell' as categorical\n",
      "... storing 'IR_VJ_1_j_cigar' as categorical\n",
      "... storing 'IR_VJ_2_j_cigar' as categorical\n",
      "... storing 'IR_VDJ_1_j_cigar' as categorical\n",
      "... storing 'IR_VDJ_2_j_cigar' as categorical\n",
      "... storing 'IR_VJ_1_junction' as categorical\n",
      "... storing 'IR_VJ_2_junction' as categorical\n",
      "... storing 'IR_VDJ_1_junction' as categorical\n",
      "... storing 'IR_VDJ_2_junction' as categorical\n",
      "... storing 'IR_VJ_1_junction_aa' as categorical\n",
      "... storing 'IR_VJ_2_junction_aa' as categorical\n",
      "... storing 'IR_VDJ_1_junction_aa' as categorical\n",
      "... storing 'IR_VDJ_2_junction_aa' as categorical\n",
      "... storing 'IR_VJ_1_productive' as categorical\n",
      "... storing 'IR_VJ_2_productive' as categorical\n",
      "... storing 'IR_VDJ_1_productive' as categorical\n",
      "... storing 'IR_VDJ_2_productive' as categorical\n",
      "... storing 'IR_VJ_1_rev_comp' as categorical\n",
      "... storing 'IR_VJ_2_rev_comp' as categorical\n",
      "... storing 'IR_VDJ_1_rev_comp' as categorical\n",
      "... storing 'IR_VDJ_2_rev_comp' as categorical\n",
      "... storing 'IR_VJ_1_sequence' as categorical\n",
      "... storing 'IR_VJ_2_sequence' as categorical\n",
      "... storing 'IR_VDJ_1_sequence' as categorical\n",
      "... storing 'IR_VDJ_2_sequence' as categorical\n",
      "... storing 'IR_VJ_1_sequence_aa' as categorical\n",
      "... storing 'IR_VJ_2_sequence_aa' as categorical\n",
      "... storing 'IR_VDJ_1_sequence_aa' as categorical\n",
      "... storing 'IR_VDJ_2_sequence_aa' as categorical\n",
      "... storing 'IR_VJ_1_sequence_alignment' as categorical\n",
      "... storing 'IR_VJ_2_sequence_alignment' as categorical\n",
      "... storing 'IR_VDJ_1_sequence_alignment' as categorical\n",
      "... storing 'IR_VDJ_2_sequence_alignment' as categorical\n",
      "... storing 'IR_VJ_1_sequence_id' as categorical\n",
      "... storing 'IR_VJ_2_sequence_id' as categorical\n",
      "... storing 'IR_VDJ_1_sequence_id' as categorical\n",
      "... storing 'IR_VDJ_2_sequence_id' as categorical\n",
      "... storing 'IR_VJ_1_v_cigar' as categorical\n",
      "... storing 'IR_VJ_2_v_cigar' as categorical\n",
      "... storing 'IR_VDJ_1_v_cigar' as categorical\n",
      "... storing 'IR_VDJ_2_v_cigar' as categorical\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "AnnData object with n_obs × n_vars = 994 × 0\n",
       "    obs: 'multi_chain', 'extra_chains', 'IR_VJ_1_c_call', 'IR_VJ_2_c_call', 'IR_VDJ_1_c_call', 'IR_VDJ_2_c_call', 'IR_VJ_1_c_cigar', 'IR_VJ_2_c_cigar', 'IR_VDJ_1_c_cigar', 'IR_VDJ_2_c_cigar', 'IR_VJ_1_c_sequence_end', 'IR_VJ_2_c_sequence_end', 'IR_VDJ_1_c_sequence_end', 'IR_VDJ_2_c_sequence_end', 'IR_VJ_1_c_sequence_start', 'IR_VJ_2_c_sequence_start', 'IR_VDJ_1_c_sequence_start', 'IR_VDJ_2_c_sequence_start', 'IR_VJ_1_clone_id', 'IR_VJ_2_clone_id', 'IR_VDJ_1_clone_id', 'IR_VDJ_2_clone_id', 'IR_VJ_1_consensus_count', 'IR_VJ_2_consensus_count', 'IR_VDJ_1_consensus_count', 'IR_VDJ_2_consensus_count', 'IR_VJ_1_d_call', 'IR_VJ_2_d_call', 'IR_VDJ_1_d_call', 'IR_VDJ_2_d_call', 'IR_VJ_1_d_cigar', 'IR_VJ_2_d_cigar', 'IR_VDJ_1_d_cigar', 'IR_VDJ_2_d_cigar', 'IR_VJ_1_d_sequence_end', 'IR_VJ_2_d_sequence_end', 'IR_VDJ_1_d_sequence_end', 'IR_VDJ_2_d_sequence_end', 'IR_VJ_1_d_sequence_start', 'IR_VJ_2_d_sequence_start', 'IR_VDJ_1_d_sequence_start', 'IR_VDJ_2_d_sequence_start', 'IR_VJ_1_duplicate_count', 'IR_VJ_2_duplicate_count', 'IR_VDJ_1_duplicate_count', 'IR_VDJ_2_duplicate_count', 'IR_VJ_1_germline_alignment', 'IR_VJ_2_germline_alignment', 'IR_VDJ_1_germline_alignment', 'IR_VDJ_2_germline_alignment', 'IR_VJ_1_is_cell', 'IR_VJ_2_is_cell', 'IR_VDJ_1_is_cell', 'IR_VDJ_2_is_cell', 'IR_VJ_1_j_call', 'IR_VJ_2_j_call', 'IR_VDJ_1_j_call', 'IR_VDJ_2_j_call', 'IR_VJ_1_j_cigar', 'IR_VJ_2_j_cigar', 'IR_VDJ_1_j_cigar', 'IR_VDJ_2_j_cigar', 'IR_VJ_1_j_sequence_end', 'IR_VJ_2_j_sequence_end', 'IR_VDJ_1_j_sequence_end', 'IR_VDJ_2_j_sequence_end', 'IR_VJ_1_j_sequence_start', 'IR_VJ_2_j_sequence_start', 'IR_VDJ_1_j_sequence_start', 'IR_VDJ_2_j_sequence_start', 'IR_VJ_1_junction', 'IR_VJ_2_junction', 'IR_VDJ_1_junction', 'IR_VDJ_2_junction', 'IR_VJ_1_junction_aa', 'IR_VJ_2_junction_aa', 'IR_VDJ_1_junction_aa', 'IR_VDJ_2_junction_aa', 'IR_VJ_1_junction_aa_length', 'IR_VJ_2_junction_aa_length', 'IR_VDJ_1_junction_aa_length', 'IR_VDJ_2_junction_aa_length', 'IR_VJ_1_junction_length', 'IR_VJ_2_junction_length', 'IR_VDJ_1_junction_length', 'IR_VDJ_2_junction_length', 'IR_VJ_1_locus', 'IR_VJ_2_locus', 'IR_VDJ_1_locus', 'IR_VDJ_2_locus', 'IR_VJ_1_productive', 'IR_VJ_2_productive', 'IR_VDJ_1_productive', 'IR_VDJ_2_productive', 'IR_VJ_1_rev_comp', 'IR_VJ_2_rev_comp', 'IR_VDJ_1_rev_comp', 'IR_VDJ_2_rev_comp', 'IR_VJ_1_sequence', 'IR_VJ_2_sequence', 'IR_VDJ_1_sequence', 'IR_VDJ_2_sequence', 'IR_VJ_1_sequence_aa', 'IR_VJ_2_sequence_aa', 'IR_VDJ_1_sequence_aa', 'IR_VDJ_2_sequence_aa', 'IR_VJ_1_sequence_alignment', 'IR_VJ_2_sequence_alignment', 'IR_VDJ_1_sequence_alignment', 'IR_VDJ_2_sequence_alignment', 'IR_VJ_1_sequence_id', 'IR_VJ_2_sequence_id', 'IR_VDJ_1_sequence_id', 'IR_VDJ_2_sequence_id', 'IR_VJ_1_v_call', 'IR_VJ_2_v_call', 'IR_VDJ_1_v_call', 'IR_VDJ_2_v_call', 'IR_VJ_1_v_cigar', 'IR_VJ_2_v_cigar', 'IR_VDJ_1_v_cigar', 'IR_VDJ_2_v_cigar', 'IR_VJ_1_v_sequence_end', 'IR_VJ_2_v_sequence_end', 'IR_VDJ_1_v_sequence_end', 'IR_VDJ_2_v_sequence_end', 'IR_VJ_1_v_sequence_start', 'IR_VJ_2_v_sequence_start', 'IR_VDJ_1_v_sequence_start', 'IR_VDJ_2_v_sequence_start', 'has_ir', 'clone_id', 'clone_id_by_size', 'locus_heavy', 'locus_light', 'productive_heavy', 'productive_light', 'v_call_heavy', 'v_call_light', 'j_call_heavy', 'j_call_light', 'c_call_heavy', 'c_call_light', 'duplicate_count_heavy_0', 'duplicate_count_heavy_1', 'duplicate_count_light_0', 'duplicate_count_light_1', 'junction_aa_heavy', 'junction_aa_light', 'status', 'status_summary', 'productive', 'productive_summary', 'isotype', 'isotype_summary', 'vdj_status', 'vdj_status_summary', 'heavychain_status_summary'"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "irdata2x = ir.io.from_dandelion(vdj, transfer = True)\n",
    "irdata2x"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## `scirpy` : Converting `scirpy` to `dandelion`"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Dandelion class object with n_obs = 978 and n_contigs = 2093\n",
       "    data: 'c_call', 'c_cigar', 'c_sequence_end', 'c_sequence_start', 'clone_id', 'consensus_count', 'd_call', 'd_cigar', 'd_sequence_end', 'd_sequence_start', 'germline_alignment', 'is_cell', 'j_call', 'j_cigar', 'j_sequence_end', 'j_sequence_start', 'junction', 'junction_aa', 'junction_aa_length', 'junction_length', 'locus', 'productive', 'rev_comp', 'sequence', 'sequence_aa', 'sequence_alignment', 'sequence_id', 'v_call', 'v_cigar', 'v_sequence_end', 'v_sequence_start', 'cell_id', 'umi_count'\n",
       "    metadata: 'clone_id', 'clone_id_by_size', 'locus_heavy', 'locus_light', 'productive_heavy', 'productive_light', 'v_call_heavy', 'v_call_light', 'j_call_heavy', 'j_call_light', 'c_call_heavy', 'c_call_light', 'umi_count_heavy_0', 'umi_count_heavy_1', 'umi_count_light_0', 'umi_count_light_1', 'junction_aa_heavy', 'junction_aa_light', 'status', 'status_summary', 'productive', 'productive_summary', 'isotype', 'isotype_summary', 'vdj_status', 'vdj_status_summary', 'heavychain_status_summary'\n",
       "    distance: None\n",
       "    edges: None\n",
       "    layout: None\n",
       "    graph: None"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "vdj3 = ir.io.to_dandelion(irdata2)\n",
    "vdj3"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## `scirpy` : Read from `scirpy`, convert to `dandelion`"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/kt16/miniconda3/envs/dandelion/lib/python3.7/site-packages/anndata/_core/anndata.py:1192: FutureWarning: is_categorical is deprecated and will be removed in a future version.  Use is_categorical_dtype instead\n",
      "... storing 'extra_chains' as categorical\n",
      "... storing 'IR_VJ_1_c_cigar' as categorical\n",
      "... storing 'IR_VJ_2_c_cigar' as categorical\n",
      "... storing 'IR_VDJ_1_c_cigar' as categorical\n",
      "... storing 'IR_VDJ_2_c_cigar' as categorical\n",
      "... storing 'IR_VJ_1_c_sequence_end' as categorical\n",
      "... storing 'IR_VJ_2_c_sequence_end' as categorical\n",
      "... storing 'IR_VDJ_1_c_sequence_end' as categorical\n",
      "... storing 'IR_VDJ_2_c_sequence_end' as categorical\n",
      "... storing 'IR_VJ_1_c_sequence_start' as categorical\n",
      "... storing 'IR_VJ_2_c_sequence_start' as categorical\n",
      "... storing 'IR_VDJ_1_c_sequence_start' as categorical\n",
      "... storing 'IR_VDJ_2_c_sequence_start' as categorical\n",
      "... storing 'IR_VJ_1_clone_id' as categorical\n",
      "... storing 'IR_VJ_2_clone_id' as categorical\n",
      "... storing 'IR_VDJ_1_clone_id' as categorical\n",
      "... storing 'IR_VDJ_2_clone_id' as categorical\n",
      "... storing 'IR_VJ_1_d_cigar' as categorical\n",
      "... storing 'IR_VJ_2_d_cigar' as categorical\n",
      "... storing 'IR_VDJ_1_d_cigar' as categorical\n",
      "... storing 'IR_VDJ_2_d_cigar' as categorical\n",
      "... storing 'IR_VJ_1_d_sequence_end' as categorical\n",
      "... storing 'IR_VJ_2_d_sequence_end' as categorical\n",
      "... storing 'IR_VJ_1_d_sequence_start' as categorical\n",
      "... storing 'IR_VJ_2_d_sequence_start' as categorical\n",
      "... storing 'IR_VJ_1_germline_alignment' as categorical\n",
      "... storing 'IR_VJ_2_germline_alignment' as categorical\n",
      "... storing 'IR_VDJ_1_germline_alignment' as categorical\n",
      "... storing 'IR_VDJ_2_germline_alignment' as categorical\n",
      "... storing 'IR_VJ_1_is_cell' as categorical\n",
      "... storing 'IR_VJ_2_is_cell' as categorical\n",
      "... storing 'IR_VDJ_1_is_cell' as categorical\n",
      "... storing 'IR_VDJ_2_is_cell' as categorical\n",
      "... storing 'IR_VJ_1_j_cigar' as categorical\n",
      "... storing 'IR_VJ_2_j_cigar' as categorical\n",
      "... storing 'IR_VDJ_1_j_cigar' as categorical\n",
      "... storing 'IR_VDJ_2_j_cigar' as categorical\n",
      "... storing 'IR_VJ_1_junction' as categorical\n",
      "... storing 'IR_VJ_2_junction' as categorical\n",
      "... storing 'IR_VDJ_1_junction' as categorical\n",
      "... storing 'IR_VDJ_2_junction' as categorical\n",
      "... storing 'IR_VJ_1_junction_aa' as categorical\n",
      "... storing 'IR_VJ_2_junction_aa' as categorical\n",
      "... storing 'IR_VDJ_1_junction_aa' as categorical\n",
      "... storing 'IR_VDJ_2_junction_aa' as categorical\n",
      "... storing 'IR_VJ_1_junction_aa_length' as categorical\n",
      "... storing 'IR_VJ_2_junction_aa_length' as categorical\n",
      "... storing 'IR_VDJ_1_junction_aa_length' as categorical\n",
      "... storing 'IR_VDJ_2_junction_aa_length' as categorical\n",
      "... storing 'IR_VJ_1_productive' as categorical\n",
      "... storing 'IR_VJ_2_productive' as categorical\n",
      "... storing 'IR_VDJ_1_productive' as categorical\n",
      "... storing 'IR_VDJ_2_productive' as categorical\n",
      "... storing 'IR_VJ_1_rev_comp' as categorical\n",
      "... storing 'IR_VJ_2_rev_comp' as categorical\n",
      "... storing 'IR_VDJ_1_rev_comp' as categorical\n",
      "... storing 'IR_VDJ_2_rev_comp' as categorical\n",
      "... storing 'IR_VJ_1_sequence' as categorical\n",
      "... storing 'IR_VJ_2_sequence' as categorical\n",
      "... storing 'IR_VDJ_1_sequence' as categorical\n",
      "... storing 'IR_VDJ_2_sequence' as categorical\n",
      "... storing 'IR_VJ_1_sequence_aa' as categorical\n",
      "... storing 'IR_VJ_2_sequence_aa' as categorical\n",
      "... storing 'IR_VDJ_1_sequence_aa' as categorical\n",
      "... storing 'IR_VDJ_2_sequence_aa' as categorical\n",
      "... storing 'IR_VJ_1_sequence_alignment' as categorical\n",
      "... storing 'IR_VJ_2_sequence_alignment' as categorical\n",
      "... storing 'IR_VDJ_1_sequence_alignment' as categorical\n",
      "... storing 'IR_VDJ_2_sequence_alignment' as categorical\n",
      "... storing 'IR_VJ_1_sequence_id' as categorical\n",
      "... storing 'IR_VJ_2_sequence_id' as categorical\n",
      "... storing 'IR_VDJ_1_sequence_id' as categorical\n",
      "... storing 'IR_VDJ_2_sequence_id' as categorical\n",
      "... storing 'IR_VJ_1_v_cigar' as categorical\n",
      "... storing 'IR_VJ_2_v_cigar' as categorical\n",
      "... storing 'IR_VDJ_1_v_cigar' as categorical\n",
      "... storing 'IR_VDJ_2_v_cigar' as categorical\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "AnnData object with n_obs × n_vars = 994 × 0\n",
       "    obs: 'multi_chain', 'extra_chains', 'IR_VJ_1_c_call', 'IR_VJ_2_c_call', 'IR_VDJ_1_c_call', 'IR_VDJ_2_c_call', 'IR_VJ_1_c_cigar', 'IR_VJ_2_c_cigar', 'IR_VDJ_1_c_cigar', 'IR_VDJ_2_c_cigar', 'IR_VJ_1_c_sequence_end', 'IR_VJ_2_c_sequence_end', 'IR_VDJ_1_c_sequence_end', 'IR_VDJ_2_c_sequence_end', 'IR_VJ_1_c_sequence_start', 'IR_VJ_2_c_sequence_start', 'IR_VDJ_1_c_sequence_start', 'IR_VDJ_2_c_sequence_start', 'IR_VJ_1_clone_id', 'IR_VJ_2_clone_id', 'IR_VDJ_1_clone_id', 'IR_VDJ_2_clone_id', 'IR_VJ_1_consensus_count', 'IR_VJ_2_consensus_count', 'IR_VDJ_1_consensus_count', 'IR_VDJ_2_consensus_count', 'IR_VJ_1_d_call', 'IR_VJ_2_d_call', 'IR_VDJ_1_d_call', 'IR_VDJ_2_d_call', 'IR_VJ_1_d_cigar', 'IR_VJ_2_d_cigar', 'IR_VDJ_1_d_cigar', 'IR_VDJ_2_d_cigar', 'IR_VJ_1_d_sequence_end', 'IR_VJ_2_d_sequence_end', 'IR_VDJ_1_d_sequence_end', 'IR_VDJ_2_d_sequence_end', 'IR_VJ_1_d_sequence_start', 'IR_VJ_2_d_sequence_start', 'IR_VDJ_1_d_sequence_start', 'IR_VDJ_2_d_sequence_start', 'IR_VJ_1_duplicate_count', 'IR_VJ_2_duplicate_count', 'IR_VDJ_1_duplicate_count', 'IR_VDJ_2_duplicate_count', 'IR_VJ_1_germline_alignment', 'IR_VJ_2_germline_alignment', 'IR_VDJ_1_germline_alignment', 'IR_VDJ_2_germline_alignment', 'IR_VJ_1_is_cell', 'IR_VJ_2_is_cell', 'IR_VDJ_1_is_cell', 'IR_VDJ_2_is_cell', 'IR_VJ_1_j_call', 'IR_VJ_2_j_call', 'IR_VDJ_1_j_call', 'IR_VDJ_2_j_call', 'IR_VJ_1_j_cigar', 'IR_VJ_2_j_cigar', 'IR_VDJ_1_j_cigar', 'IR_VDJ_2_j_cigar', 'IR_VJ_1_j_sequence_end', 'IR_VJ_2_j_sequence_end', 'IR_VDJ_1_j_sequence_end', 'IR_VDJ_2_j_sequence_end', 'IR_VJ_1_j_sequence_start', 'IR_VJ_2_j_sequence_start', 'IR_VDJ_1_j_sequence_start', 'IR_VDJ_2_j_sequence_start', 'IR_VJ_1_junction', 'IR_VJ_2_junction', 'IR_VDJ_1_junction', 'IR_VDJ_2_junction', 'IR_VJ_1_junction_aa', 'IR_VJ_2_junction_aa', 'IR_VDJ_1_junction_aa', 'IR_VDJ_2_junction_aa', 'IR_VJ_1_junction_aa_length', 'IR_VJ_2_junction_aa_length', 'IR_VDJ_1_junction_aa_length', 'IR_VDJ_2_junction_aa_length', 'IR_VJ_1_junction_length', 'IR_VJ_2_junction_length', 'IR_VDJ_1_junction_length', 'IR_VDJ_2_junction_length', 'IR_VJ_1_locus', 'IR_VJ_2_locus', 'IR_VDJ_1_locus', 'IR_VDJ_2_locus', 'IR_VJ_1_productive', 'IR_VJ_2_productive', 'IR_VDJ_1_productive', 'IR_VDJ_2_productive', 'IR_VJ_1_rev_comp', 'IR_VJ_2_rev_comp', 'IR_VDJ_1_rev_comp', 'IR_VDJ_2_rev_comp', 'IR_VJ_1_sequence', 'IR_VJ_2_sequence', 'IR_VDJ_1_sequence', 'IR_VDJ_2_sequence', 'IR_VJ_1_sequence_aa', 'IR_VJ_2_sequence_aa', 'IR_VDJ_1_sequence_aa', 'IR_VDJ_2_sequence_aa', 'IR_VJ_1_sequence_alignment', 'IR_VJ_2_sequence_alignment', 'IR_VDJ_1_sequence_alignment', 'IR_VDJ_2_sequence_alignment', 'IR_VJ_1_sequence_id', 'IR_VJ_2_sequence_id', 'IR_VDJ_1_sequence_id', 'IR_VDJ_2_sequence_id', 'IR_VJ_1_v_call', 'IR_VJ_2_v_call', 'IR_VDJ_1_v_call', 'IR_VDJ_2_v_call', 'IR_VJ_1_v_cigar', 'IR_VJ_2_v_cigar', 'IR_VDJ_1_v_cigar', 'IR_VDJ_2_v_cigar', 'IR_VJ_1_v_sequence_end', 'IR_VJ_2_v_sequence_end', 'IR_VDJ_1_v_sequence_end', 'IR_VDJ_2_v_sequence_end', 'IR_VJ_1_v_sequence_start', 'IR_VJ_2_v_sequence_start', 'IR_VDJ_1_v_sequence_start', 'IR_VDJ_2_v_sequence_start', 'has_ir'"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# read in the airr_rearrangement.tsv file\n",
    "file_location = 'sc5p_v2_hs_PBMC_10k/sc5p_v2_hs_PBMC_10k_b_airr_rearrangement.tsv'\n",
    "irdata_s = ir.io.read_airr(file_location)\n",
    "irdata_s"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "This time, find clones with `scirpy`'s method."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "0c4cf542ef25480c971c1de4baeca3c0",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "HBox(children=(HTML(value=''), FloatProgress(value=0.0, max=105.0), HTML(value='')))"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "5cbd9e6ad45941dfb0f0db20b72fe499",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "HBox(children=(HTML(value=''), FloatProgress(value=0.0, max=231.0), HTML(value='')))"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "6b1e510985694170bb109bf64fd4dc5f",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "HBox(children=(HTML(value=''), FloatProgress(value=1.0, bar_style='info', layout=Layout(width='20px'), max=1.0…"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "AnnData object with n_obs × n_vars = 994 × 0\n",
       "    obs: 'multi_chain', 'extra_chains', 'IR_VJ_1_c_call', 'IR_VJ_2_c_call', 'IR_VDJ_1_c_call', 'IR_VDJ_2_c_call', 'IR_VJ_1_c_cigar', 'IR_VJ_2_c_cigar', 'IR_VDJ_1_c_cigar', 'IR_VDJ_2_c_cigar', 'IR_VJ_1_c_sequence_end', 'IR_VJ_2_c_sequence_end', 'IR_VDJ_1_c_sequence_end', 'IR_VDJ_2_c_sequence_end', 'IR_VJ_1_c_sequence_start', 'IR_VJ_2_c_sequence_start', 'IR_VDJ_1_c_sequence_start', 'IR_VDJ_2_c_sequence_start', 'IR_VJ_1_clone_id', 'IR_VJ_2_clone_id', 'IR_VDJ_1_clone_id', 'IR_VDJ_2_clone_id', 'IR_VJ_1_consensus_count', 'IR_VJ_2_consensus_count', 'IR_VDJ_1_consensus_count', 'IR_VDJ_2_consensus_count', 'IR_VJ_1_d_call', 'IR_VJ_2_d_call', 'IR_VDJ_1_d_call', 'IR_VDJ_2_d_call', 'IR_VJ_1_d_cigar', 'IR_VJ_2_d_cigar', 'IR_VDJ_1_d_cigar', 'IR_VDJ_2_d_cigar', 'IR_VJ_1_d_sequence_end', 'IR_VJ_2_d_sequence_end', 'IR_VDJ_1_d_sequence_end', 'IR_VDJ_2_d_sequence_end', 'IR_VJ_1_d_sequence_start', 'IR_VJ_2_d_sequence_start', 'IR_VDJ_1_d_sequence_start', 'IR_VDJ_2_d_sequence_start', 'IR_VJ_1_duplicate_count', 'IR_VJ_2_duplicate_count', 'IR_VDJ_1_duplicate_count', 'IR_VDJ_2_duplicate_count', 'IR_VJ_1_germline_alignment', 'IR_VJ_2_germline_alignment', 'IR_VDJ_1_germline_alignment', 'IR_VDJ_2_germline_alignment', 'IR_VJ_1_is_cell', 'IR_VJ_2_is_cell', 'IR_VDJ_1_is_cell', 'IR_VDJ_2_is_cell', 'IR_VJ_1_j_call', 'IR_VJ_2_j_call', 'IR_VDJ_1_j_call', 'IR_VDJ_2_j_call', 'IR_VJ_1_j_cigar', 'IR_VJ_2_j_cigar', 'IR_VDJ_1_j_cigar', 'IR_VDJ_2_j_cigar', 'IR_VJ_1_j_sequence_end', 'IR_VJ_2_j_sequence_end', 'IR_VDJ_1_j_sequence_end', 'IR_VDJ_2_j_sequence_end', 'IR_VJ_1_j_sequence_start', 'IR_VJ_2_j_sequence_start', 'IR_VDJ_1_j_sequence_start', 'IR_VDJ_2_j_sequence_start', 'IR_VJ_1_junction', 'IR_VJ_2_junction', 'IR_VDJ_1_junction', 'IR_VDJ_2_junction', 'IR_VJ_1_junction_aa', 'IR_VJ_2_junction_aa', 'IR_VDJ_1_junction_aa', 'IR_VDJ_2_junction_aa', 'IR_VJ_1_junction_aa_length', 'IR_VJ_2_junction_aa_length', 'IR_VDJ_1_junction_aa_length', 'IR_VDJ_2_junction_aa_length', 'IR_VJ_1_junction_length', 'IR_VJ_2_junction_length', 'IR_VDJ_1_junction_length', 'IR_VDJ_2_junction_length', 'IR_VJ_1_locus', 'IR_VJ_2_locus', 'IR_VDJ_1_locus', 'IR_VDJ_2_locus', 'IR_VJ_1_productive', 'IR_VJ_2_productive', 'IR_VDJ_1_productive', 'IR_VDJ_2_productive', 'IR_VJ_1_rev_comp', 'IR_VJ_2_rev_comp', 'IR_VDJ_1_rev_comp', 'IR_VDJ_2_rev_comp', 'IR_VJ_1_sequence', 'IR_VJ_2_sequence', 'IR_VDJ_1_sequence', 'IR_VDJ_2_sequence', 'IR_VJ_1_sequence_aa', 'IR_VJ_2_sequence_aa', 'IR_VDJ_1_sequence_aa', 'IR_VDJ_2_sequence_aa', 'IR_VJ_1_sequence_alignment', 'IR_VJ_2_sequence_alignment', 'IR_VDJ_1_sequence_alignment', 'IR_VDJ_2_sequence_alignment', 'IR_VJ_1_sequence_id', 'IR_VJ_2_sequence_id', 'IR_VDJ_1_sequence_id', 'IR_VDJ_2_sequence_id', 'IR_VJ_1_v_call', 'IR_VJ_2_v_call', 'IR_VDJ_1_v_call', 'IR_VDJ_2_v_call', 'IR_VJ_1_v_cigar', 'IR_VJ_2_v_cigar', 'IR_VDJ_1_v_cigar', 'IR_VDJ_2_v_cigar', 'IR_VJ_1_v_sequence_end', 'IR_VJ_2_v_sequence_end', 'IR_VDJ_1_v_sequence_end', 'IR_VDJ_2_v_sequence_end', 'IR_VJ_1_v_sequence_start', 'IR_VJ_2_v_sequence_start', 'IR_VDJ_1_v_sequence_start', 'IR_VDJ_2_v_sequence_start', 'has_ir', 'receptor_type', 'receptor_subtype', 'chain_pairing', 'clonotype', 'clonotype_size'\n",
       "    uns: 'ir_dist_aa_hamming', 'ir_dist_nt_identity', 'clonotype'"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ir.tl.chain_qc(irdata_s)\n",
    "ir.pp.ir_dist(irdata_s, metric = 'hamming', sequence=\"aa\")\n",
    "ir.tl.define_clonotypes(irdata_s)\n",
    "irdata_s"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Dandelion class object with n_obs = 978 and n_contigs = 2093\n",
       "    data: 'c_call', 'c_cigar', 'c_sequence_end', 'c_sequence_start', 'clone_id', 'consensus_count', 'd_call', 'd_cigar', 'd_sequence_end', 'd_sequence_start', 'germline_alignment', 'is_cell', 'j_call', 'j_cigar', 'j_sequence_end', 'j_sequence_start', 'junction', 'junction_aa', 'junction_aa_length', 'junction_length', 'locus', 'productive', 'rev_comp', 'sequence', 'sequence_aa', 'sequence_alignment', 'sequence_id', 'v_call', 'v_cigar', 'v_sequence_end', 'v_sequence_start', 'cell_id', 'umi_count'\n",
       "    metadata: 'locus_heavy', 'locus_light', 'productive_heavy', 'productive_light', 'v_call_heavy', 'v_call_light', 'j_call_heavy', 'j_call_light', 'c_call_heavy', 'c_call_light', 'umi_count_heavy_0', 'umi_count_heavy_1', 'umi_count_light_0', 'umi_count_light_1', 'junction_aa_heavy', 'junction_aa_light', 'status', 'status_summary', 'productive', 'productive_summary', 'isotype', 'isotype_summary', 'vdj_status', 'vdj_status_summary', 'heavychain_status_summary'\n",
       "    distance: None\n",
       "    edges: None\n",
       "    layout: None\n",
       "    graph: None"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "vdj4 = ir.io.to_dandelion(irdata_s)\n",
    "vdj4"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Note that `clone_id` column is missing.\n",
    "\n",
    "As [@grst](https://github.com/grst) has [noted](https://github.com/icbi-lab/scirpy/pull/241#discussion_r604135056), *'Currently only the chain-specific attributes get exported (i.e. all scirpy columns that start with IR_). In principle, it probably makes sense to write out the clonotype column to clone_id. But then again, scirpy allows different versions of clonal assignments...'*. What this means is that unless the `IR_*_clone_id columns` are populated, this will not be transferred over.\n",
    "\n",
    "You can manually parse that over or use `ddl.from_scirpy`'s conversion method which will use the `clonotype` column (or `clone_id` column if already present) from the scirpy initialized `AnnData.obs` as the default `clone_id`. `clone_key` and `key_added` options can be toggled to adjust this behavior."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Dandelion class object with n_obs = 978 and n_contigs = 2093\n",
       "    data: 'c_call', 'c_cigar', 'c_sequence_end', 'c_sequence_start', 'clone_id', 'consensus_count', 'd_call', 'd_cigar', 'd_sequence_end', 'd_sequence_start', 'germline_alignment', 'is_cell', 'j_call', 'j_cigar', 'j_sequence_end', 'j_sequence_start', 'junction', 'junction_aa', 'junction_aa_length', 'junction_length', 'locus', 'productive', 'rev_comp', 'sequence', 'sequence_aa', 'sequence_alignment', 'sequence_id', 'v_call', 'v_cigar', 'v_sequence_end', 'v_sequence_start', 'cell_id', 'umi_count'\n",
       "    metadata: 'clone_id', 'clone_id_by_size', 'locus_heavy', 'locus_light', 'productive_heavy', 'productive_light', 'v_call_heavy', 'v_call_light', 'j_call_heavy', 'j_call_light', 'c_call_heavy', 'c_call_light', 'umi_count_heavy_0', 'umi_count_heavy_1', 'umi_count_light_0', 'umi_count_light_1', 'junction_aa_heavy', 'junction_aa_light', 'status', 'status_summary', 'productive', 'productive_summary', 'isotype', 'isotype_summary', 'vdj_status', 'vdj_status_summary', 'heavychain_status_summary'\n",
       "    distance: None\n",
       "    edges: None\n",
       "    layout: None\n",
       "    graph: None"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "vdj5 = ddl.from_scirpy(irdata_s)\n",
    "vdj5"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python (dandelion)",
   "language": "python",
   "name": "dandelion"
  },
  "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.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
