Skip to content

Commit

Permalink
Merge pull request #11 from parklab/refactor
Browse files Browse the repository at this point in the history
update tutorial
  • Loading branch information
BeGeiger authored May 1, 2024
2 parents b570218 + e970f7c commit 19ebe52
Show file tree
Hide file tree
Showing 4 changed files with 2,090 additions and 577 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
---
---

## 0.4.0 - 2024-05
### Changed
- Refactor using the AnnData and MuData data structures

## 0.3.2 - 2024-01
### Fixed
- Support fixing the model variance of (multimodal) CorrNMF models during training
Expand Down
19 changes: 8 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
[style-image]: https://img.shields.io/badge/code%20style-black-000000.svg
[style-url]: https://github.com/psf/black

Salamander is a non-negative matrix factorization (NMF) framework for signature analysis.
It implements multiple NMF algorithms, common visualizations, and can be easily customized & expanded.
Salamander is a non-negative matrix factorization (NMF) framework for signature analysis build on top of [AnnData](https://anndata.readthedocs.io/en/latest/) and [MuData](https://mudata.readthedocs.io/en/latest/). It implements multiple NMF algorithms, common visualizations, and can be easily customized & expanded.

---

Expand All @@ -28,16 +27,15 @@ pip install salamander-learn
The following example illustrates the basic syntax:

```python
import pandas as pd
import salamander
import anndata as ad
import salamander as sal

# samples and features have to be named appropriately
data_path = "..."
data = pd.read_csv(data_path, index_col=0)
# initialize data
adata = ad.AnnData(...)

# NMF with a Poisson noise model
model = salamander.KLNMF(n_signatures=5)
model.fit(data)
# NMF with Poisson noise
model = sal.models.KLNMF(n_signatures=5)
model.fit(adata)

# barplot
model.plot_signatures()
Expand All @@ -52,7 +50,6 @@ model.plot_correlation()
model.plot_correlation(data="samples")

# dimensionality reduction of the exposures
# method: umap, pca or tsne
model.plot_embeddings(method="umap")
```

Expand Down
Loading

0 comments on commit 19ebe52

Please sign in to comment.