├── README.md ├── annotations ├── Allen_MERFISH_Layers.geojson ├── Allen_MERFISH_annotations_and_data_updates.ipynb ├── Allen_MERFISH_annotations_geo.json ├── Allen_smFISH_annotations_geo.json ├── BARISTAseq_annotations.json ├── Cell_Data_Annotation_BARISTASeq.ipynb ├── Cell_Data_Annotation_ISS_mouse.ipynb ├── ISS_layer_Annotation_new_6_layers.json ├── MERFISH_layer_annotation_7_layers_no_gap.json ├── MERFISH_layer_annotation_7_layers_no_gap_um.json ├── SpaceJam_Data_Annotation_Allen_smFISH.ipynb ├── SpaceJam_Data_Annotation_Allen_smFISH_update.ipynb ├── SpaceJam_Data_Annotation_ISS.ipynb ├── Spot_Data_Annotation_Allen_MERFISH.ipynb ├── Spot_Data_Annotation_BARISTASeq.ipynb ├── Spot_Data_Annotation_osmFISH.ipynb ├── Using_Allen_MERFISH_Annotation.ipynb ├── annotated_smFISH_cells.csv ├── exSeq_annotations.json ├── exSeq_annotations2.json ├── exseq_jeremy_pciseq_renee_eeshit_consensus_df_with_annotations.csv ├── osmFISH_layer_Annotation_new_6_layers.json └── smFISH_layer_annotation_6_layers.json ├── cellxgene ├── Allen_MERFISH_df_geom_mean.csv ├── Allen_MERFISH_df_geom_mean_LAYER_ANNOTATIONS.csv ├── Allen_MERFISH_df_neg_weight.csv └── Allen_MERFISH_df_neg_weight_LAYER_ANNOTATIONS.csv ├── gene_lists ├── BARISTASEQ_genes.csv ├── DARTFISH_genes.csv ├── ISS_genes.csv ├── MERFISH_genes.csv ├── MERFISH_nonBarcoded.csv ├── exseq_genes.csv ├── file_list.csv ├── osmFISH_excitatory_genes.csv ├── osmFISH_inhibitory_genes.csv └── seqfish_genes.csv └── mouseVISp_cluster_summary.csv /README.md: -------------------------------------------------------------------------------- 1 | ## Background: 2 | This repo houses links to data for the SpaceTx Spacejam hackathons. If you have questions on the contents of the table below, please make an issue [here](https://github.com/spacetx-spacejam/data/issues). Updates on the SpaceTx wrapup and related publications will be announced here- stay tuned! 3 | 4 | ### Spacetx SpaceJam data 5 | | | Method |species| N datasets|gene list|spot table| cell x gene | notes| 6 | | ----: | ---- | ---- | ---- | ---- | ---- | --- | --- | 7 | | 1 |DARTFISH| *M. musculus* and *H. sapiens*| | [DARTFISH_genes](https://github.com/spacetx-spacejam/data/blob/master/gene_lists/DARTFISH_genes.csv)|[SpotTable Human 1 (frontal cortex)](https://s3.amazonaws.com/starfish.data.spacetx/spacejam2/DARTFISH/DARTFISH_DecodedSpots_Hs_FCtx_20180122.csv) [SpotTable Human 2 (occipital cortex)](https://s3.amazonaws.com/starfish.data.spacetx/spacejam2/DARTFISH/DARTFISH_DecodedSpots_Hs_OCtx_20180122.csv), [SpotTable Mouse 1](https://s3.amazonaws.com/starfish.data.spacetx/spacejam2/DARTFISH/DARTFISH_DecodedSpots_Mm_20190513_rev2.csv)|[CellxGene Human (frontal cortex) 1](https://s3.amazonaws.com/starfish.data.spacetx/spacejam2/DARTFISH/DARTFISH_CellxGene_Hs_FCtx_20180122_T.csv), [CellxGene Human 2 (occipital cortex)](https://s3.amazonaws.com/starfish.data.spacetx/spacejam2/DARTFISH/DARTFISH_CellxGene_Hs_OCtx_20180122_T.csv) [CellxGene Mouse 1](https://s3.amazonaws.com/starfish.data.spacetx/spacejam2/DARTFISH/DARTFISH_CellxGenes_Mm_20190513_rev2_T.csv) | [stitched DAPI for Mouse dataset](https://s3.amazonaws.com/starfish.data.spacetx/spacejam2/DARTFISH/DARTFISH_StitchedNuclei_Mm_20190513_rev2.tif) 8 | | 2 |MERFISH (Zhuang: MOp) | *M. musculus* | | [MERFISH_genes](https://github.com/spacetx-spacejam/data/blob/master/gene_lists/MERFISH_genes.csv)| | | 9 | | 3 |osmFISH| *M. musculus*| | [osmFISH_inhibitory_genes (mouse VISp)](https://github.com/spacetx-spacejam/data/blob/master/gene_lists/osmFISH_inhibitory_genes.csv), [osmFISH_excitatory_genes (mouse VISp)](https://github.com/spacetx-spacejam/data/blob/master/gene_lists/osmFISH_excitatory_genes.csv)|[New and Improved Data: excitatory](https://s3.amazonaws.com/starfish.data.spacetx/spacejam2/osmfish/osmFISH_excitatory_neurons_dataset.csv) [New and Improved Data: inhibitory](https://s3.amazonaws.com/starfish.data.spacetx/spacejam2/osmfish/osmFISH_inhibitory_neurons_dataset.csv)|*needs segmentation!*|[DAPI_excitatory_roi1_0-125_126-219](https://www.dropbox.com/s/0jpy2vnkjx9ppuj/DAPI_Excitatory_roi1_0-125_roi_126-219.zip?dl=0),[PolyT_excitatory_roi1_0-125_126-219](https://www.dropbox.com/s/ru0n11y2cfa88xu/PolyT_Excitatory_roi1_0-125_roi_126-219.zip?dl=0) 10 | | 4 |BARISTASeq| *M. musculus*| | [BARISTASeq_genes](https://github.com/spacetx-spacejam/data/blob/master/gene_lists/BARISTASEQ_genes.csv)|[SpotTable Mouse VISp](https://s3.amazonaws.com/starfish.data.spacetx/spacejam2/BARISTASEQ/all_spots_2_with_annotation.csv)|[CellxGene Mouse VISp](https://s3.amazonaws.com/starfish.data.spacetx/spacejam2/BARISTASEQ/cellxgene2_with_depth.csv)|[layer annotations](https://s3.amazonaws.com/starfish.data.spacetx/spacejam2/BARISTASEQ/annotations_geo.json) 11 | | 5 |ISS| *M. musculus* and *H. sapiens*| | [ISS_genes](https://github.com/spacetx-spacejam/data/blob/master/gene_lists/ISS_genes.csv)|[SpotTable Human 1 MTG(FOVs 540)](https://drive.google.com/file/d/17BaHMKY8k96wr8IPmrbN1McfX3_8PIZx/view) [SpotTable Mouse 1 VISp (FOVs 704)](https://drive.google.com/file/d/1OSGKWvO2E8Foq74_9h9vhnlbZ8CQtuDT/view) [SpotTable Human MTG 2 (FOVs 460)](https://s3.amazonaws.com/starfish.data.spacetx/spacejam2/ISS/ISS_1_spot_table.csv) [SpotTable Mouse VISp 2 (FOVs 140)](https://s3.amazonaws.com/starfish.data.spacetx/spacejam2/ISS/ISS_2_spot_table.csv) [SpotTable Mouse VISp 3 (FOVs 143)](https://s3.amazonaws.com/starfish.data.spacetx/spacejam2/ISS/ISS_3_spot_table.csv) [SpotTable Human MTG 3 (FOVs 378)](https://drive.google.com/open?id=15xHiftBM-esR5qijaNEMzD_QlzFTARP3) [SpotTable Human MTG 4 (FOVs 621)](https://drive.google.com/open?id=1iZwNZ7HRi8FguLhRbiZg61r43d7pPkvt)|[cellxgene Human MTG 1 (FOVs 540)](https://drive.google.com/open?id=1VjGa0QGHFRMRLQRAP1PGCkMjEVFVB_g5) [cellxgene Mouse VISp 1 (FOVs 704)](https://drive.google.com/open?id=1-o5Z4q1MMMa05Z6YZvgHEb6vNbRMBh8F) [cellxgene Human MTG 2 (FOVs 460)](https://drive.google.com/open?id=1uPo87acN9zsnQ3ezRnwfbq7m3B1wxcO0) [cellxgene Mouse VISp 2 (FOVs 140)](https://drive.google.com/open?id=1v5pwa1dgQk8x5W-ryXAyi9WbKNpFHGdG) [cellxgene Mouse VISp 3 (FOVs 143)](https://drive.google.com/open?id=1IYj3Nx5swsZwBy8rUouBsirV4unlSEzn) [cellxgene Human MTG 3 (FOVs 378)](https://drive.google.com/open?id=1l1fLPA1daH_63jBnFoH0h2EbWsWID1IT) [cellxgene Human MTG 4 (FOVs 621)](https://drive.google.com/open?id=1NM_e2UpdBYXQ5ZlYFrGO9bY3NeV_H9bk) [Viktors genexcell](https://docs.google.com/spreadsheets/d/1Y_TapftVtEOo5JMtndVqct1lTw0hQOau35aPtdSjsTE/edit?usp=sharing). *|[DAPI Human 1 (FOVs 540)](https://drive.google.com/open?id=1tSpLXelKKVdU9zgN1neED6sVmz7Fc2fy) [DAPI Mouse 1 (FOVs 704)](https://drive.google.com/open?id=1ugNjkV5nDKcbh1T_SfiHtjnVEBiEhIMD) [DAPI Human 2 (FOVs 460)](https://drive.google.com/open?id=1kAULmZOgPIMLnRd65nyhlePk6odfqYg_) [DAPI Mouse 2 (FOVs 140)](https://drive.google.com/open?id=1KqPotQuFq7LAxLUam9UHe9FWZqn4grOk) [DAPI Mouse 3 (FOVs 143)](https://drive.google.com/open?id=1D71kiqhuqSgVbvr33dC_9lMPOKdDuQiI) [DAPI Human 3 (FOVs 378)](https://drive.google.com/open?id=1KsfrceNq9XagF0lpaF_g-dIuvZWsyHKd) [DAPI Human 4 (FOVs 621)](https://drive.google.com/open?id=1ydnHC8ZwEHrab3Uqhu1GVpEG0DAknXpd) 12 | | 6 |ExSeq| *M. musculus*| | [ExSeq](https://github.com/spacetx-spacejam/data/blob/master/gene_lists/exseq_genes.csv)|[spot table](https://s3.amazonaws.com/starfish.data.spacetx/spacejam2/ExSeq/spottable_exseq.csv)|[CellxGene Table mouse](https://s3.amazonaws.com/starfish.data.spacetx/spacejam2/ExSeq/cellxgene.csv)||*...working on it...* 13 | | 7 |SeqFISH| *M. musculus*| | [SeqFISH](https://github.com/spacetx-spacejam/data/blob/master/gene_lists/seqfish_genes.csv)|[SeqFISH spot table](https://s3.amazonaws.com/starfish.data.spacetx/spacejam2/seqfish/seqFISH_spots_with_anatomy_microns.csv)|[SeqFISH cell x gene (Cai lab)](https://s3.amazonaws.com/starfish.data.spacetx/spacejam2/seqfish/seqFISH_cellxgene_with_anatomy.csv)|*note: gene names in all lowercase (e.g. "sst", "gad1") are non-barcoded and have clearer spatial structure.* 14 | | 8 |MERFISH (Allen: VISp, same panel as Zhuang lab above) | *M. musculus*| | [MERFISH_genes](https://github.com/spacetx-spacejam/data/blob/master/gene_lists/MERFISH_genes.csv)|[SpotTable Mouse VISp *with anatomy*](https://s3.amazonaws.com/starfish.data.spacetx/spacejam2/MERFISH_Allen_VISp/Allen_MERFISH_spots_with_anatomy.csv)|[CellxGene Mouse VISp](https://s3.amazonaws.com/starfish.data.spacetx/spacejam2/MERFISH_Allen_VISp/fixed_1001844875.csv)|[stitched DAPI MIP](https://s3.amazonaws.com/starfish.data.spacetx/spacejam2/MERFISH_Allen_VISp/DAPI_Overview.tif) 15 | |9|Allen smFISH VISp, (spacejam1)|*M. musculus*||[smfish_genes](https://s3.amazonaws.com/starfish.data.spacetx/spacejam2/smFISH_Allen/gene_list.csv)|[SpotTable Mouse VISp](https://s3.amazonaws.com/starfish.data.spacetx/spacejam2/smFISH_Allen/smFISH_MCT_CZI_Panel_0_spot_table.csv)||[nucleus segmentation (geojson)](https://s3.amazonaws.com/starfish.data.spacetx/spacejam2/smFISH_Allen/SongLinROIS_deduplicated.json) 16 | |10|10x-Visium/ST| *M. musculus*|n/a|n/a|[observation x gene table 1](https://s3.amazonaws.com/starfish.data.spacetx/spacejam2/spatial-transcriptomics-alma/Allen-1-count-matrix.tsv.gz), [observation x gene table 2](https://s3.amazonaws.com/starfish.data.spacetx/spacejam2/spatial-transcriptomics-alma/Allen-2-count-matrix.tsv.gz), [observation x gene table 3](https://s3.amazonaws.com/starfish.data.spacetx/spacejam2/spatial-transcriptomics-alma/Allen-3-count-matrix.tsv.gz), [observation x gene table 4](https://s3.amazonaws.com/starfish.data.spacetx/spacejam2/spatial-transcriptomics-alma/Allen-4-count-matrix.tsv.gz)||*each file is a gzipped tsv* [Example analysis](https://github.com/almaan/spacetx) 17 | |11|Slide-seq||||||*have lots of data, need help wrangling!* 18 | -------------------------------------------------------------------------------- /annotations/Allen_MERFISH_Layers.geojson: -------------------------------------------------------------------------------- 1 | {"type": "GeometryCollection", "geometries": [{"type": "Polygon", "name": "L1", "coordinates": [[[2435.069566, 6500.284703], [2476.390162, 6535.178868], [2534.993939, 6471.307336], [2743.287325, 6256.796237], [2892.512438, 6045.393994], [3110.132394, 5597.718655], [3175.960311, 5399.368749], [3130.896017, 5374.899385], [3077.489401, 5557.30352], [2850.542875, 6011.196572], [2712.19876, 6214.826674], [2493.024376, 6434.001058], [2435.069566, 6500.284703]]]}, {"type": "Polygon", "name": "L4", "coordinates": [[[2099.296063, 6218.987584], [2143.972428, 6257.045228], [2145.859029, 6257.045228], [2146.338866, 6256.459168], [2151.558392, 6260.866921], [2210.003484, 6332.509292], [2221.323093, 6321.189682], [2222.09221, 6320.430889], [2259.341867, 6351.887251], [2357.789117, 6236.588669], [2668.674769, 5824.665181], [2827.226451, 5490.463105], [2914.2115, 5257.242323], [2873.763161, 5235.279366], [2874.087247, 5234.50716], [2845.513743, 5219.940275], [2776.791914, 5182.625157], [2600.279926, 5537.095953], [2404.421965, 5857.308174], [2099.296063, 6218.987584]]]}, {"type": "Polygon", "name": "L5", "coordinates": [[[1915.9413, 6061.89444], [1940.749011, 6082.843905], [1940.219455, 6083.477881], [2099.296063, 6218.987584], [2404.421965, 5857.308174], [2600.279926, 5537.095953], [2776.791914, 5182.625157], [2524.716288, 5045.751152], [2468.153524, 5171.805312], [2258.305709, 5529.323812], [1917.88592, 6059.383848], [1915.9413, 6061.89444]]]}, {"type": "Polygon", "name": "L6a", "coordinates": [[[1751.729672, 5923.22201], [1915.9413, 6061.89444], [1917.88592, 6059.383848], [2258.305709, 5529.323812], [2468.153524, 5171.805312], [2524.716288, 5045.751152], [2356.035402, 4954.159479], [2281.622133, 5132.944606], [2135.505877, 5387.87084], [1911.668207, 5717.409631], [1751.729672, 5923.22201]]]}, {"type": "Polygon", "name": "L6b", "coordinates": [[[1685.872345, 5868.689447], [1743.695193, 5916.437102], [1751.729672, 5923.22201], [1911.668207, 5717.409631], [2135.505877, 5387.87084], [2281.622133, 5132.944606], [2356.035402, 4954.159479], [2299.438471, 4923.428033], [2295.815906, 4922.282422], [2190.900796, 5146.937604], [2029.934809, 5399.884154], [1792.318353, 5710.318557], [1685.872345, 5868.689447]]]}, {"type": "Polygon", "coordinates": [[[2259.341867, 6351.887251], [2435.069566, 6500.284703], [2493.024376, 6434.001058], [2712.19876, 6214.826674], [2850.542875, 6011.196572], [3077.489401, 5557.30352], [3130.896017, 5374.899385], [2914.2115, 5257.242323], [2827.226451, 5490.463105], [2668.674769, 5824.665181], [2357.789117, 6236.588669], [2259.341867, 6351.887251]]], "name": "Layer 2/3"}]} -------------------------------------------------------------------------------- /annotations/Allen_MERFISH_annotations_and_data_updates.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "## This notebook \n", 8 | "- loads Christoffer's gapless layer boundaries\n", 9 | "- combines \"layer 2\" and \"layer 3\" into the conventional L2/3\n", 10 | "- squares off the ends of the dataset to make sure all cells are within VISp\n", 11 | "- loads the two combined cell mapping results\n", 12 | "- corrects their `(x,y)` coordinates into microns\n", 13 | "- saves new files with the subset of cells within VISp\n", 14 | "\n" 15 | ] 16 | }, 17 | { 18 | "cell_type": "code", 19 | "execution_count": 1, 20 | "metadata": {}, 21 | "outputs": [ 22 | { 23 | "data": { 24 | "text/html": [ 25 | "" 26 | ], 27 | "text/plain": [ 28 | "" 29 | ] 30 | }, 31 | "metadata": {}, 32 | "output_type": "display_data" 33 | } 34 | ], 35 | "source": [ 36 | "%gui qt\n", 37 | "import napari\n", 38 | "import pandas as pd\n", 39 | "import numpy as np\n", 40 | "from IPython.core.display import display, HTML\n", 41 | "display(HTML(\"\"))\n", 42 | "from shapely.geometry import Polygon, Point,LineString, mapping\n", 43 | "from shapely.ops import cascaded_union\n", 44 | "from spacetx_spatial_analysis import polyToGeoJson\n", 45 | "import json\n", 46 | "import geojson" 47 | ] 48 | }, 49 | { 50 | "cell_type": "markdown", 51 | "metadata": {}, 52 | "source": [ 53 | "## Load a cell x gene table" 54 | ] 55 | }, 56 | { 57 | "cell_type": "code", 58 | "execution_count": 2, 59 | "metadata": {}, 60 | "outputs": [], 61 | "source": [ 62 | "# load one cellxgene table\n", 63 | "all_cells_geom_mean = pd.read_csv(\"/Users/brian/work/data/data/cellxgene/Allen_MERFISH_df_geom_mean.csv\")\n", 64 | "all_cells_neg_weight = pd.read_csv(\"/Users/brian/work/data/data/cellxgene/Allen_MERFISH_df_neg_weight.csv\")\n" 65 | ] 66 | }, 67 | { 68 | "cell_type": "code", 69 | "execution_count": 3, 70 | "metadata": {}, 71 | "outputs": [], 72 | "source": [ 73 | "# fix the spatial coordinates- somehow the physical coordinates got lost in Viktor's mapping?\n", 74 | "all_cells_geom_mean[\"x_um\"] = all_cells_geom_mean[\"x\"]*0.1078+ 1154.\n", 75 | "all_cells_geom_mean[\"y_um\"] = all_cells_geom_mean[\"y\"]*0.1078+ 4548.\n", 76 | "\n", 77 | "\n", 78 | "all_cells_neg_weight[\"x_um\"] = all_cells_neg_weight[\"x\"]*0.1078+ 1154.\n", 79 | "all_cells_neg_weight[\"y_um\"] = all_cells_neg_weight[\"y\"]*0.1078+ 4548.\n" 80 | ] 81 | }, 82 | { 83 | "cell_type": "markdown", 84 | "metadata": {}, 85 | "source": [ 86 | "## Load Christoffer's annotations" 87 | ] 88 | }, 89 | { 90 | "cell_type": "code", 91 | "execution_count": 6, 92 | "metadata": {}, 93 | "outputs": [], 94 | "source": [ 95 | "with open(\"/Users/brian/work/data/data/annotations/MERFISH_layer_annotation_7_layers_no_gap.json\",'r') as r:\n", 96 | " cml_annotations = geojson.load(r)\n", 97 | "# these need to be converted to microns as well:\n", 98 | "for geo in cml_annotations:\n", 99 | " shape_coordinates = np.array(geo[\"coordinates\"][0])\n", 100 | " shape_coordinates[:,0] = shape_coordinates[:,0]*0.1078+ 1154.\n", 101 | " shape_coordinates[:,1] = shape_coordinates[:,1]*0.1078+ 4548.\n", 102 | " geo[\"coordinates\"][0] = [[shape_coordinates[i,0],shape_coordinates[i,1]] for i in range(shape_coordinates.shape[0])]\n", 103 | " \n", 104 | "# and save revised version to disk:\n", 105 | "\n", 106 | "with open(\"/Users/brian/work/data/data/annotations/MERFISH_layer_annotation_7_layers_no_gap_um.json\", 'w') as w:\n", 107 | " geojson.dump(cml_annotations, w)" 108 | ] 109 | }, 110 | { 111 | "cell_type": "markdown", 112 | "metadata": {}, 113 | "source": [ 114 | "## Make a napari viewer..." 115 | ] 116 | }, 117 | { 118 | "cell_type": "code", 119 | "execution_count": 4, 120 | "metadata": {}, 121 | "outputs": [], 122 | "source": [ 123 | "v = napari.Viewer()" 124 | ] 125 | }, 126 | { 127 | "cell_type": "code", 128 | "execution_count": 5, 129 | "metadata": {}, 130 | "outputs": [], 131 | "source": [ 132 | "# add cell locations\n", 133 | "cell_plots = v.add_points(all_cells_geom_mean[[\"x_um\",\"y_um\"]], symbol='disc',\n", 134 | " name = \"all_cells_geom_mean\",edge_color= [0,0,0,0], size = 10.5,\n", 135 | " face_color= 'b' , blending = \"translucent\", opacity = 0.8)" 136 | ] 137 | }, 138 | { 139 | "cell_type": "code", 140 | "execution_count": null, 141 | "metadata": {}, 142 | "outputs": [], 143 | "source": [ 144 | "# Christoffer's annotations.\n", 145 | "# note that these need to be converted to microns as well\n", 146 | "for geo in cml_annotations:\n", 147 | " shape_coordinates = np.array(geo[\"coordinates\"][0])\n", 148 | "\n", 149 | " v.add_shapes([shape_coordinates] ,\n", 150 | " shape_type='polygon',\n", 151 | " edge_width=1,\n", 152 | " edge_color='coral',\n", 153 | " face_color='royalblue',\n", 154 | " name=geo[\"name\"])" 155 | ] 156 | }, 157 | { 158 | "cell_type": "code", 159 | "execution_count": 7, 160 | "metadata": {}, 161 | "outputs": [], 162 | "source": [ 163 | "# Brian's annotations are generally in agreement on the layers, but limited the data to within VISp\n", 164 | "with open(\"/Users/brian/Allen_MERFISH_annotations_geo.json\",'r') as r:\n", 165 | " shapejson = geojson.load(r)\n", 166 | " \n", 167 | "#last element in the geojson file is the column axis, so ignore it for now\n", 168 | "layer_annotations = shapejson[\"geometries\"][:-1]" 169 | ] 170 | }, 171 | { 172 | "cell_type": "code", 173 | "execution_count": null, 174 | "metadata": {}, 175 | "outputs": [], 176 | "source": [ 177 | "layer_annotations" 178 | ] 179 | }, 180 | { 181 | "cell_type": "code", 182 | "execution_count": null, 183 | "metadata": {}, 184 | "outputs": [], 185 | "source": [ 186 | "for geo in layer_annotations:\n", 187 | " shape_coordinates = np.array(geo[\"coordinates\"][0])\n", 188 | " v.add_shapes([shape_coordinates] ,\n", 189 | " shape_type='polygon',\n", 190 | " edge_width=1,\n", 191 | " edge_color='coral',\n", 192 | " face_color='royalblue',\n", 193 | " name=geo[\"name\"])" 194 | ] 195 | }, 196 | { 197 | "cell_type": "markdown", 198 | "metadata": {}, 199 | "source": [ 200 | "## use `shapely` to assign regions to cells" 201 | ] 202 | }, 203 | { 204 | "cell_type": "code", 205 | "execution_count": null, 206 | "metadata": {}, 207 | "outputs": [], 208 | "source": [ 209 | "# we need to label all the cells with Christoffer's layers (except the 2/3 thing) but cut off the region boundaries according to Brian's VISp boundary:\n", 210 | "\n", 211 | "# first identify those inside Brian's VISp boundary\n", 212 | "cell_is_in_layer = {p[\"name\"]:[Polygon(p[\"coordinates\"][0]).intersects(Point(a)) \n", 213 | " for a in all_cells_geom_mean[[\"x_um\",\"y_um\"]].values] for ii,p in enumerate(layer_annotations) }\n", 214 | "\n", 215 | "\n", 216 | "all_cells_geom_mean[\"layer\"] = \"outside_VISp\"\n", 217 | "for k in cell_is_in_layer.keys():\n", 218 | " all_cells_geom_mean.loc[cell_is_in_layer[k],[\"layer\"]] = k\n", 219 | "\n", 220 | "# now assign layer values based on Christoffer's layers:\n", 221 | "cell_is_in_layer = {p[\"name\"]:[Polygon(p[\"coordinates\"][0]).intersects(Point(a[0:2])) and a[2] not in \"outside_VISp\"\n", 222 | " for a in all_cells_geom_mean[[\"x_um\",\"y_um\",\"layer\"]].values] for ii,p in enumerate(cml_annotations) }\n", 223 | "\n", 224 | "for k in cell_is_in_layer.keys():\n", 225 | " if \"L2\" in k or \"L3\" in k:\n", 226 | " \n", 227 | " all_cells_geom_mean.loc[cell_is_in_layer[k],[\"layer\"]] = \"L2/3\"\n", 228 | " else:\n", 229 | " all_cells_geom_mean.loc[cell_is_in_layer[k],[\"layer\"]] = k\n", 230 | " \n", 231 | " \n", 232 | " \n", 233 | "# eliminate cells outside VISp:\n", 234 | "all_cells_geom_mean = all_cells_geom_mean[all_cells_geom_mean[\"layer\"] != \"outside_VISp\"]\n" 235 | ] 236 | }, 237 | { 238 | "cell_type": "code", 239 | "execution_count": null, 240 | "metadata": {}, 241 | "outputs": [], 242 | "source": [ 243 | "## repeat for the other combined annotation result :\n", 244 | "\n", 245 | "# first identify those inside Brian's VISp boundary\n", 246 | "cell_is_in_layer_neg_weight = {p[\"name\"]:[Polygon(p[\"coordinates\"][0]).intersects(Point(a)) \n", 247 | " for a in all_cells_neg_weight[[\"x_um\",\"y_um\"]].values] for ii,p in enumerate(layer_annotations) }\n", 248 | "\n", 249 | "\n", 250 | "all_cells_neg_weight[\"layer\"] = \"outside_VISp\"\n", 251 | "for k in cell_is_in_layer_neg_weight.keys():\n", 252 | " all_cells_neg_weight.loc[cell_is_in_layer_neg_weight[k],[\"layer\"]] = k\n", 253 | "\n", 254 | "# now assign layer values based on Christoffer's layers:\n", 255 | "cell_is_in_layer_neg_weight = {p[\"name\"]:[Polygon(p[\"coordinates\"][0]).intersects(Point(a[0:2])) and a[2] not in \"outside_VISp\"\n", 256 | " for a in all_cells_neg_weight[[\"x_um\",\"y_um\",\"layer\"]].values] for ii,p in enumerate(cml_annotations) }\n", 257 | "\n", 258 | "for k in cell_is_in_layer_neg_weight.keys():\n", 259 | " if \"L2\" in k or \"L3\" in k:\n", 260 | " \n", 261 | " all_cells_neg_weight.loc[cell_is_in_layer_neg_weight[k],[\"layer\"]] = \"L2/3\"\n", 262 | " else:\n", 263 | " all_cells_neg_weight.loc[cell_is_in_layer_neg_weight[k],[\"layer\"]] = k\n", 264 | " \n", 265 | " \n", 266 | "# eliminate cells outside VISp:\n", 267 | "all_cells_neg_weight = all_cells_neg_weight.loc[all_cells_neg_weight[\"layer\"] != \"outside_VISp\"]\n" 268 | ] 269 | }, 270 | { 271 | "cell_type": "code", 272 | "execution_count": null, 273 | "metadata": {}, 274 | "outputs": [], 275 | "source": [ 276 | "# save these results to .csv files\n", 277 | "all_cells_geom_mean.to_csv(\"/Users/brian/work/data/data/cellxgene/Allen_MERFISH_df_geom_mean_LAYER_ANNOTATIONS.csv\", index = False)\n", 278 | "\n", 279 | "all_cells_neg_weight.to_csv(\"/Users/brian/work/data/data/cellxgene/Allen_MERFISH_df_neg_weight_LAYER_ANNOTATIONS.csv\", index = False)" 280 | ] 281 | }, 282 | { 283 | "cell_type": "markdown", 284 | "metadata": {}, 285 | "source": [ 286 | "## alternatively, merge the annotations to create a single geojson:\n", 287 | "\n", 288 | "\n" 289 | ] 290 | }, 291 | { 292 | "cell_type": "code", 293 | "execution_count": 8, 294 | "metadata": {}, 295 | "outputs": [], 296 | "source": [ 297 | "L23Poly = cascaded_union([Polygon( cml_annotations[1][\"coordinates\"][0]),Polygon( cml_annotations[2][\"coordinates\"][0])])\n", 298 | "L23geojson = geojson.Polygon(L23Poly.exterior.coords)\n", 299 | "L23geojson[\"name\"] = \"Layer 2/3\"\n", 300 | "L23geojson[\"coordinates\"] = [L23geojson[\"coordinates\"]]\n", 301 | "final_annotations = [annot for annot in cml_annotations if annot[\"name\"] not in [\"L2_polygon_uncut\", \"L3_polygon_uncut\"]]\n", 302 | "final_annotations.append(L23geojson)\n", 303 | "annotation_gc = geojson.GeometryCollection(final_annotations)\n", 304 | "VISpPoly = cascaded_union([Polygon( annot[\"coordinates\"][0]) for annot in layer_annotations])" 305 | ] 306 | }, 307 | { 308 | "cell_type": "code", 309 | "execution_count": 9, 310 | "metadata": {}, 311 | "outputs": [], 312 | "source": [ 313 | "outputPolys = [VISpPoly.intersection( Polygon(annot[\"coordinates\"][0])) for annot in annotation_gc[\"geometries\"]]\n", 314 | "for ii,op in enumerate(annotation_gc[\"geometries\"]):\n", 315 | " op[\"coordinates\"][0] = geojson.Polygon(outputPolys[ii].exterior.coords)[\"coordinates\"]\n", 316 | " if \"polygon_uncut\" in op[\"name\"]:\n", 317 | " op[\"name\"] = op[\"name\"].split(\"_polygon_uncut\")[0]" 318 | ] 319 | }, 320 | { 321 | "cell_type": "code", 322 | "execution_count": 10, 323 | "metadata": {}, 324 | "outputs": [], 325 | "source": [ 326 | "with open(\"Allen_MERFISH_Layers.geojson\", 'w') as w:\n", 327 | " geojson.dump(annotation_gc, w)" 328 | ] 329 | }, 330 | { 331 | "cell_type": "code", 332 | "execution_count": 8, 333 | "metadata": {}, 334 | "outputs": [], 335 | "source": [ 336 | "for geo in annotation_gc[\"geometries\"]:\n", 337 | " shape_coordinates = np.array(geo[\"coordinates\"][0])\n", 338 | " v.add_shapes([shape_coordinates] ,\n", 339 | " shape_type='polygon',\n", 340 | " edge_width=1,\n", 341 | " edge_color='coral',\n", 342 | " face_color='royalblue',\n", 343 | " name=geo[\"name\"])" 344 | ] 345 | }, 346 | { 347 | "cell_type": "code", 348 | "execution_count": null, 349 | "metadata": {}, 350 | "outputs": [], 351 | "source": [ 352 | "annotation_gc\n" 353 | ] 354 | }, 355 | { 356 | "cell_type": "code", 357 | "execution_count": 7, 358 | "metadata": {}, 359 | "outputs": [], 360 | "source": [ 361 | "with open(\"Allen_MERFISH_Layers.geojson\", 'r') as r:\n", 362 | " annotation_gc = geojson.load(r)" 363 | ] 364 | }, 365 | { 366 | "cell_type": "code", 367 | "execution_count": null, 368 | "metadata": {}, 369 | "outputs": [], 370 | "source": [] 371 | } 372 | ], 373 | "metadata": { 374 | "kernelspec": { 375 | "display_name": "Python 3", 376 | "language": "python", 377 | "name": "python3" 378 | }, 379 | "language_info": { 380 | "codemirror_mode": { 381 | "name": "ipython", 382 | "version": 3 383 | }, 384 | "file_extension": ".py", 385 | "mimetype": "text/x-python", 386 | "name": "python", 387 | "nbconvert_exporter": "python", 388 | "pygments_lexer": "ipython3", 389 | "version": "3.7.9" 390 | } 391 | }, 392 | "nbformat": 4, 393 | "nbformat_minor": 2 394 | } 395 | -------------------------------------------------------------------------------- /annotations/Allen_MERFISH_annotations_geo.json: -------------------------------------------------------------------------------- 1 | {"type": "GeometryCollection", "geometries": [{"type": "Polygon", "coordinates": [[[2524.8618583932202, 6576.111948820892], [1658.0005423837813, 5844.070207094309], [1559.1259312002576, 5745.776193928948], [2149.6322324606895, 4876.052855650803], [2299.438470759311, 4923.428032738741], [3273.6610578379136, 5452.419069146657], [2851.6245044166735, 6284.883773573806], [2851.6245044166735, 6284.883773573806], [2524.8618583932202, 6576.111948820892]]], "name": "VISp"}, {"type": "Polygon", "coordinates": [[[2886.3835508095212, 6001.306752660324], [2658.741190976758, 6301.073424519309], [2726.3577335013415, 6283.042346512753], [2839.051971042313, 6132.032068207851], [2839.051971042313, 6132.032068207851], [2886.3835508095212, 6001.306752660324]]], "name": "VISp_I"}, {"type": "Polygon", "coordinates": [[[2457.1482935004674, 6515.509647329128], [2614.1743668254, 6329.8517774914635], [2693.3588606767275, 6242.475784276205], [2974.6003388383406, 5917.546309506963], [3165.7353239967183, 5491.588342582578], [3191.0363164726978, 5415.620913671518], [2874.087247425565, 5243.940167937654], [2843.536349015453, 5325.027855515991], [2709.7418594045885, 5636.304831345349], [2600.5218678855153, 5865.666813535403], [2499.493375730373, 6059.532298481758], [2261.9398941763893, 6288.894280671811], [2226.9828981210017, 6323.076283979082], [2457.1482935004674, 6515.509647329128]]], "name": "VISp_II/III"}, {"type": "Polygon", "coordinates": [[[2210.0034837077624, 6332.509291986438], [2221.3230933165887, 6321.1896823776115], [2502.4267319357723, 6043.85924696137], [2636.375445640215, 5781.621624356898], [2721.2725177064112, 5598.621269014207], [2874.087247425565, 5234.507159930299], [2777.8705657505425, 5185.455518292052], [2602.4166168137363, 5577.8686513980265], [2508.086536740185, 5775.9618195524845], [2402.4368470578074, 5947.642565286348], [2151.5188340621607, 6260.818431130539], [2210.0034837077624, 6332.509291986438]]], "name": "VISp_IV"}, {"type": "Polygon", "coordinates": [[[2143.9724276562765, 6257.045227927597], [2145.8590292577474, 6257.045227927597], [2393.0038390504524, 5955.188971692232], [2498.6535287328297, 5775.9618195524845], [2611.8496248210913, 5549.56962737596], [2770.3241593446583, 5181.6823150891105], [2515.632943146069, 5042.073796580255], [2470.3545047107646, 5174.135908683226], [2293.0139541724875, 5564.662440187729], [2074.1681684018486, 5923.116744467225], [1940.2194546974054, 6083.4778805922615], [2143.9724276562765, 6257.045227927597]]], "name": "VISp_V"}, {"type": "Polygon", "coordinates": [[[1934.5596498929922, 6074.044872584907], [1940.2194546974054, 6068.385067780494], [2072.2815668003773, 5913.68373645987], [2215.6632885121758, 5685.404942681875], [2291.1273525710167, 5562.775838586258], [2468.4679031092937, 5162.8162990744], [2506.199935138714, 5042.073796580255], [2304.333563781314, 4932.650903694935], [2232.6427029254146, 5072.259422203791], [2094.9207860180295, 5281.672199967074], [1928.8998450885792, 5513.724196948011], [1685.5282384988166, 5868.405298024565], [1934.5596498929922, 6074.044872584907]]], "name": "VISp_VI"}, {"type": "Polygon", "coordinates": [[[2159.065240468045, 4879.826058853746], [2093.0341844165587, 5015.661374159659], [1891.1678130591586, 5319.404231996496], [1562.8991344031997, 5751.435998733361], [1676.0952304914613, 5857.085688415738], [2162.8384436709866, 5149.610087864103], [2291.1273525710167, 4925.10449728905], [2159.065240468045, 4879.826058853746]]], "name": "VISp_wm"}, {"type": "LineString", "coordinates": [[2921.25228746234, 6128.756319027567], [1949.6524627047606, 5513.724196948011]], "name": "column_axis"}]} -------------------------------------------------------------------------------- /annotations/Allen_smFISH_annotations_geo.json: -------------------------------------------------------------------------------- 1 | {"type": "GeometryCollection", "geometries": [{"type": "Polygon", "coordinates": [[[1766.2613293344602, 1297.0533231580532], [1363.8809273752736, 225.3669060588332], [893.7731310269169, 388.70944546800797], [539.2003015777325, 607.8274861388522], [256.3388308935517, 874.7530993196988], [212.51522275938282, 930.5286005813683], [794.1740216310785, 1918.5517657880844], [1248.345960476101, 1599.8346157214016], [1766.2613293344602, 1297.0533231580532]]], "name": "VISp"}, {"type": "Polygon", "coordinates": [[[218.9468150626485, 939.9651664439003], [562.7488405472957, 623.2608375491761], [776.1432011929387, 489.46596063643165], [1001.392804096673, 365.8327199449083], [1257.1273156640707, 279.45881206452896], [1377.3733442818536, 257.44193358521665], [1416.326283129868, 359.0582957974276], [1421.4071012404784, 375.9943561661294], [1254.288684572259, 435.6606875459342], [1104.702772345754, 497.9339908207826], [972.6015014698798, 550.4357779637583], [811.7089279672125, 624.9544435860463], [693.1565053862997, 697.7795031714642], [594.9273552478292, 782.4598050149733], [593.9123195262922, 783.475367817901], [331.7061169049277, 1017.693267912266], [290.0782686111962, 1058.517589024813], [218.9468150626485, 939.9651664439003]]], "name": "VISp_I"}, {"type": "Polygon", "coordinates": [[[285.36016270381214, 1060.7656898083203], [332.53486544402614, 1015.4779751777147], [692.9495943792616, 696.5769846538678], [812.062862442667, 624.2187547868292], [971.5194920872278, 550.5649782367226], [1103.2684046994236, 496.95715408255546], [1253.3850629330045, 436.17262552788617], [1419.440016578558, 375.7890060204122], [1521.3373744974203, 639.967341365611], [1116.7528464987365, 805.2623235859274], [747.6722495579098, 973.9642367663264], [406.1274017187601, 1253.2384769883938], [285.36016270381214, 1060.7656898083203]]], "name": "VISp_II/III"}, {"type": "Polygon", "coordinates": [[[400.1962141818303, 1253.3281345871312], [749.4382734004641, 972.3823002823636], [1118.8587627072855, 804.7461118574194], [1522.4273644710402, 638.6621103623357], [1590.7235893849065, 828.0289158053283], [1258.5555863947393, 961.5169917733394], [1039.6972292843955, 1060.8569552844174], [847.2260499816816, 1175.7187880941015], [518.1624208512355, 1444.2471269599844], [400.1962141818303, 1253.3281345871312]]], "name": "VISp_IV"}, {"type": "Polygon", "coordinates": [[[516.8269491823293, 1443.9556459181306], [846.8560225271408, 1175.808717603885], [1039.8770608522022, 1060.4976862373233], [1256.8335380400274, 962.9513631606268], [1591.5183361824863, 826.7228774845506], [1680.6554934767091, 1077.316017802271], [1356.0616942732186, 1238.7720008257688], [1074.5504375269306, 1419.5418319533244], [898.6030757066416, 1548.2293016208062], [671.5555995798479, 1714.730784113788], [516.8269491823293, 1443.9556459181306]]], "name": "VISp_V"}, {"type": "Polygon", "coordinates": [[[671.5555995798479, 1716.412617270283], [897.9255407190021, 1547.712111052883], [1075.1955571385922, 1418.728148570709], [1352.5725137687232, 1239.110519963472], [1679.5275511914065, 1078.0022406537437], [1682.3373266332037, 1077.316017802271], [1769.7926507709317, 1294.2724949900962], [1245.0607059445638, 1603.7297957851335], [792.6475868474713, 1911.505263423676], [671.5555995798479, 1716.412617270283]]], "name": "VISp_VI"}, {"type": "LineString", "coordinates": [[6895.070695613703, 5736.9023557791215], [12811.789510472292, 15864.619246077607]], "name": "cortical_axis"}]} -------------------------------------------------------------------------------- /annotations/BARISTAseq_annotations.json: -------------------------------------------------------------------------------- 1 | [{"type": "Polygon", "coordinates": [[[5.886927, 81.738106], [163.835655, 52.747517], [210.820404, 293.669312], [285.796066, 597.570663], [535.714941, 1010.436644], [777.636411, 1355.324691], [846.614021, 1475.285751], [496.727596, 1504.27634], [382.76459, 1461.290294], [229.814238, 1268.352923], [70.865834, 910.469094], [5.886927, 607.567418], [-9.108206, 291.669961], [-11.107557, 173.708252]]], "name": "L2_3_polygon"}, {"type": "Polygon", "coordinates": [[[171.833059, 52.747517], [300.791199, 44.750113], [333.78049, 190.702735], [443.744795, 467.612848], [558.707477, 689.540809], [754.643875, 984.445081], [1000.564048, 1325.334426], [1085.536465, 1434.299055], [971.573458, 1463.289645], [885.601365, 1478.284777], [844.61467, 1455.292241], [581.700014, 1064.419121], [287.795417, 594.571637], [204.822351, 247.684239]]], "name": "L4_polygon"}, {"type": "Polygon", "coordinates": [[[309.788286, 42.750762], [578.700995, 46.749464], [682.667247, 333.656332], [852.612082, 691.54016], [1144.517327, 1130.397704], [1422.427116, 1427.301327], [1110.52836, 1460.290618], [770.638691, 995.441512], [567.704564, 691.54016], [339.778551, 182.705331]]], "name": "L5_polygon"}, {"type": "Polygon", "coordinates": [[[597.694829, 36.752709], [918.590664, 29.75498], [935.585148, 30.754656], [1215.494287, 562.582021], [1373.443016, 862.48467], [1453.417056, 955.454492], [1480.408295, 1409.307168], [1428.425169, 1422.302949], [1151.515056, 1126.399002], [854.611433, 675.545352], [684.666598, 321.660226]]], "name": "L6_polygon"}] -------------------------------------------------------------------------------- /annotations/Cell_Data_Annotation_BARISTASeq.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "metadata": {}, 7 | "outputs": [ 8 | { 9 | "data": { 10 | "text/html": [ 11 | "" 12 | ], 13 | "text/plain": [ 14 | "" 15 | ] 16 | }, 17 | "metadata": {}, 18 | "output_type": "display_data" 19 | } 20 | ], 21 | "source": [ 22 | "%gui qt\n", 23 | "import napari\n", 24 | "import pandas as pd\n", 25 | "import numpy as np\n", 26 | "from IPython.core.display import display, HTML\n", 27 | "display(HTML(\"\"))\n", 28 | "from shapely.geometry import Polygon, Point,LineString, mapping\n" 29 | ] 30 | }, 31 | { 32 | "cell_type": "code", 33 | "execution_count": 2, 34 | "metadata": {}, 35 | "outputs": [], 36 | "source": [ 37 | "import json\n", 38 | "import geojson\n", 39 | "import pathlib\n" 40 | ] 41 | }, 42 | { 43 | "cell_type": "markdown", 44 | "metadata": {}, 45 | "source": [ 46 | "## Make a napari viewer..." 47 | ] 48 | }, 49 | { 50 | "cell_type": "code", 51 | "execution_count": 3, 52 | "metadata": {}, 53 | "outputs": [], 54 | "source": [ 55 | "v = napari.Viewer()" 56 | ] 57 | }, 58 | { 59 | "cell_type": "markdown", 60 | "metadata": {}, 61 | "source": [ 62 | "## Load Cell table from 1 dataset" 63 | ] 64 | }, 65 | { 66 | "cell_type": "code", 67 | "execution_count": 4, 68 | "metadata": {}, 69 | "outputs": [], 70 | "source": [ 71 | "# downloaded Baysor-segmented data for Baristaseq\n", 72 | "cell_stats = pd.read_csv(\"/Users/brian/Downloads/barista_seq_updated/segmentation_cell_stats.csv\")\n" 73 | ] 74 | }, 75 | { 76 | "cell_type": "code", 77 | "execution_count": 5, 78 | "metadata": {}, 79 | "outputs": [ 80 | { 81 | "data": { 82 | "text/plain": [ 83 | "" 84 | ] 85 | }, 86 | "execution_count": 5, 87 | "metadata": {}, 88 | "output_type": "execute_result" 89 | } 90 | ], 91 | "source": [ 92 | "# add the cells to the napari viewer\n", 93 | "v.add_points(cell_stats[[\"x\",\"y\"]].values)" 94 | ] 95 | }, 96 | { 97 | "cell_type": "code", 98 | "execution_count": 6, 99 | "metadata": {}, 100 | "outputs": [], 101 | "source": [ 102 | "\n", 103 | "# Brian's layer segmentation and restriction of cells to a rectangular region that includes roughly equal area in each layer\n", 104 | "\n", 105 | "\n", 106 | "\n", 107 | "with open(\"/Users/brian/Downloads/baristaseq_annotations_geo.json\", 'r') as r:\n", 108 | " layer_geojson = geojson.load(r)\n", 109 | " \n", 110 | "layer_data_brl = {layer_annotation[\"name\"]:np.array(layer_annotation[\"coordinates\"][0]) \n", 111 | " for layer_annotation in layer_geojson[\"geometries\"] if layer_annotation[\"name\"] not in [\"column_axis\"]}\n", 112 | "\n" 113 | ] 114 | }, 115 | { 116 | "cell_type": "code", 117 | "execution_count": 7, 118 | "metadata": {}, 119 | "outputs": [ 120 | { 121 | "data": { 122 | "text/plain": [ 123 | "" 124 | ] 125 | }, 126 | "execution_count": 7, 127 | "metadata": {}, 128 | "output_type": "execute_result" 129 | } 130 | ], 131 | "source": [ 132 | "# add the polygons to the viewer\n", 133 | "v.add_shapes([layer_data_brl[layer_name] for layer_name in layer_data_brl.keys()],shape_type='polygon', edge_width=1,\n", 134 | " edge_color='coral',\n", 135 | " face_color='royalblue',\n", 136 | " name=\"Layers\")" 137 | ] 138 | }, 139 | { 140 | "cell_type": "code", 141 | "execution_count": 8, 142 | "metadata": {}, 143 | "outputs": [], 144 | "source": [ 145 | "# Use layers to annotate the cell x gene data\n", 146 | "brl_layers = v.layers[-1]\n", 147 | "is_in_layer = {ii:[Polygon(layer_data_brl[p]).intersects(Point(a)) for a in cell_stats[[\"x\",\"y\"]].values] for ii,p in enumerate(layer_data_brl.keys())}" 148 | ] 149 | }, 150 | { 151 | "cell_type": "code", 152 | "execution_count": 9, 153 | "metadata": {}, 154 | "outputs": [], 155 | "source": [ 156 | "annotation_names = [\"VISp\", \"VISp_1\", \"VISp_2/3\", \"VISp_4\", \"VISp_5\",\"VISp_6\", \"VISp_wm\", \"column_axis\"]\n", 157 | "\n", 158 | "\n", 159 | "cell_stats[\"layer\"] = \"outside_VISp\"\n", 160 | "for k in is_in_layer.keys():\n", 161 | " cell_stats.loc[is_in_layer[k],[\"layer\"]] = annotation_names[k]\n" 162 | ] 163 | }, 164 | { 165 | "cell_type": "code", 166 | "execution_count": 10, 167 | "metadata": {}, 168 | "outputs": [ 169 | { 170 | "data": { 171 | "text/html": [ 172 | "
\n", 173 | "\n", 186 | "\n", 187 | " \n", 188 | " \n", 189 | " \n", 190 | " \n", 191 | " \n", 192 | " \n", 193 | " \n", 194 | " \n", 195 | " \n", 196 | " \n", 197 | " \n", 198 | " \n", 199 | " \n", 200 | " \n", 201 | " \n", 202 | " \n", 203 | " \n", 204 | " \n", 205 | " \n", 206 | " \n", 207 | " \n", 208 | " \n", 209 | " \n", 210 | " \n", 211 | " \n", 212 | " \n", 213 | " \n", 214 | " \n", 215 | " \n", 216 | " \n", 217 | " \n", 218 | " \n", 219 | " \n", 220 | " \n", 221 | " \n", 222 | " \n", 223 | " \n", 224 | " \n", 225 | " \n", 226 | " \n", 227 | " \n", 228 | " \n", 229 | " \n", 230 | " \n", 231 | " \n", 232 | " \n", 233 | " \n", 234 | " \n", 235 | " \n", 236 | " \n", 237 | " \n", 238 | " \n", 239 | " \n", 240 | " \n", 241 | " \n", 242 | " \n", 243 | " \n", 244 | " \n", 245 | " \n", 246 | " \n", 247 | " \n", 248 | " \n", 249 | " \n", 250 | " \n", 251 | " \n", 252 | " \n", 253 | " \n", 254 | " \n", 255 | " \n", 256 | " \n", 257 | " \n", 258 | " \n", 259 | " \n", 260 | " \n", 261 | " \n", 262 | " \n", 263 | " \n", 264 | " \n", 265 | " \n", 266 | " \n", 267 | " \n", 268 | " \n", 269 | " \n", 270 | " \n", 271 | " \n", 272 | " \n", 273 | " \n", 274 | " \n", 275 | " \n", 276 | " \n", 277 | " \n", 278 | " \n", 279 | " \n", 280 | " \n", 281 | " \n", 282 | " \n", 283 | " \n", 284 | " \n", 285 | " \n", 286 | " \n", 287 | " \n", 288 | " \n", 289 | " \n", 290 | " \n", 291 | " \n", 292 | " \n", 293 | " \n", 294 | " \n", 295 | " \n", 296 | " \n", 297 | " \n", 298 | " \n", 299 | " \n", 300 | " \n", 301 | " \n", 302 | " \n", 303 | " \n", 304 | " \n", 305 | " \n", 306 | " \n", 307 | " \n", 308 | " \n", 309 | " \n", 310 | " \n", 311 | " \n", 312 | " \n", 313 | " \n", 314 | " \n", 315 | " \n", 316 | " \n", 317 | " \n", 318 | " \n", 319 | " \n", 320 | " \n", 321 | " \n", 322 | " \n", 323 | " \n", 324 | " \n", 325 | " \n", 326 | " \n", 327 | " \n", 328 | " \n", 329 | " \n", 330 | " \n", 331 | " \n", 332 | " \n", 333 | " \n", 334 | " \n", 335 | " \n", 336 | " \n", 337 | " \n", 338 | " \n", 339 | " \n", 340 | " \n", 341 | " \n", 342 | " \n", 343 | " \n", 344 | " \n", 345 | " \n", 346 | " \n", 347 | " \n", 348 | " \n", 349 | " \n", 350 | " \n", 351 | " \n", 352 | " \n", 353 | " \n", 354 | " \n", 355 | " \n", 356 | " \n", 357 | " \n", 358 | " \n", 359 | " \n", 360 | " \n", 361 | " \n", 362 | " \n", 363 | " \n", 364 | " \n", 365 | " \n", 366 | " \n", 367 | " \n", 368 | " \n", 369 | " \n", 370 | " \n", 371 | "
cellxyhas_centerclustern_transcriptsdensityelongationareaavg_confidencedoublet_scorelayer
0119.142500179.994429False3700.94253.62474.27000.98700.497700outside_VISp
1218.728989240.994511False3470.96839.83748.54000.99610.003106outside_VISp
2319.650893251.944857False4281.11601.27425.10000.9860NaNoutside_VISp
3421.228078282.335448False21340.90112.932148.70000.99640.061940outside_VISp
4521.100798308.535787False3471.04003.89845.20000.99910.035630outside_VISp
.......................................
1071410715253.218250592.672500False2121.90002.2786.31700.9983NaNoutside_VISp
1071510716321.392500801.450000False22NaNNaNNaN0.9986NaNVISp_2/3
1071610717896.513000967.688000False11NaNNaNNaN0.9709NaNVISp_5
1071710718501.410000789.604000False22NaNNaNNaN0.9991NaNVISp_4
1071810719565.8793331194.863333False337.35808.7870.40770.9761NaNVISp_2/3
\n", 372 | "

10719 rows × 12 columns

\n", 373 | "
" 374 | ], 375 | "text/plain": [ 376 | " cell x y has_center cluster n_transcripts \\\n", 377 | "0 1 19.142500 179.994429 False 3 70 \n", 378 | "1 2 18.728989 240.994511 False 3 47 \n", 379 | "2 3 19.650893 251.944857 False 4 28 \n", 380 | "3 4 21.228078 282.335448 False 2 134 \n", 381 | "4 5 21.100798 308.535787 False 3 47 \n", 382 | "... ... ... ... ... ... ... \n", 383 | "10714 10715 253.218250 592.672500 False 2 12 \n", 384 | "10715 10716 321.392500 801.450000 False 2 2 \n", 385 | "10716 10717 896.513000 967.688000 False 1 1 \n", 386 | "10717 10718 501.410000 789.604000 False 2 2 \n", 387 | "10718 10719 565.879333 1194.863333 False 3 3 \n", 388 | "\n", 389 | " density elongation area avg_confidence doublet_score \\\n", 390 | "0 0.9425 3.624 74.2700 0.9870 0.497700 \n", 391 | "1 0.9683 9.837 48.5400 0.9961 0.003106 \n", 392 | "2 1.1160 1.274 25.1000 0.9860 NaN \n", 393 | "3 0.9011 2.932 148.7000 0.9964 0.061940 \n", 394 | "4 1.0400 3.898 45.2000 0.9991 0.035630 \n", 395 | "... ... ... ... ... ... \n", 396 | "10714 1.9000 2.278 6.3170 0.9983 NaN \n", 397 | "10715 NaN NaN NaN 0.9986 NaN \n", 398 | "10716 NaN NaN NaN 0.9709 NaN \n", 399 | "10717 NaN NaN NaN 0.9991 NaN \n", 400 | "10718 7.3580 8.787 0.4077 0.9761 NaN \n", 401 | "\n", 402 | " layer \n", 403 | "0 outside_VISp \n", 404 | "1 outside_VISp \n", 405 | "2 outside_VISp \n", 406 | "3 outside_VISp \n", 407 | "4 outside_VISp \n", 408 | "... ... \n", 409 | "10714 outside_VISp \n", 410 | "10715 VISp_2/3 \n", 411 | "10716 VISp_5 \n", 412 | "10717 VISp_4 \n", 413 | "10718 VISp_2/3 \n", 414 | "\n", 415 | "[10719 rows x 12 columns]" 416 | ] 417 | }, 418 | "execution_count": 10, 419 | "metadata": {}, 420 | "output_type": "execute_result" 421 | } 422 | ], 423 | "source": [ 424 | "cell_stats" 425 | ] 426 | }, 427 | { 428 | "cell_type": "code", 429 | "execution_count": 11, 430 | "metadata": {}, 431 | "outputs": [], 432 | "source": [ 433 | "cell_stats.to_csv(\"/Users/brian/Downloads/barista_seq_updated/segmentation_cell_stats_BRL_layers.csv\")" 434 | ] 435 | }, 436 | { 437 | "cell_type": "code", 438 | "execution_count": null, 439 | "metadata": {}, 440 | "outputs": [], 441 | "source": [] 442 | } 443 | ], 444 | "metadata": { 445 | "kernelspec": { 446 | "display_name": "Python 3", 447 | "language": "python", 448 | "name": "python3" 449 | }, 450 | "language_info": { 451 | "codemirror_mode": { 452 | "name": "ipython", 453 | "version": 3 454 | }, 455 | "file_extension": ".py", 456 | "mimetype": "text/x-python", 457 | "name": "python", 458 | "nbconvert_exporter": "python", 459 | "pygments_lexer": "ipython3", 460 | "version": "3.7.9" 461 | } 462 | }, 463 | "nbformat": 4, 464 | "nbformat_minor": 2 465 | } 466 | -------------------------------------------------------------------------------- /annotations/Cell_Data_Annotation_ISS_mouse.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "metadata": {}, 7 | "outputs": [ 8 | { 9 | "data": { 10 | "text/html": [ 11 | "" 12 | ], 13 | "text/plain": [ 14 | "" 15 | ] 16 | }, 17 | "metadata": {}, 18 | "output_type": "display_data" 19 | } 20 | ], 21 | "source": [ 22 | "%gui qt\n", 23 | "import napari\n", 24 | "import pandas as pd\n", 25 | "import numpy as np\n", 26 | "from IPython.core.display import display, HTML\n", 27 | "display(HTML(\"\"))\n", 28 | "from shapely.geometry import Polygon, Point,LineString, mapping\n" 29 | ] 30 | }, 31 | { 32 | "cell_type": "code", 33 | "execution_count": 2, 34 | "metadata": {}, 35 | "outputs": [], 36 | "source": [ 37 | "import json\n", 38 | "import geojson\n", 39 | "import pathlib\n" 40 | ] 41 | }, 42 | { 43 | "cell_type": "markdown", 44 | "metadata": {}, 45 | "source": [ 46 | "## Make a napari viewer..." 47 | ] 48 | }, 49 | { 50 | "cell_type": "code", 51 | "execution_count": 3, 52 | "metadata": {}, 53 | "outputs": [], 54 | "source": [ 55 | "v = napari.Viewer()" 56 | ] 57 | }, 58 | { 59 | "cell_type": "markdown", 60 | "metadata": {}, 61 | "source": [ 62 | "## Load Cell table from 1 dataset" 63 | ] 64 | }, 65 | { 66 | "cell_type": "code", 67 | "execution_count": 4, 68 | "metadata": {}, 69 | "outputs": [], 70 | "source": [ 71 | "# downloaded Baysor-segmented data for Baristaseq\n", 72 | "cell_stats = pd.read_csv(\"/Users/brian/Downloads/mouse_visp1_ISS_m_brain_03_PreliminaryCalls_prior/segmentation_cell_stats.csv\")\n" 73 | ] 74 | }, 75 | { 76 | "cell_type": "code", 77 | "execution_count": 5, 78 | "metadata": {}, 79 | "outputs": [ 80 | { 81 | "data": { 82 | "text/plain": [ 83 | "" 84 | ] 85 | }, 86 | "execution_count": 5, 87 | "metadata": {}, 88 | "output_type": "execute_result" 89 | } 90 | ], 91 | "source": [ 92 | "# add the cells to the napari viewer\n", 93 | "v.add_points(cell_stats[[\"x\",\"y\"]].values)" 94 | ] 95 | }, 96 | { 97 | "cell_type": "code", 98 | "execution_count": 6, 99 | "metadata": {}, 100 | "outputs": [], 101 | "source": [ 102 | "# Brian's layer segmentation and restriction of cells to a rectangular region that includes roughly equal area in each layer\n", 103 | "\n", 104 | "\n", 105 | "\n", 106 | "with open(\"/Users/brian/work/data/data/annotations/ISS_layer_Annotation_new_6_layers.json\", 'r') as r:\n", 107 | " layer_geojson = geojson.load(r)" 108 | ] 109 | }, 110 | { 111 | "cell_type": "code", 112 | "execution_count": 8, 113 | "metadata": {}, 114 | "outputs": [ 115 | { 116 | "data": { 117 | "text/plain": [ 118 | "[{\"coordinates\": [[[39334.13312, 1362.231682], [39035.589057, 645.725932], [39354.036057, 386.987744], [41384.135683, 247.667182], [45703.073121, 227.764244], [49325.407747, 904.464119], [53962.792186, 2874.854932], [57366.194499, 5163.692745], [60072.994, 8507.386246], [61784.646626, 11453.020997], [63038.531688, 14657.393935], [62361.831813, 15334.09381], [61685.131938, 13184.57656], [59774.449938, 9323.406684], [57346.291562, 6278.257246], [54739.006749, 4287.963495], [51514.730873, 2536.504995], [49126.378372, 1760.290432], [45683.170184, 824.852369], [41483.65037, 944.269994]]], \"name\": \"L1_polygon\", \"type\": \"Polygon\"},\n", 119 | " {\"coordinates\": [[[39393.841932, 1402.037557], [39732.19187, 1899.610994], [44946.761496, 1800.096307], [48171.037372, 2357.378557], [51833.177873, 3949.613558], [54818.618499, 5382.625058], [57226.873937, 7552.045246], [59575.420562, 10238.941809], [61764.743688, 15791.861373], [62262.317126, 15493.31731], [61545.811375, 13184.57656], [59674.93525, 9403.018434], [57326.388624, 6457.383683], [54619.589124, 4367.575245], [51355.507373, 2556.407932], [48947.251935, 1760.290432], [45643.364309, 944.269994], [41622.970933, 984.075869]]], \"name\": \"L2_polygon\", \"type\": \"Polygon\"},\n", 120 | " {\"coordinates\": [[[39752.094807, 1959.319807], [40030.735933, 2596.213807], [43692.876433, 2576.31087], [47852.590372, 3272.913682], [51076.866248, 4248.15762], [54699.200874, 6019.519058], [56808.912249, 8069.521621], [58898.720687, 10537.485872], [61187.5585, 16189.920123], [61625.423125, 15831.667248], [59436.1, 10199.135934], [57007.941624, 7432.627621], [54699.200874, 5402.527995], [48131.231497, 2417.08737], [44847.246809, 1859.805119]]], \"name\": \"L3_polygon\", \"type\": \"Polygon\"},\n", 121 | " {\"coordinates\": [[[40110.347683, 2775.340245], [40767.14462, 3750.584182], [43991.420496, 3631.166557], [47175.890497, 3969.516495], [50718.613373, 5402.527995], [54719.103811, 7731.171683], [56928.329874, 9840.883059], [58540.467812, 12687.003122], [60212.314563, 16886.522936], [61088.043813, 16209.823061], [58799.206, 10457.874122], [56589.979937, 7930.201059], [54619.589124, 6019.519058], [51017.157435, 4287.963495], [47772.978622, 3332.622495], [43593.361746, 2616.116745]]], \"name\": \"L4_polygon\", \"type\": \"Polygon\"},\n", 122 | " {\"coordinates\": [[[40886.562245, 3929.71062], [41483.65037, 5123.88687], [44488.993934, 4865.148683], [49444.825372, 6278.257246], [52768.615936, 8169.036309], [55535.124249, 10776.321122], [57525.417999, 13721.955872], [59376.391187, 17463.708123], [60132.702813, 16986.037623], [58839.011875, 13602.538247], [57744.350312, 11433.118059], [56888.523999, 9920.494809], [54480.268561, 7651.559933], [50499.68106, 5382.625058], [47016.666997, 4029.225308], [43891.905809, 3690.87537]]], \"name\": \"L5_polygon\", \"type\": \"Polygon\"},\n", 123 | " {\"coordinates\": [[[41543.359183, 5243.304495], [42359.379621, 7074.374746], [46897.249372, 7651.559933], [50499.68106, 8766.124434], [53604.539311, 10915.641684], [55992.891812, 14259.335185], [57923.47675, 17961.281561], [58003.0885, 18100.602124], [59217.167687, 17503.513998], [57366.194499, 13602.538247], [55475.415436, 10816.126997], [52748.712998, 8208.842184], [49265.698935, 6278.257246], [44449.188059, 4984.566308]]], \"name\": \"L6_polygon\", \"type\": \"Polygon\"}]" 124 | ] 125 | }, 126 | "execution_count": 8, 127 | "metadata": {}, 128 | "output_type": "execute_result" 129 | } 130 | ], 131 | "source": [ 132 | "layer_geojson" 133 | ] 134 | }, 135 | { 136 | "cell_type": "code", 137 | "execution_count": 10, 138 | "metadata": {}, 139 | "outputs": [], 140 | "source": [ 141 | " \n", 142 | "layer_data_brl = {layer_annotation[\"name\"]:np.array(layer_annotation[\"coordinates\"][0]) \n", 143 | " for layer_annotation in layer_geojson if layer_annotation[\"name\"] not in [\"column_axis\"]}" 144 | ] 145 | }, 146 | { 147 | "cell_type": "code", 148 | "execution_count": 11, 149 | "metadata": {}, 150 | "outputs": [ 151 | { 152 | "data": { 153 | "text/plain": [ 154 | "" 155 | ] 156 | }, 157 | "execution_count": 11, 158 | "metadata": {}, 159 | "output_type": "execute_result" 160 | } 161 | ], 162 | "source": [ 163 | "# add the polygons to the viewer\n", 164 | "v.add_shapes([layer_data_brl[layer_name] for layer_name in layer_data_brl.keys()],shape_type='polygon', edge_width=1,\n", 165 | " edge_color='coral',\n", 166 | " face_color='royalblue',\n", 167 | " name=\"Layers\")" 168 | ] 169 | }, 170 | { 171 | "cell_type": "markdown", 172 | "metadata": {}, 173 | "source": [ 174 | "## Brian added a \"VISp\" polygon to subset the cortical layer annotations from Christoffer to include only V1 and merged the previously separate layer 2 and 3 annotations" 175 | ] 176 | }, 177 | { 178 | "cell_type": "code", 179 | "execution_count": 27, 180 | "metadata": {}, 181 | "outputs": [], 182 | "source": [ 183 | "shapes_layer = v.layers[-1].data\n", 184 | "annotation_names = [\"VISp_1\", \"VISp_2/3\", \"VISp_4\", \"VISp_5\",\"VISp_6\", \"VISp\"]\n", 185 | "annotations = [mapping(Polygon(p)) for ii,p in enumerate(shapes_layer)]\n", 186 | "for ii,ai in enumerate(annotations):\n", 187 | " ai[\"name\"] = annotation_names[ii]\n", 188 | "\n", 189 | "a = geojson.GeometryCollection(annotations)\n", 190 | "\n", 191 | "with open(\"/Users/brian/Downloads/mouse_visp1_ISS_m_brain_03_PreliminaryCalls_prior/Layers_VISp_geo.json\",'w') as w:\n", 192 | " geojson.dump(a,w)\n", 193 | " " 194 | ] 195 | }, 196 | { 197 | "cell_type": "code", 198 | "execution_count": 46, 199 | "metadata": {}, 200 | "outputs": [ 201 | { 202 | "data": { 203 | "text/plain": [ 204 | "[{'type': 'Polygon',\n", 205 | " 'coordinates': (((39334.13312, 1362.231682),\n", 206 | " (39035.589057, 645.725932),\n", 207 | " (39354.036057, 386.987744),\n", 208 | " (41384.135683, 247.667182),\n", 209 | " (45703.073121, 227.764244),\n", 210 | " (49325.407747, 904.464119),\n", 211 | " (53962.792186, 2874.854932),\n", 212 | " (57366.194499, 5163.692745),\n", 213 | " (60072.994, 8507.386246),\n", 214 | " (61784.646626, 11453.020997),\n", 215 | " (63038.531688, 14657.393935),\n", 216 | " (62256.22292006615, 15439.08804782239),\n", 217 | " (61545.58751585353, 13172.73729925241),\n", 218 | " (59740.189461907954, 9427.496655429137),\n", 219 | " (57377.80690195789, 6469.716864922553),\n", 220 | " (54631.29709648749, 4337.81065228469),\n", 221 | " (51500.660045496756, 2590.031685167163),\n", 222 | " (49138.277485546685, 1783.3644695744579),\n", 223 | " (45682.95460899599, 1033.8837465883028),\n", 224 | " (41478.58297014514, 1117.2565552907276),\n", 225 | " (39334.13312, 1362.231682)),),\n", 226 | " 'name': 'VISp_1'},\n", 227 | " {'type': 'Polygon',\n", 228 | " 'coordinates': (((39323.02357149946, 1360.5180814896873),\n", 229 | " (40084.29447120469, 2749.3231012221863),\n", 230 | " (43592.31307660307, 2605.2988769536305),\n", 231 | " (47738.153246619346, 3315.132553705797),\n", 232 | " (50935.80704155858, 4230.948896820723),\n", 233 | " (54700.25404765787, 6055.553313042317),\n", 234 | " (56736.12844891565, 8053.014989748063),\n", 235 | " (58829.62193700148, 10492.2229988022),\n", 236 | " (61076.766323295444, 16158.09987022715),\n", 237 | " (62235.2422657903, 15482.487365916124),\n", 238 | " (61518.7365147903, 13173.746615916123),\n", 239 | " (59647.8603897903, 9392.188489916123),\n", 240 | " (57299.3137637903, 6446.553738916117),\n", 241 | " (54592.5142637903, 4356.745300916117),\n", 242 | " (51328.4325127903, 2545.5779879161173),\n", 243 | " (48920.1770747903, 1749.4604879161172),\n", 244 | " (45588.07732718163, 1041.607299180743),\n", 245 | " (41575.9739368433, 1123.9068559056318),\n", 246 | " (39323.02357149946, 1360.5180814896873)),),\n", 247 | " 'name': 'VISp_2/3'},\n", 248 | " {'type': 'Polygon',\n", 249 | " 'coordinates': (((40110.347683, 2775.340245),\n", 250 | " (40859.24210549855, 3904.2904462003607),\n", 251 | " (44003.58803370429, 3654.172020093086),\n", 252 | " (47112.20275818042, 4047.2152611188035),\n", 253 | " (50697.23353238469, 5440.73220657362),\n", 254 | " (54719.103811, 7731.171683),\n", 255 | " (56928.329874, 9840.883059),\n", 256 | " (58540.467812, 12687.003122),\n", 257 | " (60212.314563, 16886.522936),\n", 258 | " (61088.043813, 16209.823061),\n", 259 | " (58799.206, 10457.874122),\n", 260 | " (56589.979937, 7930.201059),\n", 261 | " (54619.589124, 6019.519058),\n", 262 | " (51017.157435, 4287.963495),\n", 263 | " (47772.978622, 3332.622495),\n", 264 | " (43593.361746, 2616.116745),\n", 265 | " (40110.347683, 2775.340245)),),\n", 266 | " 'name': 'VISp_4'},\n", 267 | " {'type': 'Polygon',\n", 268 | " 'coordinates': (((40886.562245, 3929.71062),\n", 269 | " (41514.31417387474, 5214.434582952752),\n", 270 | " (44503.82488591884, 4952.4057556022735),\n", 271 | " (49375.1789943891, 6298.281096084276),\n", 272 | " (52768.615936, 8169.036309),\n", 273 | " (55535.124249, 10776.321122),\n", 274 | " (57525.417999, 13721.955872),\n", 275 | " (59376.391187, 17463.708123),\n", 276 | " (60132.702813, 16986.037623),\n", 277 | " (58839.011875, 13602.538247),\n", 278 | " (57744.350312, 11433.118059),\n", 279 | " (56888.523999, 9920.494809),\n", 280 | " (54480.268561, 7651.559933),\n", 281 | " (50499.68106, 5382.625058),\n", 282 | " (47016.666997, 4029.225308),\n", 283 | " (43891.905809, 3690.87537),\n", 284 | " (40886.562245, 3929.71062)),),\n", 285 | " 'name': 'VISp_5'},\n", 286 | " {'type': 'Polygon',\n", 287 | " 'coordinates': (((41543.359183, 5243.304495),\n", 288 | " (42359.379621, 7074.374746),\n", 289 | " (46897.249372, 7651.559933),\n", 290 | " (50499.68106, 8766.124434),\n", 291 | " (53604.539311, 10915.641684),\n", 292 | " (55992.891812, 14259.335185),\n", 293 | " (57923.47675, 17961.281561),\n", 294 | " (58003.0885, 18100.602124),\n", 295 | " (59217.167687, 17503.513998),\n", 296 | " (57366.194499, 13602.538247),\n", 297 | " (55475.415436, 10816.126997),\n", 298 | " (52748.712998, 8208.842184),\n", 299 | " (49265.698935, 6278.257246),\n", 300 | " (44449.188059, 4984.566308),\n", 301 | " (41543.359183, 5243.304495)),),\n", 302 | " 'name': 'VISp_6'},\n", 303 | " {'type': 'Polygon',\n", 304 | " 'coordinates': (((44000.33897460559, 7360.075721385211),\n", 305 | " (43315.23474903558, -70.67010979714723),\n", 306 | " (48058.26400298177, -70.67010979714723),\n", 307 | " (52930.532280990876, 1927.0807633118916),\n", 308 | " (49744.67440438486, 8782.984497569067),\n", 309 | " (44000.33897460559, 7360.075721385211)),),\n", 310 | " 'name': 'VISp'}]" 311 | ] 312 | }, 313 | "execution_count": 46, 314 | "metadata": {}, 315 | "output_type": "execute_result" 316 | } 317 | ], 318 | "source": [ 319 | "annotations" 320 | ] 321 | }, 322 | { 323 | "cell_type": "code", 324 | "execution_count": 69, 325 | "metadata": {}, 326 | "outputs": [], 327 | "source": [ 328 | "# Use layers to annotate the cell x gene data\n", 329 | "# slightly awkward dict comprehension here going through the annotations (except not annotations[-1])\n", 330 | "# and figuring out if the cell location is in the layer polygon and VISp (annotations[-1])\n", 331 | "is_in_layer = {p[\"name\"]:[(Polygon(p[\"coordinates\"][0]).intersects(Point(a)) and Polygon(annotations[-1][\"coordinates\"][0]).intersects(Point(a))) for a in cell_stats[[\"x\",\"y\"]].values] for ii,p in enumerate(annotations[:-1])}" 332 | ] 333 | }, 334 | { 335 | "cell_type": "code", 336 | "execution_count": 70, 337 | "metadata": {}, 338 | "outputs": [], 339 | "source": [ 340 | "\n", 341 | "\n", 342 | "cell_stats[\"layer\"] = \"outside_VISp\"\n", 343 | "for k in is_in_layer.keys():\n", 344 | " cell_stats.loc[is_in_layer[k],[\"layer\"]] = k\n" 345 | ] 346 | }, 347 | { 348 | "cell_type": "code", 349 | "execution_count": 75, 350 | "metadata": {}, 351 | "outputs": [], 352 | "source": [ 353 | "cell_stats[\"x_um\"] = cell_stats[\"x\"]*0.1625\n", 354 | "cell_stats[\"y_um\"] = cell_stats[\"y\"]*0.1625" 355 | ] 356 | }, 357 | { 358 | "cell_type": "code", 359 | "execution_count": 76, 360 | "metadata": {}, 361 | "outputs": [ 362 | { 363 | "data": { 364 | "text/html": [ 365 | "
\n", 366 | "\n", 379 | "\n", 380 | " \n", 381 | " \n", 382 | " \n", 383 | " \n", 384 | " \n", 385 | " \n", 386 | " \n", 387 | " \n", 388 | " \n", 389 | " \n", 390 | " \n", 391 | " \n", 392 | " \n", 393 | " \n", 394 | " \n", 395 | " \n", 396 | " \n", 397 | " \n", 398 | " \n", 399 | " \n", 400 | " \n", 401 | " \n", 402 | " \n", 403 | " \n", 404 | " \n", 405 | " \n", 406 | " \n", 407 | " \n", 408 | " \n", 409 | " \n", 410 | " \n", 411 | " \n", 412 | " \n", 413 | " \n", 414 | " \n", 415 | " \n", 416 | " \n", 417 | " \n", 418 | " \n", 419 | " \n", 420 | " \n", 421 | " \n", 422 | " \n", 423 | " \n", 424 | " \n", 425 | " \n", 426 | " \n", 427 | " \n", 428 | " \n", 429 | " \n", 430 | " \n", 431 | " \n", 432 | " \n", 433 | " \n", 434 | " \n", 435 | " \n", 436 | " \n", 437 | " \n", 438 | " \n", 439 | " \n", 440 | " \n", 441 | " \n", 442 | " \n", 443 | " \n", 444 | " \n", 445 | " \n", 446 | " \n", 447 | " \n", 448 | " \n", 449 | " \n", 450 | " \n", 451 | " \n", 452 | " \n", 453 | " \n", 454 | " \n", 455 | " \n", 456 | " \n", 457 | " \n", 458 | " \n", 459 | " \n", 460 | " \n", 461 | " \n", 462 | " \n", 463 | " \n", 464 | " \n", 465 | " \n", 466 | " \n", 467 | " \n", 468 | " \n", 469 | " \n", 470 | " \n", 471 | " \n", 472 | " \n", 473 | " \n", 474 | " \n", 475 | " \n", 476 | " \n", 477 | " \n", 478 | " \n", 479 | " \n", 480 | " \n", 481 | " \n", 482 | " \n", 483 | " \n", 484 | " \n", 485 | " \n", 486 | " \n", 487 | " \n", 488 | " \n", 489 | " \n", 490 | " \n", 491 | " \n", 492 | " \n", 493 | " \n", 494 | " \n", 495 | " \n", 496 | " \n", 497 | " \n", 498 | " \n", 499 | " \n", 500 | " \n", 501 | " \n", 502 | " \n", 503 | " \n", 504 | " \n", 505 | " \n", 506 | " \n", 507 | " \n", 508 | " \n", 509 | " \n", 510 | " \n", 511 | " \n", 512 | " \n", 513 | " \n", 514 | " \n", 515 | " \n", 516 | " \n", 517 | " \n", 518 | " \n", 519 | " \n", 520 | " \n", 521 | " \n", 522 | " \n", 523 | " \n", 524 | " \n", 525 | " \n", 526 | " \n", 527 | " \n", 528 | " \n", 529 | " \n", 530 | " \n", 531 | " \n", 532 | " \n", 533 | " \n", 534 | " \n", 535 | " \n", 536 | " \n", 537 | " \n", 538 | " \n", 539 | " \n", 540 | " \n", 541 | " \n", 542 | " \n", 543 | " \n", 544 | " \n", 545 | " \n", 546 | " \n", 547 | " \n", 548 | " \n", 549 | " \n", 550 | " \n", 551 | " \n", 552 | " \n", 553 | " \n", 554 | " \n", 555 | " \n", 556 | " \n", 557 | " \n", 558 | " \n", 559 | " \n", 560 | " \n", 561 | " \n", 562 | " \n", 563 | " \n", 564 | " \n", 565 | " \n", 566 | " \n", 567 | " \n", 568 | " \n", 569 | " \n", 570 | " \n", 571 | " \n", 572 | " \n", 573 | " \n", 574 | " \n", 575 | " \n", 576 | " \n", 577 | " \n", 578 | " \n", 579 | " \n", 580 | " \n", 581 | " \n", 582 | " \n", 583 | " \n", 584 | " \n", 585 | " \n", 586 | " \n", 587 | " \n", 588 | "
cellxyhas_centerclustern_transcriptsdensityelongationareaavg_confidencedoublet_scorelayerx_umy_um
01152.14285724494.571429False370.045902.794152.50.99910.284900outside_VISp24.7232143980.367857
12128.50000026559.750000False340.057143.04570.00.9987NaNoutside_VISp20.8812504315.959375
23130.83333326721.833333False360.023532.440255.00.98810.003106outside_VISp21.2604174342.297917
34193.42857124838.857143False370.027089.700258.50.99610.003106outside_VISp31.4321434036.314286
45214.00000024864.600000False350.039532.221126.50.99750.137000outside_VISp34.7750004040.497500
.............................................
13520713520846897.00000034441.000000False21NaNNaNNaN0.9997NaNoutside_VISp7620.7625005596.662500
13520813520920717.0000006161.000000False12NaNNaNNaN0.9993NaNoutside_VISp3366.5125001001.162500
13520913521046620.0000007199.500000False22NaNNaNNaN0.9995NaNVISp_67575.7500001169.918750
13521013521132742.0000003575.000000False11NaNNaNNaN0.9989NaNoutside_VISp5320.575000580.937500
13521113521238020.0000008505.000000False11NaNNaNNaN0.9986NaNoutside_VISp6178.2500001382.062500
\n", 589 | "

135212 rows × 14 columns

\n", 590 | "
" 591 | ], 592 | "text/plain": [ 593 | " cell x y has_center cluster \\\n", 594 | "0 1 152.142857 24494.571429 False 3 \n", 595 | "1 2 128.500000 26559.750000 False 3 \n", 596 | "2 3 130.833333 26721.833333 False 3 \n", 597 | "3 4 193.428571 24838.857143 False 3 \n", 598 | "4 5 214.000000 24864.600000 False 3 \n", 599 | "... ... ... ... ... ... \n", 600 | "135207 135208 46897.000000 34441.000000 False 2 \n", 601 | "135208 135209 20717.000000 6161.000000 False 1 \n", 602 | "135209 135210 46620.000000 7199.500000 False 2 \n", 603 | "135210 135211 32742.000000 3575.000000 False 1 \n", 604 | "135211 135212 38020.000000 8505.000000 False 1 \n", 605 | "\n", 606 | " n_transcripts density elongation area avg_confidence \\\n", 607 | "0 7 0.04590 2.794 152.5 0.9991 \n", 608 | "1 4 0.05714 3.045 70.0 0.9987 \n", 609 | "2 6 0.02353 2.440 255.0 0.9881 \n", 610 | "3 7 0.02708 9.700 258.5 0.9961 \n", 611 | "4 5 0.03953 2.221 126.5 0.9975 \n", 612 | "... ... ... ... ... ... \n", 613 | "135207 1 NaN NaN NaN 0.9997 \n", 614 | "135208 2 NaN NaN NaN 0.9993 \n", 615 | "135209 2 NaN NaN NaN 0.9995 \n", 616 | "135210 1 NaN NaN NaN 0.9989 \n", 617 | "135211 1 NaN NaN NaN 0.9986 \n", 618 | "\n", 619 | " doublet_score layer x_um y_um \n", 620 | "0 0.284900 outside_VISp 24.723214 3980.367857 \n", 621 | "1 NaN outside_VISp 20.881250 4315.959375 \n", 622 | "2 0.003106 outside_VISp 21.260417 4342.297917 \n", 623 | "3 0.003106 outside_VISp 31.432143 4036.314286 \n", 624 | "4 0.137000 outside_VISp 34.775000 4040.497500 \n", 625 | "... ... ... ... ... \n", 626 | "135207 NaN outside_VISp 7620.762500 5596.662500 \n", 627 | "135208 NaN outside_VISp 3366.512500 1001.162500 \n", 628 | "135209 NaN VISp_6 7575.750000 1169.918750 \n", 629 | "135210 NaN outside_VISp 5320.575000 580.937500 \n", 630 | "135211 NaN outside_VISp 6178.250000 1382.062500 \n", 631 | "\n", 632 | "[135212 rows x 14 columns]" 633 | ] 634 | }, 635 | "execution_count": 76, 636 | "metadata": {}, 637 | "output_type": "execute_result" 638 | } 639 | ], 640 | "source": [ 641 | "cell_stats" 642 | ] 643 | }, 644 | { 645 | "cell_type": "code", 646 | "execution_count": 77, 647 | "metadata": {}, 648 | "outputs": [], 649 | "source": [ 650 | "cell_stats.to_csv(\"/Users/brian/Downloads/mouse_visp1_ISS_m_brain_03_PreliminaryCalls_prior/segmentation_cell_stats_BRL_layers.csv\")" 651 | ] 652 | }, 653 | { 654 | "cell_type": "code", 655 | "execution_count": 72, 656 | "metadata": {}, 657 | "outputs": [ 658 | { 659 | "data": { 660 | "text/plain": [ 661 | "" 662 | ] 663 | }, 664 | "execution_count": 72, 665 | "metadata": {}, 666 | "output_type": "execute_result" 667 | } 668 | ], 669 | "source": [ 670 | "v.add_points(cell_stats.loc[cell_stats[\"layer\"]==\"VISp_5\"][[\"x\",\"y\"]].values)" 671 | ] 672 | }, 673 | { 674 | "cell_type": "code", 675 | "execution_count": 73, 676 | "metadata": {}, 677 | "outputs": [ 678 | { 679 | "data": { 680 | "text/plain": [ 681 | "array(['outside_VISp', 'VISp_1', 'VISp_2/3', 'VISp_4', 'VISp_5', 'VISp_6'],\n", 682 | " dtype=object)" 683 | ] 684 | }, 685 | "execution_count": 73, 686 | "metadata": {}, 687 | "output_type": "execute_result" 688 | } 689 | ], 690 | "source": [ 691 | "cell_stats[\"layer\"].unique()" 692 | ] 693 | }, 694 | { 695 | "cell_type": "code", 696 | "execution_count": null, 697 | "metadata": {}, 698 | "outputs": [], 699 | "source": [] 700 | } 701 | ], 702 | "metadata": { 703 | "kernelspec": { 704 | "display_name": "Python 3", 705 | "language": "python", 706 | "name": "python3" 707 | }, 708 | "language_info": { 709 | "codemirror_mode": { 710 | "name": "ipython", 711 | "version": 3 712 | }, 713 | "file_extension": ".py", 714 | "mimetype": "text/x-python", 715 | "name": "python", 716 | "nbconvert_exporter": "python", 717 | "pygments_lexer": "ipython3", 718 | "version": "3.7.9" 719 | } 720 | }, 721 | "nbformat": 4, 722 | "nbformat_minor": 2 723 | } 724 | -------------------------------------------------------------------------------- /annotations/ISS_layer_Annotation_new_6_layers.json: -------------------------------------------------------------------------------- 1 | [{"type": "Polygon", "coordinates": [[[39334.13312, 1362.231682], [39035.589057, 645.725932], [39354.036057, 386.987744], [41384.135683, 247.667182], [45703.073121, 227.764244], [49325.407747, 904.464119], [53962.792186, 2874.854932], [57366.194499, 5163.692745], [60072.994, 8507.386246], [61784.646626, 11453.020997], [63038.531688, 14657.393935], [62361.831813, 15334.09381], [61685.131938, 13184.57656], [59774.449938, 9323.406684], [57346.291562, 6278.257246], [54739.006749, 4287.963495], [51514.730873, 2536.504995], [49126.378372, 1760.290432], [45683.170184, 824.852369], [41483.65037, 944.269994]]], "name": "L1_polygon"}, {"type": "Polygon", "coordinates": [[[39393.841932, 1402.037557], [39732.19187, 1899.610994], [44946.761496, 1800.096307], [48171.037372, 2357.378557], [51833.177873, 3949.613558], [54818.618499, 5382.625058], [57226.873937, 7552.045246], [59575.420562, 10238.941809], [61764.743688, 15791.861373], [62262.317126, 15493.31731], [61545.811375, 13184.57656], [59674.93525, 9403.018434], [57326.388624, 6457.383683], [54619.589124, 4367.575245], [51355.507373, 2556.407932], [48947.251935, 1760.290432], [45643.364309, 944.269994], [41622.970933, 984.075869]]], "name": "L2_polygon"}, {"type": "Polygon", "coordinates": [[[39752.094807, 1959.319807], [40030.735933, 2596.213807], [43692.876433, 2576.31087], [47852.590372, 3272.913682], [51076.866248, 4248.15762], [54699.200874, 6019.519058], [56808.912249, 8069.521621], [58898.720687, 10537.485872], [61187.5585, 16189.920123], [61625.423125, 15831.667248], [59436.1, 10199.135934], [57007.941624, 7432.627621], [54699.200874, 5402.527995], [48131.231497, 2417.08737], [44847.246809, 1859.805119]]], "name": "L3_polygon"}, {"type": "Polygon", "coordinates": [[[40110.347683, 2775.340245], [40767.14462, 3750.584182], [43991.420496, 3631.166557], [47175.890497, 3969.516495], [50718.613373, 5402.527995], [54719.103811, 7731.171683], [56928.329874, 9840.883059], [58540.467812, 12687.003122], [60212.314563, 16886.522936], [61088.043813, 16209.823061], [58799.206, 10457.874122], [56589.979937, 7930.201059], [54619.589124, 6019.519058], [51017.157435, 4287.963495], [47772.978622, 3332.622495], [43593.361746, 2616.116745]]], "name": "L4_polygon"}, {"type": "Polygon", "coordinates": [[[40886.562245, 3929.71062], [41483.65037, 5123.88687], [44488.993934, 4865.148683], [49444.825372, 6278.257246], [52768.615936, 8169.036309], [55535.124249, 10776.321122], [57525.417999, 13721.955872], [59376.391187, 17463.708123], [60132.702813, 16986.037623], [58839.011875, 13602.538247], [57744.350312, 11433.118059], [56888.523999, 9920.494809], [54480.268561, 7651.559933], [50499.68106, 5382.625058], [47016.666997, 4029.225308], [43891.905809, 3690.87537]]], "name": "L5_polygon"}, {"type": "Polygon", "coordinates": [[[41543.359183, 5243.304495], [42359.379621, 7074.374746], [46897.249372, 7651.559933], [50499.68106, 8766.124434], [53604.539311, 10915.641684], [55992.891812, 14259.335185], [57923.47675, 17961.281561], [58003.0885, 18100.602124], [59217.167687, 17503.513998], [57366.194499, 13602.538247], [55475.415436, 10816.126997], [52748.712998, 8208.842184], [49265.698935, 6278.257246], [44449.188059, 4984.566308]]], "name": "L6_polygon"}] -------------------------------------------------------------------------------- /annotations/MERFISH_layer_annotation_7_layers_no_gap.json: -------------------------------------------------------------------------------- 1 | [{"type": "Polygon", "coordinates": [[[8657.87199, 21648.204049], [10013.31036, 20249.507008], [12421.3764, 17495.371597], [14454.533955, 15462.214042], [15737.874539, 13573.252058], [17843.129879, 9362.741377], [18780.401093, 6161.599695], [19241.826921, 6435.57128], [18145.940579, 9737.649862], [16127.202581, 13890.482315], [14742.925097, 15851.542084], [12810.704442, 17841.440968], [10244.023274, 20638.83505], [8859.745789, 21965.434306]]], "name": "L1_polygon_uncut"}, {"type": "Polygon", "coordinates": [[[19009.352839721287, 6297.539794429696], [19011.114007, 6291.375709], [18347.814379, 5916.467224], [18088.26235, 5772.271653], [17554.738737, 7084.451351], [15867.650553, 11093.088232], [14988.057568, 12794.595973], [13661.458313, 14611.460171], [11642.720315, 17033.945768], [9840.275674, 18706.614395], [8254.12439, 20638.83505], [7749.439891, 21302.134678], [8008.991919, 21691.46272], [8629.032875, 22023.112534], [8787.617518101995, 21852.089879792715], [8657.87199, 21648.204049], [10013.31036, 20249.507008], [12421.3764, 17495.371597], [14454.533955, 15462.214042], [15737.874539, 13573.252058], [17843.129879, 9362.741377], [18780.401093, 6161.599695], [19009.352839721287, 6297.539794429696]]], "name": "L2_polygon_uncut"}, {"type": "Polygon", "coordinates": [[[18098.364675547135, 5777.884056055793], [17900.808108, 5209.908925], [17309.606266, 4445.672397], [16516.530624, 6075.082352], [15521.581182, 8742.700421], [14050.786355, 11842.905203], [11166.87493, 15664.087841], [7965.733248, 19413.172694], [7489.887862, 19975.535422], [7230.335834, 20364.863465], [7759.959189271875, 21288.30931454148], [8254.12439, 20638.83505], [9840.275674, 18706.614395], [11642.720315, 17033.945768], [13661.458313, 14611.460171], [14988.057568, 12794.595973], [15867.650553, 11093.088232], [17554.738737, 7084.451351], [18088.26235, 5772.271653], [18098.364675547135, 5777.884056055793]]], "name": "L3_polygon_uncut"}, {"type": "Polygon", "coordinates": [[[17300.5202928321, 4464.339941867848], [17208.669366, 4142.861697], [16703.984866, 3825.63144], [16430.013281, 3710.274983], [16256.978595, 3566.079412], [15175.511811, 5642.495638], [13416.325841, 9175.287134], [11599.461643, 12145.715903], [8254.12439, 16111.094112], [6365.162406, 18735.453509], [5990.253921, 19211.298895], [5874.897464, 19600.626937], [7232.8773252363635, 20369.2947830499], [7230.335834, 20364.863465], [7489.887862, 19975.535422], [7965.733248, 19413.172694], [11166.87493, 15664.087841], [14050.786355, 11842.905203], [15521.581182, 8742.700421], [16516.530624, 6075.082352], [17300.5202928321, 4464.339941867848]]], "name": "L4_polygon_uncut"}, {"type": "Polygon", "coordinates": [[[16241.75381659296, 3595.310986551655], [15968.587453, 3061.394913], [15218.770482, 2470.193071], [14454.533955, 1864.571671], [14108.464583, 1720.3761], [13200.032485, 3537.240298], [12190.663486, 5786.69121], [10244.023274, 9103.189349], [7086.140263, 14020.258329], [5153.919608, 16514.841712], [4158.970166, 17870.280082], [3928.257252, 18158.671224], [4995.304479, 19139.201109], [5880.479228004683, 19581.78848350234], [5990.253921, 19211.298895], [6365.162406, 18735.453509], [8254.12439, 16111.094112], [11599.461643, 12145.715903], [13416.325841, 9175.287134], [15175.511811, 5642.495638], [16241.75381659296, 3595.310986551655]]], "name": "L5_polygon_uncut"}, {"type": "Polygon", "coordinates": [[[14097.649915406499, 1742.0054352108139], [13459.584513, 1316.6285], [12853.963113, 1013.817801], [12219.5026, 898.461344], [11570.622529, 2758.584213], [10460.31663, 5426.202281], [9104.878261, 7791.00965], [7028.462034, 10847.955761], [5168.339165, 13241.602244], [3337.05541, 15606.409613], [2947.727367, 16183.191898], [2702.594896, 16572.51994], [3365.894524, 17682.825839], [3944.1731783643095, 18138.776316079107], [4158.970166, 17870.280082], [5153.919608, 16514.841712], [7086.140263, 14020.258329], [10244.023274, 9103.189349], [12190.663486, 5786.69121], [13200.032485, 3537.240298], [14097.649915406499, 1742.0054352108139]]], "name": "L6a_polygon_uncut"}, {"type": "Polygon", "coordinates": [[[12208.889416447351, 928.8858034979631], [12054.069158, 809.793297], [11787.427913, 667.584633], [11254.145423, 2054.119106], [9618.745788, 5556.007455], [8125.554817, 7902.45041], [5921.320526, 10782.175854], [3734.862319, 14035.199041], [2312.77568, 16061.672502], [2206.119182, 16203.881166], [2705.8622254850466, 16567.33065199669], [2947.727367, 16183.191898], [3337.05541, 15606.409613], [5168.339165, 13241.602244], [7028.462034, 10847.955761], [9104.878261, 7791.00965], [10460.31663, 5426.202281], [11570.622529, 2758.584213], [12208.889416447351, 928.8858034979631]]], "name": "L6b_polygon_uncut"}] -------------------------------------------------------------------------------- /annotations/MERFISH_layer_annotation_7_layers_no_gap_um.json: -------------------------------------------------------------------------------- 1 | [{"type": "Polygon", "name": "L1_polygon_uncut", "coordinates": [[[2087.318600522, 6881.6763964822], [2233.434856808, 6730.896855462401], [2493.0243759200002, 6434.0010581566], [2712.198760349, 6214.8266737276], [2850.5428753042, 6011.1965718524], [3077.4894009562004, 5557.303520440601], [3178.5272378254003, 5212.220447121], [3228.2689420838, 5241.754583984], [3110.1323944162, 5597.7186551236], [2892.5124382318, 6045.393993557], [2743.2873254566002, 6256.7962366552], [2534.9939388476, 6471.3073363504], [2258.3057089372, 6772.86641839], [2109.0805960542, 6915.8738181868]]]}, {"type": "Polygon", "name": "L2_polygon_uncut", "coordinates": [[[3203.208236152, 5226.8747897932], [3203.3980899546, 5226.2103014302], [3131.8943900562, 5185.7951667472], [3103.9146813300003, 5170.2508841933995], [3046.4008358486, 5311.7038556378], [2864.5327296134, 5743.8349114096], [2769.7126058304, 5927.2574458894], [2626.7052061413997, 6123.115406433801], [2409.085249957, 6384.2593537904], [2214.7817176572, 6564.573031781], [2043.7946092420002, 6772.86641839], [1989.3896202498, 6844.3701182884], [2017.3693288682002, 6886.339681216], [2084.209743925, 6922.091531165201], [2101.3051684404, 6903.655289064], [2087.318600522, 6881.6763964822], [2233.434856808, 6730.896855462401], [2493.0243759200002, 6434.0010581566], [2712.198760349, 6214.8266737276], [2850.5428753042, 6011.1965718524], [3077.4894009562004, 5557.303520440601], [3178.5272378254003, 5212.220447121], [3203.208236152, 5226.8747897932]]]}, {"type": "Polygon", "name": "L3_polygon_uncut", "coordinates": [[[3105.0037120728, 5170.8559012368005], [3083.7071140424005, 5109.628182115], [3019.9755554748, 5027.2434843966], [2934.4820012672, 5202.8938775456], [2827.2264514196004, 5490.4631053838], [2668.674769069, 5824.6651808834], [2357.789117454, 6236.5886692598], [2012.7060441344001, 6640.7400164132], [1961.4099115236, 6701.3627184916], [1933.4302029052, 6743.332281527], [1990.5236005742, 6842.8797441570005], [2043.7946092420002, 6772.86641839], [2214.7817176572, 6564.573031781], [2409.085249957, 6384.2593537904], [2626.7052061413997, 6123.115406433801], [2769.7126058304, 5927.2574458894], [2864.5327296134, 5743.8349114096], [3046.4008358486, 5311.7038556378], [3103.9146813300003, 5170.2508841933995], [3105.0037120728, 5170.8559012368005]]]}, {"type": "Polygon", "name": "L4_polygon_uncut", "coordinates": [[[3018.9960875854003, 5029.2558457476], [3009.0945576548, 4994.6004909366], [2954.6895685547997, 4960.403069232], [2925.1554316918, 4947.9676431674], [2906.5022925410003, 4932.4233606136], [2789.9201732258, 5156.2610297764], [2600.2799256598, 5537.0959530452], [2404.4219651154, 5857.3081743434], [2043.7946092420002, 6284.7759452736], [1840.1645073668, 6567.6818882702], [1799.7493726838002, 6618.978020881001], [1787.3139466192001, 6660.9475838086], [1933.704175635, 6743.8099776074005], [1933.4302029052, 6743.332281527], [1961.4099115236, 6701.3627184916], [2012.7060441344001, 6640.7400164132], [2357.789117454, 6236.5886692598], [2668.674769069, 5824.6651808834], [2827.2264514196004, 5490.4631053838], [2934.4820012672, 5202.8938775456], [3018.9960875854003, 5029.2558457476]]]}, {"type": "Polygon", "name": "L5_polygon_uncut", "coordinates": [[[2904.8610614726003, 4935.5745243986], [2875.4137274334, 4878.0183716214], [2794.5834579596003, 4814.2868130538], [2712.198760349, 4749.0008261338], [2674.8924820474003, 4733.45654358], [2576.9635018830004, 4929.3145041244], [2468.1535237908, 5171.805312438], [2258.3057089372, 5529.3238118222], [1917.8859203514, 6059.3838478662], [1709.5925337424, 6328.2999365536], [1602.3369838948001, 6474.416192839601], [1577.4661317656, 6505.5047579472], [1692.4938228362, 6611.2058795502], [1787.9156607784, 6658.9167985752], [1799.7493726838002, 6618.978020881001], [1840.1645073668, 6567.6818882702], [2043.7946092420002, 6284.7759452736], [2404.4219651154, 5857.3081743434], [2600.2799256598, 5537.0959530452], [2789.9201732258, 5156.2610297764], [2904.8610614726003, 4935.5745243986]]]}, {"type": "Polygon", "name": "L6a_polygon_uncut", "coordinates": [[[2673.726660837, 4735.788185893], [2604.9432105014002, 4689.9325523], [2539.6572235814, 4657.2895589478], [2471.26238028, 4644.8541328832], [2401.3131086262, 4845.3753781614], [2281.622132714, 5132.9446058918], [2135.5058765358, 5387.87084027], [1911.6682072652002, 5717.4096310358], [1711.146961987, 5975.4447219032], [1513.734573198, 6230.3709562814], [1471.7650101626, 6292.5480866044], [1445.3397297888, 6334.517649532], [1516.8434296872001, 6454.2086254442], [1579.1818685884, 6503.3600868648], [1602.3369838948001, 6474.416192839601], [1709.5925337424, 6328.2999365536], [1917.8859203514, 6059.3838478662], [2258.3057089372, 5529.3238118222], [2468.1535237908, 5171.805312438], [2576.9635018830004, 4929.3145041244], [2673.726660837, 4735.788185893]]]}, {"type": "Polygon", "name": "L6b_polygon_uncut", "coordinates": [[[2470.1182790448, 4648.1338895634], [2453.4286552324, 4635.2957174166], [2424.6847290214, 4619.9656234374], [2367.1968765994, 4769.4340396268], [2190.9007959464, 5146.937603649], [2029.9348092726, 5399.884154198], [1792.3183527028, 5710.3185570612], [1556.6181579882, 6060.9944566198], [1403.317218304, 6279.4482957156], [1391.8196478196, 6294.7783896948], [1445.691947855, 6333.9582442856], [1471.7650101626, 6292.5480866044], [1513.734573198, 6230.3709562814], [1711.146961987, 5975.4447219032], [1911.6682072652002, 5717.4096310358], [2135.5058765358, 5387.87084027], [2281.622132714, 5132.9446058918], [2401.3131086262, 4845.3753781614], [2470.1182790448, 4648.1338895634]]]}] -------------------------------------------------------------------------------- /annotations/SpaceJam_Data_Annotation_Allen_smFISH.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "metadata": {}, 7 | "outputs": [ 8 | { 9 | "data": { 10 | "text/html": [ 11 | "" 12 | ], 13 | "text/plain": [ 14 | "" 15 | ] 16 | }, 17 | "metadata": {}, 18 | "output_type": "display_data" 19 | } 20 | ], 21 | "source": [ 22 | "%gui qt\n", 23 | "import napari\n", 24 | "import pandas as pd\n", 25 | "import numpy as np\n", 26 | "from IPython.core.display import display, HTML\n", 27 | "display(HTML(\"\"))\n", 28 | "from shapely.geometry import Polygon, Point" 29 | ] 30 | }, 31 | { 32 | "cell_type": "markdown", 33 | "metadata": {}, 34 | "source": [ 35 | "## Make a napari viewer..." 36 | ] 37 | }, 38 | { 39 | "cell_type": "code", 40 | "execution_count": 2, 41 | "metadata": {}, 42 | "outputs": [], 43 | "source": [ 44 | "v = napari.Viewer()" 45 | ] 46 | }, 47 | { 48 | "cell_type": "markdown", 49 | "metadata": {}, 50 | "source": [ 51 | "## Load cell x gene data from 1 dataset" 52 | ] 53 | }, 54 | { 55 | "cell_type": "code", 56 | "execution_count": 46, 57 | "metadata": {}, 58 | "outputs": [], 59 | "source": [ 60 | "all_cells = pd.read_csv(\"/Users/brian/Downloads/smFISH_mapping (1)/smFISH_expressionMatrix.csv\")\n", 61 | "\n", 62 | "metadata = pd.read_csv(\"/Users/brian/Downloads/smFISH_mapping (1)/smFISH_metaData.csv\")\n", 63 | "metadata[\"x_um\"] = metadata[\"x\"]*1e3\n", 64 | "metadata[\"y_um\"] = metadata[\"y\"]*1e3" 65 | ] 66 | }, 67 | { 68 | "cell_type": "code", 69 | "execution_count": 47, 70 | "metadata": {}, 71 | "outputs": [], 72 | "source": [ 73 | "all_cells = all_cells.T.rename(columns = all_cells[\"Unnamed: 0\"])\n", 74 | "\n", 75 | "all_cells = all_cells.drop(\"Unnamed: 0\")\n", 76 | "\n", 77 | "\n", 78 | "all_cells.index.name= \"cellID\"\n", 79 | "\n", 80 | "\n", 81 | "metadata = metadata.set_index(\"cellID\")" 82 | ] 83 | }, 84 | { 85 | "cell_type": "code", 86 | "execution_count": 48, 87 | "metadata": {}, 88 | "outputs": [], 89 | "source": [ 90 | "all_cells = all_cells.merge(metadata, on = \"cellID\")" 91 | ] 92 | }, 93 | { 94 | "cell_type": "markdown", 95 | "metadata": {}, 96 | "source": [ 97 | "### Add the cells as points, double-plotting cells with high Rorb, Cux2 if available" 98 | ] 99 | }, 100 | { 101 | "cell_type": "code", 102 | "execution_count": 50, 103 | "metadata": {}, 104 | "outputs": [], 105 | "source": [ 106 | "cells = v.add_points(all_cells[[\"x_um\",\"y_um\"]], symbol='o', name = \"all\", opacity = 0.8, blending = \"translucent\")\n", 107 | "colorlist = [\"magenta\", \"green\",\"yellow\",\"cyan\", \"blue\", \"orange\"]\n", 108 | "for ii, gene_to_plot in enumerate([\"Cux2\", \"Atp1a3\" , \"Vxn\", \"Pcp4\" , \"Fezf2\" , \"Rorb\" , \"Gm11549\"]):\n", 109 | "\n", 110 | " if gene_to_plot in all_cells:\n", 111 | " cux2condition = all_cells[gene_to_plot]>0.5*all_cells[gene_to_plot].median()\n", 112 | " cux2cells = v.add_points(all_cells[cux2condition][[\"x_um\",\"y_um\"]], symbol='disc',\n", 113 | " name = gene_to_plot+\"+\",edge_color= \"black\", size = 10,\n", 114 | " face_color= colorlist[ ii % len(colorlist)] , blending = \"translucent\", opacity = 0.3)\n" 115 | ] 116 | }, 117 | { 118 | "cell_type": "markdown", 119 | "metadata": {}, 120 | "source": [ 121 | "### annotate the layers in that viewer in a single `shapes` layer\n", 122 | "#### Naming/order Convention:\n", 123 | "0. outline of entire column as rectangle\n", 124 | "1. Layer 1\n", 125 | "1. Layer 2/3\n", 126 | "2. Layer 4\n", 127 | "3. Layer 5\n", 128 | "4. Layer 6\n", 129 | "5. single line segment, pointing from pia to white matter " 130 | ] 131 | }, 132 | { 133 | "cell_type": "markdown", 134 | "metadata": {}, 135 | "source": [ 136 | "#### annotate the layer locations in a list" 137 | ] 138 | }, 139 | { 140 | "cell_type": "code", 141 | "execution_count": 51, 142 | "metadata": {}, 143 | "outputs": [ 144 | { 145 | "data": { 146 | "text/plain": [ 147 | "[,\n", 148 | " ,\n", 149 | " ,\n", 150 | " ,\n", 151 | " ]" 152 | ] 153 | }, 154 | "execution_count": 51, 155 | "metadata": {}, 156 | "output_type": "execute_result" 157 | } 158 | ], 159 | "source": [ 160 | "v.layers" 161 | ] 162 | }, 163 | { 164 | "cell_type": "code", 165 | "execution_count": 52, 166 | "metadata": {}, 167 | "outputs": [ 168 | { 169 | "data": { 170 | "text/plain": [ 171 | "[array([[-1887.5990672 , -2286.80536833],\n", 172 | " [ -846.4396003 , -1551.17834779],\n", 173 | " [-1618.3180774 , -458.71088631],\n", 174 | " [-2659.4775443 , -1194.33790685]]),\n", 175 | " array([[-1865.69121122, -2265.07801297],\n", 176 | " [-1742.97664837, -2178.35013097],\n", 177 | " [-2504.78129225, -1100.44390638],\n", 178 | " [-2627.4958551 , -1187.17178838]]),\n", 179 | " array([[-1744.80471456, -2168.98522852],\n", 180 | " [-1505.5479902 , -2000.76022336],\n", 181 | " [-2255.98031504, -933.46360047],\n", 182 | " [-2495.2370394 , -1101.68860563]]),\n", 183 | " array([[-1504.51910557, -1990.85887509],\n", 184 | " [-1287.84057632, -1834.85033403],\n", 185 | " [-2045.49768122, -782.54879945],\n", 186 | " [-2262.17621047, -938.55734051]]),\n", 187 | " array([[-1295.06502424, -1840.32945847],\n", 188 | " [-1062.55301538, -1676.42322362],\n", 189 | " [-1812.73978189, -612.23288168],\n", 190 | " [-2045.25179076, -776.13911653]]),\n", 191 | " array([[-1057.21424803, -1682.87121315],\n", 192 | " [ -861.17678461, -1543.97827347],\n", 193 | " [-1615.33244221, -479.54143102],\n", 194 | " [-1811.36990564, -618.4343707 ]]),\n", 195 | " array([[-2252.12889723, -1740.12205266],\n", 196 | " [-1258.38295878, -1024.71699048]])]" 197 | ] 198 | }, 199 | "execution_count": 52, 200 | "metadata": {}, 201 | "output_type": "execute_result" 202 | } 203 | ], 204 | "source": [ 205 | "v.layers[-1].data" 206 | ] 207 | }, 208 | { 209 | "cell_type": "code", 210 | "execution_count": 53, 211 | "metadata": {}, 212 | "outputs": [], 213 | "source": [ 214 | "is_in_layer = {ii:[Polygon(p).intersects(Point(a)) for a in v.layers[0].data] for ii,p in enumerate(v.layers[-1].data[:-1])}\n", 215 | "column_points = v.layers[-1].data[-1]" 216 | ] 217 | }, 218 | { 219 | "cell_type": "code", 220 | "execution_count": null, 221 | "metadata": {}, 222 | "outputs": [], 223 | "source": [ 224 | "# ok:\n", 225 | "# 1. make a couple functions to do this\n", 226 | "#. #. do a spatially partitioned search based on bounding box of polygon\n", 227 | "# 2. throw annotation into separate vector matched to point cloud\n", 228 | "#. " 229 | ] 230 | }, 231 | { 232 | "cell_type": "code", 233 | "execution_count": 54, 234 | "metadata": {}, 235 | "outputs": [], 236 | "source": [ 237 | "# depth coordinate calculation\n", 238 | "\n", 239 | "def depth_coordinate(points_xy, column_axis_points):\n", 240 | " \"\"\" \n", 241 | " calculate the projection along the column axis vector\n", 242 | " assumes that the pia is the first point in column_axis_points\n", 243 | " \"\"\"\n", 244 | " column_vec = np.diff(column_axis_points, axis = 0)\n", 245 | " column_vec = column_vec.T/np.linalg.norm(column_vec,2)\n", 246 | " \n", 247 | " output_array = np.row_stack(\n", 248 | " [np.dot(a_point-column_axis_points[0],column_vec) for a_point in points_xy])\n", 249 | " return output_array" 250 | ] 251 | }, 252 | { 253 | "cell_type": "code", 254 | "execution_count": 55, 255 | "metadata": {}, 256 | "outputs": [], 257 | "source": [ 258 | "all_cells[\"depth_um\"] = depth_coordinate(all_cells[[\"x_um\",\"y_um\"]].values, column_points)\n", 259 | "all_cells[\"layer\"] = \"outside_VISp\"\n", 260 | "layer_list = [\"VISp\", \"VISp_I\", \"VISp_II/III\", \"VISp_IV\", \"VISp_V\",\"VISp_VI\"]\n", 261 | "for l_key in is_in_layer.keys():\n", 262 | " all_cells.loc[is_in_layer[l_key],\"layer\"] = layer_list[l_key]\n", 263 | " " 264 | ] 265 | }, 266 | { 267 | "cell_type": "code", 268 | "execution_count": 13, 269 | "metadata": {}, 270 | "outputs": [ 271 | { 272 | "data": { 273 | "text/plain": [ 274 | "dict_keys([0, 1, 2, 3, 4, 5, 6])" 275 | ] 276 | }, 277 | "execution_count": 13, 278 | "metadata": {}, 279 | "output_type": "execute_result" 280 | } 281 | ], 282 | "source": [ 283 | "is_in_layer.keys()" 284 | ] 285 | }, 286 | { 287 | "cell_type": "code", 288 | "execution_count": 56, 289 | "metadata": {}, 290 | "outputs": [], 291 | "source": [ 292 | "all_cells.to_csv(\"Allen_smFISH_with_depth.csv\")" 293 | ] 294 | }, 295 | { 296 | "cell_type": "code", 297 | "execution_count": 57, 298 | "metadata": {}, 299 | "outputs": [ 300 | { 301 | "data": { 302 | "text/html": [ 303 | "
\n", 304 | "\n", 317 | "\n", 318 | " \n", 319 | " \n", 320 | " \n", 321 | " \n", 322 | " \n", 323 | " \n", 324 | " \n", 325 | " \n", 326 | " \n", 327 | " \n", 328 | " \n", 329 | " \n", 330 | " \n", 331 | " \n", 332 | " \n", 333 | " \n", 334 | " \n", 335 | " \n", 336 | " \n", 337 | " \n", 338 | " \n", 339 | " \n", 340 | " \n", 341 | " \n", 342 | " \n", 343 | " \n", 344 | " \n", 345 | " \n", 346 | " \n", 347 | " \n", 348 | " \n", 349 | " \n", 350 | " \n", 351 | " \n", 352 | " \n", 353 | " \n", 354 | " \n", 355 | " \n", 356 | " \n", 357 | " \n", 358 | " \n", 359 | " \n", 360 | " \n", 361 | " \n", 362 | " \n", 363 | " \n", 364 | " \n", 365 | " \n", 366 | " \n", 367 | " \n", 368 | " \n", 369 | " \n", 370 | " \n", 371 | " \n", 372 | " \n", 373 | " \n", 374 | " \n", 375 | " \n", 376 | " \n", 377 | " \n", 378 | " \n", 379 | " \n", 380 | " \n", 381 | " \n", 382 | " \n", 383 | " \n", 384 | " \n", 385 | " \n", 386 | " \n", 387 | " \n", 388 | " \n", 389 | " \n", 390 | " \n", 391 | " \n", 392 | " \n", 393 | " \n", 394 | " \n", 395 | " \n", 396 | " \n", 397 | " \n", 398 | " \n", 399 | " \n", 400 | " \n", 401 | " \n", 402 | " \n", 403 | " \n", 404 | " \n", 405 | " \n", 406 | " \n", 407 | " \n", 408 | " \n", 409 | " \n", 410 | " \n", 411 | " \n", 412 | " \n", 413 | " \n", 414 | " \n", 415 | " \n", 416 | " \n", 417 | " \n", 418 | " \n", 419 | " \n", 420 | " \n", 421 | " \n", 422 | " \n", 423 | " \n", 424 | " \n", 425 | " \n", 426 | " \n", 427 | " \n", 428 | " \n", 429 | " \n", 430 | " \n", 431 | " \n", 432 | " \n", 433 | " \n", 434 | " \n", 435 | " \n", 436 | " \n", 437 | " \n", 438 | " \n", 439 | " \n", 440 | " \n", 441 | " \n", 442 | " \n", 443 | " \n", 444 | " \n", 445 | " \n", 446 | " \n", 447 | " \n", 448 | " \n", 449 | " \n", 450 | " \n", 451 | " \n", 452 | " \n", 453 | " \n", 454 | " \n", 455 | " \n", 456 | " \n", 457 | " \n", 458 | " \n", 459 | " \n", 460 | " \n", 461 | " \n", 462 | " \n", 463 | " \n", 464 | " \n", 465 | " \n", 466 | " \n", 467 | " \n", 468 | " \n", 469 | " \n", 470 | " \n", 471 | " \n", 472 | " \n", 473 | " \n", 474 | " \n", 475 | " \n", 476 | " \n", 477 | " \n", 478 | " \n", 479 | " \n", 480 | " \n", 481 | " \n", 482 | " \n", 483 | " \n", 484 | " \n", 485 | " \n", 486 | " \n", 487 | " \n", 488 | " \n", 489 | " \n", 490 | " \n", 491 | " \n", 492 | " \n", 493 | " \n", 494 | " \n", 495 | " \n", 496 | " \n", 497 | " \n", 498 | " \n", 499 | " \n", 500 | " \n", 501 | " \n", 502 | " \n", 503 | " \n", 504 | " \n", 505 | " \n", 506 | " \n", 507 | " \n", 508 | " \n", 509 | " \n", 510 | " \n", 511 | " \n", 512 | " \n", 513 | " \n", 514 | " \n", 515 | " \n", 516 | " \n", 517 | " \n", 518 | " \n", 519 | " \n", 520 | " \n", 521 | " \n", 522 | " \n", 523 | " \n", 524 | " \n", 525 | " \n", 526 | " \n", 527 | " \n", 528 | " \n", 529 | " \n", 530 | " \n", 531 | " \n", 532 | " \n", 533 | " \n", 534 | " \n", 535 | " \n", 536 | " \n", 537 | " \n", 538 | " \n", 539 | " \n", 540 | " \n", 541 | " \n", 542 | " \n", 543 | " \n", 544 | " \n", 545 | " \n", 546 | " \n", 547 | " \n", 548 | " \n", 549 | " \n", 550 | " \n", 551 | " \n", 552 | " \n", 553 | " \n", 554 | " \n", 555 | " \n", 556 | " \n", 557 | " \n", 558 | " \n", 559 | " \n", 560 | " \n", 561 | " \n", 562 | " \n", 563 | " \n", 564 | " \n", 565 | " \n", 566 | " \n", 567 | " \n", 568 | " \n", 569 | " \n", 570 | " \n", 571 | " \n", 572 | " \n", 573 | " \n", 574 | " \n", 575 | " \n", 576 | " \n", 577 | " \n", 578 | " \n", 579 | " \n", 580 | " \n", 581 | " \n", 582 | " \n", 583 | " \n", 584 | " \n", 585 | " \n", 586 | " \n", 587 | " \n", 588 | " \n", 589 | " \n", 590 | " \n", 591 | " \n", 592 | " \n", 593 | " \n", 594 | " \n", 595 | " \n", 596 | " \n", 597 | " \n", 598 | " \n", 599 | " \n", 600 | " \n", 601 | " \n", 602 | " \n", 603 | " \n", 604 | " \n", 605 | " \n", 606 | " \n", 607 | " \n", 608 | " \n", 609 | " \n", 610 | " \n", 611 | " \n", 612 | " \n", 613 | " \n", 614 | " \n", 615 | " \n", 616 | " \n", 617 | " \n", 618 | " \n", 619 | " \n", 620 | " \n", 621 | " \n", 622 | " \n", 623 | " \n", 624 | " \n", 625 | " \n", 626 | " \n", 627 | " \n", 628 | " \n", 629 | " \n", 630 | " \n", 631 | " \n", 632 | " \n", 633 | " \n", 634 | "
AlcamChodlCux2Fezf2Foxp2Gad2Galnt14Grin3aKcnip4Kcnk2...xyzarealayerDataexperimentx_umy_umdepth_umlayer
cellID
Cell_12121229133131807554946...-2.010159-0.5388220.0041360.0005810MouseVISp_AI-2010.158777-538.821628898.241746outside_VISp
Cell_270531796614121530...-1.984237-0.7206380.0042270.0004840MouseVISp_AI-1984.236740-720.637885813.052193VISp
Cell_316941136412143428...-1.725721-1.9843650.0042660.0006400MouseVISp_AI-1725.720789-1984.364680284.516980VISp_II/III
Cell_4133284146320118...-2.340063-0.6303260.0042500.0005310MouseVISp_AI-2340.062786-630.326065577.039612outside_VISp
Cell_5271654429300170...-1.908918-0.1778100.0042560.0005670MouseVISp_AI-1908.917654-177.8101411191.328852outside_VISp
..................................................................
Cell_1962472302102122...-1.937050-1.7445020.0042630.0001290MouseVISp_AI-1937.049915-1744.502433253.149381VISp_II/III
Cell_1976550160000002...-1.565728-1.9754400.0042520.0001090MouseVISp_AI-1565.728195-1975.439780419.576585VISp_II/III
Cell_2010202241211121...-2.468299-0.7118180.0042670.0001180MouseVISp_AI-2468.299305-711.818023425.354601outside_VISp
Cell_2012840122007010...-2.486177-1.2703200.0041700.0001450MouseVISp_AI-2486.177308-1270.32043684.537392VISp_I
Cell_2068340340000001...-2.234864-1.1209010.0041570.0001060MouseVISp_AI-2234.863576-1120.900665375.795354VISp_II/III
\n", 635 | "

1717 rows × 32 columns

\n", 636 | "
" 637 | ], 638 | "text/plain": [ 639 | " Alcam Chodl Cux2 Fezf2 Foxp2 Gad2 Galnt14 Grin3a Kcnip4 Kcnk2 ... \\\n", 640 | "cellID ... \n", 641 | "Cell_1 212 12 29 133 13 180 75 54 9 46 ... \n", 642 | "Cell_2 70 5 3 179 6 6 141 21 5 30 ... \n", 643 | "Cell_3 169 4 113 6 4 121 4 3 4 28 ... \n", 644 | "Cell_4 133 2 84 1 4 63 2 0 1 18 ... \n", 645 | "Cell_5 27 1 6 54 42 93 0 0 1 70 ... \n", 646 | "... ... ... ... ... ... ... ... ... ... ... ... \n", 647 | "Cell_1962 47 2 30 2 1 0 2 1 2 2 ... \n", 648 | "Cell_1976 55 0 16 0 0 0 0 0 0 2 ... \n", 649 | "Cell_2010 20 2 24 1 2 1 1 1 2 1 ... \n", 650 | "Cell_2012 84 0 1 2 2 0 0 7 0 10 ... \n", 651 | "Cell_2068 34 0 34 0 0 0 0 0 0 1 ... \n", 652 | "\n", 653 | " x y z area layerData experiment \\\n", 654 | "cellID \n", 655 | "Cell_1 -2.010159 -0.538822 0.004136 0.000581 0 MouseVISp_AI \n", 656 | "Cell_2 -1.984237 -0.720638 0.004227 0.000484 0 MouseVISp_AI \n", 657 | "Cell_3 -1.725721 -1.984365 0.004266 0.000640 0 MouseVISp_AI \n", 658 | "Cell_4 -2.340063 -0.630326 0.004250 0.000531 0 MouseVISp_AI \n", 659 | "Cell_5 -1.908918 -0.177810 0.004256 0.000567 0 MouseVISp_AI \n", 660 | "... ... ... ... ... ... ... \n", 661 | "Cell_1962 -1.937050 -1.744502 0.004263 0.000129 0 MouseVISp_AI \n", 662 | "Cell_1976 -1.565728 -1.975440 0.004252 0.000109 0 MouseVISp_AI \n", 663 | "Cell_2010 -2.468299 -0.711818 0.004267 0.000118 0 MouseVISp_AI \n", 664 | "Cell_2012 -2.486177 -1.270320 0.004170 0.000145 0 MouseVISp_AI \n", 665 | "Cell_2068 -2.234864 -1.120901 0.004157 0.000106 0 MouseVISp_AI \n", 666 | "\n", 667 | " x_um y_um depth_um layer \n", 668 | "cellID \n", 669 | "Cell_1 -2010.158777 -538.821628 898.241746 outside_VISp \n", 670 | "Cell_2 -1984.236740 -720.637885 813.052193 VISp \n", 671 | "Cell_3 -1725.720789 -1984.364680 284.516980 VISp_II/III \n", 672 | "Cell_4 -2340.062786 -630.326065 577.039612 outside_VISp \n", 673 | "Cell_5 -1908.917654 -177.810141 1191.328852 outside_VISp \n", 674 | "... ... ... ... ... \n", 675 | "Cell_1962 -1937.049915 -1744.502433 253.149381 VISp_II/III \n", 676 | "Cell_1976 -1565.728195 -1975.439780 419.576585 VISp_II/III \n", 677 | "Cell_2010 -2468.299305 -711.818023 425.354601 outside_VISp \n", 678 | "Cell_2012 -2486.177308 -1270.320436 84.537392 VISp_I \n", 679 | "Cell_2068 -2234.863576 -1120.900665 375.795354 VISp_II/III \n", 680 | "\n", 681 | "[1717 rows x 32 columns]" 682 | ] 683 | }, 684 | "execution_count": 57, 685 | "metadata": {}, 686 | "output_type": "execute_result" 687 | } 688 | ], 689 | "source": [ 690 | "all_cells" 691 | ] 692 | }, 693 | { 694 | "cell_type": "code", 695 | "execution_count": null, 696 | "metadata": {}, 697 | "outputs": [], 698 | "source": [] 699 | } 700 | ], 701 | "metadata": { 702 | "kernelspec": { 703 | "display_name": "Python 3", 704 | "language": "python", 705 | "name": "python3" 706 | }, 707 | "language_info": { 708 | "codemirror_mode": { 709 | "name": "ipython", 710 | "version": 3 711 | }, 712 | "file_extension": ".py", 713 | "mimetype": "text/x-python", 714 | "name": "python", 715 | "nbconvert_exporter": "python", 716 | "pygments_lexer": "ipython3", 717 | "version": "3.7.4" 718 | } 719 | }, 720 | "nbformat": 4, 721 | "nbformat_minor": 2 722 | } 723 | -------------------------------------------------------------------------------- /annotations/SpaceJam_Data_Annotation_Allen_smFISH_update.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "metadata": {}, 7 | "outputs": [ 8 | { 9 | "data": { 10 | "text/html": [ 11 | "" 12 | ], 13 | "text/plain": [ 14 | "" 15 | ] 16 | }, 17 | "metadata": {}, 18 | "output_type": "display_data" 19 | } 20 | ], 21 | "source": [ 22 | "%matplotlib notebook\n", 23 | "import napari\n", 24 | "import pandas as pd\n", 25 | "import numpy as np\n", 26 | "from IPython.core.display import display, HTML\n", 27 | "display(HTML(\"\"))\n", 28 | "from shapely.geometry import Polygon, Point,LineString, mapping;\n", 29 | "from shapely.ops import cascaded_union\n", 30 | "from spacetx_spatial_analysis import polyToGeoJson\n", 31 | "import json\n", 32 | "import geojson\n", 33 | "\n", 34 | "from matplotlib import pyplot as plt" 35 | ] 36 | }, 37 | { 38 | "cell_type": "markdown", 39 | "metadata": {}, 40 | "source": [ 41 | "## Load cell x gene data from 1 dataset" 42 | ] 43 | }, 44 | { 45 | "cell_type": "code", 46 | "execution_count": null, 47 | "metadata": {}, 48 | "outputs": [], 49 | "source": [ 50 | "all_cells = pd.read_csv(\"/Users/brian/Downloads/mask_prior/segmentation_counts.tsv\", delimiter = \"\\t\")" 51 | ] 52 | }, 53 | { 54 | "cell_type": "code", 55 | "execution_count": null, 56 | "metadata": {}, 57 | "outputs": [], 58 | "source": [ 59 | "counts = all_cells.T\n", 60 | "counts.columns = all_cells[\"gene\"]\n", 61 | "counts = counts[1:]" 62 | ] 63 | }, 64 | { 65 | "cell_type": "code", 66 | "execution_count": 2, 67 | "metadata": {}, 68 | "outputs": [], 69 | "source": [ 70 | "metadata = pd.read_csv(\"/Users/brian/Downloads/mask_prior/segmentation_cell_stats.csv\")" 71 | ] 72 | }, 73 | { 74 | "cell_type": "code", 75 | "execution_count": 3, 76 | "metadata": {}, 77 | "outputs": [], 78 | "source": [ 79 | "metadata[\"x_um\"] = 0.1*metadata[\"x\"]\n", 80 | "metadata[\"y_um\"] = 0.1*metadata[\"y\"]" 81 | ] 82 | }, 83 | { 84 | "cell_type": "code", 85 | "execution_count": 4, 86 | "metadata": {}, 87 | "outputs": [], 88 | "source": [ 89 | "v = napari.Viewer()" 90 | ] 91 | }, 92 | { 93 | "cell_type": "code", 94 | "execution_count": 5, 95 | "metadata": {}, 96 | "outputs": [ 97 | { 98 | "data": { 99 | "text/plain": [ 100 | "" 101 | ] 102 | }, 103 | "execution_count": 5, 104 | "metadata": {}, 105 | "output_type": "execute_result" 106 | } 107 | ], 108 | "source": [ 109 | "v.add_points(metadata[[\"x_um\",\"y_um\"]], size=10)" 110 | ] 111 | }, 112 | { 113 | "cell_type": "markdown", 114 | "metadata": {}, 115 | "source": [ 116 | "# load our annotated the layer locations " 117 | ] 118 | }, 119 | { 120 | "cell_type": "code", 121 | "execution_count": 77, 122 | "metadata": {}, 123 | "outputs": [ 124 | { 125 | "data": { 126 | "text/plain": [ 127 | "" 128 | ] 129 | }, 130 | "execution_count": 77, 131 | "metadata": {}, 132 | "output_type": "execute_result" 133 | } 134 | ], 135 | "source": [ 136 | "with open(\"Allen_smFISH_annotations_geo.json\",'r') as r:\n", 137 | " gcnew = geojson.load(r)\n", 138 | "\n", 139 | "shapes_to_add = [np.array(geo[\"coordinates\"][0]) for geo in gcnew[\"geometries\"][1:-1]]\n", 140 | "column_points = gcnew[\"geometries\"][-1][\"coordinates\"]\n", 141 | "\n", 142 | "annotation_names = [g['name'] for g in gcnew[\"geometries\"][1:]]\n", 143 | "v.add_shapes(shapes_to_add,shape_type='polygon',\n", 144 | " edge_width=1,\n", 145 | " edge_color='coral',\n", 146 | " face_color='royalblue',\n", 147 | " name=\"layer annotations\")\n", 148 | "\n", 149 | "# for ii,g in enumerate(shapes_to_add[:-1]):\n", 150 | "# carray = g\n", 151 | "# v.add_shapes([carray],shape_type='polygon',\n", 152 | "# edge_width=1,\n", 153 | "# edge_color='coral',\n", 154 | "# face_color='royalblue',\n", 155 | "# name=gcnew[\"geometries\"][ii][\"name\"])\n" 156 | ] 157 | }, 158 | { 159 | "cell_type": "code", 160 | "execution_count": 78, 161 | "metadata": {}, 162 | "outputs": [ 163 | { 164 | "data": { 165 | "text/plain": [ 166 | "['VISp_I', 'VISp_II/III', 'VISp_IV', 'VISp_V', 'VISp_VI', 'cortical_axis']" 167 | ] 168 | }, 169 | "execution_count": 78, 170 | "metadata": {}, 171 | "output_type": "execute_result" 172 | } 173 | ], 174 | "source": [ 175 | "annotation_names" 176 | ] 177 | }, 178 | { 179 | "cell_type": "code", 180 | "execution_count": 79, 181 | "metadata": {}, 182 | "outputs": [ 183 | { 184 | "name": "stdout", 185 | "output_type": "stream", 186 | "text": [ 187 | "[[6895.070696, 5736.902356], [12811.78951, 15864.619246]]\n", 188 | "dict_keys([0, 1, 2, 3, 4])\n" 189 | ] 190 | } 191 | ], 192 | "source": [ 193 | "\n", 194 | "\n", 195 | "shapes_layer = v.layers[-1]\n", 196 | "\n", 197 | "is_in_layer = {ii:[Polygon(p).intersects(Point(a)) for a in v.layers[0].data] for ii,p in enumerate(shapes_layer.data)}\n", 198 | "print(column_points)\n", 199 | "print(is_in_layer.keys())" 200 | ] 201 | }, 202 | { 203 | "cell_type": "code", 204 | "execution_count": 67, 205 | "metadata": {}, 206 | "outputs": [], 207 | "source": [ 208 | "# depth coordinate calculation\n", 209 | "\n", 210 | "def depth_coordinate(points_xy, column_axis_points):\n", 211 | " \"\"\" \n", 212 | " calculate the projection along the column axis vector\n", 213 | " assumes that the pia is the first point in column_axis_points\n", 214 | " \"\"\"\n", 215 | " column_vec = np.diff(column_axis_points, axis = 0)\n", 216 | " column_vec = column_vec.T/np.linalg.norm(column_vec,2)\n", 217 | " \n", 218 | " output_array = np.row_stack(\n", 219 | " [np.dot(a_point-column_axis_points[0],column_vec) for a_point in points_xy])\n", 220 | " return output_array" 221 | ] 222 | }, 223 | { 224 | "cell_type": "code", 225 | "execution_count": 80, 226 | "metadata": {}, 227 | "outputs": [], 228 | "source": [ 229 | "metadata[\"layer\"] = \"outside_VISp\"\n", 230 | "for l_key in is_in_layer.keys():\n", 231 | " metadata.loc[is_in_layer[l_key],\"layer\"] = annotation_names[l_key]\n", 232 | " " 233 | ] 234 | }, 235 | { 236 | "cell_type": "code", 237 | "execution_count": 81, 238 | "metadata": {}, 239 | "outputs": [], 240 | "source": [ 241 | "metadata[\"depth_um\"] = depth_coordinate(metadata[[\"x_um\",\"y_um\"]].values, np.array(column_points)*.1)" 242 | ] 243 | }, 244 | { 245 | "cell_type": "code", 246 | "execution_count": 82, 247 | "metadata": {}, 248 | "outputs": [ 249 | { 250 | "data": { 251 | "text/plain": [ 252 | "69.67768380830505" 253 | ] 254 | }, 255 | "execution_count": 82, 256 | "metadata": {}, 257 | "output_type": "execute_result" 258 | } 259 | ], 260 | "source": [ 261 | "metadata.loc[metadata[\"layer\"]==\"VISp_I\"][\"depth_um\"].mean()" 262 | ] 263 | }, 264 | { 265 | "cell_type": "code", 266 | "execution_count": 83, 267 | "metadata": {}, 268 | "outputs": [ 269 | { 270 | "data": { 271 | "text/plain": [ 272 | "280.8414099477571" 273 | ] 274 | }, 275 | "execution_count": 83, 276 | "metadata": {}, 277 | "output_type": "execute_result" 278 | } 279 | ], 280 | "source": [ 281 | "metadata.loc[metadata[\"layer\"]==\"VISp_II/III\"][\"depth_um\"].mean()" 282 | ] 283 | }, 284 | { 285 | "cell_type": "code", 286 | "execution_count": 84, 287 | "metadata": {}, 288 | "outputs": [ 289 | { 290 | "data": { 291 | "text/plain": [ 292 | "775.9941428386185" 293 | ] 294 | }, 295 | "execution_count": 84, 296 | "metadata": {}, 297 | "output_type": "execute_result" 298 | } 299 | ], 300 | "source": [ 301 | "metadata.loc[metadata[\"layer\"]==\"VISp_V\"][\"depth_um\"].mean()" 302 | ] 303 | }, 304 | { 305 | "cell_type": "code", 306 | "execution_count": 85, 307 | "metadata": {}, 308 | "outputs": [ 309 | { 310 | "data": { 311 | "text/plain": [ 312 | "1043.1176974356924" 313 | ] 314 | }, 315 | "execution_count": 85, 316 | "metadata": {}, 317 | "output_type": "execute_result" 318 | } 319 | ], 320 | "source": [ 321 | "metadata.loc[metadata[\"layer\"]==\"VISp_VI\"][\"depth_um\"].mean()" 322 | ] 323 | }, 324 | { 325 | "cell_type": "code", 326 | "execution_count": 88, 327 | "metadata": {}, 328 | "outputs": [], 329 | "source": [ 330 | "metadata.to_csv(\"annotated_smFISH_cells.csv\")" 331 | ] 332 | }, 333 | { 334 | "cell_type": "code", 335 | "execution_count": 86, 336 | "metadata": {}, 337 | "outputs": [ 338 | { 339 | "data": { 340 | "text/plain": [ 341 | "array(['VISp_VI', 'outside_VISp', 'VISp_IV', 'VISp_II/III', 'VISp_V',\n", 342 | " 'VISp_I'], dtype=object)" 343 | ] 344 | }, 345 | "execution_count": 86, 346 | "metadata": {}, 347 | "output_type": "execute_result" 348 | } 349 | ], 350 | "source": [ 351 | "metadata[\"layer\"].unique()" 352 | ] 353 | }, 354 | { 355 | "cell_type": "code", 356 | "execution_count": 87, 357 | "metadata": {}, 358 | "outputs": [ 359 | { 360 | "data": { 361 | "text/html": [ 362 | "
\n", 363 | "\n", 376 | "\n", 377 | " \n", 378 | " \n", 379 | " \n", 380 | " \n", 381 | " \n", 382 | " \n", 383 | " \n", 384 | " \n", 385 | " \n", 386 | " \n", 387 | " \n", 388 | " \n", 389 | " \n", 390 | " \n", 391 | " \n", 392 | " \n", 393 | " \n", 394 | " \n", 395 | " \n", 396 | " \n", 397 | " \n", 398 | " \n", 399 | " \n", 400 | " \n", 401 | " \n", 402 | " \n", 403 | " \n", 404 | " \n", 405 | " \n", 406 | " \n", 407 | " \n", 408 | " \n", 409 | " \n", 410 | " \n", 411 | " \n", 412 | " \n", 413 | " \n", 414 | " \n", 415 | " \n", 416 | " \n", 417 | " \n", 418 | " \n", 419 | " \n", 420 | " \n", 421 | " \n", 422 | " \n", 423 | " \n", 424 | " \n", 425 | " \n", 426 | " \n", 427 | " \n", 428 | " \n", 429 | " \n", 430 | " \n", 431 | " \n", 432 | " \n", 433 | " \n", 434 | " \n", 435 | " \n", 436 | " \n", 437 | " \n", 438 | " \n", 439 | " \n", 440 | " \n", 441 | " \n", 442 | " \n", 443 | " \n", 444 | " \n", 445 | " \n", 446 | " \n", 447 | " \n", 448 | " \n", 449 | " \n", 450 | " \n", 451 | " \n", 452 | " \n", 453 | " \n", 454 | " \n", 455 | " \n", 456 | " \n", 457 | " \n", 458 | " \n", 459 | " \n", 460 | " \n", 461 | " \n", 462 | " \n", 463 | " \n", 464 | " \n", 465 | " \n", 466 | " \n", 467 | " \n", 468 | " \n", 469 | " \n", 470 | " \n", 471 | " \n", 472 | " \n", 473 | " \n", 474 | " \n", 475 | " \n", 476 | " \n", 477 | " \n", 478 | " \n", 479 | " \n", 480 | " \n", 481 | " \n", 482 | " \n", 483 | " \n", 484 | " \n", 485 | " \n", 486 | " \n", 487 | " \n", 488 | " \n", 489 | " \n", 490 | " \n", 491 | " \n", 492 | " \n", 493 | " \n", 494 | " \n", 495 | " \n", 496 | " \n", 497 | " \n", 498 | " \n", 499 | " \n", 500 | " \n", 501 | " \n", 502 | " \n", 503 | " \n", 504 | " \n", 505 | " \n", 506 | " \n", 507 | " \n", 508 | " \n", 509 | " \n", 510 | " \n", 511 | " \n", 512 | " \n", 513 | " \n", 514 | " \n", 515 | " \n", 516 | " \n", 517 | " \n", 518 | " \n", 519 | " \n", 520 | " \n", 521 | " \n", 522 | " \n", 523 | " \n", 524 | " \n", 525 | " \n", 526 | " \n", 527 | " \n", 528 | " \n", 529 | " \n", 530 | " \n", 531 | " \n", 532 | " \n", 533 | " \n", 534 | " \n", 535 | " \n", 536 | " \n", 537 | " \n", 538 | " \n", 539 | " \n", 540 | " \n", 541 | " \n", 542 | " \n", 543 | " \n", 544 | " \n", 545 | " \n", 546 | " \n", 547 | " \n", 548 | " \n", 549 | " \n", 550 | " \n", 551 | " \n", 552 | " \n", 553 | " \n", 554 | " \n", 555 | " \n", 556 | " \n", 557 | " \n", 558 | " \n", 559 | " \n", 560 | " \n", 561 | " \n", 562 | " \n", 563 | " \n", 564 | " \n", 565 | " \n", 566 | " \n", 567 | " \n", 568 | " \n", 569 | " \n", 570 | " \n", 571 | " \n", 572 | " \n", 573 | " \n", 574 | " \n", 575 | " \n", 576 | " \n", 577 | " \n", 578 | " \n", 579 | " \n", 580 | " \n", 581 | " \n", 582 | " \n", 583 | " \n", 584 | " \n", 585 | " \n", 586 | " \n", 587 | " \n", 588 | " \n", 589 | " \n", 590 | " \n", 591 | " \n", 592 | " \n", 593 | " \n", 594 | " \n", 595 | " \n", 596 | " \n", 597 | "
cellxyhas_centerclustern_transcriptsdensityelongationareaavg_confidencedoublet_scorex_umy_umlayerdepth_um
019261.03525315447.259475False41250.0098661.93612670.00000.97480.003106926.1035251544.725947VISp_VI957.787655
126019.32905820710.346863False21040.0092362.84211260.00000.98180.485300601.9329062071.034686outside_VISp1248.705103
237741.7315199911.947365False6220.0095944.3482293.00000.9821NaN774.173152991.194737VISp_IV403.202494
3420329.8806907044.657880False53880.0165302.66923470.00000.99690.9048002032.988069704.465788outside_VISp790.618254
4515485.9729998216.108509False52200.0148602.11914800.00000.99660.1571001548.597300821.610851VISp_IV647.422891
................................................
4835483617390.9124353267.370712False1417.85000026.5300.22411.0000NaN1739.091244326.737071outside_VISp316.216598
483648374325.0813247962.837675False1130.0490201.184265.20000.9811NaN432.508132796.283768VISp_I62.558653
4837483812581.6427865113.917122False230.08966011.78033.46000.9947NaN1258.164279511.391712VISp_II/III233.059585
483848399971.5793297095.964142False1103.38400029.3502.95501.0000NaN997.157933709.596414VISp_II/III272.538244
4839484022398.80068912760.935125False2140.0332501.355421.00000.9998NaN2239.8800691276.093512outside_VISp1388.553458
\n", 598 | "

4840 rows × 15 columns

\n", 599 | "
" 600 | ], 601 | "text/plain": [ 602 | " cell x y has_center cluster n_transcripts \\\n", 603 | "0 1 9261.035253 15447.259475 False 4 125 \n", 604 | "1 2 6019.329058 20710.346863 False 2 104 \n", 605 | "2 3 7741.731519 9911.947365 False 6 22 \n", 606 | "3 4 20329.880690 7044.657880 False 5 388 \n", 607 | "4 5 15485.972999 8216.108509 False 5 220 \n", 608 | "... ... ... ... ... ... ... \n", 609 | "4835 4836 17390.912435 3267.370712 False 1 4 \n", 610 | "4836 4837 4325.081324 7962.837675 False 1 13 \n", 611 | "4837 4838 12581.642786 5113.917122 False 2 3 \n", 612 | "4838 4839 9971.579329 7095.964142 False 1 10 \n", 613 | "4839 4840 22398.800689 12760.935125 False 2 14 \n", 614 | "\n", 615 | " density elongation area avg_confidence doublet_score \\\n", 616 | "0 0.009866 1.936 12670.0000 0.9748 0.003106 \n", 617 | "1 0.009236 2.842 11260.0000 0.9818 0.485300 \n", 618 | "2 0.009594 4.348 2293.0000 0.9821 NaN \n", 619 | "3 0.016530 2.669 23470.0000 0.9969 0.904800 \n", 620 | "4 0.014860 2.119 14800.0000 0.9966 0.157100 \n", 621 | "... ... ... ... ... ... \n", 622 | "4835 17.850000 26.530 0.2241 1.0000 NaN \n", 623 | "4836 0.049020 1.184 265.2000 0.9811 NaN \n", 624 | "4837 0.089660 11.780 33.4600 0.9947 NaN \n", 625 | "4838 3.384000 29.350 2.9550 1.0000 NaN \n", 626 | "4839 0.033250 1.355 421.0000 0.9998 NaN \n", 627 | "\n", 628 | " x_um y_um layer depth_um \n", 629 | "0 926.103525 1544.725947 VISp_VI 957.787655 \n", 630 | "1 601.932906 2071.034686 outside_VISp 1248.705103 \n", 631 | "2 774.173152 991.194737 VISp_IV 403.202494 \n", 632 | "3 2032.988069 704.465788 outside_VISp 790.618254 \n", 633 | "4 1548.597300 821.610851 VISp_IV 647.422891 \n", 634 | "... ... ... ... ... \n", 635 | "4835 1739.091244 326.737071 outside_VISp 316.216598 \n", 636 | "4836 432.508132 796.283768 VISp_I 62.558653 \n", 637 | "4837 1258.164279 511.391712 VISp_II/III 233.059585 \n", 638 | "4838 997.157933 709.596414 VISp_II/III 272.538244 \n", 639 | "4839 2239.880069 1276.093512 outside_VISp 1388.553458 \n", 640 | "\n", 641 | "[4840 rows x 15 columns]" 642 | ] 643 | }, 644 | "execution_count": 87, 645 | "metadata": {}, 646 | "output_type": "execute_result" 647 | } 648 | ], 649 | "source": [ 650 | "metadata" 651 | ] 652 | } 653 | ], 654 | "metadata": { 655 | "kernelspec": { 656 | "display_name": "Python 3", 657 | "language": "python", 658 | "name": "python3" 659 | }, 660 | "language_info": { 661 | "codemirror_mode": { 662 | "name": "ipython", 663 | "version": 3 664 | }, 665 | "file_extension": ".py", 666 | "mimetype": "text/x-python", 667 | "name": "python", 668 | "nbconvert_exporter": "python", 669 | "pygments_lexer": "ipython3", 670 | "version": "3.9.2" 671 | } 672 | }, 673 | "nbformat": 4, 674 | "nbformat_minor": 2 675 | } 676 | -------------------------------------------------------------------------------- /annotations/Spot_Data_Annotation_Allen_MERFISH.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": null, 6 | "metadata": {}, 7 | "outputs": [], 8 | "source": [ 9 | "%gui qt\n", 10 | "import napari\n", 11 | "import pandas as pd\n", 12 | "import numpy as np\n", 13 | "from IPython.core.display import display, HTML\n", 14 | "display(HTML(\"\"))\n", 15 | "from shapely.geometry import Polygon, Point,LineString, mapping\n" 16 | ] 17 | }, 18 | { 19 | "cell_type": "code", 20 | "execution_count": null, 21 | "metadata": {}, 22 | "outputs": [], 23 | "source": [ 24 | "import json\n", 25 | "import geojson\n", 26 | "from spacetx_spatial_analysis import depth_coordinate" 27 | ] 28 | }, 29 | { 30 | "cell_type": "markdown", 31 | "metadata": {}, 32 | "source": [ 33 | "## Make a napari viewer..." 34 | ] 35 | }, 36 | { 37 | "cell_type": "code", 38 | "execution_count": null, 39 | "metadata": {}, 40 | "outputs": [], 41 | "source": [ 42 | "v = napari.Viewer()" 43 | ] 44 | }, 45 | { 46 | "cell_type": "markdown", 47 | "metadata": {}, 48 | "source": [ 49 | "## Load spot table from 1 dataset" 50 | ] 51 | }, 52 | { 53 | "cell_type": "code", 54 | "execution_count": null, 55 | "metadata": {}, 56 | "outputs": [], 57 | "source": [ 58 | "# load one spotxgene table\n", 59 | "all_spots = pd.read_csv(\"/Users/brian/Downloads/spot_table.csv\")\n", 60 | "genes = all_spots[\"gene\"].unique()" 61 | ] 62 | }, 63 | { 64 | "cell_type": "code", 65 | "execution_count": null, 66 | "metadata": {}, 67 | "outputs": [], 68 | "source": [ 69 | "subsample = 1 # change to >1 if number of points is too high\n", 70 | "colorlist = [\"magenta\", \"red\",\"blue\",\"cyan\", \"green\", \"orange\",\"red\"]\n" 71 | ] 72 | }, 73 | { 74 | "cell_type": "code", 75 | "execution_count": null, 76 | "metadata": {}, 77 | "outputs": [], 78 | "source": [ 79 | "cindex = 0\n", 80 | "for ii, gene_to_plot in enumerate([\"Gad1\",\"Gad2\",\"Slc17a7\",\"Cux2\",\"Calb1\",\"Meis2\",\"Foxp2\", \"Atp1a3\" , \"Vxn\", \"Pcp4\" , \"Fezf2\" , \"Rorb\" , \"Gm11549\"]):\n", 81 | "\n", 82 | " if gene_to_plot in genes:\n", 83 | " if gene_to_plot == \"Slc17a7\":\n", 84 | " spots = v.add_points(all_spots[all_spots[\"gene\"]==gene_to_plot][[\"x_um\",\"y_um\"]].values[::subsample,:], symbol='disc',\n", 85 | " name = gene_to_plot+\"+\",edge_color= [0,0,0,0], size = 1.5,\n", 86 | " face_color= colorlist[ cindex % len(colorlist)] , blending = \"translucent\", opacity = 0.8)\n", 87 | " else:\n", 88 | " spots = v.add_points(all_spots[all_spots[\"gene\"]==gene_to_plot][[\"x_um\",\"y_um\"]].values[::subsample,:], symbol='disc',\n", 89 | " name = gene_to_plot+\"+\",edge_color= [0,0,0,0], size = 2.,\n", 90 | " face_color= colorlist[ cindex % len(colorlist)] , blending = \"translucent\", opacity = 0.7)\n", 91 | " cindex = cindex + 1" 92 | ] 93 | }, 94 | { 95 | "cell_type": "code", 96 | "execution_count": null, 97 | "metadata": {}, 98 | "outputs": [], 99 | "source": [ 100 | "v.layers" 101 | ] 102 | }, 103 | { 104 | "cell_type": "markdown", 105 | "metadata": {}, 106 | "source": [ 107 | "### annotate the layers in that viewer in a single `shapes` layer\n", 108 | "#### Naming/order Convention:\n", 109 | "0. outline of entire area\n", 110 | "1. Layer 1\n", 111 | "1. Layer 2/3\n", 112 | "2. Layer 4\n", 113 | "3. Layer 5\n", 114 | "4. Layer 6\n", 115 | "5. white matter\n", 116 | "6. single line segment, pointing from pia to white matter " 117 | ] 118 | }, 119 | { 120 | "cell_type": "markdown", 121 | "metadata": {}, 122 | "source": [ 123 | "#### annotate the layer locations in a list" 124 | ] 125 | }, 126 | { 127 | "cell_type": "code", 128 | "execution_count": null, 129 | "metadata": {}, 130 | "outputs": [], 131 | "source": [ 132 | "shapes_layer = v.layers[-1].data[:-1]\n", 133 | "column_points = v.layers[-1].data[-1]" 134 | ] 135 | }, 136 | { 137 | "cell_type": "code", 138 | "execution_count": null, 139 | "metadata": {}, 140 | "outputs": [], 141 | "source": [ 142 | "if len(v.layers[-1].data) != 8:\n", 143 | " print(\"please annotate the 7 polygons and 1 line segment described above\")\n", 144 | "else:\n", 145 | " print(\"8 annotations\")" 146 | ] 147 | }, 148 | { 149 | "cell_type": "code", 150 | "execution_count": null, 151 | "metadata": {}, 152 | "outputs": [], 153 | "source": [ 154 | "# go get all the plotted points and note if they're in the annotated polygons\n", 155 | "is_in_layer = {ii:[Polygon(p).intersects(Point(a)) for a in all_spots[[\"x_um\",\"y_um\"]].values] for ii,p in enumerate(shapes_layer)}" 156 | ] 157 | }, 158 | { 159 | "cell_type": "code", 160 | "execution_count": null, 161 | "metadata": {}, 162 | "outputs": [], 163 | "source": [ 164 | "all_spots[\"layer\"] = \"outside_VISp\"\n", 165 | "for k in is_in_layer.keys():\n", 166 | " all_spots.loc[is_in_layer[k],[\"layer\"]] = annotation_names[k]\n" 167 | ] 168 | }, 169 | { 170 | "cell_type": "code", 171 | "execution_count": null, 172 | "metadata": {}, 173 | "outputs": [], 174 | "source": [ 175 | "all_spots[\"layer\"].unique()" 176 | ] 177 | }, 178 | { 179 | "cell_type": "code", 180 | "execution_count": null, 181 | "metadata": {}, 182 | "outputs": [], 183 | "source": [ 184 | "# now the spots have depth coordinates, which will be useful for detected spots v. column depth\n", 185 | "all_spots[\"depth_um\"] = depth_coordinate(all_spots[[\"x_um\",\"y_um\"]].values, column_points)" 186 | ] 187 | }, 188 | { 189 | "cell_type": "code", 190 | "execution_count": null, 191 | "metadata": {}, 192 | "outputs": [], 193 | "source": [ 194 | "all_spots" 195 | ] 196 | }, 197 | { 198 | "cell_type": "code", 199 | "execution_count": null, 200 | "metadata": {}, 201 | "outputs": [], 202 | "source": [ 203 | "all_spots.to_csv(\"Allen_MERFISH_spots_with_anatomy.csv\")" 204 | ] 205 | }, 206 | { 207 | "cell_type": "code", 208 | "execution_count": null, 209 | "metadata": {}, 210 | "outputs": [], 211 | "source": [ 212 | "annotation_names = [\"VISp\", \"VISp_I\", \"VISp_II/III\", \"VISp_IV\", \"VISp_V\",\"VISp_VI\", \"VISp_wm\", \"column_axis\"]\n" 213 | ] 214 | }, 215 | { 216 | "cell_type": "code", 217 | "execution_count": null, 218 | "metadata": {}, 219 | "outputs": [], 220 | "source": [ 221 | "annotations = [mapping(Polygon(p)) for ii,p in enumerate(shapes_layer)]\n", 222 | "annotations.append(mapping(LineString(column_points)))\n", 223 | "for ii,ai in enumerate(annotations):\n", 224 | " ai[\"name\"] = annotation_names[ii]\n", 225 | "\n", 226 | "a = geojson.GeometryCollection(annotations)\n", 227 | "\n", 228 | "with open(\"Allen_MERFISH_annotations_geo.json\",'w') as w:\n", 229 | " geojson.dump(a,w)" 230 | ] 231 | }, 232 | { 233 | "cell_type": "code", 234 | "execution_count": null, 235 | "metadata": {}, 236 | "outputs": [], 237 | "source": [ 238 | "with open(\"/Users/brian/work/data/stardist_rois.json\",'r') as r:\n", 239 | " shapejson = geojson.load(r)" 240 | ] 241 | }, 242 | { 243 | "cell_type": "code", 244 | "execution_count": null, 245 | "metadata": {}, 246 | "outputs": [], 247 | "source": [ 248 | "shapes_to_add = [0.1078*4.*np.array(geo[\"coordinates\"][0][::5]) for geo in shapejson[\"geometries\"]]\n", 249 | "for f in shapes_to_add:\n", 250 | " f[:,0] = f[:,0]+1154\n", 251 | " f[:,1] = f[:,1]+4548 #6237" 252 | ] 253 | }, 254 | { 255 | "cell_type": "code", 256 | "execution_count": null, 257 | "metadata": {}, 258 | "outputs": [], 259 | "source": [ 260 | "import imageio" 261 | ] 262 | }, 263 | { 264 | "cell_type": "code", 265 | "execution_count": null, 266 | "metadata": {}, 267 | "outputs": [], 268 | "source": [ 269 | "egdapi = imageio.imread(\"/Users/brian/work/mFISH__002_DAPI_Overview-ds.tif\")" 270 | ] 271 | }, 272 | { 273 | "cell_type": "code", 274 | "execution_count": null, 275 | "metadata": {}, 276 | "outputs": [], 277 | "source": [ 278 | "print(10706.668188763051*0.1078)\n", 279 | "print(44241.16940370426*0.1078 - 2048*.1078)" 280 | ] 281 | }, 282 | { 283 | "cell_type": "code", 284 | "execution_count": null, 285 | "metadata": {}, 286 | "outputs": [], 287 | "source": [ 288 | "v.add_image(egdapi.T, scale = [4.0*0.1078, 4.0*0.1078], translate = [1154, 4548])" 289 | ] 290 | }, 291 | { 292 | "cell_type": "code", 293 | "execution_count": null, 294 | "metadata": {}, 295 | "outputs": [], 296 | "source": [ 297 | "v.add_shapes(shapes_to_add ,\n", 298 | " shape_type='polygon',\n", 299 | " edge_width=1,\n", 300 | " edge_color='coral',\n", 301 | " face_color='royalblue',\n", 302 | " name='shapesjhjh')" 303 | ] 304 | }, 305 | { 306 | "cell_type": "code", 307 | "execution_count": null, 308 | "metadata": {}, 309 | "outputs": [], 310 | "source": [ 311 | "shapes_to_add[33]" 312 | ] 313 | }, 314 | { 315 | "cell_type": "code", 316 | "execution_count": null, 317 | "metadata": {}, 318 | "outputs": [], 319 | "source": [] 320 | }, 321 | { 322 | "cell_type": "code", 323 | "execution_count": null, 324 | "metadata": {}, 325 | "outputs": [], 326 | "source": [ 327 | "1.03*63./60." 328 | ] 329 | }, 330 | { 331 | "cell_type": "code", 332 | "execution_count": null, 333 | "metadata": {}, 334 | "outputs": [], 335 | "source": [ 336 | "40/(6660-5383)" 337 | ] 338 | }, 339 | { 340 | "cell_type": "code", 341 | "execution_count": null, 342 | "metadata": {}, 343 | "outputs": [], 344 | "source": [ 345 | "1888-1845" 346 | ] 347 | }, 348 | { 349 | "cell_type": "code", 350 | "execution_count": null, 351 | "metadata": {}, 352 | "outputs": [], 353 | "source": [ 354 | "30" 355 | ] 356 | }, 357 | { 358 | "cell_type": "code", 359 | "execution_count": null, 360 | "metadata": {}, 361 | "outputs": [], 362 | "source": [ 363 | "1817-1786" 364 | ] 365 | }, 366 | { 367 | "cell_type": "code", 368 | "execution_count": null, 369 | "metadata": {}, 370 | "outputs": [], 371 | "source": [ 372 | "77-56" 373 | ] 374 | }, 375 | { 376 | "cell_type": "code", 377 | "execution_count": null, 378 | "metadata": {}, 379 | "outputs": [], 380 | "source": [] 381 | } 382 | ], 383 | "metadata": { 384 | "kernelspec": { 385 | "display_name": "Python 3", 386 | "language": "python", 387 | "name": "python3" 388 | }, 389 | "language_info": { 390 | "codemirror_mode": { 391 | "name": "ipython", 392 | "version": 3 393 | }, 394 | "file_extension": ".py", 395 | "mimetype": "text/x-python", 396 | "name": "python", 397 | "nbconvert_exporter": "python", 398 | "pygments_lexer": "ipython3", 399 | "version": "3.7.9" 400 | } 401 | }, 402 | "nbformat": 4, 403 | "nbformat_minor": 2 404 | } 405 | -------------------------------------------------------------------------------- /annotations/Using_Allen_MERFISH_Annotation.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "## This notebook will load some existing GEOJSON files and show them with Allen_MERFISH cells in a Napari window" 8 | ] 9 | }, 10 | { 11 | "cell_type": "code", 12 | "execution_count": 1, 13 | "metadata": {}, 14 | "outputs": [ 15 | { 16 | "data": { 17 | "text/html": [ 18 | "" 19 | ], 20 | "text/plain": [ 21 | "" 22 | ] 23 | }, 24 | "metadata": {}, 25 | "output_type": "display_data" 26 | } 27 | ], 28 | "source": [ 29 | "%gui qt\n", 30 | "import napari\n", 31 | "import pandas as pd\n", 32 | "import numpy as np\n", 33 | "from IPython.core.display import display, HTML\n", 34 | "display(HTML(\"\"))\n", 35 | "from shapely.geometry import Polygon, Point,LineString, mapping\n" 36 | ] 37 | }, 38 | { 39 | "cell_type": "code", 40 | "execution_count": 2, 41 | "metadata": {}, 42 | "outputs": [], 43 | "source": [ 44 | "import json\n", 45 | "import geojson\n" 46 | ] 47 | }, 48 | { 49 | "cell_type": "markdown", 50 | "metadata": {}, 51 | "source": [ 52 | "## Make a napari viewer..." 53 | ] 54 | }, 55 | { 56 | "cell_type": "code", 57 | "execution_count": 3, 58 | "metadata": {}, 59 | "outputs": [], 60 | "source": [ 61 | "v = napari.Viewer()" 62 | ] 63 | }, 64 | { 65 | "cell_type": "markdown", 66 | "metadata": {}, 67 | "source": [ 68 | "## Load a cell x gene table, here I'm using the old one" 69 | ] 70 | }, 71 | { 72 | "cell_type": "code", 73 | "execution_count": 13, 74 | "metadata": {}, 75 | "outputs": [], 76 | "source": [ 77 | "# load one cellxgene table\n", 78 | "all_cells = pd.read_csv(\"/Users/brian/Downloads/fixed_1001844875(2).csv\")\n" 79 | ] 80 | }, 81 | { 82 | "cell_type": "code", 83 | "execution_count": 15, 84 | "metadata": {}, 85 | "outputs": [], 86 | "source": [ 87 | "cell_plots = v.add_points(all_cells[[\"x_um\",\"y_um\"]], symbol='disc',\n", 88 | " name = \"old segmentation\",edge_color= [0,0,0,0], size = 10.5,\n", 89 | " face_color= 'b' , blending = \"translucent\", opacity = 0.8)" 90 | ] 91 | }, 92 | { 93 | "cell_type": "code", 94 | "execution_count": 18, 95 | "metadata": {}, 96 | "outputs": [], 97 | "source": [ 98 | "with open(\"/Users/brian/Allen_MERFISH_annotations_geo.json\",'r') as r:\n", 99 | " shapejson = geojson.load(r)\n", 100 | " \n", 101 | "#last element in the geojson file is the column axis, so ignore it for now\n", 102 | "layer_annotations = shapejson[\"geometries\"][:-1]" 103 | ] 104 | }, 105 | { 106 | "cell_type": "code", 107 | "execution_count": null, 108 | "metadata": {}, 109 | "outputs": [], 110 | "source": [] 111 | }, 112 | { 113 | "cell_type": "code", 114 | "execution_count": 19, 115 | "metadata": {}, 116 | "outputs": [], 117 | "source": [ 118 | "for geo in layer_annotations:\n", 119 | " shape_coordinates = np.array(geo[\"coordinates\"][0])\n", 120 | " v.add_shapes([shape_coordinates] ,\n", 121 | " shape_type='polygon',\n", 122 | " edge_width=1,\n", 123 | " edge_color='coral',\n", 124 | " face_color='royalblue',\n", 125 | " name=geo[\"name\"])" 126 | ] 127 | }, 128 | { 129 | "cell_type": "markdown", 130 | "metadata": {}, 131 | "source": [ 132 | "## use `shapely` to assign regions to cells" 133 | ] 134 | }, 135 | { 136 | "cell_type": "code", 137 | "execution_count": 23, 138 | "metadata": {}, 139 | "outputs": [], 140 | "source": [ 141 | "cell_is_in_layer = {p[\"name\"]:[Polygon(p[\"coordinates\"][0]).intersects(Point(a)) for a in all_cells[[\"x_um\",\"y_um\"]].values] for ii,p in enumerate(layer_annotations)}" 142 | ] 143 | }, 144 | { 145 | "cell_type": "code", 146 | "execution_count": 24, 147 | "metadata": {}, 148 | "outputs": [], 149 | "source": [ 150 | "all_cells[\"layer\"] = \"outside_VISp\"\n", 151 | "for k in cell_is_in_layer.keys():\n", 152 | " all_cells.loc[cell_is_in_layer[k],[\"layer\"]] = k\n" 153 | ] 154 | }, 155 | { 156 | "cell_type": "code", 157 | "execution_count": 25, 158 | "metadata": {}, 159 | "outputs": [ 160 | { 161 | "data": { 162 | "text/html": [ 163 | "
\n", 164 | "\n", 177 | "\n", 178 | " \n", 179 | " \n", 180 | " \n", 181 | " \n", 182 | " \n", 183 | " \n", 184 | " \n", 185 | " \n", 186 | " \n", 187 | " \n", 188 | " \n", 189 | " \n", 190 | " \n", 191 | " \n", 192 | " \n", 193 | " \n", 194 | " \n", 195 | " \n", 196 | " \n", 197 | " \n", 198 | " \n", 199 | " \n", 200 | " \n", 201 | " \n", 202 | " \n", 203 | " \n", 204 | " \n", 205 | " \n", 206 | " \n", 207 | " \n", 208 | " \n", 209 | " \n", 210 | " \n", 211 | " \n", 212 | " \n", 213 | " \n", 214 | " \n", 215 | " \n", 216 | " \n", 217 | " \n", 218 | " \n", 219 | " \n", 220 | " \n", 221 | " \n", 222 | " \n", 223 | " \n", 224 | " \n", 225 | " \n", 226 | " \n", 227 | " \n", 228 | " \n", 229 | " \n", 230 | " \n", 231 | " \n", 232 | " \n", 233 | " \n", 234 | " \n", 235 | " \n", 236 | " \n", 237 | " \n", 238 | " \n", 239 | " \n", 240 | " \n", 241 | " \n", 242 | " \n", 243 | " \n", 244 | " \n", 245 | " \n", 246 | " \n", 247 | " \n", 248 | " \n", 249 | " \n", 250 | " \n", 251 | " \n", 252 | " \n", 253 | " \n", 254 | " \n", 255 | " \n", 256 | " \n", 257 | " \n", 258 | " \n", 259 | " \n", 260 | " \n", 261 | " \n", 262 | " \n", 263 | " \n", 264 | " \n", 265 | " \n", 266 | " \n", 267 | " \n", 268 | " \n", 269 | " \n", 270 | " \n", 271 | " \n", 272 | " \n", 273 | " \n", 274 | " \n", 275 | " \n", 276 | " \n", 277 | " \n", 278 | " \n", 279 | " \n", 280 | " \n", 281 | " \n", 282 | " \n", 283 | " \n", 284 | " \n", 285 | " \n", 286 | " \n", 287 | " \n", 288 | " \n", 289 | " \n", 290 | " \n", 291 | " \n", 292 | " \n", 293 | " \n", 294 | " \n", 295 | " \n", 296 | " \n", 297 | " \n", 298 | " \n", 299 | " \n", 300 | " \n", 301 | " \n", 302 | " \n", 303 | " \n", 304 | " \n", 305 | " \n", 306 | " \n", 307 | " \n", 308 | " \n", 309 | " \n", 310 | " \n", 311 | " \n", 312 | " \n", 313 | " \n", 314 | " \n", 315 | " \n", 316 | " \n", 317 | " \n", 318 | " \n", 319 | " \n", 320 | " \n", 321 | " \n", 322 | " \n", 323 | " \n", 324 | " \n", 325 | " \n", 326 | " \n", 327 | " \n", 328 | " \n", 329 | " \n", 330 | " \n", 331 | " \n", 332 | " \n", 333 | " \n", 334 | " \n", 335 | " \n", 336 | " \n", 337 | " \n", 338 | " \n", 339 | " \n", 340 | " \n", 341 | " \n", 342 | " \n", 343 | " \n", 344 | " \n", 345 | " \n", 346 | " \n", 347 | " \n", 348 | " \n", 349 | " \n", 350 | " \n", 351 | " \n", 352 | " \n", 353 | " \n", 354 | " \n", 355 | " \n", 356 | " \n", 357 | " \n", 358 | " \n", 359 | " \n", 360 | " \n", 361 | " \n", 362 | " \n", 363 | " \n", 364 | " \n", 365 | " \n", 366 | " \n", 367 | " \n", 368 | " \n", 369 | " \n", 370 | " \n", 371 | " \n", 372 | " \n", 373 | " \n", 374 | " \n", 375 | " \n", 376 | " \n", 377 | " \n", 378 | " \n", 379 | " \n", 380 | " \n", 381 | " \n", 382 | " \n", 383 | " \n", 384 | " \n", 385 | " \n", 386 | " \n", 387 | " \n", 388 | " \n", 389 | " \n", 390 | " \n", 391 | " \n", 392 | " \n", 393 | " \n", 394 | " \n", 395 | " \n", 396 | " \n", 397 | " \n", 398 | " \n", 399 | " \n", 400 | " \n", 401 | " \n", 402 | " \n", 403 | " \n", 404 | " \n", 405 | " \n", 406 | " \n", 407 | " \n", 408 | " \n", 409 | " \n", 410 | " \n", 411 | " \n", 412 | " \n", 413 | " \n", 414 | " \n", 415 | " \n", 416 | " \n", 417 | " \n", 418 | " \n", 419 | " \n", 420 | " \n", 421 | " \n", 422 | " \n", 423 | " \n", 424 | " \n", 425 | " \n", 426 | " \n", 427 | " \n", 428 | " \n", 429 | " \n", 430 | " \n", 431 | " \n", 432 | " \n", 433 | " \n", 434 | " \n", 435 | " \n", 436 | " \n", 437 | " \n", 438 | " \n", 439 | " \n", 440 | " \n", 441 | " \n", 442 | " \n", 443 | " \n", 444 | " \n", 445 | " \n", 446 | " \n", 447 | " \n", 448 | " \n", 449 | " \n", 450 | " \n", 451 | " \n", 452 | " \n", 453 | " \n", 454 | " \n", 455 | " \n", 456 | " \n", 457 | " \n", 458 | " \n", 459 | " \n", 460 | " \n", 461 | " \n", 462 | " \n", 463 | " \n", 464 | " \n", 465 | " \n", 466 | " \n", 467 | " \n", 468 | " \n", 469 | " \n", 470 | "
Unnamed: 0Unnamed: 0.11700022I11Rik1810046K07Rik5031425F14Rik5730522E02RikActa2Adam2Adamts2Adamts4...Wipf3Wnt7bZfp804bareapositiontotal_readssimpleClassx_umy_umlayer
00000000000...000170.10[1161.11337076 6178.3830543 ]870671161.1133716178.383054outside_VISp
11100110000...101206.55[1162.91337076 6113.1330543 ]4542331162.9133716113.133054outside_VISp
22200010000...200184.68[1168.31337076 6046.0830543 ]269971168.3133716046.083054outside_VISp
33300002000...00087.48[1163.81337076 6202.6830543 ]3401051163.8133716202.683054outside_VISp
44400010002...301155.52[1166.96337076 6083.8830543 ]241721166.9633716083.883054outside_VISp
..................................................................
23942394239400003100...200277.02[3144.26337076 5201.4330543 ]1062963144.2633715201.433054outside_VISp
23952395239500006101...311200.07[3154.61337076 5331.0330543 ]18803154.6133715331.033054outside_VISp
23962396239601013203...500338.58[3165.41337076 5190.1830543 ]1322993165.4133715190.183054outside_VISp
23972397239710000002...000189.54[3189.71337076 5292.7830543 ]120963189.7133715292.783054outside_VISp
23982398239800000000...101289.17[3196.91337076 5196.9330543 ]707663196.9133715196.933054outside_VISp
\n", 471 | "

2399 rows × 277 columns

\n", 472 | "
" 473 | ], 474 | "text/plain": [ 475 | " Unnamed: 0 Unnamed: 0.1 1700022I11Rik 1810046K07Rik 5031425F14Rik \\\n", 476 | "0 0 0 0 0 0 \n", 477 | "1 1 1 0 0 1 \n", 478 | "2 2 2 0 0 0 \n", 479 | "3 3 3 0 0 0 \n", 480 | "4 4 4 0 0 0 \n", 481 | "... ... ... ... ... ... \n", 482 | "2394 2394 2394 0 0 0 \n", 483 | "2395 2395 2395 0 0 0 \n", 484 | "2396 2396 2396 0 1 0 \n", 485 | "2397 2397 2397 1 0 0 \n", 486 | "2398 2398 2398 0 0 0 \n", 487 | "\n", 488 | " 5730522E02Rik Acta2 Adam2 Adamts2 Adamts4 ... Wipf3 Wnt7b \\\n", 489 | "0 0 0 0 0 0 ... 0 0 \n", 490 | "1 1 0 0 0 0 ... 1 0 \n", 491 | "2 1 0 0 0 0 ... 2 0 \n", 492 | "3 0 2 0 0 0 ... 0 0 \n", 493 | "4 1 0 0 0 2 ... 3 0 \n", 494 | "... ... ... ... ... ... ... ... ... \n", 495 | "2394 0 3 1 0 0 ... 2 0 \n", 496 | "2395 0 6 1 0 1 ... 3 1 \n", 497 | "2396 1 3 2 0 3 ... 5 0 \n", 498 | "2397 0 0 0 0 2 ... 0 0 \n", 499 | "2398 0 0 0 0 0 ... 1 0 \n", 500 | "\n", 501 | " Zfp804b area position total_reads \\\n", 502 | "0 0 170.10 [1161.11337076 6178.3830543 ] 870 \n", 503 | "1 1 206.55 [1162.91337076 6113.1330543 ] 454 \n", 504 | "2 0 184.68 [1168.31337076 6046.0830543 ] 269 \n", 505 | "3 0 87.48 [1163.81337076 6202.6830543 ] 340 \n", 506 | "4 1 155.52 [1166.96337076 6083.8830543 ] 241 \n", 507 | "... ... ... ... ... \n", 508 | "2394 0 277.02 [3144.26337076 5201.4330543 ] 1062 \n", 509 | "2395 1 200.07 [3154.61337076 5331.0330543 ] 188 \n", 510 | "2396 0 338.58 [3165.41337076 5190.1830543 ] 1322 \n", 511 | "2397 0 189.54 [3189.71337076 5292.7830543 ] 120 \n", 512 | "2398 1 289.17 [3196.91337076 5196.9330543 ] 707 \n", 513 | "\n", 514 | " simpleClass x_um y_um layer \n", 515 | "0 67 1161.113371 6178.383054 outside_VISp \n", 516 | "1 233 1162.913371 6113.133054 outside_VISp \n", 517 | "2 97 1168.313371 6046.083054 outside_VISp \n", 518 | "3 105 1163.813371 6202.683054 outside_VISp \n", 519 | "4 72 1166.963371 6083.883054 outside_VISp \n", 520 | "... ... ... ... ... \n", 521 | "2394 96 3144.263371 5201.433054 outside_VISp \n", 522 | "2395 0 3154.613371 5331.033054 outside_VISp \n", 523 | "2396 99 3165.413371 5190.183054 outside_VISp \n", 524 | "2397 96 3189.713371 5292.783054 outside_VISp \n", 525 | "2398 66 3196.913371 5196.933054 outside_VISp \n", 526 | "\n", 527 | "[2399 rows x 277 columns]" 528 | ] 529 | }, 530 | "execution_count": 25, 531 | "metadata": {}, 532 | "output_type": "execute_result" 533 | } 534 | ], 535 | "source": [ 536 | "all_cells" 537 | ] 538 | }, 539 | { 540 | "cell_type": "code", 541 | "execution_count": null, 542 | "metadata": {}, 543 | "outputs": [], 544 | "source": [ 545 | "#" 546 | ] 547 | } 548 | ], 549 | "metadata": { 550 | "kernelspec": { 551 | "display_name": "Python 3", 552 | "language": "python", 553 | "name": "python3" 554 | }, 555 | "language_info": { 556 | "codemirror_mode": { 557 | "name": "ipython", 558 | "version": 3 559 | }, 560 | "file_extension": ".py", 561 | "mimetype": "text/x-python", 562 | "name": "python", 563 | "nbconvert_exporter": "python", 564 | "pygments_lexer": "ipython3", 565 | "version": "3.7.4" 566 | } 567 | }, 568 | "nbformat": 4, 569 | "nbformat_minor": 2 570 | } 571 | -------------------------------------------------------------------------------- /annotations/exSeq_annotations.json: -------------------------------------------------------------------------------- 1 | [{"type": "Polygon", "coordinates": [[[120.123484, 14354.309624], [85.389789, 18140.282404], [397.993046, 18504.986203], [5347.544615, 18574.453594], [13162.62604, 18713.388375], [18598.449343, 18209.749794], [18233.745543, 15761.024281], [18268.479238, 14302.209081], [11061.237479, 14232.741691], [4496.569082, 14250.108538]]], "name": "L2_3_polygon"}, {"type": "Polygon", "coordinates": [[[-36.178145, 11210.910206], [85.389789, 14180.641148], [13509.962993, 14145.907453], [18546.3488, 14198.007996], [18164.278153, 11627.714549], [12537.419526, 11540.880311], [3801.895178, 11297.744444]]], "name": "L4_polygon"}, {"type": "Polygon", "coordinates": [[[-175.112926, 7928.576008], [-18.811297, 11002.508035], [6667.425034, 11245.643902], [15576.617859, 11506.146616], [18337.946629, 11471.412921], [17608.539029, 8293.279807], [6476.38971, 8050.143941], [2186.77835, 7963.309703]]], "name": "L5_polygon"}, {"type": "Polygon", "coordinates": [[[-383.515097, 4472.573333], [-209.846621, 7807.008074], [10644.433137, 8050.143941], [17452.237401, 8171.711874], [17712.740115, 7963.309703], [17452.237401, 5688.252666], [17330.669467, 4281.538009], [17209.101534, 3916.834209], [7153.696767, 4107.869533], [-452.982487, 4073.135838]]], "name": "L6_polygon"}] -------------------------------------------------------------------------------- /annotations/exSeq_annotations2.json: -------------------------------------------------------------------------------- 1 | [{"type": "Polygon", "coordinates": [[[33.289246, 14336.942777], [33.289246, 19494.896517], [13266.827126, 19911.70086], [18598.449343, 19529.630213], [18598.449343, 16889.869376], [18181.645, 14614.812338], [6650.058186, 14614.812338]]], "name": "L2_3_polygon"}, {"type": "Polygon", "coordinates": [[[-192.479773, 10498.869454], [-209.846621, 14198.007996], [8977.215766, 14562.711795], [18511.615105, 14545.344948], [18372.680324, 12061.885739], [18320.579781, 11853.483568], [6129.052758, 11454.046073], [1353.169664, 11002.508035]]], "name": "L4_polygon"}, {"type": "Polygon", "coordinates": [[[-209.846621, 6921.298846], [-209.846621, 10307.834131], [1335.802817, 10915.673797], [5399.645158, 11280.377597], [13457.86245, 11523.513463], [18546.3488, 11627.714549], [17573.805334, 7633.339598], [4722.338101, 7789.641227]]], "name": "L5_polygon"}, {"type": "Polygon", "coordinates": [[[-279.314011, 2579.586943], [-192.479773, 6764.997218], [4670.237558, 7685.440141], [14187.27005, 7546.50536], [17973.242829, 7546.50536], [16861.764582, 2822.72281]]], "name": "L6_polygon"}] -------------------------------------------------------------------------------- /annotations/osmFISH_layer_Annotation_new_6_layers.json: -------------------------------------------------------------------------------- 1 | [{"type": "Polygon", "coordinates": [[[27252.706498, 1524.836734], [18722.485775, 3822.450366], [13361.387302, 5908.78918], [8871.797448, 10292.741626], [3695.56444, 15706.658803], [2190.231371, 17740.178914], [1450.769513, 17053.535759], [2269.459427, 16049.98038], [4593.482411, 13197.770355], [6283.680944, 11085.022189], [9399.98449, 7889.490587], [10694.042742, 6621.841687], [12727.562852, 4852.415097], [15236.4513, 3901.678422], [18405.57355, 2739.66693], [22842.3447, 1656.883495], [27569.618723, 336.415891]]], "name": "L2_polygon"}, {"type": "Polygon", "coordinates": [[[27411.162611, 1709.702199], [27490.390667, 2607.62017], [19171.444761, 4799.596393], [13942.393048, 6806.707151], [9320.756434, 11322.706357], [3642.745736, 17740.178914], [2348.687484, 17845.816322], [2559.9623, 17291.219928], [3854.020552, 15680.249451], [7656.967252, 11666.027934], [9664.078011, 9606.098472], [12331.422571, 7044.39132], [13387.796654, 6014.426589], [18669.667071, 3954.497126], [24083.584248, 2449.164057]]], "name": "L3_polygon"}, {"type": "Polygon", "coordinates": [[[27463.981315, 2686.848226], [27437.571963, 3954.497126], [19039.398, 6278.520109], [14496.989442, 8153.584107], [8739.750688, 13514.68258], [4118.114073, 19377.558743], [3695.56444, 19324.740039], [3748.383144, 17819.40697], [4223.751481, 17211.991872], [8634.113279, 12167.805624], [9294.347081, 11454.753118], [14021.621104, 6859.525855], [19409.128929, 4773.187041]]], "name": "L4_polygon"}, {"type": "Polygon", "coordinates": [[[27358.343906, 4112.953239], [27384.753259, 5644.695659], [19593.994394, 7863.081234], [15659.000934, 9896.601345], [9796.124771, 15204.881114], [7445.692436, 19720.88032], [4329.38889, 19615.242912], [4197.342129, 19536.014855], [8766.16004, 13593.910637], [14470.58009, 8285.630868], [19039.398, 6331.338814]]], "name": "L5_polygon"}, {"type": "Polygon", "coordinates": [[[27754.484188, 5697.514364], [29576.729481, 5697.514364], [29550.320129, 7757.443826], [21178.555519, 11296.297005], [14866.720371, 13884.413509], [11407.095248, 17053.535759], [8290.791702, 21701.581726], [7577.739196, 21648.763022], [7524.920492, 19852.92708], [9743.306067, 15442.565282], [15394.907413, 10292.741626], [19699.631802, 7915.899939]]], "name": "L6_polygon"}, {"type": "Polygon", "coordinates": [[[27199.887794, -350.227263], [27463.981315, 257.187834], [21918.017377, 1815.339607], [18326.345494, 2739.66693], [12780.381556, 4693.958984], [10403.539869, 6727.479095], [6204.452888, 11058.612837], [2031.775259, 16234.845845], [1714.863034, 16710.214182], [1107.447936, 15759.477507], [5227.306861, 10319.150978], [11988.100994, 3690.403605], [19145.035409, 1366.380622]]], "name": "L1_polygon"}] -------------------------------------------------------------------------------- /annotations/smFISH_layer_annotation_6_layers.json: -------------------------------------------------------------------------------- 1 | [{"type": "Polygon", "coordinates": [[[19354.564068, 1115.855246], [19859.52633, 2525.541562], [16030.229173, 3093.624107], [12411.332959, 4040.428349], [8497.875425, 5828.836362], [5930.983924, 7469.963715], [1870.24573, 11109.900024], [923.441487, 9742.293897], [7214.429674, 4440.190141], [15840.868325, 1599.777414]]], "name": "L1_polygon"}, {"type": "Polygon", "coordinates": [[[19859.52633, 2588.661845], [19901.606519, 3282.984956], [15441.106534, 4061.468444], [11064.766925, 5765.71608], [6646.347129, 7806.605224], [2122.726861, 11930.463701], [1659.844787, 11341.341061], [2985.370726, 10184.135876], [5909.943829, 7596.204281], [8687.236273, 5807.796268], [12432.373053, 4103.548632], [16093.349456, 3177.784484]]], "name": "L2_polygon"}, {"type": "Polygon", "coordinates": [[[19880.566424, 3388.185427], [19901.606519, 3935.227878], [19880.566424, 4082.508538], [15567.347099, 4945.152403], [11801.170225, 6628.359945], [7109.229203, 8690.289183], [1933.366012, 13697.831619], [1996.486295, 12077.74436], [3637.613648, 10604.937762], [6646.347129, 7869.725507], [11422.448528, 5681.555702], [15525.266911, 4166.668915]]], "name": "L3_polygon"}, {"type": "Polygon", "coordinates": [[[20680.090007, 6060.277399], [21479.613589, 5891.956645], [21963.535757, 7491.00381], [21921.455569, 7785.565129], [17503.035772, 9363.5722], [12769.014561, 11677.982569], [8203.314105, 14497.355202], [4857.939116, 17590.249059], [3532.413177, 17653.369342], [3805.934402, 14749.836333], [4773.778739, 14013.433033], [12221.97211, 9384.612294], [20680.090007, 6207.558059]]], "name": "L5_polygon"}, {"type": "Polygon", "coordinates": [[[21837.295192, 7932.845789], [23436.342356, 7617.244375], [23541.542827, 10794.29861], [17608.236243, 13108.70898], [10517.724474, 17295.687739], [5804.743358, 21230.185368], [4836.899022, 17695.449531], [8224.354199, 14539.43539], [12769.014561, 11699.022664], [17503.035772, 9426.692482]]], "name": "L6_polygon"}, {"type": "Polygon", "coordinates": [[[19985.766896, 4271.869386], [20490.729158, 6207.558059], [12179.891922, 9363.5722], [4184.656099, 14350.074542], [1701.924975, 13887.192468], [2291.047615, 13424.310394], [7172.349486, 8690.289183], [15714.627759, 4987.232592], [18197.358883, 4482.270329], [19838.486236, 4166.668915]]], "name": "L4_polygon"}] -------------------------------------------------------------------------------- /gene_lists/BARISTASEQ_genes.csv: -------------------------------------------------------------------------------- 1 | ,gene 2 | 0,Ank1 3 | 1,Kcnmb2 4 | 2,Ankrd55 5 | 3,Slc32a1 6 | 4,Btbd11 7 | 5,Arx 8 | 6,Dlx1 9 | 7,Gad2 10 | 8,Pvalb 11 | 9,Pdgfra 12 | 10,Nxph4 13 | 11,Car3 14 | 12,Slc17a8 15 | 13,Syt6 16 | 14,Rspo1 17 | 15,Lratd2 18 | 16,Deptor 19 | 17,Ndnf 20 | 18,Chrna2 21 | 19,Calb1 22 | 20,Sncg 23 | 21,Th 24 | 22,Gad1 25 | 23,Slc17a7 26 | 24,Neurod1 27 | 25,Rorb 28 | 26,Fezf2 29 | 27,Adarb2 30 | 28,Lamp5 31 | 29,Vip 32 | 30,Lhx6 33 | 31,Chodl 34 | 32,Fa2h 35 | 33,Ly86 36 | 34,Ly6c2 37 | 35,Dcn 38 | 36,Fgfr3 39 | 37,Map3k7cl 40 | 38,Nxph1 41 | 39,Pcp4 42 | 40,Neurod6 43 | 41,Nrn1 44 | 42,Sst 45 | 43,Nrgn 46 | 44,Ptn 47 | 45,Cck 48 | 46,Synpr 49 | 47,Slc6a1 50 | 48,Dlx6 51 | 49,Atp1a3 52 | 50,Arpp19 53 | 51,Npy 54 | 52,Cxcl14 55 | 53,Rab3b 56 | 54,Cryab 57 | 55,Penk 58 | 56,Tesc 59 | 57,Crh 60 | 58,Caln1 61 | 59,Kcnip1 62 | 60,Gm11549 63 | 61,Ctxn1 64 | 62,Car4 65 | 63,Nfib 66 | 64,Id2 67 | 65,Igfbp6 68 | 66,Itpka 69 | 67,Ptprd 70 | 68,Sv2b 71 | 69,Vxn 72 | 70,Reln 73 | 71,Rprml 74 | 72,Cnr1 75 | 73,Cacna2d3 76 | 74,Plpp4 77 | 75,Adcy2 78 | 76,Kcnip4 79 | 77,Sparcl1 80 | 78,Brinp3 81 | -------------------------------------------------------------------------------- /gene_lists/DARTFISH_genes.csv: -------------------------------------------------------------------------------- 1 | ,gene 2 | 0,3110035E14Rik 3 | 1,AI593442 4 | 2,Actr1b 5 | 3,Adarb2 6 | 4,Adcy2 7 | 5,Adra1b 8 | 6,Ak5 9 | 7,Alcam 10 | 8,Aldoc 11 | 9,Ank1 12 | 10,Ankrd55 13 | 11,Ano3 14 | 12,Ap1s2 15 | 13,Apbb1 16 | 14,Apod 17 | 15,Apoe 18 | 16,App 19 | 17,Arpp19 20 | 18,Atp1a3 21 | 19,Atp2b4 22 | 20,Atp5a1 23 | 21,Atp5b 24 | 22,Atp6ap1l 25 | 23,B2m 26 | 24,B3galt2 27 | 25,Baiap2 28 | 26,Bdnf 29 | 27,Bex3 30 | 28,Bin1 31 | 29,Blnk 32 | 30,Brinp1 33 | 31,Btbd3 34 | 32,C1qb 35 | 33,C1ql1 36 | 34,Cacna2d3 37 | 35,Cadm1 38 | 36,Cadps2 39 | 37,Calb1 40 | 38,Caln1 41 | 39,Camk2n1 42 | 40,Camkv 43 | 41,Car10 44 | 42,Car4 45 | 43,Cbln2 46 | 44,Ccdc136 47 | 45,Cck 48 | 46,Cd24a 49 | 47,Cd34 50 | 48,Cdh6 51 | 49,Cdh9 52 | 50,Chga 53 | 51,Chgb 54 | 52,Chodl 55 | 53,Chrm2 56 | 54,Chrna2 57 | 55,Ckmt1 58 | 56,Clstn1 59 | 57,Clstn3 60 | 58,Clu 61 | 59,Cnr1 62 | 60,Coch 63 | 61,Col25a1 64 | 62,Col6a1 65 | 63,Cort 66 | 64,Cox6a2 67 | 65,Cp 68 | 66,Cplx1 69 | 67,Cplx2 70 | 68,Cplx3 71 | 69,Cpne4 72 | 70,Cpne6 73 | 71,Cpne7 74 | 72,Cpne9 75 | 73,Crtac1 76 | 74,Cryab 77 | 75,Crym 78 | 76,Ctgf 79 | 77,Ctsh 80 | 78,Ctxn1 81 | 79,Cx3cl1 82 | 80,Cx3cr1 83 | 81,Cxcl12 84 | 82,Cxcl14 85 | 83,Dcn 86 | 84,Deptor 87 | 85,Dgkb 88 | 86,Diras2 89 | 87,Dkkl1 90 | 88,Dlx6os1 91 | 89,Dnajc21 92 | 90,Dner 93 | 91,Dnm1 94 | 92,Edil3 95 | 93,Elmo1 96 | 94,Enc1 97 | 95,Enpp2 98 | 96,Ephx4 99 | 97,Etv1 100 | 98,Fa2h 101 | 99,Fam163b 102 | 100,Fam171b 103 | 101,Fam213a 104 | 102,Fam3c 105 | 103,Fam84b 106 | 104,Fez1 107 | 105,Fezf2 108 | 106,Fgf12 109 | 107,Fgf13 110 | 108,Fgfr3 111 | 109,Fkbp1a 112 | 110,Flywch1 113 | 111,Fndc5 114 | 112,Fth1 115 | 113,Gaa 116 | 114,Gabra1 117 | 115,Gabrb2 118 | 116,Gabrg1 119 | 117,Gabrg2 120 | 118,Gad1 121 | 119,Gad2 122 | 120,Galnt14 123 | 121,Galnt9 124 | 122,Gap43 125 | 123,Garnl3 126 | 124,Gja1 127 | 125,Glrb 128 | 126,Gm11549 129 | 127,Gm34583 130 | 128,Gpd1 131 | 129,Gpr83 132 | 130,Gpr88 133 | 131,Gprasp2 134 | 132,Grb14 135 | 133,Gria1 136 | 134,Grik1 137 | 135,Grin3a 138 | 136,Grm8 139 | 137,Gsta4 140 | 138,Gstm5 141 | 139,Gucy1a1 142 | 140,Hapln1 143 | 141,Hpca 144 | 142,Hpcal1 145 | 143,Hs3st2 146 | 144,Hsbp1 147 | 145,Hspa8 148 | 146,Htra1 149 | 147,Id2 150 | 148,Idh3a 151 | 149,Igfbp4 152 | 150,Igfbp7 153 | 151,Igsf21 154 | 152,Itfg1 155 | 153,Itm2c 156 | 154,Itpka 157 | 155,Jam2 158 | 156,Kcnab1 159 | 157,Kcnc2 160 | 158,Kcnip1 161 | 159,Kcnip2 162 | 160,Kcnip4 163 | 161,Kcnmb2 164 | 162,Kcnmb4 165 | 163,Khdrbs3 166 | 164,Kidins220 167 | 165,Kit 168 | 166,Klf5 169 | 167,Lamp5 170 | 168,Laptm4b 171 | 169,Ldb2 172 | 170,Ldha 173 | 171,Ldhb 174 | 172,Lgals1 175 | 173,Lhx6 176 | 174,Lmo3 177 | 175,Luzp2 178 | 176,Ly6c2 179 | 177,Ly86 180 | 178,Lypd6 181 | 179,Mafb 182 | 180,Maged1 183 | 181,Mal2 184 | 182,Malat1 185 | 183,Mapk1 186 | 184,Mapk10 187 | 185,Mef2c 188 | 186,Meg3 189 | 187,Meis2 190 | 188,Mgat4c 191 | 189,Mgll 192 | 190,Mir99ahg 193 | 191,Mmp17 194 | 192,Myl4 195 | 193,Nap1l1 196 | 194,Ncald 197 | 195,Ncdn 198 | 196,Ndrg4 199 | 197,Ndufa11 200 | 198,Ndufa13 201 | 199,Necab1 202 | 200,Necab2 203 | 201,Necab3 204 | 202,Nefl 205 | 203,Nefm 206 | 204,Nek7 207 | 205,Nell2 208 | 206,Neto2 209 | 207,Neurod1 210 | 208,Neurod6 211 | 209,Nfib 212 | 210,Nos1 213 | 211,Nov 214 | 212,Nptx2 215 | 213,Npy 216 | 214,Nr4a2 217 | 215,Nrep 218 | 216,Nrgn 219 | 217,Nrip3 220 | 218,Nrn1 221 | 219,Nrsn1 222 | 220,Nrsn2 223 | 221,Nrxn1 224 | 222,Nsf 225 | 223,Nxph1 226 | 224,Ogfrl1 227 | 225,Olfm2 228 | 226,Olfm3 229 | 227,Osbpl1a 230 | 228,Pak1 231 | 229,Palmd 232 | 230,Pamr1 233 | 231,Pantr1 234 | 232,Parm1 235 | 233,Pcdh15 236 | 234,Pcdh17 237 | 235,Pcdh8 238 | 236,Pcdh9 239 | 237,Pcp4 240 | 238,Pcp4l1 241 | 239,Pcsk1 242 | 240,Pde1a 243 | 241,Pdgfra 244 | 242,Penk 245 | 243,Pfkl 246 | 244,Phlda1 247 | 245,Pitpna 248 | 246,Pitpnc1 249 | 247,Pja1 250 | 248,Pja2 251 | 249,Plcxd2 252 | 250,Plcxd3 253 | 251,Plekha2 254 | 252,Plp1 255 | 253,Plpp3 256 | 254,Pls3 257 | 255,Podxl2 258 | 256,Ppp1r1a 259 | 257,Ppp3ca 260 | 258,Prkar1b 261 | 259,Prkcb 262 | 260,Prkcg 263 | 261,Prnp 264 | 262,Prss23 265 | 263,Ptgds 266 | 264,Ptgs2 267 | 265,Ptk2b 268 | 266,Ptn 269 | 267,Ptprd 270 | 268,Ptprk 271 | 269,Ptprt 272 | 270,Ptprz1 273 | 271,Pvalb 274 | 272,Qpct 275 | 273,R3hdm1 276 | 274,Rab27b 277 | 275,Rab3a 278 | 276,Rab3b 279 | 277,Rab3c 280 | 278,Rab6a 281 | 279,Ralyl 282 | 280,Ramp1 283 | 281,Rap1gds1 284 | 282,Rasgrf2 285 | 283,Rasl10a 286 | 284,Rasl11b 287 | 285,Rcan2 288 | 286,Rcn2 289 | 287,Reln 290 | 288,Rgs10 291 | 289,Rgs12 292 | 290,Rgs4 293 | 291,Rheb 294 | 292,Rorb 295 | 293,Rprm 296 | 294,Rspo1 297 | 295,Rtn1 298 | 296,Rtn3 299 | 297,Rtn4 300 | 298,Scg2 301 | 299,Scg3 302 | 300,Selenom 303 | 301,Sema3c 304 | 302,Sema3e 305 | 303,Sema5a 306 | 304,Serp2 307 | 305,Serpine2 308 | 306,Serpini1 309 | 307,Sez6 310 | 308,Slc17a7 311 | 309,Slc1a1 312 | 310,Slc1a2 313 | 311,Slc1a3 314 | 312,Slc24a3 315 | 313,Slc25a3 316 | 314,Slc25a4 317 | 315,Slc30a3 318 | 316,Slc6a1 319 | 317,Slco1a4 320 | 318,Snap25 321 | 319,Snca 322 | 320,Snhg11 323 | 321,Snrpn 324 | 322,Sparcl1 325 | 323,Spock3 326 | 324,Spon1 327 | 325,Srm 328 | 326,Sst 329 | 327,St6galnac5 330 | 328,Stmn1 331 | 329,Stmn2 332 | 330,Stmn3 333 | 331,Stx1a 334 | 332,Stxbp1 335 | 333,Stxbp6 336 | 334,Sub1 337 | 335,Sulf2 338 | 336,Sv2b 339 | 337,Syn2 340 | 338,Synpr 341 | 339,Syt1 342 | 340,Syt13 343 | 341,Syt17 344 | 342,Tagln3 345 | 343,Tcerg1l 346 | 344,Tesc 347 | 345,Th 348 | 346,Thrsp 349 | 347,Thsd7a 350 | 348,Tiam2 351 | 349,Timp2 352 | 350,Timp3 353 | 351,Tmem130 354 | 352,Tmem178 355 | 353,Tmem196 356 | 354,Tmsb10 357 | 355,Tmsb4x 358 | 356,Tnfaip6 359 | 357,Tnfaip8l3 360 | 358,Tpbg 361 | 359,Tpm2 362 | 360,Trp53i11 363 | 361,Tsc22d1 364 | 362,Tspan13 365 | 363,Tspan7 366 | 364,Tuba1a 367 | 365,Tuba4a 368 | 366,Ubb 369 | 367,Ube2m 370 | 368,Uchl3 371 | 369,Vgf 372 | 370,Vip 373 | 371,Vsnl1 374 | 372,Vstm2a 375 | 373,Vstm2b 376 | 374,Vstm2l 377 | 375,Wasf1 378 | 376,Wls 379 | 377,Wsb2 380 | 378,Zcchc12 381 | 379,Zwint 382 | -------------------------------------------------------------------------------- /gene_lists/ISS_genes.csv: -------------------------------------------------------------------------------- 1 | ,gene 2 | 0,Zmat4 3 | 1,Kcnmb2 4 | 2,Snca 5 | 3,Slc1a2 6 | 4,Cryab 7 | 5,Crh 8 | 6,Gm11549 9 | 7,Gad1 10 | 8,Dlx1 11 | 9,Id2 12 | 10,Ly6c2 13 | 11,Tmsb10 14 | 12,Btbd11 15 | 13,Grik1 16 | 14,Nrn1 17 | 15,Pdgfra 18 | 16,Lamp5 19 | 17,Fezf2 20 | 18,Fgf13 21 | 19,Adarb2 22 | 20,Th 23 | 21,Fa2h 24 | 22,Nrxn1 25 | 23,Hpca 26 | 24,Camk2n1 27 | 25,Sv2b 28 | 26,Sparcl1 29 | 27,Thsd7a 30 | 28,Igfbp6 31 | 29,Synpr 32 | 30,Rab3c 33 | 31,Ctxn1 34 | 32,R3hdm1 35 | 33,Syt1 36 | 34,Ndnf 37 | 35,Itpka 38 | 36,Cdh13 39 | 37,Igfbp4 40 | 38,Stxbp6 41 | 39,Meis2 42 | 40,Ptprt 43 | 41,Gabra1 44 | 42,Gad2 45 | 43,Cacna2d3 46 | 44,Snhg11 47 | 45,Rgs4 48 | 46,Penk 49 | 47,Ndrg4 50 | 48,Vip 51 | 49,Nfib 52 | 50,Rorb 53 | 51,Cnr1 54 | 52,Chodl 55 | 53,Lhx6 56 | 54,Cdh9 57 | 55,Reln 58 | 56,Malat1 59 | 57,Fam84b 60 | 58,Alcam 61 | 59,Tmsb4x 62 | 60,Pcp4l1 63 | 61,Ptprd 64 | 62,Mgat4c 65 | 63,Adcy2 66 | 64,Etv1 67 | 65,Npy 68 | 66,Nov 69 | 67,Car3 70 | 68,Fxyd6 71 | 69,Hs3st2 72 | 70,Nrgn 73 | 71,Ptn 74 | 72,Pde1a 75 | 73,Arpp19 76 | 74,Kcnip4 77 | 75,Cpne7 78 | 76,Caln1 79 | 77,Cplx3 80 | 78,Snrpn 81 | 79,Kcnip1 82 | 80,Sema3e 83 | 81,Slc6a1 84 | 82,Dlx6os1 85 | 83,Rgs10 86 | 84,Lrrtm4 87 | 85,Crym 88 | 86,Slc17a7 89 | 87,Neurod1 90 | 88,Sst 91 | 89,Atp1a3 92 | 90,Rspo1 93 | 91,Calb1 94 | 92,Sez6 95 | 93,Rprml 96 | 94,Fam19a1 97 | 95,Pthlh 98 | 96,Brinp3 99 | 97,Cck 100 | 98,Cxcl14 101 | 99,Fgfr3 102 | 100,Serpine2 103 | 101,Rasl10a 104 | 102,Pantr1 105 | 103,Slc32a1 106 | 104,Car4 107 | 105,Chrna2 108 | 106,Ankrd55 109 | 107,Npas1 110 | 108,Cd34 111 | 109,Deptor 112 | 110,Igsf21 113 | 111,Ank1 114 | 112,Pcp4 115 | 113,Sncg 116 | 114,3110035E14Rik 117 | 115,Dcn 118 | 116,Arx 119 | 117,Pvalb 120 | 118,Nxph4 121 | 119,Bdnf 122 | 120,Dgkb 123 | 121,Neurod6 124 | 122,Serpini1 125 | 123,Nxph1 126 | 124,Nek7 127 | 125,Rab3b 128 | 126,Luzp2 129 | 127,Ly86 130 | 128,Syt6 131 | 129,Map3k7cl 132 | 130,Tesc 133 | 131,Tac2 134 | 132,Ppapdc1a 135 | -------------------------------------------------------------------------------- /gene_lists/MERFISH_genes.csv: -------------------------------------------------------------------------------- 1 | ,gene 2 | 0,1700022I11Rik 3 | 1,1810046K07Rik 4 | 2,5031425F14Rik 5 | 3,5730522E02Rik 6 | 4,Acta2 7 | 5,Adam2 8 | 6,Adamts2 9 | 7,Adamts4 10 | 8,Adra1b 11 | 9,Alk 12 | 10,Ankfn1 13 | 11,Ano4 14 | 12,Aqp4 15 | 13,Asic4 16 | 14,B4galnt2 17 | 15,B4galnt3 18 | 16,Barx2 19 | 17,Bcl11b 20 | 18,Bdnf 21 | 19,Bgn 22 | 20,Blnk 23 | 21,Bmpr1b 24 | 22,Brinp3 25 | 23,C1ql3 26 | 24,C1qtnf7 27 | 25,Cacng5 28 | 26,Calb2 29 | 27,Camk2d 30 | 28,Car3 31 | 29,Cbln2 32 | 30,Cbln4 33 | 31,Ccbe1 34 | 32,Ccdc162 35 | 33,Ccdc3 36 | 34,Ccdc80 37 | 35,Ccnb1 38 | 36,Cd14 39 | 37,Cd24a 40 | 38,Cdca7 41 | 39,Cdcp1 42 | 40,Cdh12 43 | 41,Cdh13 44 | 42,Cdh20 45 | 43,Cdh9 46 | 44,Ceacam9 47 | 45,Cemip 48 | 46,Chat 49 | 47,Chn2 50 | 48,Chodl 51 | 49,Chrm2 52 | 50,Chrna2 53 | 51,Cldn5 54 | 52,Clrn1 55 | 53,Cntnap5b 56 | 54,Cobll1 57 | 55,Col14a1 58 | 56,Col15a1 59 | 57,Col23a1 60 | 58,Col24a1 61 | 59,Col25a1 62 | 60,Corin 63 | 61,Cplx3 64 | 62,Crhr2 65 | 63,Crispld2 66 | 64,Cspg4 67 | 65,Ctss 68 | 66,Cux2 69 | 67,Cxcl14 70 | 68,Daam2 71 | 69,Dmkn 72 | 70,Dnase1l3 73 | 71,Dscaml1 74 | 72,Egfem1 75 | 73,Egfr 76 | 74,Egln3 77 | 75,Egr2 78 | 76,Elfn1 79 | 77,Enpp6 80 | 78,Epha7 81 | 79,Fam19a2 82 | 80,Fam84b 83 | 81,Fbxl7 84 | 82,Fezf2 85 | 83,Flrt3 86 | 84,Flt1 87 | 85,Fndc7 88 | 86,Fosb 89 | 87,Foxp2 90 | 88,Frem2 91 | 89,Fst 92 | 90,Gfap 93 | 91,Glra1 94 | 92,Gpc6 95 | 93,Grik1 96 | 94,Grin3a 97 | 95,Grm1 98 | 96,Grm8 99 | 97,Hpse 100 | 98,Hs3st5 101 | 99,Igf2 102 | 100,Igfbp4 103 | 101,Igfbp5 104 | 102,Ikzf2 105 | 103,Il1rapl2 106 | 104,Il4ra 107 | 105,Inpp4b 108 | 106,Iqgap2 109 | 107,Itgb8 110 | 108,Kcng1 111 | 109,Kcnj8 112 | 110,L3mbtl4 113 | 111,Lama3 114 | 112,Lhx6 115 | 113,Lmo1 116 | 114,Lsp1 117 | 115,Ltf 118 | 116,Luzp2 119 | 117,Lypd1 120 | 118,Lyzl4 121 | 119,March1 122 | 120,Marcksl1 123 | 121,Meis2 124 | 122,Moxd1 125 | 123,Mrc1 126 | 124,Mrgprx2 127 | 125,Muc20 128 | 126,Myh14 129 | 127,Ndst4 130 | 128,Nhs 131 | 129,Nkain3 132 | 130,Nnmt 133 | 131,Nos1 134 | 132,Npas1 135 | 133,Npnt 136 | 134,Npsr1 137 | 135,Npy2r 138 | 136,Nr2f2 139 | 137,Nr4a1 140 | 138,Nr4a2 141 | 139,Ntng2 142 | 140,Nxph1 143 | 141,Nxph2 144 | 142,Nxph4 145 | 143,Olah 146 | 144,Olfm3 147 | 145,Opalin 148 | 146,Oprk1 149 | 147,Osr1 150 | 148,Otof 151 | 149,Parm1 152 | 150,Pcdh8 153 | 151,Pde11a 154 | 152,Pdgfc 155 | 153,Pdgfra 156 | 154,Pdlim5 157 | 155,Phactr2 158 | 156,Plch1 159 | 157,Plcxd3 160 | 158,Pld5 161 | 159,Plekhg3 162 | 160,Pou3f1 163 | 161,Pou3f3 164 | 162,Pou6f2 165 | 163,Prdm8 166 | 164,Prok2 167 | 165,Prokr2 168 | 166,Prox1 169 | 167,Prr16 170 | 168,Prss12 171 | 169,Prss23 172 | 170,Ptger3 173 | 171,Ptprk 174 | 172,Ptprm 175 | 173,Ptprt 176 | 174,Ptpru 177 | 175,Pxdc1 178 | 176,Ramp1 179 | 177,Reln 180 | 178,Rerg 181 | 179,Rfx3 182 | 180,Rgs5 183 | 181,Rgs6 184 | 182,Rnf152 185 | 183,Ror1 186 | 184,Rorb 187 | 185,Rspo1 188 | 186,Rxfp1 189 | 187,Rxfp2 190 | 188,Satb2 191 | 189,Scgn 192 | 190,Sema3e 193 | 191,Sema5a 194 | 192,Serpinf1 195 | 193,Sertm1 196 | 194,Sgcd 197 | 195,Shisa9 198 | 196,Slc17a6 199 | 197,Slc17a8 200 | 198,Slc25a13 201 | 199,Slc30a3 202 | 200,Slc32a1 203 | 201,Slc44a5 204 | 202,Slco5a1 205 | 203,Sncg 206 | 204,Sox10 207 | 205,Sox6 208 | 206,Sp8 209 | 207,Spon1 210 | 208,St6galnac5 211 | 209,Sulf1 212 | 210,Sulf2 213 | 211,Syndig1 214 | 212,Syt10 215 | 213,Syt6 216 | 214,Tbc1d4 217 | 215,Tcap 218 | 216,Teddm3 219 | 217,Tenm3 220 | 218,Th 221 | 219,Thbs2 222 | 220,Thsd7a 223 | 221,Timp3 224 | 222,Tmem163 225 | 223,Tmtc2 226 | 224,Tnfaip6 227 | 225,Tox 228 | 226,Trp53i11 229 | 227,Trpc4 230 | 228,Trpc6 231 | 229,Tshz2 232 | 230,Tunar 233 | 231,Ubash3b 234 | 232,Unc13c 235 | 233,Unc5b 236 | 234,Unc5d 237 | 235,Ust 238 | 236,Vipr2 239 | 237,Vtn 240 | 238,Vwc2 241 | 239,Wipf3 242 | 240,Wnt7b 243 | 241,Zfp804b 244 | 242,Vip 245 | 243,Calb1 246 | 244,Gad2 247 | 245,Tac2 248 | 246,Lamp5 249 | 247,Cnr1 250 | 248,Pvalb 251 | 249,Sst 252 | 250,Rab3b 253 | 251,Slc17a7 254 | 252,Penk 255 | 253,Gad1 256 | -------------------------------------------------------------------------------- /gene_lists/MERFISH_nonBarcoded.csv: -------------------------------------------------------------------------------- 1 | 242 Vip 2 | 243 Calb1 3 | 244 Gad2 4 | 245 Tac2 5 | 246 Lamp5 6 | 247 Cnr1 7 | 248 Pvalb 8 | 249 Sst 9 | 250 Rab3b 10 | 251 Slc17a7 11 | 252 Penk 12 | 253 Gad1 -------------------------------------------------------------------------------- /gene_lists/exseq_genes.csv: -------------------------------------------------------------------------------- 1 | ,gene 2 | 0,Alcam 3 | 1,Ank1 4 | 2,Ankrd55 5 | 3,B3galt1 6 | 4,Cdh9 7 | 5,Chodl 8 | 6,Cux2 9 | 7,Dlx1 10 | 8,Elfn1 11 | 9,Fam19a2 12 | 10,Fezf2 13 | 11,Foxp2 14 | 12,Gad2 15 | 13,Galnt14 16 | 14,Grin3a 17 | 15,Grm5 18 | 16,Kcnip4 19 | 17,Kcnk2 20 | 18,Kcnmb2 21 | 19,Ldb2 22 | 20,Lhx6 23 | 21,Lingo2 24 | 22,Mef2c 25 | 23,Mpped1 26 | 24,Npas1 27 | 25,Nr2f2 28 | 26,Nts 29 | 27,Parm1 30 | 28,Pcdh8 31 | 29,Pde1a 32 | 30,Prox1 33 | 31,Pvalb 34 | 32,Rorb 35 | 33,Satb2 36 | 34,Sema3e 37 | 35,Sez6 38 | 36,Slc32a1 39 | 37,Sv2c 40 | 38,Syndig1 41 | 39,Thsd7a 42 | 40,Tnni3k 43 | 41,Unc13c 44 | -------------------------------------------------------------------------------- /gene_lists/file_list.csv: -------------------------------------------------------------------------------- 1 | ,fullfile 2 | 0,https://s3.amazonaws.com/starfish.data.spacetx/spacejam2/MERFISH_zhuang_lab_MOp/MERFISH_dataset1_slice1.csv 3 | 1,https://s3.amazonaws.com/starfish.data.spacetx/spacejam2/MERFISH_zhuang_lab_MOp/MERFISH_dataset1_slice10.csv 4 | 2,https://s3.amazonaws.com/starfish.data.spacetx/spacejam2/MERFISH_zhuang_lab_MOp/MERFISH_dataset1_slice102.csv 5 | 3,https://s3.amazonaws.com/starfish.data.spacetx/spacejam2/MERFISH_zhuang_lab_MOp/MERFISH_dataset1_slice112.csv 6 | 4,https://s3.amazonaws.com/starfish.data.spacetx/spacejam2/MERFISH_zhuang_lab_MOp/MERFISH_dataset1_slice122.csv 7 | 5,https://s3.amazonaws.com/starfish.data.spacetx/spacejam2/MERFISH_zhuang_lab_MOp/MERFISH_dataset1_slice131.csv 8 | 6,https://s3.amazonaws.com/starfish.data.spacetx/spacejam2/MERFISH_zhuang_lab_MOp/MERFISH_dataset1_slice153.csv 9 | 7,https://s3.amazonaws.com/starfish.data.spacetx/spacejam2/MERFISH_zhuang_lab_MOp/MERFISH_dataset1_slice162.csv 10 | 8,https://s3.amazonaws.com/starfish.data.spacetx/spacejam2/MERFISH_zhuang_lab_MOp/MERFISH_dataset1_slice170.csv 11 | 9,https://s3.amazonaws.com/starfish.data.spacetx/spacejam2/MERFISH_zhuang_lab_MOp/MERFISH_dataset1_slice180.csv 12 | 10,https://s3.amazonaws.com/starfish.data.spacetx/spacejam2/MERFISH_zhuang_lab_MOp/MERFISH_dataset1_slice190.csv 13 | 11,https://s3.amazonaws.com/starfish.data.spacetx/spacejam2/MERFISH_zhuang_lab_MOp/MERFISH_dataset1_slice200.csv 14 | 12,https://s3.amazonaws.com/starfish.data.spacetx/spacejam2/MERFISH_zhuang_lab_MOp/MERFISH_dataset1_slice201.csv 15 | 13,https://s3.amazonaws.com/starfish.data.spacetx/spacejam2/MERFISH_zhuang_lab_MOp/MERFISH_dataset1_slice21.csv 16 | 14,https://s3.amazonaws.com/starfish.data.spacetx/spacejam2/MERFISH_zhuang_lab_MOp/MERFISH_dataset1_slice212.csv 17 | 15,https://s3.amazonaws.com/starfish.data.spacetx/spacejam2/MERFISH_zhuang_lab_MOp/MERFISH_dataset1_slice221.csv 18 | 16,https://s3.amazonaws.com/starfish.data.spacetx/spacejam2/MERFISH_zhuang_lab_MOp/MERFISH_dataset1_slice232.csv 19 | 17,https://s3.amazonaws.com/starfish.data.spacetx/spacejam2/MERFISH_zhuang_lab_MOp/MERFISH_dataset1_slice241.csv 20 | 18,https://s3.amazonaws.com/starfish.data.spacetx/spacejam2/MERFISH_zhuang_lab_MOp/MERFISH_dataset1_slice251.csv 21 | 19,https://s3.amazonaws.com/starfish.data.spacetx/spacejam2/MERFISH_zhuang_lab_MOp/MERFISH_dataset1_slice260.csv 22 | 20,https://s3.amazonaws.com/starfish.data.spacetx/spacejam2/MERFISH_zhuang_lab_MOp/MERFISH_dataset1_slice271.csv 23 | 21,https://s3.amazonaws.com/starfish.data.spacetx/spacejam2/MERFISH_zhuang_lab_MOp/MERFISH_dataset1_slice283.csv 24 | 22,https://s3.amazonaws.com/starfish.data.spacetx/spacejam2/MERFISH_zhuang_lab_MOp/MERFISH_dataset1_slice291.csv 25 | 23,https://s3.amazonaws.com/starfish.data.spacetx/spacejam2/MERFISH_zhuang_lab_MOp/MERFISH_dataset1_slice301.csv 26 | 24,https://s3.amazonaws.com/starfish.data.spacetx/spacejam2/MERFISH_zhuang_lab_MOp/MERFISH_dataset1_slice31.csv 27 | 25,https://s3.amazonaws.com/starfish.data.spacetx/spacejam2/MERFISH_zhuang_lab_MOp/MERFISH_dataset1_slice313.csv 28 | 26,https://s3.amazonaws.com/starfish.data.spacetx/spacejam2/MERFISH_zhuang_lab_MOp/MERFISH_dataset1_slice326.csv 29 | 27,https://s3.amazonaws.com/starfish.data.spacetx/spacejam2/MERFISH_zhuang_lab_MOp/MERFISH_dataset1_slice40.csv 30 | 28,https://s3.amazonaws.com/starfish.data.spacetx/spacejam2/MERFISH_zhuang_lab_MOp/MERFISH_dataset1_slice50.csv 31 | 29,https://s3.amazonaws.com/starfish.data.spacetx/spacejam2/MERFISH_zhuang_lab_MOp/MERFISH_dataset1_slice62.csv 32 | 30,https://s3.amazonaws.com/starfish.data.spacetx/spacejam2/MERFISH_zhuang_lab_MOp/MERFISH_dataset1_slice71.csv 33 | 31,https://s3.amazonaws.com/starfish.data.spacetx/spacejam2/MERFISH_zhuang_lab_MOp/MERFISH_dataset1_slice81.csv 34 | 32,https://s3.amazonaws.com/starfish.data.spacetx/spacejam2/MERFISH_zhuang_lab_MOp/MERFISH_dataset1_slice91.csv 35 | -------------------------------------------------------------------------------- /gene_lists/osmFISH_excitatory_genes.csv: -------------------------------------------------------------------------------- 1 | ,gene 2 | 0,Hs3st2 3 | 1,Grik1 4 | 2,Mpped1 5 | 3,Syt6 6 | 4,Slc17a8 7 | 5,Cux2 8 | 6,Tgm3 9 | 7,Slit3 10 | 8,Mdga1 11 | 9,Nipal3 12 | 10,Ncam2 13 | 11,Cntn5 14 | 12,Inf2 15 | 13,Kcna6 16 | 14,Satb2 17 | 15,Brinp2 18 | 16,Sorcs3 19 | 17,Lmo3 20 | 18,Deptor 21 | 19,Etv1 22 | 20,Prox1 23 | 21,Ly6c2 24 | 22,Fam19a2 25 | 23,Coro6 26 | 24,Galnt14 27 | 25,Fam19a1 28 | 26,Prkcg 29 | 27,Pdgfra 30 | 28,Fa2h 31 | 29,Chodl 32 | 30,Sv2c 33 | 31,Fam84b 34 | 32,Tbc1d30 35 | 33,Zfp827 36 | 34,Cdh22 37 | 35,Syt6 38 | 36,Lamp5 39 | 37,Nos1 40 | 38,Reln 41 | 39,Atp2b4 42 | 40,Cacng5 43 | 41,Rxfp1 44 | 42,Cbfb 45 | 43,Car3 46 | 44,Pvalb 47 | 45,Ndnf 48 | 46,Tbr1 49 | 47,Ly86 50 | 48,Dcn 51 | 49,Tmem108 52 | 50,Tshz2 53 | 51,Meis2 54 | 52,Lhx6 55 | 53,Map3k7cl 56 | 54,Nell1 57 | 55,Cplx2 58 | 56,Fgfr3 59 | 57,Nxph4 60 | 58,Sema3e 61 | 59,Plcb4 62 | 60,Zdhhc22 63 | 61,Rorb 64 | 62,Fosl2 65 | 63,Foxp2 66 | 64,Rspo1 67 | 65,Gm3764 68 | 66,Vstm2l 69 | 67,Pcdh8 70 | 68,Brinp3 71 | 69,Malat1 72 | 70,Calm1 73 | 71,Rorb 74 | -------------------------------------------------------------------------------- /gene_lists/osmFISH_inhibitory_genes.csv: -------------------------------------------------------------------------------- 1 | ,gene 2 | 0,Pvalb 3 | 1,Vip 4 | 2,Nos1 5 | 3,Crhbp 6 | 4,Gabrb2 7 | 5,Gpr125 8 | 6,Rgs12 9 | 7,Chst1 10 | 8,Tcerg1l 11 | 9,Htr1f 12 | 10,Ptprt 13 | 11,Kcnk2 14 | 12,Fosl2 15 | 13,Chrna2 16 | 14,Fam19a1 17 | 15,Ngf 18 | 16,Pdgfra 19 | 17,Fa2h 20 | 18,Chodl 21 | 19,Clstn3 22 | 20,Ptprd 23 | 21,Tspan12 24 | 22,Mef2c 25 | 23,Pde1a 26 | 24,Npas1 27 | 25,Cplx2 28 | 26,Rasgrf1 29 | 27,Kcnip2 30 | 28,Cacna2d3 31 | 29,Kcnip4 32 | 30,Thsd7a 33 | 31,Caln1 34 | 32,A830018L16Rik 35 | 33,Col25a1 36 | 34,Sv2c 37 | 35,Ank1 38 | 36,Sema5a 39 | 37,Kcnmb2 40 | 38,Lingo2 41 | 39,Pcdh7 42 | 40,Slc32a1 43 | 41,Lmo3 44 | 42,Unc13c 45 | 43,Pcdh17 46 | 44,Slc42a2 47 | 45,Grik7 48 | 46,Fgfr3 49 | 47,Zbtb20 50 | 48,Dlx1 51 | 49,Sncg 52 | 50,Galnt9 53 | 51,Alcam 54 | 52,Th 55 | 53,Calb1 56 | 54,Prox1 57 | 55,Ly6c2 58 | 56,Meis2 59 | 57,Lhx6 60 | 58,Map3k7cl 61 | 59,Pvalb 62 | 60,Gad2 63 | 61,Ly86 64 | 62,Dcn 65 | 63,Oprm1 66 | 64,Cntn5 67 | 65,Sema5a 68 | 66,Kcns3 69 | 67,Satb2 70 | -------------------------------------------------------------------------------- /gene_lists/seqfish_genes.csv: -------------------------------------------------------------------------------- 1 | ,gene 2 | 0,9330158h04rik 3 | 1,A330009n23rik 4 | 2,A830009l08rik 5 | 3,Ackr2 6 | 4,Acsl5 7 | 5,Adamts13 8 | 6,Adamts17 9 | 7,Adamts19 10 | 8,Adamts2 11 | 9,Adamtsl1 12 | 10,Adamtsl5 13 | 11,Adarb2 14 | 12,Adrb1 15 | 13,Agmat 16 | 14,Ai593442 17 | 15,Ak1 18 | 16,Alk 19 | 17,Amn 20 | 18,Angpt1 21 | 19,Ank3 22 | 20,Anks1b 23 | 21,Ano4 24 | 22,Anpep 25 | 23,Ap2a1 26 | 24,Apmap 27 | 25,Arhgap25 28 | 26,Arhgef28 29 | 27,Arid5a 30 | 28,Arx 31 | 29,Ascl1 32 | 30,Asic4 33 | 31,Astn2 34 | 32,Atp10d 35 | 33,Atp2b4 36 | 34,Atp2c1 37 | 35,Atp8a1 38 | 36,Avpr1a 39 | 37,Aw551984 40 | 38,B3gat1 41 | 39,Baiap2l2 42 | 40,Baiap3 43 | 41,Baz1a 44 | 42,Bc006965 45 | 43,Bcar3 46 | 44,Bcat1 47 | 45,Bcl11b 48 | 46,Bmp3 49 | 47,Btbd11 50 | 48,Btbd3 51 | 49,C1ql3 52 | 50,C1qtnf7 53 | 51,Cadm2 54 | 52,Cadps 55 | 53,Caln1 56 | 54,Camk2a 57 | 55,Camk4 58 | 56,Car3 59 | 57,Casz1 60 | 58,Ccbe1 61 | 59,Ccdc50 62 | 60,Ccdc80 63 | 61,Cckbr 64 | 62,Ccnd1 65 | 63,Ccng1 66 | 64,Ccser1 67 | 65,Cdc42bpa 68 | 66,Cdh12 69 | 67,Cdh18 70 | 68,Cdh22 71 | 69,Cdh26 72 | 70,Cdh6 73 | 71,Cdk18 74 | 72,Celf2 75 | 73,Cemip 76 | 74,Cep170b 77 | 75,Cers6 78 | 76,Cgnl1 79 | 77,Chat 80 | 78,Chrdl1 81 | 79,Chrm2 82 | 80,Chrm3 83 | 81,Chrna2 84 | 82,Chrnb3 85 | 83,Chst15 86 | 84,Cit 87 | 85,Clstn2 88 | 86,Cnksr2 89 | 87,Cntfr 90 | 88,Cntn4 91 | 89,Cntn5 92 | 90,Cntnap2 93 | 91,Cntnap3 94 | 92,Cntnap4 95 | 93,Cntnap5a 96 | 94,Cntnap5b 97 | 95,Cntnap5c 98 | 96,Cobl 99 | 97,Col11a1 100 | 98,Col12a1 101 | 99,Col13a1 102 | 100,Col14a1 103 | 101,Col15a1 104 | 102,Col19a1 105 | 103,Col1a1 106 | 104,Col24a1 107 | 105,Col5a1 108 | 106,Colq 109 | 107,Copg2 110 | 108,Coro6 111 | 109,Cpne5 112 | 110,Cpne9 113 | 111,Crhr1 114 | 112,Crhr2 115 | 113,Csmd1 116 | 114,Csmd3 117 | 115,Cspg4 118 | 116,Cul1 119 | 117,Cux2 120 | 118,Cyb561 121 | 119,Cyp4f14 122 | 120,Cys1 123 | 121,Cyyr1 124 | 122,D030045p18rik 125 | 123,D1ertd622e 126 | 124,Dcaf12l1 127 | 125,Dcc 128 | 126,Dcdc2a 129 | 127,Dclk3 130 | 128,Deptor 131 | 129,Dgkz 132 | 130,Dhrs3 133 | 131,Dlg2 134 | 132,Dlgap1 135 | 133,Dlx1 136 | 134,Dmrt2 137 | 135,Dnajb5 138 | 136,Dnm3 139 | 137,Dock4 140 | 138,Dock5 141 | 139,Dpp10 142 | 140,Dpp6 143 | 141,Drd2 144 | 142,Dscam 145 | 143,Dusp5 146 | 144,Ecel1 147 | 145,Edil3 148 | 146,Eepd1 149 | 147,Egfem1 150 | 148,Egfr 151 | 149,Elavl2 152 | 150,Elfn1 153 | 151,Elk3 154 | 152,Emilin2 155 | 153,Endou 156 | 154,Epha6 157 | 155,Epor 158 | 156,Erbb4 159 | 157,Erc2 160 | 158,Erg 161 | 159,Esrrg 162 | 160,Etl4 163 | 161,Etv1 164 | 162,Evc2 165 | 163,Exd2 166 | 164,Exph5 167 | 165,Eya4 168 | 166,F2rl2 169 | 167,Fa2h 170 | 168,Fam155a 171 | 169,Fam163a 172 | 170,Fam171a2 173 | 171,Fam19a2 174 | 172,Fam84b 175 | 173,Fat3 176 | 174,Fbxl7 177 | 175,Fgf11 178 | 176,Fgf14 179 | 177,Fgfr3 180 | 178,Fibcd1 181 | 179,Fndc1 182 | 180,Fosb 183 | 181,Foxo6 184 | 182,Foxp1 185 | 183,Foxp2 186 | 184,Fras1 187 | 185,Frem1 188 | 186,Frem2 189 | 187,Frmd7 190 | 188,Frmpd1 191 | 189,Frmpd4 192 | 190,Fscn1 193 | 191,Fstl4 194 | 192,Fstl5 195 | 193,Fuom 196 | 194,Gabra4 197 | 195,Gabrg1 198 | 196,Gabrg3 199 | 197,Gad2 200 | 198,Galnt14 201 | 199,Galntl6 202 | 200,Gda 203 | 201,Gdf10 204 | 202,Gfra2 205 | 203,Gja5 206 | 204,Gli3 207 | 205,Gm11762 208 | 206,Gm16070 209 | 207,Gm19410 210 | 208,Gm31465 211 | 209,Gmnc 212 | 210,Gna14 213 | 211,Gpc1 214 | 212,Gpc6 215 | 213,Gpr149 216 | 214,Gpr176 217 | 215,Gpr83 218 | 216,Gpr88 219 | 217,Gprc5b 220 | 218,Grem2 221 | 219,Gria4 222 | 220,Grid2 223 | 221,Grik1 224 | 222,Grik3 225 | 223,Grin2c 226 | 224,Grin3a 227 | 225,Grip1 228 | 226,Grm1 229 | 227,Grm2 230 | 228,Grm5 231 | 229,Grm7 232 | 230,Grm8 233 | 231,Grpel1 234 | 232,Grpr 235 | 233,Gsg1l 236 | 234,Gsx2 237 | 235,Gypc 238 | 236,Hecw1 239 | 237,Hk1 240 | 238,Hpse 241 | 239,Hs3st2 242 | 240,Hs3st4 243 | 241,Hs6st2 244 | 242,Hs6st3 245 | 243,Hsd17b2 246 | 244,Hspa4l 247 | 245,Hspb8 248 | 246,Htr1d 249 | 247,Htr1f 250 | 248,Htr2a 251 | 249,Htr2c 252 | 250,Hunk 253 | 251,Icam5 254 | 252,Ift81 255 | 253,Igfn1 256 | 254,Il1rapl2 257 | 255,Inpp4b 258 | 256,Inpp5j 259 | 257,Insrr 260 | 258,Iqgap2 261 | 259,Iqsec3 262 | 260,Itga4 263 | 261,Itga8 264 | 262,Itpr1 265 | 263,Jakmip1 266 | 264,Kazald1 267 | 265,Kcna2 268 | 266,Kcna6 269 | 267,Kcnc1 270 | 268,Kcng1 271 | 269,Kcnh5 272 | 270,Kcnh7 273 | 271,Kcnip4 274 | 272,Kcnj16 275 | 273,Kcnk2 276 | 274,Kcnmb2 277 | 275,Kcnq5 278 | 276,Kcns1 279 | 277,Kcns3 280 | 278,Kctd16 281 | 279,Kctd8 282 | 280,Kif19a 283 | 281,Kirrel3 284 | 282,Klf12 285 | 283,Klhdc8a 286 | 284,Klhl14 287 | 285,Krt12 288 | 286,Krt80 289 | 287,L3mbtl3 290 | 288,Lgi2 291 | 289,Lgr4 292 | 290,Lhx6 293 | 291,Lin7a 294 | 292,Llgl2 295 | 293,Lmo3 296 | 294,Lmtk2 297 | 295,Loc432842 298 | 296,Lpl 299 | 297,Lrp1b 300 | 298,Lrrc4b 301 | 299,Lrrtm1 302 | 300,Lrrtm4 303 | 301,Lsp1 304 | 302,Lztr1 305 | 303,Magi1 306 | 304,Man1a 307 | 305,Man1c1 308 | 306,Map3k7cl 309 | 307,Map6d1 310 | 308,Mapk11 311 | 309,Mapk4 312 | 310,Matn2 313 | 311,Mb21d2 314 | 312,Mblac2 315 | 313,Mdga1 316 | 314,Me3 317 | 315,Meis2 318 | 316,Met 319 | 317,Mgat4c 320 | 318,Mitf 321 | 319,Mn1 322 | 320,Mpl 323 | 321,Mpped1 324 | 322,Mrps25 325 | 323,Mybpc1 326 | 324,Myh7 327 | 325,Myo5a 328 | 326,Myocd 329 | 327,Myt1l 330 | 328,Naa50 331 | 329,Nacc2 332 | 330,Nav2 333 | 331,Nbea 334 | 332,Ncam1 335 | 333,Nceh1 336 | 334,Nckap5 337 | 335,Ncoa7 338 | 336,Ndnf 339 | 337,Ndst3 340 | 338,Ndst4 341 | 339,Neb 342 | 340,Nefh 343 | 341,Nell1 344 | 342,Neurod2 345 | 343,Nfe2l1 346 | 344,Nfia 347 | 345,Nfib 348 | 346,Nlgn1 349 | 347,Nmnat2 350 | 348,Nog 351 | 349,Npas3 352 | 350,Npnt 353 | 351,Npsr1 354 | 352,Nptx1 355 | 353,Nr2f2 356 | 354,Nrg3 357 | 355,Nrxn3 358 | 356,Ntn1 359 | 357,Ntn5 360 | 358,Ntng1 361 | 359,Nudt3 362 | 360,Nxph1 363 | 361,Nxph4 364 | 362,Nyap2 365 | 363,Opcml 366 | 364,Osbp2 367 | 365,Otof 368 | 366,Oxtr 369 | 367,P2rx2 370 | 368,Pacsin1 371 | 369,Pak3 372 | 370,Pak6 373 | 371,Pard3b 374 | 372,Pawr 375 | 373,Pcdh10 376 | 374,Pcdh11x 377 | 375,Pcdh15 378 | 376,Pcdh18 379 | 377,Pcdh19 380 | 378,Pcdh7 381 | 379,Pde11a 382 | 380,Pde1c 383 | 381,Pde3a 384 | 382,Pde4a 385 | 383,Pde4d 386 | 384,Pdia5 387 | 385,Pdp2 388 | 386,Pdxk 389 | 387,Pdzph1 390 | 388,Pdzrn3 391 | 389,Pfkp 392 | 390,Phka1 393 | 391,Pigs 394 | 392,Pip4k2c 395 | 393,Pkib 396 | 394,Plcl2 397 | 395,Plcxd2 398 | 396,Plekha2 399 | 397,Plxdc2 400 | 398,Plxna1 401 | 399,Plxna2 402 | 400,Plxna4 403 | 401,Prdm1 404 | 402,Prdm8 405 | 403,Prkg1 406 | 404,Prkg2 407 | 405,Prokr2 408 | 406,Prox1 409 | 407,Prr16 410 | 408,Prrt2 411 | 409,Pter 412 | 410,Ptgs1 413 | 411,Ptgs2os 414 | 412,Ptpre 415 | 413,Ptprf 416 | 414,Ptprk 417 | 415,Ptprm 418 | 416,Ptpro 419 | 417,Ptprt 420 | 418,Ptpru 421 | 419,Rab37 422 | 420,Racgap1 423 | 421,Rai14 424 | 422,Rasd1 425 | 423,Rasd2 426 | 424,Rasgrf2 427 | 425,Rbfox1 428 | 426,Rbfox3 429 | 427,Rbm43 430 | 428,Rcn1 431 | 429,Rell1 432 | 430,Rell2 433 | 431,Rerg 434 | 432,Ret 435 | 433,Rftn2 436 | 434,Rfx3 437 | 435,Rgs17 438 | 436,Rgs6 439 | 437,Rgs8 440 | 438,Rgs9 441 | 439,Rimbp2 442 | 440,Rims1 443 | 441,Rnd3 444 | 442,Robo2 445 | 443,Rorb 446 | 444,Rps6ka2 447 | 445,Rspo1 448 | 446,Rtn4r 449 | 447,Rtn4rl1 450 | 448,Rufy2 451 | 449,Runx1t1 452 | 450,Rxfp1 453 | 451,Rxfp3 454 | 452,Satb1 455 | 453,Satb2 456 | 454,Scn3a 457 | 455,Scnn1a 458 | 456,Scube1 459 | 457,Sdk1 460 | 458,Sema3a 461 | 459,Sema5a 462 | 460,Sema5b 463 | 461,Serbp1 464 | 462,Sh2d5 465 | 463,Sh3bp5 466 | 464,Shh 467 | 465,Shisa9 468 | 466,Sipa1l1 469 | 467,Sit1 470 | 468,Sla 471 | 469,Slc13a5 472 | 470,Slc17a6 473 | 471,Slc17a8 474 | 472,Slc24a2 475 | 473,Slc26a4 476 | 474,Slc32a1 477 | 475,Slc35d3 478 | 476,Slc38a1 479 | 477,Slc38a10 480 | 478,Slc41a3 481 | 479,Slc44a5 482 | 480,Slc5a5 483 | 481,Slc5a7 484 | 482,Slc6a9 485 | 483,Slc9b2 486 | 484,Slit2 487 | 485,Slit3 488 | 486,Sntb1 489 | 487,Sntg1 490 | 488,Sorcs1 491 | 489,Sorcs3 492 | 490,Sowaha 493 | 491,Sowahb 494 | 492,Sox5 495 | 493,Sox6 496 | 494,Sp8 497 | 495,Sp9 498 | 496,Sphk1 499 | 497,Sprn 500 | 498,Sstr1 501 | 499,St3gal2 502 | 500,Stac 503 | 501,Stac3 504 | 502,Stard8 505 | 503,Stc1 506 | 504,Strbp 507 | 505,Stx6 508 | 506,Stxbp6 509 | 507,Sv2c 510 | 508,Svop 511 | 509,Syndig1l 512 | 510,Synpo 513 | 511,Sys1 514 | 512,Syt17 515 | 513,Syt2 516 | 514,Tacr3 517 | 515,Tacstd2 518 | 516,Tanc2 519 | 517,Tbc1d4 520 | 518,Tbc1d8b 521 | 519,Tbr1 522 | 520,Tbx2 523 | 521,Teddm3 524 | 522,Tenm2 525 | 523,Tenm4 526 | 524,Them6 527 | 525,Thsd7a 528 | 526,Thsd7b 529 | 527,Tiam2 530 | 528,Timeless 531 | 529,Tll1 532 | 530,Tmem132a 533 | 531,Tmem145 534 | 532,Tmem196 535 | 533,Tmem215 536 | 534,Tmem44 537 | 535,Tnfaip8 538 | 536,Tox 539 | 537,Tox2 540 | 538,Tox3 541 | 539,Tpbg 542 | 540,Trank1 543 | 541,Trhde 544 | 542,Trim62 545 | 543,Trim9 546 | 544,Trpc5 547 | 545,Trpc6 548 | 546,Trps1 549 | 547,Tspan1 550 | 548,Tspan11 551 | 549,Ttll1 552 | 550,Ube2v2 553 | 551,Unc13c 554 | 552,Unc5c 555 | 553,Unc5d 556 | 554,Upb1 557 | 555,Ust 558 | 556,Vax1 559 | 557,Vmn2r1 560 | 558,Vps26a 561 | 559,Vrk1 562 | 560,Vwc2 563 | 561,Vwc2l 564 | 562,Whrn 565 | 563,Wnt10a 566 | 564,Wnt2 567 | 565,Wnt5a 568 | 566,Wnt5b 569 | 567,Xkr4 570 | 568,Zbtb20 571 | 569,Zdbf2 572 | 570,Zfhx3 573 | 571,Zfp365 574 | 572,Zfp385b 575 | 573,Zfp536 576 | 574,Zfp703 577 | 575,Zfp804a 578 | 576,Zfp804b 579 | 577,Zfpm2 580 | 578,Zmat4 581 | --------------------------------------------------------------------------------