Repository navigation
Fix microarray kit bugs and add current chip templates (#167) - #169
Merged
Merged
Conversation
- Lift FTDNA_V1_Affy's NCBI36 markers with UCSC hg18ToHg19, both into the genome-wide target and to find calls (was rsID matching; 49.5% no-calls). - Keep chrM positions when lifting the target to hg38 (GRCh37 MT and hg38 chrM are both rCRS); version the target and rebuild stale ones. - Correct 102 Yoruba-position MT markers in the 23andMe V4/V5/V35 templates (corrections.tsv) and map vendor chrom "XY" to X. - 23andMe: haploid calls as one letter (MT, Y, a man's non-PAR X). - Write heterozygous calls in alphabetical order; body line endings follow the head's (no more mixed CRLF/LF files). - Add 23andMe_V5_2025, Ancestry_V2_2024 and Nucleus_V1 templates (IDs and positions only) and scripts to rebuild them and the corrections. - Help/docs: `--formats all` writes only the combined kit. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 00696d6b-0791-4ed9-9bcb-3a032ee3e82b
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
There was a problem hiding this comment.
🟡 Changes recommended
Remaining defects make CSV vendor templates undiscoverable, prevent reuse of current targets in read-only libraries, and produce incorrect alleles for reverse-strand hg18-to-hg19 mappings.
3 open issues
What changed in this PR
Improves microarray kit generation following #167’s research, correcting coordinate handling and vendor formatting while adding support for recent chip exports.
Changes:
- Corrects mitochondrial and NCBI36 marker handling, adds target versioning, and rebuilds stale library targets.
- Adds current 23andMe, AncestryDNA, and Nucleus formats, with updated haploid calls, allele ordering, and line endings.
- Expands regression tests, template-generation tools, and usage documentation.
| File | Description |
|---|---|
| tests/test_sample_ploidy.py | Updates the reference-library fixture. |
| tests/test_microarray_vendor_formats.py | Tests haploid output, corrections, line endings, and NCBI36 conversion. |
| tests/test_microarray_targets.py | Tests lifted markers, mitochondrial identity, and target versioning. |
| tests/test_microarray_simulation.py | Updates expected vendor-specific haploid calls. |
| tests/test_microarray_pr43_regressions.py | Tests new format aliases and alphabetical allele ordering. |
| tests/test_lineage_microarray_cleanup.py | Updates the reference-library fixture. |
| src/wgsextract_cli/core/microarray_utils.py | Implements template corrections, NCBI36 lookup, and vendor formatting changes. |
| src/wgsextract_cli/core/microarray_targets.py | Adds versioned targets, new formats, and coordinate corrections. |
| src/wgsextract_cli/core/messages.py | Clarifies --formats all and lists new formats. |
| src/wgsextract_cli/commands/microarray.py | Connects new formats, target rebuilding, and NCBI36 conversion. |
| src/wgsextract_cli/commands/_microarray_combined.py | Sorts heterozygous alleles alphabetically. |
| src/wgsextract_cli/assets/microarray/raw_file_templates/README.md | Documents template sources, corrections, and regeneration. |
| src/wgsextract_cli/assets/microarray/raw_file_templates/head/Ancestry_V2_2024.txt | Adds the AncestryDNA export header. |
| src/wgsextract_cli/assets/microarray/raw_file_templates/head/23andMe_V5_2025.txt | Adds the 23andMe export header. |
| src/wgsextract_cli/assets/microarray/raw_file_templates/corrections.tsv | Supplies mitochondrial marker-position corrections. |
| site_src/workflows.md | Updates format examples and output behavior documentation. |
| scripts/microarray_template_from_raw.py | Generalizes template extraction across vendor exports. |
| scripts/microarray_template_corrections.py | Adds mitochondrial correction-table regeneration. |
Review effort: Balanced
- FTDNA_V1: complement and sort calls at markers in regions inverted between NCBI36 and GRCh37. - Use a current genome-wide target before taking the build lock, so a read-only reference library works. - microarray_template_from_raw.py writes the format's suffix (.csv for MyHeritage/FTDNA). - AGENTS.md: define "babysit" a PR. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 00696d6b-0791-4ed9-9bcb-3a032ee3e82b
This was referenced Oct 26, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Fixes the bugs on our side that #167's research found, and adds corrected and current chip templates.
Fixes
--parallel)corrections.tsvXY(MyHeritage PAR) wasn't mapped.AAA. X exact-string match with the real chip is 99.3%.TCCT--formats allwrites every vendor file.The genome-wide target now has a version line (
##wgsextract_microarray_target_version=2) and is rebuilt automatically when stale. It grew from 1.80M to 2.39M markers (FTDNA_V1 lifted, plus the new chips).Trade-off: upstream's reflib ships
microarray/All_SNPs_hg38_ref.tab.gzat the same path with no version line. A library that has it gets it rebuilt by our builder. A target passed with--ref-vcf-tabis never touched.New templates (IDs + positions only, no genotypes)
23andme_v5_2025(643,161 markers),ancestry_v2_2024(677,436) andnucleus(665,107), from 2024–25 exports. A vendor's exports for different people have identical marker lists.scripts/microarray_template_from_raw.pyis generalized across vendors. The newscripts/microarray_template_corrections.pyregeneratescorrections.tsv.Validation
pytest: 1,922 passed. New tests cover:XYmappingruff and mypy are clean.
A real-data chrM+chrY run, then a whole-genome hg38 run (18.5 min). Every vendor file has 0.0–0.3% no-calls overall and uniform line endings.
Agreement with the real chips (same alleles) by chromosome:
Ancestry MT disagreements are mostly strand-complemented chip calls, which are on Ancestry's side.