{ "cells": [ { "cell_type": "markdown", "id": "8ef9e021-1b2e-4086-868a-86d7e77b6f04", "metadata": {}, "source": [ "# MERSCOPE mouse liver\n", "\n", "In this notebook, we will use ovrlpy to investigate the [Vizgen MERSCOPE's mouse liver dataset](https://info.vizgen.com/mouse-liver-data).\n", "\n", "We want to create a signal embedding of the transcriptome, and a vertical signal incoherence map to identify locations with a high risk of containing spatial doublets." ] }, { "attachments": {}, "cell_type": "markdown", "id": "c88b9df5", "metadata": {}, "source": [ "## Settings and Imports\n", "\n", "First, let's define settings and input files." ] }, { "cell_type": "code", "execution_count": 1, "id": "7f26e482-97a7-4c1b-99f6-13f86119e183", "metadata": {}, "outputs": [], "source": [ "from pathlib import Path\n", "\n", "import matplotlib.pyplot as plt\n", "\n", "import ovrlpy" ] }, { "cell_type": "code", "execution_count": 2, "id": "59c7c39e-3c57-413c-b295-dad2b315b3fa", "metadata": {}, "outputs": [], "source": [ "sample_nr = 1\n", "slice_nr = 1\n", "\n", "# TODO: adjust path\n", "data_path = Path(\"path/to/downloaded_data\") / f\"Liver{sample_nr}Slice{slice_nr}\"" ] }, { "cell_type": "markdown", "id": "e7d943a4-4ff9-4b03-83f9-a78b860a18d7", "metadata": {}, "source": [ "## Loading the data\n", "\n", "Next, we want to load the data." ] }, { "cell_type": "code", "execution_count": 3, "id": "dd6576df-592f-4c2a-8e18-9706d4a4462b", "metadata": { "scrolled": true }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Number of transcripts: 417,243,171\n" ] } ], "source": [ "coordinate_df = ovrlpy.io.read_MERSCOPE(data_path / \"detected_transcripts.csv\")\n", "\n", "print(f\"Number of transcripts: {len(coordinate_df):,}\")" ] }, { "cell_type": "code", "execution_count": 4, "id": "a02c7877-0633-4971-bef6-d9ae338bd65c", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
| x | y | z | gene |
|---|---|---|---|
| f64 | f64 | f64 | cat |
| 2506.407 | -95.45148 | 0.0 | "Comt" |
| 2531.8447 | -95.18702 | 0.0 | "Comt" |
| 2483.7969 | -91.360115 | 0.0 | "Comt" |
| 2505.7693 | -84.08165 | 0.0 | "Comt" |
| 2501.394 | -81.38709 | 0.0 | "Comt" |