diff --git a/docs/index.md b/docs/index.md index 8b5f298..096b2d3 100644 --- a/docs/index.md +++ b/docs/index.md @@ -11,5 +11,5 @@ changelog.md contributing.md references.md -notebooks/example +notebooks/0_format_Xenium_sdata ``` diff --git a/docs/notebooks/0_format_Xenium_sdata.ipynb b/docs/notebooks/0_format_Xenium_sdata.ipynb index 26834f2..e429c6a 100644 --- a/docs/notebooks/0_format_Xenium_sdata.ipynb +++ b/docs/notebooks/0_format_Xenium_sdata.ipynb @@ -74,7 +74,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "### Plot small region of interest" + "## Plot small region of interest" ] }, { @@ -139,7 +139,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "### Subset data to small region of interest" + "## Subset data to small region of interest" ] }, { diff --git a/src/troutpy/tl/NMF.py b/src/troutpy/tl/NMF.py index 70e38ba..7d49353 100644 --- a/src/troutpy/tl/NMF.py +++ b/src/troutpy/tl/NMF.py @@ -9,8 +9,10 @@ import matplotlib.pyplot as plt import numpy as np import seaborn as sns +from spatialdata import SpatialData -def apply_nmf_to_adata(adata, n_components=20, subsample_percentage=1.0, save=False, output_path: str = '', random_state=None): + +def apply_nmf_to_adata(adata:SpatialData, n_components=20, subsample_percentage=1.0, save=False, output_path: str = '', random_state=None): """ Applies Non-Negative Matrix Factorization (NMF) to an AnnData object to reduce the dimensionality of gene expression data. @@ -55,7 +57,7 @@ def apply_nmf_to_adata(adata, n_components=20, subsample_percentage=1.0, save=Fa def nmf( - sdata, layer='extracellular_transcripts_enriched', + sdata:SpatialData, layer='extracellular_transcripts_enriched', feature_key='feature_name', bin_key='bin_id', density_table_key='segmentation_free_table', n_components=20, subsample_percentage=0.1, diff --git a/src/troutpy/tl/estimate_density.py b/src/troutpy/tl/estimate_density.py index ba27419..19e9f13 100644 --- a/src/troutpy/tl/estimate_density.py +++ b/src/troutpy/tl/estimate_density.py @@ -1,9 +1,10 @@ import os import numpy as np import pandas as pd +from spatialdata import SpatialData def colocalization_proportion( - sdata, + sdata:SpatialData, outpath, threshold_colocalized=1, filename='proportion_of_grouped_exRNA.parquet', save=True diff --git a/src/troutpy/tl/target_cell.py b/src/troutpy/tl/target_cell.py index 25180c2..ebb9628 100644 --- a/src/troutpy/tl/target_cell.py +++ b/src/troutpy/tl/target_cell.py @@ -4,15 +4,8 @@ import scanpy as sc import seaborn as sns import matplotlib.pyplot as plt -from tqdm import tqdm -import spatialdata as sd - - - from typing import Optional -import numpy as np from tqdm import tqdm -import scanpy as sc import spatialdata as sd from spatialdata import SpatialData