Metadata-Version: 2.4
Name: sctoolsrna
Version: 0.1.0
Summary: A workbench of general-purpose single-cell RNA-seq analysis tools from the Wagner Lab (UCSF)
Author-email: Daniel Wagner <Daniel.Wagner@ucsf.edu>
License: MIT License
        
        Copyright (c) 2023 Wagner Lab UCSF
        
        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/WagnerLabUCSF/scToolsRNA-py
Project-URL: Issues, https://github.com/WagnerLabUCSF/scToolsRNA-py/issues
Keywords: single-cell,rna-seq,scanpy,anndata,bioinformatics
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: anndata>=0.10
Requires-Dist: scanpy>=1.9
Requires-Dist: numpy>=1.24
Requires-Dist: pandas<3.0,>=2.0
Requires-Dist: scipy>=1.10
Requires-Dist: scikit-learn>=1.3
Requires-Dist: matplotlib>=3.7
Requires-Dist: seaborn>=0.12
Requires-Dist: plotly>=5.15
Requires-Dist: adjustText>=0.8
Requires-Dist: faiss-cpu>=1.8
Requires-Dist: pydeseq2>=0.4
Requires-Dist: scrublet>=0.2.3
Requires-Dist: umap-learn>=0.5
Requires-Dist: harmonypy>=0.0.9
Requires-Dist: igraph>=0.11
Requires-Dist: leidenalg>=0.10
Requires-Dist: tqdm>=4.66
Provides-Extra: docs
Requires-Dist: sphinx>=7.0; extra == "docs"
Requires-Dist: furo; extra == "docs"
Dynamic: license-file

# scToolsRNA

A workbench of general-purpose single-cell RNA-seq analysis tools from the
**Wagner Lab (UCSF)**.

`scToolsRNA` collects utilities that have accumulated across lab projects into a
single pip-installable package built on top of [scanpy](https://scanpy.readthedocs.io)
and [AnnData](https://anndata.readthedocs.io). It covers preprocessing and QC,
feature selection and dimensionality reduction, differential expression,
kNN label transfer, trajectory analysis, network export, plotting, and I/O.

It is a companion to the lab's dataset-specific
[`zmap-tools`](https://github.com/WagnerLabUCSF/zmap-tools) package: where
`zmap-tools` is specialized for the Zebrafish Multi-Atlas Project, `scToolsRNA`
holds the organism-agnostic building blocks meant for everyday use.

## Installation

```bash
pip install sctoolsrna
```

or, from a checkout of this repository:

```bash
pip install .
```

All runtime dependencies (scanpy, anndata, scikit-learn, faiss-cpu, pydeseq2,
scrublet, umap-learn, harmonypy, plotly, igraph, leidenalg, …) are installed
automatically. Individual modules import heavier or optional dependencies lazily
(inside the functions that use them), so `import scToolsRNA` stays fast and does
not fail if a single optional system library is missing.

## Usage

The distribution installs as `sctoolsrna`, but the import name is `scToolsRNA`:

```python
import scanpy as sc
import scToolsRNA as sct

adata = sc.read_h5ad("my_data.h5ad")

# Feature selection + significant-PC estimation
sct.get_variable_genes(adata, top_n_genes=3000)
sct.get_sig_pcs(adata)

# kNN label transfer from a labeled reference
sct.transfer_labels_knn(
    adata_query,
    adata_ref,
    ref_label_col="cell_type",
    ref_basis="X_pca_harmony",
    query_basis="X_pca_harmony",
)
```

Every public function is also re-exported at the top level, so
`from scToolsRNA import get_variable_genes` continues to work for existing code.

## Modules

| Module | Contents |
| --- | --- |
| `preprocess` | Barcode/mito/ribo/doublet filtering and sampling QC |
| `dimensionality` | Variable-gene (V-score) selection, covarying genes, significant-PC estimation |
| `workflows` | Convenience pipelines (raw → normalized → UMAP/Leiden) |
| `diffexp` | Pseudobulk pyDESeq2 contrasts, DEG tables, volcano/clustermap plots |
| `classification` | Train/predict per-cell classifiers (sklearn) |
| `knn` | Portable FAISS/scikit-learn k-nearest-neighbor search |
| `labeltransfer` | kNN label and continuous-value transfer between datasets |
| `trajectories` | Diffusion-pseudotime dynamic-gene detection and plotting |
| `stitch` | STITCH temporal graph construction and diagnostics |
| `network` | GraphML / Pajek export for Gephi |
| `plotting` | 3D embeddings, UMAP animations, axis helpers |
| `colormaps` | Custom matplotlib colormaps |
| `utils` | Label smoothing, confusion matrices, stacked barplots |
| `readwrite` | STARsolo / alevin / alevin-fry / inDrops loaders, cell/gene metadata |
| `sparse` | Sparse-matrix helpers |

## License

See [LICENSE](LICENSE).
