Skip to main content

Cross-platform Python toolkit for microbiome analysis using multiple sequencing technologies

Project description

microflex

PyPI version Python 3.9+ License: MIT Code style: 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)

pip install microflex

Development installation

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

Optional dependencies

# 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

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

# 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

Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Setup

# 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 file for details.

Citation

If you use microflex in your research, please cite:

@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

  • 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

Acknowledgments

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

microflex-0.1.0.tar.gz (44.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

microflex-0.1.0-py3-none-any.whl (53.2 kB view details)

Uploaded Python 3

File details

Details for the file microflex-0.1.0.tar.gz.

File metadata

  • Download URL: microflex-0.1.0.tar.gz
  • Upload date:
  • Size: 44.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for microflex-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a272339cd36433f98a6b1da5e0decd23b82b51cc8119bb0496e667745d6d02c9
MD5 3534ad136bb1d110a70d5f93dba8f51d
BLAKE2b-256 f2d079b246abef2aaed1af8e04c9f73b88baac5731324ba9a1da57db560fba69

See more details on using hashes here.

File details

Details for the file microflex-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: microflex-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 53.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for microflex-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 de33c9e0ec67be37faf56d4529d0c0591ed00fafc7c23a2b2eff30caf343cfb6
MD5 a704267e8b5bf3e2cd57bc88b528dd44
BLAKE2b-256 63bdb4d198e686a53020f02dbc9897402a2ca9b0141535deb2b36c34c0636f1c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page