Skip to content

Add dnafile to Command Line Utilities - #155

Open
AndreySoloviev wants to merge 1 commit into
danielecook:masterfrom
AndreySoloviev:add-dnafile
Open

Add dnafile to Command Line Utilities#155
AndreySoloviev wants to merge 1 commit into
danielecook:masterfrom
AndreySoloviev:add-dnafile

Conversation

@AndreySoloviev

Copy link
Copy Markdown

Adds one entry to Data Processing → Command Line Utilities, alphabetically between datamash and easy_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 rs429358 and rs7412, and coverage of that pair is not symmetric across arrays. Given a file with only one, check exits 2 with insufficient markers rather 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. detect reports 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 for Y and MT, 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 in testdata/ 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 — TestNoNetworkImports walks the full transitive import graph of every package including the command and fails if anything network-capable (net, net/*, database/sql, log/syslog, plus os/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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant