{ "cells": [ { "cell_type": "markdown", "id": "e90d448e-8b8a-408c-859f-bf4e2aa930d5", "metadata": {}, "source": [ "# B cell annotations\n", "\n", "In this notebook, we upload cell type annotations assigned by our domain experts. These annotations were generated using markers and by interactive investigation of our .h5ad files.\n", "\n", "As these are derived from our .h5ad files, we'll connect them to the HISE analysis chain by chaching those files and using `hisepy.upload.upload_files()`." ] }, { "cell_type": "code", "execution_count": 1, "id": "d61a2467-035c-45e2-b0a8-c94523406816", "metadata": {}, "outputs": [], "source": [ "import hisepy\n", "from datetime import date" ] }, { "cell_type": "markdown", "id": "3d6119e2-df2a-4fed-ad82-3248b0ed3a4d", "metadata": {}, "source": [ "For B cells, this was done in two steps - all B cells that were clustered after Immunoglobulin removal, and with subclustering of non-effector memory B cells.\n", "\n", "Here, we'll combine these steps to build the link in our reproducibility chain." ] }, { "cell_type": "code", "execution_count": 2, "id": "8123c57a-c51c-4832-bc30-c7ef787cacc8", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "downloading fileID: 99f83994-26ee-49af-a882-c1f2558daed2\n", "downloading fileID: 51838754-b378-4f13-b447-82511bcd0a66\n", "Files have been successfully downloaded!\n" ] } ], "source": [ "in_files = [\n", " '99f83994-26ee-49af-a882-c1f2558daed2', # B cell .h5ad\n", " '51838754-b378-4f13-b447-82511bcd0a66' # B Memory cell focus .h5ad\n", "]\n", "hise_res = hisepy.reader.cache_files(in_files)" ] }, { "cell_type": "code", "execution_count": 3, "id": "eed57930-debb-40c4-a201-b787af10520f", "metadata": {}, "outputs": [], "source": [ "out_files = [\n", " 'annotations/pbmc_ref_b-cells-no-ig_annotations_2024-03-08.csv',\n", " 'annotations/pbmc_ref_b-cells-mem-no-ig_annotations_2024-03-08.csv'\n", "]" ] }, { "cell_type": "code", "execution_count": 4, "id": "c94c9511-5758-49aa-9171-95ea152ad99b", "metadata": {}, "outputs": [], "source": [ "study_space_uuid = '64097865-486d-43b3-8f94-74994e0a72e0'\n", "title = 'Ref. B cell annotations {d}'.format(d = date.today())" ] }, { "cell_type": "code", "execution_count": 5, "id": "b30714da-90d4-4ecd-9d6b-053e1545b070", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "annotations/pbmc_ref_b-cells-no-ig_annotations_2024-03-08.csv\n", "annotations/pbmc_ref_b-cells-mem-no-ig_annotations_2024-03-08.csv\n", "Cannot determine the current notebook.\n", "1) /home/jupyter/scRNA-Reference-IH-A/04-Annotation/12-Python_B_cell_annotations.ipynb\n", "2) /home/jupyter/scRNA-Reference-IH-A/visualizations/04-Python_other_markers.ipynb\n", "3) /home/jupyter/scRNA-Reference-IH-A/visualizations/03-Python_T_markers.ipynb\n", "Please select (1-3) \n" ] }, { "name": "stdin", "output_type": "stream", "text": [ " 1\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "you are trying to upload file_ids... ['annotations/pbmc_ref_b-cells-no-ig_annotations_2024-03-08.csv', 'annotations/pbmc_ref_b-cells-mem-no-ig_annotations_2024-03-08.csv']. Do you truly want to proceed?\n" ] }, { "name": "stdin", "output_type": "stream", "text": [ "(y/n) y\n" ] }, { "data": { "text/plain": [ "{'trace_id': '9dae5780-00b0-47c4-b148-ee2f2868bd9e',\n", " 'files': ['annotations/pbmc_ref_b-cells-no-ig_annotations_2024-03-08.csv',\n", " 'annotations/pbmc_ref_b-cells-mem-no-ig_annotations_2024-03-08.csv']}" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "hisepy.upload.upload_files(\n", " files = out_files,\n", " study_space_id = study_space_uuid,\n", " title = title,\n", " input_file_ids = in_files\n", ")" ] }, { "cell_type": "code", "execution_count": 6, "id": "ae5ad1de-b624-4727-a4bd-2a3bc3d6e313", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "Click to view session information\n", "
\n",
       "-----\n",
       "hisepy              0.3.0\n",
       "session_info        1.0.0\n",
       "-----\n",
       "
\n", "
\n", "Click to view modules imported as dependencies\n", "
\n",
       "PIL                         10.0.1\n",
       "anyio                       NA\n",
       "arrow                       1.3.0\n",
       "asttokens                   NA\n",
       "attr                        23.2.0\n",
       "attrs                       23.2.0\n",
       "babel                       2.14.0\n",
       "beatrix_jupyterlab          NA\n",
       "brotli                      NA\n",
       "cachetools                  5.3.1\n",
       "certifi                     2024.02.02\n",
       "cffi                        1.16.0\n",
       "charset_normalizer          3.3.2\n",
       "cloudpickle                 2.2.1\n",
       "colorama                    0.4.6\n",
       "comm                        0.1.4\n",
       "cryptography                41.0.7\n",
       "cycler                      0.10.0\n",
       "cython_runtime              NA\n",
       "dateutil                    2.8.2\n",
       "db_dtypes                   1.1.1\n",
       "debugpy                     1.8.0\n",
       "decorator                   5.1.1\n",
       "defusedxml                  0.7.1\n",
       "deprecated                  1.2.14\n",
       "exceptiongroup              1.2.0\n",
       "executing                   2.0.1\n",
       "fastjsonschema              NA\n",
       "fqdn                        NA\n",
       "google                      NA\n",
       "greenlet                    2.0.2\n",
       "grpc                        1.58.0\n",
       "grpc_status                 NA\n",
       "h5py                        3.10.0\n",
       "idna                        3.6\n",
       "importlib_metadata          NA\n",
       "ipykernel                   6.28.0\n",
       "ipython_genutils            0.2.0\n",
       "ipywidgets                  8.1.1\n",
       "isoduration                 NA\n",
       "jedi                        0.19.1\n",
       "jinja2                      3.1.2\n",
       "json5                       NA\n",
       "jsonpointer                 2.4\n",
       "jsonschema                  4.20.0\n",
       "jsonschema_specifications   NA\n",
       "jupyter_events              0.9.0\n",
       "jupyter_server              2.12.1\n",
       "jupyterlab_server           2.25.2\n",
       "jwt                         2.8.0\n",
       "kiwisolver                  1.4.5\n",
       "markupsafe                  2.1.3\n",
       "matplotlib                  3.8.0\n",
       "matplotlib_inline           0.1.6\n",
       "mpl_toolkits                NA\n",
       "nbformat                    5.9.2\n",
       "numpy                       1.26.2\n",
       "opentelemetry               NA\n",
       "overrides                   NA\n",
       "packaging                   23.2\n",
       "pandas                      2.1.4\n",
       "parso                       0.8.3\n",
       "pexpect                     4.8.0\n",
       "pickleshare                 0.7.5\n",
       "pkg_resources               NA\n",
       "platformdirs                4.1.0\n",
       "plotly                      5.18.0\n",
       "prettytable                 3.9.0\n",
       "prometheus_client           NA\n",
       "prompt_toolkit              3.0.42\n",
       "proto                       NA\n",
       "psutil                      NA\n",
       "ptyprocess                  0.7.0\n",
       "pure_eval                   0.2.2\n",
       "pyarrow                     13.0.0\n",
       "pydev_ipython               NA\n",
       "pydevconsole                NA\n",
       "pydevd                      2.9.5\n",
       "pydevd_file_utils           NA\n",
       "pydevd_plugins              NA\n",
       "pydevd_tracing              NA\n",
       "pygments                    2.17.2\n",
       "pyparsing                   3.1.1\n",
       "pyreadr                     0.5.0\n",
       "pythonjsonlogger            NA\n",
       "pytz                        2023.3.post1\n",
       "referencing                 NA\n",
       "requests                    2.31.0\n",
       "rfc3339_validator           0.1.4\n",
       "rfc3986_validator           0.1.1\n",
       "rpds                        NA\n",
       "send2trash                  NA\n",
       "shapely                     1.8.5.post1\n",
       "six                         1.16.0\n",
       "sniffio                     1.3.0\n",
       "socks                       1.7.1\n",
       "sql                         NA\n",
       "sqlalchemy                  2.0.21\n",
       "sqlparse                    0.4.4\n",
       "stack_data                  0.6.2\n",
       "termcolor                   NA\n",
       "tornado                     6.3.3\n",
       "tqdm                        4.66.1\n",
       "traitlets                   5.9.0\n",
       "typing_extensions           NA\n",
       "uri_template                NA\n",
       "urllib3                     1.26.18\n",
       "wcwidth                     0.2.12\n",
       "webcolors                   1.13\n",
       "websocket                   1.7.0\n",
       "wrapt                       1.15.0\n",
       "xarray                      2023.12.0\n",
       "yaml                        6.0.1\n",
       "zipp                        NA\n",
       "zmq                         25.1.2\n",
       "zoneinfo                    NA\n",
       "
\n", "
\n", "
\n",
       "-----\n",
       "IPython             8.19.0\n",
       "jupyter_client      8.6.0\n",
       "jupyter_core        5.6.1\n",
       "jupyterlab          4.1.2\n",
       "notebook            6.5.4\n",
       "-----\n",
       "Python 3.10.13 | packaged by conda-forge | (main, Dec 23 2023, 15:36:39) [GCC 12.3.0]\n",
       "Linux-5.15.0-1052-gcp-x86_64-with-glibc2.31\n",
       "-----\n",
       "Session information updated at 2024-03-09 04:56\n",
       "
\n", "
" ], "text/plain": [ "" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import session_info\n", "session_info.show()" ] }, { "cell_type": "code", "execution_count": null, "id": "74f5402b-1571-4e40-a726-37728e42cd64", "metadata": {}, "outputs": [], "source": [] } ], "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.10.13" } }, "nbformat": 4, "nbformat_minor": 5 }