Download source/scripts/export_atlas_coverage.py from CladeTeam/ouroboros: direct link, hf CLI and curl.
- Browser
- Download file 1.31 kB
-
https://huggingface.co/spaces/CladeTeam/ouroboros/resolve/main/source/scripts/export_atlas_coverage.py
- Command line
-
hf download hf://spaces/CladeTeam/ouroboros/source/scripts/export_atlas_coverage.py
-
curl -L -o export_atlas_coverage.py https://huggingface.co/spaces/CladeTeam/ouroboros/resolve/main/source/scripts/export_atlas_coverage.py
1.31 kB
| """Export the full-corpus reference-overlap audit, independently of map sampling.""" | |
| import hashlib | |
| import json | |
| from pathlib import Path | |
| ROOT = Path(__file__).resolve().parents[1] | |
| SOURCE = ROOT.parent / 'Ouroboros_Atlas/visualization/20261107-atlas-million-r1/coverage_audit.json' | |
| def export_coverage(): | |
| raw = SOURCE.read_bytes() | |
| audit = json.loads(raw) | |
| counts = audit['counts']['eligible'] | |
| data = {'population': audit['eligible'], | |
| 'referenceMatches': counts['swissprot2024_exact_match'], | |
| 'beyondReference': counts['no_exact_swissprot2024_match'], | |
| 'referenceRelease': audit['reference']['release'], | |
| 'definition': audit['definition'], 'sequenceScope': audit['sequence_scope'], | |
| 'source': str(SOURCE.relative_to(ROOT.parent)), | |
| 'sourceSha256': hashlib.sha256(raw).hexdigest(), | |
| 'interpretation': 'No exact match to this snapshot does not establish absence of other annotations. Ouroboros descriptions are model-generated functional hypotheses.'} | |
| assert data['referenceMatches'] + data['beyondReference'] == data['population'] | |
| (ROOT / 'public/data/atlas-coverage.json').write_text(json.dumps(data, indent=2)+'\n') | |
| return data | |
| if __name__ == '__main__': | |
| print(json.dumps(export_coverage(), indent=2)) | |