{ "cells": [ { "cell_type": "markdown", "id": "2d69e5d7-3e28-4cf7-9ffc-0bd59b3aafc5", "metadata": {}, "source": [ "# Simple workflow for identifiying clones" ] }, { "cell_type": "code", "execution_count": 1, "id": "4305273e-44a0-4e7f-b020-ea96c8b270fd", "metadata": {}, "outputs": [], "source": [ "import celltag_tools as ct\n", "import pandas as pd\n", "import numpy as np\n", "\n", "import warnings\n", "warnings.filterwarnings('ignore')\n", "import scipy" ] }, { "cell_type": "code", "execution_count": 3, "id": "ebbad404-3802-4b39-b511-e2c76e32c0ff", "metadata": {}, "outputs": [], "source": [ "import pkg_resources\n", "\n", "data_path_1 = pkg_resources.resource_filename(\"celltag_tools\", \"data/parse_1.txt.gz\")\n", "data_path_2 = pkg_resources.resource_filename(\"celltag_tools\", \"data/parse_2.txt.gz\")" ] }, { "cell_type": "code", "execution_count": 4, "id": "67ecc833-d062-487a-b5b3-66eef61a083c", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "processing: /Users/kjindal/Documents/single_cell/celltag_tools/celltag_tools/data/parse_2.txt.gz\n", "Total filtered CellTag Reads: 4468269\n", "CellTag Sequencing saturation: 91.92850743766769\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "running starcode-v1.4 (last revised 2021-09-22) with 4 threads\n", "reading input files\n", "raw format detected\n", "sorting\n", "progress: 100.00%\n", "spheres clustering\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Creating CellTagData object and setting ct_reads, thresholds, and seq_sat\n" ] } ], "source": [ "ct_obj = ct.tl.read_celltag(data_path_2, starcode_path=\"../../starcode/\", assay='RNA',\n", " allowlist_path=\"../../18N-multi-v1-allowlist.csv\", inplace=True)" ] }, { "cell_type": "code", "execution_count": 5, "id": "6efeca15-174c-434f-a65f-cb1cbd4a1c37", "metadata": {}, "outputs": [], "source": [ "ct.tl.create_allow_mtx(ct_obj)" ] }, { "cell_type": "code", "execution_count": 6, "id": "41b63b53-5ef8-41be-9114-a49996026431", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(<74575x20202 sparse matrix of type ''\n", " \twith 149745 stored elements in Compressed Sparse Row format>,\n", " array(['AAACCCAAGAGCATCG-1', 'AAACCCAAGATCACCT-1', 'AAACCCAAGATCGCTT-1',\n", " ..., 'TTTGTTGGTTACCCAA-1', 'TTTGTTGGTTCATCTT-1',\n", " 'TTTGTTGGTTTGCAGT-1'], dtype=''\n", " \twith 17223 stored elements in Compressed Sparse Row format>,\n", " array(['AAACCCAAGAGCATCG-1', 'AAACCCAAGATCGCTT-1', 'AAACCCACAAGATGTA-1',\n", " ..., 'TTTGTTGCAGCAGATG-1', 'TTTGTTGCAGTGTGGA-1',\n", " 'TTTGTTGGTGCATTTG-1'], dtype='" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "ct.pl.diagnostic_plots(ct_obj, 'metric')" ] }, { "cell_type": "code", "execution_count": 11, "id": "c59cce89-a78e-474d-99f9-17aeea86a946", "metadata": {}, "outputs": [], "source": [ "ct_obj.save(\"celltag_obj_reprogramming.pkl\")" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "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.9.20" } }, "nbformat": 4, "nbformat_minor": 5 }