geno_lewm.data.membership_store¶
membership_store
¶
Scalable, lineage-bound membership artifacts for v0.3 datasets.
This stable public facade keeps the production-scale membership contract separate from its writer, verifier, storage, lineage, and runtime adapters. PyArrow is imported only by the Parquet build and verification paths.
MEMBERSHIP_STORE_SCHEMA_VERSION
module-attribute
¶
Closed manifest and row schema for the scalable membership store.
LabeledClinVarMembership
dataclass
¶
One chromosome-assigned binary ClinVar label and its membership identity.
is_pathogenic
property
¶
Return the closed binary target for this normalized ClinVar class.
MembershipSourceBinding
dataclass
¶
MembershipSourceBinding(source_id: str, kind: str, repository: str, revision: str, namespace: str, artifact_path: str, artifact_sha256: str, artifact_size_bytes: int, artifact_row_count: int, artifact_schema_version: str, verification_kind: str, verification_sha256: str, membership_row_count: int, filtered_row_count: int)
Lineage, staged-byte, and derived-row commitments for one source.
MembershipSourceInput
dataclass
¶
One local lineage-bound source shard consumed by the builder.
source_id
property
¶
Return the stable source identifier recorded on every derived row.
MembershipStoreFile
dataclass
¶
Exact identity of one physical store file.
MembershipStoreManifest
dataclass
¶
MembershipStoreManifest(artifact_id: str, assembly: str, chromosome_roles: ChromosomeRoles, snapshot_lineage: SnapshotLineageBinding, sources: tuple[MembershipSourceBinding, ...], row_count: int, variant_count: int, role_counts: dict[str, int], source_counts: dict[str, int], source_role_counts: dict[str, dict[str, int]], source_kind_role_counts: dict[str, dict[str, int]], clinvar_class_role_counts: dict[str, dict[str, int]], rowset_sha256: str, files: tuple[MembershipStoreFile, ...], content_identity: str, schema_version: str = MEMBERSHIP_STORE_SCHEMA_VERSION)
Closed semantic and physical contract for one membership store.
physical_identity
property
¶
Return the exact identity of semantic and bound physical bytes.
MembershipStoreVerification
dataclass
¶
Result of independently scanning a membership store.
SnapshotLineageBinding
dataclass
¶
Exact byte and semantic identity of the source snapshot lineage.
evidence_profile
property
¶
Return whether the lineage passed official or fixture-only verification.
MembershipStore
¶
Read-only, indexed membership lookup without a PyArrow dependency.
Source code in geno_lewm/data/_membership_store_runtime.py
open
classmethod
¶
Open a store read-only, optionally running its full streaming verifier.
close
¶
Close this handle and every per-thread read-only connection it owns.
Source code in geno_lewm/data/_membership_store_runtime.py
__getstate__
¶
Serialize stable bindings only; live SQLite handles never cross processes.
contains_variant
¶
contains_variant(variant: CanonicalVariant | str, *, roles: Sequence[str] = ('validation', 'evaluation'), sources: Sequence[str] | None = None) -> bool
Return whether variant has any indexed membership in roles.
Source code in geno_lewm/data/_membership_store_runtime.py
overlaps_interval
¶
overlaps_interval(chrom: str, *, start_bp: int, end_bp: int, roles: Sequence[str] = ('validation', 'evaluation'), sources: Sequence[str] | None = None) -> bool
Return whether an indexed variant intersects a 0-based half-open interval.
Source code in geno_lewm/data/_membership_store_runtime.py
iter_role
¶
Stream one split role in canonical order with bounded Python memory.
Source code in geno_lewm/data/_membership_store_runtime.py
iter_labeled_clinvar
¶
Stream binary-labeled ClinVar rows for one chromosome-assigned role.
Source code in geno_lewm/data/_membership_store_runtime.py
MembershipStoreHoldoutPolicy
¶
Bases: HoldoutPolicy
Existing tuple-builder holdout adapter backed by :class:MembershipStore.
Source code in geno_lewm/data/_membership_store_runtime.py
excludes_window
¶
Exclude every validation/evaluation chromosome before tuple emission.
Source code in geno_lewm/data/_membership_store_runtime.py
excludes_edit
¶
Exclude a held chromosome or a validation/evaluation variant lookup.
Source code in geno_lewm/data/_membership_store_runtime.py
to_dict
¶
Return a compact policy binding, never the complete key set.
Source code in geno_lewm/data/_membership_store_runtime.py
build_membership_store
¶
build_membership_store(*, artifact_id: str, snapshot_lineage_path: Path, expected_snapshot_lineage_sha256: str, builder_git_commit: str, container_image: str, sources: Sequence[MembershipSourceInput], output_dir: Path) -> MembershipStoreManifest
Build one immutable store from expected lineage bytes and pinned builder provenance.
Source code in geno_lewm/data/membership_store.py
verify_membership_store
¶
Independently verify manifest, files, Parquet rows, and SQLite rows.