Metadata-Version: 2.4
Name: celltypemark
Version: 0.3.0
Summary: cell type annotation with scRNA sequencing data using any marker gene sets
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: anndata>=0.11.4
Requires-Dist: requests>=2.32.3
Dynamic: license-file

# CellTypeMark

CellTypeMark is a Python package for cell type annotation in single-cell RNA sequencing data using marker genes. It provides tools for scoring and annotating cell types based on predefined marker gene sets.

## Features

- Score cell types using marker genes (using scanpy score_genes)
- Automatic cell type annotation based on marker gene expression
- Visualization of cell type annotations
- Integration with Scanpy and AnnData objects
- Support for custom marker gene sets

## Installation

```bash
pip install celltypemark
```

## Usage

```python
import scanpy as sc
import celltypemark as ctm

# Load your AnnData object
adata = sc.read_h5ad("your_data.h5ad")

# Score cell types using default marker genes
adata = ctm.score(adata, ctm.marker_genes)

# Score cell types using specified marker genes
## Example, Tabula_Muris
from pathlib import Path
resource_path = Path("your gene marker file")
marker_genes = ctm.load_resource(resource_path, resource_url='https://maayanlab.cloud/Enrichr/geneSetLibrary?mode=text&libraryName=Tabula_Muris')
# For using marker sets from enrichr, uppercase var_names
adata.var_names = adata.var_names.str.upper()
adata = ctm.score(adata, marker_genes)

# Annotate cell types
adata = ctm.mark(adata, ctm.marker_genes, by='leiden', save='results', plot=True)
```

### Output

Add in the adata.obs:
- the scores of the keys in the gene sets for each observation
- the predicted key for each observation
- (if by) the predicted key for each by group, e.g., leiden
- (if save) save the scores of the keys for each by group in a txt file and the heatmap of the data under cellmarkoutput/

## Dependencies

- scanpy

## License

This project is licensed under the GNU General Public License v3.0 - see the [LICENSE](LICENSE) file for details.

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

## Citation

If you use CellTypeMark in your research, please cite:

```
@software{celltypemark2024,
  author = {brainfo},
  title = {CellTypeMark: A Python package for cell type annotation in single-cell RNA sequencing data},
  year = {2024},
  publisher = {GitHub},
  url = {https://github.com/yourusername/celltypemark}
}
```

---

Copyright (c) 2024

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <https://www.gnu.org/licenses/>. 
