Skip to main content

A Serverless-Ready Metadata Validator for GA4GH Genomic Standards

Project description

OmicsGuard

OmicsGuard is a lightweight, serverless-ready metadata validator designed for modern bioinformatics workflows. It ensures "Schema-on-Write" integrity for GA4GH standards (like Phenopackets) while allowing flexible organizational extensions and custom business logic.

Key Features

  • Serverless Ready: Designed to run in AWS Lambda, Google Cloud Functions, or lightweight containers.
  • GA4GH Standard Support: Built-in registry for official schemas (e.g., ga4gh-phenopacket-v2).
  • Plugin System: Inject custom business logic with simple Python functions.
  • Schema Extensions: Layer organization-specific fields (e.g., hospital_id) on top of standard schemas.
  • Human-Readable Reports: Generate HTML or Markdown reports for biologists and clinicians.
  • Smart Caching: Automatically caches remote schemas to minimize network latency.

Installation

Installation

You can install OmicsGuard from PyPI or directly from the source.

1. From PyPI (Recommended)

pip install omicsguard

2. From Source

Useful for development or using the latest unreleased features.

git clone https://github.com/your-org/omicsguard.git
cd omicsguard
pip install .

Usage

1. Basic Validation

Validate a JSON or YAML file against the default bundled standard (Phenopackets v2).

omicsguard validate --data patient_data.json

Output:

true

2. Pulling Schemas

Download and cache official schemas from the registry to avoid repeated network calls.

omicsguard pull --standard ga4gh-phenopacket-v2

3. Custom Business Rules (Plugins)

Sometimes, structural validation isn't enough. Use Python plugins to enforce complex rules (e.g., "ID must start with PROBAND-").

Create a plugin (my_plugin.py):

def validate(data):
    errors = []
    if not data.get("id", "").startswith("PROBAND-"):
        errors.append("ID must start with 'PROBAND-'")
    return errors

Run with plugin:

omicsguard validate --data patient.json --plugin my_plugin.py

4. Schema Extensions

Add custom fields to a standard schema without forking it.

Extension Schema (hospital_fields.json):

{
  "properties": {
    "hospital_id": { "type": "string" }
  },
  "required": ["hospital_id"]
}

Merge and Validate:

omicsguard validate --data patient.json --extend hospital_fields.json

5. Generating Reports

Generate detailed reports for non-technical stakeholders.

# HTML Report
omicsguard validate --data patient.json --output report.html

# Markdown Report (great for CI/CD comments)
omicsguard validate --data patient.json --output report.md

Configuration

OmicsGuard is 12-factor app compliant and can be configured via Environment Variables:

  • OMICSGUARD_SCHEMA_CACHE: Directory to store cached schemas (Default: ~/.omicsguard/schemas).

Development

  1. Clone the repo

    git clone https://github.com/your-org/omicsguard.git
    cd omicsguard
    
  2. Install dependencies

    pip install -e .
    
  3. Run Tests

    python -m unittest discover tests
    

License

MIT License. See LICENSE for details.

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

omicsguard-0.1.0.tar.gz (12.7 kB view details)

Uploaded Source

Built Distribution

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

omicsguard-0.1.0-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for omicsguard-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3e7a3419c9c79000d9ff73acd2db91914b08bd394c2d8de2c7ce90045851101e
MD5 fc44b60c424fa6080054eb440cc0862c
BLAKE2b-256 304a698915574ab151d4037e72de188154e154e91eb6672b7892bd7daa49b4f1

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for omicsguard-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a6004c92d51283f97bb41b3aaf87b753ec23eb12b48fa002a5dfed7df6b5b58a
MD5 09592d2a7873ea3d8abd0d2d3c01a444
BLAKE2b-256 6b8ebb341ff0878c2d67d5a49c5ef8db8877f6ada71c5dd79a929d9e00c43b30

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