Metadata-Version: 2.4
Name: pycondiments
Version: 0.1.0
Summary: Pure-Python port of condiments — differential trajectory analysis across conditions (Roux de Bezieux et al. Nat Commun 2024).
Author-email: Zehua Zeng <starlitnightly@163.com>
License: MIT License
        
        Copyright (c) 2026 omicverse contributors
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/omicverse/py-condiments
Project-URL: Repository, https://github.com/omicverse/py-condiments
Project-URL: Upstream R package, https://github.com/HectorRDB/condiments
Keywords: single-cell,scRNA-seq,trajectory,condition,condiments
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.23
Requires-Dist: scipy>=1.10
Requires-Dist: pandas>=1.5
Requires-Dist: scikit-learn>=1.2
Provides-Extra: dev
Requires-Dist: pytest>=7; extra == "dev"
Provides-Extra: tradeseq
Requires-Dist: pytradeseq>=0.1.0; extra == "tradeseq"
Dynamic: license-file

# py-condiments

A **Python port of [condiments](https://github.com/HectorRDB/condiments)** (Roux de Bezieux et al., *Nature Communications* 2024) — differential-trajectory analysis between conditions in single-cell RNA-seq.

- AnnData-compatible
- 7/7 R exports ported
- **imbalance_score Pearson = 1.0000** vs R on canonical toy fixture

## Install

```bash
pip install pycondiments
```

## Quick-start

```python
import pycondiments as cd

# Given a Slingshot pseudotime + cellWeights + condition labels per cell:
imb = cd.imbalance_score(rd, conditions, k=10, smooth=10)
ptest = cd.progressionTest(pseudotime, conditions, cellWeights=cellWeights)
ttest = cd.topologyTest(pseudotime, cellWeights, conditions)
```

## Function map

| Python | R | Status |
|---|---|---|
| `imbalance_score` | `imbalance_score` | ✅ Pearson 1.000 vs R |
| `progressionTest` | `progressionTest` | ✅ both agree on significance |
| `differentiationTest` | `fateSelectionTest` | ✅ (multi-lineage only) |
| `topologyTest` | `topologyTest` | 🟡 simplified (v0.1) |
| `weights_from_pst` | `weights_from_pst` | ✅ |
| `merge_sds` | `merge_sds` | ✅ |
| `create_differential_topology` | `create_differential_topology` | ✅ test-data helper |

## Known limitations (v0.1)

1. **`topologyTest` is approximate**: uses χ² on dominant-lineage contingency rather than re-fitting Slingshot per condition. Strong topology changes will be missed.
2. **No GAM smoothing in `imbalance_score`**: R uses mgcv `s()`; we use kNN-average. Both give similar smoothed z-scores.
3. **No multi-condition support**: v0.1 supports 2-condition tests only. Multi-condition extension is on the v0.2 roadmap.

## Citation

> Roux de Bezieux, H. et al. *Trajectory inference across multiple conditions with condiments.* Nature Communications 15, 1281 (2024).

## License

MIT.
