geno_lewm.data.clinvar¶
clinvar
¶
ClinVar local VCF preparation and shard loading.
ClinvarVariant
dataclass
¶
ClinvarVariant(chrom: str, pos: int, ref: str, alt: str, clinical_significance: str, review_status: str, gene_symbol: str | None, clinvar_id: int, schema_version: str = CLINVAR_SCHEMA_VERSION)
One normalized ClinVar row.
ClinvarPrepareReport
dataclass
¶
ClinvarPrepareReport(output_path: Path, release: str, records_read: int, allele_records_seen: int, records_written: int, skipped_allele: int, size_bytes: int, already_exists: bool = False)
Summary emitted by geno-lewm-prepare-clinvar.
prepare_clinvar_shard
¶
prepare_clinvar_shard(input_vcf: str | Path, output_dir: str | Path, *, release: str, max_allele_len: int = 16, overwrite: bool = False) -> ClinvarPrepareReport
Normalize a local ClinVar VCF/VCF.gz into the release shard schema.
Source code in geno_lewm/data/clinvar.py
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 | |
iter_clinvar_vcf_variants
¶
iter_clinvar_vcf_variants(input_vcf: str | Path, *, max_allele_len: int = 16) -> Iterator[ClinvarVariant]
Yield normalized ClinVar rows from a local VCF without writing a shard.
Source code in geno_lewm/data/clinvar.py
iter_clinvar_shard
¶
Yield normalized ClinVar rows from a Parquet shard.
Source code in geno_lewm/data/clinvar.py
label_set
¶
Return ClinVar rows usable for labelled eval, excluding VUS/OTHER.