allelix 2.6.0__tar.gz → 2.6.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {allelix-2.6.0/allelix.egg-info → allelix-2.6.1}/PKG-INFO +14 -12
- {allelix-2.6.0 → allelix-2.6.1}/README.md +13 -11
- {allelix-2.6.0 → allelix-2.6.1}/allelix/annotators/_placement.py +16 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix/annotators/_resolution.py +32 -7
- {allelix-2.6.0 → allelix-2.6.1}/allelix/annotators/base.py +9 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix/annotators/cadd.py +11 -1
- {allelix-2.6.0 → allelix-2.6.1}/allelix/annotators/clinvar.py +498 -32
- {allelix-2.6.0 → allelix-2.6.1}/allelix/annotators/pharmgkb.py +4 -3
- {allelix-2.6.0 → allelix-2.6.1}/allelix/annotators/reference_fallback.py +5 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix/annotators/snpedia.py +92 -51
- allelix-2.6.1/allelix/cli/__init__.py +136 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix/cli/_helpers.py +70 -18
- {allelix-2.6.0 → allelix-2.6.1}/allelix/cli/db.py +287 -100
- {allelix-2.6.0 → allelix-2.6.1}/allelix/cli/utility.py +25 -8
- {allelix-2.6.0 → allelix-2.6.1}/allelix/compare.py +9 -3
- {allelix-2.6.0 → allelix-2.6.1}/allelix/databases/cache_state.py +6 -1
- {allelix-2.6.0 → allelix-2.6.1}/allelix/databases/cpic_loader.py +77 -4
- {allelix-2.6.0 → allelix-2.6.1}/allelix/databases/loader_utils.py +90 -3
- {allelix-2.6.0 → allelix-2.6.1}/allelix/databases/manager.py +19 -6
- {allelix-2.6.0 → allelix-2.6.1}/allelix/databases/staging.py +27 -3
- {allelix-2.6.0 → allelix-2.6.1}/allelix/exporters/plink.py +29 -6
- {allelix-2.6.0 → allelix-2.6.1}/allelix/models.py +21 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix/reports/__init__.py +23 -13
- {allelix-2.6.0 → allelix-2.6.1}/allelix/reports/_pipeline.py +153 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix/reports/diff.py +62 -2
- {allelix-2.6.0 → allelix-2.6.1}/allelix/reports/high_value.py +127 -4
- {allelix-2.6.0 → allelix-2.6.1}/allelix/reports/html.py +2 -2
- {allelix-2.6.0 → allelix-2.6.1}/allelix/reports/json_report.py +22 -6
- {allelix-2.6.0 → allelix-2.6.1}/allelix/reports/vcf.py +22 -1
- {allelix-2.6.0 → allelix-2.6.1/allelix.egg-info}/PKG-INFO +14 -12
- {allelix-2.6.0 → allelix-2.6.1}/pyproject.toml +13 -1
- allelix-2.6.0/allelix/cli/__init__.py +0 -60
- {allelix-2.6.0 → allelix-2.6.1}/LICENSE +0 -0
- {allelix-2.6.0 → allelix-2.6.1}/MANIFEST.in +0 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix/__init__.py +0 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix/annotators/__init__.py +0 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix/annotators/alphamissense.py +0 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix/annotators/gnomad.py +0 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix/annotators/gwas.py +0 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix/annotators/rsid_identity.py +0 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix/attribution.py +0 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix/cli/_options.py +0 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix/cli/analyze.py +0 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix/cli/config.py +0 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix/cli/focused.py +0 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix/config.py +0 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix/data/__init__.py +0 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix/data/clinvar_clnsig_snapshot.yaml +0 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix/data/high_value_snps.yaml +0 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix/databases/__init__.py +0 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix/databases/_versions.py +0 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix/databases/alphamissense_loader.py +0 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix/databases/cadd_loader.py +0 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix/databases/gnomad_loader.py +0 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix/databases/gwas_loader.py +0 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix/databases/pharmgkb_loader.py +0 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix/databases/rsid_identity_loader.py +0 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix/databases/schema.py +0 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix/databases/snpedia_loader.py +0 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix/databases/snpedia_parser.py +0 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix/exporters/__init__.py +0 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix/parsers/__init__.py +0 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix/parsers/_helpers.py +0 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix/parsers/ancestrydna.py +0 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix/parsers/base.py +0 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix/parsers/decodeme.py +0 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix/parsers/ftdna.py +0 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix/parsers/ftdna_famfinder.py +0 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix/parsers/ftdna_illumina.py +0 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix/parsers/genesforgood.py +0 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix/parsers/livingdna.py +0 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix/parsers/myhappygenes.py +0 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix/parsers/myheritage.py +0 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix/parsers/rsidlist.py +0 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix/parsers/twentythreeandme.py +0 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix/parsers/vcf.py +0 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix/py.typed +0 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix/reports/_sources.py +0 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix/reports/association_text.py +0 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix/reports/build_text.py +0 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix/reports/clinvar_text.py +0 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix/reports/methylation.py +0 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix/reports/terminal.py +0 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix/utils/__init__.py +0 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix/utils/allele.py +0 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix/utils/build_detect.py +0 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix/utils/plausibility.py +0 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix.egg-info/SOURCES.txt +0 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix.egg-info/dependency_links.txt +0 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix.egg-info/entry_points.txt +0 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix.egg-info/requires.txt +0 -0
- {allelix-2.6.0 → allelix-2.6.1}/allelix.egg-info/top_level.txt +0 -0
- {allelix-2.6.0 → allelix-2.6.1}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: allelix
|
|
3
|
-
Version: 2.6.
|
|
3
|
+
Version: 2.6.1
|
|
4
4
|
Summary: Open-source genotype analysis toolkit. Format-agnostic ingestion, database-agnostic annotation, offline-first.
|
|
5
5
|
Author: Allelix
|
|
6
6
|
Maintainer-email: dial481 <dial481@users.noreply.github.com>
|
|
@@ -107,7 +107,7 @@ See [Development](#development) for source installs and running tests, [Managing
|
|
|
107
107
|
| Format | Status | Notes |
|
|
108
108
|
|---|---|---|
|
|
109
109
|
| MyHappyGenes (Tempus) | ✓ | Tab-delimited, 5 columns. **Build is auto-detected** — real-world MHG exports mislabel the header as "build 37.1" while shipping GRCh38 coordinates. Allelix decides the build from position data and warns on header/data disagreement (ADR-0021, ADR-0044). See [docs/formats.md](https://github.com/allelix/allelix/blob/main/docs/formats.md#myhappygenes-tempus). |
|
|
110
|
-
| 23andMe | ✓ | Tab-delimited, 4 columns, concatenated genotype; a copy a spreadsheet re-saved as CSV (quoted or not) or with spaces is read too ([docs/formats.md](https://github.com/allelix/allelix/blob/main/docs/formats.md#23andme)). Reads build 36, 37 or 38; the header's build is used when the known-SNP positions agree. I-prefixed probe IDs are passed through but not matched against ClinVar, and `D`/`I` indel calls (mixed calls such as `AD` too) are matched by no source (ADR-0070); the report counts both (ADR-0051). A `D`/`I` call at a high-value rsID, or at one ClinVar classifies Pathogenic or Likely pathogenic, is also named as not checked (gene, variant name, rsID and call) on the console, in HTML and in JSON. Such calls are never interpreted, also at known variants such as BRCA1 5382insC, BRCA2 6174delT and CFTR F508del; carrier status for these needs clinical testing ([docs/formats.md](https://github.com/allelix/allelix/blob/main/docs/formats.md#d-and-i-calls)). |
|
|
110
|
+
| 23andMe | ✓ | Tab-delimited, 4 columns, concatenated genotype; a copy a spreadsheet re-saved as CSV (quoted or not) or with spaces is read too ([docs/formats.md](https://github.com/allelix/allelix/blob/main/docs/formats.md#23andme)). Reads build 36, 37 or 38; the header's build is used when the known-SNP positions agree. I-prefixed probe IDs are passed through but not matched against ClinVar, and `D`/`I` indel calls (mixed calls such as `AD` too) are matched by no source (ADR-0070), except that a `D`/`I` call at a 23andMe `i` probe reads SNPedia's page for that probe; the report counts both (ADR-0051). A `D`/`I` call at a high-value rsID, or at one ClinVar classifies Pathogenic or Likely pathogenic, is also named as not checked (gene, variant name, rsID and call) on the console, in HTML and in JSON. Such calls are never interpreted, also at known variants such as BRCA1 5382insC, BRCA2 6174delT and CFTR F508del; carrier status for these needs clinical testing ([docs/formats.md](https://github.com/allelix/allelix/blob/main/docs/formats.md#d-and-i-calls)). |
|
|
111
111
|
| Genes for Good | ✓ | The 23andMe-style `.txt` from a Genes for Good download (23andMe's columns under a PLINK banner). The imputed text file (about 7.7 million rows) and the imputed VCF are labelled imputed in every report; the measured files are not. The download's VCFs are read as VCF; see [docs/formats.md](https://github.com/allelix/allelix/blob/main/docs/formats.md#genes-for-good). |
|
|
112
112
|
| rsID and genotype list | ✓ | Two tab-separated columns, an rsID and a call, with no chromosome, position or build (IYG files, for one). Detected strictly: every one of the first 50 data lines is `ID<TAB>call`, and at least three of their IDs, and at least 80%, are rsIDs. Each row is placed on GRCh38 from the rsID identity table when exactly one strand reading of its call fits the site, and is otherwise counted by reason and kept without a locus for ClinPGx, SNPedia and the GWAS Catalog (ADR-0069). Needs the identity table; only `analyze`, `methylation` and `pharmacogenomics` read it. See [docs/formats.md](https://github.com/allelix/allelix/blob/main/docs/formats.md#rsid-and-genotype-lists). |
|
|
113
113
|
| AncestryDNA | ✓ | Tab-delimited, 5 columns. Chromosome mapping: 23→X, 24→Y, 25→X (PAR), 26→MT. V1 and V2 chip layouts. |
|
|
@@ -144,7 +144,7 @@ Issues and milestones are tracked at [github.com/allelix/allelix/issues](https:/
|
|
|
144
144
|
|
|
145
145
|
| Database | Status | Notes |
|
|
146
146
|
|---|---|---|
|
|
147
|
-
| ClinVar (GRCh37 + GRCh38) | ✓ | Public domain (NCBI). SNVs + indels + multi-allelic sites. **Both builds cached**; `analyze` dispatches by the decided build (ADR-0044). Rows are matched by chromosome, position, REF and ALT, never by rsID alone. A record written REF = ALT, where this build's reference itself carries the record's allele (Factor V Leiden on GRCh37, or a record for the normal allele), is reported for a user who carries that allele; Pathogenic and Likely pathogenic classifications of a normal allele are dropped (ADR-0039). Carrier rule (ADR-0007) requires the user to carry the ALT allele. Indel-anchor protection (ADR-0011) prevents single-base array readouts from matching anchor-base indels. Array calls ClinVar cannot match are counted in the report: vendor probes without an rsID at a locus ClinVar classifies as Pathogenic or Likely pathogenic,
|
|
147
|
+
| ClinVar (GRCh37 + GRCh38) | ✓ | Public domain (NCBI). SNVs + indels + multi-allelic sites. **Both builds cached**; `analyze` dispatches by the decided build (ADR-0044). Rows are matched by chromosome, position, REF and ALT, never by rsID alone. A record written REF = ALT, where this build's reference itself carries the record's allele (Factor V Leiden on GRCh37, or a record for the normal allele), is reported for a user who carries that allele; Pathogenic and Likely pathogenic classifications of a normal allele are dropped (ADR-0039). Carrier rule (ADR-0007) requires the user to carry the ALT allele. Indel-anchor protection (ADR-0011) prevents single-base array readouts from matching anchor-base indels. Array calls ClinVar cannot match are counted in the report: vendor probes without an rsID at a locus ClinVar classifies as Pathogenic or Likely pathogenic, `D`/`I` calls, and, at such a locus, a chip call that names a base that is none of its own rsID's alleles there (from the rsID identity table's SNV rows, ClinVar's own rows of the rsID and gnomAD's), or whose rsID's alleles no source knows; such a call is matched only to its own rsID's rows, so that another rsID's row cannot be taken for it (ADR-0051). A `D`/`I` call at a high-value or Pathogenic / Likely pathogenic rsID is named as not checked, not only counted; it is still not interpreted. Variants scored down by ClinVar's Conflicting or Benign classification, or as an outranked Pathogenic / Likely pathogenic submission (ADR-0045), are named with their submitter split. ClinVar variants without an rsID are matched for VCF input only, where REF comes from the file (ADR-0046). A VCF allele written with bases it shares with REF (`GTT>GT,G`, `CA>TA`) is trimmed per carried allele before matching, by ClinPGx, SNPedia and the GWAS Catalog as well as ClinVar, and a VCF homozygous deletion to one base matches; indels are not left-aligned, so one the file places at a different position from ClinVar's still does not match (ADR-0047). |
|
|
148
148
|
| ClinPGx (formerly PharmGKB) | ✓ | CC BY-SA 4.0. Clinical annotations only — single-rsid SNVs; star alleles and haplotypes deferred (ADR-0009). **Primary non-finding filter is the ClinVar REF carrier rule (ADR-0023):** where ClinVar for the input's build is installed and places the rsID at the call's position, a user homozygous for the normal allele ClinVar resolves there is not reported. That is usually ClinVar's single-base REF. The exception is a site where this build's reference itself carries ClinVar's variant allele (a REF = ALT row, F5 rs6025 on GRCh37): there the normal allele is the other build's REF, written on the input build's strand, so a TT call is reported as a carrier and CC is the non-finding. Where that normal allele cannot be told, nothing is suppressed. Without that cache, only sites where the two builds' references differ are decided: by the other build's ClinVar, written on the input build's strand, else by gnomAD's major allele. Where the strand relation between the builds cannot be told (F5 rs6025 is such a site), the other build's ClinVar is not used: a GRCh38 call is decided by gnomAD alone, and a GRCh37 call is not decided. gnomAD is GRCh38's own reading: a GRCh38 call can use its evidence as it is, and a GRCh37 call only written on its own strand. Where none of these can tell (no evidence, a tie, or, for a GRCh37 call, a strand relation between the builds that cannot be told), the row shows. Every other site is then not suppressed. CPIC's `(rsid, base) → function_class` join (ADR-0020) survives as a secondary tier for rsids ClinVar doesn't catalog. Earlier prose tiers (ADR-0013, ADR-0017, ADR-0018) are superseded. |
|
|
149
149
|
| CPIC (per-allele function table) | ✓ | Internal data source for the ClinPGx filter. Fetched from `api.cpicpgx.org` at `db update` time. Used to populate the `pharmgkb_allele_function` table — not surfaced to end users as its own annotator. |
|
|
150
150
|
| SNPedia | ✓ | CC BY-NC-SA 3.0 US. Pre-built cache downloaded via `db update` (~216K wiki pages, ~105K genotype rows). The cache carries SNPedia's orientation metadata: minus-strand alleles are complemented before matching. Single-base genotypes at rsIDs are then checked against the site's forward alleles in the rsID identity table. A page that states its orientation is kept wherever its genotype is among them, A/T and C/G sites included. A page without one is read on its own: as written when only that fits, complemented when only the complement fits. It abstains when both fit (an A/T or C/G site, or a site with more alleles) or neither does (ADR-0066). Sites that abstain are counted in the report. If the database is absent, analysis runs without it. For commercial use, pass `--exclude-snpedia`. The cache can also be rebuilt from source via `scripts/scrape_snpedia.py` + `scripts/parse_snpedia.py`. |
|
|
@@ -154,7 +154,7 @@ Issues and milestones are tracked at [github.com/allelix/allelix/issues](https:/
|
|
|
154
154
|
| CADD | ✓ | LicenseRef-CADD (non-commercial). **GRCh38-only enrichment annotator** — adds PHRED-scaled deleteriousness scores from CADD v1.7. **Opt-in**, disabled by default; GRCh37 input is scored only through the rsID identity table (ADR-0040) and GRCh36 input never; see [CADD modes](#cadd-modes) below for details. |
|
|
155
155
|
| dbSNP rsID identity | ✓ | Public domain (NCBI dbSNP). Not an annotator: a cross-build table of each annotator rsID's GRCh37 and GRCh38 placement and alleles (ADR-0040). Supplies the reference allele for GRCh37 and GRCh38 array data, recovers rsIDs for rsID-less VCFs on both builds, and translates a GRCh37 allele to its GRCh38 coordinates so gnomAD, AlphaMissense and CADD can be looked up. Strand-inverted loci are translated explicitly. A row the table flags palindromic (its dbSNP allele set equals its own complement: A/T, C/G, or all four bases) abstains where the GRCh37 and GRCh38 reference bases differ, and translates as written where they are equal; rows the table does not flag translate by their alleles. Alleles that became the GRCh38 reference abstain. Pre-built cache downloaded via `db update` (~4.9M rows covering ~3.0M rsIDs, from dbSNP b157). |
|
|
156
156
|
|
|
157
|
-
A single-base call whose rsID the identity table places only elsewhere on the analysis build (a stale rsID, or coordinates from another build) is given to no source, ClinPGx included, and the report counts it in a warning, `identity_locus_conflict
|
|
157
|
+
A single-base call whose rsID the identity table places only elsewhere on the analysis build (a stale rsID, or coordinates from another build) is given to no source, ClinPGx included, and the report counts it in a warning, `identity_locus_conflict`; one at a high-value rsID, or at one ClinVar classifies Pathogenic or Likely pathogenic, is also named as not checked. Indels and chip `D`/`I` calls are not checked this way, and an rsID the table does not place is not affected (ADR-0063).
|
|
158
158
|
|
|
159
159
|
### CADD modes
|
|
160
160
|
|
|
@@ -165,7 +165,7 @@ CADD ranks how deleterious any single-nucleotide variant is using 100+ annotatio
|
|
|
165
165
|
Two modes:
|
|
166
166
|
|
|
167
167
|
- **Cache mode** (default): pre-built ~5.8 GB SQLite cache (~120M GRCh38 variant keys). Covers nearly every GRCh38 position allelix can annotate from its other databases (gnomAD, AlphaMissense, ClinVar). GRCh37 input is scored only after translation through the rsID identity table; GRCh36 input never is.
|
|
168
|
-
- **Full mode** (`options.cadd_full = true`): tabix queries against the complete CADD v1.7 file via pysam (GRCh38 only). It scores variants the cache lacks, such as novel or private variants in WGS/WES data. CADD adds scores to findings from the other sources; it never makes a finding of its own, so a variant no other source reports gains nothing. Requires `pip install allelix[cadd]` for the pysam dependency, and CADD's files, downloaded separately from [cadd.gs.washington.edu/download](https://cadd.gs.washington.edu/download) (`db update --cadd`
|
|
168
|
+
- **Full mode** (`options.cadd_full = true`): tabix queries against the complete CADD v1.7 file via pysam (GRCh38 only). It scores variants the cache lacks, such as novel or private variants in WGS/WES data. CADD adds scores to findings from the other sources; it never makes a finding of its own, so a variant no other source reports gains nothing. Requires `pip install allelix[cadd]` for the pysam dependency, and CADD's files, downloaded separately from [cadd.gs.washington.edu/download](https://cadd.gs.washington.edu/download) (`db update --cadd` cannot fetch them, and in full mode downloads nothing, since full mode never reads the SQLite cache; until both files are in place and readable, `db update --cadd` names the one it cannot use and fails, and `analyze` runs without CADD): `whole_genome_SNVs.tsv.gz` (about 81 GB) and its `.tbi` index in the data directory, plus, optionally for indels, `gnomad.genomes.r4.0.indel.tsv.gz` (about 1.2 GB) and its `.tbi`.
|
|
169
169
|
|
|
170
170
|
If your input is a genotyping chip file, cache mode is normally all you need. GRCh37 chip files are scored through the rsID identity table; GRCh36 files are not scored.
|
|
171
171
|
|
|
@@ -309,12 +309,12 @@ Allelix keeps its caches in `~/.local/share/allelix/`, or `$XDG_DATA_HOME/alleli
|
|
|
309
309
|
└── pharmgkb.sqlite ~6 MB
|
|
310
310
|
```
|
|
311
311
|
|
|
312
|
-
Every cache is written beside its final name under a staging name of its own and moved into place only when complete, so a failed or interrupted update keeps the cache you had, and two updates running at once cannot install each other's files.
|
|
312
|
+
Every cache is written beside its final name under a staging name of its own and moved into place only when complete, so a failed or interrupted update keeps the cache you had, and two updates running at once cannot install each other's files. An update stopped with Ctrl-C, SIGTERM or SIGHUP removes its staging files (hidden `.<name>…` files and directories, which can be several GB) on the way out. One killed outright (SIGKILL, a crash, a power cut) cannot, and no later run removes what it left, since that cannot be told from a running update's files; `db clean` removes them (it removes only names allelix creates, and keeps and lists a staging directory holding a finished cache or an extracted table). It does not reach a ClinVar build's temporary index of `variant_summary`, a `tmp….sqlite` file in the system temp directory (such as `/tmp`), outside the data directory; delete one a killed update left by hand. On Windows a forced end (TerminateProcess, as `taskkill /F` and Task Manager use, and SIGTERM there), closing the console and Ctrl-Break do not run this cleanup either; `db clean` removes what they leave by the same rule. Do not run `db clean` while an update is running in the same data directory, including an `analyze` without `--no-update`, whose refresh can build a cache there: it would remove that update's staging files.
|
|
313
313
|
|
|
314
|
-
**The caches are disposable and re-downloadable.**
|
|
314
|
+
**The caches are disposable and re-downloadable.** Every cache here was fetched or built by `allelix db update` and can be fetched again at any time; the ClinVar build log cannot (below). There's no per-user state in the cache — allelix never writes your genotype files into this directory. `db clean` removes only what allelix created there: the caches, their side files, GWAS's kept table, the ClinVar build log, staging entries and earlier releases' downloads. A directory is removed only when it is one of allelix's staging directories and every entry in it is a name allelix writes there (its downloads, the partial files of a download or of a cache being built, an empty `extracted/`), and a link is removed, not followed; a hidden directory of the same shape that holds anything else (a dated backup like `.clinvar-20261101/`, a finished cache not yet moved into place, an extracted table) is kept and listed, as possibly an interrupted update's leftovers to delete by hand. Everything else stays, and `db clean` lists it: CADD full-mode files (which `db update` cannot fetch), any file or folder you keep there, even one named like a cache. `config.toml` always stays too, and is not listed. Safe to run to reclaim space (or to force a full refresh if you suspect a cache went stale):
|
|
315
315
|
|
|
316
316
|
```bash
|
|
317
|
-
# Reclaim
|
|
317
|
+
# Reclaim the caches' ~19-25 GB, with size report and confirmation prompt
|
|
318
318
|
allelix db clean
|
|
319
319
|
|
|
320
320
|
# Preserve the CADD cache (avoids re-downloading the slowest one, ~5.8 GB)
|
|
@@ -330,7 +330,7 @@ allelix db clean --yes
|
|
|
330
330
|
allelix db update
|
|
331
331
|
```
|
|
332
332
|
|
|
333
|
-
`db clean`
|
|
333
|
+
Because `db clean` removes only names allelix creates, a typo'd `--data-dir ~/Documents` removes nothing from an unrelated tree, even with `--yes`. A cache renamed by hand is not allelix's name, so it is kept. `--force` is still accepted, for scripts written for 2.6.0 and earlier, and has no effect.
|
|
334
334
|
|
|
335
335
|
For scripting and backup integration, `allelix db path` prints the resolved data directory:
|
|
336
336
|
|
|
@@ -459,7 +459,9 @@ are left untouched. Annotated VCF still refuses any existing output at the CLI.
|
|
|
459
459
|
Two outputs of one run must name different files too: `--output` and
|
|
460
460
|
`--vcf-out`, and PLINK's `.bed`, `.bim` and `.fam`, are refused before any work
|
|
461
461
|
when they resolve to one file (another spelling, a symlink, a linked folder or a
|
|
462
|
-
hardlink).
|
|
462
|
+
hardlink). Without `--output-prefix`, `export plink` writes next to the input
|
|
463
|
+
under its stem and refuses, before any work, a `.bed`, `.bim` or `.fam` that
|
|
464
|
+
already exists there, so an unrelated `genome.bed` is never replaced.
|
|
463
465
|
|
|
464
466
|
Writers use unique temporary files in the destination directory and publish
|
|
465
467
|
only complete, closed content. Failure before publication preserves previous
|
|
@@ -511,9 +513,9 @@ Notable load-bearing ADRs:
|
|
|
511
513
|
- **ADR-0048: Caches are read-only at analyze time.** With `--no-update`, `analyze` writes nothing to the data directory; every cache opens read-only, installs in rollback-journal mode, and a skipped source is named with its reason (missing, outdated, unreadable, damaged, or WAL mode from an older Allelix). Local migrations run in the update step.
|
|
512
514
|
- **ADR-0049: Every report names its sources.** JSON `sources` gives every registered source's part in the run (used, ready but not used, or skipped with a reason); `report_warnings` carries report-level warnings, starting with ClinVar not used; the annotated VCF names skipped sources.
|
|
513
515
|
- **ADR-0050: Zygosity codes and haploid calls.** JSON zygosity and plausibility are codes, a call the file declares haploid is shown as hemizygous, "not assessed" carries a reason, and three rare homozygous P/LP calls give a report warning.
|
|
514
|
-
- **ADR-0051: Array calls ClinVar cannot match are counted.** Vendor probes at P/LP loci
|
|
516
|
+
- **ADR-0051: Array calls ClinVar cannot match are counted.** Vendor probes at P/LP loci, `D`/`I` calls and (since 2.6.1) chip calls naming a base their own rsID's known alleles do not include, or whose rsID's alleles no source knows, are counted in the report; since 2.5.2, a `D`/`I` call at a high-value or P/LP rsID is also named as not checked (JSON `high_value_unchecked` and `report_warnings` code `di_calls_not_checked`), and panel coverage puts each requested rsID in one of four states. Since 2.6.1, every such call at a high-value or P/LP site is named, not only counted, whatever the reason: a `D`/`I` call (also at a vendor probe), a base call at a vendor probe without an rsID, an unplaced rsID-list row, an identity locus conflict or a foreign-allele chip call (JSON `high_value_unchecked` reasons `di_call`, `vendor_probe`, `unplaced`, `identity_locus_conflict`, `foreign_alleles`, `unknown_alleles`). Each says what ClinVar did not check; it claims nothing about the sources that look a call up by rsID.
|
|
515
517
|
- **ADR-0052: Zero-star P/LP on a common allele.** A ClinVar P/LP row without assertion criteria whose allele has a gnomAD frequency of 5% or more is scored down, marked and counted.
|
|
516
|
-
- **ADR-0070: A chip D/I call is interpreted by no source.** A `D` or `I` code does not say which indel was called, so ClinVar, SNPedia, the GWAS Catalog and ClinPGx skip it; it is counted, and named at high-value and P/LP rsIDs as not checked.
|
|
518
|
+
- **ADR-0070: A chip D/I call is interpreted by no source.** A `D` or `I` code does not say which indel was called, so ClinVar, SNPedia, the GWAS Catalog and ClinPGx skip it; it is counted, and named at high-value and P/LP rsIDs as not checked. Since 2.6.1, SNPedia reads 23andMe's own `i`-probe page for a D/I call in a file the 23andMe parser read.
|
|
517
519
|
|
|
518
520
|
Release history: see [`CHANGELOG.md`](https://github.com/allelix/allelix/blob/main/CHANGELOG.md).
|
|
519
521
|
|
|
@@ -67,7 +67,7 @@ See [Development](#development) for source installs and running tests, [Managing
|
|
|
67
67
|
| Format | Status | Notes |
|
|
68
68
|
|---|---|---|
|
|
69
69
|
| MyHappyGenes (Tempus) | ✓ | Tab-delimited, 5 columns. **Build is auto-detected** — real-world MHG exports mislabel the header as "build 37.1" while shipping GRCh38 coordinates. Allelix decides the build from position data and warns on header/data disagreement (ADR-0021, ADR-0044). See [docs/formats.md](https://github.com/allelix/allelix/blob/main/docs/formats.md#myhappygenes-tempus). |
|
|
70
|
-
| 23andMe | ✓ | Tab-delimited, 4 columns, concatenated genotype; a copy a spreadsheet re-saved as CSV (quoted or not) or with spaces is read too ([docs/formats.md](https://github.com/allelix/allelix/blob/main/docs/formats.md#23andme)). Reads build 36, 37 or 38; the header's build is used when the known-SNP positions agree. I-prefixed probe IDs are passed through but not matched against ClinVar, and `D`/`I` indel calls (mixed calls such as `AD` too) are matched by no source (ADR-0070); the report counts both (ADR-0051). A `D`/`I` call at a high-value rsID, or at one ClinVar classifies Pathogenic or Likely pathogenic, is also named as not checked (gene, variant name, rsID and call) on the console, in HTML and in JSON. Such calls are never interpreted, also at known variants such as BRCA1 5382insC, BRCA2 6174delT and CFTR F508del; carrier status for these needs clinical testing ([docs/formats.md](https://github.com/allelix/allelix/blob/main/docs/formats.md#d-and-i-calls)). |
|
|
70
|
+
| 23andMe | ✓ | Tab-delimited, 4 columns, concatenated genotype; a copy a spreadsheet re-saved as CSV (quoted or not) or with spaces is read too ([docs/formats.md](https://github.com/allelix/allelix/blob/main/docs/formats.md#23andme)). Reads build 36, 37 or 38; the header's build is used when the known-SNP positions agree. I-prefixed probe IDs are passed through but not matched against ClinVar, and `D`/`I` indel calls (mixed calls such as `AD` too) are matched by no source (ADR-0070), except that a `D`/`I` call at a 23andMe `i` probe reads SNPedia's page for that probe; the report counts both (ADR-0051). A `D`/`I` call at a high-value rsID, or at one ClinVar classifies Pathogenic or Likely pathogenic, is also named as not checked (gene, variant name, rsID and call) on the console, in HTML and in JSON. Such calls are never interpreted, also at known variants such as BRCA1 5382insC, BRCA2 6174delT and CFTR F508del; carrier status for these needs clinical testing ([docs/formats.md](https://github.com/allelix/allelix/blob/main/docs/formats.md#d-and-i-calls)). |
|
|
71
71
|
| Genes for Good | ✓ | The 23andMe-style `.txt` from a Genes for Good download (23andMe's columns under a PLINK banner). The imputed text file (about 7.7 million rows) and the imputed VCF are labelled imputed in every report; the measured files are not. The download's VCFs are read as VCF; see [docs/formats.md](https://github.com/allelix/allelix/blob/main/docs/formats.md#genes-for-good). |
|
|
72
72
|
| rsID and genotype list | ✓ | Two tab-separated columns, an rsID and a call, with no chromosome, position or build (IYG files, for one). Detected strictly: every one of the first 50 data lines is `ID<TAB>call`, and at least three of their IDs, and at least 80%, are rsIDs. Each row is placed on GRCh38 from the rsID identity table when exactly one strand reading of its call fits the site, and is otherwise counted by reason and kept without a locus for ClinPGx, SNPedia and the GWAS Catalog (ADR-0069). Needs the identity table; only `analyze`, `methylation` and `pharmacogenomics` read it. See [docs/formats.md](https://github.com/allelix/allelix/blob/main/docs/formats.md#rsid-and-genotype-lists). |
|
|
73
73
|
| AncestryDNA | ✓ | Tab-delimited, 5 columns. Chromosome mapping: 23→X, 24→Y, 25→X (PAR), 26→MT. V1 and V2 chip layouts. |
|
|
@@ -104,7 +104,7 @@ Issues and milestones are tracked at [github.com/allelix/allelix/issues](https:/
|
|
|
104
104
|
|
|
105
105
|
| Database | Status | Notes |
|
|
106
106
|
|---|---|---|
|
|
107
|
-
| ClinVar (GRCh37 + GRCh38) | ✓ | Public domain (NCBI). SNVs + indels + multi-allelic sites. **Both builds cached**; `analyze` dispatches by the decided build (ADR-0044). Rows are matched by chromosome, position, REF and ALT, never by rsID alone. A record written REF = ALT, where this build's reference itself carries the record's allele (Factor V Leiden on GRCh37, or a record for the normal allele), is reported for a user who carries that allele; Pathogenic and Likely pathogenic classifications of a normal allele are dropped (ADR-0039). Carrier rule (ADR-0007) requires the user to carry the ALT allele. Indel-anchor protection (ADR-0011) prevents single-base array readouts from matching anchor-base indels. Array calls ClinVar cannot match are counted in the report: vendor probes without an rsID at a locus ClinVar classifies as Pathogenic or Likely pathogenic,
|
|
107
|
+
| ClinVar (GRCh37 + GRCh38) | ✓ | Public domain (NCBI). SNVs + indels + multi-allelic sites. **Both builds cached**; `analyze` dispatches by the decided build (ADR-0044). Rows are matched by chromosome, position, REF and ALT, never by rsID alone. A record written REF = ALT, where this build's reference itself carries the record's allele (Factor V Leiden on GRCh37, or a record for the normal allele), is reported for a user who carries that allele; Pathogenic and Likely pathogenic classifications of a normal allele are dropped (ADR-0039). Carrier rule (ADR-0007) requires the user to carry the ALT allele. Indel-anchor protection (ADR-0011) prevents single-base array readouts from matching anchor-base indels. Array calls ClinVar cannot match are counted in the report: vendor probes without an rsID at a locus ClinVar classifies as Pathogenic or Likely pathogenic, `D`/`I` calls, and, at such a locus, a chip call that names a base that is none of its own rsID's alleles there (from the rsID identity table's SNV rows, ClinVar's own rows of the rsID and gnomAD's), or whose rsID's alleles no source knows; such a call is matched only to its own rsID's rows, so that another rsID's row cannot be taken for it (ADR-0051). A `D`/`I` call at a high-value or Pathogenic / Likely pathogenic rsID is named as not checked, not only counted; it is still not interpreted. Variants scored down by ClinVar's Conflicting or Benign classification, or as an outranked Pathogenic / Likely pathogenic submission (ADR-0045), are named with their submitter split. ClinVar variants without an rsID are matched for VCF input only, where REF comes from the file (ADR-0046). A VCF allele written with bases it shares with REF (`GTT>GT,G`, `CA>TA`) is trimmed per carried allele before matching, by ClinPGx, SNPedia and the GWAS Catalog as well as ClinVar, and a VCF homozygous deletion to one base matches; indels are not left-aligned, so one the file places at a different position from ClinVar's still does not match (ADR-0047). |
|
|
108
108
|
| ClinPGx (formerly PharmGKB) | ✓ | CC BY-SA 4.0. Clinical annotations only — single-rsid SNVs; star alleles and haplotypes deferred (ADR-0009). **Primary non-finding filter is the ClinVar REF carrier rule (ADR-0023):** where ClinVar for the input's build is installed and places the rsID at the call's position, a user homozygous for the normal allele ClinVar resolves there is not reported. That is usually ClinVar's single-base REF. The exception is a site where this build's reference itself carries ClinVar's variant allele (a REF = ALT row, F5 rs6025 on GRCh37): there the normal allele is the other build's REF, written on the input build's strand, so a TT call is reported as a carrier and CC is the non-finding. Where that normal allele cannot be told, nothing is suppressed. Without that cache, only sites where the two builds' references differ are decided: by the other build's ClinVar, written on the input build's strand, else by gnomAD's major allele. Where the strand relation between the builds cannot be told (F5 rs6025 is such a site), the other build's ClinVar is not used: a GRCh38 call is decided by gnomAD alone, and a GRCh37 call is not decided. gnomAD is GRCh38's own reading: a GRCh38 call can use its evidence as it is, and a GRCh37 call only written on its own strand. Where none of these can tell (no evidence, a tie, or, for a GRCh37 call, a strand relation between the builds that cannot be told), the row shows. Every other site is then not suppressed. CPIC's `(rsid, base) → function_class` join (ADR-0020) survives as a secondary tier for rsids ClinVar doesn't catalog. Earlier prose tiers (ADR-0013, ADR-0017, ADR-0018) are superseded. |
|
|
109
109
|
| CPIC (per-allele function table) | ✓ | Internal data source for the ClinPGx filter. Fetched from `api.cpicpgx.org` at `db update` time. Used to populate the `pharmgkb_allele_function` table — not surfaced to end users as its own annotator. |
|
|
110
110
|
| SNPedia | ✓ | CC BY-NC-SA 3.0 US. Pre-built cache downloaded via `db update` (~216K wiki pages, ~105K genotype rows). The cache carries SNPedia's orientation metadata: minus-strand alleles are complemented before matching. Single-base genotypes at rsIDs are then checked against the site's forward alleles in the rsID identity table. A page that states its orientation is kept wherever its genotype is among them, A/T and C/G sites included. A page without one is read on its own: as written when only that fits, complemented when only the complement fits. It abstains when both fit (an A/T or C/G site, or a site with more alleles) or neither does (ADR-0066). Sites that abstain are counted in the report. If the database is absent, analysis runs without it. For commercial use, pass `--exclude-snpedia`. The cache can also be rebuilt from source via `scripts/scrape_snpedia.py` + `scripts/parse_snpedia.py`. |
|
|
@@ -114,7 +114,7 @@ Issues and milestones are tracked at [github.com/allelix/allelix/issues](https:/
|
|
|
114
114
|
| CADD | ✓ | LicenseRef-CADD (non-commercial). **GRCh38-only enrichment annotator** — adds PHRED-scaled deleteriousness scores from CADD v1.7. **Opt-in**, disabled by default; GRCh37 input is scored only through the rsID identity table (ADR-0040) and GRCh36 input never; see [CADD modes](#cadd-modes) below for details. |
|
|
115
115
|
| dbSNP rsID identity | ✓ | Public domain (NCBI dbSNP). Not an annotator: a cross-build table of each annotator rsID's GRCh37 and GRCh38 placement and alleles (ADR-0040). Supplies the reference allele for GRCh37 and GRCh38 array data, recovers rsIDs for rsID-less VCFs on both builds, and translates a GRCh37 allele to its GRCh38 coordinates so gnomAD, AlphaMissense and CADD can be looked up. Strand-inverted loci are translated explicitly. A row the table flags palindromic (its dbSNP allele set equals its own complement: A/T, C/G, or all four bases) abstains where the GRCh37 and GRCh38 reference bases differ, and translates as written where they are equal; rows the table does not flag translate by their alleles. Alleles that became the GRCh38 reference abstain. Pre-built cache downloaded via `db update` (~4.9M rows covering ~3.0M rsIDs, from dbSNP b157). |
|
|
116
116
|
|
|
117
|
-
A single-base call whose rsID the identity table places only elsewhere on the analysis build (a stale rsID, or coordinates from another build) is given to no source, ClinPGx included, and the report counts it in a warning, `identity_locus_conflict
|
|
117
|
+
A single-base call whose rsID the identity table places only elsewhere on the analysis build (a stale rsID, or coordinates from another build) is given to no source, ClinPGx included, and the report counts it in a warning, `identity_locus_conflict`; one at a high-value rsID, or at one ClinVar classifies Pathogenic or Likely pathogenic, is also named as not checked. Indels and chip `D`/`I` calls are not checked this way, and an rsID the table does not place is not affected (ADR-0063).
|
|
118
118
|
|
|
119
119
|
### CADD modes
|
|
120
120
|
|
|
@@ -125,7 +125,7 @@ CADD ranks how deleterious any single-nucleotide variant is using 100+ annotatio
|
|
|
125
125
|
Two modes:
|
|
126
126
|
|
|
127
127
|
- **Cache mode** (default): pre-built ~5.8 GB SQLite cache (~120M GRCh38 variant keys). Covers nearly every GRCh38 position allelix can annotate from its other databases (gnomAD, AlphaMissense, ClinVar). GRCh37 input is scored only after translation through the rsID identity table; GRCh36 input never is.
|
|
128
|
-
- **Full mode** (`options.cadd_full = true`): tabix queries against the complete CADD v1.7 file via pysam (GRCh38 only). It scores variants the cache lacks, such as novel or private variants in WGS/WES data. CADD adds scores to findings from the other sources; it never makes a finding of its own, so a variant no other source reports gains nothing. Requires `pip install allelix[cadd]` for the pysam dependency, and CADD's files, downloaded separately from [cadd.gs.washington.edu/download](https://cadd.gs.washington.edu/download) (`db update --cadd`
|
|
128
|
+
- **Full mode** (`options.cadd_full = true`): tabix queries against the complete CADD v1.7 file via pysam (GRCh38 only). It scores variants the cache lacks, such as novel or private variants in WGS/WES data. CADD adds scores to findings from the other sources; it never makes a finding of its own, so a variant no other source reports gains nothing. Requires `pip install allelix[cadd]` for the pysam dependency, and CADD's files, downloaded separately from [cadd.gs.washington.edu/download](https://cadd.gs.washington.edu/download) (`db update --cadd` cannot fetch them, and in full mode downloads nothing, since full mode never reads the SQLite cache; until both files are in place and readable, `db update --cadd` names the one it cannot use and fails, and `analyze` runs without CADD): `whole_genome_SNVs.tsv.gz` (about 81 GB) and its `.tbi` index in the data directory, plus, optionally for indels, `gnomad.genomes.r4.0.indel.tsv.gz` (about 1.2 GB) and its `.tbi`.
|
|
129
129
|
|
|
130
130
|
If your input is a genotyping chip file, cache mode is normally all you need. GRCh37 chip files are scored through the rsID identity table; GRCh36 files are not scored.
|
|
131
131
|
|
|
@@ -269,12 +269,12 @@ Allelix keeps its caches in `~/.local/share/allelix/`, or `$XDG_DATA_HOME/alleli
|
|
|
269
269
|
└── pharmgkb.sqlite ~6 MB
|
|
270
270
|
```
|
|
271
271
|
|
|
272
|
-
Every cache is written beside its final name under a staging name of its own and moved into place only when complete, so a failed or interrupted update keeps the cache you had, and two updates running at once cannot install each other's files.
|
|
272
|
+
Every cache is written beside its final name under a staging name of its own and moved into place only when complete, so a failed or interrupted update keeps the cache you had, and two updates running at once cannot install each other's files. An update stopped with Ctrl-C, SIGTERM or SIGHUP removes its staging files (hidden `.<name>…` files and directories, which can be several GB) on the way out. One killed outright (SIGKILL, a crash, a power cut) cannot, and no later run removes what it left, since that cannot be told from a running update's files; `db clean` removes them (it removes only names allelix creates, and keeps and lists a staging directory holding a finished cache or an extracted table). It does not reach a ClinVar build's temporary index of `variant_summary`, a `tmp….sqlite` file in the system temp directory (such as `/tmp`), outside the data directory; delete one a killed update left by hand. On Windows a forced end (TerminateProcess, as `taskkill /F` and Task Manager use, and SIGTERM there), closing the console and Ctrl-Break do not run this cleanup either; `db clean` removes what they leave by the same rule. Do not run `db clean` while an update is running in the same data directory, including an `analyze` without `--no-update`, whose refresh can build a cache there: it would remove that update's staging files.
|
|
273
273
|
|
|
274
|
-
**The caches are disposable and re-downloadable.**
|
|
274
|
+
**The caches are disposable and re-downloadable.** Every cache here was fetched or built by `allelix db update` and can be fetched again at any time; the ClinVar build log cannot (below). There's no per-user state in the cache — allelix never writes your genotype files into this directory. `db clean` removes only what allelix created there: the caches, their side files, GWAS's kept table, the ClinVar build log, staging entries and earlier releases' downloads. A directory is removed only when it is one of allelix's staging directories and every entry in it is a name allelix writes there (its downloads, the partial files of a download or of a cache being built, an empty `extracted/`), and a link is removed, not followed; a hidden directory of the same shape that holds anything else (a dated backup like `.clinvar-20261101/`, a finished cache not yet moved into place, an extracted table) is kept and listed, as possibly an interrupted update's leftovers to delete by hand. Everything else stays, and `db clean` lists it: CADD full-mode files (which `db update` cannot fetch), any file or folder you keep there, even one named like a cache. `config.toml` always stays too, and is not listed. Safe to run to reclaim space (or to force a full refresh if you suspect a cache went stale):
|
|
275
275
|
|
|
276
276
|
```bash
|
|
277
|
-
# Reclaim
|
|
277
|
+
# Reclaim the caches' ~19-25 GB, with size report and confirmation prompt
|
|
278
278
|
allelix db clean
|
|
279
279
|
|
|
280
280
|
# Preserve the CADD cache (avoids re-downloading the slowest one, ~5.8 GB)
|
|
@@ -290,7 +290,7 @@ allelix db clean --yes
|
|
|
290
290
|
allelix db update
|
|
291
291
|
```
|
|
292
292
|
|
|
293
|
-
`db clean`
|
|
293
|
+
Because `db clean` removes only names allelix creates, a typo'd `--data-dir ~/Documents` removes nothing from an unrelated tree, even with `--yes`. A cache renamed by hand is not allelix's name, so it is kept. `--force` is still accepted, for scripts written for 2.6.0 and earlier, and has no effect.
|
|
294
294
|
|
|
295
295
|
For scripting and backup integration, `allelix db path` prints the resolved data directory:
|
|
296
296
|
|
|
@@ -419,7 +419,9 @@ are left untouched. Annotated VCF still refuses any existing output at the CLI.
|
|
|
419
419
|
Two outputs of one run must name different files too: `--output` and
|
|
420
420
|
`--vcf-out`, and PLINK's `.bed`, `.bim` and `.fam`, are refused before any work
|
|
421
421
|
when they resolve to one file (another spelling, a symlink, a linked folder or a
|
|
422
|
-
hardlink).
|
|
422
|
+
hardlink). Without `--output-prefix`, `export plink` writes next to the input
|
|
423
|
+
under its stem and refuses, before any work, a `.bed`, `.bim` or `.fam` that
|
|
424
|
+
already exists there, so an unrelated `genome.bed` is never replaced.
|
|
423
425
|
|
|
424
426
|
Writers use unique temporary files in the destination directory and publish
|
|
425
427
|
only complete, closed content. Failure before publication preserves previous
|
|
@@ -471,9 +473,9 @@ Notable load-bearing ADRs:
|
|
|
471
473
|
- **ADR-0048: Caches are read-only at analyze time.** With `--no-update`, `analyze` writes nothing to the data directory; every cache opens read-only, installs in rollback-journal mode, and a skipped source is named with its reason (missing, outdated, unreadable, damaged, or WAL mode from an older Allelix). Local migrations run in the update step.
|
|
472
474
|
- **ADR-0049: Every report names its sources.** JSON `sources` gives every registered source's part in the run (used, ready but not used, or skipped with a reason); `report_warnings` carries report-level warnings, starting with ClinVar not used; the annotated VCF names skipped sources.
|
|
473
475
|
- **ADR-0050: Zygosity codes and haploid calls.** JSON zygosity and plausibility are codes, a call the file declares haploid is shown as hemizygous, "not assessed" carries a reason, and three rare homozygous P/LP calls give a report warning.
|
|
474
|
-
- **ADR-0051: Array calls ClinVar cannot match are counted.** Vendor probes at P/LP loci
|
|
476
|
+
- **ADR-0051: Array calls ClinVar cannot match are counted.** Vendor probes at P/LP loci, `D`/`I` calls and (since 2.6.1) chip calls naming a base their own rsID's known alleles do not include, or whose rsID's alleles no source knows, are counted in the report; since 2.5.2, a `D`/`I` call at a high-value or P/LP rsID is also named as not checked (JSON `high_value_unchecked` and `report_warnings` code `di_calls_not_checked`), and panel coverage puts each requested rsID in one of four states. Since 2.6.1, every such call at a high-value or P/LP site is named, not only counted, whatever the reason: a `D`/`I` call (also at a vendor probe), a base call at a vendor probe without an rsID, an unplaced rsID-list row, an identity locus conflict or a foreign-allele chip call (JSON `high_value_unchecked` reasons `di_call`, `vendor_probe`, `unplaced`, `identity_locus_conflict`, `foreign_alleles`, `unknown_alleles`). Each says what ClinVar did not check; it claims nothing about the sources that look a call up by rsID.
|
|
475
477
|
- **ADR-0052: Zero-star P/LP on a common allele.** A ClinVar P/LP row without assertion criteria whose allele has a gnomAD frequency of 5% or more is scored down, marked and counted.
|
|
476
|
-
- **ADR-0070: A chip D/I call is interpreted by no source.** A `D` or `I` code does not say which indel was called, so ClinVar, SNPedia, the GWAS Catalog and ClinPGx skip it; it is counted, and named at high-value and P/LP rsIDs as not checked.
|
|
478
|
+
- **ADR-0070: A chip D/I call is interpreted by no source.** A `D` or `I` code does not say which indel was called, so ClinVar, SNPedia, the GWAS Catalog and ClinPGx skip it; it is counted, and named at high-value and P/LP rsIDs as not checked. Since 2.6.1, SNPedia reads 23andMe's own `i`-probe page for a D/I call in a file the 23andMe parser read.
|
|
477
479
|
|
|
478
480
|
Release history: see [`CHANGELOG.md`](https://github.com/allelix/allelix/blob/main/CHANGELOG.md).
|
|
479
481
|
|
|
@@ -59,6 +59,16 @@ BOTH_FIT = STRAND_BOTH_FIT
|
|
|
59
59
|
NO_FIT = STRAND_NO_FIT
|
|
60
60
|
UNPLACED_REASONS = (NOT_AN_RSID, NOT_IN_TABLE, PALINDROMIC, BOTH_FIT, NO_FIT, DI_CALL)
|
|
61
61
|
|
|
62
|
+
# Why a row of a position-less file stayed unplaced, in report words (ADR-0069).
|
|
63
|
+
UNPLACED_WORDS = {
|
|
64
|
+
"not_an_rsid": "no rsID",
|
|
65
|
+
"not_in_table": "rsID not placed once on GRCh38 in the identity table",
|
|
66
|
+
"palindromic": "A/T or C/G site (strand cannot be told)",
|
|
67
|
+
"both_fit": "call fits both strands at the site",
|
|
68
|
+
"no_fit": "call fits neither strand at the site",
|
|
69
|
+
"di_call": "D/I call",
|
|
70
|
+
}
|
|
71
|
+
|
|
62
72
|
|
|
63
73
|
@dataclass
|
|
64
74
|
class PlacementStats:
|
|
@@ -69,6 +79,10 @@ class PlacementStats:
|
|
|
69
79
|
placed: int = 0
|
|
70
80
|
complemented: int = 0
|
|
71
81
|
unplaced: dict[str, int] = field(default_factory=lambda: dict.fromkeys(UNPLACED_REASONS, 0))
|
|
82
|
+
# Each unplaced row with an rsID: rsID -> (call as written, reason), so
|
|
83
|
+
# the report can name the ones at high-value or P/LP rsIDs. Not in
|
|
84
|
+
# ``to_dict``; one entry per rsID.
|
|
85
|
+
unplaced_rows: dict[str, tuple[str, str]] = field(default_factory=dict)
|
|
72
86
|
|
|
73
87
|
@property
|
|
74
88
|
def unplaced_total(self) -> int:
|
|
@@ -118,6 +132,8 @@ def _place_chunk(
|
|
|
118
132
|
placed, reason = _place(variant, sites.get(variant.rsid))
|
|
119
133
|
if placed is None:
|
|
120
134
|
stats.unplaced[reason] += 1
|
|
135
|
+
if reason != NOT_AN_RSID:
|
|
136
|
+
stats.unplaced_rows.setdefault(variant.rsid, (variant.genotype, reason))
|
|
121
137
|
yield variant
|
|
122
138
|
continue
|
|
123
139
|
stats.placed += 1
|
|
@@ -219,6 +219,12 @@ def _populate_ref_from_identity(identity: RsidIdentityAnnotator, variants: list[
|
|
|
219
219
|
Such a call keeps ``ref`` None, and ClinVar matches it by locus only
|
|
220
220
|
when ClinVar holds its rsID.
|
|
221
221
|
|
|
222
|
+
The alleles of those rows that are SNVs (REF and ALT one base each) are
|
|
223
|
+
added to the call's ``allele_evidence``; an indel row's
|
|
224
|
+
one-base side says nothing about SNV alleles. ClinVar uses that evidence,
|
|
225
|
+
with its own rows of the rsID, to decide whether another rsID's row at
|
|
226
|
+
the locus may match the call. REF is filled as before.
|
|
227
|
+
|
|
222
228
|
A call without an rsID (array vendor probes such as 23andMe
|
|
223
229
|
``i5000123``) never gets a REF from position alone. The REF at a locus
|
|
224
230
|
says nothing about which strand the vendor reported the probe's alleles
|
|
@@ -240,13 +246,26 @@ def _populate_ref_from_identity(identity: RsidIdentityAnnotator, variants: list[
|
|
|
240
246
|
group = [v for v in pending if v.build == build]
|
|
241
247
|
rows_at = identity.alleles_at_loci(build, {variant_locus(v) for v in group})
|
|
242
248
|
for v in group:
|
|
243
|
-
|
|
249
|
+
own = [
|
|
250
|
+
(ref, alt)
|
|
251
|
+
for ref, alt, rsid in rows_at.get(variant_locus(v), [])
|
|
252
|
+
if rsid == v.rsid
|
|
253
|
+
]
|
|
254
|
+
refs = {ref for ref, _alt in own}
|
|
244
255
|
if len(v.allele1) <= 1 and len(v.allele2) <= 1:
|
|
245
256
|
refs = {r for r in refs if len(r) == 1}
|
|
257
|
+
v.allele_evidence = (v.allele_evidence or frozenset()) | _snv_alleles(own)
|
|
246
258
|
if len(refs) == 1:
|
|
247
259
|
v.ref = next(iter(refs))
|
|
248
260
|
|
|
249
261
|
|
|
262
|
+
def _snv_alleles(rows: Iterable[tuple[str, str]]) -> frozenset[str]:
|
|
263
|
+
"""The bases of the (REF, ALT) rows that are SNVs; an indel row is no evidence."""
|
|
264
|
+
return frozenset(
|
|
265
|
+
a.upper() for ref, alt in rows if len(ref) == 1 and len(alt) == 1 for a in (ref, alt)
|
|
266
|
+
)
|
|
267
|
+
|
|
268
|
+
|
|
250
269
|
def _resolve_from_identity(
|
|
251
270
|
identity: RsidIdentityAnnotator, variants: list[Variant], coords: ResolvedCoords
|
|
252
271
|
) -> None:
|
|
@@ -320,8 +339,10 @@ def _populate_ref_from_gnomad(gnomad: GnomadAnnotator, variants: list[Variant])
|
|
|
320
339
|
"""GRCh38 ``Variant.ref`` fallback from gnomAD's rsID coordinates.
|
|
321
340
|
|
|
322
341
|
Accepted only when the coordinate is the variant's own locus and its
|
|
323
|
-
REF is unique there.
|
|
324
|
-
|
|
342
|
+
REF is unique there. gnomAD's SNV alleles of the rsID at the locus are
|
|
343
|
+
added to ``allele_evidence``, after the identity step. Variants
|
|
344
|
+
no source covers keep ``ref=None`` and degrade gracefully (direct match,
|
|
345
|
+
no strand flip).
|
|
325
346
|
"""
|
|
326
347
|
need_ref = {
|
|
327
348
|
v.rsid
|
|
@@ -334,10 +355,14 @@ def _populate_ref_from_gnomad(gnomad: GnomadAnnotator, variants: list[Variant])
|
|
|
334
355
|
for v in variants:
|
|
335
356
|
if v.build != BUILD_GRCH38 or v.ref is not None:
|
|
336
357
|
continue
|
|
337
|
-
|
|
338
|
-
ref
|
|
339
|
-
for chrom, pos, ref,
|
|
358
|
+
here = [
|
|
359
|
+
(ref, alt)
|
|
360
|
+
for chrom, pos, ref, alt in coord_map.get(v.rsid, [])
|
|
340
361
|
if (chrom, pos) == variant_locus(v)
|
|
341
|
-
|
|
362
|
+
]
|
|
363
|
+
# gnomAD's rows of the call's own rsID are allele evidence too.
|
|
364
|
+
if len(v.allele1) <= 1 and len(v.allele2) <= 1:
|
|
365
|
+
v.allele_evidence = (v.allele_evidence or frozenset()) | _snv_alleles(here)
|
|
366
|
+
refs = {ref for ref, _alt in here}
|
|
342
367
|
if len(refs) == 1:
|
|
343
368
|
v.ref = refs.pop()
|
|
@@ -290,6 +290,15 @@ class Annotator(ABC):
|
|
|
290
290
|
db_path: Path | None = getattr(self, "_db_path", None)
|
|
291
291
|
return (db_path,) if db_path is not None else ()
|
|
292
292
|
|
|
293
|
+
def update_supplies_backend(self) -> bool:
|
|
294
|
+
"""Whether ``setup()`` installs what this source reads (2.6.1).
|
|
295
|
+
|
|
296
|
+
True for every source that downloads its cache. CADD full mode reads
|
|
297
|
+
files the user places in the data directory, so `db update` has
|
|
298
|
+
nothing to install for it.
|
|
299
|
+
"""
|
|
300
|
+
return self.requires_download
|
|
301
|
+
|
|
293
302
|
def prepare_cache(self) -> bool:
|
|
294
303
|
"""Bring an outdated cache up to date from local data only (ADR-0048).
|
|
295
304
|
|
|
@@ -58,6 +58,12 @@ _BULK_BATCH_SIZE = 900
|
|
|
58
58
|
|
|
59
59
|
CADD_FULL_FILENAME = "whole_genome_SNVs.tsv.gz"
|
|
60
60
|
CADD_INDEL_FILENAME = "gnomad.genomes.r4.0.indel.tsv.gz"
|
|
61
|
+
_FULL_MODE_REMEDY = (
|
|
62
|
+
f"CADD full mode reads {CADD_FULL_FILENAME} and its .tbi index from the data "
|
|
63
|
+
"directory: download them from https://cadd.gs.washington.edu/download "
|
|
64
|
+
"(`allelix db update` cannot fetch them), or switch full mode off with "
|
|
65
|
+
"`allelix config set options.cadd_full false` to use the cache."
|
|
66
|
+
)
|
|
61
67
|
|
|
62
68
|
|
|
63
69
|
class CaddAnnotator(Annotator):
|
|
@@ -170,13 +176,17 @@ class CaddAnnotator(Annotator):
|
|
|
170
176
|
"""
|
|
171
177
|
return self.cache_status().ready
|
|
172
178
|
|
|
179
|
+
def update_supplies_backend(self) -> bool:
|
|
180
|
+
"""False in full mode: it reads CADD's own files, which `db update` cannot fetch."""
|
|
181
|
+
return not self._full_mode
|
|
182
|
+
|
|
173
183
|
def cache_status(self) -> CacheStatus:
|
|
174
184
|
"""State of the active backend: the tabix pair, or the SQLite cache (ADR-0048)."""
|
|
175
185
|
if self._full_mode:
|
|
176
186
|
tbi = self._tabix_path.parent / (CADD_FULL_FILENAME + ".tbi")
|
|
177
187
|
for path in (self._tabix_path, tbi):
|
|
178
188
|
if not path.exists():
|
|
179
|
-
return CacheStatus(CacheState.MISSING, path)
|
|
189
|
+
return CacheStatus(CacheState.MISSING, path, remedy=_FULL_MODE_REMEDY)
|
|
180
190
|
if not os.access(path, os.R_OK):
|
|
181
191
|
return CacheStatus(CacheState.UNREADABLE, path)
|
|
182
192
|
return READY
|