Skip to content

Commit

Permalink
mod_docstrings8
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiomarco25 committed Jan 3, 2025
1 parent d9f185a commit fc82248
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 13 deletions.
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ changelog.md
contributing.md
references.md
notebooks/example
notebooks/0_format_Xenium_sdata
```
4 changes: 2 additions & 2 deletions docs/notebooks/0_format_Xenium_sdata.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Plot small region of interest"
"## Plot small region of interest"
]
},
{
Expand Down Expand Up @@ -139,7 +139,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Subset data to small region of interest"
"## Subset data to small region of interest"
]
},
{
Expand Down
6 changes: 4 additions & 2 deletions src/troutpy/tl/NMF.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion src/troutpy/tl/estimate_density.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
7 changes: 0 additions & 7 deletions src/troutpy/tl/target_cell.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit fc82248

Please sign in to comment.