primer-designer-byao 0.1.0
An automated primer design pipeline for conserved regions with specificity validation
License: MIT
Requires Python: >=3.8
Keywords: bioinformatics, primer-design, PCR, BLAST, MAFFT, Primer3

# Primer Designer

An automated bioinformatics pipeline for designing PCR primers targeting conserved genomic regions with built-in specificity validation.

## Features

- **Automated Workflow**: Integrates BLAST, MAFFT, and Primer3 into a seamless pipeline
- **Conservation Analysis**: Identifies conserved regions across homologous sequences
- **Specificity Validation**: Verifies primer specificity against NCBI databases
- **Graphical Interface**: User-friendly PyQt6 GUI for easy operation
- **Command-Line Tools**: Flexible CLI for batch processing and automation
- **Configurable Parameters**: Extensive customization via YAML configuration

## Quick Start

### Installation

```bash
# Step 1: Install Python package
pip install -e .

# Step 2: Set up bioinformatics tools (optional - automatic via Snakemake)
python setup_envs.py
```

**Important**: MAFFT and Primer3 are **automatically installed** when using Snakemake or the GUI. Manual setup is only needed if you want to use CLI tools directly. See [INSTALL.md](INSTALL.md) for details.

### Launch GUI (Recommended for Beginners)

```bash
primer-designer
```

The GUI handles all dependencies automatically through Snakemake.

### Run Pipeline via Snakemake

```bash
# First run: automatically creates Conda environments (may take 5-10 min)
snakemake --use-conda --conda-prefix ./envs -j 8

# Subsequent runs: fast execution using cached environments
snakemake --use-conda --conda-prefix ./envs -j 8 all
```

## Workflow Overview

1. **Remote BLAST**: Query NCBI to find homologous sequences
2. **MAFFT Alignment**: Align sequences and identify conserved regions
3. **Primer3 Design**: Design primers targeting conserved areas
4. **Specificity Check**: Validate primers against off-target binding

## Command-Line Tools

After installation, the following commands are available:

- `primer-designer` or `primer-designer-gui` - Launch graphical interface
- `primer-blast` - Run remote BLAST search
- `primer-mafft` - Perform MAFFT alignment and conservation analysis
- `primer-design` - Design primers using Primer3
- `primer-specificity` - Check primer specificity

## Configuration

Edit `config.yaml` to customize:

- NCBI email and API key
- BLAST parameters (database, e-value, hit list size)
- Conservation detection thresholds
- Primer design constraints (Tm, GC%, size)
- Specificity checking parameters

## Input Files

Place your FASTA files in `backend/tasks/fastas/` or configure paths in `config.yaml`.

## Output Files

- `blast/*.xml` - BLAST results in XML format
- `mafft/*.bed` - Conserved regions in BED format
- `mafft/*.fasta` - Multiple sequence alignments
- `primer/*.tsv` - Designed primer pairs
- `primer/*_specificity.tsv` - Specificity validation results

## Requirements

- Python 3.8+
- Conda (for bioinformatics tools)
- 4 GB RAM minimum (8 GB recommended)

## Documentation

- [Installation Guide](INSTALL.md) - Detailed setup instructions
- [Configuration](config.yaml) - Parameter reference

## License

MIT License - see [LICENSE](LICENSE) file for details.

## Citation

If you use this software in your research, please cite:

```
[Add citation information here]
```