Metadata-Version: 2.4
Name: cstag-cli
Version: 1.0.1
Summary: Command line interface of cstag to manipulate minimap2's cs tags
License-Expression: MIT
License-File: LICENSE
Author: Akihiro Kuno
Author-email: akuno@md.tsukuba.ac.jp
Requires-Python: >=3.11
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: POSIX
Classifier: Operating System :: Unix
Classifier: Operating System :: MacOS
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Requires-Dist: cstag (>=1.1.1,<2.0.0)
Requires-Dist: pysam (>=0.24.0,<0.25.0)
Project-URL: Homepage, https://github.com/akikuno/cstag-cli
Project-URL: Repository, https://github.com/akikuno/cstag-cli
Description-Content-Type: text/markdown

[![Licence](https://img.shields.io/badge/License-MIT-9cf.svg)](https://choosealicense.com/licenses/mit/)
[![Test](https://img.shields.io/github/actions/workflow/status/akikuno/cstag-cli/pytest.yml?branch=main&label=Test&color=brightgreen)](https://github.com/akikuno/cstag-cli/actions)
[![Python](https://img.shields.io/pypi/pyversions/cstag-cli.svg?label=Python&color=blue)](https://pypi.org/project/cstag-cli/)
[![PyPI](https://img.shields.io/pypi/v/cstag-cli.svg?label=PyPI&color=orange)](https://pypi.org/project/cstag-cli/)
[![Bioconda](https://img.shields.io/conda/v/bioconda/cstag-cli?label=Bioconda&color=orange)](https://anaconda.org/bioconda/cstag-cli)
[![JOSS](https://joss.theoj.org/papers/10.21105/joss.06066/status.svg)](https://doi.org/10.21105/joss.06066)
[![DOI](https://zenodo.org/badge/683243028.svg)](https://zenodo.org/badge/latestdoi/683243028)


# cstag-cli

`cstag-cli` is a command-line tool of [`cstag`](https://github.com/akikuno/cstag) for manipulating [minimap2's cs tags](https://github.com/lh3/minimap2#the-cs-optional-tag).

## 🌟Features

- `cstag append`: Appends cs tags to a SAM/BAM file

## 🛠 Installation

### Prerequisites

- Python 3.11 or later
- Unix-like environment (Linux, macOS, WSL, etc.)

### Installation

Using [Bioconda](https://anaconda.org/bioconda/cstag-cli) (Recommended):

```bash
conda create -n env-cstag -c conda-forge -c bioconda python=3.11 cstag-cli -y
conda activate env-cstag
```

Using [PyPI](https://pypi.org/project/cstag-cli/):

```bash
pip install cstag-cli
```

> [!CAUTION]
> If you encounter any issues during the installation, please refer to the [Troubleshooting Guide](https://github.com/akikuno/cstag-cli/blob/main/docs/troubleshooting.md)

### Development

```bash
python -m pip install -e . --group dev
ruff format --check .
ruff check .
mypy
python -m pytest tests -W error
sh tests/append/tests.sh
sh tests/test_version.sh
python -m build
```

## 💡Usage

### Appending cs tags to a SAM/BAM File

```bash
cstag append <file> [-l/--long]
```

- **\<file\>**:  Path to the SAM/BAM file. If omitted, the program reads from standard input.  

> [!IMPORTANT]
> The SAM/BAM file must contain an MD tag.  
> if the SAM/BAM files do not have MD tags, use [`samtools calmd`](https://www.htslib.org/doc/samtools-calmd.html).  

- **-l/--long**: Generates cs tags in long format


#### Examples

- Appending cs tags in short format:
```bash
cstag append tests/append/data/example.bam > example_cs_short.sam
```

- Appending cs tags in long format:
```bash
cstag append tests/append/data/example.bam --long > example_cs_long.sam
```
- Reading data from standard input:

```bash
cat tests/append/data/example.bam | cstag append > example_cs_short.sam
```

## 📣Feedback and Support

For questions, bug reports, or other forms of feedback, we'd love to hear from you!  
Please use [GitHub Issues](https://github.com/akikuno/cstag-cli/issues) for all reporting purposes.  

Please refer to [CONTRIBUTING](https://github.com/akikuno/cstag-cli/blob/main/docs/CONTRIBUTING.md) for how to contribute and how to verify your contributions.  

## 🤝 Code of Conduct

Please note that this project is released with a [Contributor Code of Conduct](https://github.com/akikuno/cstag-cli/blob/main/docs/CODE_OF_CONDUCT.md).  
By participating in this project you agree to abide by its terms.  

## 📄 Citation

- Kuno, A., (2024). cstag and cstag-cli: tools for manipulating and visualizing cs tags. *Journal of Open Source Software*, 9(93), 6066, https://doi.org/10.21105/joss.06066

