Metadata-Version: 2.4
Name: microflex
Version: 0.1.0
Summary: Cross-platform Python toolkit for microbiome analysis using multiple sequencing technologies
Author-email: Ata Umut Özsoy <ataumut7@gmail.com>
Maintainer-email: Ata Umut Özsoy <ataumut7@gmail.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/ataozsoysoy/microflex
Project-URL: Documentation, https://microflex.readthedocs.io
Project-URL: Repository, https://github.com/ataozsoysoy/microflex
Project-URL: Bug Tracker, https://github.com/ataozsoysoy/microflex/issues
Keywords: microbiome,bioinformatics,sequencing,NGS,nanopore,sanger
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: biopython>=1.81
Requires-Dist: pandas>=2.0.0
Requires-Dist: numpy>=1.24.0
Requires-Dist: scipy>=1.11.0
Requires-Dist: matplotlib>=3.7.0
Requires-Dist: seaborn>=0.12.0
Requires-Dist: plotly>=5.15.0
Requires-Dist: scikit-learn>=1.3.0
Requires-Dist: click>=8.1.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: typing-extensions>=4.5.0
Provides-Extra: dev
Requires-Dist: pytest>=7.4.0; extra == "dev"
Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
Requires-Dist: black>=23.7.0; extra == "dev"
Requires-Dist: isort>=5.12.0; extra == "dev"
Requires-Dist: flake8>=6.0.0; extra == "dev"
Requires-Dist: mypy>=1.5.0; extra == "dev"
Requires-Dist: pre-commit>=3.3.0; extra == "dev"
Provides-Extra: web
Requires-Dist: dash>=2.14.0; extra == "web"
Requires-Dist: dash-bootstrap-components>=1.4.0; extra == "web"
Provides-Extra: docs
Requires-Dist: sphinx>=7.1.0; extra == "docs"
Requires-Dist: sphinx-rtd-theme>=1.3.0; extra == "docs"
Requires-Dist: myst-parser>=2.0.0; extra == "docs"
Dynamic: license-file

# microflex

[![PyPI version](https://badge.fury.io/py/microflex.svg)](https://badge.fury.io/py/microflex)
[![Python 3.9+](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

A cross-platform Python toolkit for microbiome analysis using multiple sequencing technologies including Illumina (NGS), Oxford Nanopore, and Sanger sequencing.

## Features

- **Multi-platform support**: Illumina NGS, Oxford Nanopore, Sanger sequencing
- **Multiple input formats**: `.fastq`, `.fasta`, `.ab1`, `.qza`, `.biom`
- **Comprehensive preprocessing**: Quality control, trimming, chimera detection
- **Taxonomic classification**: BLAST, Kraken2, QIIME2 integration
- **Ecological analysis**: Alpha/beta diversity, ordination, clustering
- **Functional predictions**: PICRUSt2 and HUMAnN2 support
- **Rich visualizations**: Interactive and static plots
- **Automated reporting**: PDF/HTML reports
- **Modular design**: Use only what you need

## Installation

### From PyPI (recommended)

```bash
pip install microflex
```

### Development installation

```bash
git clone https://github.com/ataozsoysoy/microflex.git
cd microflex
pip install -e ".[dev]"
```

### Optional dependencies

```bash
# For web interface
pip install "microflex[web]"

# For documentation
pip install "microflex[docs]"

# All optional dependencies
pip install "microflex[dev,web,docs]"
```

## Quick Start

### Python API

```python
from microflex.io import FastqReader
from microflex.preprocess import QualityFilter
from microflex.taxonomy import MockClassifier
from microflex.analysis import DiversityAnalyzer

# Read sequencing data
reader = FastqReader()
sequences = reader.read("data/samples.fastq")

# Quality filtering
quality_filter = QualityFilter(min_quality_score=20, min_length=100)
filtered_sequences = quality_filter.process(sequences)

# Taxonomic classification
classifier = MockClassifier(confidence_range=(70.0, 95.0))
taxonomy_results = classifier.process(filtered_sequences)

# Diversity analysis
analyzer = DiversityAnalyzer()
alpha_metrics = analyzer.calculate_alpha_diversity(abundance_data)
beta_distances = analyzer.calculate_beta_diversity(abundance_matrix)
```

### Command Line Interface

```bash
# Get file information
python -m microflex.cli.main info sequences.fastq

# Filter sequences by quality
python -m microflex.cli.main filter sequences.fastq --min-length 100 --min-quality 20

# Taxonomic classification
python -m microflex.cli.main classify sequences.fasta --method mock

# Diversity analysis
python -m microflex.cli.main analyze taxonomy.tsv --level genus

# Convert between formats
python -m microflex.cli.main convert sequences.fastq --format fasta
```

## Available CLI Commands

| Command | Description | Example |
|---------|-------------|---------|
| `info` | Display file information | `python -m microflex.cli.main info sequences.fastq` |
| `filter` | Quality-based sequence filtering | `python -m microflex.cli.main filter sequences.fastq --min-length 100` |
| `classify` | Taxonomic classification | `python -m microflex.cli.main classify sequences.fasta --method mock` |
| `analyze` | Diversity analysis | `python -m microflex.cli.main analyze taxonomy.tsv --level genus` |
| `convert` | Format conversion | `python -m microflex.cli.main convert sequences.fastq --format fasta` |

## Project Structure

```
microflex/
├── src/microflex/
│   ├── core/           # Core abstractions and interfaces
│   ├── io/             # Input/output handlers
│   ├── preprocess/     # Quality control and preprocessing
│   ├── taxonomy/       # Taxonomic classification
│   ├── analysis/       # Ecological analysis
│   ├── functional/     # Functional predictions
│   ├── visualization/  # Plotting and visualization
│   ├── cli/            # Command line interface
│   └── utils/          # Utilities and helpers
├── tests/              # Test suite
├── docs/               # Documentation
└── examples/           # Example scripts and notebooks
```

## Documentation

Full documentation is available at [microflex.readthedocs.io](https://microflex.readthedocs.io)

## Contributing

We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.

### Development Setup

```bash
# Clone the repository
git clone https://github.com/ataozsoysoy/microflex.git
cd microflex

# Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install in development mode
pip install -e ".[dev]"

# Install pre-commit hooks
pre-commit install

# Run tests
pytest

# Run linting
black src/ tests/
isort src/ tests/
flake8 src/ tests/
mypy src/
```

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## Citation

If you use microflex in your research, please cite:

```bibtex
@software{microflex,
  author = {Özsoy, Ata Umut},
  title = {microflex: Cross-platform Python toolkit for microbiome analysis},
  url = {https://github.com/ataozsoysoy/microflex},
  version = {0.1.0},
  year = {2025}
}
```

## Roadmap

- [x] v0.1.0: Core architecture, I/O modules, quality filtering, mock classification, alpha/beta diversity, CLI
- [ ] v0.2.0: BLAST integration, Kraken2 support, visualization module
- [ ] v0.3.0: Nanopore support, PICRUSt2 integration, web interface
- [ ] v1.0.0: Stable release with comprehensive documentation and tutorials

## Support

- 📖 [Documentation](https://microflex.readthedocs.io)
- 🐛 [Issue Tracker](https://github.com/ataozsoysoy/microflex/issues)
- 💬 [Discussions](https://github.com/ataozsoysoy/microflex/discussions)

## Acknowledgments

Special thanks to the bioinformatics community and the developers of the underlying tools that make microflex possible. 
