Skip to main content

OmicsGuard

Python application PyPI version License: MIT Lines of Code

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

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

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.

Metadata

Release files for omicsguard 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for omicsguard 0.1.1
File Size Uploaded Provenance
omicsguard-0.1.1.tar.gz 13.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for omicsguard 0.1.1
File Interpreter ABI Platform
omicsguard-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 26.3 kB

Release files / omicsguard-0.1.1.tar.gz

Download URL omicsguard-0.1.1.tar.gz
Size 13.2 kB
Tags Source
SHA-256 checksum
How to use checksums
9a74d7045055dde40ff91728349842ccbb04fcc655e984afccaa43b296bb4a57
BLAKE2b-256 checksum
How to use checksums
5db8e537dbf0a4d26260036d1e554b90e2af48990e5a3532d9727069b39c740f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / omicsguard-0.1.1-py3-none-any.whl

Download URL omicsguard-0.1.1-py3-none-any.whl
Size 13.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dc32282e3c96a2a6e85f69e35095991de40eb4f5161acaa440927582b52aa2ac
BLAKE2b-256 checksum
How to use checksums
f2c44431d17e44c7a2eb79ae102d8d3807f7f13f5282e62546471784e07ac0a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Security for omicsguard 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page