allelix 2.6.2__tar.gz → 2.7.0__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 (93) hide show
  1. {allelix-2.6.2/allelix.egg-info → allelix-2.7.0}/PKG-INFO +21 -15
  2. {allelix-2.6.2 → allelix-2.7.0}/README.md +20 -14
  3. {allelix-2.6.2 → allelix-2.7.0}/allelix/annotators/__init__.py +1 -0
  4. {allelix-2.6.2 → allelix-2.7.0}/allelix/annotators/clinvar.py +60 -3
  5. {allelix-2.6.2 → allelix-2.7.0}/allelix/annotators/gwas.py +19 -0
  6. {allelix-2.6.2 → allelix-2.7.0}/allelix/annotators/pharmgkb.py +174 -20
  7. {allelix-2.6.2 → allelix-2.7.0}/allelix/annotators/rsid_identity.py +143 -32
  8. {allelix-2.6.2 → allelix-2.7.0}/allelix/cli/_helpers.py +20 -5
  9. {allelix-2.6.2 → allelix-2.7.0}/allelix/cli/_options.py +6 -4
  10. {allelix-2.6.2 → allelix-2.7.0}/allelix/cli/db.py +31 -0
  11. {allelix-2.6.2 → allelix-2.7.0}/allelix/cli/focused.py +71 -7
  12. {allelix-2.6.2 → allelix-2.7.0}/allelix/cli/utility.py +21 -12
  13. {allelix-2.6.2 → allelix-2.7.0}/allelix/compare.py +4 -2
  14. {allelix-2.6.2 → allelix-2.7.0}/allelix/config.py +2 -1
  15. {allelix-2.6.2 → allelix-2.7.0}/allelix/databases/_versions.py +4 -1
  16. {allelix-2.6.2 → allelix-2.7.0}/allelix/databases/cpic_loader.py +3 -2
  17. {allelix-2.6.2 → allelix-2.7.0}/allelix/databases/gwas_loader.py +96 -8
  18. {allelix-2.6.2 → allelix-2.7.0}/allelix/databases/loader_utils.py +50 -0
  19. {allelix-2.6.2 → allelix-2.7.0}/allelix/databases/manager.py +85 -25
  20. {allelix-2.6.2 → allelix-2.7.0}/allelix/databases/pharmgkb_loader.py +45 -14
  21. {allelix-2.6.2 → allelix-2.7.0}/allelix/databases/rsid_identity_loader.py +2 -3
  22. {allelix-2.6.2 → allelix-2.7.0}/allelix/exporters/plink.py +31 -8
  23. {allelix-2.6.2 → allelix-2.7.0}/allelix/models.py +41 -1
  24. {allelix-2.6.2 → allelix-2.7.0}/allelix/parsers/__init__.py +4 -1
  25. {allelix-2.6.2 → allelix-2.7.0}/allelix/parsers/_helpers.py +42 -0
  26. {allelix-2.6.2 → allelix-2.7.0}/allelix/parsers/ancestrydna.py +1 -0
  27. {allelix-2.6.2 → allelix-2.7.0}/allelix/parsers/decodeme.py +4 -0
  28. {allelix-2.6.2 → allelix-2.7.0}/allelix/parsers/ftdna_famfinder.py +4 -0
  29. {allelix-2.6.2 → allelix-2.7.0}/allelix/parsers/ftdna_illumina.py +4 -0
  30. {allelix-2.6.2 → allelix-2.7.0}/allelix/parsers/vcf.py +258 -9
  31. {allelix-2.6.2 → allelix-2.7.0}/allelix/reports/__init__.py +81 -15
  32. {allelix-2.6.2 → allelix-2.7.0}/allelix/reports/_pipeline.py +143 -16
  33. {allelix-2.6.2 → allelix-2.7.0}/allelix/reports/diff.py +72 -19
  34. {allelix-2.6.2 → allelix-2.7.0}/allelix/reports/high_value.py +10 -0
  35. {allelix-2.6.2 → allelix-2.7.0}/allelix/reports/html.py +99 -14
  36. {allelix-2.6.2 → allelix-2.7.0}/allelix/reports/json_report.py +16 -5
  37. {allelix-2.6.2 → allelix-2.7.0}/allelix/reports/terminal.py +37 -6
  38. {allelix-2.6.2 → allelix-2.7.0}/allelix/reports/vcf.py +70 -4
  39. {allelix-2.6.2 → allelix-2.7.0}/allelix/utils/allele.py +29 -9
  40. {allelix-2.6.2 → allelix-2.7.0}/allelix/utils/build_detect.py +17 -5
  41. {allelix-2.6.2 → allelix-2.7.0/allelix.egg-info}/PKG-INFO +21 -15
  42. {allelix-2.6.2 → allelix-2.7.0}/pyproject.toml +1 -1
  43. {allelix-2.6.2 → allelix-2.7.0}/LICENSE +0 -0
  44. {allelix-2.6.2 → allelix-2.7.0}/MANIFEST.in +0 -0
  45. {allelix-2.6.2 → allelix-2.7.0}/allelix/__init__.py +0 -0
  46. {allelix-2.6.2 → allelix-2.7.0}/allelix/annotators/_placement.py +0 -0
  47. {allelix-2.6.2 → allelix-2.7.0}/allelix/annotators/_resolution.py +0 -0
  48. {allelix-2.6.2 → allelix-2.7.0}/allelix/annotators/alphamissense.py +0 -0
  49. {allelix-2.6.2 → allelix-2.7.0}/allelix/annotators/base.py +0 -0
  50. {allelix-2.6.2 → allelix-2.7.0}/allelix/annotators/cadd.py +0 -0
  51. {allelix-2.6.2 → allelix-2.7.0}/allelix/annotators/gnomad.py +0 -0
  52. {allelix-2.6.2 → allelix-2.7.0}/allelix/annotators/reference_fallback.py +0 -0
  53. {allelix-2.6.2 → allelix-2.7.0}/allelix/annotators/snpedia.py +0 -0
  54. {allelix-2.6.2 → allelix-2.7.0}/allelix/attribution.py +0 -0
  55. {allelix-2.6.2 → allelix-2.7.0}/allelix/cli/__init__.py +0 -0
  56. {allelix-2.6.2 → allelix-2.7.0}/allelix/cli/analyze.py +0 -0
  57. {allelix-2.6.2 → allelix-2.7.0}/allelix/cli/config.py +0 -0
  58. {allelix-2.6.2 → allelix-2.7.0}/allelix/data/__init__.py +0 -0
  59. {allelix-2.6.2 → allelix-2.7.0}/allelix/data/clinvar_clnsig_snapshot.yaml +0 -0
  60. {allelix-2.6.2 → allelix-2.7.0}/allelix/data/high_value_snps.yaml +0 -0
  61. {allelix-2.6.2 → allelix-2.7.0}/allelix/databases/__init__.py +0 -0
  62. {allelix-2.6.2 → allelix-2.7.0}/allelix/databases/alphamissense_loader.py +0 -0
  63. {allelix-2.6.2 → allelix-2.7.0}/allelix/databases/cache_state.py +0 -0
  64. {allelix-2.6.2 → allelix-2.7.0}/allelix/databases/cadd_loader.py +0 -0
  65. {allelix-2.6.2 → allelix-2.7.0}/allelix/databases/gnomad_loader.py +0 -0
  66. {allelix-2.6.2 → allelix-2.7.0}/allelix/databases/schema.py +0 -0
  67. {allelix-2.6.2 → allelix-2.7.0}/allelix/databases/snpedia_loader.py +0 -0
  68. {allelix-2.6.2 → allelix-2.7.0}/allelix/databases/snpedia_parser.py +0 -0
  69. {allelix-2.6.2 → allelix-2.7.0}/allelix/databases/staging.py +0 -0
  70. {allelix-2.6.2 → allelix-2.7.0}/allelix/exporters/__init__.py +0 -0
  71. {allelix-2.6.2 → allelix-2.7.0}/allelix/parsers/base.py +0 -0
  72. {allelix-2.6.2 → allelix-2.7.0}/allelix/parsers/ftdna.py +0 -0
  73. {allelix-2.6.2 → allelix-2.7.0}/allelix/parsers/genesforgood.py +0 -0
  74. {allelix-2.6.2 → allelix-2.7.0}/allelix/parsers/livingdna.py +0 -0
  75. {allelix-2.6.2 → allelix-2.7.0}/allelix/parsers/myhappygenes.py +0 -0
  76. {allelix-2.6.2 → allelix-2.7.0}/allelix/parsers/myheritage.py +0 -0
  77. {allelix-2.6.2 → allelix-2.7.0}/allelix/parsers/rsidlist.py +0 -0
  78. {allelix-2.6.2 → allelix-2.7.0}/allelix/parsers/twentythreeandme.py +0 -0
  79. {allelix-2.6.2 → allelix-2.7.0}/allelix/py.typed +0 -0
  80. {allelix-2.6.2 → allelix-2.7.0}/allelix/reports/_sources.py +0 -0
  81. {allelix-2.6.2 → allelix-2.7.0}/allelix/reports/association_text.py +0 -0
  82. {allelix-2.6.2 → allelix-2.7.0}/allelix/reports/build_text.py +0 -0
  83. {allelix-2.6.2 → allelix-2.7.0}/allelix/reports/clinvar_text.py +0 -0
  84. {allelix-2.6.2 → allelix-2.7.0}/allelix/reports/methylation.py +0 -0
  85. {allelix-2.6.2 → allelix-2.7.0}/allelix/utils/__init__.py +0 -0
  86. {allelix-2.6.2 → allelix-2.7.0}/allelix/utils/markup.py +0 -0
  87. {allelix-2.6.2 → allelix-2.7.0}/allelix/utils/plausibility.py +0 -0
  88. {allelix-2.6.2 → allelix-2.7.0}/allelix.egg-info/SOURCES.txt +0 -0
  89. {allelix-2.6.2 → allelix-2.7.0}/allelix.egg-info/dependency_links.txt +0 -0
  90. {allelix-2.6.2 → allelix-2.7.0}/allelix.egg-info/entry_points.txt +0 -0
  91. {allelix-2.6.2 → allelix-2.7.0}/allelix.egg-info/requires.txt +0 -0
  92. {allelix-2.6.2 → allelix-2.7.0}/allelix.egg-info/top_level.txt +0 -0
  93. {allelix-2.6.2 → allelix-2.7.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: allelix
3
- Version: 2.6.2
3
+ Version: 2.7.0
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>
@@ -56,7 +56,7 @@ Dynamic: license-file
56
56
 
57
57
  # Allelix
58
58
 
59
- > **Status:** Production. Reads twelve file formats, including VCF and gVCF and lists of rsIDs and genotypes. Reports what ClinVar, ClinPGx, the GWAS Catalog and SNPedia say about your variants, with frequencies and scores from gnomAD, AlphaMissense and CADD. It decides the genome build from the file itself and stops rather than guess. HTML, JSON, terminal or annotated VCF. Everything runs on your machine. The [Changelog](https://github.com/allelix/allelix/blob/main/CHANGELOG.md) tracks every release.
59
+ > **Status:** Production. Reads twelve file formats, including VCF and gVCF and lists of rsIDs and genotypes. Reports what ClinVar, ClinPGx, the GWAS Catalog and SNPedia say about your variants, with frequencies and scores from gnomAD, AlphaMissense and CADD. It decides the genome build from the file itself and stops rather than guess. HTML, JSON, terminal or annotated VCF. The analysis runs on your machine, and your genotypes are never sent anywhere. The [Changelog](https://github.com/allelix/allelix/blob/main/CHANGELOG.md) tracks every release.
60
60
 
61
61
  ## Quickstart
62
62
 
@@ -96,7 +96,8 @@ allelix analyze your_genotype_file.txt --filter-file my_panel.txt --output repor
96
96
  # Annotated VCF output — VCF-in / VCF-out for pipeline integration
97
97
  # Writes a valid VCF with annotations as INFO fields + full provenance in the header.
98
98
  # Missing ##contig declarations are synthesized; raw CHROM names are preserved.
99
- # Refuses to overwrite; requires VCF or gVCF input.
99
+ # Refuses to overwrite; requires VCF or gVCF input. Written uncompressed:
100
+ # a .gz or .bgz name is refused (compress afterwards with bgzip).
100
101
  allelix analyze your_wgs.vcf.gz --vcf-out annotated.vcf
101
102
  ```
102
103
 
@@ -147,14 +148,14 @@ Issues and milestones are tracked at [github.com/allelix/allelix/issues](https:/
147
148
  | 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
149
  | 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
150
  | 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
- | 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
- | 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). |
151
+ | 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, switch it off with `allelix config set sources.snpedia false`, or pass `--exclude-snpedia` to `analyze` or `methylation` for one run (`pharmacogenomics` refuses that option). The cache can also be rebuilt from source via `scripts/scrape_snpedia.py` + `scripts/parse_snpedia.py`. |
152
+ | 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. A single-base risk allele is taken only from a catalog row whose risk-allele field names the row's own SNP; a row whose single-base risk allele is written under another rsID (`other_snp`) or under something that is not an rsID (`unattributed`) is skipped, and `db update` and `db status` show how many rows the cached release skipped. A field without a single-base risk allele (`rs123-?`, `rs123-AT`) still loads the row without a risk allele, as before, whatever rsID it names. 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
153
  | 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
154
  | 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
155
  | 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
156
  | 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
157
 
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
+ 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). ClinVar also has a check of its own, with or without the identity table, and it rejects only ClinVar findings: a call whose rsID ClinVar places only elsewhere is not matched to another variant's ClinVar row at its position. Since 2.7.0 the report counts such a call where it carries that row's exact allele, in a warning, `clinvar_rsid_placed_elsewhere`, and names one at a high-value or own Pathogenic or Likely pathogenic rsID (ADR-0051). A call the identity table has already set aside is not counted again there.
158
159
 
159
160
  ### CADD modes
160
161
 
@@ -210,9 +211,9 @@ This is not a disclaimer afterthought. It is a design constraint that affects mo
210
211
 
211
212
  ## Privacy
212
213
 
213
- - No data leaves your machine. No telemetry. No uploads. No analytics.
214
- - Reference databases are downloaded via `allelix db update` and cached locally.
215
- - Analysis runs offline against local database caches. A brief freshness check of the switched-on sources runs before analysis by default (skipped with `--no-update`).
214
+ - Your genotype data never leaves your machine. No telemetry. No uploads. No analytics.
215
+ - Allelix goes online only to fetch reference databases, which are cached locally: when you run `allelix db update`, and in a freshness check before `analyze`, `methylation` or `pharmacogenomics`. The check asks the servers of ClinVar (NCBI), the GWAS Catalog (EBI) and ClinPGx (with CPIC's API) whether a switched-on cache older than seven days has changed, and downloads and installs the new data if it has. The pre-built caches are not checked. Each request carries only what any download carries (the address requested, an `allelix/<version>` user agent, and your IP address as the server sees it), never genotypes, file names or results.
216
+ - With `--no-update`, nothing is contacted: the analysis runs offline against the local caches.
216
217
 
217
218
  ### Output files contain real annotations of your genome
218
219
 
@@ -224,6 +225,11 @@ that's where they sit until you delete them. Allelix doesn't
224
225
  auto-clean and won't warn you when you write to `/tmp/` or any
225
226
  other shared location. Treat the files as personal data: read them,
226
227
  move them somewhere you control, or delete when you're done.
228
+ Since 2.7.0 a new report file (`--output`, `--vcf-out`, and the `.bed`,
229
+ `.bim` and `.fam` of `export plink`) is created readable and writable by
230
+ you alone (`0600`), whatever your umask; a file that already exists keeps
231
+ its mode. Terminal output you redirect to a file is created by your shell,
232
+ with its umask.
227
233
  `allelix db clean` (shipped in v2.2.0) handles the cache side of
228
234
  the lifecycle; output reports are still the user's responsibility
229
235
  to manage.
@@ -254,7 +260,7 @@ allelix config set plausibility.homozygous_max_af 0.0001
254
260
  allelix config set plausibility.heterozygous_max_af 0
255
261
  ```
256
262
 
257
- CLI flags (`--no-gnomad`, `--no-alphamissense`, `--no-cadd`, `--exclude-snpedia`) turn a source off for a single run. The config sets the baseline; flags override per-invocation. A source turned off is fully off: no finding comes from it, and no other source uses it either. For example, with ClinVar or gnomAD off, ClinPGx and SNPedia cannot use them to tell a normal allele. The report says what ran without it. `stats`, `extract` and `export plink` follow the config the same way.
263
+ CLI flags (`--no-gnomad`, `--no-alphamissense`, `--no-cadd`, `--exclude-snpedia`) turn a source off for a single run. The config sets the baseline; flags override per-invocation. `pharmacogenomics` refuses `--exclude-snpedia` and the GWAS Catalog and SNPedia floor options, since its report keeps ClinPGx findings only; switch SNPedia off there in the config. A source turned off is fully off: no finding comes from it, and no other source uses it either. For example, with ClinVar or gnomAD off, ClinPGx and SNPedia cannot use them to tell a normal allele. The report says what ran without it. `stats`, `extract` and `export plink` follow the config the same way.
258
264
 
259
265
  ### Plausibility flag
260
266
 
@@ -309,7 +315,7 @@ Allelix keeps its caches in `~/.local/share/allelix/`, or `$XDG_DATA_HOME/alleli
309
315
  └── pharmgkb.sqlite ~6 MB
310
316
  ```
311
317
 
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.
318
+ Downloaded or rebuilt caches are staged beside their final names and moved into place only when complete, so two updates running at once cannot install each other's files. If a rebuild fails before publication, its previous cache remains in place. Freshness and interpreter stamps can instead be updated in the existing database. Each cache is published on its own, so an update of several sources can fail after some have already been updated. ClinVar's two builds are published one build at a time; a publication failure names any build already updated. 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
319
 
314
320
  **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
321
 
@@ -355,7 +361,7 @@ pip uninstall allelix
355
361
 
356
362
  ## Data Sources & Licensing
357
363
 
358
- Allelix source code is licensed under the **GNU Affero General Public License v3.0 or later** (AGPL-3.0-or-later). Allelix ships with **zero third-party data**. All reference databases are downloaded by the user at runtime via `allelix db update`. Each database retains its original license on the user's machine:
364
+ Allelix source code is licensed under the **GNU Affero General Public License v3.0 or later** (AGPL-3.0-or-later). The Allelix package contains **no third-party data**. The reference databases are downloaded at run time, by `allelix db update` or the freshness check before an analysis (see [Privacy](#privacy)): ClinVar, the GWAS Catalog, ClinPGx and CPIC from their publishers, and gnomAD, AlphaMissense, CADD, SNPedia and the rsID identity table as pre-built caches from Hugging Face dataset repositories. Each database retains its original license on the user's machine:
359
365
 
360
366
  | Database | Source | License | Usage |
361
367
  |---|---|---|---|
@@ -363,7 +369,7 @@ Allelix source code is licensed under the **GNU Affero General Public License v3
363
369
  | GWAS Catalog | EBI/NHGRI | Public domain | No restrictions |
364
370
  | ClinPGx (formerly PharmGKB) | clinpgx.org | CC BY-SA 4.0 | Attribution required |
365
371
  | CPIC | cpicpgx.org | CC BY-SA 4.0 | Attribution required. Per-allele function data fetched from `api.cpicpgx.org` at `db update` time; used internally for the ClinPGx non-finding filter (ADR-0020), not surfaced as its own annotator. |
366
- | SNPedia | snpedia.com | CC BY-NC-SA 3.0 US | Attribution required, **non-commercial only**. Use `--exclude-snpedia` to omit. |
372
+ | SNPedia | snpedia.com | CC BY-NC-SA 3.0 US | Attribution required, **non-commercial only**. Omit it with `allelix config set sources.snpedia false`, or with `--exclude-snpedia` on `analyze` and `methylation`. |
367
373
  | gnomAD | gnomad.broadinstitute.org | ODbL v1.0 | Attribution required. GRCh38 population allele frequencies for context (GRCh37 input through the identity table); not a clinical annotator. Use `--no-gnomad` to omit. |
368
374
  | AlphaMissense | zenodo.org/records/10813168 | CC BY 4.0 | Attribution required. Cheng et al., Science 2023. GRCh38 missense variant pathogenicity predictions (GRCh37 input through the identity table). Use `--no-alphamissense` to omit. |
369
375
  | dbSNP (rsID identity table) | ncbi.nlm.nih.gov/snp | Public domain | No restrictions. Cross-build rsID placements derived from dbSNP; not surfaced as an annotator. |
@@ -468,8 +474,8 @@ only complete, closed content. Failure before publication preserves previous
468
474
  outputs. PLINK stages all three files first, then publishes each atomically;
469
475
  a later publication failure can leave complete new files next to unchanged old
470
476
  ones. Existing ordinary permission bits are retained when replacement is
471
- permitted; new staging files start private, and a new output file gets the mode
472
- your umask gives any new file (`0666 & ~umask`, so `0644` under `022`).
477
+ permitted; new staging files start private, and a new output file is `0600`
478
+ (since 2.7.0; `config.toml` still gets the mode your umask gives a new file).
473
479
  Ownership, ACLs, extended attributes,
474
480
  crash durability and concurrent path swaps are outside this guarantee.
475
481
 
@@ -16,7 +16,7 @@
16
16
 
17
17
  # Allelix
18
18
 
19
- > **Status:** Production. Reads twelve file formats, including VCF and gVCF and lists of rsIDs and genotypes. Reports what ClinVar, ClinPGx, the GWAS Catalog and SNPedia say about your variants, with frequencies and scores from gnomAD, AlphaMissense and CADD. It decides the genome build from the file itself and stops rather than guess. HTML, JSON, terminal or annotated VCF. Everything runs on your machine. The [Changelog](https://github.com/allelix/allelix/blob/main/CHANGELOG.md) tracks every release.
19
+ > **Status:** Production. Reads twelve file formats, including VCF and gVCF and lists of rsIDs and genotypes. Reports what ClinVar, ClinPGx, the GWAS Catalog and SNPedia say about your variants, with frequencies and scores from gnomAD, AlphaMissense and CADD. It decides the genome build from the file itself and stops rather than guess. HTML, JSON, terminal or annotated VCF. The analysis runs on your machine, and your genotypes are never sent anywhere. The [Changelog](https://github.com/allelix/allelix/blob/main/CHANGELOG.md) tracks every release.
20
20
 
21
21
  ## Quickstart
22
22
 
@@ -56,7 +56,8 @@ allelix analyze your_genotype_file.txt --filter-file my_panel.txt --output repor
56
56
  # Annotated VCF output — VCF-in / VCF-out for pipeline integration
57
57
  # Writes a valid VCF with annotations as INFO fields + full provenance in the header.
58
58
  # Missing ##contig declarations are synthesized; raw CHROM names are preserved.
59
- # Refuses to overwrite; requires VCF or gVCF input.
59
+ # Refuses to overwrite; requires VCF or gVCF input. Written uncompressed:
60
+ # a .gz or .bgz name is refused (compress afterwards with bgzip).
60
61
  allelix analyze your_wgs.vcf.gz --vcf-out annotated.vcf
61
62
  ```
62
63
 
@@ -107,14 +108,14 @@ Issues and milestones are tracked at [github.com/allelix/allelix/issues](https:/
107
108
  | 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
109
  | 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
110
  | 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
- | 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
- | 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). |
111
+ | 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, switch it off with `allelix config set sources.snpedia false`, or pass `--exclude-snpedia` to `analyze` or `methylation` for one run (`pharmacogenomics` refuses that option). The cache can also be rebuilt from source via `scripts/scrape_snpedia.py` + `scripts/parse_snpedia.py`. |
112
+ | 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. A single-base risk allele is taken only from a catalog row whose risk-allele field names the row's own SNP; a row whose single-base risk allele is written under another rsID (`other_snp`) or under something that is not an rsID (`unattributed`) is skipped, and `db update` and `db status` show how many rows the cached release skipped. A field without a single-base risk allele (`rs123-?`, `rs123-AT`) still loads the row without a risk allele, as before, whatever rsID it names. 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
113
  | 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
114
  | 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
115
  | 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
116
  | 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
117
 
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
+ 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). ClinVar also has a check of its own, with or without the identity table, and it rejects only ClinVar findings: a call whose rsID ClinVar places only elsewhere is not matched to another variant's ClinVar row at its position. Since 2.7.0 the report counts such a call where it carries that row's exact allele, in a warning, `clinvar_rsid_placed_elsewhere`, and names one at a high-value or own Pathogenic or Likely pathogenic rsID (ADR-0051). A call the identity table has already set aside is not counted again there.
118
119
 
119
120
  ### CADD modes
120
121
 
@@ -170,9 +171,9 @@ This is not a disclaimer afterthought. It is a design constraint that affects mo
170
171
 
171
172
  ## Privacy
172
173
 
173
- - No data leaves your machine. No telemetry. No uploads. No analytics.
174
- - Reference databases are downloaded via `allelix db update` and cached locally.
175
- - Analysis runs offline against local database caches. A brief freshness check of the switched-on sources runs before analysis by default (skipped with `--no-update`).
174
+ - Your genotype data never leaves your machine. No telemetry. No uploads. No analytics.
175
+ - Allelix goes online only to fetch reference databases, which are cached locally: when you run `allelix db update`, and in a freshness check before `analyze`, `methylation` or `pharmacogenomics`. The check asks the servers of ClinVar (NCBI), the GWAS Catalog (EBI) and ClinPGx (with CPIC's API) whether a switched-on cache older than seven days has changed, and downloads and installs the new data if it has. The pre-built caches are not checked. Each request carries only what any download carries (the address requested, an `allelix/<version>` user agent, and your IP address as the server sees it), never genotypes, file names or results.
176
+ - With `--no-update`, nothing is contacted: the analysis runs offline against the local caches.
176
177
 
177
178
  ### Output files contain real annotations of your genome
178
179
 
@@ -184,6 +185,11 @@ that's where they sit until you delete them. Allelix doesn't
184
185
  auto-clean and won't warn you when you write to `/tmp/` or any
185
186
  other shared location. Treat the files as personal data: read them,
186
187
  move them somewhere you control, or delete when you're done.
188
+ Since 2.7.0 a new report file (`--output`, `--vcf-out`, and the `.bed`,
189
+ `.bim` and `.fam` of `export plink`) is created readable and writable by
190
+ you alone (`0600`), whatever your umask; a file that already exists keeps
191
+ its mode. Terminal output you redirect to a file is created by your shell,
192
+ with its umask.
187
193
  `allelix db clean` (shipped in v2.2.0) handles the cache side of
188
194
  the lifecycle; output reports are still the user's responsibility
189
195
  to manage.
@@ -214,7 +220,7 @@ allelix config set plausibility.homozygous_max_af 0.0001
214
220
  allelix config set plausibility.heterozygous_max_af 0
215
221
  ```
216
222
 
217
- CLI flags (`--no-gnomad`, `--no-alphamissense`, `--no-cadd`, `--exclude-snpedia`) turn a source off for a single run. The config sets the baseline; flags override per-invocation. A source turned off is fully off: no finding comes from it, and no other source uses it either. For example, with ClinVar or gnomAD off, ClinPGx and SNPedia cannot use them to tell a normal allele. The report says what ran without it. `stats`, `extract` and `export plink` follow the config the same way.
223
+ CLI flags (`--no-gnomad`, `--no-alphamissense`, `--no-cadd`, `--exclude-snpedia`) turn a source off for a single run. The config sets the baseline; flags override per-invocation. `pharmacogenomics` refuses `--exclude-snpedia` and the GWAS Catalog and SNPedia floor options, since its report keeps ClinPGx findings only; switch SNPedia off there in the config. A source turned off is fully off: no finding comes from it, and no other source uses it either. For example, with ClinVar or gnomAD off, ClinPGx and SNPedia cannot use them to tell a normal allele. The report says what ran without it. `stats`, `extract` and `export plink` follow the config the same way.
218
224
 
219
225
  ### Plausibility flag
220
226
 
@@ -269,7 +275,7 @@ Allelix keeps its caches in `~/.local/share/allelix/`, or `$XDG_DATA_HOME/alleli
269
275
  └── pharmgkb.sqlite ~6 MB
270
276
  ```
271
277
 
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.
278
+ Downloaded or rebuilt caches are staged beside their final names and moved into place only when complete, so two updates running at once cannot install each other's files. If a rebuild fails before publication, its previous cache remains in place. Freshness and interpreter stamps can instead be updated in the existing database. Each cache is published on its own, so an update of several sources can fail after some have already been updated. ClinVar's two builds are published one build at a time; a publication failure names any build already updated. 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
279
 
274
280
  **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
281
 
@@ -315,7 +321,7 @@ pip uninstall allelix
315
321
 
316
322
  ## Data Sources & Licensing
317
323
 
318
- Allelix source code is licensed under the **GNU Affero General Public License v3.0 or later** (AGPL-3.0-or-later). Allelix ships with **zero third-party data**. All reference databases are downloaded by the user at runtime via `allelix db update`. Each database retains its original license on the user's machine:
324
+ Allelix source code is licensed under the **GNU Affero General Public License v3.0 or later** (AGPL-3.0-or-later). The Allelix package contains **no third-party data**. The reference databases are downloaded at run time, by `allelix db update` or the freshness check before an analysis (see [Privacy](#privacy)): ClinVar, the GWAS Catalog, ClinPGx and CPIC from their publishers, and gnomAD, AlphaMissense, CADD, SNPedia and the rsID identity table as pre-built caches from Hugging Face dataset repositories. Each database retains its original license on the user's machine:
319
325
 
320
326
  | Database | Source | License | Usage |
321
327
  |---|---|---|---|
@@ -323,7 +329,7 @@ Allelix source code is licensed under the **GNU Affero General Public License v3
323
329
  | GWAS Catalog | EBI/NHGRI | Public domain | No restrictions |
324
330
  | ClinPGx (formerly PharmGKB) | clinpgx.org | CC BY-SA 4.0 | Attribution required |
325
331
  | CPIC | cpicpgx.org | CC BY-SA 4.0 | Attribution required. Per-allele function data fetched from `api.cpicpgx.org` at `db update` time; used internally for the ClinPGx non-finding filter (ADR-0020), not surfaced as its own annotator. |
326
- | SNPedia | snpedia.com | CC BY-NC-SA 3.0 US | Attribution required, **non-commercial only**. Use `--exclude-snpedia` to omit. |
332
+ | SNPedia | snpedia.com | CC BY-NC-SA 3.0 US | Attribution required, **non-commercial only**. Omit it with `allelix config set sources.snpedia false`, or with `--exclude-snpedia` on `analyze` and `methylation`. |
327
333
  | gnomAD | gnomad.broadinstitute.org | ODbL v1.0 | Attribution required. GRCh38 population allele frequencies for context (GRCh37 input through the identity table); not a clinical annotator. Use `--no-gnomad` to omit. |
328
334
  | AlphaMissense | zenodo.org/records/10813168 | CC BY 4.0 | Attribution required. Cheng et al., Science 2023. GRCh38 missense variant pathogenicity predictions (GRCh37 input through the identity table). Use `--no-alphamissense` to omit. |
329
335
  | dbSNP (rsID identity table) | ncbi.nlm.nih.gov/snp | Public domain | No restrictions. Cross-build rsID placements derived from dbSNP; not surfaced as an annotator. |
@@ -428,8 +434,8 @@ only complete, closed content. Failure before publication preserves previous
428
434
  outputs. PLINK stages all three files first, then publishes each atomically;
429
435
  a later publication failure can leave complete new files next to unchanged old
430
436
  ones. Existing ordinary permission bits are retained when replacement is
431
- permitted; new staging files start private, and a new output file gets the mode
432
- your umask gives any new file (`0666 & ~umask`, so `0644` under `022`).
437
+ permitted; new staging files start private, and a new output file is `0600`
438
+ (since 2.7.0; `config.toml` still gets the mode your umask gives a new file).
433
439
  Ownership, ACLs, extended attributes,
434
440
  crash durability and concurrent path swaps are outside this guarantee.
435
441
 
@@ -137,6 +137,7 @@ def get_annotators(
137
137
  palindromic_provider=identity.palindromic_rsids,
138
138
  normal_allele_provider=references.normal_allele_for,
139
139
  reference_prefetch=references.prefetch,
140
+ forward_site_provider=identity.forward_sites,
140
141
  )
141
142
  gwas = GWASCatalogAnnotator(
142
143
  data_dir,
@@ -32,6 +32,11 @@ from allelix.databases.cache_state import (
32
32
  cache_state,
33
33
  connect_readonly,
34
34
  )
35
+ from allelix.databases.loader_utils import (
36
+ UnrecoveredJournalError,
37
+ publish_cache,
38
+ settle_for_publication,
39
+ )
35
40
  from allelix.databases.manager import (
36
41
  CLINVAR_BUILD_LOG,
37
42
  CONTRIBUTES_TO_AGGREGATE,
@@ -368,6 +373,9 @@ class ClinVarAnnotator(Annotator):
368
373
  # rsID calls at an aggregate-P/LP locus whose rsID's alleles
369
374
  # nothing knows, not matched to another rsID's row there.
370
375
  self._unknown_allele_calls_at_plp_loci = 0
376
+ # calls whose exact allele a row at their locus carries, not matched
377
+ # because ClinVar places the call's own rsID elsewhere.
378
+ self._placed_elsewhere_calls = 0
371
379
  # gnomAD's alleles of an rsID at a locus, asked only for a call
372
380
  # the identity table and ClinVar's own rows do not settle. None when
373
381
  # gnomAD is off or not ready (the pipeline wires it per run).
@@ -435,6 +443,7 @@ class ClinVarAnnotator(Annotator):
435
443
  "foreign_allele_calls_at_plp_loci": self._foreign_allele_calls_at_plp_loci,
436
444
  "unknown_allele_calls_at_plp_loci": self._unknown_allele_calls_at_plp_loci,
437
445
  "ref_mismatches": self._ref_mismatches,
446
+ "placed_elsewhere_calls": self._placed_elsewhere_calls,
438
447
  }
439
448
 
440
449
  def _connection(self, build: str) -> sqlite3.Connection | None:
@@ -513,11 +522,18 @@ class ClinVarAnnotator(Annotator):
513
522
  )
514
523
  candidates[build] = candidate
515
524
  self.close()
525
+ # A recovery preflight: every selected build's old cache is settled
526
+ # before any is replaced, so a refusal found then changes nothing.
527
+ # Each move after it is atomic on its own; a later failure (a side
528
+ # file that appears meanwhile, a failed rename) can leave an
529
+ # earlier build updated, and the error says which.
530
+ for build in candidates:
531
+ settle_for_publication(self._db_paths[build])
516
532
  published: list[str] = []
517
533
  for build, candidate in candidates.items():
518
534
  try:
519
- os.replace(candidate, self._db_paths[build])
520
- except OSError as exc:
535
+ publish_cache(candidate, self._db_paths[build])
536
+ except (OSError, UnrecoveredJournalError) as exc:
521
537
  kept = (
522
538
  "old cache kept"
523
539
  if self._db_paths[build].exists()
@@ -1489,11 +1505,27 @@ class ClinVarAnnotator(Annotator):
1489
1505
  """The D/I calls ``di_calls_at_plp_rsids`` counts: rsID -> (call, gene)."""
1490
1506
  return dict(self._di_calls_at_plp)
1491
1507
 
1508
+ def loci_of_rsids(self, rsids: set[str], *, build: str) -> dict[str, set[tuple[str, int]]]:
1509
+ """Where ClinVar places each of ``rsids`` on ``build``; empty without a current cache.
1510
+
1511
+ For the pipeline's reference-carried calls: an explicit record naming
1512
+ an rsID held only elsewhere keeps that rsID for the placement guard.
1513
+ """
1514
+ conn = self._connection(build)
1515
+ if conn is None or not self._cache_is_current(build):
1516
+ return {}
1517
+ return self._loci_of(conn, rsids)
1518
+
1492
1519
  def _loci_of_rsids(
1493
1520
  self, conn: sqlite3.Connection, variants: Iterable[Variant]
1494
1521
  ) -> dict[str, set[tuple[str, int]]]:
1495
1522
  """Where ClinVar places each input rsID on this build, keyed by rsID."""
1496
- rsids = sorted({v.rsid for v in variants if v.rsid.startswith("rs")})
1523
+ return self._loci_of(conn, {v.rsid for v in variants})
1524
+
1525
+ @staticmethod
1526
+ def _loci_of(conn: sqlite3.Connection, wanted: set[str]) -> dict[str, set[tuple[str, int]]]:
1527
+ """Where ClinVar places each of the ``wanted`` rsIDs, keyed by rsID."""
1528
+ rsids = sorted(r for r in wanted if r.startswith("rs"))
1497
1529
  out: dict[str, set[tuple[str, int]]] = {}
1498
1530
  for start in range(0, len(rsids), _BATCH_CHUNK):
1499
1531
  chunk = rsids[start : start + _BATCH_CHUNK]
@@ -1598,6 +1630,11 @@ class ClinVarAnnotator(Annotator):
1598
1630
  if rsid_loci and not rsid_loci & (
1599
1631
  {record_locus} | {(record_locus[0], t[0]) for t in trimmed}
1600
1632
  ):
1633
+ if _carries_a_row_allele(variant, rows, trimmed):
1634
+ # The exact allele of another variant's row, not reported
1635
+ # under this rsID; counted, and named where it matters.
1636
+ self._placed_elsewhere_calls += 1
1637
+ self._note_unchecked(variant, "placed_elsewhere", None)
1601
1638
  return []
1602
1639
  allele1, allele2 = variant.carried_pair
1603
1640
  user_is_multibase = len(allele1) > 1 or len(allele2) > 1
@@ -1802,6 +1839,26 @@ def _in_trimmed_frame(allele: str, variant: Variant, position: int, ref: str) ->
1802
1839
  return trimmed[2] if trimmed[:2] == (position, ref) else _OTHER_SHAPE
1803
1840
 
1804
1841
 
1842
+ def _carries_a_row_allele(
1843
+ variant: Variant, rows: list[tuple], trimmed: dict[tuple[int, str, str], str]
1844
+ ) -> bool:
1845
+ """Whether the call carries a row's exact ALT at that row's position and REF.
1846
+
1847
+ As written (the call's POS and REF), or trimmed (ADR-0047). A row whose
1848
+ ALT is the REF (the reference base carries ClinVar's allele) counts when
1849
+ the call carries that base.
1850
+ """
1851
+ pos = variant_locus(variant)[1]
1852
+ carried = {a for a in variant.carried_pair if a != NO_CALL_MARKER}
1853
+ for row in rows:
1854
+ ref, alt, at = row[_R_REF], row[_R_ALT], row[_R_POS]
1855
+ if at == pos and alt in carried and (variant.ref is None or ref == variant.ref):
1856
+ return True
1857
+ if (at, ref, alt) in trimmed:
1858
+ return True
1859
+ return False
1860
+
1861
+
1805
1862
  def _trimmed_alleles(variant: Variant) -> dict[tuple[int, str, str], str]:
1806
1863
  """A VCF call's carried alleles that its record wrote untrimmed (ADR-0047).
1807
1864
 
@@ -30,7 +30,9 @@ from allelix.databases.gwas_loader import (
30
30
  gwas_source_hash,
31
31
  load_gwas_tsv,
32
32
  retained_source_stamp,
33
+ source_skip_counts,
33
34
  )
35
+ from allelix.databases.loader_utils import check_zip_expansion
34
36
  from allelix.databases.manager import (
35
37
  _ensure_local_version_tag_column,
36
38
  download,
@@ -283,6 +285,9 @@ class GWASCatalogAnnotator(Annotator):
283
285
  if not tsv_names:
284
286
  msg = f"No .tsv file found in {zip_path.name}"
285
287
  raise RuntimeError(msg)
288
+ # The one table it unpacks, within the unpack limit, before
289
+ # it is read.
290
+ check_zip_expansion(zf, [zf.getinfo(tsv_names[0])], zip_path.name)
286
291
  extracted = Path(zf.extract(tsv_names[0], staging / "extracted"))
287
292
  extracted.rename(tsv_path)
288
293
  load_gwas_tsv(
@@ -398,6 +403,20 @@ class GWASCatalogAnnotator(Annotator):
398
403
  info = get_database_info(self._db_path, "gwas")
399
404
  return info["record_count"] if info else None
400
405
 
406
+ def source_skip_counts(self) -> dict[str, int] | None:
407
+ """The cached release's source rows skipped by risk-allele owner, by reason.
408
+
409
+ ``other_snp`` and ``unattributed``; None without a cache, or
410
+ for a cache built before 2.7.0. Read-only.
411
+ """
412
+ if not self._db_path.exists():
413
+ return None
414
+ try:
415
+ with contextlib.closing(connect_readonly(self._db_path)) as conn:
416
+ return source_skip_counts(conn)
417
+ except sqlite3.Error:
418
+ return None
419
+
401
420
  def close(self) -> None:
402
421
  """Close the SQLite connection if open."""
403
422
  if self._conn is not None: