Skip to content
Merged
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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,16 @@ sc.tl.leiden(adata, resolution=0.5)
```
### Multi-sample support

If you have multiple samples in `adata.obs['sample']`, you can provide the key `sample` to `npc.wf.nichepca` this uses harmony by default:
If you have multiple samples in `adata.obs["sample"]`, you can provide the key `sample` to `npc.wf.nichepca` this uses harmony by default:

```python
npc.wf.nichepca(adata, knn=25, sample_key="sample")
```

If you have cell type labels in `adata.obs['cell_type']`, you can directly provide them to `nichepca` as follows (we found this sometimes works better for multi-sample domain identification). However, in this case we need to run `npc.cl.leiden_unique` to handle potential duplicate embeddings:
If you have cell type labels in `adata.obs["cell_type"]`, you can directly provide them to `nichepca` as follows (we found this sometimes works better for multi-sample domain identification). However, in this case we need to run `npc.cl.leiden_unique` to handle potential duplicate embeddings:

```python
npc.wf.nichepca(adata, knn=25, obs_key='cell_type', sample_key="sample")
npc.wf.nichepca(adata, knn=25, obs_key="cell_type", sample_key="sample")
npc.cl.leiden_unique(adata, use_rep="X_npca", resolution=0.5, n_neighbors=15)
```

Expand Down
55 changes: 53 additions & 2 deletions docs/api.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,65 @@
# API

## Workflows

```{eval-rst}
.. autosummary::
:toctree: generated
:recursive:
:nosignatures:

nichepca.workflows
nichepca.workflows.nichepca
```

## Clustering

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

nichepca.clustering
nichepca.clustering.leiden_unique
nichepca.clustering.leiden_multires
nichepca.clustering.leiden_with_nclusters
```

## Graph Construction

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

nichepca.graph_construction
nichepca.graph_construction.knn_graph
nichepca.graph_construction.delaunay_graph
nichepca.graph_construction.distance_graph
nichepca.graph_construction.construct_multi_sample_graph
nichepca.graph_construction.from_squidpy
nichepca.graph_construction.to_squidpy
nichepca.graph_construction.remove_long_links
nichepca.graph_construction.calc_graph_stats
nichepca.graph_construction.print_graph_stats
nichepca.graph_construction.resolve_graph_constructor
```

## Neighborhood Embedding

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

nichepca.nhood_embedding
nichepca.nhood_embedding.aggregate
```

## Utilities

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

nichepca.utils
nichepca.utils.check_for_raw_counts
nichepca.utils.normalize_per_sample
nichepca.utils.to_numpy
nichepca.utils.to_torch
```