Metadata-Version: 2.4
Name: bio-grep
Version: 0.1.2
Summary: Local-first biological sequence search engine
Author: Ravi Sharma
License-Expression: MIT
Project-URL: Homepage, https://github.com/ravishar313/bio-grep
Project-URL: Repository, https://github.com/ravishar313/bio-grep
Project-URL: Issues, https://github.com/ravishar313/bio-grep/issues
Keywords: bioinformatics,search,fasta,genomics,cli
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: bam
Requires-Dist: pysam>=0.22.0; extra == "bam"
Dynamic: license-file

# bio-grep

`bio-grep` is a local-first biological search engine for fast iterative querying over FASTA, FASTQ, GFF3, GTF, BED, VCF, SAM/BAM, GenBank, and EMBL corpora.

## Install

```bash
pip install "bio-grep[bam]"
```

or

```bash
uv tool install "bio-grep[bam]"
```

One-line installer (tag-pinned):

```bash
curl -fsSL https://raw.githubusercontent.com/ravishar313/bio-grep/v0.1.1/scripts/install.sh | bash
```

## Quick Start

Index one or more files:

```bash
bio-grep index data/fasta/*.fasta --index-dir . --k 7
```

Run a motif search:

```bash
bio-grep search --motif "C..C" --top-k 20 --index-dir .
```

Search annotation formats:

```bash
bio-grep search --file-type gff --region "chr1:120-300" --feature-type-exact gene --top-k 20 --index-dir .
bio-grep search --file-type vcf --region "chr1:1-1000000" --filter-exact PASS --top-k 20 --index-dir .
bio-grep search --file-type sam --seqid-exact chr1 --mapq-gte 30 --top-k 20 --index-dir .
```

Fetch full sequence payload by ID:

```bash
bio-grep fetch s1 --index-dir .
```

## Highlights

- Agent-first compact `jsonl` output by default.
- Stable metadata keys (`null` when unavailable).
- Rich filter support for sequence and annotation search.
- `--version` flag for CLI/version pinning workflows.

## Python API

```python
from pathlib import Path
from bio_grep.engine import BioGrep

bio = BioGrep(base_dir=Path("."), k=7)
bio.index([Path("data/fasta/uniprot_reviewed_human_250.fasta")])
rows = bio.search(motif="C..C", length_lt=200).top_k(10)
print(rows[0]["id"], rows[0]["score"])
```

## Project Links

- Repository: https://github.com/ravishar313/bio-grep
- Issues: https://github.com/ravishar313/bio-grep/issues
