Skip to content

Commit

Permalink
add all attrs, clean up Aggregator, fix overlay
Browse files Browse the repository at this point in the history
  • Loading branch information
quentinblampey committed Nov 4, 2024
1 parent 449b53f commit b7b4b5f
Show file tree
Hide file tree
Showing 14 changed files with 221 additions and 149 deletions.
34 changes: 20 additions & 14 deletions docs/tutorials/api_usage.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -306,10 +306,12 @@
"name": "stderr",
"output_type": "stream",
"text": [
"/Users/quentinblampey/mambaforge/envs/sopa/lib/python3.10/site-packages/cellpose/resnet_torch.py:280: FutureWarning: You are using `torch.load` with `weights_only=False` (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for `weights_only` will be flipped to `True`. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via `torch.serialization.add_safe_globals`. We recommend you start setting `weights_only=True` for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.\n",
" state_dict = torch.load(filename, map_location=torch.device(\"cpu\"))\n",
"\u001b[33;20m[WARNING] (sopa._settings)\u001b[0m Running without parallelization backend can be slow. Consider using a backend, e.g. via `sopa.settings.parallelization_backend = 'dask'`, or `export SOPA_PARALLELIZATION_BACKEND=dask`.\n",
"100%|██████████| 4/4 [00:30<00:00, 7.59s/it]\n",
"100%|██████████| 4/4 [00:28<00:00, 7.07s/it]\n",
"\u001b[36;20m[INFO] (sopa.segmentation._stainings)\u001b[0m Found 314 total cells\n",
"Resolving conflicts: 100%|██████████| 100/100 [00:00<00:00, 7499.60it/s]\n",
"Resolving conflicts: 100%|██████████| 100/100 [00:00<00:00, 7575.87it/s]\n",
"\u001b[36;20m[INFO] (sopa.segmentation._stainings)\u001b[0m Added 280 cell boundaries in sdata['cellpose_boundaries']\n"
]
}
Expand Down Expand Up @@ -530,7 +532,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"[########################################] | 100% Completed | 106.15 ms\n"
"[########################################] | 100% Completed | 106.00 ms\n"
]
},
{
Expand All @@ -544,7 +546,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"[########################################] | 100% Completed | 101.54 ms\n"
"[########################################] | 100% Completed | 106.00 ms\n"
]
},
{
Expand Down Expand Up @@ -572,19 +574,19 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": 11,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"AnnData object with n_obs × n_vars = 267 × 5\n",
" obs: 'baysor_area', 'avg_assignment_confidence', 'avg_confidence', 'cluster', 'density', 'elongation', 'lifespan', 'max_cluster_frac', 'n_transcripts', 'x', 'y', 'region', 'cell_id', 'slide', 'area'\n",
"AnnData object with n_obs × n_vars = 280 × 6\n",
" obs: 'region', 'slide', 'cell_id', 'area'\n",
" uns: 'sopa_attrs', 'spatialdata_attrs'\n",
" obsm: 'spatial', 'intensities'"
" obsm: 'intensities', 'spatial'"
]
},
"execution_count": 15,
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
Expand Down Expand Up @@ -640,7 +642,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 12,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -689,7 +691,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 13,
"metadata": {},
"outputs": [
{
Expand All @@ -698,7 +700,7 @@
"text": [
"\u001b[36;20m[INFO] (sopa.io.explorer.table)\u001b[0m Writing table with 6 columns\n",
"\u001b[36;20m[INFO] (sopa.io.explorer.table)\u001b[0m Writing 3 cell categories: region, slide, cell_type\n",
"\u001b[36;20m[INFO] (sopa.io.explorer.shapes)\u001b[0m Writing 372 cell polygons\n",
"\u001b[36;20m[INFO] (sopa.io.explorer.shapes)\u001b[0m Writing 280 cell polygons\n",
"\u001b[36;20m[INFO] (sopa.io.explorer.points)\u001b[0m Writing 40000 transcripts\n",
"\u001b[36;20m[INFO] (sopa.io.explorer.points)\u001b[0m > Level 0: 40000 transcripts\n",
"\u001b[36;20m[INFO] (sopa.io.explorer.points)\u001b[0m > Level 1: 10000 transcripts\n",
Expand Down Expand Up @@ -738,7 +740,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 14,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -747,7 +749,7 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 15,
"metadata": {},
"outputs": [
{
Expand All @@ -763,12 +765,16 @@
"output_type": "stream",
"text": [
"Clipping input data to the valid range for imshow with RGB data ([0..1] for floats or [0..255] for integers). Got range [0.0..1.9530949634755863].\n",
"/Users/quentinblampey/mambaforge/envs/sopa/lib/python3.10/site-packages/anndata/_core/anndata.py:430: FutureWarning: The dtype argument is deprecated and will be removed in late 2024.\n",
" warnings.warn(\n",
"/Users/quentinblampey/mambaforge/envs/sopa/lib/python3.10/site-packages/anndata/_core/aligned_df.py:67: ImplicitModificationWarning: Transforming to str index.\n",
" warnings.warn(\"Transforming to str index.\", ImplicitModificationWarning)\n",
"/Users/quentinblampey/dev/_external/spatialdata/src/spatialdata/_core/_elements.py:106: UserWarning: Key `misc` already exists. Overwriting it in-memory.\n",
" self._check_key(key, self.keys(), self._shared_keys)\n",
"/Users/quentinblampey/mambaforge/envs/sopa/lib/python3.10/site-packages/spatialdata_plot/pl/render.py:494: UserWarning: No data for colormapping provided via 'c'. Parameters 'cmap', 'norm' will be ignored\n",
" _cax = ax.scatter(\n",
"/Users/quentinblampey/mambaforge/envs/sopa/lib/python3.10/site-packages/anndata/_core/anndata.py:430: FutureWarning: The dtype argument is deprecated and will be removed in late 2024.\n",
" warnings.warn(\n",
"/Users/quentinblampey/mambaforge/envs/sopa/lib/python3.10/site-packages/anndata/_core/aligned_df.py:67: ImplicitModificationWarning: Transforming to str index.\n",
" warnings.warn(\"Transforming to str index.\", ImplicitModificationWarning)\n",
"/Users/quentinblampey/dev/_external/spatialdata/src/spatialdata/_core/_elements.py:106: UserWarning: Key `transcripts` already exists. Overwriting it in-memory.\n",
Expand Down
Loading

0 comments on commit b7b4b5f

Please sign in to comment.