ouroboros / source /scripts /export_atlas_coverage.py
REXWind's picture
Publish the Ouroboros scientific showcase to CladeTeam
03677d0 verified
Raw History Blame Contribute Delete
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))