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.
- 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.
You can install OmicsGuard from PyPI or directly from the source.
pip install omicsguardUseful for development or using the latest unreleased features.
git clone https://github.com/your-org/omicsguard.git
cd omicsguard
pip install .Validate a JSON or YAML file against the default bundled standard (Phenopackets v2).
omicsguard validate --data patient_data.jsonOutput:
true
Download and cache official schemas from the registry to avoid repeated network calls.
omicsguard pull --standard ga4gh-phenopacket-v2Sometimes, 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 errorsRun with plugin:
omicsguard validate --data patient.json --plugin my_plugin.pyAdd 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.jsonGenerate 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.mdOmicsGuard is 12-factor app compliant and can be configured via Environment Variables:
OMICSGUARD_SCHEMA_CACHE: Directory to store cached schemas (Default:~/.omicsguard/schemas).
-
Clone the repo
git clone https://github.com/your-org/omicsguard.git cd omicsguard -
Install dependencies
pip install -e . -
Run Tests
python -m unittest discover tests
MIT License. See LICENSE for details.