Add dnafile to Command Line Utilities - #155
Open
AndreySoloviev wants to merge 1 commit into
Open
Conversation
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.
Adds one entry to Data Processing → Command Line Utilities, alphabetically between
datamashandeasy_qsub.What it is: a Go library and CLI for reading raw DNA exports from consumer genetic-testing services — 23andMe (v3/v4/v5), AncestryDNA (v1/v2), MyHeritage, FamilyTreeDNA and LivingDNA. Four subcommands:
detect(which service/array produced this file),stats(marker census),check(is a given rsID actually covered),normalize(one TSV/JSON shape regardless of source). Accepts plain text,.gz,.zip, or stdin.Why I think it's worth listing:
It refuses to answer questions the file can't support. Determining APOE ε-status needs both
rs429358andrs7412, and coverage of that pair is not symmetric across arrays. Given a file with only one,checkexits 2 withinsufficient markersrather than emitting a result that looks identical to one computed from a complete pair. Exit codes separate "this file cannot answer" (2) from "this invocation was broken" (1), which makes it usable in scripts.It doesn't assume a single layout per service. These exports vary — chromosomes spelled out in one and numbered in another, genotype in one column or two, and the same service shipping more than one profile. Code written against a single template parses the other one wrongly and quietly.
detectreports the profile it found plus the evidence behind the verdict, so a wrong detection can be argued with. A specific trap it handles: exports that number the non-autosomes (23/24/25/26 for X/Y/XY/MT) defeat parsers looking forYandMT, so those rows land in the autosomes and a file that does carry Y markers is reported as carrying none.It distinguishes absent from uncalled. A marker missing from the file means the array cannot answer; a marker present with no call means the sample didn't. Both block a conclusion but call for different responses, so they're kept separate rather than collapsed into one boolean.
Practical details: Go 1.24+, no dependencies outside the standard library, MIT.
go test ./...is green with 84.3% / 84.6% / 77.1% statement coverage across the three packages. All fixtures intestdata/are synthetic — no real export is in the repository in any form.One design point that may interest this list: "sends nothing anywhere" is enforced by a test rather than promised in prose —
TestNoNetworkImportswalks the full transitive import graph of every package including the command and fails if anything network-capable (net,net/*,database/sql,log/syslog, plusos/exec) is reachable. That test has its own test, so a matcher that stops matching is caught rather than passing silently.Scope, stated plainly: it delivers data up to the point where interpretation begins and stops there — no health claims, no risk estimates, no recommendations. It's maintained by the team behind askmydna.com and stands alone; using it involves no account and no service.
Disclosure: I'm the author. Happy to reword the description, move it to a different section, or drop it if it isn't a fit for the list.