geno_lewm.data.gnomad¶
gnomad
¶
gnomAD local VCF preparation and shard loading.
GnomadVariant
dataclass
¶
GnomadVariant(chrom: str, pos: int, ref: str, alt: str, af_global: float, af_afr: float | None, af_ami: float | None, af_amr: float | None, af_asj: float | None, af_eas: float | None, af_fin: float | None, af_nfe: float | None, af_oth: float | None, af_sas: float | None, filter: str, schema_version: str = _GNOMAD_LEGACY_SCHEMA_VERSION)
One normalized common-variant row for the gnomAD shard.
Omitting schema_version retains the legacy v1 constructor contract.
Rows prepared from gnomAD v4.1 are always stamped with the current public
:data:GNOMAD_SCHEMA_VERSION.
GnomadPrepareReport
dataclass
¶
GnomadPrepareReport(output_path: Path, release: str, records_read: int, allele_records_seen: int, records_written: int, skipped_filter: int, skipped_af: int, skipped_allele: int, size_bytes: int, already_exists: bool = False)
Summary emitted by geno-lewm-prepare-gnomad.
prepare_gnomad_shard
¶
prepare_gnomad_shard(input_vcf: str | Path, output_dir: str | Path, *, release: str = 'v4.1', min_af: float = 0.01, max_allele_len: int = 16, overwrite: bool = False) -> GnomadPrepareReport
Filter a local gnomAD VCF/VCF.gz into the release shard schema.
Source code in geno_lewm/data/gnomad.py
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 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 | |
iter_gnomad_vcf_variants
¶
iter_gnomad_vcf_variants(input_vcf: str | Path, *, min_af: float = 0.01, max_allele_len: int = 16) -> Iterator[GnomadVariant]
Yield normalized rows from a local gnomAD VCF without writing a shard.
Source code in geno_lewm/data/gnomad.py
iter_gnomad_shard
¶
Yield normalized gnomAD rows from a Parquet shard.