allelix 2.6.0__tar.gz → 2.6.2__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.
Files changed (95) hide show
  1. {allelix-2.6.0/allelix.egg-info → allelix-2.6.2}/PKG-INFO +18 -16
  2. {allelix-2.6.0 → allelix-2.6.2}/README.md +17 -15
  3. {allelix-2.6.0 → allelix-2.6.2}/allelix/annotators/_placement.py +16 -0
  4. {allelix-2.6.0 → allelix-2.6.2}/allelix/annotators/_resolution.py +32 -7
  5. {allelix-2.6.0 → allelix-2.6.2}/allelix/annotators/base.py +9 -0
  6. {allelix-2.6.0 → allelix-2.6.2}/allelix/annotators/cadd.py +11 -1
  7. {allelix-2.6.0 → allelix-2.6.2}/allelix/annotators/clinvar.py +498 -32
  8. {allelix-2.6.0 → allelix-2.6.2}/allelix/annotators/pharmgkb.py +4 -3
  9. {allelix-2.6.0 → allelix-2.6.2}/allelix/annotators/reference_fallback.py +5 -0
  10. {allelix-2.6.0 → allelix-2.6.2}/allelix/annotators/snpedia.py +92 -51
  11. allelix-2.6.2/allelix/cli/__init__.py +169 -0
  12. {allelix-2.6.0 → allelix-2.6.2}/allelix/cli/_helpers.py +125 -45
  13. {allelix-2.6.0 → allelix-2.6.2}/allelix/cli/_options.py +14 -0
  14. {allelix-2.6.0 → allelix-2.6.2}/allelix/cli/analyze.py +4 -0
  15. {allelix-2.6.0 → allelix-2.6.2}/allelix/cli/config.py +8 -7
  16. {allelix-2.6.0 → allelix-2.6.2}/allelix/cli/db.py +301 -112
  17. {allelix-2.6.0 → allelix-2.6.2}/allelix/cli/focused.py +7 -0
  18. {allelix-2.6.0 → allelix-2.6.2}/allelix/cli/utility.py +41 -24
  19. {allelix-2.6.0 → allelix-2.6.2}/allelix/compare.py +9 -3
  20. {allelix-2.6.0 → allelix-2.6.2}/allelix/databases/cache_state.py +6 -1
  21. {allelix-2.6.0 → allelix-2.6.2}/allelix/databases/cpic_loader.py +77 -4
  22. {allelix-2.6.0 → allelix-2.6.2}/allelix/databases/loader_utils.py +90 -3
  23. {allelix-2.6.0 → allelix-2.6.2}/allelix/databases/manager.py +19 -6
  24. {allelix-2.6.0 → allelix-2.6.2}/allelix/databases/staging.py +27 -3
  25. {allelix-2.6.0 → allelix-2.6.2}/allelix/exporters/plink.py +29 -6
  26. {allelix-2.6.0 → allelix-2.6.2}/allelix/models.py +21 -0
  27. {allelix-2.6.0 → allelix-2.6.2}/allelix/reports/__init__.py +23 -13
  28. {allelix-2.6.0 → allelix-2.6.2}/allelix/reports/_pipeline.py +174 -0
  29. {allelix-2.6.0 → allelix-2.6.2}/allelix/reports/diff.py +62 -2
  30. allelix-2.6.2/allelix/reports/high_value.py +491 -0
  31. {allelix-2.6.0 → allelix-2.6.2}/allelix/reports/html.py +96 -65
  32. {allelix-2.6.0 → allelix-2.6.2}/allelix/reports/json_report.py +22 -6
  33. {allelix-2.6.0 → allelix-2.6.2}/allelix/reports/terminal.py +41 -43
  34. {allelix-2.6.0 → allelix-2.6.2}/allelix/reports/vcf.py +22 -1
  35. allelix-2.6.2/allelix/utils/markup.py +30 -0
  36. {allelix-2.6.0 → allelix-2.6.2/allelix.egg-info}/PKG-INFO +18 -16
  37. {allelix-2.6.0 → allelix-2.6.2}/allelix.egg-info/SOURCES.txt +1 -0
  38. {allelix-2.6.0 → allelix-2.6.2}/pyproject.toml +18 -1
  39. allelix-2.6.0/allelix/cli/__init__.py +0 -60
  40. allelix-2.6.0/allelix/reports/high_value.py +0 -268
  41. {allelix-2.6.0 → allelix-2.6.2}/LICENSE +0 -0
  42. {allelix-2.6.0 → allelix-2.6.2}/MANIFEST.in +0 -0
  43. {allelix-2.6.0 → allelix-2.6.2}/allelix/__init__.py +0 -0
  44. {allelix-2.6.0 → allelix-2.6.2}/allelix/annotators/__init__.py +0 -0
  45. {allelix-2.6.0 → allelix-2.6.2}/allelix/annotators/alphamissense.py +0 -0
  46. {allelix-2.6.0 → allelix-2.6.2}/allelix/annotators/gnomad.py +0 -0
  47. {allelix-2.6.0 → allelix-2.6.2}/allelix/annotators/gwas.py +0 -0
  48. {allelix-2.6.0 → allelix-2.6.2}/allelix/annotators/rsid_identity.py +0 -0
  49. {allelix-2.6.0 → allelix-2.6.2}/allelix/attribution.py +0 -0
  50. {allelix-2.6.0 → allelix-2.6.2}/allelix/config.py +0 -0
  51. {allelix-2.6.0 → allelix-2.6.2}/allelix/data/__init__.py +0 -0
  52. {allelix-2.6.0 → allelix-2.6.2}/allelix/data/clinvar_clnsig_snapshot.yaml +0 -0
  53. {allelix-2.6.0 → allelix-2.6.2}/allelix/data/high_value_snps.yaml +0 -0
  54. {allelix-2.6.0 → allelix-2.6.2}/allelix/databases/__init__.py +0 -0
  55. {allelix-2.6.0 → allelix-2.6.2}/allelix/databases/_versions.py +0 -0
  56. {allelix-2.6.0 → allelix-2.6.2}/allelix/databases/alphamissense_loader.py +0 -0
  57. {allelix-2.6.0 → allelix-2.6.2}/allelix/databases/cadd_loader.py +0 -0
  58. {allelix-2.6.0 → allelix-2.6.2}/allelix/databases/gnomad_loader.py +0 -0
  59. {allelix-2.6.0 → allelix-2.6.2}/allelix/databases/gwas_loader.py +0 -0
  60. {allelix-2.6.0 → allelix-2.6.2}/allelix/databases/pharmgkb_loader.py +0 -0
  61. {allelix-2.6.0 → allelix-2.6.2}/allelix/databases/rsid_identity_loader.py +0 -0
  62. {allelix-2.6.0 → allelix-2.6.2}/allelix/databases/schema.py +0 -0
  63. {allelix-2.6.0 → allelix-2.6.2}/allelix/databases/snpedia_loader.py +0 -0
  64. {allelix-2.6.0 → allelix-2.6.2}/allelix/databases/snpedia_parser.py +0 -0
  65. {allelix-2.6.0 → allelix-2.6.2}/allelix/exporters/__init__.py +0 -0
  66. {allelix-2.6.0 → allelix-2.6.2}/allelix/parsers/__init__.py +0 -0
  67. {allelix-2.6.0 → allelix-2.6.2}/allelix/parsers/_helpers.py +0 -0
  68. {allelix-2.6.0 → allelix-2.6.2}/allelix/parsers/ancestrydna.py +0 -0
  69. {allelix-2.6.0 → allelix-2.6.2}/allelix/parsers/base.py +0 -0
  70. {allelix-2.6.0 → allelix-2.6.2}/allelix/parsers/decodeme.py +0 -0
  71. {allelix-2.6.0 → allelix-2.6.2}/allelix/parsers/ftdna.py +0 -0
  72. {allelix-2.6.0 → allelix-2.6.2}/allelix/parsers/ftdna_famfinder.py +0 -0
  73. {allelix-2.6.0 → allelix-2.6.2}/allelix/parsers/ftdna_illumina.py +0 -0
  74. {allelix-2.6.0 → allelix-2.6.2}/allelix/parsers/genesforgood.py +0 -0
  75. {allelix-2.6.0 → allelix-2.6.2}/allelix/parsers/livingdna.py +0 -0
  76. {allelix-2.6.0 → allelix-2.6.2}/allelix/parsers/myhappygenes.py +0 -0
  77. {allelix-2.6.0 → allelix-2.6.2}/allelix/parsers/myheritage.py +0 -0
  78. {allelix-2.6.0 → allelix-2.6.2}/allelix/parsers/rsidlist.py +0 -0
  79. {allelix-2.6.0 → allelix-2.6.2}/allelix/parsers/twentythreeandme.py +0 -0
  80. {allelix-2.6.0 → allelix-2.6.2}/allelix/parsers/vcf.py +0 -0
  81. {allelix-2.6.0 → allelix-2.6.2}/allelix/py.typed +0 -0
  82. {allelix-2.6.0 → allelix-2.6.2}/allelix/reports/_sources.py +0 -0
  83. {allelix-2.6.0 → allelix-2.6.2}/allelix/reports/association_text.py +0 -0
  84. {allelix-2.6.0 → allelix-2.6.2}/allelix/reports/build_text.py +0 -0
  85. {allelix-2.6.0 → allelix-2.6.2}/allelix/reports/clinvar_text.py +0 -0
  86. {allelix-2.6.0 → allelix-2.6.2}/allelix/reports/methylation.py +0 -0
  87. {allelix-2.6.0 → allelix-2.6.2}/allelix/utils/__init__.py +0 -0
  88. {allelix-2.6.0 → allelix-2.6.2}/allelix/utils/allele.py +0 -0
  89. {allelix-2.6.0 → allelix-2.6.2}/allelix/utils/build_detect.py +0 -0
  90. {allelix-2.6.0 → allelix-2.6.2}/allelix/utils/plausibility.py +0 -0
  91. {allelix-2.6.0 → allelix-2.6.2}/allelix.egg-info/dependency_links.txt +0 -0
  92. {allelix-2.6.0 → allelix-2.6.2}/allelix.egg-info/entry_points.txt +0 -0
  93. {allelix-2.6.0 → allelix-2.6.2}/allelix.egg-info/requires.txt +0 -0
  94. {allelix-2.6.0 → allelix-2.6.2}/allelix.egg-info/top_level.txt +0 -0
  95. {allelix-2.6.0 → allelix-2.6.2}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: allelix
3
- Version: 2.6.0
3
+ Version: 2.6.2
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) in JSON, and in HTML and on the console where the rsID is high-value; since 2.6.2 the console and HTML give the others as one count, and `--show-unchecked` lists them. 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,28 +144,28 @@ 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, and `D`/`I` calls (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). |
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 (in JSON; since 2.6.2 the console and HTML name those at high-value rsIDs and count the rest); 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`. |
151
151
  | GWAS Catalog | ✓ | Public domain (EBI/NHGRI). Trait–SNP associations with p-values and effect sizes. Carrier rule (ADR-0007) requires the user to carry the risk allele. The reported allele is the study's effect (risk) allele, which can be the reference allele (ADR-0039). P-value magnitude scoring maps continuous p-values to the 0–10 scale; only a confidence-interval field that positively identifies a bare odds ratio receives the odds-ratio modifier. Beta coefficients and ambiguous or unit-bearing effects receive no modifier (ADR-0038). Unknown-risk-allele entries fire on rsID match alone but are capped at 3.0. Risk alleles are read on the forward strand against the site's alleles in the rsID identity table. A risk allele is read as written when only that fits and complemented when only the complement fits. It abstains when both fit (an A/T or C/G site, or a site with more alleles), when neither fits, or when the table does not place the rsID at the call, and the report counts each abstention (ADR-0066). Every row says whether the effect allele raises or lowers the odds or the measured value (JSON `effect_direction`). GWAS rows must meet the larger of `--min-magnitude` and `--gwas-min-magnitude` (default 9.0); the must-include rsIDs skip the GWAS floor (ADR-0024). |
152
152
  | gnomAD | ✓ | ODbL v1.0. **GRCh38-only enrichment annotator** — adds population allele frequency context to existing annotations. Shows how common each variant is in the general population (~57M exome variants with an rsID, from 730K individuals). A pathogenic variant that 35% of people carry reads very differently from one seen in 0.001%. Pre-built cache downloaded via `db update` (~7 GB on disk). GRCh37 input is enriched only through the rsID identity table's explicit allele translation (ADR-0040); gnomAD's own rsID resolution stays GRCh38-only, and GRCh36 input receives nothing. `--no-gnomad` switches it off for the run (see below). |
153
153
  | AlphaMissense | ✓ | CC BY 4.0. **GRCh38-only enrichment annotator** — adds DeepMind's protein-structure-based pathogenicity predictions to existing annotations. Scores 71M missense variants on a 0–1 scale: <0.34 = likely benign, >0.564 = likely pathogenic. Complements ClinVar's expert classifications with computational predictions — especially valuable for variants ClinVar hasn't reviewed yet. Pre-built cache downloaded via `db update` (~8GB on disk). GRCh37 input is enriched only through the rsID identity table (ADR-0040); GRCh36 input receives nothing. Use `--no-alphamissense` to skip. |
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. |
154
+ | CADD | ✓ | LicenseRef-CADD (non-commercial). **GRCh38-only enrichment annotator** — adds PHRED-scaled predicted 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`. Indels and chip `D`/`I` calls are not checked this way, and an rsID the table does not place is not affected (ADR-0063).
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
 
161
- CADD ranks how deleterious any single-nucleotide variant is using 100+ annotation tracks (coding, non-coding, regulatory). PHRED 10 = top 10% most deleterious, 20 = top 1%, 30 = top 0.1%.
161
+ CADD ranks how deleterious any single-nucleotide variant is predicted to be, using 100+ annotation tracks (coding, non-coding, regulatory). PHRED 10 = top 10% predicted deleterious, 20 = top 1%, 30 = top 0.1%. CADD predicts how disruptive a change is, not whether its effect is good or bad for you: ClinVar and the other sources say that, and a protective variant can score high.
162
162
 
163
163
  **Opt-in**: download the cache with `allelix db update --cadd`, then enable it with `allelix config set sources.cadd true`. Downloading the cache alone does not change persistent configuration. Use `--no-cadd` to skip enrichment for a single run when it is enabled in config.
164
164
 
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` installs only the SQLite cache): `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`.
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
 
@@ -266,7 +266,7 @@ Genotyping arrays sometimes miscall very rare variants, most visibly as a homozy
266
266
  | Heterozygous | at or below `plausibility.heterozygous_max_af` (default 0: gnomAD has the site but no carriers) | **suspicious** |
267
267
  | Either | otherwise | plausible |
268
268
 
269
- The HTML report shows a ⚠ icon next to a flagged genotype, with the reason on hover and in the detail panel, and a muted ○ with the reason when the call was not assessed. The terminal table marks implausible calls with ⚠, suspicious ones with ? and not-assessed ones with ○. JSON reports carry `plausibility` on every annotation (`plausible`, `suspicious`, `implausible` or `not_assessed`) and, when not assessed, `plausibility_reason` (`no_frequency`, `gnomad_not_run`, `chromosome`, `half_call` or `no_allele`; ADR-0050).
269
+ ⚠ means the call looks doubtful because the variant's frequency in gnomAD is at or under Allelix's limit for that call (under it for two copies): with the default limits in the table, two copies of an allele below 0.01%, or one copy of an allele that gnomAD lists with no carriers. A call this rare can be a genotyping or sequencing error; confirm it before relying on it. Allelix can only check variants with population counts in gnomAD, so no ⚠ is not a guarantee. The HTML report shows ⚠ next to a flagged genotype, with the reason on hover and in the detail panel. The terminal table marks implausible calls with ⚠ and suspicious ones with ?. A call that was not assessed gets no mark in either. JSON reports carry `plausibility` on every annotation (`plausible`, `suspicious`, `implausible` or `not_assessed`) and, when not assessed, `plausibility_reason` (`no_frequency`, `gnomad_not_run`, `chromosome`, `half_call` or `no_allele`; ADR-0050).
270
270
 
271
271
  A call is not assessed when gnomAD has no frequency for the allele. Allelix's gnomAD cache covers exome sites with an rsID, so a missing value says nothing about rarity. Calls are also not assessed when the gnomAD database is skipped. Homozygous calls on X are not assessed because a male's single X reads as homozygous; heterozygous X calls are. A call the file itself declares as one copy (a one-letter array call such as 23andMe's male X calls, or a one-index VCF genotype) is shown as Hemizygous and assessed as one copy. Y and mitochondrial calls are not assessed. When records at one position disagree on ploidy (one copy in one record, two in another), each finding keeps its own record's genotype and zygosity, and the report counts them in a warning, `contradictory_calls` (ADR-0062). Confirm a flagged call with a clinical-grade test before relying on it.
272
272
 
@@ -284,7 +284,7 @@ Not all databases are equal in size. `allelix db update` downloads them all by d
284
284
  | gnomAD | ~7 GB | 5–15 min | Population allele frequencies (how common is this variant?). |
285
285
  | AlphaMissense | ~8GB | 5–15 min | Missense pathogenicity predictions (how likely to break protein function?). |
286
286
  | dbSNP rsID identity | ~460 MB | ~1 min | Cross-build placements: reference allele for array data, rsID recovery on both builds, GRCh37 enrichment translation. |
287
- | CADD (opt-in) | ~6 GB | 5–15 min | Variant deleteriousness scores (how damaging is this variant?). Download with `db update --cadd`; enable in config. |
287
+ | CADD (opt-in) | ~6 GB | 5–15 min | Predicted variant deleteriousness scores (how disruptive a change is predicted to be, not whether it is good or bad for you). Download with `db update --cadd`; enable in config. |
288
288
 
289
289
  gnomAD and AlphaMissense are the largest but add the most interpretive context. gnomAD answers "is this variant rare or common?" — a pathogenic variant carried by 35% of the population reads very differently from one seen in 3 people. AlphaMissense answers "does this missense change likely damage the protein?" — especially valuable for the thousands of variants ClinVar hasn't reviewed yet.
290
290
 
@@ -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. A staging file left by a killed process (a hidden `.<name>…` file or directory) is never removed by another run; `db clean` removes it (with `--force` when no finished cache is left beside it, since `db clean` otherwise refuses a directory it does not recognise).
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.** Everything here was fetched by `allelix db update` and can be re-fetched at any time. There's no per-user state in the cache — your genotype files never enter this directory. Safe to delete to reclaim space (or to force a full refresh if you suspect a cache went stale):
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 all ~19-25 GB, with size report and confirmation prompt
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` refuses to act on a directory that doesn't contain any recognized allelix cache files — a typo'd `--data-dir ~/Documents` won't result in `rm -rf` against an unrelated tree, even with `--yes`. Pass `--force` if you've staged caches under a non-standard name and want to delete them anyway.
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 and `D`/`I` calls 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.
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. Since 2.6.2 the console and HTML name only the high-value sites and the non-`D`/`I` calls at rsIDs ClinVar itself classifies P/LP, and count the rest by kind; `--show-unchecked` lists every site on the console, HTML keeps them in a collapsed section, and JSON lists them all.
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.2 the console and HTML name only those at high-value rsIDs, and count the rest). 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) in JSON, and in HTML and on the console where the rsID is high-value; since 2.6.2 the console and HTML give the others as one count, and `--show-unchecked` lists them. 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,28 +104,28 @@ 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, and `D`/`I` calls (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). |
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 (in JSON; since 2.6.2 the console and HTML name those at high-value rsIDs and count the rest); 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`. |
111
111
  | GWAS Catalog | ✓ | Public domain (EBI/NHGRI). Trait–SNP associations with p-values and effect sizes. Carrier rule (ADR-0007) requires the user to carry the risk allele. The reported allele is the study's effect (risk) allele, which can be the reference allele (ADR-0039). P-value magnitude scoring maps continuous p-values to the 0–10 scale; only a confidence-interval field that positively identifies a bare odds ratio receives the odds-ratio modifier. Beta coefficients and ambiguous or unit-bearing effects receive no modifier (ADR-0038). Unknown-risk-allele entries fire on rsID match alone but are capped at 3.0. Risk alleles are read on the forward strand against the site's alleles in the rsID identity table. A risk allele is read as written when only that fits and complemented when only the complement fits. It abstains when both fit (an A/T or C/G site, or a site with more alleles), when neither fits, or when the table does not place the rsID at the call, and the report counts each abstention (ADR-0066). Every row says whether the effect allele raises or lowers the odds or the measured value (JSON `effect_direction`). GWAS rows must meet the larger of `--min-magnitude` and `--gwas-min-magnitude` (default 9.0); the must-include rsIDs skip the GWAS floor (ADR-0024). |
112
112
  | gnomAD | ✓ | ODbL v1.0. **GRCh38-only enrichment annotator** — adds population allele frequency context to existing annotations. Shows how common each variant is in the general population (~57M exome variants with an rsID, from 730K individuals). A pathogenic variant that 35% of people carry reads very differently from one seen in 0.001%. Pre-built cache downloaded via `db update` (~7 GB on disk). GRCh37 input is enriched only through the rsID identity table's explicit allele translation (ADR-0040); gnomAD's own rsID resolution stays GRCh38-only, and GRCh36 input receives nothing. `--no-gnomad` switches it off for the run (see below). |
113
113
  | AlphaMissense | ✓ | CC BY 4.0. **GRCh38-only enrichment annotator** — adds DeepMind's protein-structure-based pathogenicity predictions to existing annotations. Scores 71M missense variants on a 0–1 scale: <0.34 = likely benign, >0.564 = likely pathogenic. Complements ClinVar's expert classifications with computational predictions — especially valuable for variants ClinVar hasn't reviewed yet. Pre-built cache downloaded via `db update` (~8GB on disk). GRCh37 input is enriched only through the rsID identity table (ADR-0040); GRCh36 input receives nothing. Use `--no-alphamissense` to skip. |
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. |
114
+ | CADD | ✓ | LicenseRef-CADD (non-commercial). **GRCh38-only enrichment annotator** — adds PHRED-scaled predicted 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`. Indels and chip `D`/`I` calls are not checked this way, and an rsID the table does not place is not affected (ADR-0063).
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
 
121
- CADD ranks how deleterious any single-nucleotide variant is using 100+ annotation tracks (coding, non-coding, regulatory). PHRED 10 = top 10% most deleterious, 20 = top 1%, 30 = top 0.1%.
121
+ CADD ranks how deleterious any single-nucleotide variant is predicted to be, using 100+ annotation tracks (coding, non-coding, regulatory). PHRED 10 = top 10% predicted deleterious, 20 = top 1%, 30 = top 0.1%. CADD predicts how disruptive a change is, not whether its effect is good or bad for you: ClinVar and the other sources say that, and a protective variant can score high.
122
122
 
123
123
  **Opt-in**: download the cache with `allelix db update --cadd`, then enable it with `allelix config set sources.cadd true`. Downloading the cache alone does not change persistent configuration. Use `--no-cadd` to skip enrichment for a single run when it is enabled in config.
124
124
 
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` installs only the SQLite cache): `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`.
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
 
@@ -226,7 +226,7 @@ Genotyping arrays sometimes miscall very rare variants, most visibly as a homozy
226
226
  | Heterozygous | at or below `plausibility.heterozygous_max_af` (default 0: gnomAD has the site but no carriers) | **suspicious** |
227
227
  | Either | otherwise | plausible |
228
228
 
229
- The HTML report shows a ⚠ icon next to a flagged genotype, with the reason on hover and in the detail panel, and a muted ○ with the reason when the call was not assessed. The terminal table marks implausible calls with ⚠, suspicious ones with ? and not-assessed ones with ○. JSON reports carry `plausibility` on every annotation (`plausible`, `suspicious`, `implausible` or `not_assessed`) and, when not assessed, `plausibility_reason` (`no_frequency`, `gnomad_not_run`, `chromosome`, `half_call` or `no_allele`; ADR-0050).
229
+ ⚠ means the call looks doubtful because the variant's frequency in gnomAD is at or under Allelix's limit for that call (under it for two copies): with the default limits in the table, two copies of an allele below 0.01%, or one copy of an allele that gnomAD lists with no carriers. A call this rare can be a genotyping or sequencing error; confirm it before relying on it. Allelix can only check variants with population counts in gnomAD, so no ⚠ is not a guarantee. The HTML report shows ⚠ next to a flagged genotype, with the reason on hover and in the detail panel. The terminal table marks implausible calls with ⚠ and suspicious ones with ?. A call that was not assessed gets no mark in either. JSON reports carry `plausibility` on every annotation (`plausible`, `suspicious`, `implausible` or `not_assessed`) and, when not assessed, `plausibility_reason` (`no_frequency`, `gnomad_not_run`, `chromosome`, `half_call` or `no_allele`; ADR-0050).
230
230
 
231
231
  A call is not assessed when gnomAD has no frequency for the allele. Allelix's gnomAD cache covers exome sites with an rsID, so a missing value says nothing about rarity. Calls are also not assessed when the gnomAD database is skipped. Homozygous calls on X are not assessed because a male's single X reads as homozygous; heterozygous X calls are. A call the file itself declares as one copy (a one-letter array call such as 23andMe's male X calls, or a one-index VCF genotype) is shown as Hemizygous and assessed as one copy. Y and mitochondrial calls are not assessed. When records at one position disagree on ploidy (one copy in one record, two in another), each finding keeps its own record's genotype and zygosity, and the report counts them in a warning, `contradictory_calls` (ADR-0062). Confirm a flagged call with a clinical-grade test before relying on it.
232
232
 
@@ -244,7 +244,7 @@ Not all databases are equal in size. `allelix db update` downloads them all by d
244
244
  | gnomAD | ~7 GB | 5–15 min | Population allele frequencies (how common is this variant?). |
245
245
  | AlphaMissense | ~8GB | 5–15 min | Missense pathogenicity predictions (how likely to break protein function?). |
246
246
  | dbSNP rsID identity | ~460 MB | ~1 min | Cross-build placements: reference allele for array data, rsID recovery on both builds, GRCh37 enrichment translation. |
247
- | CADD (opt-in) | ~6 GB | 5–15 min | Variant deleteriousness scores (how damaging is this variant?). Download with `db update --cadd`; enable in config. |
247
+ | CADD (opt-in) | ~6 GB | 5–15 min | Predicted variant deleteriousness scores (how disruptive a change is predicted to be, not whether it is good or bad for you). Download with `db update --cadd`; enable in config. |
248
248
 
249
249
  gnomAD and AlphaMissense are the largest but add the most interpretive context. gnomAD answers "is this variant rare or common?" — a pathogenic variant carried by 35% of the population reads very differently from one seen in 3 people. AlphaMissense answers "does this missense change likely damage the protein?" — especially valuable for the thousands of variants ClinVar hasn't reviewed yet.
250
250
 
@@ -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. A staging file left by a killed process (a hidden `.<name>…` file or directory) is never removed by another run; `db clean` removes it (with `--force` when no finished cache is left beside it, since `db clean` otherwise refuses a directory it does not recognise).
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.** Everything here was fetched by `allelix db update` and can be re-fetched at any time. There's no per-user state in the cache — your genotype files never enter this directory. Safe to delete to reclaim space (or to force a full refresh if you suspect a cache went stale):
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 all ~19-25 GB, with size report and confirmation prompt
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` refuses to act on a directory that doesn't contain any recognized allelix cache files — a typo'd `--data-dir ~/Documents` won't result in `rm -rf` against an unrelated tree, even with `--yes`. Pass `--force` if you've staged caches under a non-standard name and want to delete them anyway.
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 and `D`/`I` calls 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.
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. Since 2.6.2 the console and HTML name only the high-value sites and the non-`D`/`I` calls at rsIDs ClinVar itself classifies P/LP, and count the rest by kind; `--show-unchecked` lists every site on the console, HTML keeps them in a collapsed section, and JSON lists them all.
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.2 the console and HTML name only those at high-value rsIDs, and count the rest). 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
- refs = {ref for ref, _alt, rsid in rows_at.get(variant_locus(v), []) if rsid == v.rsid}
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. Variants no source covers keep ``ref=None`` and
324
- degrade gracefully (direct match, no strand flip).
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
- refs = {
338
- ref
339
- for chrom, pos, ref, _alt in coord_map.get(v.rsid, [])
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