Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ repos:
hooks:
- id: prettier
- repo: https://github.com/tox-dev/pyproject-fmt
rev: v2.5.0
rev: v2.11.1
hooks:
- id: pyproject-fmt
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.2
rev: v0.14.9
hooks:
- id: ruff
types_or: [python, pyi, jupyter]
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format
types_or: [python, pyi, jupyter]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
rev: v6.0.0
hooks:
- id: detect-private-key
- id: check-ast
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ If you don't have Python installed, we recommend installing [Mambaforge][].

There are several alternative options to install troutpy:

1) Install the latest release of `troutpy` from [PyPI][]:
1. Install the latest release of `troutpy` from [PyPI][]:

```bash
pip install troutpy
Expand All @@ -43,6 +43,7 @@ import troutpy as tp
```

## Reproducibility

Code, notebooks, and instructions to reproduce the results from the paper are available at the [reproducibility repository](https://github.com/theislab/troutpy_reproducibility). This repository also include diverse tutorials and compementary functions that are not core to Troutpy, but are required to reproduce the figures from Marco Salas et al. 2025.

## Release notes
Expand Down
3 changes: 2 additions & 1 deletion docs/.ipynb_checkpoints/index-checkpoint.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Tools <api/tools.md>
Plotting <api/plotting.md>

```

```{toctree}
:maxdepth: 3
:caption: Tutorials
Expand All @@ -26,4 +27,4 @@ changelog.md
contributing.md
references.md

```
```
2 changes: 1 addition & 1 deletion docs/.ipynb_checkpoints/references-checkpoint.bib
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ @article{blampey2024sopa
pages={4981},
year={2024},
publisher={Nature Publishing Group UK London}
}
}
21 changes: 7 additions & 14 deletions docs/api/.ipynb_checkpoints/plotting-checkpoint.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

.. autosummary::
:toctree: generated/basic_plots

crosstab
histogram
pie
Expand All @@ -23,7 +23,7 @@
```{eval-rst}
.. autosummary::
:toctree: generated/quantification

gene_metric_heatmap
logfoldratio_over_noise
metric_scatter
Expand All @@ -33,18 +33,15 @@
moranI_histogram
diffusion_results
spatial_inout_expression

```



```

## Source, target and communication

```{eval-rst}
.. autosummary::
:toctree: generated/communication

celltype_communication
gene_communication
global_distribution_from_source
Expand All @@ -54,25 +51,24 @@
target_score_by_celltype
interactions_with_arrows
spatial_interactions

```

## Factor analysis

```{eval-rst}
.. autosummary::
:toctree: generated/factor_analysis

factors_in_cells
rank_factor_genes_loadings
rank_factor_genes_loadings_matrixplot
nmf_factors_exrna_cells_W
nmf_gene_contributions
paired_nmf_factors
apply_exrnaH_to_cellular_to_create_cellularW

```

```

## Colormaps & palettes

Expand All @@ -83,6 +79,3 @@
get_colormap
get_palette
```



1 change: 1 addition & 0 deletions docs/api/.ipynb_checkpoints/preprocessing-checkpoint.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@
pp.define_urna
pp.filter_urna
pp.format_adata
```
11 changes: 5 additions & 6 deletions docs/api/.ipynb_checkpoints/tools-checkpoint.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
tl.calculate_target_cells
tl.compute_target_score
tl.define_target_by_celltype
tl.cluster_distribution_from_source
tl.cluster_distribution_from_source
tl.get_gene_interaction_strength
tl.communication_strength
tl.gene_specific_interactions
Expand All @@ -46,7 +46,7 @@
```{eval-rst}
.. autosummary::
:toctree: generated/cell_scores

tl.compute_contribution_score
```

Expand All @@ -55,7 +55,7 @@
```{eval-rst}
.. autosummary::
:toctree: generated/factors

tl.factors_to_cells
tl.latent_factor
```
Expand All @@ -68,15 +68,14 @@

tl.assess_diffusion
tl.compute_js_divergence

```

## Multimodal quantication

```{eval-rst}
.. autosummary::
:toctree: generated/multimodal

tl.image_intensities_per_transcript
```

21 changes: 7 additions & 14 deletions docs/api/plotting.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

.. autosummary::
:toctree: generated/basic_plots

crosstab
histogram
pie
Expand All @@ -23,7 +23,7 @@
```{eval-rst}
.. autosummary::
:toctree: generated/quantification

gene_metric_heatmap
logfoldratio_over_noise
metric_scatter
Expand All @@ -33,18 +33,15 @@
moranI_histogram
diffusion_results
spatial_inout_expression

```



```

## Source, target and communication

```{eval-rst}
.. autosummary::
:toctree: generated/communication

celltype_communication
gene_communication
global_distribution_from_source
Expand All @@ -54,25 +51,24 @@
target_score_by_celltype
interactions_with_arrows
spatial_interactions

```

## Factor analysis

```{eval-rst}
.. autosummary::
:toctree: generated/factor_analysis

factors_in_cells
rank_factor_genes_loadings
rank_factor_genes_loadings_matrixplot
nmf_factors_exrna_cells_W
nmf_gene_contributions
paired_nmf_factors
apply_exrnaH_to_cellular_to_create_cellularW

```

```

## Colormaps & palettes

Expand All @@ -83,6 +79,3 @@
get_colormap
get_palette
```



1 change: 1 addition & 0 deletions docs/api/preprocessing.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@
pp.define_urna
pp.filter_urna
pp.format_adata
```
11 changes: 5 additions & 6 deletions docs/api/tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
tl.calculate_target_cells
tl.compute_target_score
tl.define_target_by_celltype
tl.cluster_distribution_from_source
tl.cluster_distribution_from_source
tl.get_gene_interaction_strength
tl.communication_strength
tl.gene_specific_interactions
Expand All @@ -46,7 +46,7 @@
```{eval-rst}
.. autosummary::
:toctree: generated/cell_scores

tl.compute_contribution_score
```

Expand All @@ -55,7 +55,7 @@
```{eval-rst}
.. autosummary::
:toctree: generated/factors

tl.factors_to_cells
tl.latent_factor
```
Expand All @@ -68,15 +68,14 @@

tl.assess_diffusion
tl.compute_js_divergence

```

## Multimodal quantication

```{eval-rst}
.. autosummary::
:toctree: generated/multimodal

tl.image_intensities_per_transcript
```

3 changes: 2 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Tools <api/tools.md>
Plotting <api/plotting.md>

```

```{toctree}
:maxdepth: 3
:caption: Tutorials
Expand All @@ -26,4 +27,4 @@ changelog.md
contributing.md
references.md

```
```
2 changes: 1 addition & 1 deletion docs/references.bib
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ @article{blampey2024sopa
pages={4981},
year={2024},
publisher={Nature Publishing Group UK London}
}
}
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ classifiers = [
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
]

dependencies = [
Expand All @@ -34,7 +35,7 @@ dependencies = [
"sainsc", # Version not specified; verify if necessary
"scikit-learn>=1.6.1",
"seaborn",
"sopa[cellpose,baysor]",
"sopa[baysor,cellpose]",
"spatialdata",
"spatialdata-io",
"spatialdata-plot",
Expand Down
2 changes: 1 addition & 1 deletion src/troutpy/pl/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from .basic import crosstab, histogram, pie
from .colors import get_colormap, get_palette
from .communication import cell_type_contacts, gene_communication, target_score_by_celltype
from .communication import cell_type_contacts, gene_communication, target_score_by_celltype
from .factor_analysis import factors_in_cells, rank_factor_genes_loadings, rank_factor_genes_loadings_matrixplot
from .metric_analysis import gene_metric_heatmap, logfoldratio_over_noise, metric_scatter, top_bottom_probes
from .plotting import (
Expand Down
Loading
Loading