File size: 1,313 Bytes
03677d0 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | """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))
|