{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Command-line: Quick Start" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Basic usage" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### 1. Inspect input (optional)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "!head ../../tcrconvert/examples/tenx.csv | column -t -s," ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### 2. Use the `convert` subcommand" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "!tcrconvert convert \\\n", " --input ../../tcrconvert/examples/tenx.csv \\\n", " --output ../../tcrconvert/examples/converted/tenx2adapt.tsv \\\n", " --frm tenx \\\n", " --to adaptive" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**Explanation of flags used in this command**:\n", "\n", "- `--input`/`-i`: Input file (CSV or TSV)\n", "\n", "- `--output`/`-o`: Output file (CSV or TSV)\n", "\n", "- `--frm`/`-f`: Input TCR gene format (`tenx`, `adaptive`, `adaptivev2`, or `imgt`)\n", "\n", "- `--to`/`-t`: Output TCR gene format(`tenx`, `adaptive`, `adaptivev2`, or `imgt`)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "> **Tip**: Suppress INFO-level messages by setting `verbose=False`. Warnings and errors will still appear.\n", "\n", "> **Tip**: If your Adaptive data lacks `x_resolved`/`xMaxResolved` columns, create them yourself by combining the `x_gene`/`xGeneName` and `x_allele`/`xGeneAllele` columns. See the FAQs." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### 3. Inspect output (optional)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "!head ../../tcrconvert/examples/converted/tenx2adapt.tsv | column -t" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## AIRR data" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Supply the standard AIRR gene column names individually as custom columns:\n", "\n", "- `--custom`/`-c`: Custom gene column name\n", "\n", "```bash\n", "$ tcrconvert convert -i airr.csv -o out.csv --frm tenx --to imgt \\\n", " -c v_call \\\n", " -c d_call \\\n", " -c j_call \\\n", " -c c_call\n", "```" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Custom column names" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "By default, `TCRconvert` assumes these column names based on the input nomenclature (`--frm`/`-f`):\n", "\n", "- `--frm imgt` = `['v_gene', 'd_gene', 'j_gene', 'c_gene']`\n", "\n", "- `--frm tenx` = `['v_gene', 'd_gene', 'j_gene', 'c_gene']`\n", "\n", "- `--frm adaptive` = `['v_resolved', 'd_resolved', 'j_resolved']`\n", "\n", "- `--frm adaptivev2` = `['vMaxResolved', 'dMaxResolved', 'jMaxResolved']`\n", "\n", "You can override these columns using the `--custom`/`-c` flag:" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### 1. Inspect input 10X data with custom column names (optional)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "!head ../../tcrconvert/examples/customcols.csv | column -t -s," ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### 2. Convert to IMGT, specifying columns with `--custom`/`-c`" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "!tcrconvert convert \\\n", " -i ../../tcrconvert/examples/customcols.csv \\\n", " -o ../../tcrconvert/examples/converted/custom2imgt.csv \\\n", " --frm tenx \\\n", " --to imgt \\\n", " --verbose False \\\n", " -c myVgene \\\n", " -c myDgene \\\n", " -c myJgene \\\n", " -c myCgene" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### 3. Inspect output (optional)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "!head ../../tcrconvert/examples/converted/custom2imgt.csv | column -t -s," ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Rhesus or mouse data" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Use the `--species`/`-s` flag:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "!tcrconvert convert \\\n", " -i ../../tcrconvert/examples/tenx.csv \\\n", " -o ../../tcrconvert/examples/converted/tenx2adapt.tsv \\\n", " --frm tenx \\\n", " --to adaptive \\\n", " --verbose False \\\n", " -s rhesus # or mouse" ] } ], "metadata": { "kernelspec": { "display_name": "tcrconvert", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.12.4" } }, "nbformat": 4, "nbformat_minor": 2 }