diff --git a/.github/workflows/guard.yml b/.github/workflows/guard.yml index e73de0946..953d99d1c 100644 --- a/.github/workflows/guard.yml +++ b/.github/workflows/guard.yml @@ -945,6 +945,14 @@ jobs: working-directory: . run: bin/og dev remnants + # EVERYTHING=true and -profile everything run every optional step from + # assets/everything.tsv: a new tool, switch, setup flag, false-by-default + # or opt-in parameter, or optional image with no row there fails here. + # Its planted cases are og-dev's everything::tests, in cargo test. + - name: og dev everything-check + working-directory: . + run: bin/og dev everything-check + # main.nf runs the same check before any task: a stale og stops # `nextflow run` with the setup command. Without the check, this stub # run completes and the step fails. diff --git a/CHANGELOG.md b/CHANGELOG.md index dda3da6ec..f84f1605e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,13 @@ Each release's notes. From 1.0.0 on, a major or minor release has hand-written n ## Unreleased +- The local genome viewer runs on `og` and no longer needs `python3` on the host. `scripts/owngenome-view.sh` starts `og view serve` (through `bin/og`, or `OG`), which serves the same page, config and byte ranges on 127.0.0.1 as `assets/viewer/serve.py` did. Two requests it answered before are now refused. A locus whose end comes before its start (`chr1:13000-12000`) stops the script with exit 2 and the reason, instead of opening a view igv.js cannot show. A request with a `Forwarded`, `X-Forwarded-*` or `X-Real-IP` header gets 403: the viewer has no password, so a reverse proxy in front of it would hand the sample to anyone who reaches the proxy; an ssh port forward still works. The default SV track is now Manta's diploid SVs (step 4), else step 22's consensus, which keeps only the calls two callers agree on. `docs/viewer.md` says that every account on the machine can reach 127.0.0.1. No option of the script, file or output name changes; `og view serve` takes the flags `serve.py` took, plus `--assets`, the page's folder. The live site's viewer also opens Manta's diploid SVs first; the rest of it is unchanged until its server moves to `og`. Part of #411 (plat-11, plat-12). +- Step 10 (telomere content) always reads the GRCh38 chromosome bands now. When `reference/cytoBand.hg38.txt` was missing, `scripts/10-telomere-hunter.sh` warned and ran TelomereHunter without `-b`, so it sorted reads by its own hg19 band ends on GRCh38 positions; the Nextflow module did the same whenever `--cytoband` was not set, which is the default. The script now installs the copy the repository ships (`assets/reference/cytoBand.hg38.txt`) before it runs, and the pipeline passes that copy when `--cytoband` is not set. The step also moves from TelomereHunter 1.1.0, Python 2.7 code, to its maintained successor TelomereHunter2 1.0.12 (`TELOMEREHUNTER_IMAGE`, `quay.io/biocontainers/telomerehunter2`). On the image test's input both give the same `tel_content` (5347.255643 with 1,100 planted telomeric reads, 5337.585253 with 1,098), so earlier values stay comparable. THREADS now sets its worker count (`-c`), and the container gets a higher open-file limit, which it needs on a BAM with many contigs. Output change: `telomere///_summary.tsv` keeps its name, but its columns follow TelomereHunter2 (`tel_content` third, `intratelomeric_reads`, `tel_read_count`, `read_lengths`, plus three read-class counts). `summary.json` and the reports read both layouts by name and do not change. The docs no longer describe the value as an age measure: `tests/test_telomere_wording.sh` fails when a file that describes step 10 does. Part of #411 (trait-46, trait-47, trait-48, trait-49). - Step 25 and the Nextflow `PRS_SUMMARY` withhold a score's percentile when the genotypes pgsc_calc scored list variants only. Every site such a VCF leaves out adds nothing to the sum, so the sum leans away from the panel's sums, which come from complete genotypes, and the percentile was not comparable. Each score keeps its raw sum. Its `Percentile` is `NA`, its `Effect` is empty, and a new column before `Input`, `Percentile_Note`, says `percentile withheld: the input lists variants only`. The decision reads the genotypes, not the kind of input: at least one genotyped position in five must be a reference call (0/0), the rule step 26b applies to the panel's sites. Genotypes from a gVCF and chip VCFs from `scripts/chip-to-vcf.sh`, which list their reference calls, keep their percentiles. `og prs table` takes the genotypes with a new option, `--target VCF`, and prints the NOTE that step 25 printed before; the NOTE now follows the genotypes too, so a gVCF without reference blocks at the score positions gets it. `og summary collect` passes the note on as `percentile_note`. When every percentile was withheld, both reports say "Percentile withheld: the input lists variants only" and why, and the summary's `not_assessed` list says the percentiles were withheld, in place of the lines for a run without the panel, which told the user to install a panel the run had used. The output gains one column; no column, option or file name changes. +- Step 41 (blood groups) no longer reads a VCF that does not cover a gene as the reference allele. Without a BAM, a system with no VCF record at any of its sites now reads `not assessed` (phenotype and confidence) instead of the reference phenotype at confidence medium, so a VCF with no chr9 record no longer reads ABO as O. A call with a genotype quality (`GQ`) under 20 or a read depth (`DP`, else `MIN_DP`) under 8 keeps its genotype but gives its system confidence low, and the note and the evidence file name the values. An ABO A allele now reads at confidence low, because no variant shows it: it is what is left of a functional allele with neither c.802G>A nor c.803G>C. Duffy reads the VCF's phase: a GATA box phased with one Fyb in one phase set goes on the chromosome the VCF gives (on Fya that is Fy(a-b+)). When H reads H- and ABO is `not assessed` or `not determined`, the ABO row no longer carries the Bombay note about its alleles. The notes now say what the DNA cannot check: the ABO alleles outside the five variants, RHD null and DEL alleles behind a D+, and null alleles the table does not hold. The table keeps its columns; `not assessed` is a new value in the phenotype and confidence columns. +- summary.json has a new section, `acmg_sf`: the ACMG secondary-findings card, built from step 06's ClinVar hits on every run, with or without the VEP cache. Before, the card existed only inside step 23's clinical section, so a run without the VEP cache had no card at all. The new section's state follows step 06. Without step 23's clinical VCF it has `high_impact_checked: false` and a `high_impact_note` that says why and what it can miss (a predicted loss-of-function variant not in ClinVar). A clinical VCF that cannot be read no longer costs the ClinVar rows of this card. `sections.clinical.data.acmg_sf` stays as it was, and the reports still read the card there, so they show it only when step 23 ran. The first run after the update lists the new section under "New since" once. +- Two CYP2D6 callers no longer count as agreeing on too few reads. The CYP2D6 depth check (`og pgx cyp2d6-check`, steps 21 and 32) looked only at the share of reads with MAPQ 0, so flanks at 6x with every read mapped well passed as fit for a copy-number call, and step 36 passed pypgx and Cyrius's shared diplotype to PharmCAT. The check now also needs 10x or more in the flanks at MAPQ >= 1. Under that its status is `unreliable` and its message says `agreement not counted (depth)`: pypgx's CYP2D6 row reads `Indeterminate`, the Cyrius call gets Filter `CYP2D6_depth_unreliable`, and step 36 withholds CYP2D6 with that message as its reason. Multi-mapped reads are still named first. Step 36's consensus table also shows weak pypgx evidence: when step 32's `Defining_filter` is not `PASS` or its `Quality` is not `ok`, the `Evidence` column reads `pypgx: , weak evidence (...)`. A call Cyrius agrees with is still passed. The file names and columns are unchanged; the `Evidence` text and the check's verdict on shallow flanks are new. Part of #411 (pgx-09, pgx-01). +- One switch now runs every optional step. Before, a run that should run everything had to name each opt-in step in `TOOLS` and set each switch by hand, and nothing said when a new opt-in was missing from that list. `EVERYTHING=true ./scripts/run-all.sh ` reads the new list `assets/everything.tsv`: it puts every `--tools` name in `TOOLS`, sets `KIR`, `HLA_QC`, `TIDDIT`, `GRIDSS`, `IMPUTATION`, `SOMATIC` and `BENCHMARK` to `true` and `EXTRA_CALLERS` to all four callers. A step whose data is not installed, or a panel set to `none`, stops the run with exit 2 before Nextflow, and the error names the setup command. That includes the classic BWA index that GRIDSS (step 4b) needs, which `setup.sh` does not build. A refused run leaves the last run's `logs/run_status.tsv` as it was. `TOOLS`, or a switch set to another value, also stops it with exit 2. A skip that comes from the sample stays a skip: no BAM, no gVCF, a female sample for the Y steps, a BAM that is not PacBio HiFi for Paraphase. On the Nextflow path, `-profile everything` (`conf/everything.config`) sets the same tools and switches. `og dev everything-check`, in Guard, fails when `main.nf`, `nextflow.config`, `run-all.sh`, `setup.sh` or `versions.env` gains an opt-in with no row in the list. Without `EVERYTHING` a default run does not change, with three exceptions. `TIDDIT=true` is a new switch that runs `04a-tiddit.sh` after the pipeline. Step 37 (Yleaf) on a female sample is now listed as `skipped (female sample: no Y chromosome)`, as step 45 already was; the pipeline skipped it for her before, so no result changes. Step 35b (Paraphase) on a BAM that is not PacBio HiFi, or on a FASTQ row, is now `skipped (not PacBio HiFi: ...)` instead of a failed step: `run-all.sh` runs `og paraphase check-bam` on the BAM first. `logs/run_status.tsv` records `EVERYTHING` and `TIDDIT` with the other switches, and `og recheck --rerun` replays them. - A third-party outage no longer fails the Freshness check of a pull request. Since 2026-11-18 rest.ensembl.org has not answered, and the pull-request job's dry run of `og dev freshness` failed on every pull request that touched `versions.env` or `og-fresh`. `og dev freshness --unreachable-warns` now lists a lookup whose upstream did not answer (no connection, a timeout, HTTP 5xx or 429 after the retries, or HTTP 403) under "Upstreams that did not answer" as a warning, and its database row reads `NO ANSWER`; it does not change the exit. The 403 counts because rest.ensembl.org came back on 2026-11-19 answering 403 to GitHub's runners and 200 elsewhere, which still failed the pull-request job. A 404, an empty answer or an answer in an odd shape still exits 1. `freshness.yml` passes the flag only in the pull-request dry run. Without the flag the report and the exit are as before, and the monthly report on main still counts an outage as an error in the issue. - Three statements in the docs were wrong. Troubleshooting said exit code 137 confirms a kill for memory, and checked it with `docker ps -a --latest`. 137 is any SIGKILL, and the step scripts run their containers with `--rm`, so that command shows an older, unrelated container. The page now says how to confirm a kill for memory: `docker events --filter event=oom`, the kernel log, or `.State.OOMKilled` for a container kept without `--rm`. The run-state and troubleshooting pages said `bin/og` does not run on a Mac and told Mac users to build `og` with cargo or run it in a container. `bin/og` runs the native macOS build that `scripts/setup.sh --og` installs, and the pages now say so; on a Mac, `og run headroom` reports the machine's memory as unknown. Troubleshooting, the FAQ and the lessons-learned page said the step scripts run their containers as root, and lessons-learned gave `:latest` images and `chmod 777` as current fixes. The step scripts run their containers as you; those entries are now marked as past fixes and name what the pipeline does today. Documentation only: no option, output or behaviour changes. - Lint's ShellCheck job now checks every tracked shell script, not only `scripts/`: the e2e cases and their library, the fake-docker and parity tests, `tests/*.sh`, `bin/og` and the fake tools, 482 files in all, at every ShellCheck level. The 265 findings these files hold today are listed in `tests/shellcheck-baseline.txt` and still pass; any other finding fails lint. A listed finding is matched by its file, its code and the text of its line, so it keeps matching when lines above it move, and a new line with the same mistake still fails. Each run plants an unquoted `$1` in a new test script and on a new line of a listed script, and fails if either passes or if the file search misses the new script or `bin/og`. The `scripts/` check at warning level stays as it was. Part of #411 (plat-10). @@ -27,6 +33,8 @@ Each release's notes. From 1.0.0 on, a major or minor release has hand-written n - `og y private-snps` drops a call as public only when a table names the same change at that position (the same two bases, either order). Another base at a known position is a new mutation and stays in the list. A VCF with more than one sample is read only when `--sample` names one of its columns, and refused otherwise; before, the scan read the first column, which could be another man's. The file's columns do not change. - HLA-B drug answers no longer depend on the order T1K prints tied alleles. T1K writes equally likely candidates of one allele comma-separated, with one quality. Step 36 (`og pgx outside-calls`) cut the whole field to two fields, so PharmCAT got whichever candidate T1K printed first: a B\*57:01/B\*58:01 tie passed as B\*57:01 in one order and B\*58:01 in the other, which flips abacavir and allopurinol guidance. Now each candidate is read. When the tie, or an allele with an expression suffix (`N` null, `Q` questionable), leaves open whether HLA-A\*31:01, HLA-B\*15:02, \*57:01 or \*58:01 is there, the gene is `indeterminate`, is not passed, and its reason reads `ambiguous: B*57:01 possible, B*58:01 possible (T1K ties *57:01 and *58:01 on one allele)`. An OptiType call that matches one candidate does not decide it. A tie or a null that names none of those alleles still passes the gene, so a sure B\*57:01 on the other copy is not lost; the reason names the stand-in. Two-field names keep their expression suffix (`*02:53N`), so a T1K null no longer agrees with OptiType's expressed `*02:53` in step 08's concordance table, which also lists tied candidates comma-separated. OptiType never calls a null, so step 36 still compares it with the names PharmCAT reads and passes such a pair; the table's note says so. `summary.json`'s `withheld_from_pharmcat` follows the same rule, and the HLA allele table reads a null form of an allele (`B*57:01:01N`) as uncertain, not present. `og summary collect` also finds `bin/hla_alleles.tsv` beside its `--assets` folder, so a binary outside the checkout run from another folder no longer reads the HLA section as unreadable. No option, file or column changes; only these values do, and every input without a tie or a suffix gives the same bytes as before. When pypgx and Cyrius agree on CYP2D6 with a passed depth check, the call is still passed whatever pypgx's `Defining_filter` and `Quality` say; a cargo test now pins that rule. The docs no longer call OptiType independent: both callers read the same alignment, so their agreement is extra evidence, not validation. - Step 20's section of `summary.json` flags the heteroplasmic calls that PASS alone does not make reliable, and keeps them counted. A call whose bases touch either end of the control region (m.1-500 or m.16000-16569, where reads that span the origin of the circular reference align poorly) gets `origin_edge`. A call under 0.10 AF, the low-level range where missed NuMT reads look like calls, gets `low_af`. Before, both read like every other PASS call, ClinVar class included. Each entry of `heteroplasmic_sites` and each row of `annotation.variants` now carries both flags, and `heteroplasmic_origin_edge` and `heteroplasmic_low_af` count the flagged calls beside the `heteroplasmic` total, with `origin_edge_regions` and `low_af_ceiling` naming the limits. No call leaves a count or a list: a PASS m.3243A>G at AF 0.07 carries `low_af` and is still in the ClinVar pathogenic count and the confirmed variants. Fields are only added; none is renamed or removed. The reports do not show the flags yet. +- Step 20 now finds the ClinVar and gnomAD record of a mitochondrial indel wherever in its repeat each side writes it. `og mito annotate` matched an indel only on the exact spelling, and looked for ClinVar's record at most one base away. An indel in a homopolymer can be written at any place in it, so one C more in the m.311-315 tract, written m.315C>CC by one side and m.310T>TC by the other, got no ClinVar class and no gnomAD frequency. When the exact spelling finds nothing, the allele is now moved to the left end of its repeat on the rCRS (GRCh38's chrM) and matched there, on both sides; an exact match still wins, and an allele whose REF, as written, is not the rCRS is not moved. `_chrM_annotated.tsv` keeps its columns, and each row keeps the call's trimmed position, REF and ALT as before, never the moved spelling; only `.` cells can now hold a value. Part of #411 (lin-35). +- Step 20 and the Nextflow run (on the console, when it starts) warn when the NuMT filter had no autosomal depth (no mosdepth output, and no `AUTOSOMAL_COVERAGE` in step 20), so it ran at depth 0 and marked nothing, and the annotation table says so. `og mito annotate` has a new switch, `--numt-default`, which adds a `# numt` header line that reads `NuMT filter used a default depth` to `_chrM_annotated.tsv`; step 20 and `MITO_VARIANTS_ANNOTATE` pass it in that case. A run with a depth writes the table as before. The reports do not show the line yet. Part of #411 (lin-32). - The run manifest stays whole when two scripts write it at once. `bin/write_manifest.sh` built every manifest in one shared file, `run_manifest.tsv.tmp`. When a run and a report script wrote one sample's manifest at the same time, each emptied and appended to the other's file, and the manifest that landed had rows missing or repeated. Each writer now builds its manifest in a temporary file of its own beside `run_manifest.tsv` and renames it into place, so the manifest is always one writer's whole manifest. A writer that stops early removes its temporary file. `tests/test_write_manifest.sh` runs three writers at once; its control copy with the shared name breaks the manifest. The manifest's rows and format do not change. - The delta report words each reason it gives for a changed result as a guess. The "why" of a change read `changed inputs: VEP_CACHE_RELEASE 115 -> 116`, which reads as the cause. The delta only knows which inputs changed and which inputs feed the section, so it now reads `likely from changed inputs: VEP_CACHE_RELEASE 115 -> 116`, in `_delta.json`, `.txt` and `.html`. The line for a result whose tracked inputs did not change names no cause and stays as it was. No file, field or column changes; only the text of `why`. - Step 46's LPA KIV-2 message now says what its interval covers and what the count adds up. It read `about N KIV-2 repeats in total (95% interval LOW to HIGH)`, which looked like a calibrated range for one chromosome. The interval comes only from how the depth varies between exons, read as independent, so it covers read sampling and leaves out any aligner or library bias; the count is the total over both copies of chromosome 6. The message is now `about N KIV-2 repeats in total over both copies (95% interval for read sampling, LOW to HIGH; aligner or library bias not included)`, then the class reading as before. Only the `message` value of `lpa/_lpa_kiv2.tsv` and the step's stdout line change; the columns `kiv2_copies`, `ci95_low` and `ci95_high` keep their names and values. @@ -63,8 +71,14 @@ Each release's notes. From 1.0.0 on, a major or minor release has hand-written n - Step 42 now says when a genotype rule's reading assumes which variants share a copy. Heterozygous at both HFE sites read as C282Y/H63D, one change on each copy, with no word that the two changes could sit on one copy. The same held for SERPINA1 PiSZ and GC Gc1S/Gc2, and the other way round for APOL1 G0/G1, CAD9p21 "one risk copy" and MAPT H1/H2, which assume both sites sit on one copy. Such a reading now ends with "Phase unknown: this reading assumes ...". `og traits phase-sites` also sends those sites to WhatsHap. When one phase block holds them, a confirmed pair reads without the note (`phase` read_backed), and a pair with a copy the rule does not describe reads `other_haplotype`, not read: C282Y and H63D on one copy say that one copy is changed and the other is not. The columns of `_genotype_rules.tsv` stay the same; only the `reading`, `phase` and `status` values of these double heterozygotes change. APOE is unchanged: its line already names both pairs. Part of #411 (trait-02, trait-03, trait-05, trait-06, trait-25). - og-admix has our own local-ancestry painting engine, `og_admix::paint`, written from the published equations of the copying model FLARE uses; no FLARE or RFMix source was read. Each hidden state is an ancestry and a reference haplotype of it. Ancestry events come at T per Morgan and draw the new ancestry from mu; inside an ancestry the copied haplotype jumps at rho_a per Morgan; the copied allele differs from the target's with chance epsilon. Each forward and backward step costs O(H) through per-group totals, the forward values are kept every sqrt(M) sites, and the reference haplotypes are bit-packed. Up to 5 EM rounds over the whole genome fit mu, T, epsilon and rho_a, starting from mu of the continental projection, T 10, epsilon 0.01 and rho_a 4Ne/n_a; `write_params` writes them as `paint/params.tsv`. Chromosomes and haplotypes run on a set number of threads and give the same bytes on any number. No step calls the engine yet, so nothing a run writes changes; step 26b still paints with RFMix. The cargo test `tests/anc_paint_engine.rs` paints a simulated two-group chromosome of 2,000 sites with one breakpoint (bp accuracy 0.9995, the breakpoint 0.002 cM off) and fails it with an emission of 0.5; checks forward-backward against a brute-force model within 1e-9 and the checkpoints against full storage within 1e-12; and measures a 22-chromosome painting under 1 GB. - The monthly freshness issue now says when a curated drug table no longer matches its source. Three rows join its database table. Each row of `assets/pgx_contraindications.tsv` is compared with its CPIC pair (the pair exists, its level, still provisional) and with its DailyMed label (still published). `assets/pgx_inhibitors.tsv` is compared with the FDA table of CYP inhibitors: each row's class, and any strong or moderate CYP2D6, CYP2C19, CYP2C9 or CYP2B6 inhibitor, or strong CYP3A inhibitor, that has no row. fda.gov refuses GitHub's runners, so when it does not answer, the newest Wayback Machine capture of the page is read instead, the row names the capture date, and a capture older than 92 days is an error. `assets/pgx_genes.tsv` is compared with the gene table of the newest pypgx release. A row that differs shows as `drift` with the row named; it is a warning to fix the table, and the run stays green. A source that does not answer, or answers empty, is an error as for every other lookup. The freshness checks now also run on a pull request that changes one of the three tables. `og dev freshness --self-test` plants a row whose CPIC level moved from A to B and fails unless it shows as drift. No pipeline output changes. +- A recessive secondary finding now needs two different copies of the gene hit. The ACMG SF tier of `og summary collect` added up the alt copies of a gene's records, so three things completed the two hits that MUTYH, BTD, ATP7B and the other recessive genes need, and reported a carrier as affected: + - Two variants that read-backed phase puts on one copy (a `|` genotype and the same phase set, PS), as a provider VCF from DRAGEN or a long-read phaser can hold. They are now listed apart under `not_reported`, with the phase set. Two variants on different copies are biallelic. A `|` genotype with no PS, or a half call such as `1|.`, is phase unknown. + - A combined allele of step 06 counted together with its own parts, from ClinVar or as a HIGH-impact record. It now counts once, unless it is unphased and two of its parts are hits on their own: those may sit on different copies. + - A record with no alt copy called (`./.`, `0/0`), which counted as one copy. It now counts nothing and is listed apart with the reason. Steps 06 and 23 never write such a record, so no pipeline run changes. + Two variants of unknown phase are still reported, as the ACMG rule says. Each finding of a gene whose rule needs two hits now has two new fields: `pair`, `biallelic` (a homozygote, a phased trans pair, the two alt alleles of one split call, or a deletion pair the reads prove) or `possibly biallelic`, and `phase`, which says why. The reports do not show them yet. A ClinVar finding and a carrier-list entry that is a combined allele, or a part of one, now carry the note of the ClinVar table as `combined_allele`. In the two-hit rule, a hypomorph (such as the RBM8A low-expression allele) called homozygous inside a called deletion is now possibly biallelic, not biallelic, and is not shown as hemizygous: without a real deletion it is a homozygous hypomorph, which is no finding. A full loss-of-function variant there stays biallelic, and its reason now says it holds whether the deletion is real or not. No field is renamed or removed. - Each `run-all.sh` run now ends with `bin/og facts`, which writes `facts/_genome_facts.json` in the format `ownhealth.genome-facts/v1`, readable by its owner only (mode 600). [OwnHealth](https://github.com/GeiserX/OwnHealth) imports this file, with the sample's VCF, to show the genome next to the rest of a person's record: `docs/ownhealth.md` says how. The file is a stable output under the 1.0 promise and is listed in the output contract. It is skipped when the HTML report fails, and an earlier run's file is removed before a run starts. A plain `nextflow run main.nf` does not write it yet; `bin/og facts` writes it by hand. - `og report index build --summary summary.json [--sample-dir DIR] -o _search_index.json` writes the run's search index in Rust. `og report index query --index FILE QUERY` answers one query with the rule of the live site's search box (`assets/live/plugins/search.js`); a cargo test runs that script under node against the Rust rule. The file is the one `bin/results_index.py` writes: the same terms, sections, anchors, counts and mentions, and the same answer to each query. No step calls the verb yet: step 24 and the Nextflow report still write the index with `bin/results_index.py`. One field is not written yet: `veil`, which tags an item that names a result a child's page keeps closed. It needs the live site's findings, which are not ported yet. +- `og report charts --summary summary.json --charts-json _charts.json` builds the report's five charts in Rust: the ClinVar stars, the genome (runs of homozygosity, ClinVar hits, AnnotSV class 4 and 5 SVs, MoChA calls), the heteroplasmic chrM sites, fine-grained ancestry and the PRS percentiles, each as data and as inline SVG. It writes the same file as `bin/render_report.py --charts-json`, byte for byte, on the 154 summaries of the report corpus, and prints the same "Sections:" line. The specs are built once in `og-render` (`charts::build`), with each chart's HTML report line (`charts::figure`) for the report and the JSON for the live page. No step calls it yet: `bin/render_report.py` still writes the charts until the reports switch to og. The chart checks of `tests/test_report_charts.py` moved to `rust/crates/og-render/tests/charts.rs`. The file keeps the checks of what `bin/render_report.py` still ships: where each chart sits in the HTML report, two renders giving the same charts file, and the live page in a browser. - Step 37 and the Nextflow `Y_HAPLOGROUP` process run Yleaf through its own command line. `bin/yleaf_run.py`, our Python launcher that patched Yleaf at run time (its data folder, its reference, its samtools calls and its process pools), is gone. Yleaf 4.1.7 has the options the launcher stood in for: `-rp` reads the pileup the step makes beside the chrY BAM, `--ref-fasta` names the reference so it downloads none, and `--no-update-check` keeps it offline. Yleaf now predicts with the marker table and tree its image ships; the image test checks they are the files of the archive `setup.sh --yleaf-data` installs, whose positions the pileup is made at, and that Yleaf still has those options, that pileup file and the samtools flags the pileup uses. When no read falls on any marker, Yleaf stops before it predicts, so `og y yleaf-no-reads` writes the row it gives for too few markers (`Hg` NA, the BAM's mapped reads), as the launcher did. On the fixture's chrY slice the prediction table and every file Yleaf writes are the same, byte for byte, as with the launcher, and so is the empty-pileup row. No option, output file or column changes. Step 37 now stops with a clear message when `REF_FASTA` does not end in `.fa`, `.fasta` or `.fna` (a compressed FASTA, say): Yleaf's `--ref-fasta` takes no other name, and the Nextflow `--reference` already asks for a plain FASTA. `setup.sh` installs `.fasta`. - The exome guide no longer says the drug-gene steps work unchanged on an exome. Some variants that define a star allele sit outside the coding exons, such as CYP2C19 \*17, CYP3A5 \*3, CYP3A4 \*22 and UGT1A1 \*28 and \*80, so a typical capture does not read them. PharmCAT then cannot call those alleles, and a gene can read as normal function when it is not. `docs/wes-guide.md` now lists the PharmCAT 3.4.0 positions that a capture of the coding exons misses, gene by gene, and tells you to check `${SAMPLE}.missing_pgx_var.vcf` before you act on a call from an exome. Step 7's limitations say the same. Docs only; no output changes. - Four commands in docs tables now copy and run as written. The docs site printed the backslash that escaped each pipe for GitHub, so the Nextflow install line in Getting started read `curl -s https://get.nextflow.io \| ...`, which is not a pipeline. That row now points at the install command in Full run. The BAM build check of the FAQ and the site table hash of Keeping versions up to date moved into code blocks under their tables, and the `readings` row of Copy Number from Depth names its separator in words. `tests/test_docs_table_pipes.sh` fails when a table row under `docs/` holds an escaped pipe inside a code span. diff --git a/assets/acmg_sf.tsv b/assets/acmg_sf.tsv index 66c1fed5b..873ffc099 100644 --- a/assets/acmg_sf.tsv +++ b/assets/acmg_sf.tsv @@ -1,5 +1,6 @@ # acmg_sf.tsv: the ACMG SF v3.3 secondary-findings genes and the reporting rule of each -# (bin/collect_summary.py acmg_sf_tier). One row per gene, 84 rows. Source: Lee et al., ACMG SF v3.3 +# (og summary collect, rust/crates/og-summary/src/collect/acmg.rs). One row per gene, 84 rows. +# Source: Lee et al., ACMG SF v3.3 # list for reporting of secondary findings in clinical exome and genome sequencing, Genet Med # 2025;27(8):101454 (PMID 40568962, doi:10.1016/j.gim.2025.101454), Table 1 and its footnotes, read # 2026-10-27. HGNC ids from rest.genenames.org on 2026-10-27; GRCh38 positions from Ensembl. @@ -8,14 +9,21 @@ # inheritance AD, AR, SD (semidominant) or XL, as Table 1 gives it # report_if when a P/LP variant (ClinVar, or a rare HIGH-impact record) is a secondary finding: # any one variant is enough -# biallelic two variants: a homozygote, or two different variants even when -# their phase is unknown (Table 1 footnote a); a called deletion -# of the gene (AnnotSV, step 35's copy number) counts as one of the -# two unless read-backed phase puts it on the variant's copy -# (bin/collect_summary.py two_hits); so it does for hemizygous +# biallelic both copies of the gene hit: a homozygote, or two different +# variants even when their phase is unknown (Table 1 footnote a; +# reported as possibly biallelic). Two variants that read-backed +# phase puts on one copy (a "|" GT and the same PS) are one copy +# and are not reported; a "|" GT with no PS, or a half call such +# as 1|., is phase unknown. A combined allele of step 06 counts +# once with its parts, and a record with no alt copy called counts +# nothing. A called deletion of the gene (AnnotSV, step 35's copy +# number) counts as one of the two unless read-backed phase puts +# it on the variant's copy (og-summary two_hits); so it does for +# hemizygous # hom_variant only a variant of the variants column, homozygous -# hemizygous a hemizygous or homozygous variant, or two heterozygous ones; a -# single heterozygous variant is not reported +# hemizygous a hemizygous or homozygous variant, or two heterozygous ones +# counted as for biallelic; a single heterozygous variant is not +# reported # het_female_too any variant, heterozygous females included # variants report_if hom_variant: the only variants that count, as chrom:pos:ref:alt (GRCh38) # and a name; "." for every other gene diff --git a/assets/everything.tsv b/assets/everything.tsv new file mode 100644 index 000000000..a7ad9a018 --- /dev/null +++ b/assets/everything.tsv @@ -0,0 +1,159 @@ +# assets/everything.tsv: every optional part of a run, and what EVERYTHING=true (scripts/run-all.sh) and +# -profile everything (conf/everything.config) do with it. One row per item; `og dev everything-check` fails when +# main.nf, nextflow.config, run-all.sh, setup.sh or versions.env gains an item with no row here. +# kind: tool (a main.nf --tools name: EVERYTHING names it), switch (a run-all.sh switch: EVERYTHING sets it to +# value), setup (a setup.sh flag: value names the rows whose data it installs), input (a choice or a file only +# the user can give: EVERYTHING leaves it to them), image (an optional image of versions.env: value names the row +# whose step runs it), excluded (left out: reason says why). +# value: tool and input rows: how to install the data, '-' when none is needed; switch rows: the value EVERYTHING +# sets; setup and image rows: the rows they serve, comma separated. +# nextflow: switch rows with a Nextflow parameter: that parameter as conf/everything.config sets it, else '-'. +# Rows named -- stand for a Nextflow parameter that has no run-all.sh switch. +kind name value nextflow reason +tool pharmcat - - step 07 +tool cpic - - step 27 +tool clinvar setup.sh - step 06 +tool pypgx the pypgx-bundle, by hand: docs/00-reference-setup.md - step 32 +tool vep setup.sh --vep-cache - step 13 +tool vcfanno setup.sh --vep-cache, then the score files of docs/00-reference-setup.md - step 30 +tool slivar setup.sh --vep-cache - step 31 +tool clinical_filter setup.sh --vep-cache - step 23 +tool cpsr setup.sh --clinical-data - step 17 +tool roh - - step 11 +tool prs setup.sh - step 25 +tool ancestry setup.sh --ancestry-panel - step 26 +tool ancestry_fine setup.sh --ancestry-fine-panel - step 26b +tool mito_haplogroup - - step 12 +tool hla_typing setup.sh - step 08 +tool expansion_hunter - - step 09 +tool stranger - - step 9b +tool telomere_hunter - - step 10 +tool mosdepth - - step 16b +tool mito_variants - - step 20 +tool cyrius setup.sh --cyrius - step 21; its licence is non-commercial, and installing it accepts that licence +tool manta - - step 04 +tool delly - - step 19 +tool cnvpytor the CNVpytor resources, by hand: docs/00-reference-setup.md - step 18 +tool duphold - - step 15 +tool annotsv setup.sh --annotsv-data - step 05 +tool survivor_merge - - step 22 +tool sample_qc setup.sh --sample-qc-data - step 33 +tool parascopy setup.sh --parascopy-data - step 35 +tool paraphase - - step 35b; a BAM that is not PacBio HiFi is skipped +tool y_haplogroup setup.sh --yleaf-data - step 37; a female sample is skipped +tool html_report - - step 24; run-all.sh writes the report itself after the pipeline +tool multiqc - - step 28 +tool consumer_export setup.sh --consumer-sites - step 40 +tool bloodtype - - step 41 +tool lpa - - step 46 +tool vntyper - - step 52 +tool traits - - step 42 +tool archaic setup.sh --archaic - step 43 +tool ancient setup.sh --ancient-panel - step 44 +tool y_str - - step 45; a female sample is skipped +tool viral setup.sh --viral-data - step 47 +tool chip setup.sh --chip-data - step 49 +tool mei setup.sh --megane-kmers - step 50 +tool mocha setup.sh --mocha-data - step 51 +tool locityper setup.sh --locityper-data - step 53 +input exomiser setup.sh --exomiser-data - step 48 runs when HPO (or --hpo) names the symptoms; naming it without them stops the run +excluded cram_archive - - a CRAM copy of each BAM for the archive: it costs disk and adds no result +switch KIR true --kir true step 08 types the KIR genes too; setup.sh --kir-data +switch HLA_QC true --hla_qc true step 08 runs OptiType beside T1K +switch CPSR_SECONDARY_FINDINGS true --cpsr_secondary_findings true step 17 also screens the ACMG SF genes +switch GRIDSS true - script 04b after the pipeline +switch TIDDIT true - script 04a after the pipeline +switch IMPUTATION true - script 14 after the pipeline +switch SOMATIC true - script 29 after the pipeline +switch EXTRA_CALLERS gatk,freebayes,strelka2,octopus - scripts 03a to 03d after the pipeline +switch BENCHMARK true - benchmark-variants.sh after the extra callers +input HPO setup.sh --exomiser-data - the symptoms as HPO ids; only the user knows them +input FAMILIES - - who is related to whom; steps 38 and 39 run when the family has what they need +input ALIGN_DIR - - the BAM of another aligner (script 02a writes aligned_bwamem2/) +input REF_FASTA - - another GRCh38 build +input EH_CATALOG - - another catalog for steps 09 and 9b +input MANTA_CALL_REGIONS - - the regions Manta calls on +input PARASCOPY_POPULATION - - the Parascopy model; EUR when unset +input PARAPHASE_REGIONS - - the Paraphase regions; all when unset +input ANCESTRY_PANEL - - another panel for step 26; none skips the step, which EVERYTHING=true refuses +input ANCESTRY_FINE_DIR - - another panel for step 26b; none skips the step, which EVERYTHING=true refuses +input ARCHAIC_DIR - - another table for step 43; none skips the step, which EVERYTHING=true refuses +input ARCHAIC_POP - - the 1000 Genomes group of step 43; ALL when unset +input PGSC_CALC_DIR - - another pgsc_calc checkout +input ANCIENT_PANEL_DIR - - another panel for step 44 +input VIRAL_REF - - other viral genomes for step 47 +input MEGANE_KMERS - - another k-mer set for step 50 +input MOCHA_DATA - - another panel for step 51 +input LOCITYPER_DATA - - another database for step 53 +input LOCITYPER_BG_REGION - - another background region for step 53 +input long-read - - scripts 02b, 03e and 04c read ONT or PacBio HiFi reads: run them by hand on long-read data +input --pedigree - - the family file of the Nextflow path (FAMILIES on run-all.sh) +input --medications - - the drugs taken, for step 27's phenoconversion +excluded EVERYTHING - - this switch +excluded TOOLS - - EVERYTHING=true names every tool itself, so it refuses TOOLS +excluded GENOME_DIR - - where the data is, not a step +excluded SKIP_VALIDATION - - skips a check, not a step +excluded THREADS - - a resource cap, not a step +excluded SKIP_TRIM - - skips fastp, so it removes a step +excluded INTERVALS - - calls part of the genome, so it removes work +excluded OWNGENOME_LIVE_URL - - the live site's address, not a step +excluded NXF_VER - - the Nextflow release, not a step +excluded NXF_WORK - - Nextflow's work folder, not a step +excluded NXF_HOME - - Nextflow's home folder, not a step +excluded NXF_OFFLINE - - Nextflow's offline mode, not a step +excluded --allow_unfiltered - - accepts a VCF with no FILTER=PASS record: an input choice, not a step +excluded --skip_trim - - skips fastp, so it removes a step +excluded --prs_keep_ambiguous - - changes which rows of a score count, not which steps run +setup --cyrius cyrius - Cyrius, under its non-commercial licence +setup --parascopy-data parascopy - Parascopy's table and models +setup --kir-data KIR - IPD-KIR +setup --ancestry-panel ancestry - pgsc_calc's ancestry panel +setup --ancestry-fine-panel ancestry_fine - the fine-grained ancestry panel +setup --yleaf-data y_haplogroup - Yleaf's tables +setup --consumer-sites consumer_export - the 23andMe v5 site table +setup --ancient-panel ancient - the AADR panel +setup --viral-data viral - the viral genomes +setup --exomiser-data exomiser,HPO - Exomiser's data +setup --chip-data chip - Ensembl's gene annotation +setup --strchive-data expansion_hunter,stranger - the STRchive catalog; part of a full setup +setup --megane-kmers mei - MEGAnE's k-mer set +setup --mocha-data mocha - MoChA's panel +setup --locityper-data locityper - Locityper's database +setup --vep-cache vep,vcfanno,slivar,clinical_filter - the VEP cache; part of a full setup +setup --annotsv-data annotsv - AnnotSV's data; part of a full setup +setup --archaic archaic - the archaic table +setup --clinical-data cpsr,vep - the VEP caches and the CPSR bundle; part of a full setup +setup --sample-qc-data sample_qc - somalier's sites and VerifyBamID2's panel; part of a full setup +excluded --masked-reference - - another reference: every sample is aligned again on it +excluded --og - - builds og, which a full setup does too +excluded --no-clinical-data - - installs less +excluded --pull-only - - pulls the images only +excluded --refresh - - replaces ClinVar with a newer release +image BWAMEM2_IMAGE ALIGN_DIR - script 02a +image BWA_IMAGE GRIDSS - the classic BWA index of script 04b +image FREEBAYES_IMAGE EXTRA_CALLERS - script 03b +image STRELKA_IMAGE EXTRA_CALLERS - script 03c +image OCTOPUS_IMAGE EXTRA_CALLERS - script 03d +image CLAIR3_IMAGE long-read - script 03e +image TIDDIT_IMAGE TIDDIT - script 04a +image SNIFFLES_IMAGE long-read - script 04c +image HAPPY_IMAGE BENCHMARK - benchmark-variants.sh +image YLEAF_IMAGE y_haplogroup - step 37 +image HIPSTR_IMAGE y_str - step 45 +image OPTITYPE_IMAGE HLA_QC - step 08 with HLA_QC=true +image PARASCOPY_IMAGE parascopy - step 35 +image PARAPHASE_IMAGE paraphase - step 35b +image MEGANE_IMAGE mei - step 50 +image VNTYPER_IMAGE vntyper - step 52 +image LOCITYPER_IMAGE locityper - step 53 +image GLNEXUS_IMAGE FAMILIES - step 38 +image HAP_IBD_IMAGE FAMILIES - step 38 +image EXOMISER_IMAGE exomiser - step 48 +image ADMIXTURE_IMAGE ancestry_fine - step 26b +image BEAGLE_IMAGE ancestry_fine,mocha - steps 26b and 51 +image RFMIX_IMAGE ancestry_fine - step 26b +image BCFTOOLS_HTTPS_IMAGE --ancestry-fine-panel - setup.sh --ancestry-fine-panel +image MOCHA_IMAGE mocha - step 51 +image IBDMIX_IMAGE archaic - step 43 +image EIGENSOFT_IMAGE ancient - step 44 +excluded SAMTOOLS_HTTPS_IMAGE - - docs/quick-test.md reads a CRAM over https with it; no step runs it diff --git a/assets/output_contract.tsv b/assets/output_contract.tsv index 3e5af4be3..8315f2e05 100644 --- a/assets/output_contract.tsv +++ b/assets/output_contract.tsv @@ -428,6 +428,7 @@ switch VIRAL_REF - - - - experimental - - switch MEGANE_KMERS - - - - experimental - - switch MOCHA_DATA - - - - experimental - - switch GRIDSS - - - - stable - - +switch TIDDIT - - - - stable - - switch IMPUTATION - - - - stable - - switch SOMATIC - - - - stable - - switch EXTRA_CALLERS - - - - stable - - @@ -436,6 +437,7 @@ switch FAMILIES - - - - experimental - - switch OWNGENOME_LIVE_URL - - - - experimental - - switch LOCITYPER_DATA - - - - experimental - - switch LOCITYPER_BG_REGION - - - - experimental - - +switch EVERYTHING - - - - stable - - switch NXF_VER - - - - stable - - switch NXF_WORK - - - - stable - - switch NXF_HOME - - - - stable - - diff --git a/assets/steps.tsv b/assets/steps.tsv index 5f8bb5df1..aefdc50b1 100644 --- a/assets/steps.tsv +++ b/assets/steps.tsv @@ -22,6 +22,7 @@ step label tool recorded processes sections upstream hours hours_from hours_low 03c Strelka2 yes 02 03d Octopus yes 02 4 estimate 04 Manta manta yes MANTA manta 02 0.68 measured 0.3666 +04a TIDDIT yes 02 04b GRIDSS yes 02 8 estimate 05 AnnotSV annotsv yes ANNOTSV annotsv 15,19,18 0.03 measured 0.0166 06 ClinVar screen clinvar yes CLINVAR_SCREEN,CLINVAR_CDNA_CHECK clinvar,carrier 03 0.02 measured 0.0083 clinvar_file_date diff --git a/assets/viewer/serve.py b/assets/viewer/serve.py index fc7d1624d..7bf2a540f 100755 --- a/assets/viewer/serve.py +++ b/assets/viewer/serve.py @@ -1,40 +1,20 @@ #!/usr/bin/env python3 -"""Serve the local genome viewer (igv.js) for one sample on 127.0.0.1. - -scripts/owngenome-view.sh finds the sample's files and starts this server. -The live site serves the same page per run, behind its login, through -bin/owngenome_live_viewer.py, which reuses sample_files, build_config, -send_file and CSP from here. This server serves exactly these, and nothing -else from the disk: - - / index.html of this folder - /viewer.js the page's script, from this folder - /igv.min.js the pinned igv.js release owngenome-view.sh checked by sha256 - /config.json the reference, the tracks and the start locus (build_config) - /data// (name percent-encoded in the URL) the n-th file of the config: the reference FASTA and its - .fai, the BAM or CRAM and its index, the VCF and the SV VCF - and their .tbi - -It binds 127.0.0.1 only (BIND is not an option), answers byte-range requests -(igv.js reads a BAM, CRAM, FASTA or indexed VCF in pieces), refuses a Host -header that is not 127.0.0.1, localhost or [::1] (so a web page cannot reach -it through a DNS name pointed at 127.0.0.1), and sends a Content-Security- -Policy that lets the page talk to this server only: igv.js's own calls to -outside services (gene-name search, BLAT, genome lists) are blocked by the -browser, so nothing about the sample leaves the machine. +"""What is left of the local genome viewer's Python once it moved to +`og view serve` (rust/crates/og-live/src/viewer.rs, started by +scripts/owngenome-view.sh). Only the names the live site's viewer, +bin/owngenome_live_viewer.py, imports are kept: sample_files, build_config, +send_file and LIVE_CSP, and what they call. That plugin, and this file with +it, go when the live site's server moves to og. + +Both viewers pick Manta's diploid SVs before step 22's consensus. The local +viewer (og) also refuses a reversed locus; the live site's viewer never takes +a locus from the command line. """ -import argparse -import http.server -import json import os import re -import sys import urllib.parse -BIND = "127.0.0.1" -HERE = os.path.dirname(os.path.abspath(__file__)) -ALLOWED_HOSTS = {"127.0.0.1", "localhost", "[::1]"} CSP = ("default-src 'none'; script-src 'self'; connect-src 'self'; img-src 'self' data: blob:; " "style-src 'self' 'unsafe-inline'; font-src 'self' data:; worker-src 'self' blob:; " "base-uri 'none'; form-action 'none'; frame-ancestors 'none'") @@ -88,7 +68,7 @@ def first(*names): return next((p for p in (os.path.join(sample_dir, n) for n in names) if os.path.isfile(p)), None) return (first(f"aligned/{sample}_sorted.bam", f"aligned/{sample}_sorted.cram"), first(f"vcf/{sample}.vcf.gz"), - first(f"sv_merged/{sample}_sv_consensus.vcf.gz", "manta/results/variants/diploidSV.vcf.gz")) + first("manta/results/variants/diploidSV.vcf.gz", f"sv_merged/{sample}_sv_consensus.vcf.gz")) def build_config(sample, fasta, reads=None, vcf=None, sv_vcf=None, locus=None): @@ -170,115 +150,3 @@ def send_file(handler, head, ctype, src): break handler.wfile.write(chunk) left -= len(chunk) - - -class Handler(http.server.BaseHTTPRequestHandler): - server_version = "owngenome-view" - sys_version = "" - - def log_message(self, fmt, *args): - if not self.server.quiet: - sys.stderr.write("%s\n" % (fmt % args)) - - def _head(self, code, ctype, length, extra=()): - self.send_response(code) - self.send_header("Content-Type", ctype) - self.send_header("Content-Length", str(length)) - self.send_header("Cache-Control", "no-store") - self.send_header("Content-Security-Policy", CSP) - self.send_header("X-Content-Type-Options", "nosniff") - self.send_header("Referrer-Policy", "no-referrer") - self.send_header("Cross-Origin-Resource-Policy", "same-origin") - for k, v in extra: - self.send_header(k, v) - self.end_headers() - - def _fail(self, code, text): - body = (text + "\n").encode() - self._head(code, "text/plain; charset=utf-8", len(body)) - if self.command != "HEAD": - self.wfile.write(body) - - def _target(self): - host = re.sub(r":[0-9]+$", "", self.headers.get("Host") or "") - if host not in ALLOWED_HOSTS: - return None, "the Host header must be 127.0.0.1 or localhost" - # The config percent-encodes each file name (a space, '#' or '?' in - # it), so the browser asks for the encoded form; the routes hold the - # plain name. - path = urllib.parse.unquote(self.path.split("?", 1)[0].split("#", 1)[0]) - return self.server.routes.get(path), None - - def _serve(self): - target, err = self._target() - if err: - return self._fail(403, err) - if target is None: - return self._fail(404, "not found") - ctype, src = target - if isinstance(src, bytes): - data = src - self._head(200, ctype, len(data)) - if self.command != "HEAD": - self.wfile.write(data) - return - send_file(self, self._head, ctype, src) - - def do_GET(self): - try: - self._serve() - except (BrokenPipeError, ConnectionResetError): - pass - - do_HEAD = do_GET - - -def make_server(cfg, files, igv_js, port, quiet=False): - """The server on 127.0.0.1:port (0 picks a free port), not started.""" - routes = {"/": ("text/html; charset=utf-8", os.path.join(HERE, "index.html")), - "/index.html": ("text/html; charset=utf-8", os.path.join(HERE, "index.html")), - "/viewer.js": ("text/javascript; charset=utf-8", os.path.join(HERE, "viewer.js")), - "/igv.min.js": ("text/javascript; charset=utf-8", igv_js), - "/config.json": ("application/json", json.dumps(cfg, indent=1).encode())} - for i, f in enumerate(files): - routes[f"/data/{i}/{os.path.basename(f)}"] = ("application/octet-stream", f) - srv = http.server.ThreadingHTTPServer((BIND, port), Handler) - srv.daemon_threads = True - srv.routes, srv.quiet = routes, quiet - return srv - - -def main(argv=None): - ap = argparse.ArgumentParser(description=__doc__.split("\n\n")[0]) - ap.add_argument("--sample", required=True) - ap.add_argument("--fasta", required=True, help="reference FASTA, with its .fai beside it") - ap.add_argument("--reads", help="BAM or CRAM, with its index beside it") - ap.add_argument("--vcf", help="small-variant VCF") - ap.add_argument("--sv-vcf", help="structural-variant VCF") - ap.add_argument("--locus", help="chr, chr:pos or chr:start-end to open at") - ap.add_argument("--igv-js", required=True, help="the checked igv.min.js") - ap.add_argument("--port", type=int, default=8765) - a = ap.parse_args(argv) - try: - cfg, files = build_config(a.sample, a.fasta, a.reads, a.vcf, a.sv_vcf, a.locus) - except ValueError as e: - print(f"ERROR: {e}", file=sys.stderr) - return 2 - try: - srv = make_server(cfg, files, a.igv_js, a.port) - except OSError as e: - print(f"ERROR: cannot listen on {BIND}:{a.port}: {e}. Set OWNGENOME_VIEW_PORT to a free port.", file=sys.stderr) - return 1 - print(f"Viewer for {a.sample}: http://{BIND}:{srv.server_address[1]}/#{cfg['locus']}", flush=True) - print("Press Ctrl-C to stop it.", flush=True) - try: - srv.serve_forever() - except KeyboardInterrupt: - pass - finally: - srv.server_close() - return 0 - - -if __name__ == "__main__": - sys.exit(main()) diff --git a/assets/viewer/viewer.js b/assets/viewer/viewer.js index 7edf7248a..1bdd3f89c 100644 --- a/assets/viewer/viewer.js +++ b/assets/viewer/viewer.js @@ -1,11 +1,12 @@ // The page of scripts/owngenome-view.sh: reads config.json from the local server -// (assets/viewer/serve.py) and opens igv.js on it at the locus in the URL +// (og view serve) and opens igv.js on it at the locus in the URL // after '#', else the one the config names. The report's links set that // part, so a click on a finding opens the reads at it. // // The state goes on : "loading", "ready" or // "error: "; a request the Content-Security-Policy blocked is added to -// data-pgp-blocked. tests/test_viewer.py reads both from a headless browser. +// data-pgp-blocked. rust/crates/og-live/tests/port_viewer.rs reads both from a +// headless browser. "use strict"; (function () { diff --git a/bin/collect_summary.py b/bin/collect_summary.py index 570dc9f01..be50233c5 100755 --- a/bin/collect_summary.py +++ b/bin/collect_summary.py @@ -141,7 +141,7 @@ def collect(sample, sample_dir, declared_sex=None, out=None): # equal; the set stays written here because this file also runs where only # bin/ is mounted). A section whose step is not here (variant calling, step # 03, which run-all reuses on purpose) is never marked stale. -RUN_ALL_STEPS = {"03a", "03b", "03c", "03d", "04", "04b", "05", "06", "07", "08", "09", "09b", "10", "11", +RUN_ALL_STEPS = {"03a", "03b", "03c", "03d", "04", "04a", "04b", "05", "06", "07", "08", "09", "09b", "10", "11", "12", "13", "14", "15", "16", "16b", "17", "18", "19", "20", "21", "22", "23", "25", "26", "26b", "27", "28", "29", "30", "31", "32", "33", "35", "35b", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53"} diff --git a/conf/containers.config b/conf/containers.config index 23b77f16a..f425b71d2 100644 --- a/conf/containers.config +++ b/conf/containers.config @@ -109,7 +109,7 @@ process { withName: 'SURVIVOR_PREP' { container = 'staphb/bcftools:1.24' } withName: 'SURVIVOR_SORT' { container = 'staphb/bcftools:1.24' } withName: 'T1K_BUILD' { container = 'quay.io/biocontainers/t1k:1.0.10--h5814d7d_0' } - withName: 'TELOMERE_HUNTER' { container = 'quay.io/biocontainers/telomerehunter:1.1.0--pyhdfd78af_0' } + withName: 'TELOMERE_HUNTER' { container = 'quay.io/biocontainers/telomerehunter2:1.0.12--pyhdfd78af_0' } withName: 'TRAITS' { container = 'python:3.15.2@sha256:d7a732b20de2f5d3cf977cbcf69aacf30dc928a37908ff9fdb7bb3503024c91a' } withName: 'TRAITS_PHASE' { container = 'quay.io/biocontainers/whatshap:2.8--py312h9b2995c_1' } withName: 'TRAITS_SITES' { container = 'staphb/bcftools:1.24' } diff --git a/conf/everything.config b/conf/everything.config new file mode 100644 index 000000000..3e9a055ad --- /dev/null +++ b/conf/everything.config @@ -0,0 +1,23 @@ +/* +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Nextflow config: every optional step +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + nextflow run main.nf -profile docker,everything --input ... --reference ... \ + -- ... + + The tool rows and the switch rows of assets/everything.tsv, as + EVERYTHING=true in scripts/run-all.sh sets them: every --tools name but + exomiser (it runs when --hpo names the symptoms) and cram_archive (an + archive copy of each BAM), plus KIR typing and OptiType. Pass every + database the tools need: main.nf stops before any task and names the + option a tool lacks. `og dev everything-check` fails when this file and + the list differ. +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +*/ + +params { + tools = 'pharmcat,cpic,clinvar,pypgx,vep,vcfanno,slivar,clinical_filter,cpsr,roh,prs,ancestry,ancestry_fine,mito_haplogroup,hla_typing,expansion_hunter,stranger,telomere_hunter,mosdepth,mito_variants,cyrius,manta,delly,cnvpytor,duphold,annotsv,survivor_merge,sample_qc,parascopy,paraphase,y_haplogroup,html_report,multiqc,consumer_export,bloodtype,lpa,vntyper,traits,archaic,ancient,y_str,viral,chip,mei,mocha,locityper' + kir = true + hla_qc = true + cpsr_secondary_findings = true +} diff --git a/docs/00-reference-setup.md b/docs/00-reference-setup.md index 63357393d..4a74a2b20 100644 --- a/docs/00-reference-setup.md +++ b/docs/00-reference-setup.md @@ -138,7 +138,7 @@ It downloads the new file under `clinvar/.refresh/`, checks the md5, builds both | File | Source | Used by | Without it | |---|---|---|---| | `reference/delly_human.hg38.excl.tsv` | Delly's GRCh38 exclude map at a pinned commit (sha256 checked) | step 19 (`delly sr -x`) | Delly runs without it: slower, and with calls in centromeres, telomeres and the unplaced scaffolds | -| `reference/cytoBand.hg38.txt` | UCSC's GRCh38 chromosome bands, chr1-22, X and Y, copied from `assets/reference/cytoBand.hg38.txt` (its README says how it was made). `validate-setup.sh` fails an installed copy that differs from it | step 10 (`telomerehunter -b`), Nextflow `--cytoband`; the genome map reads the asset itself | TelomereHunter falls back to its hg19 bands | +| `reference/cytoBand.hg38.txt` | UCSC's GRCh38 chromosome bands, chr1-22, X and Y, copied from `assets/reference/cytoBand.hg38.txt` (its README says how it was made). `validate-setup.sh` fails an installed copy that differs from it | step 10 (`telomerehunter2 -b`), Nextflow `--cytoband`; the genome map reads the asset itself | Step 10 installs it from `assets/reference` before it runs; Nextflow passes the asset itself | | `hla/IPD-IMGT-HLA_/hla.dat` | IPD-IMGT/HLA release `HLA_DB_RELEASE` (3.66.0) from the IMGTHLA repository (md5 checked) | step 8 | step 8 is skipped | | `reference/gencode.v50.basic.genes.gtf` | the gene lines of GENCODE 50's basic annotation (md5 checked) | step 8 (gene positions for T1K) | step 8 is skipped | | `reference/gencode.v50.basic.exons.bed` | the exon intervals of the same GENCODE 50 basic annotation, written from the same download as the gene lines (md5 checked) | steps 6 and 17 and Nextflow `--gencode_exons` with `clinvar` (cDNA read check); step 39 and `--gencode_exons` with `--pedigree` (deletions over an exon) | steps 6 and 17 and `CLINVAR_CDNA_CHECK` write every hit as `not_checked`; step 39 does not use deletions | diff --git a/docs/06-clinvar-screen.md b/docs/06-clinvar-screen.md index 522b0fc9a..335f542ed 100644 --- a/docs/06-clinvar-screen.md +++ b/docs/06-clinvar-screen.md @@ -121,6 +121,8 @@ The [runtime table](hardware-requirements.md#runtime-per-step) gives the measure Both reports (step 24 and `generate-report.sh`) read the hits file and show gene, genotype (het, hom, or "one copy, other copy not called ref" for the half of a split `1/2` call), significance, review status, stars and the combined-allele note ("combined allele of ...", "part of a combined allele: ...", both followed by "; unphased, so the parts may sit on different haplotypes" on an unphased het call, or "possibly one allele with ...: check ClinVar for a combined record") for each hit, the best-reviewed first, with the ClinVar file's release date, the gnomAD frequency and the low-confidence mark. The headline count leaves the low-confidence calls out and a line beside it counts them. When the cDNA check table is there, both print its result beside each hit (the HTML hits table has a "cDNA read check" column) and the ClinVar card counts the flagged hits. Older versions of this step wrote `clinvar/isec/0002.vcf`; that file holds only the sample's side of the intersection, with no gene or significance, and nothing reads it any more. Rerun step 6 to get the hits file. +summary.json also has an ACMG secondary-findings card built from these hits, `sections.acmg_sf`. It follows this step, not step 23: it is there whenever the hits file is, also in a run without the VEP cache, and is not run (or failed) with this step's reason otherwise. It holds the hits in the 84 genes of the ACMG SF v3.3 list with each gene's rule applied, step 05's class 4 and 5 SVs in the genes whose rule allows them, and the deletions that count as a second hit. Step 23's rare HIGH-impact records join it when step 23 left its clinical VCF. Without that VCF the card says `high_impact_checked: false`, and `high_impact_note` names why (step 23 skipped, with the run's reason, failed, or its VCF unreadable) and what that can miss: a predicted loss-of-function variant that is not in ClinVar, alone or as the second hit of a recessive gene. [Step 23](23-clinical-filter.md#secondary-findings-genes-acmg-sf-v33) gives the rules. The reports still show the card from step 23's section, so they show it only when step 23 ran. + `${SAMPLE}_clinvar_hits.tsv` is the table to read or load elsewhere. To list the hits from the VCF yourself: ```bash diff --git a/docs/10-telomere-analysis.md b/docs/10-telomere-analysis.md index c08b7692b..b221395d1 100644 --- a/docs/10-telomere-analysis.md +++ b/docs/10-telomere-analysis.md @@ -7,26 +7,27 @@ Estimates relative telomere content from WGS BAM files by quantifying telomeric Telomere length correlates with cellular aging at a population level. Comparing telomere content between individuals of similar age, sequenced on the same platform, provides a rough relative comparison. However, telomere length alone is not established as a clinically important standalone risk marker for individuals — it provides only a rough estimate of aging rate and is influenced by many non-age factors (genetics, cell type, technical variables). ## Tool -- **TelomereHunter** (German Cancer Research Center) +- **TelomereHunter2** 1.0.12 (German Cancer Research Center; GPL-3.0), the maintained Python 3 successor of TelomereHunter ## Docker Image - `TELOMEREHUNTER_IMAGE` Pinned in `versions.env`; [Image versions](versions.md) lists the current tag. -> The image is the Bioconda build of TelomereHunter 1.1.0. It runs as you, not as root, and with `--plotNone`: its plots fail (its R has no `dplyr`, and its PyPDF2 is written for Python 3), and nothing in the pipeline reads them. It replaced a patched, digest-pinned build from a personal Docker Hub account. +> The image is the Bioconda build of TelomereHunter2. It runs as you, not as root, and with `--plotNone`: nothing in the pipeline reads its plots. ### Which TelomereHunter, and what changed -Step 10 runs TelomereHunter 1 (1.1.0). On the image test's input, the HG002 fixture BAM plus 1,100 planted unmapped telomeric reads (600 `TTAGGG`, 400 `CCCTAA`, 100 with one `TCAGGG`), three images were run side by side: +Step 10 runs TelomereHunter2 1.0.12. Until now it ran TelomereHunter 1.1.0, Python 2.7 code with its plots off. On the image test's input, the HG002 fixture BAM (fixture-v8) plus 1,100 planted unmapped telomeric reads (600 `TTAGGG`, 400 `CCCTAA`, 100 with one `TCAGGG`), both were run with the GRCh38 bands. The second run drops two planted reads: -| Image | intratel_reads | tel_content | TCAGGG per intratelomeric read | -|---|---|---|---| -| the earlier digest-pinned build | 1100 | 5594.234887 | 0.0909 | -| Bioconda TelomereHunter 1.1.0 (this step) | 1100 | 5594.234887 | 0.0909 | -| Bioconda TelomereHunter2 1.0.12 | 1100 | 5594.234887 | 0.0909 | +| Input | Image | intratelomeric reads | tel_content | TCAGGG per intratelomeric read | +|---|---|---|---|---| +| 1,100 planted | TelomereHunter 1.1.0 | 1100 | 5347.255643 | 0.0909 | +| 1,100 planted | TelomereHunter2 1.0.12 (this step) | 1100 | 5347.255643 | 0.0909 | +| 1,098 planted | TelomereHunter 1.1.0 | 1098 | 5337.585253 | 0.0911 | +| 1,098 planted | TelomereHunter2 1.0.12 (this step) | 1098 | 5337.585253 | 0.0911 | -So a value from an earlier run of this step stays comparable. TelomereHunter2 (GPL-3.0, Python 3, maintained) gives the same numbers on this input, but it is not switched in yet: without `-b` it skips the band classes instead of using hg19 bands, which the Nextflow warning and parameter help describe, and its summary has other columns in another order. Moving to it is a separate change. +So a value from an earlier run of this step stays comparable, and both versions move by the same amount when reads change. The summary file keeps its name, but TelomereHunter2 writes other columns in another order: `tel_content` is the third column, `intratel_reads` is now `intratelomeric_reads`, `tel_reads` is `tel_read_count`, `read_length` is `read_lengths`, and it adds the junction-spanning, subtelomeric and intrachromosomal read counts. The reports and `summary.json` read both layouts by column name, so they do not change. A script of your own that reads the summary by column position must read it by name. ## Command ```bash @@ -34,9 +35,11 @@ export GENOME_DIR=/path/to/your/data ./scripts/10-telomere-hunter.sh your_sample ``` -`ALIGN_DIR` (default `aligned`) picks the BAM, for example `ALIGN_DIR=aligned_bwamem2`. `THREADS` (default 4) caps the container's CPUs; TelomereHunter has no thread option of its own. +`ALIGN_DIR` (default `aligned`) picks the BAM, for example `ALIGN_DIR=aligned_bwamem2`. `THREADS` (default 4) caps the container's CPUs and is TelomereHunter2's worker count (`-c`). -TelomereHunter sorts telomeric reads into intratelomeric, subtelomeric and junction classes by chromosome band. Without `-b` it uses its own hg19 bands (`telomerehunter --help`: "If no banding file is specified, the banding information of hg19 will be used"), which put the band ends at hg19 positions on a GRCh38 BAM. The script passes UCSC's GRCh38 bands, which `setup.sh` installs as `reference/cytoBand.hg38.txt` (chr1-22, X and Y; see [reference setup](00-reference-setup.md#small-pinned-data-files)). When they are not installed it runs without `-b` and says so. What the script runs: +TelomereHunter2 sorts telomeric reads into intratelomeric, subtelomeric, junction-spanning and intrachromosomal classes by chromosome band. The BAM is GRCh38, so the script always passes UCSC's GRCh38 bands, `reference/cytoBand.hg38.txt` (chr1-22, X and Y; see [reference setup](00-reference-setup.md#small-pinned-data-files)). The repository ships that file in `assets/reference`, and `setup.sh` installs it. When it is not installed, the script installs it first and says so; it never runs without the bands. (TelomereHunter 1.1.0 used its own hg19 band ends without `-b`, and TelomereHunter2 leaves the band classes out.) The Nextflow pipeline passes `--cytoband` when it is set, and otherwise the copy in `assets/reference`. + +TelomereHunter2 writes one BAM per contig and merges them at once, so a BAM with decoy contigs (the HG002 test BAM has 2,580) needs more than the 1,024 open files a container gets by default. The script raises the container's limit with `--ulimit nofile=65536:65536`; the Nextflow module raises its soft limit to the hard one. Without that the run stops with "Too many open files". What the script runs: ```bash source versions.env # from the repository root @@ -44,29 +47,30 @@ SAMPLE=your_sample GENOME_DIR=/path/to/your/data docker run --rm --network none --user "$(id -u):$(id -g)" \ - --cpus 4 --memory 4g \ + --cpus 4 --memory 4g --ulimit nofile=65536:65536 \ -v ${GENOME_DIR}:/genome \ "${TELOMEREHUNTER_IMAGE}" \ - telomerehunter \ + telomerehunter2 \ -ibt /genome/${SAMPLE}/aligned/${SAMPLE}_sorted.bam \ -o /genome/${SAMPLE}/telomere/${SAMPLE} \ -p ${SAMPLE} \ + -c 4 \ --plotNone \ -b /genome/reference/cytoBand.hg38.txt # Output: telomere content report in ${GENOME_DIR}/${SAMPLE}/telomere/${SAMPLE}/ ``` -TelomereHunter uses `-ibt` (input BAM tumor) for a single-sample analysis. No `--tumor_only` flag is needed — when only `-ibt` is provided (without `-ibc` for a matched control BAM), TelomereHunter runs in single-sample mode automatically. +TelomereHunter2 uses `-ibt` (input BAM tumor) for a single-sample analysis. No `--tumor_only` flag is needed: with only `-ibt` (no `-ibc` for a matched control BAM), it runs in single-sample mode. ## Key Metric -- **`tel_content`** — intratelomeric reads per million reads with 48-52% GC, the GC content of telomeric repeats (TelomereHunter 1.1.0 divides the intratelomeric read count by `total_reads_with_tel_gc`). It is a relative telomere content, not a telomere length; the report labels it "Telomere content (relative)" +- **`tel_content`** — intratelomeric reads per million reads with 48-52% GC, the GC content of telomeric repeats (TelomereHunter2 divides the intratelomeric read count by `total_reads_with_tel_gc`, as TelomereHunter 1.1.0 did). It is a relative telomere content, not a telomere length; the report labels it "Telomere content (relative)" - Higher values indicate longer/more abundant telomeres -- Compare between samples of known age for relative ranking +- Compare only between samples sequenced on the same platform. The value is not an age ### Read-count check -The value rests on the intratelomeric reads (`intratel_reads` in TelomereHunter 1.1.0's summary). The reports print that count beside the value and warn "too few telomeric reads for a stable estimate" when it is below 2,000 per 30x of depth. The depth is the one TelomereHunter counted: `total_reads` times the read length (`read_lengths`, the largest when there are several) over 3.1 Gb. A typical 30x short-read genome has tens of thousands of intratelomeric reads, so the floor sits far below that: a sample under it has a library or platform problem, or reads too short for TelomereHunter's repeat threshold, and its value is not comparable. The floor is a first choice, not one fitted to many samples. A summary without `total_reads` or the read length gets the count and no check, and the report says so. +The value rests on the intratelomeric reads (`intratelomeric_reads` in TelomereHunter2's summary, `intratel_reads` in a summary TelomereHunter 1.1.0 wrote). The reports print that count beside the value and warn "too few telomeric reads for a stable estimate" when it is below 2,000 per 30x of depth. The depth is the one TelomereHunter counted: `total_reads` times the read length (`read_lengths`, the largest when there are several) over 3.1 Gb. A typical 30x short-read genome has tens of thousands of intratelomeric reads, so the floor sits far below that: a sample under it has a library or platform problem, or reads too short for TelomereHunter's repeat threshold, and its value is not comparable. The floor is a first choice, not one fitted to many samples. A summary without `total_reads` or the read length gets the count and no check, and the report says so. ## Important Notes - The container runs as you (`--user "$(id -u):$(id -g)"`), so the outputs are yours. A telomere directory an older version wrote as root has to be taken back first: `sudo chown -R "$(id -u):$(id -g)" "${GENOME_DIR}/${SAMPLE}/telomere"`. diff --git a/docs/20-mtoolbox.md b/docs/20-mtoolbox.md index 964e5f859..1991f0008 100644 --- a/docs/20-mtoolbox.md +++ b/docs/20-mtoolbox.md @@ -61,7 +61,7 @@ The last stage (`og mito annotate`, in `PYTHON_IMAGE`) writes `${SAMPLE}_chrM_an - ClinVar's record of the same allele from `clinvar/clinvar_chr.vcf.gz`, the ClinVar file `setup.sh` installs: `clinvar_id`, `clinvar_significance` (CLNSIG), `clinvar_review` (CLNREVSTAT) and `clinvar_condition` (CLNDN); - gnomAD v3.1's chrM sites of the same allele (`gnomad_mito/`, pinned in `versions.env`): `gnomad_af_hom` (the share of gnomAD's samples with the allele at 95% or more), `gnomad_af_het` (at 10% to 95%) and `gnomad_max_hl` (the highest level gnomAD saw). -Alleles are matched by position, REF and ALT after the bases they share are trimmed, so Mutect2's multi-allelic indels meet ClinVar's and gnomAD's single-allele records. A file that is not installed leaves its columns `.`, and the table's first lines say which. The reports list each PASS call that is heteroplasmic, or that ClinVar classes as anything but benign (a record with no classification, `not_provided`, does not count), with these columns, and count the ClinVar pathogenic or likely pathogenic ones. +Alleles are matched by position, REF and ALT after the bases they share are trimmed, so Mutect2's multi-allelic indels meet ClinVar's and gnomAD's single-allele records. An indel in a repeat can be written at any place in it, so an indel that finds no record that way is moved to the left end of its repeat on the rCRS (GRCh38's chrM) and matched there, on both sides. One C more in the m.311-315 tract then meets its record whether either side writes it m.310T>TC or m.315C>CC. An exact spelling wins over a moved one, and an allele whose REF, as written, is not the rCRS at its position is not moved. The table writes each call's position, REF and ALT trimmed as above (Mutect2's m.302 AC>ACC reads m.302 A>AC), never the moved spelling. A file that is not installed leaves its columns `.`, and the table's first lines say which. The reports list each PASS call that is heteroplasmic, or that ClinVar classes as anything but benign (a record with no classification, `not_provided`, does not count), with these columns, and count the ClinVar pathogenic or likely pathogenic ones. Step 13's VEP annotates the main VCF, whose chrM records come from the nuclear caller: a heteroplasmic call only Mutect2 makes has no VEP record, so this step annotates its own calls. In the Nextflow pipeline `MITO_VARIANTS_ANNOTATE` does the same after `MITO_VARIANTS`, with the files of `--mito_clinvar` and `--gnomad_mito`; without them its table names each file as not given and leaves its columns `.`. @@ -100,7 +100,7 @@ The copy-number catalog (`bin/cn_loci.tsv`, [docs/cn-loci.md](cn-loci.md)) has n ### NuMTs -NuMTs are copies of mitochondrial DNA in the nuclear genome. Their reads can map to chrM and look like low-level heteroplasmy. GATK's NuMTFilterTool marks an allele `possible_numt` when its depth is no more than such copies could give at the sample's autosomal depth. The script reads the median autosomal depth from step 16b's mosdepth output (`mosdepth/.mosdepth.summary.txt` and `.global.dist.txt`), so run step 16b first; `AUTOSOMAL_COVERAGE=30` sets it by hand. Without either, the filter runs at depth 0 and marks nothing, and the step says so. The Nextflow `MITO_VARIANTS` runs the same filter with the same depth, read from `MOSDEPTH`'s output when `mosdepth` is in `--tools` (a default tool); without it, at depth 0. +NuMTs are copies of mitochondrial DNA in the nuclear genome. Their reads can map to chrM and look like low-level heteroplasmy. GATK's NuMTFilterTool marks an allele `possible_numt` when its depth is no more than such copies could give at the sample's autosomal depth. The script reads the median autosomal depth from step 16b's mosdepth output (`mosdepth/.mosdepth.summary.txt` and `.global.dist.txt`), so run step 16b first; `AUTOSOMAL_COVERAGE=30` sets it by hand. Without either, the filter runs at depth 0 and marks nothing. The step then prints a `WARNING`, and the annotation table gets a `# numt` header line that reads `NuMT filter used a default depth` (`og mito annotate --numt-default`). The Nextflow `MITO_VARIANTS` runs the same filter with the same depth, read from `MOSDEPTH`'s output when `mosdepth` is in `--tools` (a default tool). Without it the depth is 0: the run prints a warning on the console when it starts, and `MITO_VARIANTS_ANNOTATE` writes the same `# numt` line. The reports do not show that line yet. ## Output - `${SAMPLE}_chrM_mutect2.vcf.gz` — Raw mitochondrial variant calls diff --git a/docs/21-cyrius.md b/docs/21-cyrius.md index 7e8fbb5cd..318613ea3 100644 --- a/docs/21-cyrius.md +++ b/docs/21-cyrius.md @@ -49,7 +49,7 @@ With `run-all.sh`, a default run plans it when the install matches this version 1. Validates that the sorted BAM, its index and the Cyrius install exist 2. Checks the depth at CYP2D6 against its flanks ([depth check](32-pypgx.md#cyp2d6-depth-check)), with `${MOSDEPTH_IMAGE}` 3. Creates a manifest file listing the BAM path (Cyrius requires this) and runs `python3 -m cyrius --genome 38` (GRCh38) from the install, with no network -4. When the depth check found multi-mapped reads, sets the call's Filter to `CYP2D6_depth_unreliable`: [step 36](36-pgx-consensus.md) then does not pass it on. Cyrius writes into `cyrius/partial/`, and its TSV moves to `${SAMPLE}_cyp2d6.tsv` only after this, so a run that stops earlier leaves no call for step 36 +4. When the depth check failed (multi-mapped reads, or flanks under 10x at MAPQ >= 1), sets the call's Filter to `CYP2D6_depth_unreliable`: [step 36](36-pgx-consensus.md) then does not pass it on. Cyrius writes into `cyrius/partial/`, and its TSV moves to `${SAMPLE}_cyp2d6.tsv` only after this, so a run that stops earlier leaves no call for step 36 5. Parses the output TSV to display the called diplotype ## Output diff --git a/docs/23-clinical-filter.md b/docs/23-clinical-filter.md index 28388bf82..a39358cf2 100644 --- a/docs/23-clinical-filter.md +++ b/docs/23-clinical-filter.md @@ -88,7 +88,9 @@ The Nextflow `CLINICAL_FILTER` module applies the same tiers, ranking, frequency ### Secondary-findings genes (ACMG SF v3.3) -Both reports list, beside the clinical filter's counts, the secondary findings in the 84 genes of the ACMG SF v3.3 list (Lee et al., Genet Med 2025;27(8):101454; the genes in which the ACMG recommends reporting pathogenic variants found by chance, such as BRCA1, LDLR, MYBPC3 or TTN): the step 6 ClinVar hits in those genes, the clinical filter's records with a HIGH-impact consequence on the ranked transcript in them, and step 5's AnnotSV class 4 and 5 structural variants in the genes whose rule allows them. Each gene's rule from Table 1 of the list is a row of `assets/acmg_sf.tsv`: one variant in a dominant gene, two in a recessive one (MUTYH, BTD, ATP7B and others; a homozygote, or two variants of unknown phase), HFE only as homozygous p.C282Y, GLA and OTC also in a heterozygous female, ABCD1 hemizygous, homozygous or with two heterozygous variants. A variant the rule does not report is listed apart with the reason; a pseudodeficiency allele is not counted, and a BTD finding with the p.Asp444His hypomorph says partial, not profound. Of the reported HIGH-impact records the reports count as "rare HIGH impact" only the rare ones with a sound call; a weak call or an unknown frequency is listed with its mark and counted apart, and a common one is left out. The list version is `ACMG_SF_VERSION` in `og summary collect` (`rust/crates/og-summary`). It is a list to review with a clinician: a rare HIGH-impact variant is not a ClinVar classification. [Interpreting results](interpreting-results.md#carrier-status-is-not-disease) gives every rule. Step 17 (CPSR) reports the ACMG secondary findings with its own classification. +Both reports list, beside the clinical filter's counts, the secondary findings in the 84 genes of the ACMG SF v3.3 list (Lee et al., Genet Med 2025;27(8):101454; the genes in which the ACMG recommends reporting pathogenic variants found by chance, such as BRCA1, LDLR, MYBPC3 or TTN): the step 6 ClinVar hits in those genes, the clinical filter's records with a HIGH-impact consequence on the ranked transcript in them, and step 5's AnnotSV class 4 and 5 structural variants in the genes whose rule allows them. Each gene's rule from Table 1 of the list is a row of `assets/acmg_sf.tsv`: one variant in a dominant gene, two copies hit in a recessive one (MUTYH, BTD, ATP7B and others: a homozygote, two variants that read-backed phase puts on different copies, or two variants of unknown phase, which `summary.json` marks `"pair": "possibly biallelic"`; two variants phased on one copy are listed apart, a combined allele of step 6 counts once with its parts, and a record with no alt copy called counts nothing), HFE only as homozygous p.C282Y, GLA and OTC also in a heterozygous female, ABCD1 hemizygous, homozygous or with two heterozygous variants. A variant the rule does not report is listed apart with the reason; a pseudodeficiency allele is not counted, and a BTD finding with the p.Asp444His hypomorph says partial, not profound. Of the reported HIGH-impact records the reports count as "rare HIGH impact" only the rare ones with a sound call; a weak call or an unknown frequency is listed with its mark and counted apart, and a common one is left out. The list version is `ACMG_SF_VERSION` in `og summary collect` (`rust/crates/og-summary`). It is a list to review with a clinician: a rare HIGH-impact variant is not a ClinVar classification. [Interpreting results](interpreting-results.md#carrier-status-is-not-disease) gives every rule. Step 17 (CPSR) reports the ACMG secondary findings with its own classification. + +summary.json holds the card twice. `sections.clinical.data.acmg_sf` is the card as both reports read it. It is there whenever this step's summary table or clinical VCF can be read, also one left by an earlier run (then, when this step did not run ok, the clinical section is stale). `sections.acmg_sf` is the same card as a section of step 6: it is written whenever step 6's hits are there, so a run without the VEP cache still gets the ClinVar and SV findings. Without this step's clinical VCF it has `high_impact_checked: false` and a `high_impact_note` that names why (this step skipped, with the run's reason, failed, or its VCF unreadable) and what that can miss: a predicted loss-of-function variant that is not in ClinVar, alone or as the second hit of a recessive gene. With the clinical VCF the two cards are equal, except when that VCF is from an earlier run (this step not ok in this run): then `sections.acmg_sf` adds a `high_impact_note` with the earlier VCF's date. A clinical VCF that cannot be read, or whose HIGH-impact records cannot be parsed, makes the clinical section's card unavailable, while `sections.acmg_sf` keeps its ClinVar rows with `high_impact_checked: false` and says the VCF could not be read. The two cards then differ. The `table_text` column of `assets/acmg_sf.tsv` quotes each gene's rule from Table 1 of the paper (doi:10.1016/j.gim.2025.101454), such as "All P and LP" or "P and LP (2 variants)". summary.json gives that text as the rule of each finding, and the reports use it in the reason a variant is not reported. These are short cited quotations of a factual reporting rule: six phrases, the longest 44 characters. "(See text)" after a rule points to the paper's section on the dilated cardiomyopathy (DCM) genes. The `note` column says what the table's footnotes add, in our own words. diff --git a/docs/24-html-report.md b/docs/24-html-report.md index a46341805..b78de3d17 100644 --- a/docs/24-html-report.md +++ b/docs/24-html-report.md @@ -91,7 +91,7 @@ The cards, by chapter (cards not listed here are named in the chapter table abov - **ClinVar Screening** — hit count by review stars, the ClinVar file date, and the hits table best-reviewed first with a Stars column. The count's badge is yellow when there is a hit and gray when there is none, never green. Each hit shows its gnomAD allele frequency from step 13's VEP output, and a line says where the frequencies came from and how many hits are above 1%, or why every frequency is unknown: a common allele with a P/LP record is often low-penetrance, so read every hit with the frequency the card shows, and look up a hit whose frequency is unknown. A low-confidence line counts the hits whose call is under step 6's GQ or DP floor: they are listed but not counted in the total. When step 6's cDNA read check ran, the card also counts the hits it flagged - **Clinical Filter** and **slivar** — variant counts from steps 23 and 31 -- **Secondary-Findings Genes (ACMG SF v3.3)** — the step 06 ClinVar hits, the clinical filter's rare HIGH-impact records and step 05's class 4 and 5 SVs in the 84 genes of the ACMG list, each gene's reporting rule applied (`assets/acmg_sf.tsv`, for example HFE homozygous C282Y only), and the variants a rule does not report listed apart with the reason +- **Secondary-Findings Genes (ACMG SF v3.3)** — the step 06 ClinVar hits, the clinical filter's rare HIGH-impact records and step 05's class 4 and 5 SVs in the 84 genes of the ACMG list, each gene's reporting rule applied (`assets/acmg_sf.tsv`, for example HFE homozygous C282Y only), and the variants a rule does not report listed apart with the reason. The card is shown when step 23 ran. summary.json also writes it as its own section, `acmg_sf`, from step 06's hits, with or without step 23 ([step 06](06-clinvar-screen.md#output)) - **Cancer Predisposition** — CPSR status and the classification breakdown (read by column name from `${SAMPLE}.cpsr.grch38.classification.tsv.gz`) - **Structural Variants** — Manta, Delly, CNVpytor and the SURVIVOR consensus (2+ callers) counts; then step 05's class 4 and 5 SVs (AnnotSV) with their caller support, exon-edge and frequency checks. A call step 05's rules moved to class 3 (a coding tandem repeat, an immunoglobulin or T-cell receptor locus, the MHC, a pseudogene named by a disease gene's alias, or read depth that does not show the change) is listed apart with AnnotSV's class, the rule and the reason, and the class 4-5 count leaves it out - **Repeat Expansions** — a table of every locus, the five key loci (HTT, FMR1, C9orf72, ATXN1, DMPK) first, with its repeat count, Stranger's status and notes; and counts of the loci outside the normal range (step 9b, Stranger), of those short reads could not size (not counted as normal), and the loci in an intermediate range (`bin/str_intermediate_ranges.tsv`). When Stranger flags RFC1, or another locus where the motif decides (`expansion_hunter/${SAMPLE}_str_motifs.tsv`), the card adds the verdict of the read-level motif count (step 9b). A locus the repeat catalog gives no thresholds (its `NoThresholds` field in `expansion_hunter/${SAMPLE}_eh_catalog.json`: MUC1, CEL, TYMS and PLIN4 with the STRchive catalog, among others) is marked not graded, with the catalog's reason, never normal. Any other locus outside Stranger's catalog has no status and is counted apart. Without step 9b the card says Stranger did not run; a Stranger file older than the ExpansionHunter result it came from is not read, and the card says to rerun step 9b. Repeat-expansion calls from short reads can be wrong at some loci diff --git a/docs/32-pypgx.md b/docs/32-pypgx.md index 9fcf28455..6d187fdb3 100644 --- a/docs/32-pypgx.md +++ b/docs/32-pypgx.md @@ -139,6 +139,7 @@ The BAM-based calling uses both `--variants` and `--depth-of-coverage` per the u A copy-number call from depth is only as good as the depth. Before pypgx runs, the step measures, with mosdepth (`${MOSDEPTH_IMAGE}`), the mean depth over CYP2D6 (chr22:42,123,193-42,132,032, the region Cyrius uses) and over two 50 kb flanks outside the CYP2D6-CYP2D8 cluster (chr22:42.05-42.10 Mb and 42.20-42.25 Mb), once for all reads and once for reads with MAPQ >= 1 (callers ignore MAPQ 0 reads). `og pgx cyp2d6-check` then judges it (the regions come from `og pgx cyp2d6-bed`): - **unreliable** when more than 40% of the reads at CYP2D6 (if it has at least 15% of the flank depth) or in the flanks have MAPQ 0: the aligner placed them on more than one sequence. The step writes `CYP2D6 copy number unreliable: reads are multi-mapped (was this BAM aligned to a reference with ALT contigs?)` to its log and to `${SAMPLE}_cyp2d6_depth_check.tsv`, and the summary's CYP2D6 row says `Indeterminate` (pypgx's own call stays in `CYP2D6/results.zip`). +- **unreliable** too when the flanks have under 10x at MAPQ >= 1, the reads the callers use. The message is `CYP2D6 copy number unreliable, agreement not counted (depth): the flanks of CYP2D6 (chr22:42.05-42.25 Mb) have under 10x at MAPQ >= 1, too few reads for a copy-number call`, and the summary's CYP2D6 row says `Indeterminate` as above. At that depth two callers can agree on noise, so their agreement does not count. Multi-mapped reads are named first when both apply, because that cause can be fixed by realigning. - **ok** otherwise. A real deletion leaves few reads at CYP2D6, but those map uniquely and the flanks keep their depth, so it passes. Beside the verdict, the check gives three more figures, which do not change it. Cyrius's region includes REP6 and the 3' flank of the gene, where a sizeable share of the depth is MAPQ 0 even on a clean BAM, so its MAPQ >= 1 share reads worse than the gene is. `og pgx cyp2d6-measure` counts, from the BAM itself, the depth over that region and over the gene body alone, CYP2D6's MANE Select transcript (chr22:42,126,499-42,130,810, without REP6), for all reads, MAPQ >= 1 and MAPQ >= 20, leaving out the reads mosdepth leaves out (unmapped, secondary, QC-failed, duplicate). The check file then has `gene_mapq1_share` (the share the verdict reads), `gene_mapq20_share`, `body_depth_all`, `body_mapq1_share` and `body_mapq20_share`. A share reads `not measured` when the measurement did not run, and `no reads` when there was no depth to divide by. The two shares on real 30x genomes are still to be measured; the verdict rule stays the one above until they are. @@ -164,7 +165,7 @@ All output is written to `${GENOME_DIR}/${SAMPLE}/pypgx/`. | Column | Description | |---|---| | Gene | Gene symbol | -| Diplotype | Star allele call (e.g., \*1/\*4); `Indeterminate` for CYP2D6 when the depth check found multi-mapped reads; `FAILED` for a gene pypgx wrote no result for; `N/A` for a gene not callable on this reference (see Status) | +| Diplotype | Star allele call (e.g., \*1/\*4); `Indeterminate` for CYP2D6 when the depth check failed (multi-mapped reads, or flanks under 10x); `FAILED` for a gene pypgx wrote no result for; `N/A` for a gene not callable on this reference (see Status) | | Phenotype | Metabolizer status (e.g., Intermediate Metabolizer). `no pypgx phenotype rule` for a gene pypgx has no phenotype rule for (no `PhenotypeMethod` in its own gene table; in 0.26.0 the 17 genes listed under [Weakly supported genes](#weakly-supported-genes)), where pypgx itself writes `Indeterminate` | | CNV_call | The copy-number call pypgx itself made from read depth (its `CNV` field, for example `Normal` or `WholeDel1`). BAM-based genes only; `N/A` for VCF-based genes, and `N/A (CYP2D6 depth check)` for CYP2D6 when the depth check failed. Earlier versions guessed a Yes/No flag from the allele names, which flagged any name containing `*5` and missed the GSTM1/GSTT1/CYP2A6 whole-gene deletions | | Source | BAM (SV genes) or VCF (variant-based genes) | @@ -235,7 +236,7 @@ The two tools are complementary. PharmCAT provides drug recommendations for the - pypgx does not produce drug recommendations directly. Its CYP2D6 call reaches PharmCAT, and so the CPIC recommendations of step 27, only through [step 36](36-pgx-consensus.md), when Cyrius (step 21, after `setup.sh --cyrius`) gives the same diplotype and the depth check passed. Alone, it is shown in the reports as a probable call and goes no further. Step 27 also lists the genes PharmCAT could not call but pypgx did; for the other genes consult [CPIC guidelines](https://cpicpgx.org/guidelines/). - **The image and the bundle must be the same release.** The pinned pair is image `pypgx:0.26.0--pyh7e72e81_0` with the `0.26.0` branch of pypgx-bundle; with that pair all 23 genes of the earlier list, including its four BAM-based ones, were called on a real 30x genome (see [lessons learned](lessons-learned.md)). The 0.27.0 image against the 0.26.0 bundle failed every gene. Bump both together and rerun a known sample before trusting the new calls. - **GSTT1 needs an ALT contig, which the default reference does not have.** In GRCh38, GSTT1 lies on `chr22_KI270879v1_alt`. The pipeline's reference, the no-ALT analysis set, has no such contig (it leaves ALT contigs out so CYP2D6 and the other BAM genes keep their depth, see [realignment](realignment.md)). The step then prints a notice, leaves GSTT1 out of depth preparation (otherwise it fails for every BAM-based gene) and writes GSTT1 with Status `not callable on this reference`, not `FAILED`: nothing went wrong, the reference cannot hold the gene. Both reports list it as not assessable on this reference. The other 28 genes are called. The rule comes from the table: a row with `callable_without_alt` `no` and its `alt_contig`. -- **A copy-number call is only as good as the depth it reads.** On a reference with ALT contigs and an aligner that is not run ALT-aware, reads at CYP2D6 split between the primary and ALT copies, depth on the primary drops, and pypgx can report a deletion that is not there. The [CYP2D6 depth check](#cyp2d6-depth-check) marks such a call `Indeterminate`, and step 36 reports CYP2D6 to PharmCAT only when two callers agree. +- **A copy-number call is only as good as the depth it reads.** On a reference with ALT contigs and an aligner that is not run ALT-aware, reads at CYP2D6 split between the primary and ALT copies, depth on the primary drops, and pypgx can report a deletion that is not there. The [CYP2D6 depth check](#cyp2d6-depth-check) marks such a call `Indeterminate`, as it does a call from flanks under 10x, and step 36 reports CYP2D6 to PharmCAT only when two callers agree. - Individual gene failures do not stop the pipeline. However, if **all** genes fail, the script exits with status 1 before generating the summary TSV — this signals a systemic problem (e.g., wrong BAM path, corrupted index, missing pypgx-bundle). Rerun with verbose output to identify the root cause. For partial failures, check the summary TSV for "FAILED" entries. A gene that failed in this run reads `FAILED` even when an earlier run called it: the earlier run's result is removed before pypgx starts. ## Maintenance diff --git a/docs/36-pgx-consensus.md b/docs/36-pgx-consensus.md index 983343a36..893df0d10 100644 --- a/docs/36-pgx-consensus.md +++ b/docs/36-pgx-consensus.md @@ -5,7 +5,7 @@ Decides what the BAM-based callers tell PharmCAT. PharmCAT (step 7) reads a VCF, and from a VCF it types neither the HLA genes nor CYP2D6, so its drug guidance for them (abacavir, carbamazepine, allopurinol, codeine, tramadol, tamoxifen and many more) could never fire. This step writes PharmCAT's [outside-call file](https://pharmcat.org/using/Outside-Call-Format/): - **HLA-A and HLA-B** from T1K (step 8), cut to two fields (`*57:01`), when every allele has a T1K quality above 0. T1K can print several equally likely candidates for one allele, comma-separated. When those candidates, or an allele with an expression suffix (`*57:01:01N`, a null allele), leave open whether one of the alleles PharmCAT acts on is there (HLA-A\*31:01, HLA-B\*15:02, \*57:01 or \*58:01), the gene is `indeterminate` and is not passed, with a reason such as `ambiguous: B*57:01 possible, B*58:01 possible (T1K ties *57:01 and *58:01 on one allele)`. The answer does not depend on the order T1K printed the candidates in, and an OptiType call that matches one candidate does not decide it. A tie or a null that names none of those alleles changes no PharmCAT answer: the gene is passed, the first candidate in sorted order stands in for the tie and a null goes without its suffix, and the reason says so. A null that names none of those alleles never holds back a sure B\*57:01 on the other copy. When step 8 also ran OptiType, the opt-in second caller (`HLA_QC=true`, `--hla_qc true` in Nextflow), a gene passes only when both callers give the same pair at two fields; OptiType never calls a null, so it is compared with the names PharmCAT reads (T1K's `*02:53N` against OptiType's `*02:53` agrees here); see [step 8](08-hla-typing.md#second-caller-optitype-opt-in). One allele reads as homozygous, the way T1K reports a homozygous gene. -- **CYP2D6** only when pypgx (step 32) and Cyrius (step 21, once `setup.sh --cyrius` installed it) give the same diplotype **and** the [CYP2D6 depth check](32-pypgx.md#cyp2d6-depth-check) passed. One caller alone, a disagreement, or multi-mapped reads leave CYP2D6 `indeterminate`, and nothing reaches PharmCAT. +- **CYP2D6** only when pypgx (step 32) and Cyrius (step 21, once `setup.sh --cyrius` installed it) give the same diplotype **and** the [CYP2D6 depth check](32-pypgx.md#cyp2d6-depth-check) passed. The depth check passes only when the flanks of CYP2D6 have 10x or more at MAPQ >= 1 and the reads are not multi-mapped. One caller alone, a disagreement, multi-mapped reads or flanks under 10x leave CYP2D6 `indeterminate`, and nothing reaches PharmCAT. It also writes a consensus table that says, for each of the three genes, what every caller said and what was passed on. Step 27 copies it into the CPIC recommendations. @@ -54,7 +54,7 @@ All output is written to `${GENOME_DIR}/${SAMPLE}/pgx_consensus/`. | `${SAMPLE}_outside_calls.tsv` | PharmCAT's outside-call file: `genediplotype`, one line per gene passed on; empty when none was. Step 7 passes it with `-po` when it is not empty. | | `${SAMPLE}_pgx_consensus.tsv` | `Gene`, `Result` (the diplotype, `indeterminate` or `not typed`), `Outside_call` (`yes` or `no`), `Reason`, `Evidence` (what each caller said) | -For CYP2D6 the `Reason` is one of: the depth check's message (multi-mapped reads), `no caller made a call`, `one caller only: a second caller must agree (Cyrius: setup.sh --cyrius)`, `pypgx and Cyrius disagree`, `the CYP2D6 depth check did not run`, or `pypgx and Cyrius agree; the depth check passed`. +For CYP2D6 the `Reason` is one of: the depth check's message (multi-mapped reads, or `agreement not counted (depth)` for flanks under 10x), `no caller made a call`, `one caller only: a second caller must agree (Cyrius: setup.sh --cyrius)`, `pypgx and Cyrius disagree`, `the CYP2D6 depth check did not run`, or `pypgx and Cyrius agree; the depth check passed`. ## Runtime @@ -65,7 +65,7 @@ For CYP2D6 the `Reason` is one of: the depth check's message (multi-mapped reads - Without Cyrius, CYP2D6 is always `indeterminate` here: that is the point, not a fault. Install Cyrius (`setup.sh --cyrius`, non-commercial licence) to get an agreed call; `run-all.sh` then runs step 21 in a default run. - **A probable call, never an outside call.** When pypgx alone called CYP2D6 (Cyrius did not run, or made no usable call), the depth check passed, and every variant that defines its star alleles is in the VCF as a `PASS` call at or above the GQ floor (step 32's `Defining_filter` and `Quality` columns), both reports show pypgx's diplotype and phenotype labelled `probable (one caller: pypgx)`. This table still says `indeterminate` for it and nothing reaches PharmCAT, so no drug guidance rests on it. The rule is the probable call of `og summary collect` (`rust/crates/og-summary/src/collect/pgx.rs`); a failed depth check, a usable Cyrius call (then the two callers decide), a defining variant that is missing, not `PASS`, below the GQ floor or without a GQ, a star allele pypgx's table lacks, or a summary from before these columns gives no probable call. - A Cyrius call counts only with Filter `PASS`; `None`, an ambiguous call (two diplotypes) or `CYP2D6_depth_unreliable` is no call. -- When pypgx and Cyrius agree and the depth check passed, CYP2D6 is passed whatever step 32's `Defining_filter` and `Quality` columns say: Cyrius calls from the BAM on its own, so its agreement is the second line of evidence. Both reports show those columns as a flag beside the call. The cargo test `rust/crates/og-steps/tests/i411_hla_ties.rs` pins this rule. +- When pypgx and Cyrius agree and the depth check passed, CYP2D6 is passed whatever step 32's `Defining_filter` and `Quality` columns say: Cyrius calls from the BAM on its own, so its agreement is the second line of evidence. Weak evidence is shown, not hidden: when `Defining_filter` is not `PASS` (or `none`) or `Quality` is not `ok`, the `Evidence` column reads `pypgx: *1/*4, weak evidence (; )`, naming only the column that is weak, whether the call was passed or not. A summary from before those columns gets no flag. Both reports show those columns as a flag beside the call. The cargo test `rust/crates/og-steps/tests/i411_hla_ties.rs` pins this rule, and the unit test `weak_pypgx_evidence_is_flagged_not_withheld` in `pgx_rules.rs` pins the flag. - HLA agreement between T1K and OptiType is extra evidence, not an independent check: both read the same alignment, so reads that never reach the HLA windows (an allele that drops out or maps elsewhere) can make them agree on the wrong pair, most often a false homozygote. The consensus table names the callers that decided each gene. - The two diplotypes must be the same up to the order of the alleles. The one passed to PharmCAT is pypgx's. - PharmCAT turns the HLA alleles into its own phenotypes (`*57:01 positive`, `*58:01 negative` and so on) and gives the drug guidance for them; step 27 marks those genes `[outside call]`. diff --git a/docs/41-bloodtype.md b/docs/41-bloodtype.md index acbadea0b..b4e20d14d 100644 --- a/docs/41-bloodtype.md +++ b/docs/41-bloodtype.md @@ -36,7 +36,7 @@ Pinned in `versions.env`; [Image versions](versions.md) lists the current tags. - `${SAMPLE}/vcf/${SAMPLE}.vcf.gz`: one sample, from any caller. Its records near the marker sites are left-aligned first, so an indel need not be written the way the table writes it. Split and whole multi-allelic records, all-sites VCFs (a reference record and then the variant at one position) and gVCF reference blocks are read too: every record that covers a site counts, whatever their order (see below) - the reference (`REF_FASTA`, `reference/GRCh38_no_alt_analysis_set.fasta` by default) with its `.fai`, for the left-alignment; `--reference` in the Nextflow pipeline -- `${SAMPLE}/aligned/${SAMPLE}_sorted.bam` with its `.bai` (`ALIGN_DIR` as for the other BAM steps). Optional: without it RhD is not determined, and a site the VCF has no record for is read as the reference allele at confidence medium. +- `${SAMPLE}/aligned/${SAMPLE}_sorted.bam` with its `.bai` (`ALIGN_DIR` as for the other BAM steps). Optional: without it RhD is not determined, and a site the VCF has no record for is read as the reference allele at confidence medium. A system with no VCF record at any of its sites is then not assessed (see [Without the BAM](#without-the-bam)). ## Command @@ -54,17 +54,30 @@ With `run-all.sh`: `TOOLS=...,bloodtype`. It is opt-in and needs no data, so a r | RhD | read depth over RHD; c.487-19_504dup with c.609G>A | Copies = 2 x RHD depth / depth of the two flanks outside the RHD deletion (0 under 0.5, 1 under 1.5, else 2). The RHD pseudogene (RHD*08N.01) is an inactive copy. Exons 3 to 7 without RHD reads in a gene that is there is the pattern of an RHD-RHCE hybrid gene: RhD is then not determined | | RhCE | c.307C>T (C/c), c.676G>C (E/e) | one allele per copy of the variant | | Kell | c.578C>T (K/k), c.841C>T (Kp), c.1790T>C (Js) | the same | -| Duffy | c.125G>A (Fya/Fyb), c.-67T>C (GATA box), c.265C>T (FY*X) | The GATA box stops expression on red cells; with no phase it is placed on a Fyb chromosome first, where it usually lies (FY*02N.01). FY*X gives a weak Fyb (`b+w`) | +| Duffy | c.125G>A (Fya/Fyb), c.-67T>C (GATA box), c.265C>T (FY*X) | The GATA box stops expression on red cells. With one Fyb and one GATA box, both phased calls in one phase set (the same `PS`, or no `PS` on either), it goes on the chromosome the VCF gives: on the Fya chromosome that is Fy(a-b+). Else it is placed on a Fyb chromosome first, where it usually lies (FY*02N.01). FY*X gives a weak Fyb (`b+w`) | | Kidd, MNS, Lutheran, Diego, Dombrock, Colton | one variant each pair (c.838G>A; c.59T>C and c.143C>T; c.230G>A; c.2561C>T; c.793G>A; c.134C>T) | one allele per copy | | HPA-1, -2, -3, -4, -5, -6, -15 | ITGB3 c.176T>C, GP1BA c.482C>T, ITGA2B c.2621T>G, ITGB3 c.506G>A, ITGA2 c.1600G>A, ITGB3 c.1544G>A, CD109 c.2108C>A | one allele per copy; GRCh38 carries HPA-15b. HPA-6b is a low-frequency antigen, written HPA-6bw in the ISBT table | | HNA-1 | FCGR3B c.108G>C, c.114C>T, c.244G>A, c.316G>A (a or b); c.194A>G (checked); c.233C>A (c) | FCGR3B\*01 (HNA-1a) and \*02 (HNA-1b) differ at five bases. GRCh38 carries the \*02 base at four of them and the \*01 base at c.194, so the copies of HNA-1a are counted on the four, which must agree (else not determined), and c.194 is only checked: a c.194 that does not match is named in the note. FCGR3B\*03 (HNA-1c) is \*02 with c.233C>A and carries HNA-1b too. Without a call at c.233 an HNA-1b allele reads \*02 or \*03. Confidence is always low: FCGR3B and FCGR3A are near copies, and FCGR3B has from none to four or more copies, which the step does not count | | Vel, Langereis, Junior | SMIM1 c.64_80del; 36 ABCB6 null rows; 23 ABCG2 null rows | Read from the null rows alone: two null copies lack the antigen (Vel-, Lan-, Jr(a-)). One copy is a carrier, still positive. Two different null alleles, each once, are taken to sit on different chromosomes (no phase), so the antigen is lacking at confidence low | -| H, Secretor | 34 FUT1 null rows; 14 FUT2 null rows (c.461G>A among them, often written c.428G>A) | The same rule. Two FUT1 null copies give H- on red cells: `H- (Bombay, Oh)` with a non-secretor, `H- (para-Bombay)` with a secretor. The ABO row then says the red cells carry little or no A or B and usually group as O, whatever the ABO alleles are | +| H, Secretor | 34 FUT1 null rows; 14 FUT2 null rows (c.461G>A among them, often written c.428G>A) | The same rule. Two FUT1 null copies give H- on red cells: `H- (Bombay, Oh)` with a non-secretor, `H- (para-Bombay)` with a secretor. The ABO row then says the red cells carry little or no A or B and usually group as O, whatever the ABO alleles are; an ABO row that reads `not assessed` or `not determined` has no alleles to qualify and gets no such note | | Kell null (K0), Kidd null (Jk(a-b-)) | 57 KEL null rows; 40 SLC14A1 null rows, c.342-1G>A and c.871T>C among them | Each null copy silences one chromosome. With no phase it is placed on a chromosome with the antigens of the row's `null_on` column (k, Kpb and Jsb for KEL; Jka or Jkb, as the ISBT table finds it): one KEL null with K/k reads K+k-. Two null copies give K-k- Kp(a-b-) Js(a-b-) (lacking Ku) or Jk(a-b-) (lacking Jk3), also when an antigen site has no call. Two different nulls with different `null_on` alleles are each named with their own in the note | | HPA-7 to -14, -16 to -35 | one variant each in ITGB3, ITGA2B, ITGA2, GP1BB or GP9 | one allele per copy; the a antigen is on the reference allele, the low-prevalence b antigen on the other | | HNA-3, -4, -5 | SLC44A2 c.461G>A, ITGAM c.230G>A, ITGAL c.2372G>C | one allele per copy; GRCh38 carries HNA-3b | -A site the VCF has no record for is the reference allele when the BAM has at least 8 reads there at MAPQ 20, and not determined below that. Without the BAM it is read as reference, and the confidence says so. The step leaves out of `samtools bedcov` the rows on a contig the BAM has no `@SQ` line for (a BAM cut to a few chromosomes), because `bedcov` would stop on them. Those sites then have no depth row: the ones with no VCF record are not determined, and RhD is not determined without chr1. A record at a site whose REF is not the table's REF is a no call, because it says nothing about the table's ALT. There are two exceptions. A 0/0 call over a longer REF that starts with the table's REF is the reference allele. A 0/0 record over a shorter REF (an all-sites VCF's `C . 0/0`, or a gVCF block that starts at a deletion marker such as ABO c.1061delC) says nothing past its own base, so the site reads as one with no record: the reads decide. +A site the VCF has no record for is the reference allele when the BAM has at least 8 reads there at MAPQ 20, and not determined below that. Without the BAM it is read as reference, and the confidence says so (see [Without the BAM](#without-the-bam)). The step leaves out of `samtools bedcov` the rows on a contig the BAM has no `@SQ` line for (a BAM cut to a few chromosomes), because `bedcov` would stop on them. Those sites then have no depth row: the ones with no VCF record are not determined, and RhD is not determined without chr1. A record at a site whose REF is not the table's REF is a no call, because it says nothing about the table's ALT. There are two exceptions. A 0/0 call over a longer REF that starts with the table's REF is the reference allele. A 0/0 record over a shorter REF (an all-sites VCF's `C . 0/0`, or a gVCF block that starts at a deletion marker such as ABO c.1061delC) says nothing past its own base, so the site reads as one with no record: the reads decide. A gVCF reference block (ALT `.`, `<*>` or ``) whose `INFO/END` reaches the table's last REF base is a reference call there, wherever the block starts, with the block's `GQ` and `DP` (else `MIN_DP`) (see [Weak calls](#weak-calls)). + +### Without the BAM + +A VCF lists where the genome differs from the reference. A site with no record is either the reference allele or a site the VCF does not cover, and only the reads tell the two apart. So without the BAM: + +- A system with a record at one of its sites at least is read, and its sites with no record count as the reference allele at confidence medium. The record shows that the VCF covers the gene. +- A system with no record at any of its sites is `not assessed` (phenotype and confidence), and the note names the sites' chromosome. A VCF with no chr9 record would otherwise read ABO as O, the group GRCh38 carries. + +A person who matches GRCh38 at every site of a system (group O at ABO, HPA-1a/1a, most null rows) also has no record there in a variants-only VCF, so that system is not assessed either. A gVCF covers every site with a record or a reference block, and needs no BAM for this. RhD needs the BAM in every case. + +### Weak calls + +A call keeps its genotype, but it is weak when its genotype quality (FORMAT `GQ`) is under 20 or its read depth (FORMAT `DP`, else a gVCF block's `MIN_DP`) is under 8, the same depth a site with no record needs. A system that uses a weak call has confidence low, and its note names the site and the values (`KEL c.578C>T: weak call (GQ 0 under 20, DP 1 under 8)`). The evidence file adds the same values to the site's note. A record without `GQ` or `DP` is not checked. The allele balance of a call (the share of reads that carry the ALT) is not checked. ### Indels written another way @@ -99,8 +112,9 @@ Confidence: - **high**: every site was called in the VCF or covered by reads - **medium**: a site was read as reference with no BAM depth to confirm it, or one of the system's null rows was not determined (for example too few reads there) -- **low**: a site in a region where short reads are unreliable, named in the note (RHCE exon 2 for C/c, which is RHD-like on a C allele; GYPA, GYPB and GYPE, which are near copies), markers that disagree, another allele at a site of a two-antigen pair, or two different null alleles taken to sit on different chromosomes +- **low**: a site in a region where short reads are unreliable, named in the note (RHCE exon 2 for C/c, which is RHD-like on a C allele; GYPA, GYPB and GYPE, which are near copies), markers that disagree, another allele at a site of a two-antigen pair, two different null alleles taken to sit on different chromosomes, a weak call (see [Weak calls](#weak-calls)), or an ABO A allele (no variant shows A: it is a functional allele with neither c.802G>A nor c.803G>C, so a rare O allele that keeps c.261 or a weak A subgroup reads A too) - **not determined**: a needed site had no call or too few reads; RhD without the BAM, with flanks under 10x, or with the hybrid pattern +- **not assessed**: without the BAM, no VCF record at any of the system's sites Row order: first the systems where the genome predicts the person lacks a high-prevalence antigen, then the others in the table's order. The high-prevalence antigens are the ones in the marker table's `high_prevalence` column: ISBT's high-prevalence antigens Vel, Lan, Jra, H, k, Kpb, Jsb, Ku, Jk3, Lub, Dib and Coa, and for platelets HPA-1a and the a antigen of HPA-4 and of HPA-6 to HPA-35 except HPA-15, whose b antigen is a low-prevalence one. Such a row's note ends with `lacks , carried by most people (high prevalence)`. A genome with only the reference alleles lacks none of them, so its rows keep the table's order. @@ -121,9 +135,9 @@ Not measured on a whole genome. bcftools reads the VCF's records near the marker ## Notes -- RhD here is the number of RHD copies, not their kind: weak D and partial D (RHD missense alleles) are not assessed, and neither are the RHD-CE-D hybrids that keep exons 3 to 7. The common RhD-negative allele, the deletion of the whole gene (RHD*01N.01), is what the depth sees. -- Phase is not read. ABO assumes A and B sit on different chromosomes, Duffy places the GATA box on Fyb first. -- Rare and null alleles outside the table (null alleles of two or more variants, ABO's weak subgroups, cis-AB) are not assessed. A high-prevalence antigen reads positive when none of the table's null alleles is found, so a null allele the table does not hold goes unseen. Neither are HNA-2 (CD177), HNA-1d and HNA-1null (no FCGR3B gene) assessed. +- RhD here is the number of RHD copies, not their kind: weak D and partial D (RHD missense alleles) are not assessed, and neither are RHD null alleles other than RHD*08N.01, the RHD-CE-D hybrids that keep exons 3 to 7, and DEL alleles. The common RhD-negative allele, the deletion of the whole gene (RHD*01N.01), is what the depth sees. A D+ row's note says so. +- Phase is read for Duffy only (see the table). ABO assumes A and B sit on different chromosomes, and two different null alleles of one system are taken to sit on different chromosomes. +- Rare and null alleles outside the table (null alleles of two or more variants, ABO's weak subgroups, cis-AB) are not assessed. A high-prevalence antigen reads positive when none of the table's null alleles is found, so a null allele the table does not hold goes unseen: the note of each system read from null rows (Vel, Langereis, Junior, H, secretor, Kell, Kidd) says so while the antigen reads present. The ABO row's note names the ABO alleles outside its five variants. Neither are HNA-2 (CD177), HNA-1d and HNA-1null (no FCGR3B gene) assessed. - Every null row's allele was looked up in gnomAD v4 (genomes and exomes, 2026-11-03): 214 alleles, 53 of them not in gnomAD at all. Three were dropped because they are far more common than their null phenotype allows: FUT2 c.772G>A (rs602662, about 0.5 of chromosomes) and c.335C>T (rs200157007, 0.14 in South Asians) sit on the same haplotype as the common non-secretor allele c.461G>A, so with no phase they turned Se/se carriers into non-secretors; SLC14A1 c.810G>A (rs17675299, 0.08 in Finns) is far too common for a Kidd null. The rows kept that pass 1% in some population are known nulls of that population: FUT2 c.461G>A (the common non-secretor allele), SMIM1 c.64_80del (Vel), ABCG2 c.376C>T (Jr(a-), East Asians), SLC14A1 c.871T>C (Finns), and FUT2 c.812delC (rs1799761, 0.015 in African genomes). - Another ALT at a null row's position (for example G>T at the position of KEL c.1546C>T, rs8176034) is not that null allele: the note names it, and the confidence stays as the other sites set it. - Secretor status: weak secretor alleles (such as FUT2 c.418A>T, often written c.385A>T) and a deletion of the whole FUT2 gene are not assessed; the row's note says so. diff --git a/docs/getting-started.md b/docs/getting-started.md index 67db9ed83..2ea026818 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -177,9 +177,10 @@ When the run starts from an existing VCF, the pipeline does not read a gVCF besi | `MANTA_CALL_REGIONS=file` | a bgzipped BED of the regions Manta calls | `--manta_call_regions` | | `ANCESTRY_PANEL=file`, `PGSC_CALC_DIR=dir` | another ancestry panel (step 26 and the percentiles of step 25), another pgsc_calc checkout; both are passed when `setup.sh` installed them, and `ANCESTRY_PANEL=none` scores without the panel | `--ancestry_ref`, `--pgsc_calc` | | `ANCESTRY_FINE_DIR=dir` | another fine-grained ancestry panel (step 26b); passed when `setup.sh --ancestry-fine-panel` installed it, and `ANCESTRY_FINE_DIR=none` skips the step | `--ancestry_fine_panel` | -| `GRIDSS=true`, `IMPUTATION=true`, `SOMATIC=true` | run steps 4b, 14 and 29 as scripts after the pipeline | | +| `TIDDIT=true`, `GRIDSS=true`, `IMPUTATION=true`, `SOMATIC=true` | run steps 4a, 4b, 14 and 29 as scripts after the pipeline | | | `EXTRA_CALLERS=gatk,freebayes,strelka2,octopus` | run the alternative callers 3a to 3d after the pipeline | | | `BENCHMARK=true` | runs `benchmark-variants.sh` after them; it needs `EXTRA_CALLERS` or a second caller's VCF from an earlier 3a-3d run, and is skipped without one | | +| `EVERYTHING=true` | runs every optional step: see [Every optional step](#every-optional-step) | `-profile everything` | GRIDSS is left out of the SV consensus (step 22): it reports every event as a pair of breakends, and nothing in the pipeline turns a pair into one DEL, DUP or INV. Step 4b writes GRIDSS's high-confidence calls to `sv_gridss/_gridss.high.vcf.gz` beside its raw VCF. @@ -199,7 +200,7 @@ Without `THREADS` or `--max_cpus`, `run-all.sh` passes the machine's CPU count a | 5 AnnotSV | `annotsv_annotations/Annotations_Human/` | `--annotsv_annotations` | | 32 pypgx | `reference/pypgx-bundle/` | `--pypgx_bundle` | | 25 PRS | `prs_scores/*.txt.gz` (`setup.sh` installs the scoring files) | `--pgs_scoring` | -| 10 TelomereHunter, 19 Delly | `reference/cytoBand.hg38.txt`, `reference/delly_human.hg38.excl.tsv` (optional) | `--cytoband`, `--delly_exclude` | +| 10 TelomereHunter, 19 Delly | `reference/cytoBand.hg38.txt` (optional: the repository's copy is used without it), `reference/delly_human.hg38.excl.tsv` (optional) | `--cytoband`, `--delly_exclude` | **Where things land.** Results go to `${GENOME_DIR}//`, in the folders of the pipeline's [output structure](nextflow.md#output-structure). Most match the single scripts' folders; the pipeline writes PharmCAT to `pharmcat/`, ROH to `roh/`, depth to `coverage/` and HLA types to `hla/`, where the scripts use `vcf/`, `vcf/`, `mosdepth/` and `hla_t1k/`. The reports read both. At the end `run-all.sh` renders the full HTML report (`_report.html`, step 24), the text report (`_report.txt`) and the `summary.json` both are made from. @@ -219,6 +220,20 @@ The `work/` folder holds a copy of every intermediate file (from FASTQ, several **After a failure** run the same command again: `-resume` reuses every task that finished and runs the rest, including from the start the one that was running when the run stopped. **To rerun one step by hand**, run its script, for example `./scripts/06-clinvar-screen.sh your_name` after a ClinVar update, then `./scripts/24-html-report.sh your_name` and `./scripts/generate-report.sh your_name` to refresh the reports. A script reads the folders the scripts write; where the pipeline's folder differs (above), a script that reads another step's output may need that step run by hand first. +### Every optional step + +`EVERYTHING=true ./scripts/run-all.sh your_name male` runs every step the pipeline has, the opt-in ones too. The list is [`assets/everything.tsv`](https://github.com/GeiserX/OwnGenome/blob/main/assets/everything.tsv), one row per optional item: + +- every `--tools` name goes into `TOOLS`, so Parascopy, Paraphase, the Y steps, the raw-data export, blood groups, Lp(a), VNtyper, CHIP, viral DNA, ancient populations, MEGAnE, MoChA and Locityper run; +- `KIR`, `HLA_QC`, `TIDDIT`, `GRIDSS`, `IMPUTATION`, `SOMATIC` and `BENCHMARK` are `true`, and `EXTRA_CALLERS` is `gatk,freebayes,strelka2,octopus`; +- `TOOLS`, or one of these switches set to another value, stops the run with exit 2. + +A step whose data is not installed stops the run with exit 2 before Nextflow starts, and the error names the command that installs it, for example `setup.sh --yleaf-data`. So does `ANCESTRY_PANEL`, `ANCESTRY_FINE_DIR` or `ARCHAIC_DIR` set to `none`. The check covers the classic BWA index that GRIDSS (step 4b, after the pipeline) reads beside the reference: `setup.sh` does not build it, and the error names `bwa index` ([4b](04b-gridss.md)). A refused run leaves the last run's `logs/run_status.tsv` as it was. Cyrius counts too: `setup.sh --cyrius` installs it, and you accept its non-commercial licence when you run that command. A skip that comes from the sample stays a skip: no BAM, no gVCF, a female sample for the two Y steps, a BAM that is not PacBio HiFi for Paraphase. + +Some things only you can give, so `EVERYTHING=true` leaves them to you: the symptoms for Exomiser (`HPO`), the families file (`FAMILIES`) and the drugs you take (`--medications`). The long-read scripts (2b, 3e, 4c) read ONT or PacBio HiFi reads, so you run them by hand on such data. One step stays out: `cram_archive` writes a CRAM copy of each BAM, which costs disk and adds no result. + +On the Nextflow path, `-profile docker,everything` sets the same tools and switches (`conf/everything.config`). Pass the database of each tool; `main.nf` stops before any task and names the option a tool lacks. CI fails when a new opt-in step, switch, setup flag or optional image has no row in the list (`og dev everything-check`). + ### Path A: I Have FASTQ Files (Raw Reads) The paths below run the steps one by one, with Docker alone. Most common if you downloaded data from Nebula, Dante Labs, Novogene, BGI, or any sequencing provider. diff --git a/docs/live-site.md b/docs/live-site.md index ea5fbd3b8..f9943477c 100644 --- a/docs/live-site.md +++ b/docs/live-site.md @@ -110,7 +110,7 @@ On a phone each page is one column and each table row becomes a short list of la `bin/owngenome_live_viewer.py` serves it, behind the same password as every page. `owngenome-live.sh` passes it the reference (`REF_FASTA`, as in every step) and igv.js, which the first start downloads into `GENOME_DIR/tools/` and checks against `IGV_JS_SHA256` in `versions.env`. Without the reference's `.fai` or igv.js the site starts without the viewer and says why; `OWNGENOME_LIVE_VIEWER=off` leaves it out on purpose. Running `owngenome_live.py` yourself (in Docker, say), pass `--viewer-fasta` and `--viewer-igv-js`. -Per run it serves the folder's BAM or CRAM, its VCF and its SV VCF, each with its index, and the reference: the files `owngenome-view.sh` picks by default. A track whose file or index is a symlink out of `GENOME_DIR` is left out. The page and the files carry the viewer's Content-Security-Policy, so the page talks to this site only, and igv.js's calls to outside services are blocked. +Per run it serves the folder's BAM or CRAM, its VCF and its SV VCF, each with its index, and the reference: the files `owngenome-view.sh` picks by default, Manta's diploid SVs before step 22's consensus. A track whose file or index is a symlink out of `GENOME_DIR` is left out. The page and the files carry the viewer's Content-Security-Policy, so the page talks to this site only, and igv.js's calls to outside services are blocked. The reads cross the network to the browser that logged in: only the byte ranges igv.js asks for, but they are the sample's reads. Off loopback, use TLS (`--tls-cert` and `--tls-key`, or a proxy that ends TLS); without it the password and the reads cross the network in clear. Opening the viewer writes one access-log row; the byte ranges igv.js reads write none. diff --git a/docs/nextflow.md b/docs/nextflow.md index 68d7eae1a..752923bc7 100644 --- a/docs/nextflow.md +++ b/docs/nextflow.md @@ -84,8 +84,8 @@ nextflow run main.nf \ # only when it agrees with T1K (docs/08-hla-typing.md) # With pharmcat, PGX_CONSENSUS gives PharmCAT the HLA types of hla_typing and a CYP2D6 call only when # pypgx and cyrius agree (docs/36-pgx-consensus.md); PharmCAT then waits for those BAM steps. -# telomere_hunter (a default tool) takes --cytoband for GRCh38 bands; without it, -# TelomereHunter uses its own hg19 bands and the run logs a warning +# telomere_hunter (a default tool) gets GRCh38 bands: --cytoband , or without it +# the copy the repository ships (assets/reference/cytoBand.hg38.txt) # An unknown name in --tools stops the run. # --pedigree pedigree.tsv + --somalier_sites: the family workflow over the samplesheet rows # it names (two or more, each with a gVCF; docs/multi-sample.md) diff --git a/docs/parameters.md b/docs/parameters.md index b4cbdec3b..b6c8d4606 100644 --- a/docs/parameters.md +++ b/docs/parameters.md @@ -38,7 +38,7 @@ Paths to reference files required by the pipeline. ## Tool selection -Control which analysis tools to run. +Control which analysis tools to run. `-profile everything` (`conf/everything.config`) sets `--tools` to every tool of [`assets/everything.tsv`](https://github.com/GeiserX/OwnGenome/blob/main/assets/everything.tsv), and `--kir`, `--hla_qc` and `--cpsr_secondary_findings` to `true`: every optional step, as `EVERYTHING=true` does on `run-all.sh` ([Every optional step](getting-started.md#every-optional-step)). It leaves out `exomiser`, which runs when `--hpo` is set, and `cram_archive`. | Parameter | Default | What it does | |---|---|---| @@ -119,7 +119,7 @@ Paths to clinical and population genetics reference data. | `--annotsv_annotations` | none | AnnotSV annotation directory (contains Annotations_Human/), built once with AnnotSV's INSTALL_annotations.sh. Required by annotsv: the AnnotSV image ships no annotation data. | | `--delly_exclude` | none | Optional Delly exclude map, passed as `delly sr -x` (for example Delly's excludeTemplates/human.hg38.excl.tsv). | | `--manta_call_regions` | none | Optional bgzipped BED of the regions Manta calls on, passed as `configManta.py --callRegions`; its .tbi must sit beside it. For example chr1-22, X and Y, which keeps Manta off the ALT, decoy and unplaced contigs. | -| `--cytoband` | none | Optional UCSC GRCh38 chromosome bands (cytoBand.hg38.txt, chr1-22, X and Y; scripts/setup.sh installs it), passed as `telomerehunter -b`. Without it TelomereHunter uses its own hg19 bands. | +| `--cytoband` | none | UCSC GRCh38 chromosome bands (cytoBand.hg38.txt, chr1-22, X and Y), passed as `telomerehunter2 -b`. Without it the run passes the copy the repository ships, `assets/reference/cytoBand.hg38.txt` (the file scripts/setup.sh installs). | | `--somalier_sites` | none | somalier's GRCh38 sites VCF (sites.hg38.vcf.gz; scripts/setup.sh installs it under reference/somalier/). Required by sample_qc. | | `--verifybamid2_panel` | none | Folder holding VerifyBamID2's marker panel, the .UD, .mu and .bed files of one prefix (scripts/setup.sh installs the 1000 Genomes 100k GRCh38 panel under reference/verifybamid2/). Required by sample_qc. | | `--freemix_warn` | `0.03` | VerifyBamID2's FREEMIX (estimated share of reads from another person) above which sample_qc reports possible contamination. A warning only; it never stops the run. | diff --git a/docs/pipeline-overview.md b/docs/pipeline-overview.md index 8f28913c3..313c9de9e 100644 --- a/docs/pipeline-overview.md +++ b/docs/pipeline-overview.md @@ -178,7 +178,7 @@ These run after the core pipeline completes and combine outputs from earlier ste A default `./scripts/run-all.sh ` runs **37 numbered steps**: 1b and 2 (only when there is no BAM yet), 3 (only when there is no VCF yet), 4, 5, 6, 7, 8, 9, 9b, 10, 11, 12, 13, 15, 16, 16b, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 26b, 27, 28, 30, 31, 32, 33, 36, 42 and 43. Steps 5, 8, 13, 17, 18, 32 and 33 are reported as skipped when their data is not installed (for 33, somalier's sites and VerifyBamID2's panel, which `setup.sh` installs), 21 when Cyrius is not installed (`setup.sh --cyrius`; non-commercial licence), 25 when no score file is, 26 (inside the PRS run of step 25) when the ancestry panel is not, 26b when its panel (`setup.sh --ancestry-fine-panel`) is not, 43 when its table (`setup.sh --archaic`) is not, 23, 30 and 31 when step 13 did not run, 36 (inside the PharmCAT stage) runs when step 8 or 32 did, and 42 and 43 (43 once its table is installed) are reported as skipped for a sample that starts from a VCF, unless it has a BAM too and a gVCF beside the VCF (the gVCF `run-all.sh` passes on). It ends with the summary report (`generate-report.sh`). -Off unless you ask for them: 35 (`TOOLS=...,parascopy`, after `setup.sh --parascopy-data`), 35b (`TOOLS=...,paraphase`, on a PacBio HiFi BAM), KIR typing in step 8 (`KIR=true`, after `setup.sh --kir-data`), OptiType beside T1K in step 8 (`HLA_QC=true`), 4b (`GRIDSS=true`), 14 (`IMPUTATION=true`), 29 (`SOMATIC=true`), 37 (`TOOLS=...,y_haplogroup`, after `setup.sh --yleaf-data`, male samples), 40 (`TOOLS=...,consumer_export`, after `setup.sh --consumer-sites`), 41 (`TOOLS=...,bloodtype`), 44 (`TOOLS=...,ancient`, after `setup.sh --ancient-panel`), 45 (`TOOLS=...,y_str`, male samples), 46 (`TOOLS=...,lpa`), 47 (`TOOLS=...,viral`, after `setup.sh --viral-data`), 48 (`HPO=...` with the symptoms as HPO terms, after `setup.sh --exomiser-data`), 49 (`TOOLS=...,chip`, after `setup.sh --chip-data`), 50 (`TOOLS=...,mei`, after `setup.sh --megane-kmers`), 51 (`TOOLS=...,mocha`, after `setup.sh --mocha-data`), 52 (`TOOLS=...,vntyper`), 53 (`TOOLS=...,locityper`, after `setup.sh --locityper-data`), the alternative callers 3a to 3d (`EXTRA_CALLERS=gatk,freebayes,strelka2,octopus`) and the caller comparison (`BENCHMARK=true`). Step 1 (ORA input) and the other alternative scripts (2a, 2b, 3e, 4a, 4c) run only by hand. Step 33 stops the run when somalier's sex from the reads differs from the declared one, as step 16 does (`--sex_check warn` logs it and goes on). Step 34 runs by hand, or in the Nextflow pipeline with `cram_archive` in `--tools`. Steps 38 and 39 work on a family, not one sample. With `FAMILIES=`, `run-all.sh` runs them after the pipeline once the members they need are processed, and records `skipped (waiting: ...)` until then ([Running it](multi-sample.md#running-it)). Without `FAMILIES`, run `38-family.sh` and `39-couple.sh` by hand with a pedigree, or give the Nextflow pipeline `--pedigree` (step 39 then runs for two samples the pedigree marks as partners, when `clinvar` is in `--tools`). +Off unless you ask for them: 35 (`TOOLS=...,parascopy`, after `setup.sh --parascopy-data`), 35b (`TOOLS=...,paraphase`, on a PacBio HiFi BAM), KIR typing in step 8 (`KIR=true`, after `setup.sh --kir-data`), OptiType beside T1K in step 8 (`HLA_QC=true`), 4a (`TIDDIT=true`), 4b (`GRIDSS=true`), 14 (`IMPUTATION=true`), 29 (`SOMATIC=true`), 37 (`TOOLS=...,y_haplogroup`, after `setup.sh --yleaf-data`, male samples), 40 (`TOOLS=...,consumer_export`, after `setup.sh --consumer-sites`), 41 (`TOOLS=...,bloodtype`), 44 (`TOOLS=...,ancient`, after `setup.sh --ancient-panel`), 45 (`TOOLS=...,y_str`, male samples), 46 (`TOOLS=...,lpa`), 47 (`TOOLS=...,viral`, after `setup.sh --viral-data`), 48 (`HPO=...` with the symptoms as HPO terms, after `setup.sh --exomiser-data`), 49 (`TOOLS=...,chip`, after `setup.sh --chip-data`), 50 (`TOOLS=...,mei`, after `setup.sh --megane-kmers`), 51 (`TOOLS=...,mocha`, after `setup.sh --mocha-data`), 52 (`TOOLS=...,vntyper`), 53 (`TOOLS=...,locityper`, after `setup.sh --locityper-data`), the alternative callers 3a to 3d (`EXTRA_CALLERS=gatk,freebayes,strelka2,octopus`) and the caller comparison (`BENCHMARK=true`). `EVERYTHING=true` turns on all of these at once ([Every optional step](getting-started.md#every-optional-step)). Step 1 (ORA input) and the other alternative scripts (2a, 2b, 3e, 4c) run only by hand. Step 33 stops the run when somalier's sex from the reads differs from the declared one, as step 16 does (`--sex_check warn` logs it and goes on). Step 34 runs by hand, or in the Nextflow pipeline with `cram_archive` in `--tools`. Steps 38 and 39 work on a family, not one sample. With `FAMILIES=`, `run-all.sh` runs them after the pipeline once the members they need are processed, and records `skipped (waiting: ...)` until then ([Running it](multi-sample.md#running-it)). Without `FAMILIES`, run `38-family.sh` and `39-couple.sh` by hand with a pedigree, or give the Nextflow pipeline `--pedigree` (step 39 then runs for two samples the pedigree marks as partners, when `clinvar` is in `--tools`). The [Nextflow pipeline](nextflow.md) runs the same chain from a samplesheet, from FASTQ (steps 1b, 2, 16 and 3) to the report, with the steps above that have a module. diff --git a/docs/results/secondary-findings.md b/docs/results/secondary-findings.md index 94e96b430..28ef4721d 100644 --- a/docs/results/secondary-findings.md +++ b/docs/results/secondary-findings.md @@ -12,12 +12,12 @@ The most common "pathogenic" finding in any genome is **heterozygous carrier sta - **Note — MUTYH**: Biallelic (homozygous or compound het) MUTYH carriers have a well-established high colorectal cancer risk. For **monoallelic** (single-copy) carriers, the evidence is more nuanced: some meta-analyses show a modest risk increase, but a counseling framework for moderate-penetrance CRC genes (Genetics in Medicine) notes that risk estimates for monoallelic MUTYH are conflicting and that screening recommendations (e.g., earlier colonoscopy) were historically tied to carriers with a CRC family history. Discuss with a genetic counselor, especially if you have a family history of CRC - Examples: GJB2 (hearing loss), CFTR (cystic fibrosis), HFE (hemochromatosis) -**Your own carrier list (step 24 report).** The ClinVar card of both reports is followed by a carrier list for this one sample, with no partner needed: every step 6 ClinVar hit in the 3,292 recessive and X-linked genes of `assets/carrier_genes.tsv` (the list of the [couple screen](../39-couple.md#the-carrier-list)). An allele that list marks as a hypomorph (for example BTD p.Asp444His or the GALT Duarte variants) or a pseudodeficiency allele (HEXA c.739C>T and c.745C>T, which lower the enzyme test result but cause no Tay-Sachs disease) is listed as set aside, never as a carrier finding on its own. +**Your own carrier list (step 24 report).** The ClinVar card of both reports is followed by a carrier list for this one sample, with no partner needed: every step 6 ClinVar hit in the 3,292 recessive and X-linked genes of `assets/carrier_genes.tsv` (the list of the [couple screen](../39-couple.md#the-carrier-list)). An allele that list marks as a hypomorph (for example BTD p.Asp444His or the GALT Duarte variants) or a pseudodeficiency allele (HEXA c.739C>T and c.745C>T, which lower the enzyme test result but cause no Tay-Sachs disease) is listed as set aside, never as a carrier finding on its own. A hit that is a combined allele of step 6 or a part of one keeps the note the ClinVar table prints for it (`combined_allele` in `summary.json`), and so does a secondary finding: an unphased combined allele says its parts may sit on different copies. -**Secondary findings follow each gene's ACMG rule.** The secondary-findings card (step 23's section of the report) applies the reporting rule of each of the 84 ACMG SF v3.3 genes (Lee et al., Genet Med 2025;27(8):101454, Table 1), written gene by gene in `assets/acmg_sf.tsv`: +**Secondary findings follow each gene's ACMG rule.** The secondary-findings card (step 23's section of the report; in summary.json also `sections.acmg_sf`, written from step 6's hits on every run, VEP cache or not) applies the reporting rule of each of the 84 ACMG SF v3.3 genes (Lee et al., Genet Med 2025;27(8):101454, Table 1), written gene by gene in `assets/acmg_sf.tsv`: - a dominant gene (BRCA1, LDLR, MYH7 and most others): one pathogenic or likely pathogenic variant is reported; -- a recessive gene (MUTYH, ATP7B, BTD, CYP27A1, GAA, RPE65, CASQ2, TRDN): two variants are needed, a homozygote or two different ones even when their phase is unknown. One heterozygous MUTYH variant is listed apart as not reported, with the reason; +- a recessive gene (MUTYH, ATP7B, BTD, CYP27A1, GAA, RPE65, CASQ2, TRDN): both copies of the gene must be hit. A homozygote, or two variants that read-backed phase puts on different copies (a `|` genotype with the same phase set, PS), are biallelic. Two different variants of unknown phase are still reported, as possibly biallelic: most short-read calls carry no phase, and they may sit on one copy. In `summary.json` each such finding has a `pair` field (`biallelic` or `possibly biallelic`) and a `phase` field that says why. Two variants that read-backed phase puts on the same copy (cis) hit one copy only, so they are listed apart with the phase set. A `|` genotype with no phase set, or a half call such as `1|.`, counts as phase unknown. The two alt alleles of one split call (`1/.` and `./1` at one position) sit on different copies. A combined allele of step 6 counts once with its parts, unless it is unphased and two of its parts are hits on their own. A record with no alt copy called counts nothing. One heterozygous MUTYH variant is listed apart as not reported, with the reason; - HFE: only homozygous p.Cys282Tyr. A heterozygous p.Cys282Tyr or a homozygous p.His63Asp is not reported; - X-linked: GLA (Fabry disease) and OTC are reported in a hemizygous male and a heterozygous female alike. ABCD1 (X-linked adrenoleukodystrophy) is reported hemizygous, homozygous or with two heterozygous variants, never for one heterozygous variant; - BTD with p.Asp444His: reported as partial, not profound, biotinidase deficiency; @@ -25,12 +25,14 @@ The most common "pathogenic" finding in any genome is **heterozygous carrier sta **Two hits across callers: a deletion plus a variant on the other copy.** Small-variant callers see one hit when the other copy of the gene is deleted. So the carrier list also joins the deletions the other engines call with the ClinVar hits, gene by gene (`og summary collect`, `two_hits`). The deletions come from AnnotSV's class 4 and 5 deletions (step 5), step 35's interval table (the recurrent regions of `bin/cn_loci.tsv`, such as 1q21.1), its HBA1/HBA2 count and Parascopy's SMN1 count. A recessive gene that a deletion and a hit both reach gets one line: -- **biallelic** when the reads show the two hits on different copies. Either the hit is called homozygous inside the deletion, so it sits on the one copy left (the line and the carrier list call it hemizygous), or both calls carry read-backed phase (a `|` genotype with the same phase set, PS) on different copies; +- **biallelic** when the reads show the two hits on different copies. Either the hit is called homozygous inside the deletion, so it sits on the one copy left (the line and the carrier list call it hemizygous; if the deletion is a false call, the hit is homozygous and both copies still carry it), or both calls carry read-backed phase (a `|` genotype with the same phase set, PS) on different copies. A low-expression (hypomorph) allele called homozygous inside a deletion is only **possibly biallelic**: it causes disease with a null allele only if the deletion is real, so confirm the deletion (array or MLPA); - **possibly biallelic** otherwise: the phase is unknown. Most short-read calls carry no phase, so this is the usual line. Step 05's checked table keeps no genotype column yet, and step 35's counts have no phase, so in a pipeline run a deletion pairs as possibly biallelic unless the hit is called homozygous inside it. A parent's genome (step 38, [family analysis](../multi-sample.md#family-analysis-step-38-opt-in)) or long reads can settle it; - no line when read-backed phase puts both on the same copy (cis): the other copy is intact. Examples: an exon deletion of MUTYH plus a pathogenic MUTYH variant; three alpha-globin genes plus an HBA2 point variant; one SMN1 copy plus an SMN1 variant (short reads place few SMN1 variants reliably, so check with a targeted test); and the 1q21.1 deletion plus one of the two RBM8A low-expression alleles (c.-21G>A, rs139428292, or c.67+32G>C, rs201779890), the cause of TAR syndrome (thrombocytopenia with absent radius; Albers et al., Nat Genet 2012;44(4):435-439, PMID 22366785). On its own an RBM8A low-expression allele stays set aside. The [couple screen](../39-couple.md) (step 39) applies the same pairing between partners: a hypomorph allele of the list in one partner and a full loss of function in the same gene in the other (a ClinVar pathogenic variant, a Delly deletion) is a shared gene with its risk for a child; the allele in both partners, or in one alone, stays set aside. In the secondary-findings card a called deletion counts as one of the two variants a recessive gene needs, unless read-backed phase puts it on the variant's copy. The line under the carrier list names the deletion callers it read and the ones it could not read. A deletion AnnotSV ranks below class 4 is not counted. +Without a readable clinical VCF from step 23 (no VEP cache, step 23 skipped or failed with no VCF left, or a VCF that cannot be read) the card in `sections.acmg_sf` holds the ClinVar hits and the SVs only, and its `high_impact_note` says so: a predicted loss-of-function variant that is not in ClinVar is not screened, alone or as the second hit of a recessive gene. A clinical VCF left by an earlier run is still read when step 23 failed in this run, as the clinical section reads it; that section then shows as stale, and the card's `high_impact_note` gives the date of that earlier VCF and step 23's result in this run. + The TTN rule (truncating variants only) and the LMNA rule (missense only with cardiac evidence) are printed beside the finding, not applied. It is still a list to review with a clinician. --- diff --git a/docs/results/traits-and-somatic.md b/docs/results/traits-and-somatic.md index 648d7851e..15641eba6 100644 --- a/docs/results/traits-and-somatic.md +++ b/docs/results/traits-and-somatic.md @@ -18,7 +18,7 @@ Telomeres are protective caps at the ends of chromosomes that shorten with cell ### Limitations - **Not a clinical telomere length measurement.** TelomereHunter was developed for cancer genome analysis, not as a validated healthy-population aging assay -- **Not a "biological age" readout.** While telomere length correlates with aging at a population level, it is a rough estimate of aging rate and is not established as a clinically important standalone risk marker for individuals (see Vaiserman & Krasnienkov, "Telomere Length as a Marker of Biological Age," 2021) +- **Not an age.** Telomere length follows age only across a population. For one person it is a rough estimate, and it is not an established standalone risk marker (Vaiserman and Krasnienkov 2021, Frontiers in Genetics 11:630186, https://doi.org/10.3389/fgene.2020.630186) - Short-read WGS systematically underestimates telomere length compared to dedicated assays (TRF, FlowFISH) - Useful only for **relative comparisons** between samples run on the same platform — not absolute measurements and not individual health predictions diff --git a/docs/rust.md b/docs/rust.md index 3e2a92a88..6c17ff49b 100644 --- a/docs/rust.md +++ b/docs/rust.md @@ -42,7 +42,7 @@ tests/rust/ the differential test against CPython, the image test Each ported tool becomes a subcommand named after its file in `bin/` without `.py`, in kebab-case. Today `og` has `og qc sex-loss` (step 33), `og version`, `og --tree-hash`, `og map`, `og setup mask-fasta`, `og run state|tasks|eta|headroom|delta`, `og dev parity-compare`, `og pgx cyp2d6-bed|cyp2d6-measure|cyp2d6-check`, `og str motif|catalog`, `og cdna check|scan` (were `clip_check.py` and `cdna_scan.py`), `og comphet phase` (was `comphet_phase.py`), `og bam contigs`, `og setup unzip|genetic-map` and two hidden ones the tests drive: `og pycompat-probe` and `og bam-fetch-probe`. The filters of steps 04, 05 and 07 are grouped by step: `og sv svlen-fix` and `og sv inv-filter` (were `sv_svlen_fix.py` and `manta_inv_filter.py`), `og pgx refblock-fill` and `og pgx mito-merge` (were `pgx_refblock_fill.py` and `pgx_mito_merge.py`). Step 05 builds AnnotSV's input with `og sv add-callers` and checks its class 4 and 5 calls with `og sv postfilter` (were `cnvpytor_to_vcf.py` and `annotsv_postfilter.py`); both apply one read-depth rule for long Delly calls (`og-steps::sv`). Step 39's couple screen applies the same rule. `og str catalog` (was `strchive_convert.py`) builds the STRchive catalog of steps 09 and 9b; `og setup unzip` and `og setup genetic-map` replace two small Python programs inside `setup.sh`. Step 25 has `og prs format` (a port of `collect_summary.py prs-format`, named by what it works on) and `og prs table` (was `prs-table`). Step 33 has `og qc sample` (was `sample-qc`), and step 20 has `og mito annotate|deletions|copies` (were `mito-annotate`, `mito-deletions` and `mito-copies`). Steps 23 and 31 use `og vcf csq-rank` and `og table constraint-join` (ports of the awk programs `bin/csq_rank.awk` and `bin/constraint_join.awk`, named by what they work on). Step 27 uses `og pgx cpic-report` and `og pgx step36-outside` (were the two commands of `pgx_parse.py`). Step 49 runs `og chip prepare`, `og chip report` and `og chip check-table` (were the commands of `chip_report.py`). Steps 32, 35, 41 and 46 run `og cn bed`, `og cn call`, `og cn intervals`, `og cn check-bam`, `og cn marker-regions` and `og cn marker-read` ([Copy number from depth](cn-loci.md)); they replace `hba_copy_number.py`, `lpa_kiv2.py`, `copy_number.py` (the catalog tests materialise its pinned historical version as a differential oracle) and the marker reader of `traits_report.py`. Step 41 runs `og bloodtype report` (was `bloodtype_report.py`), which reads the marker sites through the VCF's index. Step 26b's six commands are `og ancestry-fine panel-map|check-map|order|sample-bed|chroms|report`. Step 43 runs `og archaic table|strict|genotypes|report` (were the four commands of `archaic_report.py`), and the archaic jobs of `public-evidence.yml` run `og archaic compare|genomes` (were the two commands of `archaic_compare.py`), and step 44 runs `og ancient select|lift|person-geno|align|report` (were the five commands of `ancient_report.py`); `og ancient lift` reads UCSC's chain file with `og-intervals::chain`. Step 40 runs `og consumer build-sites`, `og consumer export` and `og consumer check` (were the three commands of `export_consumer.py`). Step 38 and the Nextflow family workflow run `og family plan`, `prepare`, `check`, `report`, `segments` and `ibd` (were `family_report.py`, `family_segments.py` and `ibd_report.py`), and index the phased family VCF with `og vcf index` (was a `pysam.tabix_index` one-liner). `og family report` reads the joint VCF once, compresses each child's inheritance table on its own thread, and stops with exit 2 on a joint VCF that is not sorted. Step 39 and the Nextflow `COUPLE_CARRIER` process run `og couple screen`, and `og couple genes` rebuilds the carrier list (were the two commands of `couple_report.py`); the screen computes every couple before it writes a file. The opt-in steps read their tool's output with `og y str-bed|str-report` (45), `og viral report` (47), `og exomiser prepare|report` (48), `og mei report|annotsv-input` (50), `og mocha report` (51), `og vntyper report` (52) and `og locityper report` (53); they replaced `ystr_report.py`, `viral_report.py`, `exomiser_report.py`, `mei_report.py`, `mocha_report.py`, `vntyper_report.py` and `locityper_report.py`. Step 37 places the sample on the current YFull YTree with `og y tree-positions` and `og y tree-place` (were the two commands of `y_tree_place.py`), lists its private SNPs with `og y private-snps` (was `y_private_snps.py`) and writes Yleaf's marker positions with `og y yleaf-positions` (was `yleaf_run.py positions`; `yleaf_run.py predict` stays Python, as glue inside Yleaf's own code). Steps 08, 32 and 36 run `og pgx hla-concordance`, `og pgx pypgx-summary` and `og pgx outside-calls` (were the three commands of `pgx_outside_calls.py`), and step 35b runs `og paraphase check-bam|table` (were `paraphase_report.py`). Both write their two output files together or not at all. `scripts/owngenome-lookup.sh` runs `og lookup query` ([genotype lookup](lookup.md)), which answers every query of the command line in one process; `og lookup resolve` and `og lookup report` are its two halves, with the command lines of `genome_lookup.py`, which keeps only the query reading and the names rule that `results_index.py` imports. `og recheck` replaced `owngenome_recheck.py` ([Newer databases since a run](recheck.md)); the file stays one release as a shim that runs it, for crontabs. `og dev freshness` replaced `scripts/ci/freshness.py`, the monthly freshness issue of `freshness.yml`. Any failed lookup makes it exit 1. With `--unreachable-warns`, a lookup whose upstream did not answer (no connection, a timeout, HTTP 5xx or 429 after the retries, or HTTP 403, which an upstream that refuses a whole network answers) is listed under its own heading as a warning and does not change the exit; `freshness.yml` passes it only in the pull-request dry run, so a third-party outage does not block a pull request, and the monthly report stays strict. `og dev build cn-intervals|callability|sv-rule-regions` rebuild the committed tables `bin/cn_loci.tsv` (its interval rows), `assets/callability_genes.tsv` and `assets/sv_rule_regions.tsv`; they replaced `scripts/ci/build-cn-intervals.py` and the Python inside `build-callability.sh` and `build-sv-rule-regions.sh`. Those scripts keep the downloads (`curl` through `scripts/ci/lib/fetch-pinned.sh`, each file checked against its sha256) and hand `og` the folder, so `og dev build` reads local files only. Both ask the network through the host's `curl` (the config on stdin, so no token reaches the process list), which keeps a TLS stack out of the static binary and its cross-builds. -Every verb the 1.0.0 release still has to port is already registered, each in its own module, as a stub that prints `og : not ported yet` on stderr and exits 2: `og report charts`, `og live serve|results|family|demo`, `og view serve`, `og vcf shift-back`, `og setup chrm-shift|revel|roh-af`, `og sv survivor-prep|consensus-check`, `og ancestry-fine freqs|project|paint`, `og longread clair3-model`, `og map svg`, `og dev demo-sample|demo-events|python-gate|everything-check|docs-check|steps-check` and `og dev build roh-af|acmg-lof`. A port fills its module's body and does not edit `og/src/main.rs`, the workspace member list or a crate's module list. `rust/og/tests/port_scaffold.rs` lists these verbs and fails when one has no line in `og --help` (`og dev --help` for an `og dev` verb) or reaches a router's "unknown" error. `og report render` is part way: it writes the frame of both reports and the quality-control and variant sections, leaves the other sections out, and no step calls it yet; `bin/render_report.py` still writes the reports. +Every verb the 1.0.0 release still has to port is already registered, each in its own module, as a stub that prints `og : not ported yet` on stderr and exits 2: `og live serve|results|family|demo`, `og view serve`, `og vcf shift-back`, `og setup chrm-shift|revel|roh-af`, `og sv survivor-prep|consensus-check`, `og ancestry-fine freqs|project|paint`, `og longread clair3-model`, `og map svg`, `og dev demo-sample|demo-events|python-gate|everything-check|docs-check|steps-check` and `og dev build roh-af|acmg-lof`. A port fills its module's body and does not edit `og/src/main.rs`, the workspace member list or a crate's module list. `rust/og/tests/port_scaffold.rs` lists these verbs and fails when one has no line in `og --help` (`og dev --help` for an `og dev` verb) or reaches a router's "unknown" error. `og report render` is part way: it writes the frame of both reports and the quality-control and variant sections, leaves the other sections out, and no step calls it yet; `bin/render_report.py` still writes the reports. `og report charts` writes the five chart specs and their inline SVG as `bin/render_report.py --charts-json` does; no step calls it yet either. `og ancestry-fine simulate` builds an admixed genome with known truth from held-out people of the fine-ancestry panel: an unphased VCF and a BED of each copy's ancestry. The engines that replace ADMIXTURE and RFMix test against it. It and the parts those engines share (the panel reader, the genetic map, `model/ref.geno` and a seeded xoshiro256** generator) live in `og-admix`. diff --git a/docs/vcf-first.md b/docs/vcf-first.md index 35cf56a68..8a4758714 100644 --- a/docs/vcf-first.md +++ b/docs/vcf-first.md @@ -7,7 +7,7 @@ Many providers send a VCF, the file that lists where your DNA differs from the r ## What runs on a VCF alone -With only `sample`, `vcf` and `vcf_index` in the [samplesheet](nextflow.md#samplesheet-format), these tools run: `pharmcat`, `cpic`, `clinvar`, `vep`, `vcfanno`, `slivar`, `clinical_filter`, `cpsr`, `roh`, `prs`, `ancestry`, `mito_haplogroup` and `html_report`. +With only `sample`, `vcf` and `vcf_index` in the [samplesheet](nextflow.md#samplesheet-format), these tools run: `pharmcat`, `cpic`, `clinvar`, `vep`, `vcfanno`, `slivar`, `clinical_filter`, `cpsr`, `roh`, `prs`, `ancestry`, `mito_haplogroup` and `html_report`. The blood groups run too when `--tools` names `bloodtype` (it is opt-in), with RhD not determined. Without reads, a site the VCF does not list may be the reference allele or a site the file does not cover, so a blood group system with no record at any of its sites reads "not assessed" ([Step 41](41-bloodtype.md#without-the-bam)). Everything that reads the aligned reads has nothing to work on, so it does not run: coverage (`mosdepth`, and `multiqc`, which reads it), structural variants and copy-number changes (`manta`, `delly`, `cnvpytor`, `duphold`, `annotsv`, `survivor_merge`), HLA typing, repeat expansions, telomere length, mitochondrial heteroplasmy and the read-depth CYP2D6 calls (`cyrius`, `pypgx`). If your provider can send the BAM or FASTQ, get it. The [Vendor Compatibility Guide](vendor-guide.md) says what each provider delivers. diff --git a/docs/versions.md b/docs/versions.md index 8a20eeadc..6a4ac9b4e 100644 --- a/docs/versions.md +++ b/docs/versions.md @@ -34,7 +34,7 @@ This page is generated by `scripts/ci/gen-versions-doc.sh` from `versions.env` a | Variant annotation | pcgr | `PCGR_IMAGE` | `ghcr.io/sigven/pcgr` | `2.3.2` | Docker Hub sigven/pcgr stops at 2.2.5; 2.3.x is on ghcr.io | | Pharmacogenomics | pharmcat | `PHARMCAT_IMAGE` | `pgkb/pharmcat` | `3.4.0` | | | Pharmacogenomics | pypgx | `PYPGX_IMAGE` | `quay.io/biocontainers/pypgx` | `0.26.0--pyh7e72e81_0` | | -| Specialized analysis | telomerehunter | `TELOMEREHUNTER_IMAGE` | `quay.io/biocontainers/telomerehunter` | `1.1.0--pyhdfd78af_0` | run with --plotNone: the plots of this build fail (its R lacks dplyr) | +| Specialized analysis | telomerehunter2 | `TELOMEREHUNTER_IMAGE` | `quay.io/biocontainers/telomerehunter2` | `1.0.12--pyhdfd78af_0` | step 10: TelomereHunter2, same tel_content as TelomereHunter 1.1.0 on the planted test BAM; needs more than 1,024 open files | | Specialized analysis | haplogrep3 | `HAPLOGREP3_IMAGE` | `quay.io/biocontainers/haplogrep3` | `3.2.2--hdfd78af_1` | | | Specialized analysis | haplocheck | `HAPLOCHECK_IMAGE` | `quay.io/biocontainers/haplocheck` | `1.3.3--h2a3209d_2` | step 12: mtDNA contamination; legacy: no automated bumps (last release 2022) | | Specialized analysis | eklipse | `EKLIPSE_IMAGE` | `quay.io/biocontainers/eklipse:1.8--hdfd78af_6` | `sha256:edd58aa92dcd62a39328d20b044fc024978afce31f70ba5cd174279f85146705` | step 20: large mtDNA deletions; upstream has no release: the Bioconda recipe builds commit 3606cb2edac983d2623ddc667b49206c3d01373c (2022-02-03), AGPL-3.0, run as its own tool; legacy: no automated bumps (eKLIPse is no longer maintained) | diff --git a/docs/viewer.md b/docs/viewer.md index add80039b..5fa27e2fd 100644 --- a/docs/viewer.md +++ b/docs/viewer.md @@ -7,7 +7,9 @@ - the reference genome (`REF_FASTA`), - the sample's reads (the BAM, or the CRAM from step 34), - its small variants (the VCF from step 3), -- its structural variants (step 22's consensus, else Manta's VCF from step 4). +- its structural variants (Manta's diploid SVs from step 4, else step 22's consensus). + +Manta comes first: step 22's consensus keeps only the calls two callers agree on, and the reads are where you check a call that only one caller made. It opens at the locus you give. Every findings table of the HTML report (step 24) ends with a Viewer column: the ClinVar hits, the secondary-findings genes, the mitochondrial variants, the deep intronic sites, the cDNA scan, the AnnotSV class 4 and 5 SVs, slivar's pairs in trans, the mosaic alterations and Exomiser's ranked variants. With the viewer running, a click on a row's link opens the reads at that row. @@ -20,11 +22,11 @@ A variant call is a summary of the reads. Before you act on a finding, look at t ## Tool - **igv.js** 3.8.10 (`IGV_JS_VERSION` and `IGV_JS_SHA256` in `versions.env`, shared with the live site) draws the reads and variants in the browser. -- **`assets/viewer/serve.py`** (Python standard library) serves the page and the sample's files on `127.0.0.1`. +- **`og view serve`** (OwnGenome's Rust binary, through `bin/og`) serves the page and the sample's files on `127.0.0.1`. ## Docker Image -None. The viewer runs on the host's `python3`, so it needs no image and no port publishing. +None. The viewer runs on the host as `og`, so it needs no image and no port publishing. ## Command @@ -32,7 +34,7 @@ None. The viewer runs on the host's `python3`, so it needs no image and no port GENOME_DIR=/path/to/data ./scripts/owngenome-view.sh [locus] ``` -`locus` is `chr17`, `chr17:43045000` or `chr17:43044000-43046000`. Without one the viewer opens the first chromosome of the reference. Zoom in to a few kilobases or less to see the reads. The script prints the address to open: +`locus` is `chr17`, `chr17:43045000` or `chr17:43044000-43046000`. Without one the viewer opens the first chromosome of the reference. A locus on a contig the reference does not have, past the contig's end, or with its end before its start (`chr17:43046000-43044000`) stops the script with exit 2 and the reason. Zoom in to a few kilobases or less to see the reads. The script prints the address to open: ``` Viewer for your_name: http://127.0.0.1:8765/#chr17:43045000 @@ -46,21 +48,24 @@ Open it in a browser. To jump somewhere else, type a locus in igv.js's search bo | `OWNGENOME_VIEW_PORT` | `8765` | The port. The report's links use 8765, so keep it unless the port is taken. | | `READS` | `/aligned/_sorted.bam`, else `..._sorted.cram` | The reads; `none` leaves them out. `ALIGN_DIR` picks another folder, as in the steps. | | `VCF` | `/vcf/.vcf.gz` | The small-variant VCF (`VCF_DIR` as in the steps). | -| `SV_VCF` | `/sv_merged/_sv_consensus.vcf.gz`, else `/manta/results/variants/diploidSV.vcf.gz` | The structural-variant VCF. | +| `SV_VCF` | `/manta/results/variants/diploidSV.vcf.gz`, else `/sv_merged/_sv_consensus.vcf.gz` | The structural-variant VCF. | | `REF_FASTA` | as in every step | The reference. Its `.fai` must sit beside it. | +| `OG` | `bin/og` | The `og` binary to run. | The script leaves out a file it does not find, and says so. A BAM or CRAM needs its index (`.bai`, `.crai`) beside it. A VCF with a `.tbi` is read in pieces. One without a `.tbi` is read whole, which is fine for an SV VCF. -The command needs `python3` on the host, but no Docker. The first run downloads igv.js (version 3.8.10, the `IGV_JS_VERSION` line in `versions.env`) into `GENOME_DIR/tools/igv.js-3.8.10/` and checks its sha256. After that it needs no network. +The command needs `og` built for this machine (`scripts/setup.sh --og`; on macOS that is the native build `bin/og` picks), but no `python3` and no Docker. The first run downloads igv.js (version 3.8.10, the `IGV_JS_VERSION` line in `versions.env`) into `GENOME_DIR/tools/igv.js-3.8.10/` and checks its sha256. After that it needs no network. ## Privacy Nothing is uploaded: -- The server (`assets/viewer/serve.py`) listens on `127.0.0.1` only. Other machines on your network cannot reach it. +- The server (`og view serve`) listens on `127.0.0.1` only. Other machines on your network cannot reach it. +- It has no login and no token. Every account on this computer can reach `127.0.0.1`, so while the viewer runs, anyone logged in to the same machine can read the sample through it. On a shared machine, stop it when you are done. - It serves only the page, igv.js and the files listed above. It sends nothing else from `GENOME_DIR`. - Every response carries a Content-Security-Policy that lets the page talk to this server and nowhere else. igv.js has features that call outside services: the genome list and gene-name search on igv.org, and BLAT. The browser blocks those calls. The viewer turns off the genome list, which igv.js would otherwise fetch at start. - It refuses a request whose `Host` header is not `127.0.0.1` or `localhost`. That stops a web page from reaching the server through a domain name that points at your own machine. +- It refuses a request a proxy forwarded (one with a `Forwarded`, `X-Forwarded-For`, `X-Forwarded-Host`, `X-Forwarded-Proto` or `X-Real-IP` header) with 403. Without a password, a reverse proxy in front of the viewer would hand the sample to anyone who reaches the proxy. An ssh port forward adds no such header, so it keeps working. The only download is igv.js itself, once, from jsDelivr's copy of the npm release. It is checked against the pinned sha256 before use. @@ -76,11 +81,11 @@ ssh -N -L 8765:127.0.0.1:8765 user@remote-machine GENOME_DIR=/path/to/data ./scripts/owngenome-view.sh your_name chr17:43045000 ``` -Then open `http://127.0.0.1:8765/` on your computer. The report's links work the same way. The reads travel inside the ssh connection, and only the ranges igv.js asks for. Do not expose the port any other way: the server has no login, so anyone who can reach it can read the sample. +Then open `http://127.0.0.1:8765/` on your computer. The report's links work the same way. The reads travel inside the ssh connection, and only the ranges igv.js asks for. Do not expose the port any other way: the server has no login, so anyone who can reach it can read the sample. It refuses requests that come through a reverse proxy for that reason. ## From the live site -`scripts/owngenome-live.sh` starts the [live site](live-site.md) with the viewer: each run has it at `/runs//viewer/`, behind the site's password, and the report the site serves points its Viewer links there. `bin/owngenome_live_viewer.py` uses the same page and files as `owngenome-view.sh` picks by default (the run folder's BAM or CRAM, its VCF and its SV VCF, each with its index, and `REF_FASTA`). The `READS`, `VCF`, `SV_VCF`, `ALIGN_DIR` and `VCF_DIR` overrides do not apply there, and a track whose file or index is a symlink out of `GENOME_DIR` is left out. The first start downloads igv.js the same way. `OWNGENOME_LIVE_VIEWER=off` starts the site without it. +`scripts/owngenome-live.sh` starts the [live site](live-site.md) with the viewer: each run has it at `/runs//viewer/`, behind the site's password, and the report the site serves points its Viewer links there. `bin/owngenome_live_viewer.py` uses the same page and the files `owngenome-view.sh` picks by default (the run folder's BAM or CRAM, its VCF and its SV VCF, each with its index, and `REF_FASTA`). The `READS`, `VCF`, `SV_VCF`, `ALIGN_DIR` and `VCF_DIR` overrides do not apply there, and a track whose file or index is a symlink out of `GENOME_DIR` is left out. The first start downloads igv.js the same way. `OWNGENOME_LIVE_VIEWER=off` starts the site without it. On the genome map, zoom below 50 kb and press **R** or select **See the reads**. The **Reads** gauge opens a 2 kb view. A finding's map card also offers **See the reads**, centred on its position with 50 bases on each side. The panel otherwise starts at the nearest open finding in view, or at the view itself. Moving the map updates the viewer's locus. Alignments are visible up to 50 kb. @@ -102,14 +107,17 @@ The server starts at once. How fast a view loads depends on the disk and the rea ## Tested by -`tests/test_viewer.py`, in CI's unit tests, on a synthetic sample it writes itself (a random 3 kb reference, 30 reads, one variant, one deletion). It checks that: +`rust/crates/og-live/tests/port_viewer.rs`, in the Guard job `rust`, on a synthetic sample it writes itself (a random 3 kb reference, 30 reads, one variant, one deletion). It checks that: -- the page's config names the sample's files and the locus; +- the page's config names the sample's files and the locus, and a locus that is not on the reference, or ends before it starts, is refused; +- Manta's diploid SVs come before step 22's consensus; - the server listens on 127.0.0.1 and not on the machine's other address; -- it answers byte ranges of the BAM exactly, and refuses unknown paths and a foreign `Host`; -- in headless Chrome, igv.js starts on the config, the policy blocks nothing it needs, and it reads the BAM, its index, the reference and the VCF; -- every findings table of the report ends with a Viewer cell that links each row to its position, with the note under it; a control with the links taken out must fail that check for every table; -- igv.js is the release `versions.env` pins, with its sha256, and the script sets no pin of its own. +- it answers byte ranges of the BAM exactly, and refuses unknown paths, a foreign `Host` and a forwarded request; +- in headless Chrome, igv.js starts on the config, the policy blocks nothing it needs, and it reads the BAM, its index, the reference and the VCF. A control with an empty igv.js must not reach that state. + +`tests/test_owngenome_view.sh` checks the script with `og`: igv.js is the release `versions.env` pins, with its sha256, and the script sets no pin of its own; it prints the address, picks Manta's SV VCF, refuses a foreign `Host`, a forwarded request and a reversed locus, and never calls `python3`. + +`tests/test_viewer.py` checks that every findings table of the report ends with a Viewer cell that links each row to its position, with the note under it; a control with the links taken out must fail that check for every table. `tests/test_live_viewer.py` checks the live site's viewer on the same sample: the login, the policy, the byte ranges, the files it refuses, the report's links pointed at the site, the access log, a BAM symlinked out of `GENOME_DIR`, a site started without the viewer, and the page in headless Chrome. diff --git a/modules/local/bloodtype/main.nf b/modules/local/bloodtype/main.nf index c03d3ff6a..0c0316661 100644 --- a/modules/local/bloodtype/main.nf +++ b/modules/local/bloodtype/main.nf @@ -15,8 +15,10 @@ wrote further right in a repeat meets its marker; then og bloodtype report on that file and the depth, reading the marker sites through its index; without a BAM - ([] in its place) RhD is not determined and sites with - no VCF record are read as reference (confidence medium) + ([] in its place) RhD is not determined, sites with + no VCF record are read as reference (confidence medium), + and a system with no record at any of its sites is not + assessed Equivalent to: scripts/41-bloodtype.sh ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/modules/local/mito_variants/main.nf b/modules/local/mito_variants/main.nf index ffc8b84e6..46dcd2fcc 100644 --- a/modules/local/mito_variants/main.nf +++ b/modules/local/mito_variants/main.nf @@ -14,7 +14,8 @@ the median autosomal depth, read from MOSDEPTH's summary and global distribution with the awk of scripts/20-mtoolbox.sh. Without mosdepth in --tools the depth is 0 and the filter marks nothing, as - step 20 does without step 16b's output. + step 20 does without step 16b's output: the task warns, and + MITO_VARIANTS_ANNOTATE writes the '# numt' line that says so. MITO_VARIANTS_ANNOTATE, after it, annotates each call with its ClinVar record and gnomAD v3.1's chrM sites (og mito annotate), as step 20's @@ -93,7 +94,7 @@ process MITO_VARIANTS { echo "Median autosomal coverage: \${AUTOSOMAL_COVERAGE} (from \${DEPTH_FILES})" else AUTOSOMAL_COVERAGE=0 - echo "mosdepth is not in --tools: NuMTFilterTool runs at depth 0 and marks nothing" + echo "WARNING: mosdepth is not in --tools: NuMTFilterTool runs at the default depth 0 and marks nothing" >&2 fi gatk NuMTFilterTool \\ -R ${reference} \\ @@ -133,7 +134,9 @@ process MITO_VARIANTS { it) and gnomAD v3.1's chrM sites (AF_hom, AF_het, max_hl, from --gnomad_mito, the file GNOMAD_MITO_URL in versions.env names), into _chrM_annotated.tsv. A file not given is named in the table's header - and its columns are '.', as step 20 does without it. + and its columns are '.', as step 20 does without it. Without mosdepth in + --tools MITO_VARIANTS had no autosomal depth for the NuMT filter, so the + table gets the '# numt' line (--numt-default), as step 20 writes it. Equivalent to: stage 6 of scripts/20-mtoolbox.sh */ @@ -159,8 +162,10 @@ process MITO_VARIANTS_ANNOTATE { script: def cv = clinvar ? "--clinvar ${clinvar}" : '' def gn = gnomad ? "--gnomad ${gnomad}" : '' + // MITO_VARIANTS gets mosdepth's output exactly when mosdepth is in --tools. + def numt = (params.tools ?: '').toString().split(',').collect { it.trim() }.contains('mosdepth') ? '' : '--numt-default' """ - og mito annotate --vcf ${vcf} ${cv} ${gn} --out ${meta.id}_chrM_annotated.tsv + og mito annotate --vcf ${vcf} ${cv} ${gn} ${numt} --out ${meta.id}_chrM_annotated.tsv printf '"%s":\\n python: %s\\n' "${task.process}" "${task.container.replaceFirst(/^[^:@]+[:@]/, '')}" > versions.yml """ diff --git a/modules/local/telomere_hunter/main.nf b/modules/local/telomere_hunter/main.nf index 9b51a7a4c..769bbb115 100644 --- a/modules/local/telomere_hunter/main.nf +++ b/modules/local/telomere_hunter/main.nf @@ -1,9 +1,10 @@ /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - TELOMERE_HUNTER — Telomere length estimation from WGS BAM + TELOMERE_HUNTER — relative telomere content from a WGS BAM (TelomereHunter2) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Estimates telomere length via GC-corrected telomeric reads per million. - Higher tel_content values = longer telomeres. Provides biological age baseline. + tel_content: intratelomeric reads per million reads with 48-52% GC. A + higher value means more telomeric sequence. It is a relative research + measure for comparing samples from one platform, not an age. WARNING: Reads the entire BAM (~30-40 GB). Takes 30-60 minutes. @@ -19,7 +20,7 @@ process TELOMERE_HUNTER { input: tuple val(meta), path(bam), path(bai) - path(cytoband) // UCSC GRCh38 chromosome bands (--cytoband) or [] + path(cytoband) // UCSC GRCh38 chromosome bands: --cytoband, or the copy in assets/reference output: tuple val(meta), path("${meta.id}"), emit: telomere_results @@ -29,23 +30,29 @@ process TELOMERE_HUNTER { task.ext.when == null || task.ext.when script: - // Without -b TelomereHunter classifies reads by its own hg19 bands; - // workflows/bam_analysis.nf warns when --cytoband is not set. - // --plotNone: the Bioconda build's plots fail (its R has no dplyr, and its - // PyPDF2 is written for Python 3); the summary does not need them. - def band_arg = cytoband ? "-b ${cytoband}" : '' + // The bands are always given: workflows/bam_analysis.nf passes the copy in + // assets/reference when --cytoband is not set. + // ulimit: TelomereHunter2 writes one BAM per contig and merges them at + // once; a BAM with decoy contigs needs more than the 1,024 open files a + // container gets by default. Raising the soft limit to the hard one needs + // no privilege, under Docker or Singularity. + // --plotNone: nothing in the pipeline reads its plots. + // It has no --version: its own version is the "TelomereHunter2 " line + // of --help. """ - telomerehunter \\ + ulimit -n "\$(ulimit -Hn)" 2>/dev/null || true + telomerehunter2 \\ -ibt ${bam} \\ -o ./ \\ -p ${meta.id} \\ + -c ${task.cpus} \\ --plotNone \\ - ${band_arg} + -b ${cytoband} cat <<-END_VERSIONS > versions.yml "${task.process}": telomerehunter: ${task.container.replaceFirst(/^[^:@]+[:@]/, '')} - telomerehunter_reported: \$( { telomerehunter --version 2>&1 || true; } | awk '!v && match(\$0, /[0-9]+\\.[0-9]+(\\.[0-9]+)*/) { v = substr(\$0, RSTART, RLENGTH) } END { print (v != "" ? v : "unknown") }') + telomerehunter_reported: \$( { telomerehunter2 --help 2>&1 || true; } | awk '\$1 == "TelomereHunter2" && \$2 ~ /^[0-9]/ { v = \$2; exit } END { print (v != "" ? v : "unknown") }') END_VERSIONS """ diff --git a/nextflow.config b/nextflow.config index dca4b1106..d6c7df852 100644 --- a/nextflow.config +++ b/nextflow.config @@ -68,7 +68,7 @@ params { cnvpytor_resources = null // dir with pinned CNVpytor gc_*/mask_* .pytor files (see docs/00-reference-setup.md) delly_exclude = null // Delly exclude map passed as `delly sr -x` (optional, e.g. human.hg38.excl.tsv) manta_call_regions = null // bgzipped BED (.tbi beside it) passed as configManta.py --callRegions (optional) - cytoband = null // UCSC GRCh38 chromosome bands passed as telomerehunter -b (optional, cytoBand.hg38.txt) + cytoband = null // UCSC GRCh38 chromosome bands passed as telomerehunter2 -b (null: the copy in assets/reference) annotsv_annotations = null // AnnotSV annotation dir (holds Annotations_Human/), built once with INSTALL_annotations.sh somalier_sites = null // somalier's GRCh38 sites VCF (sample_qc; setup.sh installs reference/somalier/sites.hg38.vcf.gz) verifybamid2_panel = null // folder of VerifyBamID2's .UD/.mu/.bed panel (sample_qc; setup.sh installs reference/verifybamid2/) @@ -235,6 +235,11 @@ profiles { test_all { includeConfig 'conf/test_all.config' } + // Every optional step: the tools and switches of assets/everything.tsv + // (EVERYTHING=true in scripts/run-all.sh). Pass the databases they need. + everything { + includeConfig 'conf/everything.config' + } } // Execution reports diff --git a/nextflow_schema.json b/nextflow_schema.json index c0bd21ac5..d80b8f1bd 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -499,7 +499,7 @@ "cytoband": { "type": "string", "format": "file-path", - "description": "Optional UCSC GRCh38 chromosome bands (cytoBand.hg38.txt, chr1-22, X and Y; scripts/setup.sh installs it), passed as `telomerehunter -b`. Without it TelomereHunter uses its own hg19 bands.", + "description": "UCSC GRCh38 chromosome bands (cytoBand.hg38.txt, chr1-22, X and Y), passed as `telomerehunter2 -b`. Without it the run passes the copy the repository ships, assets/reference/cytoBand.hg38.txt (the file scripts/setup.sh installs).", "fa_icon": "fas fa-file" }, "somalier_sites": { diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 6bfd68843..51429dcff 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -843,8 +843,10 @@ dependencies = [ name = "og-live" version = "0.1.0" dependencies = [ + "flate2", "indexmap", "jiff", + "og-browser", "og-nf", "og-runlog", "pycompat", diff --git a/rust/README.md b/rust/README.md index bf5a85f84..7f4ebf3fe 100644 --- a/rust/README.md +++ b/rust/README.md @@ -22,7 +22,7 @@ OwnGenome's own tools, ported from `bin/*.py` one at a time into one static bina | `crates/og-steps` | step helpers, among them `og pgx outside-calls`, `og pgx hla-concordance` (steps 08, 36), `og pgx pypgx-summary` (step 32) and `og paraphase check-bam`, `og paraphase table` (step 35b) | | `crates/og-fresh` | `og dev freshness`: the upstream lookups of the monthly freshness issue, each answer typed, HTTP through the host's `curl` | | `crates/og-recheck` | `og recheck`: which of a finished sample's results a newer ClinVar or catalog would change, `--rerun`, `--affected`, `--launch-dir` | -| `crates/og-render` | `og report render`, `og report index`, `og report charts`: the reports from summary.json (render: the frame, QC and variants so far, no caller yet; index and charts not ported yet) | +| `crates/og-render` | `og report render`, `og report index`, `og report charts`: the reports from summary.json (render: the frame, QC and variants so far, no caller yet; charts: ported, no caller yet; index not ported yet) | | `crates/og-live` | `og live serve`, `og live results`, `og live family`, `og live demo`, `og view serve`: the live site (not ported yet) | | `crates/og-couple` | `og couple screen`, `og couple genes`: step 39's couple screen and its carrier list | | `crates/og-admix` | what the fine-ancestry engines share: the panel's haplotypes, the genetic map, `model/ref.geno`, a seeded RNG and the admixed-genome simulator of `og ancestry-fine simulate`; our own painting and projection (not ported yet) | diff --git a/rust/crates/og-bam/src/cyp2d6.rs b/rust/crates/og-bam/src/cyp2d6.rs index cc33dd51d..63e5a6148 100644 --- a/rust/crates/og-bam/src/cyp2d6.rs +++ b/rust/crates/og-bam/src/cyp2d6.rs @@ -15,10 +15,13 @@ //! verdict, `ok` or `unreliable`; the shares never change it. Exit 0 //! whatever the verdict, 2 on unreadable input. //! -//! One deliberate change from the Python: a region listed twice in a +//! Two deliberate changes from the Python. A region listed twice in a //! mosdepth file counts once, and listed twice with two different depths it //! is refused (exit 2). The Python added every copy to the totals, so two -//! depths for one region were silently averaged. +//! depths for one region were silently averaged. And flanks under 10x at +//! MAPQ >= 1 make the verdict `unreliable` (`agreement not counted +//! (depth)`): the Python looked only at the MAPQ 0 share, so a shallow +//! region passed and two callers could agree on too few reads. use std::collections::hash_map::Entry; use std::collections::{HashMap, HashSet}; @@ -68,6 +71,9 @@ const UNRELIABLE: &str = "CYP2D6 copy number unreliable: reads are multi-mapped (was this BAM aligned to a reference with ALT contigs?)"; const NO_DEPTH: &str = "CYP2D6 copy number unreliable: no reads in the flanks of CYP2D6 \ (chr22:42.05-42.25 Mb), so its depth cannot be compared"; +const SHALLOW: &str = "CYP2D6 copy number unreliable, agreement not counted (depth): \ + the flanks of CYP2D6 (chr22:42.05-42.25 Mb) have under 10x at MAPQ >= 1, \ + too few reads for a copy-number call"; /// A depth fit for a copy-number call has at least this share of its reads /// at MAPQ >= 1, at CYP2D6 and in the flanks. @@ -75,6 +81,10 @@ const MIN_MAPQ1_SHARE: f64 = 0.6; /// Below this ratio of CYP2D6 to flank depth (all reads) the gene has too /// few reads for its MAPQ share to mean anything: both copies deleted. const MIN_GENE_RATIO: f64 = 0.15; +/// A depth fit for a copy-number call has at least this mean depth in the +/// flanks at MAPQ >= 1, the reads the callers use. Below it two callers can +/// agree on noise, so their agreement does not count. +pub const MIN_FLANK_DEPTH: f64 = 10.0; /// The verdict on the four mean depths. #[derive(Debug, Clone, Copy, PartialEq, Eq)] @@ -84,6 +94,8 @@ pub enum Verdict { MultiMapped, /// No reads in the flanks, so nothing to compare CYP2D6 with. NoFlankDepth, + /// Flanks under 10x at MAPQ >= 1: too few reads for a copy-number call. + ShallowFlanks, } impl Verdict { @@ -99,6 +111,7 @@ impl Verdict { Verdict::Ok => OK, Verdict::MultiMapped => UNRELIABLE, Verdict::NoFlankDepth => NO_DEPTH, + Verdict::ShallowFlanks => SHALLOW, } } } @@ -116,7 +129,8 @@ pub struct Depths { /// MAPQ 0: the aligner placed them on more than one sequence. A deletion /// leaves few reads at CYP2D6, but those map uniquely and the flanks are /// untouched, so it passes; below a gene/flank ratio of 0.15 the gene share -/// is not read at all. +/// is not read at all. Reads that map well are not enough: flanks under 10x +/// at MAPQ >= 1 are unreliable too (multi-mapped reads are named first). pub fn assess(all: Depths, q1: Depths) -> Verdict { if all.flank <= 0.0 { return Verdict::NoFlankDepth; @@ -132,6 +146,8 @@ pub fn assess(all: Depths, q1: Depths) -> Verdict { || (ratio_all >= MIN_GENE_RATIO && share_gene < MIN_MAPQ1_SHARE) { Verdict::MultiMapped + } else if q1.flank < MIN_FLANK_DEPTH { + Verdict::ShallowFlanks } else { Verdict::Ok } @@ -460,6 +476,11 @@ mod tests { assert_eq!(assess(d(6.0, 30.0), d(0.0, 29.0)), Verdict::MultiMapped); // No gene depth at all: the gene share is taken as 1. assert_eq!(assess(d(0.0, 30.0), d(0.0, 29.0)), Verdict::Ok); + // Flanks under 10x at MAPQ >= 1: shallow, whatever the share. + assert_eq!(assess(d(6.0, 6.0), d(6.0, 6.0)), Verdict::ShallowFlanks); + assert_eq!(assess(d(12.0, 12.0), d(12.0, 10.0)), Verdict::Ok); + // Multi-mapped reads are named before the depth. + assert_eq!(assess(d(6.0, 6.0), d(6.0, 2.0)), Verdict::MultiMapped); } #[test] diff --git a/rust/crates/og-bam/tests/i411_cyp2d6_gate.rs b/rust/crates/og-bam/tests/i411_cyp2d6_gate.rs new file mode 100644 index 000000000..b2b253d66 --- /dev/null +++ b/rust/crates/og-bam/tests/i411_cyp2d6_gate.rs @@ -0,0 +1,121 @@ +//! The CYP2D6 depth check needs real depth in the flanks (#411, pgx-09). +//! +//! `og pgx cyp2d6-check` looked only at the share of reads with MAPQ 0, so +//! flanks at 6x with every read mapped uniquely passed as "fit for a +//! copy-number call", and step 36 then counted pypgx and Cyrius agreeing on +//! those few reads as a confirmed CYP2D6 call. The flanks must now have +//! 10x or more at MAPQ >= 1, the reads the callers use, before the check +//! passes; under that the status is `unreliable` and the message, which step +//! 36 writes as its reason, says `agreement not counted (depth)`. +//! +//! These cases pin: +//! +//! 1. flanks at 6x, cleanly mapped: `unreliable`, `agreement not counted +//! (depth)`; +//! 2. flanks at 12x: `ok`, the agreement counts; +//! 3. the edge: 9.99x at MAPQ >= 1 fails, 10x passes, and the floor reads +//! the MAPQ >= 1 depth, not the depth of all reads; +//! 4. multi-mapped reads on shallow flanks keep the multi-mapped message, +//! which names the cause the user can fix. + +use std::fs; +use std::path::{Path, PathBuf}; + +use og_bam::cyp2d6::{MIN_FLANK_DEPTH, cli}; + +const OK: &str = "CYP2D6 depth is fit for a copy-number call"; +const NOT_COUNTED: &str = "agreement not counted (depth)"; +const MULTI: &str = "reads are multi-mapped"; + +struct Scratch(PathBuf); + +impl Scratch { + fn new(name: &str) -> Self { + let dir = Path::new(env!("CARGO_TARGET_TMPDIR")).join(format!("i411-cyp2d6-gate-{name}")); + let _ = fs::remove_dir_all(&dir); + fs::create_dir_all(&dir).unwrap(); + Scratch(dir) + } + + fn path(&self, name: &str) -> String { + self.0.join(name).display().to_string() + } +} + +impl Drop for Scratch { + fn drop(&mut self) { + let _ = fs::remove_dir_all(&self.0); + } +} + +/// A mosdepth regions file over the regions `cyp2d6-bed` prints. +fn regions(gene: f64, flank: f64) -> String { + format!( + "chr22\t42050000\t42100000\tflank\t{flank:.2}\n\ + chr22\t42123192\t42132032\tCYP2D6\t{gene:.2}\n\ + chr22\t42200000\t42250000\tflank\t{flank:.2}\n" + ) +} + +/// `(status, message)` of `og pgx cyp2d6-check` on the two depth tables, +/// each `(gene, flank)` mean depth, all reads first, then MAPQ >= 1. +fn check(name: &str, all: (f64, f64), q1: (f64, f64)) -> (String, String) { + let s = Scratch::new(name); + let (q0, q1p, out) = (s.path("q0.bed"), s.path("q1.bed"), s.path("check.tsv")); + fs::write(&q0, regions(all.0, all.1)).unwrap(); + fs::write(&q1p, regions(q1.0, q1.1)).unwrap(); + let argv: Vec = ["--all", &q0, "--mapq1", &q1p, "--out", &out] + .iter() + .map(|a| (*a).to_owned()) + .collect(); + let (mut o, mut e) = (Vec::new(), Vec::new()); + let code = cli("check", &argv, &mut o, &mut e); + assert_eq!(code, 0, "{name}: {}", String::from_utf8_lossy(&e)); + let text = fs::read_to_string(&out).unwrap(); + let get = |k: &str| { + text.lines() + .find_map(|l| l.strip_prefix(&format!("{k}\t"))) + .unwrap_or_else(|| panic!("{name}: no {k} row in {text}")) + .to_owned() + }; + (get("status"), get("message")) +} + +#[test] +fn flanks_at_6x_do_not_count_the_agreement() { + let (status, message) = check("6x", (4.0, 6.0), (3.8, 6.0)); + assert_eq!(status, "unreliable"); + assert!(message.contains(NOT_COUNTED), "{message}"); + assert!(message.contains("under 10x at MAPQ >= 1"), "{message}"); +} + +#[test] +fn flanks_at_12x_count() { + let (status, message) = check("12x", (7.5, 12.0), (7.0, 12.0)); + assert_eq!(status, "ok"); + assert_eq!(message, OK); +} + +#[test] +fn the_floor_is_10x_at_mapq1() { + assert!((MIN_FLANK_DEPTH - 10.0).abs() < f64::EPSILON); + let (status, message) = check("9.99x", (6.0, 9.99), (6.0, 9.99)); + assert_eq!(status, "unreliable", "9.99x: {message}"); + assert!(message.contains(NOT_COUNTED), "{message}"); + let (status, _) = check("10x", (6.0, 10.0), (6.0, 10.0)); + assert_eq!(status, "ok", "10x at MAPQ >= 1 counts"); + // 11x of all reads, 9x of them at MAPQ >= 1 (a share of 0.82, not + // multi-mapped): the callers see 9x, so the agreement does not count. + let (status, message) = check("mapq1", (7.0, 11.0), (6.5, 9.0)); + assert_eq!(status, "unreliable", "{message}"); + assert!(message.contains(NOT_COUNTED), "{message}"); +} + +#[test] +fn multi_mapped_reads_are_named_before_the_depth() { + // Half the flank reads at MAPQ 0, and 4x left at MAPQ >= 1. + let (status, message) = check("multi", (5.0, 8.0), (2.0, 4.0)); + assert_eq!(status, "unreliable"); + assert!(message.contains(MULTI), "{message}"); + assert!(!message.contains(NOT_COUNTED), "{message}"); +} diff --git a/rust/crates/og-bloodtype/src/genotypes.rs b/rust/crates/og-bloodtype/src/genotypes.rs index f2506464b..1a5c9ce65 100644 --- a/rust/crates/og-bloodtype/src/genotypes.rs +++ b/rust/crates/og-bloodtype/src/genotypes.rs @@ -26,7 +26,16 @@ //! calls of the same ALT count once, and incompatible dosages are no call; //! - a reference-only record whose REF is shorter than the marker's (an //! all-sites record or a gVCF block starting at a deletion marker) says -//! nothing past its own bases, so the site reads as if it had no record. +//! nothing past its own bases, so the site reads as if it had no record; +//! - a gVCF reference block (ALT `.`, `<*>` or ``) whose `INFO/END` +//! reaches the marker's last REF base is a reference call there, wherever +//! the block starts, with the block's quality. +//! +//! A call keeps its genotype whatever its quality, but one with a genotype +//! quality under [`MIN_GQ`] or a read depth under [`MIN_DEPTH`] (FORMAT `GQ`, +//! and `DP`, else a gVCF block's `MIN_DP`) is marked weak: the rules then give +//! the systems that use it confidence low. A phased call (`0|1`) keeps the +//! haplotype that carries the marker's ALT, and its phase set (`PS`). use crate::Error; use crate::markers::{Marker, Sites}; @@ -34,9 +43,13 @@ use indexmap::IndexMap; use std::collections::{BTreeMap, HashMap}; use std::path::Path; -/// Reads (MAPQ >= 20) before a site missing from the VCF counts as reference. +/// Reads (MAPQ >= 20) before a site missing from the VCF counts as reference, +/// and the read depth (FORMAT `DP`) under which a call is weak. pub const MIN_DEPTH: f64 = 8.0; +/// The genotype quality (FORMAT `GQ`) under which a call is weak. +pub const MIN_GQ: f64 = 20.0; + /// What is known at one site. #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum Status { @@ -68,6 +81,15 @@ impl Status { } } +/// The phase of a call: which of its two haplotypes carries the marker's +/// ALT (`0|1` is `[false, true]`), and its phase set (`PS`), `None` when the +/// record gives none (then the call is phased with the whole chromosome). +#[derive(Debug, Clone, PartialEq, Eq)] +pub struct Phase { + pub alt_on: [bool; 2], + pub block: Option, +} + /// What the VCF and the reads say at one site: status, alt copies (`None` /// when not known), read depth, note. #[derive(Debug, Clone, PartialEq)] @@ -77,6 +99,10 @@ pub struct Site { pub n: Option, pub depth: Option, pub note: String, + /// Why the call is weak (`GQ 5 under 20`), empty when it is not. + pub weak: String, + /// The phase of the call, when the VCF gives one. + pub phase: Option, } impl Site { @@ -87,6 +113,8 @@ impl Site { n: None, depth: None, note: String::new(), + weak: String::new(), + phase: None, } } } @@ -178,6 +206,9 @@ struct Reading { note: String, /// Called marker ALTs and their dosages, independent of VCF allele indices. alts: BTreeMap, + /// Why the call is weak, empty when it is not. + weak: String, + phase: Option, } impl Reading { @@ -188,7 +219,65 @@ impl Reading { n: None, note, alts: BTreeMap::new(), + weak: String::new(), + phase: None, + } + } +} + +/// The sample's FORMAT values a call's quality and phase come from. +#[derive(Debug, Clone, Default, PartialEq)] +struct Quality { + /// `GQ`, as written and as read. + gq: Option<(String, f64)>, + /// `DP`, else `MIN_DP`, as written and as read. + dp: Option<(String, f64)>, + /// The genotype is written with `|`. + phased: bool, + /// `PS`, when given and not `.`. + ps: Option, +} + +impl Quality { + /// The quality of the sample column `smp` under the keys `fmt`. + fn of(fmt: &[&str], smp: &[&str], gt: &str) -> Quality { + let get = |key: &str| { + fmt.iter() + .position(|k| *k == key) + .and_then(|i| smp.get(i)) + .copied() + .filter(|v| !v.is_empty() && *v != ".") + }; + let num = |key: &str| { + get(key).and_then(|v| { + pycompat::num::parse_float(v) + .ok() + .filter(|x| x.is_finite()) + .map(|x| (v.to_owned(), x)) + }) + }; + Quality { + gq: num("GQ"), + dp: num("DP").or_else(|| num("MIN_DP")), + phased: gt.contains('|') && !gt.contains('/'), + ps: get("PS").map(str::to_owned), + } + } + + /// Why a call with this quality is weak, empty when it is not. + fn weak(&self) -> String { + let mut why = Vec::new(); + if let Some((raw, gq)) = &self.gq + && *gq < MIN_GQ + { + why.push(format!("GQ {raw} under {}", MIN_GQ as i64)); + } + if let Some((raw, dp)) = &self.dp + && *dp < MIN_DEPTH + { + why.push(format!("DP {raw} under {}", MIN_DEPTH as i64)); } + why.join(", ") } } @@ -205,10 +294,15 @@ struct Evidence { alts: BTreeMap, /// Different calls of one ALT disagree about its dosage. incompatible: bool, + /// Why the first weak call of a marker ALT is weak. + alt_weak: Option, } impl Evidence { fn add(&mut self, r: Reading) { + if !r.alts.is_empty() && !r.weak.is_empty() && self.alt_weak.is_none() { + self.alt_weak = Some(r.weak.clone()); + } for (alt, &copies) in &r.alts { match self.alts.get(alt) { Some(&previous) if previous != copies => self.incompatible = true, @@ -255,6 +349,19 @@ impl Evidence { } else { b.n }; + // The copies of an ALT may come from several records: the call + // is weak when any of them is, and its phase is the record's only + // when one ALT was called. + site.weak = if b.weight == Weight::Alt && b.weak.is_empty() { + self.alt_weak.clone().unwrap_or_default() + } else { + b.weak.clone() + }; + site.phase = if b.weight == Weight::Alt && self.alts.len() == 1 { + b.phase.clone() + } else { + None + }; site.note = if b.status == Status::Called { let others = self.others.into_iter().filter(|o| *o != b.note); std::iter::once(b.note.clone()) @@ -269,9 +376,47 @@ impl Evidence { } } +/// Whether every ALT of a record is a reference-only symbol: a gVCF +/// reference block (`.`, `<*>`, ``). +fn is_block(alts: &str) -> bool { + alts.split(',') + .all(|a| matches!(a, "." | "<*>" | "")) +} + +/// `INFO/END` as htslib reads it (`og_io::tabix`): the key at the start or +/// after a `;`, its leading digits. +fn info_end(info: &str) -> Option { + let at = if info.starts_with("END=") { + 4 + } else { + info.find(";END=")? + 5 + }; + let digits = info[at..].bytes().take_while(u8::is_ascii_digit).count(); + info[at..at + digits].parse().ok() +} + +/// What a reference block that covers a whole marker says about it: a +/// reference call, with the block's quality, unless its genotype is not +/// `0/0`. +fn read_block(alleles: &[&str], quality: &Quality) -> Reading { + if alleles.len() != 2 || !alleles.iter().all(|a| *a == "0") { + return Reading::no_call(Weight::Other, format!("genotype {}", alleles.join("/"))); + } + Reading { + weight: Weight::Reference, + status: Status::Called, + n: Some(0), + note: String::new(), + alts: BTreeMap::new(), + weak: quality.weak(), + phase: None, + } +} + /// Applies one record line (no line ending) to the sites it covers: those -/// at its position and those its REF spans. `only` keeps the sites at one -/// position (the index path reads each position's records on their own). +/// at its position, those its REF spans, and those a reference block covers +/// to its `INFO/END`. `only` keeps the sites at one position (the index +/// path reads each position's records on their own). fn apply_record( line: &str, by_pos: &ByPos, @@ -280,7 +425,7 @@ fn apply_record( only: Option, ) { let mut c = line.splitn(5, '\t'); - let (Some(chrom), Some(pos), Some(_), Some(rf), Some(_)) = + let (Some(chrom), Some(pos), Some(_), Some(rf), Some(rest)) = (c.next(), c.next(), c.next(), c.next(), c.next()) else { return; @@ -297,6 +442,15 @@ fn apply_record( return; }; let span = i64::try_from(rf.len().max(1)).unwrap_or(1); + // A reference block reaches its INFO/END (the index finds it there too). + let block_end = { + let mut r = rest.split('\t'); + match (r.next(), r.nth(2)) { + (Some(alt), Some(info)) if is_block(alt) => info_end(info).filter(|e| *e >= p), + _ => None, + } + }; + let span = block_end.map_or(span, |e| span.max(e - p + 1)); let mut hits = here .range(p..p.saturating_add(span)) .filter(|(at, _)| only.is_none_or(|o| o == **at)) @@ -318,10 +472,29 @@ fn apply_record( .copied() .unwrap_or("."); let alleles: Vec<&str> = gt.split(['/', '|']).collect(); + let quality = Quality::of(&fmt, &smp, gt); + // A block covers a marker when it reaches the marker's last REF base. + let covers = |i: usize, at: i64| { + block_end.is_some_and(|e| { + at + i64::try_from(sites[i].row.ref_.len().max(1)).unwrap_or(1) - 1 <= e + }) + }; for (&at, names) in hits { + if names.iter().any(|&i| covers(i, at)) { + for &i in names { + if covers(i, at) { + ev[i].add(read_block(&alleles, &quality)); + } else if at == p + && let Some(r) = read_record(&sites[i].row, rf, &alts, filt, &alleles, &quality) + { + ev[i].add(r); + } + } + continue; + } if at == p { for &i in names { - if let Some(r) = read_record(&sites[i].row, rf, &alts, filt, &alleles) { + if let Some(r) = read_record(&sites[i].row, rf, &alts, filt, &alleles, &quality) { ev[i].add(r); } } @@ -368,6 +541,7 @@ fn read_record( alts: &[&str], filt: &str, alleles: &[&str], + quality: &Quality, ) -> Option { // A null row may list several ALTs (null alleles at one position): any of them counts. let wants: Vec<&str> = if r.ref_ == rf { @@ -433,6 +607,10 @@ fn read_record( } else { String::new() }; + let phase = quality.phased.then(|| Phase { + alt_on: [0, 1].map(|h| idx.iter().any(|i| i == alleles[h])), + block: quality.ps.clone(), + }); Some(Reading { weight: if n > 0 { Weight::Alt @@ -443,6 +621,8 @@ fn read_record( n: Some(n), note, alts: called_alts, + weak: quality.weak(), + phase, }) } @@ -658,7 +838,7 @@ mod tests { fn records(s: &mut Site, recs: &[Rec]) { let mut e = Evidence::default(); for (rf, alts, filt, alleles) in recs { - if let Some(r) = read_record(&s.row, rf, alts, filt, alleles) { + if let Some(r) = read_record(&s.row, rf, alts, filt, alleles, &Quality::default()) { e.add(r); } } @@ -793,6 +973,89 @@ mod tests { assert!(!changes_base("CG", &["C"], &[".", "."], 1)); } + /// The site as one record with these FORMAT keys and values leaves it. + fn with_format(r: &str, alt: &str, alleles: &[&str], fmt: &[&str], smp: &[&str]) -> Site { + let mut s = site(r, alt); + let mut e = Evidence::default(); + let q = Quality::of(fmt, smp, smp[0]); + if let Some(rd) = read_record(&s.row, r, &[alt], "PASS", alleles, &q) { + e.add(rd); + } + e.settle(&mut s); + s + } + + #[test] + fn a_call_under_the_gq_or_dp_floor_is_weak_and_keeps_its_genotype() { + let gt = |g: &str| g.split(['/', '|']).map(str::to_owned).collect::>(); + for (fmt, smp, want) in [ + ( + &["GT", "GQ", "DP"][..], + &["0/1", "0", "1"][..], + "GQ 0 under 20, DP 1 under 8", + ), + (&["GT", "GQ", "DP"], &["0/1", "19", "30"], "GQ 19 under 20"), + (&["GT", "GQ", "DP"], &["0/1", "20", "8"], ""), + (&["GT", "GQ", "MIN_DP"], &["0/1", "50", "3"], "DP 3 under 8"), + (&["GT", "DP", "MIN_DP"], &["0/1", "30", "3"], ""), + (&["GT", "GQ", "DP"], &["0/1", ".", "."], ""), + (&["GT"], &["0/1"], ""), + ] { + let a = gt(smp[0]); + let alleles: Vec<&str> = a.iter().map(String::as_str).collect(); + let s = with_format("G", "A", &alleles, fmt, smp); + assert_eq!( + (s.status, s.n, s.weak.as_str()), + (Status::Called, Some(1), want), + "{smp:?}" + ); + } + // A weak reference call is weak too; a no call is not marked. + let s = with_format("G", "A", &["0", "0"], &["GT", "GQ"], &["0/0", "3"]); + assert_eq!((s.n, s.weak.as_str()), (Some(0), "GQ 3 under 20")); + let s = with_format("G", "A", &[".", "."], &["GT", "GQ"], &["./.", "3"]); + assert_eq!((s.status, s.weak.as_str()), (Status::NoCall, "")); + } + + #[test] + fn a_phased_call_keeps_the_haplotype_of_the_alt() { + let s = with_format("G", "A", &["0", "1"], &["GT", "PS"], &["0|1", "100"]); + assert_eq!( + s.phase, + Some(Phase { + alt_on: [false, true], + block: Some("100".to_owned()) + }) + ); + let s = with_format("G", "A", &["1", "0"], &["GT", "PS"], &["1|0", "."]); + assert_eq!( + s.phase, + Some(Phase { + alt_on: [true, false], + block: None + }) + ); + let s = with_format("G", "A", &["0", "1"], &["GT"], &["0/1"]); + assert_eq!(s.phase, None); + } + + #[test] + fn a_reference_block_reads_to_its_end() { + assert_eq!(info_end("END=120"), Some(120)); + assert_eq!(info_end("MIN_DP=3;END=99;X=1"), Some(99)); + assert_eq!(info_end("SVEND=99;CIEND=5"), None); + assert_eq!(info_end("END=."), None); + assert!(is_block("<*>") && is_block(".") && is_block("")); + assert!(!is_block("A,<*>") && !is_block("")); + let q = Quality::of(&["GT", "GQ", "MIN_DP"], &["0/0", "3", "20"], "0/0"); + let r = read_block(&["0", "0"], &q); + assert_eq!( + (r.status, r.n, r.weak.as_str()), + (Status::Called, Some(0), "GQ 3 under 20") + ); + assert_eq!(read_block(&[".", "."], &q).status, Status::NoCall); + } + #[test] fn depth_decides_a_site_with_no_record() { let mut g: Genotyped = IndexMap::new(); diff --git a/rust/crates/og-bloodtype/src/lib.rs b/rust/crates/og-bloodtype/src/lib.rs index dbc178a6b..c6ed4e744 100644 --- a/rust/crates/og-bloodtype/src/lib.rs +++ b/rust/crates/og-bloodtype/src/lib.rs @@ -24,7 +24,7 @@ //! the top. //! //! What changes on purpose: the VCF is read through its `.tbi` or `.csi` -//! (318 positions, not the whole file), the catalog is read and the RHD row +//! (271 positions, not the whole file), the catalog is read and the RHD row //! assessed once, a rule site missing from the table is an `ERROR:` line, //! not a traceback, and each output is written whole or not at all. diff --git a/rust/crates/og-bloodtype/src/rules.rs b/rust/crates/og-bloodtype/src/rules.rs index c1f8c654a..90cfc1836 100644 --- a/rust/crates/og-bloodtype/src/rules.rs +++ b/rust/crates/og-bloodtype/src/rules.rs @@ -1,11 +1,17 @@ //! The rules: from the sites to one row per blood group system. //! -//! Phase is not read: two variants of one system are placed on the -//! chromosomes the common alleles carry them on, and the note says so. +//! Phase is read for Duffy only: a GATA box phased with c.125G>A in one +//! phase set goes on the chromosome the VCF puts it on. Elsewhere two +//! variants of one system are placed on the chromosomes the common alleles +//! carry them on, and the note says so. //! Confidence: high (every site called or covered by reads), medium (a site //! read as reference with no depth to confirm it, or a null row of the //! system not determined), low (a site in a region where short reads are -//! unreliable, named in the note, or markers that disagree), not determined. +//! unreliable, named in the note, markers that disagree, a weak call (GQ +//! under 20 or DP under 8), or an ABO A allele, which is read from the +//! absence of the O and B variants), not determined. Without a BAM, a +//! system with no VCF record at any of its sites is not assessed: a VCF +//! that does not cover the gene would otherwise read as the reference. use crate::Error; use crate::genotypes::{Genotyped, Site, Status}; @@ -19,6 +25,10 @@ use std::sync::LazyLock; /// The exons an RHD-CE(3-7)-D hybrid takes from RHCE. pub const RHD_HYBRID_EXONS: [i64; 5] = [3, 4, 5, 6, 7]; pub const NOT_DETERMINED: &str = "not determined"; +pub const NOT_ASSESSED: &str = "not assessed"; + +/// The note of a system read from null rows, while the antigen reads present. +const NULL_LIMIT: &str = "a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen"; /// A two-allele site: its label and its phenotype template, where /// `{antigen}` is replaced by `+` or `-`. The antigen names are the marker @@ -297,6 +307,10 @@ impl Row { Row::new(system, NOT_DETERMINED, ".", NOT_DETERMINED, note) } + fn not_assessed(system: &str, note: impl Into) -> Row { + Row::new(system, NOT_ASSESSED, ".", NOT_ASSESSED, note) + } + fn add_note(&mut self, part: &str) { self.note = join_parts([self.note.as_str(), part]); } @@ -333,14 +347,14 @@ fn is_stray(s: &Site) -> bool { s.note.starts_with("another allele") } -/// Confidence from the sites a call used: low for a caveat or a stray -/// allele, medium for a site read as reference without depth, else high. -/// Another ALT at a null row's position is not that null allele and leaves -/// the antigens read, so it is only named in the note. +/// Confidence from the sites a call used: low for a caveat, a stray +/// allele or a weak call, medium for a site read as reference without +/// depth, else high. Another ALT at a null row's position is not that null +/// allele and leaves the antigens read, so it is only named in the note. fn level_of(used: &[&Site]) -> &'static str { let mut lv = "high"; for s in used { - if !s.row.caveat.is_empty() || (is_stray(s) && !s.row.is_null()) { + if !s.row.caveat.is_empty() || (is_stray(s) && !s.row.is_null()) || !s.weak.is_empty() { return "low"; } if s.status == Status::Assumed { @@ -359,6 +373,9 @@ fn notes_of(used: &[&Site], extra: Vec) -> String { if is_stray(s) { out.push(format!("{}: {}", s.row.hgvs, s.note)); } + if !s.weak.is_empty() { + out.push(format!("{}: weak call ({})", s.row.hgvs, s.weak)); + } } if used.iter().any(|s| s.status == Status::Assumed) { out.push( @@ -686,6 +703,9 @@ fn system_pairs(system: &str, names: &[&str], sites: &Genotyped) -> Row { } else { genos.join(" ") }; + if !nulls.is_empty() && nc.n < 2 { + extra.push(NULL_LIMIT.to_owned()); + } extra.extend(meaning(system, &lacks, &used)); let row = Row::new( system, @@ -716,13 +736,17 @@ fn system_null(ns: &NullSystem, sites: &Genotyped) -> Row { } else { Vec::new() }; + let mut extra = nc.extra.clone(); + if nc.n < 2 { + extra.push(NULL_LIMIT.to_owned()); + } let geno: Vec<&str> = rep(ns.ok, 2 - nc.n).chain(rep(ns.null, nc.n)).collect(); let row = Row::new( ns.system, if nc.n >= 2 { ns.minus } else { ns.plus }, geno.join("/"), conf, - notes_of(&used, nc.extra.clone()), + notes_of(&used, extra), ); with_lacks(row, &lacks, &used) } @@ -856,6 +880,10 @@ fn system_abo(sites: &Genotyped) -> Row { } if s1061.status == Status::Assumed { used.push(s1061); + } else if !s1061.weak.is_empty() { + // Named here, not through `used`, so the caveat is not + // repeated; any A allele already reads low. + extra.push(format!("{}: weak call ({})", s1061.row.hgvs, s1061.weak)); } let n_a2 = n1061.min(n_a); alleles.extend(rep("A1", n_a - n_a2).chain(rep("A2", n_a2))); @@ -869,6 +897,9 @@ fn system_abo(sites: &Genotyped) -> Row { .chain(rep("O.02", n_o2)), ); let s796 = site(sites, "ABO_796"); + if s796.n.is_some() { + used.push(s796); + } let mut low = false; if let Some(n796) = s796.n && n796 != n_b @@ -882,6 +913,19 @@ fn system_abo(sites: &Genotyped) -> Row { if pheno.is_empty() { pheno = "O".to_owned(); } + if n_a != 0 { + // A is what is left of a functional allele with neither c.802G>A + // nor c.803G>C: no variant shows it. + low = true; + extra.push( + "an A allele is read from a c.261 insertion with neither c.802G>A nor c.803G>C, so an O allele that keeps c.261 (a non-deletional O) or a weak A subgroup also reads A" + .to_owned(), + ); + } + extra.push( + "ABO alleles outside these five variants (weak A and B subgroups, cis-AB, O alleles other than O.01 and O.02) are not assessed" + .to_owned(), + ); let conf = if low { "low" } else { level_of(&used) }; if n_b != 0 && n_a != 0 { extra.push("A and B on different chromosomes assumed (no phase)".to_owned()); @@ -906,7 +950,19 @@ fn system_duffy(sites: &Genotyped) -> Row { return unknown("Duffy", &missing, ""); } let (nb, ng) = (s125.n.unwrap_or(0), sg.n.unwrap_or(0)); - let sil_b = ng.min(nb); + // One GATA box and one Fyb: the VCF's phase says which chromosome it + // is on, when both calls are phased in one phase set. + let phased_on_a = match (&s125.phase, &sg.phase) { + (Some(p), Some(q)) if nb == 1 && ng == 1 && p.block == q.block => { + Some(p.alt_on != q.alt_on) + } + _ => None, + }; + let sil_b = if phased_on_a == Some(true) { + 0 + } else { + ng.min(nb) + }; let sil_a = ng - sil_b; let (a_expr, b_expr) = ((2 - nb) - sil_a, nb - sil_b); let (mut used, mut extra) = (vec![s125, sg], Vec::new()); @@ -928,11 +984,16 @@ fn system_duffy(sites: &Genotyped) -> Row { .chain(rep("FY*X", weak)) .chain(rep("FY*B GATA", sil_b)) .collect(); - if ng != 0 { - extra.push( + match phased_on_a { + Some(on_a) => extra.push(format!( + "c.-67T>C (GATA box) stops Duffy expression on red cells only; the VCF's phase puts it on the {} chromosome", + if on_a { "Fya" } else { "Fyb" } + )), + None if ng != 0 => extra.push( "c.-67T>C (GATA box) stops Duffy expression on red cells only; with no phase it is placed on the Fyb chromosome first, where it usually lies (FY*02N.01)" .to_owned(), - ); + ), + None => {} } Row::new( "Duffy", @@ -1134,6 +1195,12 @@ fn system_rhd(sites: &Genotyped, rhd: &RhdDepth, row: &Locus) -> Result 0 { + extra.push( + "an RHD gene that is there reads D+: RHD null alleles other than RHD*08N.01, RHD-CE-D hybrids that keep exons 3 to 7, and DEL alleles are not assessed" + .to_owned(), + ); + } Ok(Row::new( "RhD", if call - n_psi > 0 { "D+" } else { "D-" }, @@ -1167,6 +1234,10 @@ fn bombay(rows: &mut [Row]) { "para-Bombay: a working FUT2 makes H in secretions, and red cells carry little or none", ); } + // No ABO alleles were read: there is nothing for the note to qualify. + if rows[abo].phenotype == NOT_ASSESSED || rows[abo].phenotype == NOT_DETERMINED { + return; + } rows[abo].add_note( "no FUT1 (H-): the red cells carry no H (or very little, para-Bombay), so these ABO alleles make little or no A or B on them and the cells usually group as O", ); @@ -1183,6 +1254,55 @@ fn missing_sites(sites: &Genotyped) -> Vec<&'static str> { out } +/// Every site a system's row reads (none for RhD, read from depth). +fn system_sites<'a>(system: &str, names: Option<&[&str]>, sites: &'a Genotyped) -> Vec<&'a Site> { + let named: &[&str] = match system { + "ABO" => &["ABO_261", "ABO_802", "ABO_803", "ABO_796", "ABO_1061"], + "Duffy" => &["FY_125", "FY_GATA", "FY_265"], + "HNA-1" => &[ + "FCGR3B_108", + "FCGR3B_114", + "FCGR3B_244", + "FCGR3B_316", + "FCGR3B_194", + "FCGR3B_233", + ], + "RhD" => return Vec::new(), + _ => names.unwrap_or_default(), + }; + let mut out: Vec<&Site> = named.iter().map(|n| site(sites, n)).collect(); + if names.is_some() || null_system(system).is_some() { + out.extend(null_rows(system, sites)); + } + out +} + +/// Without a BAM, a system none of whose sites has a VCF record is not +/// assessed: the VCF may not cover the gene at all (a file cut to some +/// chromosomes, a panel, a dropped contig), which reads the same as the +/// reference everywhere. +fn no_record(system: &str, names: Option<&[&str]>, sites: &Genotyped) -> Option { + let used = system_sites(system, names, sites); + if used.is_empty() || used.iter().any(|s| s.status != Status::Assumed) { + return None; + } + let mut chroms: Vec<&str> = Vec::new(); + for s in &used { + if !chroms.contains(&s.row.chrom.as_str()) { + chroms.push(&s.row.chrom); + } + } + Some(Row::not_assessed( + system, + format!( + "no VCF record at any of its {} site{} and no BAM: a VCF that does not cover {} would read as the reference", + used.len(), + if used.len() > 1 { "s" } else { "" }, + chroms.join(", ") + ), + )) +} + /// One row per system: the systems that lack a high-prevalence antigen /// first, each list in the base order of [`SYSTEMS`]. pub fn predict(sites: &Genotyped, rhd: &RhdDepth, rhd_row: &Locus) -> Result, Error> { @@ -1195,6 +1315,10 @@ pub fn predict(sites: &Genotyped, rhd: &RhdDepth, rhd_row: &Locus) -> Result system_abo(sites), ("RhD", _) => system_rhd(sites, rhd, rhd_row)?, @@ -1206,6 +1330,7 @@ pub fn predict(sites: &Genotyped, rhd: &RhdDepth, rhd_row: &Locus) -> ResultT, also written c.385A>T) and a deletion of the whole FUT2 gene are not assessed", @@ -1242,7 +1367,7 @@ pub fn evidence_rows( s.status.as_str().to_owned(), dot(s.n.map(|n| n.to_string())), dot(s.depth.map(|d| fixed(d, 1))), - s.note.clone(), + join_parts([s.note.as_str(), s.weak.as_str()]), ]); } let flank = rhd.flank().filter(|f| *f != 0.0); diff --git a/rust/crates/og-bloodtype/tests/port_tests_cn_traits.rs b/rust/crates/og-bloodtype/tests/port_tests_cn_traits.rs index cf0e4365f..6efbbf51f 100644 --- a/rust/crates/og-bloodtype/tests/port_tests_cn_traits.rs +++ b/rust/crates/og-bloodtype/tests/port_tests_cn_traits.rs @@ -12,8 +12,8 @@ //! 1. the table and the code agree (`og bloodtype check-markers`); a table //! missing a rule's site fails the check //! 2. nothing planted, reads everywhere: the reference alleles at -//! confidence high; without the BAM the same calls at medium, and RhD -//! not determined +//! confidence high; without the BAM a system with no VCF record at any +//! of its sites is not assessed, and RhD not determined //! 3. ABO: A1, A2, B, AB, O.02, and markers that do not add up //! 4. RhD from depth: two copies, one, none, the RHD pseudogene, a hybrid //! gene, low flank depth @@ -519,14 +519,9 @@ fn s02_nothing_planted() { c.eq("Kell high", r.cf("Kell").as_str(), "high"); let nobam = T(report(&[], NO_BAM)); c.eq( - "without the BAM, ABO is still O", - nobam.ph("ABO").as_str(), - "O", - ); - c.eq( - "without the BAM, confidence medium", - nobam.cf("ABO").as_str(), - "medium", + "without the BAM and with no ABO record, ABO is not assessed", + (nobam.ph("ABO"), nobam.cf("ABO")), + ("not assessed".into(), "not assessed".into()), ); c.eq( "without the BAM, RhD is not determined", @@ -585,9 +580,9 @@ fn s03_abo() { &d2, ); c.eq( - "A1B", + "A1B, low: no variant shows the A allele", (ab.ph("ABO"), ab.cf("ABO")), - ("A1B".into(), "high".into()), + ("A1B".into(), "low".into()), ); c.eq( "the A1 or A2 caveat is in the note", diff --git a/rust/crates/og-bloodtype/tests/report.rs b/rust/crates/og-bloodtype/tests/report.rs index 43de618cf..ce97841d9 100644 --- a/rust/crates/og-bloodtype/tests/report.rs +++ b/rust/crates/og-bloodtype/tests/report.rs @@ -317,7 +317,7 @@ fn the_abo_insertion_counts_after_a_reference_or_other_record() { &[line("chr9", 133257521, "T", ".", ".", "0/0"), ins("0/1")], Some(depth(&d, 2.0, &HashMap::new())), ); - assert_eq!(t["ABO"][..3], ["A1", "A1/O.01", "high"]); + assert_eq!(t["ABO"][..3], ["A1", "A1/O.01", "low"]); } #[test] @@ -361,7 +361,7 @@ fn a_shorter_reference_record_leaves_a_deletion_marker_to_the_reads() { ("absent".to_owned(), None, String::new()) ); let t = run(&d, &recs, Some(depth(&d, 2.0, &HashMap::new()))); - assert_eq!(t["ABO"][..3], ["A1", "A1/O.01", "high"], "{r}"); + assert_eq!(t["ABO"][..3], ["A1", "A1/O.01", "low"], "{r}"); // The deletion after it still counts, in either order. let del = line("chr9", 133255669, "CG", "C", "PASS", "0/1"); for recs in [[r.clone(), del.clone()], [del.clone(), r.clone()]] { @@ -540,3 +540,204 @@ fn incompatible_null_alt_dosages_are_no_call_in_both_readers() { } } } + +/// A one-sample VCF record at the marker `name` with these FORMAT keys and values. +fn recf(name: &str, fmt: &str, smp: &str) -> String { + let m = &read_markers(&markers()).unwrap()[name]; + format!( + "{}\t{}\t.\t{}\t{}\t50\tPASS\t.\t{fmt}\t{smp}\n", + m.chrom, m.pos, m.ref_, m.alt + ) +} + +#[test] +fn a_call_under_the_gq_and_dp_floor_lowers_confidence() { + let d = dir("weak"); + let reads = || Some(depth(&d, 2.0, &HashMap::new())); + // KEL c.578C>T 0/1 with GQ 0 and one read: K+k+ still, at confidence low. + let t = run(&d, &[recf("KEL_578", "GT:GQ:DP", "0/1:0:1")], reads()); + assert_eq!(t["Kell"][0], "K+k+ Kp(a-b+) Js(a-b+)"); + assert_eq!(t["Kell"][2], "low"); + assert!( + t["Kell"][3].contains("KEL c.578C>T: weak call (GQ 0 under 20, DP 1 under 8)"), + "{}", + t["Kell"][3] + ); + let ev = std::fs::read_to_string(d.join("e.tsv")).unwrap(); + let row = ev.lines().find(|l| l.contains("\tKEL_578\t")).unwrap(); + assert!(row.ends_with("GQ 0 under 20, DP 1 under 8"), "{row}"); + // The same call with GQ 20 and 8 reads, at the floors, stays high. + let t = run(&d, &[recf("KEL_578", "GT:GQ:DP", "0/1:20:8")], reads()); + assert_eq!( + t["Kell"][..3], + ["K+k+ Kp(a-b+) Js(a-b+)", "K/k Kpb/Kpb Jsb/Jsb", "high"] + ); + // A gVCF reference block with GQ 3 at a site: low too. + let t = run(&d, &[recf("JK_838", "GT:GQ:MIN_DP", "0/0:3:20")], reads()); + assert_eq!(t["Kidd"][..3], ["Jk(a+b-)", "Jka/Jka", "low"]); +} + +#[test] +fn a_vcf_with_no_chr9_record_reads_abo_not_assessed_without_a_bam() { + let d = dir("nochr9"); + // A VCF with records elsewhere, none on chr9, and no BAM: ABO is not + // assessed, not O; Kell, with its record, is read. + let t = run(&d, &[rec("KEL_578", "0/1")], None); + assert_eq!(t["ABO"][..3], ["not assessed", ".", "not assessed"]); + assert!(t["ABO"][3].contains("no VCF record at any of its 5 sites and no BAM")); + assert!(t["ABO"][3].contains("chr9")); + assert_eq!(t["Kell"][0], "K+k+ Kp(a-b+) Js(a-b+)"); + // One ABO record is enough to read the others as the reference. + let t = run(&d, &[rec("ABO_802", "0/0")], None); + assert_eq!(t["ABO"][..3], ["O", "O.01/O.01", "medium"]); + // A VCF with no record at all is no error: every system not assessed, + // and RhD not determined (it needs the BAM). + let t = run(&d, &[], None); + assert_eq!(t["ABO"][0], "not assessed"); + assert_eq!(t["Vel"][0], "not assessed"); + assert_eq!(t["RhD"][0], "not determined"); + // With reads the reads decide, as before. + let t = run(&d, &[], Some(depth(&d, 2.0, &HashMap::new()))); + assert_eq!(t["ABO"][..3], ["O", "O.01/O.01", "high"]); +} + +#[test] +fn a_phased_gata_box_goes_on_the_chromosome_the_vcf_gives() { + let d = dir("duffy-phase"); + let reads = || Some(depth(&d, 2.0, &HashMap::new())); + let duffy = |fy: &str, gata: &str| { + let t = run( + &d, + &[recf("FY_GATA", "GT:PS", gata), recf("FY_125", "GT:PS", fy)], + reads(), + ); + t["Duffy"].clone() + }; + // On the Fya chromosome: Fya silenced on red cells, Fyb expressed. + let r = duffy("0|1:7", "1|0:7"); + assert_eq!(r[..3], ["Fy(a-b+)", "FY*A GATA/FY*B", "high"]); + assert!( + r[3].contains("the VCF's phase puts it on the Fya chromosome"), + "{}", + r[3] + ); + // On the Fyb chromosome. + let r = duffy("0|1:7", "0|1:7"); + assert_eq!(r[..2], ["Fy(a+b-)", "FY*A/FY*B GATA"]); + assert!(r[3].contains("the VCF's phase puts it on the Fyb chromosome")); + // Two phase sets, or no phase: Fyb first, as before. + for (fy, gata) in [("0|1:7", "1|0:9"), ("0/1:.", "0/1:.")] { + let r = duffy(fy, gata); + assert_eq!(r[..2], ["Fy(a+b-)", "FY*A/FY*B GATA"], "{fy} {gata}"); + assert!(r[3].contains("with no phase it is placed on the Fyb chromosome first")); + } +} + +#[test] +fn an_abo_a_allele_reads_low_and_o_or_b_keeps_its_confidence() { + let d = dir("abo-a-low"); + let reads = || Some(depth(&d, 2.0, &HashMap::new())); + let t = run(&d, &[rec("ABO_261", "0/1")], reads()); + assert_eq!(t["ABO"][..3], ["A1", "A1/O.01", "low"]); + assert!(t["ABO"][3].contains("an A allele is read from a c.261 insertion")); + let t = run( + &d, + &[ + rec("ABO_261", "0/1"), + rec("ABO_803", "0/1"), + rec("ABO_796", "0/1"), + ], + reads(), + ); + assert_eq!(t["ABO"][..3], ["B", "B/O.01", "high"]); + assert!(t["ABO"][3].contains("ABO alleles outside these five variants")); + assert!(!t["ABO"][3].contains("an A allele is read")); +} + +#[test] +fn rows_state_what_dna_cannot_check() { + let d = dir("limits"); + let t = run(&d, &[], Some(depth(&d, 2.0, &HashMap::new()))); + assert!(t["RhD"][3].contains("RHD-CE-D hybrids that keep exons 3 to 7")); + for system in [ + "Vel", + "Langereis", + "Junior", + "H", + "Secretor", + "Kell", + "Kidd", + ] { + assert!( + t[system][3].contains("a null allele the table does not hold"), + "{system}: {}", + t[system][3] + ); + } + assert!(!t["Lutheran"][3].contains("null allele")); + // Both deleted: D-, and no D+ limit to state. + let t = run(&d, &[], Some(depth(&d, 0.0, &HashMap::new()))); + assert!(!t["RhD"][3].contains("RHD-CE-D hybrids")); +} + +#[test] +fn a_gvcf_block_that_reaches_a_marker_through_end_is_a_reference_call() { + let d = dir("block-end"); + let m = read_markers(&markers()).unwrap()["JK_838"].clone(); + let block = |gq: i64, end: i64| { + format!( + "{}\t{}\t.\tA\t<*>\t0\t.\tEND={end}\tGT:GQ:MIN_DP\t0/0:{gq}:20\n", + m.chrom, + m.pos - 10 + ) + }; + // A block from ten bases before the marker to past it, GQ 3: a weak + // reference call, the same through the index and a full pass. + let recs = [block(3, m.pos + 5)]; + assert_eq!( + site_both_ways(&d, &recs, "JK_838"), + ("called".to_owned(), Some(0), String::new()) + ); + // Without a BAM, Kidd is read from it (not "not assessed"), at low. + let t = run(&d, &recs, None); + assert_eq!(t["Kidd"][..3], ["Jk(a+b-)", "Jka/Jka", "low"]); + assert!( + t["Kidd"][3].contains("weak call (GQ 3 under 20)"), + "{}", + t["Kidd"][3] + ); + // GQ 50: the block's call, and the null rows read as reference: medium. + let t = run(&d, &[block(50, m.pos + 5)], None); + assert_eq!(t["Kidd"][..3], ["Jk(a+b-)", "Jka/Jka", "medium"]); + // A block that ends before the marker says nothing about it. + let recs = [block(50, m.pos - 1)]; + assert_eq!(site_both_ways(&d, &recs, "JK_838").0, "absent"); + assert_eq!(run(&d, &recs, None)["Kidd"][0], "not assessed"); +} + +#[test] +fn a_weak_abo_1061_call_is_named_and_h_minus_leaves_an_unread_abo_alone() { + let d = dir("abo-1061-bombay"); + let reads = || Some(depth(&d, 2.0, &HashMap::new())); + // A weak c.1061delC call under an A allele is named in the note, once. + let t = run( + &d, + &[ + rec("ABO_261", "0/1"), + recf("ABO_1061", "GT:GQ:DP", "0/0:3:30"), + ], + reads(), + ); + assert_eq!(t["ABO"][2], "low"); + assert!( + t["ABO"][3].contains("ABO c.1061delC: weak call (GQ 3 under 20)"), + "{}", + t["ABO"][3] + ); + // Two FUT1 null copies on chr19 and no chr9 record, no BAM: H-, and + // ABO, not assessed, gets no note about its alleles. + let t = run(&d, &[rec("FUT1_01N36", "1/1")], None); + assert!(t["H"][0].starts_with("H-"), "{}", t["H"][0]); + assert_eq!(t["ABO"][0], "not assessed"); + assert!(!t["ABO"][3].contains("no FUT1 (H-)"), "{}", t["ABO"][3]); +} diff --git a/rust/crates/og-dev/src/everything.rs b/rust/crates/og-dev/src/everything.rs index be8e755e5..8b8c61301 100644 --- a/rust/crates/og-dev/src/everything.rs +++ b/rust/crates/og-dev/src/everything.rs @@ -1,13 +1,675 @@ -//! `og dev everything-check`: `assets/everything.tsv` against every tool, -//! switch and installer. +//! `og dev everything-check [--repo DIR]`: `assets/everything.tsv` against +//! every tool, switch, installer and optional image. //! -//! Not ported yet: until its unit of the 1.0.0 plan lands, the verb says so -//! on stderr and exits 2, before reading any argument. +//! `EVERYTHING=true` (scripts/run-all.sh) and `-profile everything` +//! (conf/everything.config) run every optional step from that one list, so +//! an opt-in that has no row there would be missed with no word. The check +//! reads, as text: +//! +//! - the names of `known_tools` in `main.nf`; +//! - the parameters of `nextflow.config`'s `params` block that default to +//! `false`, and those whose comment says `opt-in`; +//! - the words of `SWITCHES=(...)` in `scripts/run-all.sh`; +//! - the flags of the first `case "${1:-}" in` of `scripts/setup.sh`; +//! - the images of `versions.env` whose comment starts with `optional`; +//! +//! and fails when one of them has no row, when a row names an item that is +//! gone, when `conf/everything.config` sets other tools or parameters than +//! the rows say, or when `conf/test_all.config`'s tools miss one of them (the +//! stub run of every process would then miss it too). +//! +//! Exit 0 when everything agrees, 1 when a check fails (one `FAIL` line per +//! problem, naming the item), 2 when a file cannot be read or an argument is +//! wrong. `--repo` defaults to the current folder. +use std::collections::{BTreeMap, BTreeSet}; +use std::fs; use std::io::Write; +use std::path::Path; + +const USAGE: &str = "usage: og dev everything-check [--repo DIR]\n"; +const LIST: &str = "assets/everything.tsv"; +const KINDS: [&str; 6] = ["tool", "switch", "setup", "input", "image", "excluded"]; + +/// One row of `assets/everything.tsv`. +struct Row { + kind: String, + name: String, + value: String, + nextflow: String, + line: usize, +} + +/// What the repository declares, read from its files. +#[derive(Default)] +struct Items { + tools: BTreeSet, + nf_params: BTreeSet, + switches: BTreeSet, + setup_flags: BTreeSet, + images: BTreeSet, +} + +fn read(repo: &Path, rel: &str) -> Result { + fs::read_to_string(repo.join(rel)).map_err(|e| format!("cannot read {rel}: {e}")) +} + +fn read_rows(text: &str) -> Result, String> { + let mut rows = Vec::new(); + let mut header = false; + for (i, line) in text.lines().enumerate() { + if line.starts_with('#') || line.trim().is_empty() { + continue; + } + let c: Vec<&str> = line.split('\t').collect(); + if !header { + if c != ["kind", "name", "value", "nextflow", "reason"] { + return Err(format!( + "{LIST} line {}: the header must be kind, name, value, nextflow, reason", + i + 1 + )); + } + header = true; + continue; + } + let [kind, name, value, nextflow, reason] = c.as_slice() else { + return Err(format!( + "{LIST} line {}: {} fields, want 5: kind, name, value, nextflow, reason", + i + 1, + c.len() + )); + }; + if [kind, name, value, nextflow, reason] + .iter() + .any(|f| f.trim().is_empty()) + { + return Err(format!("{LIST} line {}: an empty field", i + 1)); + } + rows.push(Row { + kind: (*kind).to_owned(), + name: (*name).to_owned(), + value: (*value).to_owned(), + nextflow: (*nextflow).to_owned(), + line: i + 1, + }); + } + if rows.is_empty() { + return Err(format!("{LIST}: no rows")); + } + Ok(rows) +} + +/// The quoted words of `def known_tools = [ ... ]` in `main.nf`. +fn known_tools(main_nf: &str) -> Result, String> { + let start = main_nf + .find("def known_tools = [") + .ok_or("main.nf: no `def known_tools = [`")?; + let rest = &main_nf[start + "def known_tools = [".len()..]; + let end = rest.find(']').ok_or("main.nf: known_tools has no `]`")?; + let names: BTreeSet = rest[..end] + .split('\'') + .skip(1) + .step_by(2) + .map(str::to_owned) + .collect(); + if names.len() < 10 { + return Err(format!( + "main.nf: known_tools read as {} names: that is the list read wrong", + names.len() + )); + } + Ok(names) +} + +/// A line split into its code and its `//` comment, outside quotes. +fn split_comment(line: &str) -> (&str, &str) { + let mut quote = None; + let bytes = line.as_bytes(); + for (i, &b) in bytes.iter().enumerate() { + match (quote, b) { + (None, b'\'' | b'"') => quote = Some(b), + (Some(q), _) if b == q => quote = None, + (None, b'/') if bytes.get(i + 1) == Some(&b'/') => { + return (&line[..i], &line[i + 2..]); + } + _ => {} + } + } + (line, "") +} + +/// `name = value` of one config line, with its comment. +fn assignment(line: &str) -> Option<(&str, &str, &str)> { + let (code, comment) = split_comment(line); + let (name, value) = code.split_once('=')?; + let name = name.trim(); + let ok = !name.is_empty() + && name + .chars() + .all(|c| c.is_ascii_lowercase() || c.is_ascii_digit() || c == '_'); + ok.then(|| (name, value.trim(), comment)) +} + +/// The lines of the first top-level `params {` block of a config. +fn params_block(config: &str) -> Option> { + let mut lines = config.lines(); + lines.find(|l| l.trim_end() == "params {")?; + Some(lines.take_while(|l| !l.starts_with('}')).collect()) +} + +/// The parameters of `nextflow.config` that default to `false` or whose +/// comment says `opt-in`. +fn optional_params(config: &str) -> Result, String> { + let block = params_block(config).ok_or("nextflow.config: no `params {` block")?; + let mut out = BTreeSet::new(); + let mut seen = 0; + for line in block { + if let Some((name, value, comment)) = assignment(line) { + seen += 1; + if value == "false" || comment.contains("opt-in") { + out.insert(name.to_owned()); + } + } + } + if seen < 20 { + return Err(format!( + "nextflow.config: the params block read as {seen} parameters: that is the block read wrong" + )); + } + Ok(out) +} + +/// The words of `SWITCHES=( ... )` in `run-all.sh`. +fn switches(run_all: &str) -> Result, String> { + let start = run_all + .find("SWITCHES=(") + .ok_or("scripts/run-all.sh: no `SWITCHES=(`")?; + let rest = &run_all[start + "SWITCHES=(".len()..]; + let end = rest + .find(')') + .ok_or("scripts/run-all.sh: SWITCHES has no `)`")?; + let words: BTreeSet = rest[..end].split_whitespace().map(str::to_owned).collect(); + if words.len() < 10 { + return Err(format!( + "scripts/run-all.sh: SWITCHES read as {} names: that is the list read wrong", + words.len() + )); + } + Ok(words) +} + +/// The flags of the first `case "${1:-}" in` of `setup.sh`: every `--flag` +/// of each pattern line, up to its `esac`. +fn setup_flags(setup: &str) -> Result, String> { + let mut lines = setup.lines(); + lines + .find(|l| l.trim() == r#"case "${1:-}" in"#) + .ok_or(r#"scripts/setup.sh: no `case "${1:-}" in`"#)?; + let mut out = BTreeSet::new(); + for line in lines.take_while(|l| l.trim() != "esac") { + let t = line.trim(); + let Some(pattern) = t.strip_suffix(')') else { + continue; + }; + if pattern.starts_with("--") { + out.extend(pattern.split('|').map(str::to_owned)); + } + } + if out.len() < 5 { + return Err(format!( + "scripts/setup.sh: its flags read as {}: that is the case read wrong", + out.len() + )); + } + Ok(out) +} + +/// The images of `versions.env` whose comment starts with `optional`. +fn optional_images(env: &str) -> BTreeSet { + env.lines() + .filter_map(|l| { + let (name, rest) = l.split_once('=')?; + let ok = name.ends_with("_IMAGE") + && name + .chars() + .all(|c| c.is_ascii_uppercase() || c.is_ascii_digit() || c == '_'); + let (_, comment) = rest.split_once(" # ")?; + (ok && comment.trim_start().starts_with("optional")).then(|| name.to_owned()) + }) + .collect() +} + +/// The comma-separated names of a config's `tools = '...'`. +fn config_tools(config: &str, rel: &str) -> Result, String> { + let block = params_block(config).ok_or(format!("{rel}: no `params {{` block"))?; + let value = block + .iter() + .find_map(|l| assignment(l).filter(|(n, _, _)| *n == "tools")) + .map(|(_, v, _)| v) + .ok_or(format!("{rel}: no `tools =` in its params block"))?; + Ok(value + .trim_matches(|c| c == '\'' || c == '"') + .split(',') + .map(str::trim) + .filter(|s| !s.is_empty()) + .map(str::to_owned) + .collect()) +} + +fn read_items(repo: &Path) -> Result { + let env = read(repo, "versions.env")?; + let images = optional_images(&env); + if images.len() < 5 { + return Err(format!( + "versions.env: {} optional images: that is the file read wrong", + images.len() + )); + } + Ok(Items { + tools: known_tools(&read(repo, "main.nf")?)?, + nf_params: optional_params(&read(repo, "nextflow.config")?)?, + switches: switches(&read(repo, "scripts/run-all.sh")?)?, + setup_flags: setup_flags(&read(repo, "scripts/setup.sh")?)?, + images, + }) +} + +/// Does the repository still declare the item a row names? +fn row_item_exists(row: &Row, items: &Items) -> bool { + let n = row.name.as_str(); + let param = n.strip_prefix("--"); + match row.kind.as_str() { + "tool" => items.tools.contains(n), + "switch" => items.switches.contains(n), + "setup" => items.setup_flags.contains(n), + "image" => items.images.contains(n), + _ if n.ends_with("_IMAGE") => items.images.contains(n), + _ if param.is_some() => { + items.setup_flags.contains(n) || param.is_some_and(|p| items.nf_params.contains(p)) + } + _ if n.chars().any(|c| c.is_ascii_uppercase()) => items.switches.contains(n), + "input" => true, + _ => items.tools.contains(n), + } +} + +/// Every problem, one line each; empty when the list agrees with the repo. +fn problems(repo: &Path) -> Result<(Vec, usize), String> { + let rows = read_rows(&read(repo, LIST)?)?; + let items = read_items(repo)?; + let mut bad = Vec::new(); + let mut by_name: BTreeMap<&str, &Row> = BTreeMap::new(); + for r in &rows { + if !KINDS.contains(&r.kind.as_str()) { + bad.push(format!( + "{LIST} line {}: kind '{}' is none of {}", + r.line, + r.kind, + KINDS.join(", ") + )); + } + if by_name.insert(&r.name, r).is_some() { + bad.push(format!("{LIST} line {}: '{}' has two rows", r.line, r.name)); + } + } + for r in &rows { + if KINDS.contains(&r.kind.as_str()) && !row_item_exists(r, &items) { + bad.push(format!( + "{LIST} line {}: {} row '{}' names nothing the repository declares (renamed or removed?)", + r.line, r.kind, r.name + )); + } + if matches!(r.kind.as_str(), "setup" | "image") { + for target in r.value.split(',') { + if !by_name.contains_key(target) { + bad.push(format!( + "{LIST} line {}: {} row '{}' serves '{target}', which has no row", + r.line, r.kind, r.name + )); + } + } + } + let nf_ok = if r.kind == "switch" { + r.nextflow == "-" + || r.nextflow + .strip_prefix("--") + .and_then(|s| s.split_once(' ')) + .is_some_and(|(p, v)| !p.is_empty() && !v.is_empty() && !v.contains(' ')) + } else { + r.nextflow == "-" + }; + if !nf_ok { + bad.push(format!( + "{LIST} line {}: nextflow '{}' of '{}': a switch row takes '--param value' or '-', any other row '-'", + r.line, r.nextflow, r.name + )); + } + } + // Every item the repository declares has a row. + let has = |name: &str| by_name.contains_key(name); + let nf_named: BTreeSet<&str> = rows + .iter() + .filter_map(|r| r.nextflow.strip_prefix("--")?.split(' ').next()) + .collect(); + for t in &items.tools { + if !has(t) { + bad.push(format!( + "main.nf: tool '{t}' of known_tools has no row in {LIST}" + )); + } + } + for p in &items.nf_params { + if !has(&format!("--{p}")) && !nf_named.contains(p.as_str()) { + bad.push(format!( + "nextflow.config: params.{p} (false by default or opt-in) has no row in {LIST}" + )); + } + } + for s in &items.switches { + if !has(s) { + bad.push(format!( + "scripts/run-all.sh: switch {s} of SWITCHES has no row in {LIST}" + )); + } + } + for f in &items.setup_flags { + if !has(f) { + bad.push(format!("scripts/setup.sh: flag {f} has no row in {LIST}")); + } + } + for i in &items.images { + if !has(i) { + bad.push(format!( + "versions.env: optional image {i} has no row in {LIST}" + )); + } + } + // conf/everything.config sets exactly the tool rows and the switch rows' + // Nextflow parameters. + let want_tools: BTreeSet = rows + .iter() + .filter(|r| r.kind == "tool") + .map(|r| r.name.clone()) + .collect(); + let ev_rel = "conf/everything.config"; + let ev = read(repo, ev_rel)?; + let ev_tools = config_tools(&ev, ev_rel)?; + for t in want_tools.difference(&ev_tools) { + bad.push(format!("{ev_rel}: tools lacks '{t}', a tool row of {LIST}")); + } + for t in ev_tools.difference(&want_tools) { + bad.push(format!( + "{ev_rel}: tools names '{t}', which is no tool row of {LIST}" + )); + } + let want_params: BTreeMap<&str, &str> = rows + .iter() + .filter(|r| r.kind == "switch") + .filter_map(|r| r.nextflow.strip_prefix("--")?.split_once(' ')) + .collect(); + let mut set: BTreeMap = BTreeMap::new(); + for line in params_block(&ev).unwrap_or_default() { + if let Some((name, value, _)) = assignment(line) + && name != "tools" + { + set.insert(name.to_owned(), value.trim_matches('\'').to_owned()); + } + } + for (p, v) in &want_params { + match set.get(*p) { + Some(got) if got == v => {} + Some(got) => bad.push(format!( + "{ev_rel}: {p} = {got}, but its switch row says {v}" + )), + None => bad.push(format!( + "{ev_rel}: does not set {p} = {v} of its switch row" + )), + } + } + for p in set.keys() { + if !want_params.contains_key(p.as_str()) { + bad.push(format!( + "{ev_rel}: sets {p}, which no switch row of {LIST} names" + )); + } + } + // The stub run of every process covers every tool of the everything profile. + let ta_rel = "conf/test_all.config"; + let ta_tools = config_tools(&read(repo, ta_rel)?, ta_rel)?; + for t in want_tools.difference(&ta_tools) { + bad.push(format!( + "{ta_rel}: tools lacks '{t}', so the stub run of every tool misses it" + )); + } + Ok((bad, rows.len())) +} + +/// `og dev everything-check ARGS`: 0 when the list covers every optional +/// item, 1 when it does not, 2 on a usage or read error. +pub fn cli(args: &[String], out: &mut dyn Write, err: &mut dyn Write) -> u8 { + let mut repo = std::path::PathBuf::from("."); + let mut it = args.iter(); + while let Some(a) = it.next() { + match (a.as_str(), it.clone().next()) { + ("--repo", Some(v)) => { + repo = v.into(); + it.next(); + } + ("-h" | "--help", _) => { + let _ = write!(out, "{USAGE}"); + return 0; + } + _ => { + let _ = write!(err, "{USAGE}"); + let _ = writeln!( + err, + "og dev everything-check: error: unexpected argument '{a}'" + ); + return 2; + } + } + } + match problems(&repo) { + Ok((bad, n)) if bad.is_empty() => { + let _ = writeln!( + out, + "ok {LIST}: {n} rows cover every tool, switch, setup flag and optional image; conf/everything.config and conf/test_all.config agree" + ); + 0 + } + Ok((bad, _)) => { + for b in &bad { + let _ = writeln!(out, "FAIL {b}"); + } + let _ = writeln!( + out, + "{} problem(s): give each new opt-in a row in {LIST} (kind tool, switch, setup, input, image or excluded with the reason)", + bad.len() + ); + 1 + } + Err(e) => { + let _ = writeln!(err, "og dev everything-check: {e}"); + 2 + } + } +} + +#[cfg(test)] +mod tests { + use super::*; + use std::path::PathBuf; + + const FILES: [&str; 8] = [ + LIST, + "main.nf", + "nextflow.config", + "scripts/run-all.sh", + "scripts/setup.sh", + "versions.env", + "conf/everything.config", + "conf/test_all.config", + ]; + + fn repo_root() -> PathBuf { + Path::new(env!("CARGO_MANIFEST_DIR")).join("../../..") + } + + /// A copy of the files the check reads, in a folder of its own. + fn copy(name: &str) -> PathBuf { + let d = + std::env::temp_dir().join(format!("og-dev-everything-{name}-{}", std::process::id())); + let _ = fs::remove_dir_all(&d); + for f in FILES { + let to = d.join(f); + fs::create_dir_all(to.parent().unwrap()).unwrap(); + fs::copy(repo_root().join(f), &to).unwrap(); + } + d + } + + fn edit(d: &Path, rel: &str, from: &str, to: &str) { + let p = d.join(rel); + let text = fs::read_to_string(&p).unwrap(); + assert!(text.contains(from), "{rel} has no {from:?}"); + fs::write(&p, text.replacen(from, to, 1)).unwrap(); + } + + fn run(d: &Path) -> (u8, String) { + let (mut out, mut err) = (Vec::new(), Vec::new()); + let args = ["--repo".to_owned(), d.display().to_string()]; + let code = cli(&args, &mut out, &mut err); + let mut text = String::from_utf8(out).unwrap(); + text.push_str(&String::from_utf8(err).unwrap()); + (code, text) + } + + fn assert_fails(d: &Path, want: &str) { + let (code, text) = run(d); + let _ = fs::remove_dir_all(d); + assert_eq!(code, 1, "{text}"); + assert!(text.contains(want), "no {want:?} in:\n{text}"); + } + + #[test] + fn the_repository_agrees() { + let d = copy("ok"); + let (code, text) = run(&d); + let _ = fs::remove_dir_all(&d); + assert_eq!(code, 0, "{text}"); + assert!(text.starts_with("ok "), "{text}"); + } + + #[test] + fn a_new_tool_in_known_tools_fails() { + let d = copy("tool"); + edit( + &d, + "main.nf", + "'locityper',\n", + "'locityper',\n 'newtool',\n", + ); + assert_fails(&d, "main.nf: tool 'newtool' of known_tools has no row"); + } + + #[test] + fn a_new_false_param_fails() { + let d = copy("param"); + edit( + &d, + "nextflow.config", + " kir = false", + " foo = false // a new switch\n kir = false", + ); + assert_fails( + &d, + "nextflow.config: params.foo (false by default or opt-in) has no row", + ); + } + + #[test] + fn a_new_opt_in_param_fails() { + let d = copy("optin"); + edit( + &d, + "nextflow.config", + " pedigree = null", + " bar = null // opt-in: a new input\n pedigree = null", + ); + assert_fails( + &d, + "nextflow.config: params.bar (false by default or opt-in) has no row", + ); + } + + #[test] + fn a_new_setup_flag_fails() { + let d = copy("setup"); + edit( + &d, + "scripts/setup.sh", + "|--archaic)", + "|--archaic|--new-data)", + ); + assert_fails(&d, "scripts/setup.sh: flag --new-data has no row"); + } + + #[test] + fn a_new_optional_image_fails() { + let d = copy("image"); + edit( + &d, + "versions.env", + "TIDDIT_IMAGE=", + "NEWTOOL_IMAGE=\"quay.io/biocontainers/newtool:1.0--0\" # optional: step 99\nTIDDIT_IMAGE=", + ); + assert_fails(&d, "versions.env: optional image NEWTOOL_IMAGE has no row"); + } + + #[test] + fn a_new_run_all_switch_fails() { + let d = copy("switch"); + edit( + &d, + "scripts/run-all.sh", + "SWITCHES=(", + "SWITCHES=(NEWSWITCH ", + ); + assert_fails( + &d, + "scripts/run-all.sh: switch NEWSWITCH of SWITCHES has no row", + ); + } + + #[test] + fn a_stale_row_fails() { + let d = copy("stale"); + edit(&d, "main.nf", " 'mocha',\n", ""); + assert_fails(&d, "tool row 'mocha' names nothing the repository declares"); + } + + #[test] + fn the_profile_and_the_stub_run_must_follow_the_rows() { + let d = copy("profile"); + edit(&d, "conf/everything.config", "hla_qc", "hla_qc_off"); + assert_fails(&d, "conf/everything.config: does not set hla_qc = true"); + let d = copy("profile-tool"); + edit(&d, "conf/everything.config", ",locityper", ""); + assert_fails(&d, "conf/everything.config: tools lacks 'locityper'"); + let d = copy("test-all"); + edit(&d, "conf/test_all.config", ",locityper", ""); + assert_fails(&d, "conf/test_all.config: tools lacks 'locityper'"); + } -/// `og dev everything-check ARGS`: not ported yet, so one line on stderr and exit 2. -pub fn cli(_args: &[String], _out: &mut dyn Write, err: &mut dyn Write) -> u8 { - let _ = writeln!(err, "og dev everything-check: not ported yet"); - 2 + #[test] + fn a_bad_argument_is_refused() { + let (mut out, mut err) = (Vec::new(), Vec::new()); + assert_eq!( + cli(&["--og-scaffold-probe".to_owned()], &mut out, &mut err), + 2 + ); + let (mut out, mut err) = (Vec::new(), Vec::new()); + let missing = ["--repo".to_owned(), "/nonexistent-og-repo".to_owned()]; + assert_eq!(cli(&missing, &mut out, &mut err), 2); + } } diff --git a/rust/crates/og-live/Cargo.toml b/rust/crates/og-live/Cargo.toml index e23bd6872..15cfd3749 100644 --- a/rust/crates/og-live/Cargo.toml +++ b/rust/crates/og-live/Cargo.toml @@ -12,12 +12,15 @@ fault-inject = ["og-runlog/fault-inject"] [dependencies] pycompat.workspace = true +indexmap.workspace = true og-nf.workspace = true og-runlog.workspace = true jiff.workspace = true [dev-dependencies] -indexmap.workspace = true +# tests/port_viewer.rs: the synthetic BAM and VCFs (BGZF), and the page in Chrome. +flate2.workspace = true +og-browser = { path = "../og-browser" } [lints] workspace = true diff --git a/rust/crates/og-live/src/viewer.rs b/rust/crates/og-live/src/viewer.rs index c3b9d3847..865e9caf7 100644 --- a/rust/crates/og-live/src/viewer.rs +++ b/rust/crates/og-live/src/viewer.rs @@ -1,13 +1,1001 @@ -//! `og view serve`: igv.js and one sample's reads and calls on 127.0.0.1, -//! which `assets/viewer/serve.py` serves today. +//! `og view serve`: the local genome viewer. It serves igv.js and one +//! sample's reads and calls on 127.0.0.1, and nothing else from the disk: //! -//! Not ported yet: until its unit of the 1.0.0 plan lands, the verb says so -//! on stderr and exits 2, before reading any argument. +//! ```text +//! / index.html of --assets (assets/viewer) +//! /viewer.js the page's script, from --assets +//! /igv.min.js the pinned igv.js release owngenome-view.sh checked by sha256 +//! /config.json the reference, the tracks and the start locus (build_config) +//! /data// the n-th file of the config, its name percent-encoded in +//! the URL: the reference FASTA and its .fai, the BAM or CRAM +//! and its index, the VCF and the SV VCF and their .tbi +//! ``` +//! +//! `scripts/owngenome-view.sh` finds the sample's files and runs it. The +//! server binds 127.0.0.1 only (there is no bind option), answers byte-range +//! requests (igv.js reads a BAM, CRAM, FASTA or indexed VCF in pieces), and +//! sends a Content-Security-Policy that keeps the page on this server, so +//! igv.js's own calls to outside services are blocked by the browser. +//! +//! It has no login and needs none on loopback, but every account on the +//! machine can reach 127.0.0.1. Two requests are refused with 403: a `Host` +//! header that is not 127.0.0.1, localhost or [::1] (a web page reaching it +//! through a DNS name pointed at 127.0.0.1), and a request a proxy forwarded +//! (a `Forwarded`, `X-Forwarded-*` or `X-Real-IP` header): a reverse proxy +//! would hand the sample to whoever reaches the proxy, and the viewer has no +//! password to stop them. An ssh port forward adds no such header, so the +//! documented way to reach a remote viewer keeps working. +//! +//! The live site's server reuses [`sample_files`], [`build_config`], +//! [`parse_range`] and the policies here for its per-run viewer. + +use indexmap::IndexMap; +use pycompat::json::{self, Dump, Value}; +use std::collections::HashMap; +use std::fs::{self, File}; +use std::io::{self, BufRead, BufReader, Read, Seek, SeekFrom, Write}; +use std::net::{Shutdown, TcpListener, TcpStream}; +use std::path::{Path, PathBuf}; +use std::sync::atomic::{AtomicBool, Ordering}; +use std::sync::{Arc, mpsc}; +use std::thread::{self, JoinHandle}; +use std::time::Duration; + +/// The only address the viewer listens on. +pub const BIND: &str = "127.0.0.1"; +/// The port when none is given; the report's Viewer links use it. +pub const DEFAULT_PORT: u16 = 8765; +/// The policy of every answer: the page talks to this server only. +pub const CSP: &str = "default-src 'none'; script-src 'self'; connect-src 'self'; img-src 'self' data: blob:; \ + style-src 'self' 'unsafe-inline'; font-src 'self' data:; worker-src 'self' blob:; \ + base-uri 'none'; form-action 'none'; frame-ancestors 'none'"; +/// The live site's viewer: the same policy, but a page of the same site may +/// frame it (the genome map's reads panel). +pub const LIVE_CSP: &str = "default-src 'none'; script-src 'self'; connect-src 'self'; img-src 'self' data: blob:; \ + style-src 'self' 'unsafe-inline'; font-src 'self' data:; worker-src 'self' blob:; \ + base-uri 'none'; form-action 'none'; frame-ancestors 'self'"; +/// The `Host` names a request may carry (its port aside). +const ALLOWED_HOSTS: [&str; 3] = ["127.0.0.1", "localhost", "[::1]"]; +/// Headers a proxy adds when it forwards a request (lower case). +pub const FORWARDED_HEADERS: [&str; 5] = [ + "forwarded", + "x-forwarded-for", + "x-forwarded-host", + "x-forwarded-proto", + "x-real-ip", +]; +/// Why a forwarded request is refused. +const FORWARDED_TEXT: &str = "the viewer has no password, so it does not answer a request a proxy \ + forwarded: reach it over an ssh port forward instead (docs/viewer.md)"; +/// The longest request head read, in bytes. +const MAX_HEAD: usize = 64 * 1024; +/// How much of a file one write sends. +const CHUNK: usize = 1 << 20; + +const USAGE: &str = "usage: og view serve --sample NAME --fasta FASTA --igv-js FILE --assets DIR\n\ + \x20 [--reads BAM|CRAM] [--vcf VCF] [--sv-vcf VCF] [--locus LOCUS] [--port N]\n"; + +/// The contig names and lengths of a `.fai`, in order. +pub fn read_fai(fai: &Path) -> Result, String> { + let text = + fs::read_to_string(fai).map_err(|e| format!("cannot read {}: {e}", fai.display()))?; + let mut out = Vec::new(); + for line in text.lines() { + let p: Vec<&str> = line.split('\t').collect(); + if p.len() >= 2 && !p[0].is_empty() { + let len = p[1].trim().parse::().map_err(|_| { + format!( + "{}: '{}' is not the length of {}", + fai.display(), + p[1], + p[0] + ) + })?; + out.push((p[0].to_owned(), len)); + } + } + if out.is_empty() { + return Err(format!("{} names no contig", fai.display())); + } + Ok(out) +} + +/// `chr`, `chr:pos` or `chr:start-end` split into its parts; `None` when +/// the text has another shape. A position is digits with optional commas, +/// starting with a digit. +fn split_locus(locus: &str) -> Option<(&str, Option<&str>, Option<&str>)> { + let name_end = locus + .find(|c: char| !(c.is_ascii_alphanumeric() || matches!(c, '.' | '_' | '-'))) + .unwrap_or(locus.len()); + let (name, rest) = locus.split_at(name_end); + if name.is_empty() { + return None; + } + let pos = |s: &str| { + s.starts_with(|c: char| c.is_ascii_digit()) + && s.chars().all(|c| c.is_ascii_digit() || c == ',') + }; + if rest.is_empty() { + return Some((name, None, None)); + } + let rest = rest.strip_prefix(':')?; + let (start, end) = match rest.split_once('-') { + Some((s, e)) => (s, Some(e)), + None => (rest, None), + }; + if !pos(start) || end.is_some_and(|e| !pos(e)) { + return None; + } + Some((name, Some(start), end)) +} + +/// A position as written (commas allowed); `None` past `u64`. +fn position(text: &str) -> Option { + text.replace(',', "").parse().ok() +} + +/// The locus as igv.js reads it (`chr`, `chr:pos` or `chr:start-end`), +/// checked against the reference: the contig exists, each position lies on +/// it, and the end does not come before the start. The first contig when +/// none is given. +pub fn check_locus(locus: Option<&str>, contigs: &[(String, u64)]) -> Result { + let Some(locus) = locus.filter(|l| !l.is_empty()) else { + return Ok(contigs[0].0.clone()); + }; + let Some((name, start, end)) = split_locus(locus) else { + return Err(format!( + "'{locus}' is not a locus: give chr1, chr1:12345 or chr1:12000-13000" + )); + }; + let Some(&(_, len)) = contigs.iter().find(|(n, _)| n == name) else { + return Err(format!("'{name}' is not a contig of the reference")); + }; + let mut at = Vec::new(); + for x in [start, end].into_iter().flatten() { + match position(x) { + Some(p) if (1..=len).contains(&p) => at.push(p), + _ => return Err(format!("{x} is outside {name} (1 to {len})")), + } + } + if let [s, e] = at[..] + && e < s + { + return Err(format!( + "'{locus}' ends before it starts: give the smaller position first, as in {name}:{e}-{s}" + )); + } + Ok(locus.to_owned()) +} + +/// The first of these files that exists. +fn index_of(names: &[PathBuf]) -> Option { + names.iter().find(|n| n.is_file()).cloned() +} + +/// `path` with `suffix` added to its name. +fn plus(path: &Path, suffix: &str) -> PathBuf { + let mut s = path.as_os_str().to_owned(); + s.push(suffix); + PathBuf::from(s) +} + +/// The reads, the small-variant VCF and the SV VCF of a sample folder, by +/// the names the steps write; `None` for one that is not there. +#[derive(Debug, Clone, PartialEq, Eq)] +pub struct SampleFiles { + pub reads: Option, + pub vcf: Option, + pub sv_vcf: Option, +} + +/// The files of `sample_dir`, as `scripts/owngenome-view.sh` picks them +/// with none of `READS`, `VCF`, `SV_VCF`, `ALIGN_DIR` or `VCF_DIR` set: the +/// BAM, else the CRAM, of `aligned/`; the VCF of `vcf/`; and Manta's +/// diploid SVs (step 4), else step 22's consensus. Manta comes first because +/// the consensus keeps only the calls two callers agree on, and the reads +/// are where a call one caller made gets checked. +pub fn sample_files(sample_dir: &Path, sample: &str) -> SampleFiles { + let first = |names: &[String]| { + names + .iter() + .map(|n| sample_dir.join(n)) + .find(|p| p.is_file()) + }; + SampleFiles { + reads: first(&[ + format!("aligned/{sample}_sorted.bam"), + format!("aligned/{sample}_sorted.cram"), + ]), + vcf: first(&[format!("vcf/{sample}.vcf.gz")]), + sv_vcf: first(&[ + "manta/results/variants/diploidSV.vcf.gz".to_owned(), + format!("sv_merged/{sample}_sv_consensus.vcf.gz"), + ]), + } +} + +/// `urllib.parse.quote` of a file name: every byte but letters, digits and +/// `_.-~/` as `%XX`. +pub fn quote(name: &str) -> String { + let mut out = String::new(); + for b in name.bytes() { + if b.is_ascii_alphanumeric() || matches!(b, b'_' | b'.' | b'-' | b'~' | b'/') { + out.push(b as char); + } else { + out.push_str(&format!("%{b:02X}")); + } + } + out +} + +/// `urllib.parse.unquote`: each `%XX` as its byte, read as UTF-8 with +/// replacement; a `%` without two hex digits stays as it is. +pub fn unquote(text: &str) -> String { + let b = text.as_bytes(); + let mut out = Vec::with_capacity(b.len()); + let mut i = 0; + while i < b.len() { + let hex = |c: u8| (c as char).to_digit(16); + if b[i] == b'%' + && i + 2 < b.len() + && let (Some(h), Some(l)) = (hex(b[i + 1]), hex(b[i + 2])) + { + out.push((h * 16 + l) as u8); + i += 3; + } else { + out.push(b[i]); + i += 1; + } + } + String::from_utf8_lossy(&out).into_owned() +} + +/// What the viewer shows: the igv.js options (`config.json`) and the files +/// the server may send, `data//` each. +#[derive(Debug, Clone)] +pub struct Config { + pub json: Value, + pub files: Vec, + pub locus: String, + pub sample: String, +} + +impl Config { + /// `config.json` as the page reads it. + pub fn to_json(&self) -> String { + let opts = Dump { + indent: Some(1), + ..Dump::default() + }; + json::dumps(&self.json, &opts).expect("the config holds no float") + } +} + +fn file_name(path: &Path) -> String { + path.file_name() + .map(|n| n.to_string_lossy().into_owned()) + .unwrap_or_default() +} + +fn obj(pairs: Vec<(&str, Value)>) -> Value { + Value::Object( + pairs + .into_iter() + .map(|(k, v)| (k.to_owned(), v)) + .collect::>(), + ) +} + +fn s(text: &str) -> Value { + Value::Str(text.to_owned()) +} + +/// The config for `sample`: the reference (`fasta`, with its `.fai` +/// beside it), the reads (with their index, required), the VCF and the SV +/// VCF (read in pieces with a `.tbi` or `.csi`, whole without), and the +/// start locus ([`check_locus`]). +pub fn build_config( + sample: &str, + fasta: &Path, + reads: Option<&Path>, + vcf: Option<&Path>, + sv_vcf: Option<&Path>, + locus: Option<&str>, +) -> Result { + let mut files: Vec = Vec::new(); + let mut url = |path: &Path| { + files.push(std::path::absolute(path).unwrap_or_else(|_| path.to_owned())); + Value::Str(format!( + "data/{}/{}", + files.len() - 1, + quote(&file_name(path)) + )) + }; + let fai = plus(fasta, ".fai"); + if !fasta.is_file() || !fai.is_file() { + return Err(format!( + "the reference needs its FASTA and .fai: {}", + fasta.display() + )); + } + let contigs = read_fai(&fai)?; + let locus = check_locus(locus, &contigs)?; + let reference = obj(vec![ + ("id", s("reference")), + ("name", s(&file_name(fasta))), + ("fastaURL", url(fasta)), + ("indexURL", url(&fai)), + ]); + let mut tracks = Vec::new(); + if let Some(reads) = reads { + let cram = reads.to_string_lossy().ends_with(".cram"); + let stem = reads.with_extension(""); + let idx = index_of(&if cram { + vec![plus(reads, ".crai"), plus(&stem, ".crai")] + } else { + vec![ + plus(reads, ".bai"), + plus(&stem, ".bai"), + plus(reads, ".csi"), + ] + }) + .ok_or_else(|| { + format!( + "no index beside {}: run samtools index on it", + reads.display() + ) + })?; + tracks.push(obj(vec![ + ("name", Value::Str(format!("{sample} reads"))), + ("type", s("alignment")), + ("format", s(if cram { "cram" } else { "bam" })), + ("url", url(reads)), + ("indexURL", url(&idx)), + ])); + } + for (path, name) in [(vcf, "small variants"), (sv_vcf, "structural variants")] { + let Some(path) = path else { continue }; + let mut t = vec![ + ("name", Value::Str(format!("{sample} {name}"))), + ("type", s("variant")), + ("format", s("vcf")), + ("url", url(path)), + ]; + match index_of(&[plus(path, ".tbi"), plus(path, ".csi")]) { + Some(idx) => t.push(("indexURL", url(&idx))), + None => t.push(("indexed", Value::Bool(false))), + } + tracks.push(obj(t)); + } + let json = obj(vec![ + ("sample", s(sample)), + ("locus", s(&locus)), + ("reference", reference), + ("tracks", Value::Array(tracks)), + ]); + Ok(Config { + json, + files, + locus, + sample: sample.to_owned(), + }) +} + +/// What a `Range` header asks of a file of `size` bytes. +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum Range { + /// No range, or one this server answers with the whole file. + Whole, + /// Bytes `start..=end`. + Part(u64, u64), + /// A range past the end: 416. + Bad, +} + +/// One `bytes=start-end`, `bytes=start-` or `bytes=-suffix` range. A list +/// of ranges, or anything else, is answered with the whole file. +pub fn parse_range(header: Option<&str>, size: u64) -> Range { + let Some(spec) = header.map(str::trim).and_then(|h| h.strip_prefix("bytes=")) else { + return Range::Whole; + }; + let Some((a, b)) = spec.split_once('-') else { + return Range::Whole; + }; + let digits = |t: &str| t.chars().all(|c| c.is_ascii_digit()); + if !digits(a) || !digits(b) || (a.is_empty() && b.is_empty()) { + return Range::Whole; + } + // Digits that overflow u64 ask for more than any file holds. + let num = |t: &str| t.parse::().unwrap_or(u64::MAX); + let (start, end) = if a.is_empty() { + (size.saturating_sub(num(b)), size.saturating_sub(1)) + } else { + let start = num(a); + ( + start, + if b.is_empty() { + size.saturating_sub(1) + } else { + num(b) + }, + ) + }; + if start >= size || end < start { + return Range::Bad; + } + Range::Part(start, end.min(size - 1)) +} + +/// Where a route's answer comes from. +enum Source { + Bytes(Vec), + File(PathBuf), +} + +/// One logged request: `"GET / HTTP/1.1" 200 -`, as Python's +/// http.server writes it. +pub type Logger = Box; + +struct Shared { + routes: HashMap, + log: Option, +} + +/// The routes of `cfg`: the page and its script from `assets`, igv.js, +/// the config and its files. +fn routes(cfg: &Config, assets: &Path, igv_js: &Path) -> HashMap { + let html = "text/html; charset=utf-8"; + let js = "text/javascript; charset=utf-8"; + let mut r = HashMap::new(); + r.insert( + "/".to_owned(), + (html, Source::File(assets.join("index.html"))), + ); + r.insert( + "/index.html".to_owned(), + (html, Source::File(assets.join("index.html"))), + ); + r.insert( + "/viewer.js".to_owned(), + (js, Source::File(assets.join("viewer.js"))), + ); + r.insert( + "/igv.min.js".to_owned(), + (js, Source::File(igv_js.to_owned())), + ); + r.insert( + "/config.json".to_owned(), + ( + "application/json", + Source::Bytes(cfg.to_json().into_bytes()), + ), + ); + for (i, f) in cfg.files.iter().enumerate() { + r.insert( + format!("/data/{i}/{}", file_name(f)), + ("application/octet-stream", Source::File(f.clone())), + ); + } + r +} + +/// A parsed request head. +struct Request { + line: String, + method: String, + target: String, + headers: Vec<(String, String)>, +} + +impl Request { + fn header(&self, name: &str) -> Option<&str> { + self.headers + .iter() + .find(|(k, _)| k == name) + .map(|(_, v)| v.as_str()) + } +} + +/// Reads the request line and headers; `None` for anything that is not an +/// HTTP request head within [`MAX_HEAD`] bytes. +fn read_head(stream: &TcpStream) -> Option { + let mut r = BufReader::new(stream.take(MAX_HEAD as u64)); + let mut line = String::new(); + r.read_line(&mut line).ok()?; + let line = line.trim_end_matches(['\r', '\n']).to_owned(); + let mut parts = line.split(' '); + let (method, target, version) = (parts.next()?, parts.next()?, parts.next()?); + if parts.next().is_some() || !version.starts_with("HTTP/") || method.is_empty() { + return None; + } + let mut headers = Vec::new(); + loop { + let mut h = String::new(); + if r.read_line(&mut h).ok()? == 0 { + return None; + } + let h = h.trim_end_matches(['\r', '\n']); + if h.is_empty() { + break; + } + let (k, v) = h.split_once(':')?; + headers.push((k.trim().to_ascii_lowercase(), v.trim().to_owned())); + } + Some(Request { + method: method.to_owned(), + target: target.to_owned(), + line, + headers, + }) +} + +/// The status line's reason. +fn reason(code: u16) -> &'static str { + match code { + 200 => "OK", + 206 => "Partial Content", + 400 => "Bad Request", + 403 => "Forbidden", + 404 => "Not Found", + 405 => "Method Not Allowed", + 416 => "Range Not Satisfiable", + _ => "", + } +} + +/// Writes the status line and headers: the viewer's policy and the +/// no-store, nosniff, no-referrer and same-origin headers on every answer. +fn head( + out: &mut dyn Write, + code: u16, + ctype: &str, + length: u64, + extra: &[(&str, String)], +) -> io::Result<()> { + let mut h = format!( + "HTTP/1.1 {code} {}\r\nServer: owngenome-view\r\nContent-Type: {ctype}\r\nContent-Length: {length}\r\n\ + Cache-Control: no-store\r\nContent-Security-Policy: {CSP}\r\nX-Content-Type-Options: nosniff\r\n\ + Referrer-Policy: no-referrer\r\nCross-Origin-Resource-Policy: same-origin\r\nConnection: close\r\n", + reason(code) + ); + for (k, v) in extra { + h.push_str(&format!("{k}: {v}\r\n")); + } + h.push_str("\r\n"); + out.write_all(h.as_bytes()) +} + +/// Sends `src`, or the one byte range `range` asks for (206, or 416 past +/// the end), [`CHUNK`] bytes at a time. Returns the status sent. +pub fn send_file( + out: &mut dyn Write, + is_head: bool, + ctype: &str, + src: &Path, + range: Option<&str>, +) -> io::Result { + let mut f = File::open(src)?; + let size = f.metadata()?.len(); + let rng = parse_range(range, size); + if rng == Range::Bad { + head( + out, + 416, + "text/plain; charset=utf-8", + 0, + &[("Content-Range", format!("bytes */{size}"))], + )?; + return Ok(416); + } + let (start, end) = match rng { + Range::Part(a, b) => (a, b), + _ => (0, size.saturating_sub(1)), + }; + let length = if size == 0 { 0 } else { end - start + 1 }; + let mut extra = vec![("Accept-Ranges", "bytes".to_owned())]; + if rng != Range::Whole { + extra.push(("Content-Range", format!("bytes {start}-{end}/{size}"))); + } + let code = if rng == Range::Whole { 200 } else { 206 }; + head(out, code, ctype, length, &extra)?; + if is_head || length == 0 { + return Ok(code); + } + f.seek(SeekFrom::Start(start))?; + let mut left = length; + let mut buf = vec![0u8; CHUNK.min(length as usize)]; + while left > 0 { + let want = buf.len().min(left as usize); + let n = f.read(&mut buf[..want])?; + if n == 0 { + break; + } + out.write_all(&buf[..n])?; + left -= n as u64; + } + Ok(code) +} + +/// A short text answer. +fn fail(out: &mut dyn Write, is_head: bool, code: u16, text: &str) -> io::Result { + let body = format!("{text}\n"); + let extra: Vec<(&str, String)> = if code == 405 { + vec![("Allow", "GET, HEAD".to_owned())] + } else { + Vec::new() + }; + head( + out, + code, + "text/plain; charset=utf-8", + body.len() as u64, + &extra, + )?; + if !is_head { + out.write_all(body.as_bytes())?; + } + Ok(code) +} + +/// The `Host` header without its port, as the allow-list compares it. +fn host_name(host: &str) -> &str { + match host.rfind(':') { + Some(i) if i + 1 < host.len() && host[i + 1..].bytes().all(|b| b.is_ascii_digit()) => { + &host[..i] + } + _ => host, + } +} + +/// Answers one request on `stream`. +fn answer(shared: &Shared, stream: &mut TcpStream) -> io::Result<()> { + let Some(req) = read_head(stream) else { + let _ = fail(stream, false, 400, "bad request"); + return Ok(()); + }; + let is_head = req.method == "HEAD"; + let code = if req.method != "GET" && !is_head { + fail(stream, false, 405, "only GET and HEAD") + } else if !ALLOWED_HOSTS.contains(&host_name(req.header("host").unwrap_or(""))) { + fail( + stream, + is_head, + 403, + "the Host header must be 127.0.0.1 or localhost", + ) + } else if FORWARDED_HEADERS.iter().any(|h| req.header(h).is_some()) { + fail(stream, is_head, 403, FORWARDED_TEXT) + } else { + // The config percent-encodes each file name (a space, '#' or '?' in + // it), so the browser asks for the encoded form; the routes hold + // the plain name. + let path = req.target.split(['?', '#']).next().unwrap_or(""); + match shared.routes.get(&unquote(path)) { + None => fail(stream, is_head, 404, "not found"), + Some((ctype, Source::Bytes(data))) => head(stream, 200, ctype, data.len() as u64, &[]) + .and_then(|()| { + if is_head { + Ok(()) + } else { + stream.write_all(data) + } + }) + .map(|()| 200), + Some((ctype, Source::File(src))) => { + match send_file(stream, is_head, ctype, src, req.header("range")) { + Err(e) if e.kind() == io::ErrorKind::NotFound => { + fail(stream, is_head, 404, "not found") + } + other => other, + } + } + } + }; + if let (Some(log), Ok(code)) = (&shared.log, &code) { + log(&format!("\"{}\" {code} -", req.line)); + } + code.map(|_| ()) +} + +fn handle(shared: &Shared, mut stream: TcpStream) { + let _ = stream.set_read_timeout(Some(Duration::from_secs(30))); + let _ = stream.set_write_timeout(Some(Duration::from_secs(60))); + // A client that goes away mid-answer (igv.js cancels ranges it no + // longer needs) is not an error of the server. + let _ = answer(shared, &mut stream); + let _ = stream.flush(); + let _ = stream.shutdown(Shutdown::Both); +} + +/// Accepts connections until `stop` is set, one thread each. +fn serve(listener: TcpListener, shared: Arc, stop: Arc) { + for conn in listener.incoming() { + if stop.load(Ordering::SeqCst) { + break; + } + let Ok(stream) = conn else { continue }; + let shared = Arc::clone(&shared); + thread::spawn(move || handle(&shared, stream)); + } +} + +/// The viewer running in a thread; dropping it stops it. +pub struct Server { + port: u16, + stop: Arc, + thread: Option>, +} + +impl Server { + /// Starts the viewer for `cfg` on 127.0.0.1:`port` (0 picks a free + /// port), with the page from `assets` and igv.js from `igv_js`; each + /// request goes to `log` when one is given. + pub fn start( + cfg: &Config, + assets: &Path, + igv_js: &Path, + port: u16, + log: Option, + ) -> io::Result { + let listener = TcpListener::bind((BIND, port))?; + let port = listener.local_addr()?.port(); + let shared = Arc::new(Shared { + routes: routes(cfg, assets, igv_js), + log, + }); + let stop = Arc::new(AtomicBool::new(false)); + let s = Arc::clone(&stop); + let thread = thread::spawn(move || serve(listener, shared, s)); + Ok(Server { + port, + stop, + thread: Some(thread), + }) + } + + /// The port it listens on. + pub fn port(&self) -> u16 { + self.port + } +} + +impl Drop for Server { + fn drop(&mut self) { + self.stop.store(true, Ordering::SeqCst); + // Wake the accept loop so it sees the flag. + let _ = TcpStream::connect((BIND, self.port)); + if let Some(t) = self.thread.take() { + let _ = t.join(); + } + } +} + +/// The options of `og view serve`. +#[derive(Debug, Default)] +struct Args { + sample: Option, + fasta: Option, + reads: Option, + vcf: Option, + sv_vcf: Option, + locus: Option, + igv_js: Option, + assets: Option, + port: Option, +} + +fn parse_args(args: &[String]) -> Result { + let mut a = Args::default(); + let mut it = args.iter(); + while let Some(arg) = it.next() { + let (flag, inline) = match arg.split_once('=') { + Some((f, v)) if f.starts_with("--") => (f, Some(v.to_owned())), + _ => (arg.as_str(), None), + }; + let mut value = || -> Result { + match &inline { + Some(v) => Ok(v.clone()), + None => it + .next() + .cloned() + .ok_or_else(|| format!("argument {flag}: expected one argument")), + } + }; + let path = |v: String| Some(PathBuf::from(v)); + match flag { + "--sample" => a.sample = Some(value()?), + "--fasta" => a.fasta = path(value()?), + "--reads" => a.reads = path(value()?), + "--vcf" => a.vcf = path(value()?), + "--sv-vcf" => a.sv_vcf = path(value()?), + "--locus" => a.locus = Some(value()?), + "--igv-js" => a.igv_js = path(value()?), + "--assets" => a.assets = path(value()?), + "--port" => a.port = Some(value()?), + _ => return Err(format!("unrecognized arguments: {arg}")), + } + } + Ok(a) +} + +/// `og view serve ARGS`: build the config, print the address and serve +/// until stopped. Exit 2 on a usage error or a config the reference +/// refuses, 1 when the port cannot be bound. +pub fn cli(args: &[String], out: &mut dyn Write, err: &mut dyn Write) -> u8 { + if args.iter().any(|a| a == "-h" || a == "--help") { + let _ = write!(out, "{USAGE}"); + return 0; + } + let usage = |err: &mut dyn Write, why: &str| { + let _ = writeln!(err, "{USAGE}og view serve: error: {why}"); + 2 + }; + let a = match parse_args(args) { + Ok(a) => a, + Err(why) => return usage(err, &why), + }; + let (Some(sample), Some(fasta), Some(igv_js), Some(assets)) = + (&a.sample, &a.fasta, &a.igv_js, &a.assets) + else { + return usage( + err, + "the following arguments are required: --sample, --fasta, --igv-js, --assets", + ); + }; + let port = match a.port.as_deref().map(str::parse::) { + None => DEFAULT_PORT, + Some(Ok(p)) => p, + Some(Err(_)) => { + return usage( + err, + &format!( + "argument --port: '{}' is not a port number", + a.port.as_deref().unwrap_or_default() + ), + ); + } + }; + let cfg = match build_config( + sample, + fasta, + a.reads.as_deref(), + a.vcf.as_deref(), + a.sv_vcf.as_deref(), + a.locus.as_deref(), + ) { + Ok(c) => c, + Err(e) => { + let _ = writeln!(err, "ERROR: {e}"); + return 2; + } + }; + for (what, p) in [ + ("igv.min.js", igv_js.clone()), + ("the viewer page", assets.join("index.html")), + ("the viewer script", assets.join("viewer.js")), + ] { + if !p.is_file() { + let _ = writeln!(err, "ERROR: {what} not found: {}", p.display()); + return 2; + } + } + let listener = match TcpListener::bind((BIND, port)) { + Ok(l) => l, + Err(e) => { + let _ = writeln!( + err, + "ERROR: cannot listen on {BIND}:{port}: {e}. Set OWNGENOME_VIEW_PORT to a free port." + ); + return 1; + } + }; + let bound = listener.local_addr().map_or(port, |a| a.port()); + let _ = writeln!( + out, + "Viewer for {}: http://{BIND}:{bound}/#{}", + cfg.sample, cfg.locus + ); + let _ = writeln!(out, "Press Ctrl-C to stop it."); + let _ = out.flush(); + // The request log goes through `err`, which the caller may hold locked + // (og's main holds stderr's lock while a verb runs). A handler thread + // that wrote to stderr itself would wait on that lock forever, before it + // closes its connection. So the handlers send their lines here, and + // this thread, the one that owns `err`, writes them. + let (tx, rx) = mpsc::channel::(); + let shared = Arc::new(Shared { + routes: routes(&cfg, assets, igv_js), + log: Some(Box::new(move |line: &str| { + let _ = tx.send(line.to_owned()); + })), + }); + let server = thread::spawn(move || serve(listener, shared, Arc::new(AtomicBool::new(false)))); + for line in rx { + let _ = writeln!(err, "{line}"); + let _ = err.flush(); + } + let _ = server.join(); + 0 +} + +#[cfg(test)] +mod tests { + use super::*; + + fn contigs() -> Vec<(String, u64)> { + vec![("chr1".into(), 3000), ("chr2".into(), 1000)] + } + + #[test] + fn a_locus_is_checked_against_the_reference() { + let c = contigs(); + assert_eq!(check_locus(None, &c).unwrap(), "chr1"); + assert_eq!(check_locus(Some(""), &c).unwrap(), "chr1"); + for ok in [ + "chr2", + "chr1:451", + "chr1:1,000-2,000", + "chr1:5-5", + "chr1:1-3000", + ] { + assert_eq!(check_locus(Some(ok), &c).unwrap(), ok); + } + for bad in [ + "chr9:100", + "chr1:99999", + "chr1;alert(1)", + "BRCA1 x", + "chr1:0", + "chr1:", + "chr1:-5", + "chr1:5-", + ":5", + "chr1:99999999999999999999999", + ] { + assert!(check_locus(Some(bad), &c).is_err(), "{bad} was accepted"); + } + } + + #[test] + fn a_reversed_locus_is_refused() { + let e = check_locus(Some("chr1:2,000-1000"), &contigs()).unwrap_err(); + assert!( + e.contains("ends before it starts") && e.contains("chr1:1000-2000"), + "{e}" + ); + } + + #[test] + fn ranges_as_http_reads_them() { + assert_eq!(parse_range(None, 100), Range::Whole); + assert_eq!(parse_range(Some("bytes=10-19"), 100), Range::Part(10, 19)); + assert_eq!(parse_range(Some(" bytes=90- "), 100), Range::Part(90, 99)); + assert_eq!(parse_range(Some("bytes=-28"), 100), Range::Part(72, 99)); + assert_eq!(parse_range(Some("bytes=-500"), 100), Range::Part(0, 99)); + assert_eq!(parse_range(Some("bytes=50-5000"), 100), Range::Part(50, 99)); + assert_eq!(parse_range(Some("bytes=100-"), 100), Range::Bad); + assert_eq!(parse_range(Some("bytes=20-10"), 100), Range::Bad); + assert_eq!(parse_range(Some("bytes=-"), 100), Range::Whole); + assert_eq!(parse_range(Some("bytes=1-2,5-6"), 100), Range::Whole); + assert_eq!(parse_range(Some("items=1-2"), 100), Range::Whole); + } -use std::io::Write; + #[test] + fn names_are_quoted_and_unquoted_as_urllib_does() { + assert_eq!(quote("my ref#1?.fasta"), "my%20ref%231%3F.fasta"); + assert_eq!(quote("año.bam"), "a%C3%B1o.bam"); + assert_eq!(unquote("my%20ref%231%3F.fasta"), "my ref#1?.fasta"); + assert_eq!(unquote("100%"), "100%"); + assert_eq!(unquote("%zz%4"), "%zz%4"); + assert_eq!(unquote("..%2F..%2Fx"), "../../x"); + } -/// `og view serve ARGS`: not ported yet, so one line on stderr and exit 2. -pub fn cli(_args: &[String], _out: &mut dyn Write, err: &mut dyn Write) -> u8 { - let _ = writeln!(err, "og view serve: not ported yet"); - 2 + #[test] + fn the_host_port_is_stripped_before_the_allow_list() { + assert_eq!(host_name("127.0.0.1:8765"), "127.0.0.1"); + assert_eq!(host_name("[::1]:8765"), "[::1]"); + assert_eq!(host_name("[::1]"), "[::1]"); + assert_eq!(host_name("localhost"), "localhost"); + assert_eq!(host_name("evil.example:80"), "evil.example"); + } } diff --git a/rust/crates/og-live/tests/port_viewer.rs b/rust/crates/og-live/tests/port_viewer.rs new file mode 100644 index 000000000..4d7a1de81 --- /dev/null +++ b/rust/crates/og-live/tests/port_viewer.rs @@ -0,0 +1,851 @@ +//! The local genome viewer (`og view serve`, `og_live::viewer`) on a +//! synthetic sample written here: a random 3 kb chr1 and 1 kb chr2 +//! reference with its .fai, 30 reads on chr1 as a coordinate-sorted BAM with +//! its .bai, a bgzipped small-variant VCF with its .tbi and an SV VCF without +//! an index, each written byte by byte (no samtools or htslib). +//! +//! Moved here from tests/test_viewer.py, check for check: the config, the +//! locus check, the byte ranges, the refused paths and Host headers, the +//! loopback-only bind, and the page in a headless Chrome. New: a reversed +//! locus and a request a proxy forwarded are refused. +//! +//! The browser check needs Chrome and the igv.js release versions.env pins +//! (downloaded once into the test's scratch and checked by sha256). Without +//! Chrome it says SKIP, and fails in CI. Its red control serves an empty +//! igv.min.js: the page must then report an error, not "ready". + +use flate2::Compression; +use flate2::Crc; +use flate2::write::DeflateEncoder; +use og_browser::{Browser, Scratch, Value, chrome_or_skip, repo_root}; +use og_live::viewer::{self, Config, Logger, Server}; +use pycompat::json; +use std::fs; +use std::io::{Read, Write}; +use std::net::{TcpStream, UdpSocket}; +use std::path::{Path, PathBuf}; +use std::process::Command; +use std::sync::{Arc, Mutex}; +use std::time::Duration; + +const BGZF_EOF: [u8; 28] = [ + 0x1f, 0x8b, 0x08, 0x04, 0, 0, 0, 0, 0, 0xff, 0x06, 0, 0x42, 0x43, 0x02, 0, 0x1b, 0, 0x03, 0, 0, + 0, 0, 0, 0, 0, 0, 0, +]; + +fn bgzf_block(data: &[u8]) -> Vec { + let mut e = DeflateEncoder::new(Vec::new(), Compression::new(6)); + e.write_all(data).unwrap(); + let body = e.finish().unwrap(); + let mut crc = Crc::new(); + crc.update(data); + let mut out = vec![0x1f, 0x8b, 0x08, 0x04, 0, 0, 0, 0, 0, 0xff]; + out.extend(6u16.to_le_bytes()); + out.extend(b"BC"); + out.extend(2u16.to_le_bytes()); + out.extend(u16::try_from(body.len() + 25).unwrap().to_le_bytes()); + out.extend(&body); + out.extend(crc.sum().to_le_bytes()); + out.extend(u32::try_from(data.len()).unwrap().to_le_bytes()); + out +} + +fn reg2bin(beg: i64, end: i64) -> u32 { + let end = end - 1; + for (shift, off) in [(14, 4681), (17, 585), (20, 73), (23, 9), (26, 1)] { + if beg >> shift == end >> shift { + return (off + (beg >> shift)) as u32; + } + } + 0 +} + +/// The per-reference part of a BAI or TBI: every record (ref, beg, end) +/// sits in one BGZF block that starts at `rec_voff`. +fn binning_index( + n_ref: usize, + recs: &[(usize, i64, i64)], + rec_voff: i64, + end_voff: i64, +) -> Vec { + let mut out = Vec::new(); + for r in 0..n_ref { + let mine: Vec<_> = recs.iter().filter(|x| x.0 == r).collect(); + if mine.is_empty() { + out.extend(0i32.to_le_bytes()); + out.extend(0i32.to_le_bytes()); + continue; + } + let mut bins: Vec = mine.iter().map(|&&(_, b, e)| reg2bin(b, e)).collect(); + bins.sort_unstable(); + bins.dedup(); + out.extend((bins.len() as i32).to_le_bytes()); + for b in bins { + out.extend(b.to_le_bytes()); + out.extend(1i32.to_le_bytes()); + out.extend(rec_voff.to_le_bytes()); + out.extend(end_voff.to_le_bytes()); + } + let last = mine.iter().map(|x| x.2).max().unwrap(); + let n_intv = ((last - 1) >> 14) + 1; + out.extend((n_intv as i32).to_le_bytes()); + for _ in 0..n_intv { + out.extend(rec_voff.to_le_bytes()); + } + } + out +} + +/// A BAM of `reads` (ref index, 0-based pos, sequence), sorted, 50M each, +/// with its .bai. +fn write_bam(path: &Path, contigs: &[(String, String)], reads: &[(usize, i64, String)]) { + let mut text = "@HD\tVN:1.6\tSO:coordinate\n".to_owned(); + for (n, s) in contigs { + text.push_str(&format!("@SQ\tSN:{n}\tLN:{}\n", s.len())); + } + text.push_str("@RG\tID:S\tSM:S\n"); + let mut head = b"BAM\x01".to_vec(); + head.extend((text.len() as i32).to_le_bytes()); + head.extend(text.as_bytes()); + head.extend((contigs.len() as i32).to_le_bytes()); + for (n, s) in contigs { + head.extend((n.len() as i32 + 1).to_le_bytes()); + head.extend(n.as_bytes()); + head.push(0); + head.extend((s.len() as i32).to_le_bytes()); + } + let code = |c: u8| "=ACMGRSVTWYHKDBN".bytes().position(|x| x == c).unwrap() as u8; + let (mut body, mut recs) = (Vec::new(), Vec::new()); + for (i, (r, pos, seq)) in reads.iter().enumerate() { + let name = format!("r{i}\0"); + let sb = seq.as_bytes(); + let packed: Vec = sb + .chunks(2) + .map(|c| (code(c[0]) << 4) | c.get(1).map_or(0, |&x| code(x))) + .collect(); + let len = sb.len() as i64; + let mut rec = Vec::new(); + rec.extend((*r as i32).to_le_bytes()); + rec.extend((*pos as i32).to_le_bytes()); + rec.push(name.len() as u8); + rec.push(60); + rec.extend((reg2bin(*pos, pos + len) as u16).to_le_bytes()); + rec.extend(1u16.to_le_bytes()); + rec.extend(0u16.to_le_bytes()); + rec.extend((len as i32).to_le_bytes()); + for v in [-1i32, -1, 0] { + rec.extend(v.to_le_bytes()); + } + rec.extend(name.as_bytes()); + rec.extend(((len as u32) << 4).to_le_bytes()); + rec.extend(&packed); + rec.extend(std::iter::repeat_n(30u8, sb.len())); + rec.extend(b"RGZS\0"); + body.extend((rec.len() as i32).to_le_bytes()); + body.extend(rec); + recs.push((*r, *pos, pos + len)); + } + let (b0, b1) = (bgzf_block(&head), bgzf_block(&body)); + let mut all = b0.clone(); + all.extend(&b1); + all.extend(BGZF_EOF); + fs::write(path, all).unwrap(); + let mut bai = b"BAI\x01".to_vec(); + bai.extend((contigs.len() as i32).to_le_bytes()); + bai.extend(binning_index( + contigs.len(), + &recs, + (b0.len() as i64) << 16, + ((b0.len() + b1.len()) as i64) << 16, + )); + fs::write(format!("{}.bai", path.display()), bai).unwrap(); +} + +/// A bgzipped VCF of `records` (chrom, 1-based pos, ref, alt, info), with +/// a .tbi when `index`. +fn write_vcf( + path: &Path, + contigs: &[(String, String)], + records: &[(&str, i64, String, String, &str)], + index: bool, +) { + let mut head = "##fileformat=VCFv4.2\n".to_owned(); + for (n, s) in contigs { + head.push_str(&format!("##contig=\n", s.len())); + } + head.push_str("##INFO=\n"); + head.push_str("##INFO=\n"); + head.push_str("##FORMAT=\n"); + head.push_str("#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO\tFORMAT\tS\n"); + let body: String = records + .iter() + .map(|(c, p, r, a, i)| format!("{c}\t{p}\t.\t{r}\t{a}\t50\tPASS\t{i}\tGT\t0/1\n")) + .collect(); + let (b0, b1) = (bgzf_block(head.as_bytes()), bgzf_block(body.as_bytes())); + let mut all = b0.clone(); + all.extend(&b1); + all.extend(BGZF_EOF); + fs::write(path, all).unwrap(); + if index { + let order: Vec<&str> = contigs.iter().map(|(n, _)| n.as_str()).collect(); + let mut names: Vec<&str> = records.iter().map(|r| r.0).collect(); + names.sort_by_key(|n| order.iter().position(|o| o == n)); + names.dedup(); + let nm: Vec = names.iter().flat_map(|n| n.bytes().chain([0])).collect(); + let recs: Vec<_> = records + .iter() + .map(|(c, p, r, _, _)| { + let i = names.iter().position(|n| n == c).unwrap(); + (i, p - 1, p - 1 + r.len() as i64) + }) + .collect(); + let mut tbi = b"TBI\x01".to_vec(); + for v in [ + names.len() as i32, + 2, + 1, + 2, + 0, + i32::from(b'#'), + 0, + nm.len() as i32, + ] { + tbi.extend(v.to_le_bytes()); + } + tbi.extend(&nm); + tbi.extend(binning_index( + names.len(), + &recs, + (b0.len() as i64) << 16, + ((b0.len() + b1.len()) as i64) << 16, + )); + let mut out = bgzf_block(&tbi); + out.extend(BGZF_EOF); + fs::write(format!("{}.tbi", path.display()), out).unwrap(); + } +} + +/// A random sequence, the same on every run. +fn sequence(seed: &mut u64, n: usize) -> String { + (0..n) + .map(|_| { + *seed = seed + .wrapping_mul(6364136223846793005) + .wrapping_add(1442695040888963407); + b"ACGT"[(*seed >> 62) as usize] as char + }) + .collect() +} + +/// The genome folder `gd`: reference/synthetic.fasta and sample S. The +/// FASTA path and the contigs. +fn make_sample(gd: &Path) -> (PathBuf, Vec<(String, String)>) { + let mut seed = 7; + let contigs = vec![ + ("chr1".to_owned(), sequence(&mut seed, 3000)), + ("chr2".to_owned(), sequence(&mut seed, 1000)), + ]; + fs::create_dir_all(gd.join("reference")).unwrap(); + let fa = gd.join("reference/synthetic.fasta"); + let (mut fasta, mut fai, mut off) = (String::new(), String::new(), 0); + for (n, s) in &contigs { + off += n.len() + 2; + fai.push_str(&format!("{n}\t{}\t{off}\t60\t61\n", s.len())); + let lines: Vec<&str> = s + .as_bytes() + .chunks(60) + .map(|c| std::str::from_utf8(c).unwrap()) + .collect(); + fasta.push_str(&format!(">{n}\n{}\n", lines.join("\n"))); + off += s.len() + lines.len(); + } + fs::write(&fa, fasta).unwrap(); + fs::write(gd.join("reference/synthetic.fasta.fai"), fai).unwrap(); + let s = gd.join("S"); + for d in ["aligned", "vcf", "sv_merged"] { + fs::create_dir_all(s.join(d)).unwrap(); + } + let seq = &contigs[0].1; + let reads: Vec<_> = (400..700) + .step_by(10) + .map(|p| (0, p as i64, seq[p..p + 50].to_owned())) + .collect(); + write_bam(&s.join("aligned/S_sorted.bam"), &contigs, &reads); + let r = &seq[450..451]; + let alt = "ACGT".replace(r, "")[..1].to_owned(); + write_vcf( + &s.join("vcf/S.vcf.gz"), + &contigs, + &[("chr1", 451, r.to_owned(), alt, ".")], + true, + ); + write_vcf( + &s.join("sv_merged/S_sv_consensus.vcf.gz"), + &contigs, + &[( + "chr1", + 1000, + seq[999..1000].to_owned(), + "".into(), + "SVTYPE=DEL;END=1500", + )], + false, + ); + (fa, contigs) +} + +fn sample_config(gd: &Path, fa: &Path, locus: Option<&str>) -> Config { + let s = gd.join("S"); + viewer::build_config( + "S", + fa, + Some(&s.join("aligned/S_sorted.bam")), + Some(&s.join("vcf/S.vcf.gz")), + Some(&s.join("sv_merged/S_sv_consensus.vcf.gz")), + locus, + ) + .unwrap() +} + +/// The answer to one request: status, headers (lower-case names) and body. +fn get( + port: u16, + method: &str, + path: &str, + headers: &[(&str, &str)], +) -> (u16, Vec<(String, String)>, Vec) { + let mut c = TcpStream::connect(("127.0.0.1", port)).unwrap(); + c.set_read_timeout(Some(Duration::from_secs(20))).unwrap(); + let mut req = format!("{method} {path} HTTP/1.1\r\n"); + if !headers.iter().any(|(k, _)| k.eq_ignore_ascii_case("host")) { + req.push_str(&format!("Host: 127.0.0.1:{port}\r\n")); + } + for (k, v) in headers { + req.push_str(&format!("{k}: {v}\r\n")); + } + req.push_str("\r\n"); + c.write_all(req.as_bytes()).unwrap(); + let mut raw = Vec::new(); + c.read_to_end(&mut raw).unwrap(); + let end = raw + .windows(4) + .position(|w| w == b"\r\n\r\n") + .expect("a response head"); + let head = String::from_utf8(raw[..end].to_vec()).unwrap(); + let mut lines = head.split("\r\n"); + let code = lines + .next() + .unwrap() + .split(' ') + .nth(1) + .unwrap() + .parse() + .unwrap(); + let hs = lines + .filter_map(|l| l.split_once(':')) + .map(|(k, v)| (k.trim().to_ascii_lowercase(), v.trim().to_owned())) + .collect(); + (code, hs, raw[end + 4..].to_vec()) +} + +fn header<'a>(h: &'a [(String, String)], name: &str) -> Option<&'a str> { + h.iter().find(|(k, _)| k == name).map(|(_, v)| v.as_str()) +} + +fn assets() -> PathBuf { + repo_root().join("assets/viewer") +} + +/// A stand-in igv.min.js for the HTTP checks, which never run it. +fn fake_igv(dir: &Path) -> PathBuf { + let p = dir.join("igv.min.js"); + fs::write(&p, "// igv stand-in\n").unwrap(); + p +} + +fn file_of(cfg: &Config, url: &str) -> PathBuf { + cfg.files[url.split('/').nth(1).unwrap().parse::().unwrap()].clone() +} + +fn str_at<'a>(v: &'a Value, path: &[&str]) -> Option<&'a str> { + let mut v = v; + for k in path { + v = match v { + Value::Object(m) => m.get(*k)?, + Value::Array(a) => a.get(k.parse::().ok()?)?, + _ => return None, + }; + } + match v { + Value::Str(s) => Some(s), + _ => None, + } +} + +fn tracks(v: &Value) -> Vec { + match v { + Value::Object(m) => match m.get("tracks") { + Some(Value::Array(a)) => a.clone(), + _ => Vec::new(), + }, + _ => Vec::new(), + } +} + +#[test] +fn the_config_names_the_samples_files_and_checks_the_locus() { + let scratch = Scratch::new(Path::new(env!("CARGO_TARGET_TMPDIR")), "viewer-config"); + let gd = scratch.path().join("genome"); + let (fa, _) = make_sample(&gd); + let cfg = sample_config(&gd, &fa, Some("chr1:451")); + assert_eq!(viewer::BIND, "127.0.0.1"); + assert_eq!(cfg.locus, "chr1:451"); + assert!( + cfg.files[0].ends_with("reference/synthetic.fasta") + && cfg.files[1].ends_with("synthetic.fasta.fai") + ); + assert_eq!( + str_at(&cfg.json, &["reference", "fastaURL"]), + Some("data/0/synthetic.fasta") + ); + let t = tracks(&cfg.json); + let kinds: Vec<(String, String, String)> = t + .iter() + .map(|x| { + ( + str_at(x, &["type"]).unwrap().to_owned(), + str_at(x, &["format"]).unwrap().to_owned(), + file_of(&cfg, str_at(x, &["url"]).unwrap()) + .file_name() + .unwrap() + .to_string_lossy() + .into_owned(), + ) + }) + .collect(); + assert_eq!( + kinds, + [ + ("alignment".into(), "bam".into(), "S_sorted.bam".into()), + ("variant".into(), "vcf".into(), "S.vcf.gz".into()), + ( + "variant".into(), + "vcf".into(), + "S_sv_consensus.vcf.gz".into() + ), + ] + ); + assert!(file_of(&cfg, str_at(&t[0], &["indexURL"]).unwrap()).ends_with("S_sorted.bam.bai")); + assert!( + str_at(&t[1], &["indexURL"]) + .unwrap() + .ends_with("S.vcf.gz.tbi") + ); + let Value::Object(sv) = &t[2] else { panic!() }; + assert_eq!( + sv.get("indexed"), + Some(&Value::Bool(false)), + "the SV VCF without an index loads whole" + ); + // The same bytes Python's json.dumps(cfg, indent=1) wrote. + assert!(cfg.to_json().starts_with("{\n \"sample\": \"S\",\n \"locus\": \"chr1:451\",\n \"reference\": {\n \"id\": \"reference\"")); + assert_eq!(json::loads(&cfg.to_json()).unwrap(), cfg.json); + + assert_eq!( + sample_config(&gd, &fa, None).locus, + "chr1", + "no locus opens the first contig" + ); + for bad in [ + "chr9:100", + "chr1:99999", + "chr1;alert(1)", + "BRCA1 x", + "chr1:2000-1000", + ] { + assert!( + viewer::build_config("S", &fa, None, None, None, Some(bad)).is_err(), + "locus {bad} was accepted" + ); + } + let bam = gd.join("S/aligned/S_sorted.bam"); + fs::rename( + gd.join("S/aligned/S_sorted.bam.bai"), + scratch.path().join("bai"), + ) + .unwrap(); + let e = viewer::build_config("S", &fa, Some(&bam), None, None, None).unwrap_err(); + assert!(e.contains("samtools index"), "a BAM without an index: {e}"); + let e = viewer::build_config( + "S", + &gd.join("reference/none.fasta"), + None, + None, + None, + None, + ) + .unwrap_err(); + assert!(e.contains("needs its FASTA and .fai"), "{e}"); +} + +#[test] +fn manta_diploid_svs_come_before_the_consensus() { + let scratch = Scratch::new(Path::new(env!("CARGO_TARGET_TMPDIR")), "viewer-files"); + let s = scratch.path().join("S"); + fs::create_dir_all(s.join("sv_merged")).unwrap(); + fs::write(s.join("sv_merged/S_sv_consensus.vcf.gz"), "").unwrap(); + let f = viewer::sample_files(&s, "S"); + assert_eq!((f.reads, f.vcf), (None, None)); + assert_eq!( + f.sv_vcf, + Some(s.join("sv_merged/S_sv_consensus.vcf.gz")), + "the consensus when Manta's is missing" + ); + fs::create_dir_all(s.join("manta/results/variants")).unwrap(); + fs::write(s.join("manta/results/variants/diploidSV.vcf.gz"), "").unwrap(); + fs::create_dir_all(s.join("aligned")).unwrap(); + fs::write(s.join("aligned/S_sorted.cram"), "").unwrap(); + let f = viewer::sample_files(&s, "S"); + assert_eq!( + f.sv_vcf, + Some(s.join("manta/results/variants/diploidSV.vcf.gz")) + ); + assert_eq!(f.reads, Some(s.join("aligned/S_sorted.cram"))); + fs::write(s.join("aligned/S_sorted.bam"), "").unwrap(); + assert_eq!( + viewer::sample_files(&s, "S").reads, + Some(s.join("aligned/S_sorted.bam")), + "the BAM before the CRAM" + ); +} + +/// An address of this machine that is not loopback, if it has one. +fn other_address() -> Option { + let so = UdpSocket::bind("0.0.0.0:0").ok()?; + so.connect("192.0.2.1:9").ok()?; + let ip = so.local_addr().ok()?.ip().to_string(); + (!ip.starts_with("127.") && ip != "0.0.0.0").then_some(ip) +} + +#[test] +fn the_server_answers_only_what_the_config_names() { + let scratch = Scratch::new(Path::new(env!("CARGO_TARGET_TMPDIR")), "viewer-http"); + let gd = scratch.path().join("genome"); + let (fa, _) = make_sample(&gd); + let cfg = sample_config(&gd, &fa, Some("chr1:451")); + let srv = Server::start(&cfg, &assets(), &fake_igv(scratch.path()), 0, None).unwrap(); + let port = srv.port(); + + let (code, h, body) = get(port, "GET", "/", &[]); + let csp = header(&h, "content-security-policy").unwrap_or_default(); + assert!( + code == 200 && String::from_utf8_lossy(&body).contains("igv.min.js"), + "{code}" + ); + assert!( + csp.contains("connect-src 'self'") + && csp.contains("default-src 'none'") + && csp.contains("frame-ancestors 'none'"), + "{csp}" + ); + assert_eq!(csp, viewer::CSP); + assert_eq!(header(&h, "x-content-type-options"), Some("nosniff")); + assert_eq!(header(&h, "cache-control"), Some("no-store")); + + let (code, h, body) = get(port, "GET", "/config.json", &[]); + assert_eq!( + (code, header(&h, "content-type")), + (200, Some("application/json")) + ); + let sc = json::loads(std::str::from_utf8(&body).unwrap()).unwrap(); + assert_eq!(sc, cfg.json); + let st = tracks(&sc); + let names: Vec<&str> = st + .iter() + .map(|t| str_at(t, &["url"]).unwrap().rsplit('/').next().unwrap()) + .collect(); + assert_eq!(names, ["S_sorted.bam", "S.vcf.gz", "S_sv_consensus.vcf.gz"]); + + let raw = fs::read(gd.join("S/aligned/S_sorted.bam")).unwrap(); + let bam = format!("/{}", str_at(&tracks(&sc)[0], &["url"]).unwrap()); + let (code, h, body) = get(port, "GET", &bam, &[("Range", "bytes=10-109")]); + assert_eq!((code, body.as_slice()), (206, &raw[10..110])); + assert_eq!( + header(&h, "content-range").map(str::to_owned), + Some(format!("bytes 10-109/{}", raw.len())) + ); + let (code, _, body) = get(port, "GET", &bam, &[("Range", "bytes=-28")]); + assert_eq!( + (code, body.as_slice()), + (206, &BGZF_EOF[..]), + "a suffix range (the BGZF EOF block)" + ); + let (code, h, body) = get(port, "GET", &bam, &[]); + assert_eq!( + (code, body.len(), header(&h, "accept-ranges")), + (200, raw.len(), Some("bytes")) + ); + let past = format!("bytes={}-", raw.len() + 5); + let (code, h, _) = get(port, "GET", &bam, &[("Range", &past)]); + assert_eq!(code, 416); + assert_eq!( + header(&h, "content-range").map(str::to_owned), + Some(format!("bytes */{}", raw.len())) + ); + let (code, h, body) = get(port, "HEAD", &bam, &[("Range", "bytes=0-9")]); + assert_eq!( + (code, header(&h, "content-length"), body.len()), + (206, Some("10"), 0), + "HEAD sends no body" + ); + + for p in [ + "/data/0/../../reference/synthetic.fasta.fai", + "/data/2/..%2F..%2Fvcf%2FS.vcf.gz", + "/data/99/S_sorted.bam", + "/serve.py", + "/data/2/S.vcf.gz", + ] { + assert_eq!(get(port, "GET", p, &[]).0, 404, "{p} must be 404"); + } + assert_eq!( + get( + port, + "GET", + "/config.json", + &[("Host", "attacker.example:8765")] + ) + .0, + 403, + "a foreign Host" + ); + assert_eq!( + get(port, "GET", "/config.json", &[("Host", "localhost:8765")]).0, + 200 + ); + assert_eq!(get(port, "POST", "/config.json", &[]).0, 405); + // D12: the viewer has no password, so a request a proxy forwarded is refused. + for (k, v) in [ + ("X-Forwarded-For", "203.0.113.9"), + ("Forwarded", "for=203.0.113.9"), + ("X-Forwarded-Host", "genome.example"), + ("X-Forwarded-Proto", "https"), + ("X-Real-IP", "203.0.113.9"), + ] { + let (code, _, body) = get(port, "GET", "/config.json", &[(k, v)]); + assert_eq!(code, 403, "a request with {k} must be refused"); + assert!( + String::from_utf8_lossy(&body).contains("ssh"), + "the refusal says how to reach it" + ); + } + + if let Some(ip) = other_address() { + assert!( + TcpStream::connect_timeout( + &format!("{ip}:{port}").parse().unwrap(), + Duration::from_secs(2) + ) + .is_err(), + "the viewer must not be reachable on {ip}" + ); + } else { + println!("[SKIP] no non-loopback address to test the bind against"); + } + drop(srv); + + // A file name with a space, '#' or '?' (a REF_FASTA the user named so). + let odd = scratch.path().join("odd"); + fs::create_dir_all(&odd).unwrap(); + fs::copy(&fa, odd.join("my ref#1?.fasta")).unwrap(); + fs::copy( + gd.join("reference/synthetic.fasta.fai"), + odd.join("my ref#1?.fasta.fai"), + ) + .unwrap(); + let ocfg = + viewer::build_config("S", &odd.join("my ref#1?.fasta"), None, None, None, None).unwrap(); + let url = str_at(&ocfg.json, &["reference", "fastaURL"]) + .unwrap() + .to_owned(); + assert_eq!(url, "data/0/my%20ref%231%3F.fasta"); + let osrv = Server::start(&ocfg, &assets(), &fake_igv(scratch.path()), 0, None).unwrap(); + let (code, _, body) = get( + osrv.port(), + "GET", + &format!("/{url}"), + &[("Range", "bytes=0-4")], + ); + assert_eq!((code, body.as_slice()), (206, &b">chr1"[..])); +} + +#[test] +fn og_view_serve_refuses_a_bad_start() { + let scratch = Scratch::new(Path::new(env!("CARGO_TARGET_TMPDIR")), "viewer-cli"); + let gd = scratch.path().join("genome"); + let (fa, _) = make_sample(&gd); + let igv = fake_igv(scratch.path()); + // Every run names a port that is taken, so a check that stops failing + // ends with exit 1 instead of a server that never returns. + let busy = std::net::TcpListener::bind("127.0.0.1:0").unwrap(); + let busy_port = busy.local_addr().unwrap().port().to_string(); + let run = |extra: &[&str]| { + let mut args: Vec = ["--sample", "S", "--fasta"] + .iter() + .map(|s| (*s).to_owned()) + .collect(); + args.push(fa.display().to_string()); + args.extend([ + "--igv-js".into(), + igv.display().to_string(), + "--assets".into(), + assets().display().to_string(), + ]); + args.extend(["--port".into(), busy_port.clone()]); + args.extend(extra.iter().map(|s| (*s).to_owned())); + let (mut out, mut err) = (Vec::new(), Vec::new()); + let code = viewer::cli(&args, &mut out, &mut err); + (code, String::from_utf8(err).unwrap()) + }; + let (code, err) = run(&["--locus", "chr1:2000-1000"]); + assert_eq!(code, 2); + assert!( + err.starts_with("ERROR: 'chr1:2000-1000' ends before it starts"), + "{err}" + ); + let (code, err) = run(&["--port", "http"]); + assert!(code == 2 && err.contains("is not a port number"), "{err}"); + let (code, err) = run(&["--og-scaffold-probe"]); + assert!(code == 2 && err.contains("unrecognized arguments"), "{err}"); + let (code, err) = run(&["--assets", "/nonexistent"]); + assert!( + code == 2 && err.contains("the viewer page not found"), + "{err}" + ); + // A port that is taken: exit 1 with the variable to set. + let (code, err) = run(&[]); + assert!( + code == 1 && err.contains("Set OWNGENOME_VIEW_PORT"), + "{err}" + ); +} + +/// The igv.js release versions.env pins, downloaded once into `dir` and +/// checked by sha256. +fn pinned_igv(dir: &Path) -> PathBuf { + let env = fs::read_to_string(repo_root().join("versions.env")).unwrap(); + let pin = |k: &str| { + env.lines() + .find_map(|l| l.strip_prefix(&format!("{k}=\""))) + .and_then(|v| v.strip_suffix('"')) + .unwrap_or_else(|| panic!("versions.env sets no {k}")) + .to_owned() + }; + let (version, sha) = (pin("IGV_JS_VERSION"), pin("IGV_JS_SHA256")); + let path = dir.join(format!("igv-{version}.min.js")); + if !path.is_file() { + let url = format!("https://cdn.jsdelivr.net/npm/igv@{version}/dist/igv.min.js"); + let ok = Command::new("curl") + .args(["-fsSL", "--retry", "3", "-o"]) + .arg(&path) + .arg(&url) + .status() + .is_ok_and(|s| s.success()); + assert!(ok, "cannot download {url}"); + } + let sum = Command::new("shasum") + .args(["-a", "256"]) + .arg(&path) + .output() + .or_else(|_| Command::new("sha256sum").arg(&path).output()) + .expect("shasum or sha256sum"); + let got = String::from_utf8_lossy(&sum.stdout) + .split_whitespace() + .next() + .unwrap_or_default() + .to_owned(); + if got != sha { + let _ = fs::remove_file(&path); + panic!("igv.min.js has sha256 {got}, versions.env pins {sha}"); + } + path +} + +/// Opens the viewer of `cfg` in Chrome with `igv` as igv.min.js: the +/// page's status, what the policy blocked, and the requests it made. +fn load_page( + chrome: &Path, + scratch: &Path, + name: &str, + cfg: &Config, + igv: &Path, +) -> (String, String, Vec) { + let lines = Arc::new(Mutex::new(Vec::new())); + let sink = Arc::clone(&lines); + let log: Logger = Box::new(move |l: &str| sink.lock().unwrap().push(l.to_owned())); + let srv = Server::start(cfg, &assets(), igv, 0, Some(log)).unwrap(); + let mut b = Browser::launch(chrome, &scratch.join(format!("chrome-{name}"))).unwrap(); + b.go(&format!("http://127.0.0.1:{}/#chr1:451", srv.port())) + .unwrap(); + let done = "(function(){var s=document.documentElement.dataset.pgpStatus||'';return s==='ready'||s.indexOf('error')===0;})()"; + b.wait(done, Duration::from_secs(60)); + // igv.js reads the reads after it reports ready; give it the time. + b.wait( + "performance.getEntriesByType('resource').some(function(e){return /S_sorted\\.bam$/.test(e.name);})", + Duration::from_secs(20), + ); + let text = |v: Result| match v { + Ok(Value::Str(s)) => s, + _ => String::new(), + }; + let status = text(b.eval("document.documentElement.dataset.pgpStatus || ''")); + let blocked = text(b.eval("document.documentElement.dataset.pgpBlocked || ''")); + drop(b); + drop(srv); + let log = lines.lock().unwrap().clone(); + (status, blocked, log) +} + +#[test] +fn the_page_starts_igv_on_the_config() { + let Some(chrome) = chrome_or_skip("load the viewer page") else { + return; + }; + let scratch = Scratch::new(Path::new(env!("CARGO_TARGET_TMPDIR")), "viewer-browser"); + let gd = scratch.path().join("genome"); + let (fa, _) = make_sample(&gd); + let cfg = sample_config(&gd, &fa, Some("chr1:451")); + let igv = pinned_igv(Path::new(env!("CARGO_TARGET_TMPDIR"))); + + let (status, blocked, log) = load_page(&chrome, scratch.path(), "real", &cfg, &igv); + let all = log.join("\n"); + assert_eq!( + status, "ready", + "igv.js did not start on the config; requests:\n{all}" + ); + assert_eq!(blocked, "", "the policy blocked what the page needed"); + assert!( + all.contains("S_sorted.bam.bai") + && log + .iter() + .any(|l| l.starts_with("\"GET /data/") && l.contains("/S_sorted.bam HTTP")), + "igv.js read the BAM's index and a range of the BAM:\n{all}" + ); + assert!( + all.contains("synthetic.fasta") && all.contains("S.vcf.gz"), + "igv.js read the reference and the VCF:\n{all}" + ); + assert!( + !log.iter().any(|l| l.contains("\" 4")), + "every request of the page was served:\n{all}" + ); + + // Red control: an empty igv.min.js. The same check must see an error. + let empty = scratch.path().join("empty-igv.min.js"); + fs::write(&empty, "").unwrap(); + let (status, _, _) = load_page(&chrome, scratch.path(), "control", &cfg, &empty); + assert!( + status.starts_with("error: "), + "control: the page reported {status:?} without igv.js" + ); +} diff --git a/rust/crates/og-recheck/src/rerun.rs b/rust/crates/og-recheck/src/rerun.rs index 130c9a47c..3570c642d 100644 --- a/rust/crates/og-recheck/src/rerun.rs +++ b/rust/crates/og-recheck/src/rerun.rs @@ -152,6 +152,7 @@ pub const SWITCHES: &[&str] = &[ "MEGANE_KMERS", "MOCHA_DATA", "GRIDSS", + "TIDDIT", "IMPUTATION", "SOMATIC", "EXTRA_CALLERS", @@ -160,6 +161,7 @@ pub const SWITCHES: &[&str] = &[ "OWNGENOME_LIVE_URL", "LOCITYPER_DATA", "LOCITYPER_BG_REGION", + "EVERYTHING", "NXF_VER", "NXF_WORK", "NXF_HOME", diff --git a/rust/crates/og-render/src/chapters.rs b/rust/crates/og-render/src/chapters.rs index ea46924ed..7ea79341b 100644 --- a/rust/crates/og-render/src/chapters.rs +++ b/rust/crates/og-render/src/chapters.rs @@ -266,8 +266,21 @@ pub fn step_of(key: &str) -> &'static str { .map_or("?", |s| s.step) } +/// Summary keys no frame section lists, because the section of another key +/// already shows what they hold: `(key, the key whose section shows it)`. +/// `acmg_sf` is the secondary-findings card the clinical section also holds +/// as `clinical.data.acmg_sf`, and the reports read it there. Listing it in +/// the clinical-filter frame would change that section's step, state and +/// file date before any reader shows it. It moves into the frame when the +/// readers switch to `sections.acmg_sf` (i411-display-sf). +pub const SHOWN_WITH: &[(&str, &str)] = &[("acmg_sf", "clinical")]; + /// The section that shows summary key `key`. pub fn section_of(key: &str) -> Option<&'static Sec> { + let key = SHOWN_WITH + .iter() + .find(|(k, _)| *k == key) + .map_or(key, |(_, with)| *with); CHAPTERS .iter() .flat_map(|c| c.sections.iter()) @@ -283,12 +296,19 @@ pub fn section(sid: &str) -> Option<&'static Sec> { } /// What is wrong with a chapter table against the summary keys: a key no -/// section shows, a key two sections show, a key no collector writes. +/// section shows, a key two sections show, a key no collector writes. A key +/// of `SHOWN_WITH` counts as shown where its partner key is. pub fn key_problems(chapters: &[Chapter], keys: &[&str]) -> Vec { - let seen: Vec<&str> = chapters + let mut seen: Vec<&str> = chapters .iter() .flat_map(|c| c.sections.iter().flat_map(|s| s.keys.iter().copied())) .collect(); + let carried: Vec<&str> = SHOWN_WITH + .iter() + .filter(|(_, with)| seen.contains(with)) + .map(|(k, _)| *k) + .collect(); + seen.extend(carried); let mut out: Vec = keys .iter() .filter(|k| !seen.contains(k)) diff --git a/rust/crates/og-render/src/charts/build.rs b/rust/crates/og-render/src/charts/build.rs new file mode 100644 index 000000000..faf3a8480 --- /dev/null +++ b/rust/crates/og-render/src/charts/build.rs @@ -0,0 +1,792 @@ +//! The five chart specs from a summary, read with Python's rules (an int +//! stays an int, `str()`, `int()` and `float()` as Python applies them), so +//! the specs are what `bin/report_charts.py` built. + +use indexmap::IndexMap; +use pycompat::json::Value; +use pycompat::num::{parse_float, parse_int}; +use pycompat::value::py_repr; + +use super::{Kind, Mark, MarkKind, NotDrawn, ROH_MIN_MB, Spec, Tone, chrom_len, draw}; +use crate::model::{Malformed, Summary, get, need, py, py_eq, truthy}; +use crate::notes; +use crate::sections::clinvar::{HITS_ANCHOR, HITS_SHOWN}; +use crate::sections::{ancestry_fine, prs}; + +/// The specs of the five charts, in report order (ClinVar, genome, mito, +/// fine-grained ancestry, PRS), for the sections that ran, each drawn. +pub fn build(s: &Summary) -> Result, Malformed> { + let all = [ + clinvar(s)?, + genome(s)?, + mito(s)?, + ancestry(s)?, + prs_chart(s)?, + ]; + let mut out = Vec::new(); + for mut sp in all.into_iter().flatten() { + sp.svg = draw(&sp)?; + out.push(sp); + } + Ok(out) +} + +// --- Python's rules --------------------------------------------------------------------- + +fn bad(path: &str, why: &str) -> Malformed { + Malformed(format!("{path}: {why}")) +} + +/// `int(v)`: an int, a float cut toward zero, a bool, or a text of digits. +fn py_int(v: &Value, path: &str) -> Result { + match v { + Value::Int(i) => Ok(*i), + Value::Bool(b) => Ok(i128::from(*b)), + Value::Float(x) if x.is_finite() => Ok(x.trunc() as i128), + Value::Str(t) => parse_int(t).map_err(|_| bad(path, "not an int")), + _ => Err(bad(path, "not an int")), + } +} + +/// `float(v)`; `Ok(None)` for a text that is not a number (Python's +/// ValueError), an error for a value of another kind (TypeError). +fn py_float(v: &Value, path: &str) -> Result, Malformed> { + match v { + Value::Int(i) => Ok(Some(*i as f64)), + Value::Float(x) => Ok(Some(*x)), + Value::Bool(b) => Ok(Some(f64::from(u8::from(*b)))), + Value::Str(t) => Ok(parse_float(t).ok()), + _ => Err(bad(path, "not a number")), + } +} + +/// `float(v)` that must be a number. +fn need_float(v: &Value, path: &str) -> Result { + py_float(v, path)?.ok_or_else(|| bad(path, "not a number")) +} + +/// `100 * v`, an int for an int as in Python. +fn times_100(v: &Value, path: &str) -> Result { + match v { + Value::Int(i) => Ok(Value::Int(i * 100)), + Value::Bool(b) => Ok(Value::Int(i128::from(*b) * 100)), + Value::Float(x) => Ok(Value::Float(100.0 * x)), + _ => Err(bad(path, "not a number")), + } +} + +/// `str(d.get(key, default))`. +fn s_or(d: &Value, key: &str, default: &str, path: &str) -> Result { + match get(d, key, path)? { + Some(v) => py(v), + None => Ok(default.to_owned()), + } +} + +/// `str(d.get(key) or default)`. +fn s_truthy(d: &Value, key: &str, default: &str, path: &str) -> Result { + match get(d, key, path)?.filter(|v| truthy(v)) { + Some(v) => py(v), + None => Ok(default.to_owned()), + } +} + +/// `d.get(key)`, `null` when it is not there. +fn raw(d: &Value, key: &str, path: &str) -> Result { + Ok(get(d, key, path)?.cloned().unwrap_or(Value::Null)) +} + +/// `d.get(key) or []` as a list. +fn list<'a>(d: &'a Value, key: &str, path: &str) -> Result<&'a [Value], Malformed> { + match get(d, key, path)?.filter(|v| truthy(v)) { + None => Ok(&[]), + Some(Value::Array(a)) => Ok(a), + Some(_) => Err(bad(&format!("{path}.{key}"), "not a list")), + } +} + +/// The section's data, when the section ran (`ok` or `stale`). +fn ran<'a>(s: &'a Summary, key: &'a str) -> Option<&'a Value> { + let sec = s.section(key); + sec.state.ran().then_some(sec.data) +} + +fn caveat(key: &'static str) -> Result<&'static str, Malformed> { + notes::text(key).ok_or_else(|| Malformed(format!("no caveat called {key}"))) +} + +fn spec( + id: &'static str, + section: &'static str, + kind: Kind, + title: &'static str, + caveat_key: &'static str, + marks: Vec, +) -> Result { + Ok(Spec { + id, + section, + kind, + title, + caveat_key, + caveat: caveat(caveat_key)?, + axis: IndexMap::new(), + marks, + not_drawn: Vec::new(), + text: None, + svg: String::new(), + }) +} + +fn axis(items: &[(&str, Value)]) -> IndexMap { + items + .iter() + .map(|(k, v)| ((*k).to_owned(), v.clone())) + .collect() +} + +fn plural(n: i128) -> &'static str { + if n == 1 { "" } else { "s" } +} + +/// The report's hits table for a hit it lists, the ClinVar section for one +/// past it. +fn hit_anchor(i: usize) -> &'static str { + if i < HITS_SHOWN { + HITS_ANCHOR + } else { + "clinvar" + } +} + +/// `GENE chrom:pos REF>ALT`. +fn hit_label(h: &Value, path: &str) -> Result { + Ok(format!( + "{} {}:{} {}>{}", + s_truthy(h, "gene", ".", path)?, + py(need(h, "chrom", path)?)?, + py(need(h, "pos", path)?)?, + s_or(h, "ref", "", path)?, + s_or(h, "alt", "", path)? + )) +} + +/// `^(chr[0-9XYM]+):([0-9]+)-([0-9]+)$`, where `$` also matches before a +/// final newline as in Python. +fn region(text: &str) -> Option<(String, i128, i128)> { + let t = text.strip_suffix('\n').unwrap_or(text); + let (chrom, rest) = t.split_once(':')?; + let name = chrom.strip_prefix("chr")?; + if name.is_empty() + || !name + .bytes() + .all(|b| b.is_ascii_digit() || b"XYM".contains(&b)) + { + return None; + } + let (a, b) = rest.split_once('-')?; + let digits = |x: &str| !x.is_empty() && x.bytes().all(|c| c.is_ascii_digit()); + if !digits(a) || !digits(b) { + return None; + } + Some((chrom.to_owned(), a.parse().ok()?, b.parse().ok()?)) +} + +/// Counts by what is not drawn, in the order first seen. +#[derive(Default)] +struct Tally(IndexMap); + +impl Tally { + fn add(&mut self, what: &str) { + *self.0.entry(what.to_owned()).or_insert(0) += 1; + } + + fn list(self) -> Vec { + self.0 + .into_iter() + .map(|(what, count)| NotDrawn { what, count }) + .collect() + } +} + +// --- the five charts -------------------------------------------------------------------- + +fn clinvar(s: &Summary) -> Result, Malformed> { + let Some(c) = ran(s, "clinvar") else { + return Ok(None); + }; + let path = "sections.clinvar.data"; + let empty = Value::Object(IndexMap::new()); + let by = get(c, "by_stars", path)? + .filter(|v| truthy(v)) + .unwrap_or(&empty); + let hits = list(c, "hits", path)?; + let hp = format!("{path}.hits[]"); + let low_conf = |h: &Value| -> Result { + Ok(get(h, "low_confidence", &hp)?.is_some_and(truthy)) + }; + let mut marks = Vec::new(); + for k in ["4", "3", "2", "1", "0"] { + let n = match get(by, k, &format!("{path}.by_stars"))? { + Some(v) => py_int(v, &format!("{path}.by_stars.{k}"))?, + None => 0, + }; + let mut idx = Vec::new(); + for (i, h) in hits.iter().enumerate() { + let stars = match get(h, "stars", &hp)? { + Some(v) => py(v)?, + None => "None".to_owned(), + }; + if stars == k && !low_conf(h)? { + idx.push(i); + } + } + let shown: Vec = idx + .iter() + .take(10) + .map(|&i| hit_label(&hits[i], &hp)) + .collect::>()?; + let names = shown.join(", ") + if idx.len() > 10 { " and more" } else { "" }; + let one = if k == "1" { "" } else { "s" }; + let mut m = Mark::new( + format!("stars-{k}"), + format!("{k} star{one}"), + Value::Int(n), + ); + m.tone = if n != 0 { Tone::Attention } else { Tone::Muted }; + m.anchor = Some(idx.first().map_or("clinvar", |&i| hit_anchor(i)).to_owned()); + m.detail = format!("{n} hit{} with {k} review star{one}", plural(n)) + + &if names.is_empty() { + String::new() + } else { + format!(": {names}") + }; + marks.push(m); + } + if let Some(v) = get(c, "low_confidence", path)? { + let n = py_int(v, &format!("{path}.low_confidence"))?; + let mut first = None; + for (i, h) in hits.iter().enumerate() { + if low_conf(h)? { + first = Some(i); + break; + } + } + let f = get(c, "call_floor", path)? + .filter(|v| truthy(v)) + .unwrap_or(&empty); + let fp = format!("{path}.call_floor"); + let floor = |k: &str| -> Result { + get(f, k, &fp)?.map_or(Ok("None".to_owned()), py) + }; + let mut m = Mark::new( + "low-confidence".into(), + "Low-confidence, not counted".into(), + Value::Int(n), + ); + m.tone = Tone::Muted; + m.anchor = Some(first.map_or("clinvar", hit_anchor).to_owned()); + m.detail = format!( + "{n} call{} with GQ below {} or DP below {}: listed in the hits, not counted in the stars", + plural(n), + floor("GQ")?, + floor("DP")? + ); + marks.push(m); + } + let mut sp = spec( + "clinvar-stars", + "clinvar", + Kind::Bars, + "ClinVar hits by review stars", + "CLINVAR_FREQ_NOTE", + marks, + )?; + sp.axis = axis(&[("unit", Value::Str("hits".into()))]); + Ok(Some(sp)) +} + +fn ancestry(s: &Summary) -> Result, Malformed> { + let Some(d) = ran(s, "ancestry_fine") else { + return Ok(None); + }; + let mut marks: Vec = Vec::new(); + for (level, title) in ancestry_fine::LEVELS { + let at = format!("sections.ancestry_fine.data.{level}[]"); + for r in ancestry_fine::rows(d, level)? { + let v = times_100(need(&r, "fraction", &at)?, &format!("{at}.fraction"))?; + let bound = |k: &str| -> Result { + match get(&r, k, &at)? { + None | Some(Value::Null) => Ok(Value::Null), + Some(x) => times_100(x, &format!("{at}.{k}")), + } + }; + let (low, high) = (bound("low")?, bound("high")?); + let pct = + |x: &Value| pycompat::fmt::fixed(crate::model::num(Some(x)).unwrap_or(0.0), 0); + let code = match get(&r, "code", &at)?.filter(|c| truthy(c)) { + Some(c) => py(c)?, + None => marks.len().to_string(), + }; + let mut m = Mark::new( + format!("{level}-{code}"), + py(need(&r, "group", &at)?)?, + v.clone(), + ); + m.detail = format!("{title}: {}%", pct(&v)); + if !matches!(low, Value::Null) && !matches!(high, Value::Null) { + m.detail += &format!(" (bootstrap range {}% to {}%)", pct(&low), pct(&high)); + } + m.low = low; + m.high = high; + m.anchor = Some("ancestry-fine".into()); + m.group = Some(title.to_owned()); + marks.push(m); + } + } + if marks.is_empty() { + return Ok(None); + } + let mut sp = spec( + "ancestry-fine", + "ancestry_fine", + Kind::Ranges, + "Fine-grained ancestry, with bootstrap ranges", + "ANCESTRY_FINE_NOTE", + marks, + )?; + sp.axis = axis(&[ + ("min", Value::Int(0)), + ("max", Value::Int(100)), + ("unit", Value::Str("%".into())), + ]); + Ok(Some(sp)) +} + +fn prs_chart(s: &Summary) -> Result, Malformed> { + let Some(d) = ran(s, "prs") else { + return Ok(None); + }; + let path = "sections.prs.data"; + if !get(d, "adjusted", path)?.is_some_and(truthy) { + let mut sp = spec( + "prs", + "prs", + Kind::Text, + "Polygenic risk scores", + "PRS_ANCESTRY_NOTE", + Vec::new(), + )?; + sp.text = Some(prs::note(d)?); + return Ok(Some(sp)); + } + let at = format!("{path}.scores[]"); + let mut marks = Vec::new(); + for (i, r) in list(d, "scores", path)?.iter().enumerate() { + let other = + matches!(get(r, "sex_check", &at)?, Some(Value::Str(x)) if x == prs::NOT_APPLICABLE); + let mut value = None; + if !other && let Some(p) = get(r, "percentile", &at)?.filter(|v| truthy(v)) { + value = py_float(p, &format!("{at}.percentile"))?.filter(|v| (0.0..=100.0).contains(v)); + } + let id = s_truthy(r, "pgs_id", &i.to_string(), &at)?; + let label = format!( + "{} ({})", + s_truthy(r, "condition", ".", &at)?, + s_truthy(r, "pgs_id", ".", &at)? + ); + let text = prs::percentile(r)?; + let mut m = Mark::new( + format!("pgs-{id}"), + label, + value.map_or(Value::Null, Value::Float), + ); + m.tone = if value.is_some() { + Tone::Info + } else { + Tone::Muted + }; + m.anchor = Some("prs".into()); + m.detail = match (value, text.is_empty()) { + (Some(_), false) => text, + (Some(_), true) => "no percentile".into(), + (None, false) => format!("no percentile: {text}"), + (None, true) => "no percentile".into(), + }; + marks.push(m); + } + let mut sp = spec( + "prs", + "prs", + Kind::Strip, + "Polygenic risk score percentiles", + "PRS_ANCESTRY_NOTE", + marks, + )?; + sp.axis = axis(&[ + ("min", Value::Int(0)), + ("max", Value::Int(100)), + ("unit", Value::Str("percentile".into())), + ]); + Ok(Some(sp)) +} + +/// The genome chart sits in the ROH section, so it is drawn only when ROH +/// ran; the ClinVar ticks, AnnotSV spans and MoChA bars come with it when +/// their steps ran too. +fn genome(s: &Summary) -> Result, Malformed> { + let Some(roh) = ran(s, "roh") else { + return Ok(None); + }; + let mut marks = Vec::new(); + let mut not_drawn = Tally::default(); + let at = "sections.roh.data.autosomal_over_5mb[]"; + let mut short = 0; + for (i, r) in list(roh, "autosomal_over_5mb", "sections.roh.data")? + .iter() + .enumerate() + { + let reg = s_or(r, "region", "", at)?; + let shown = || -> Result { + match get(r, "region", at)? { + Some(v) => py_repr(v).map_err(|e| Malformed(e.to_string())), + None => Ok("None".into()), + } + }; + let Some((chrom, start, end)) = region(®) else { + return Err(Malformed(format!( + "run of homozygosity {}: not a chrom:start-end region", + shown()? + ))); + }; + if end < start { + return Err(Malformed(format!( + "run of homozygosity {}: the end is before the start", + shown()? + ))); + } + let mb = match get(r, "mb", at)? { + Some(v) => need_float(v, &format!("{at}.mb"))?, + None => 0.0, + }; + if mb < ROH_MIN_MB { + short += 1; + continue; + } + if chrom_len(&chrom).is_none() { + not_drawn.add(&format!("runs of homozygosity on {chrom}")); + continue; + } + let mb_text = py(need(r, "mb", at)?)?; + let mut m = Mark::new( + format!("roh-{i}"), + format!("Run of homozygosity {reg}"), + Value::Float(mb), + ); + m.locus = Some(format!("{chrom}:{start}-{end}")); + m.chrom = Some(chrom); + m.pos = Some(start); + m.end = Some(end); + m.anchor = Some("roh".into()); + m.kind = Some(MarkKind::Roh); + m.detail = format!("{mb_text} MB run of homozygosity at {reg}"); + marks.push(m); + } + if short > 0 { + not_drawn + .0 + .insert("runs of homozygosity under 5 MB".into(), short); + } + if let Some(c) = ran(s, "clinvar") { + let hp = "sections.clinvar.data.hits[]"; + for (i, h) in list(c, "hits", "sections.clinvar.data")?.iter().enumerate() { + let chrom = match get(h, "chrom", hp)? { + Some(Value::Str(x)) => Some(x.as_str()), + _ => None, + }; + if chrom == Some("chrM") { + not_drawn.add("ClinVar hits on chrM"); + continue; + } + let Some(chrom) = chrom.filter(|c| chrom_len(c).is_some()) else { + not_drawn.add("ClinVar hits on other contigs (alt, unplaced)"); + continue; + }; + let low = get(h, "low_confidence", hp)?.is_some_and(truthy); + let pos = need(h, "pos", hp)?; + let stars = raw(h, "stars", hp)?; + let one = if py_eq(&stars, &Value::Int(1)) { + "" + } else { + "s" + }; + let mut m = Mark::new(format!("hit-{i}"), hit_label(h, hp)?, stars.clone()); + m.chrom = Some(chrom.to_owned()); + m.pos = Some(py_int(pos, &format!("{hp}.pos"))?); + m.tone = if low { Tone::Muted } else { Tone::Attention }; + m.anchor = Some(hit_anchor(i).to_owned()); + m.locus = Some(format!("{chrom}:{}", py(pos)?)); + m.kind = Some(MarkKind::Hit); + m.caveat = Some(caveat("CLINVAR_FREQ_NOTE")?.to_owned()); + m.detail = format!( + "{}, {} star{one}, {}{}", + s_truthy(h, "significance", ".", hp)?, + py(&stars)?, + s_truthy(h, "genotype", ".", hp)?, + if low { ", low-confidence call" } else { "" } + ); + marks.push(m); + } + } + if let Some(a) = ran(s, "annotsv") { + let rp = "sections.annotsv.data.rows[]"; + for (i, r) in list(a, "rows", "sections.annotsv.data")?.iter().enumerate() { + let sv = s_or(r, "sv", "", rp)?; + // AnnotSV writes SV_chrom without the chr prefix: put it back, as the collector does. + let full = if sv.starts_with("chr") { + sv.clone() + } else { + format!("chr{sv}") + }; + let Some((chrom, start, end)) = + region(&full).filter(|(c, _, _)| chrom_len(c).is_some()) + else { + not_drawn.add("AnnotSV class 4 and 5 SVs on other contigs"); + continue; + }; + let genes = match get(r, "genes", rp)?.filter(|v| truthy(v)) { + None => String::new(), + Some(Value::Array(g)) => g + .iter() + .take(5) + .map(py) + .collect::, _>>()? + .join(", "), + Some(Value::Str(g)) => g + .chars() + .take(5) + .map(String::from) + .collect::>() + .join(", "), + Some(_) => return Err(bad(&format!("{rp}.genes"), "not a list")), + }; + let genes = if genes.is_empty() { + "no gene".to_owned() + } else { + genes + }; + let class = raw(r, "acmg_class", rp)?; + let kind = s_truthy(r, "type", "SV", rp)?; + let mut m = Mark::new( + format!("sv-{i}"), + format!( + "{kind} {} (AnnotSV class {})", + py(need(r, "sv", rp)?)?, + py(&class)? + ), + class.clone(), + ); + m.locus = Some(format!("{chrom}:{start}-{end}")); + m.chrom = Some(chrom); + m.pos = Some(start); + m.end = Some(end.max(start)); + m.tone = Tone::Attention; + m.anchor = Some("structural-variants".into()); + m.kind = Some(MarkKind::Sv); + m.caveat = Some(caveat("ANNOTSV_NOTE")?.to_owned()); + m.detail = format!( + "AnnotSV class {} {kind}, {} bp, genotype {}, genes: {genes}", + py(&class)?, + s_truthy(r, "length", ".", rp)?, + s_truthy(r, "gt", ".", rp)? + ); + marks.push(m); + } + } + if let Some(mo) = ran(s, "mosaic") { + let cp = "sections.mosaic.data.calls[]"; + for (i, c) in list(mo, "calls", "sections.mosaic.data")? + .iter() + .enumerate() + { + let mut chrom = s_truthy(c, "chrom", "", cp)?; + if !chrom.is_empty() && !chrom.starts_with("chr") { + chrom = format!("chr{chrom}"); + } + // int() of start and end; a value that is not one leaves the call unplaced. + let as_int = |k: &str| -> Option { + let v = get(c, k, cp).ok()??; + py_int(v, k).ok() + }; + let span = as_int("start").zip(as_int("end")); + let Some((start, end)) = span.filter(|(a, b)| chrom_len(&chrom).is_some() && b >= a) + else { + not_drawn.add("MoChA calls on other contigs or with no position"); + continue; + }; + let fraction = raw(c, "cell_fraction", cp)?; + let mut m = Mark::new( + format!("mca-{i}"), + format!( + "MoChA {} {chrom}:{start}-{end}", + s_truthy(c, "type", "call", cp)? + ), + fraction, + ); + m.locus = Some(format!("{chrom}:{start}-{end}")); + m.chrom = Some(chrom); + m.pos = Some(start); + m.end = Some(end); + m.tone = Tone::Attention; + m.anchor = Some("mosaic-mca".into()); + m.kind = Some(MarkKind::Mca); + m.caveat = Some(caveat("MCA_NOTE")?.to_owned()); + m.detail = format!( + "mosaic {} over {} Mb, cell fraction {}", + s_truthy(c, "type", "alteration", cp)?, + s_truthy(c, "length_mb", ".", cp)?, + s_truthy(c, "cell_fraction", ".", cp)? + ); + marks.push(m); + } + } + // A position past the end of its chromosome (a file of another assembly) + // is not drawn; an end past it is cut at the end, so every mark stays + // inside its chromosome. + let mut kept = Vec::new(); + for mut m in marks { + let n = m.chrom.as_deref().and_then(chrom_len).unwrap_or(0); + if m.pos.is_some_and(|p| p > n) { + not_drawn.add("marks past the end of their GRCh38 chromosome"); + continue; + } + if m.end.is_some_and(|e| e > n) { + m.end = Some(n); + } + kept.push(m); + } + let mut sp = spec( + "genome", + "roh", + Kind::Ideogram, + "Runs of homozygosity, ClinVar hits, structural variants and mosaic alterations on the \ + chromosomes", + "ROH_NOTE", + kept, + )?; + sp.axis = axis(&[("assembly", Value::Str("GRCh38".into()))]); + sp.not_drawn = not_drawn.list(); + Ok(Some(sp)) +} + +/// `^chrM:([0-9]+) `: the position of a poly-C call. +fn polyc_pos(variant: &str) -> Option { + let rest = variant.strip_prefix("chrM:")?; + let n = rest.bytes().take_while(u8::is_ascii_digit).count(); + (n > 0 && rest.as_bytes().get(n) == Some(&b' ')).then(|| rest[..n].parse().ok())? +} + +fn mito(s: &Summary) -> Result, Malformed> { + let Some(d) = ran(s, "mito") else { + return Ok(None); + }; + let path = "sections.mito.data"; + let sp_at = format!("{path}.heteroplasmic_sites[]"); + let mut marks = Vec::new(); + let mut not_drawn = Vec::new(); + let sites = get(d, "heteroplasmic_sites", path)?.filter(|v| !matches!(v, Value::Null)); + let site_list: &[Value] = match sites { + None => &[], + Some(v) if !truthy(v) => &[], + Some(Value::Array(a)) => a, + Some(_) => return Err(bad(&format!("{path}.heteroplasmic_sites"), "not a list")), + }; + for x in site_list { + let pos = need(x, "pos", &sp_at)?; + let (p, alt, af) = ( + py(pos)?, + py(need(x, "alt", &sp_at)?)?, + need(x, "af", &sp_at)?, + ); + let mut m = Mark::new( + format!("m{p}-{alt}"), + format!("m.{p}{}>{alt}", py(need(x, "ref", &sp_at)?)?), + Value::Float(need_float(af, &format!("{sp_at}.af"))?), + ); + m.chrom = Some("chrM".into()); + m.pos = Some(py_int(pos, &format!("{sp_at}.pos"))?); + m.tone = Tone::Attention; + m.anchor = Some("mito".into()); + m.locus = Some(format!("chrM:{p}")); + m.kind = Some(MarkKind::Site); + m.detail = format!("allele fraction {}", py(af)?); + marks.push(m); + } + let missing = match (sites, get(d, "heteroplasmic", path)?.filter(|v| truthy(v))) { + (None, Some(h)) => py_int(h, &format!("{path}.heteroplasmic"))?, + _ => 0, + }; + if missing != 0 { + not_drawn.push(NotDrawn { + what: "heteroplasmic sites this summary does not list (made before it listed them)" + .into(), + count: missing, + }); + } + let pc_at = format!("{path}.polyc_heteroplasmic[]"); + for x in list(d, "polyc_heteroplasmic", path)? { + let variant = match get(x, "variant", &pc_at)? { + None => String::new(), + Some(Value::Str(v)) => v.clone(), + Some(_) => return Err(bad(&format!("{pc_at}.variant"), "not a text")), + }; + let Some(pos) = polyc_pos(&variant) else { + let shown = match get(x, "variant", &pc_at)? { + Some(v) => py_repr(v).map_err(|e| Malformed(e.to_string()))?, + None => "None".into(), + }; + not_drawn.push(NotDrawn { + what: format!("poly-C call {shown} with no position"), + count: 1, + }); + continue; + }; + let af = need(x, "af", &pc_at)?; + let mut m = Mark::new( + format!("polyc-{pos}"), + format!("{variant} (D-loop poly-C tract)"), + Value::Float(need_float(af, &format!("{pc_at}.af"))?), + ); + m.chrom = Some("chrM".into()); + m.pos = Some(pos); + m.tone = Tone::Muted; + m.anchor = Some("mito".into()); + m.locus = Some(format!("chrM:{pos}")); + m.kind = Some(MarkKind::Polyc); + m.detail = format!( + "length heteroplasmy in a D-loop poly-C tract, allele fraction {}; not counted as heteroplasmic", + py(af)? + ); + marks.push(m); + } + let floor = get(d, "heteroplasmy_floor", path)? + .cloned() + .unwrap_or(Value::Float(0.05)); + let mut sp = spec( + "mito", + "mito", + Kind::Scatter, + "Heteroplasmic chrM sites", + "MITO_NOTE", + marks, + )?; + sp.axis = axis(&[ + ("min", Value::Int(0)), + ("max", Value::Int(1)), + ("unit", Value::Str("allele fraction".into())), + ("floor", floor), + ("sites_missing", Value::Int(missing)), + ]); + sp.not_drawn = not_drawn; + Ok(Some(sp)) +} diff --git a/rust/crates/og-render/src/charts/mod.rs b/rust/crates/og-render/src/charts/mod.rs index 814b431b6..1bf958ea1 100644 --- a/rust/crates/og-render/src/charts/mod.rs +++ b/rust/crates/og-render/src/charts/mod.rs @@ -1,13 +1,414 @@ -//! `og report charts`: the chart specs the HTML report embeds and the live -//! site serves, which `bin/report_charts.py` builds today. +//! `og report charts`: the report's five charts, as data and as inline SVG, +//! built once from summary.json for both places a chart is shown: the HTML +//! report puts each SVG in its section, under that section's caveat +//! ([`figure`]), and the live page's charts plugin reads every spec with its +//! SVG from `_charts.json` ([`json`]). //! -//! Not ported yet: until its unit of the 1.0.0 plan lands, the verb says so -//! on stderr and exits 2, before reading any argument. +//! ```text +//! og report charts --summary IN.json [--charts-json OUT.json] +//! ``` +//! +//! It writes what `bin/render_report.py --summary IN.json --charts-json +//! OUT.json` writes, and prints the same last line (the summary's sections +//! counted by state), so the two run with the same arguments. +//! +//! The five charts, each drawn only when its section ran: +//! +//! - `clinvar-stars` (bars): ClinVar hits per review star, 4 to 0, and a +//! grey bar for the low-confidence calls, which the star counts leave out. +//! Yellow and grey only, never green; with no hit a grey frame says that +//! no hit is not an all-clear. +//! - `genome` (ideogram), drawn in the ROH section so only when ROH ran: +//! chromosomes 1 to 22, X and Y of GRCh38 with the runs of homozygosity of +//! 5 MB or more, a tick for each ClinVar hit, an outlined span for each +//! AnnotSV class 4 or 5 SV and a bar under the chromosome for each MoChA +//! call. What has no place on them is counted in `not_drawn`. +//! - `mito` (scatter): the heteroplasmic chrM sites by position and allele +//! fraction, the D-loop poly-C length variants marked apart. +//! - `ancestry-fine` (ranges): each fine-grained ancestry group the report +//! lists, its share as a dot and its bootstrap range as a line. +//! - `prs` (strip): PRS percentiles on a 0 to 100 strip, only when pgsc_calc +//! had an ancestry panel. Without one a raw score has no scale, so the +//! chart is the report's own note (`text`); a score of the other sex, or +//! one with no percentile, says "no percentile" and is never placed. +//! +//! Every caveat comes from [`crate::notes`] by its name, so the chart and the +//! report say the same thing. The SVG has no script, no style attribute and +//! no outside reference: colours are presentation attributes, links are +//! `` inside the page and each mark carries a `` and +//! `data-mark="<id>"`. + +mod build; +mod svg; use std::io::Write; -/// `og report charts ARGS`: not ported yet, so one line on stderr and exit 2. -pub fn cli(_args: &[String], _out: &mut dyn Write, err: &mut dyn Write) -> u8 { - let _ = writeln!(err, "og report charts: not ported yet"); - 2 +use indexmap::IndexMap; +use pycompat::json::{Dump, Value, dumps}; + +use crate::model::{Malformed, Summary, need, py}; + +pub use build::build; +pub use svg::draw; + +/// The `schema_version` of `<sample>_charts.json`. +pub const SCHEMA_VERSION: i128 = 1; + +/// GRCh38 primary assembly lengths (UCSC hg38 chrom.sizes), in the order the +/// genome chart draws them. The live site's family page uses them too. +pub const GRCH38: [(&str, i128); 24] = [ + ("chr1", 248_956_422), + ("chr2", 242_193_529), + ("chr3", 198_295_559), + ("chr4", 190_214_555), + ("chr5", 181_538_259), + ("chr6", 170_805_979), + ("chr7", 159_345_973), + ("chr8", 145_138_636), + ("chr9", 138_394_717), + ("chr10", 133_797_422), + ("chr11", 135_086_622), + ("chr12", 133_275_309), + ("chr13", 114_364_328), + ("chr14", 107_043_718), + ("chr15", 101_991_189), + ("chr16", 90_338_345), + ("chr17", 83_257_441), + ("chr18", 80_373_285), + ("chr19", 58_617_616), + ("chr20", 64_444_167), + ("chr21", 46_709_983), + ("chr22", 50_818_468), + ("chrX", 156_040_895), + ("chrY", 57_227_415), +]; + +/// The length of a GRCh38 primary chromosome, `None` for any other name. +pub fn chrom_len(chrom: &str) -> Option<i128> { + GRCH38.iter().find(|(c, _)| *c == chrom).map(|(_, n)| *n) +} + +/// The length of chrM. +pub const MITO_LEN: i128 = 16569; + +/// The shortest run of homozygosity the genome chart draws, in MB: the runs +/// F_ROH counts (the roh section's own floor). +pub const ROH_MIN_MB: f64 = og_summary::collect::group_c::roh::ROH_MIN_BP / 1e6; + +/// What a mark's colour means: yellow for something to look at, grey for +/// what is not counted, blue for plain information. No green anywhere: a +/// chart is not an all-clear. +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum Tone { + Attention, + Muted, + Info, +} + +impl Tone { + pub fn name(self) -> &'static str { + match self { + Tone::Attention => "attention", + Tone::Muted => "muted", + Tone::Info => "info", + } + } + + pub fn colour(self) -> &'static str { + match self { + Tone::Attention => "#e0b94a", + Tone::Muted => "#8a909b", + Tone::Info => "#5b9ee6", + } + } +} + +/// How a chart is drawn. +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum Kind { + Bars, + Ranges, + Strip, + Text, + Ideogram, + Scatter, +} + +impl Kind { + pub fn name(self) -> &'static str { + match self { + Kind::Bars => "bars", + Kind::Ranges => "ranges", + Kind::Strip => "strip", + Kind::Text => "text", + Kind::Ideogram => "ideogram", + Kind::Scatter => "scatter", + } + } +} + +/// What a mark of the genome or mito chart stands for. +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum MarkKind { + Roh, + Hit, + Sv, + Mca, + Site, + Polyc, +} + +impl MarkKind { + pub fn name(self) -> &'static str { + match self { + MarkKind::Roh => "roh", + MarkKind::Hit => "hit", + MarkKind::Sv => "sv", + MarkKind::Mca => "mca", + MarkKind::Site => "site", + MarkKind::Polyc => "polyc", + } + } +} + +/// One mark of a chart. `value`, `low` and `high` keep the summary's own +/// type (an int stays an int); `null` where they do not apply. +#[derive(Debug, Clone, PartialEq)] +pub struct Mark { + pub id: String, + pub label: String, + pub value: Value, + pub low: Value, + pub high: Value, + pub chrom: Option<String>, + pub pos: Option<i128>, + pub end: Option<i128>, + pub tone: Tone, + /// The id of the report element the mark links to. + pub anchor: Option<String>, + /// `chrom:pos` or `chrom:start-end`, for the genome viewer. + pub locus: Option<String>, + pub detail: String, + /// The heading of the ancestry level the mark belongs to. + pub group: Option<String>, + pub kind: Option<MarkKind>, + /// A genome chart mark of another section carries that section's caveat. + pub caveat: Option<String>, +} + +impl Mark { + /// A mark with nothing but its id, label and value; tone `info`. + pub fn new(id: String, label: String, value: Value) -> Mark { + Mark { + id, + label, + value, + low: Value::Null, + high: Value::Null, + chrom: None, + pos: None, + end: None, + tone: Tone::Info, + anchor: None, + locus: None, + detail: String::new(), + group: None, + kind: None, + caveat: None, + } + } + + fn to_value(&self) -> Value { + let s = |x: &Option<String>| x.clone().map_or(Value::Null, Value::Str); + let i = |x: Option<i128>| x.map_or(Value::Null, Value::Int); + let mut m = IndexMap::new(); + m.insert("id".into(), Value::Str(self.id.clone())); + m.insert("label".into(), Value::Str(self.label.clone())); + m.insert("value".into(), self.value.clone()); + m.insert("low".into(), self.low.clone()); + m.insert("high".into(), self.high.clone()); + m.insert("chrom".into(), s(&self.chrom)); + m.insert("pos".into(), i(self.pos)); + m.insert("end".into(), i(self.end)); + m.insert("tone".into(), Value::Str(self.tone.name().into())); + m.insert("anchor".into(), s(&self.anchor)); + m.insert("locus".into(), s(&self.locus)); + m.insert("detail".into(), Value::Str(self.detail.clone())); + if let Some(g) = &self.group { + m.insert("group".into(), Value::Str(g.clone())); + } + if let Some(k) = self.kind { + m.insert("kind".into(), Value::Str(k.name().into())); + } + if let Some(c) = &self.caveat { + m.insert("caveat".into(), Value::Str(c.clone())); + } + Value::Object(m) + } +} + +/// Something a chart has no place for, and how many. +#[derive(Debug, Clone, PartialEq)] +pub struct NotDrawn { + pub what: String, + pub count: i128, +} + +/// One chart: its data and its SVG. +#[derive(Debug, Clone, PartialEq)] +pub struct Spec { + pub id: &'static str, + /// The summary section whose data it shows. + pub section: &'static str, + pub kind: Kind, + pub title: &'static str, + /// The name of its caveat in [`crate::notes`], and that caveat's text. + pub caveat_key: &'static str, + pub caveat: &'static str, + pub axis: IndexMap<String, Value>, + pub marks: Vec<Mark>, + pub not_drawn: Vec<NotDrawn>, + /// The text a `text` chart shows. + pub text: Option<String>, + /// The chart drawn ([`draw`]). + pub svg: String, +} + +impl Spec { + /// The spec as `<sample>_charts.json` holds it. + pub fn to_value(&self) -> Value { + let mut m = IndexMap::new(); + m.insert("id".into(), Value::Str(self.id.into())); + m.insert("section".into(), Value::Str(self.section.into())); + m.insert("kind".into(), Value::Str(self.kind.name().into())); + m.insert("title".into(), Value::Str(self.title.into())); + m.insert("caveat_key".into(), Value::Str(self.caveat_key.into())); + m.insert("caveat".into(), Value::Str(self.caveat.into())); + m.insert("axis".into(), Value::Object(self.axis.clone())); + m.insert( + "marks".into(), + Value::Array(self.marks.iter().map(Mark::to_value).collect()), + ); + let nd = self.not_drawn.iter().map(|x| { + let mut o = IndexMap::new(); + o.insert("what".into(), Value::Str(x.what.clone())); + o.insert("count".into(), Value::Int(x.count)); + Value::Object(o) + }); + m.insert("not_drawn".into(), Value::Array(nd.collect())); + if let Some(t) = &self.text { + m.insert("text".into(), Value::Str(t.clone())); + } + m.insert("svg".into(), Value::Str(self.svg.clone())); + Value::Object(m) + } +} + +/// The HTML report's line for a chart, which goes into its section right +/// under its caveat; `None` for a `text` chart, which is the note the card +/// already prints (the live page shows it). +pub fn figure(spec: &Spec) -> Option<String> { + (spec.kind != Kind::Text).then(|| format!(" <figure class=\"chart\">{}</figure>", spec.svg)) +} + +/// `<sample>_charts.json`: the schema version, the sample, when the summary +/// was made and the charts. +pub fn json(s: &Summary) -> Result<Value, Malformed> { + let mut m = IndexMap::new(); + m.insert("schema_version".into(), Value::Int(SCHEMA_VERSION)); + m.insert("sample".into(), s.need("sample")?.clone()); + m.insert("generated_utc".into(), s.need("generated_utc")?.clone()); + let charts = build(s)?.iter().map(Spec::to_value).collect(); + m.insert("charts".into(), Value::Array(charts)); + Ok(Value::Object(m)) +} + +const USAGE: &str = "usage: og report charts --summary IN.json [--charts-json OUT.json]"; + +/// The arguments: the summary, and where to write the charts. +fn parse(args: &[String]) -> Result<(String, Option<String>), String> { + let (mut summary, mut out) = (None, None); + let mut it = args.iter(); + while let Some(arg) = it.next() { + let (name, inline) = match arg.split_once('=') { + Some((n, v)) if n.starts_with("--") => (n, Some(v.to_owned())), + _ => (arg.as_str(), None), + }; + let mut value = || { + inline + .clone() + .or_else(|| it.next().cloned()) + .ok_or_else(|| format!("argument {name}: expected one argument")) + }; + match name { + "--summary" => summary = Some(value()?), + "--charts-json" => out = Some(value()?), + n => return Err(format!("unrecognized arguments: {n}")), + } + } + Ok((summary.ok_or("give --summary")?, out)) +} + +/// `Sections: missing 28, ok 20`: the sections counted by state, as `og +/// report render` and `bin/render_report.py` end. +fn state_counts(s: &Summary) -> Result<String, Malformed> { + let Some(Value::Object(secs)) = s.get("sections") else { + return Err(Malformed("summary.sections is not an object".into())); + }; + let mut counts: Vec<(String, usize)> = Vec::new(); + for (key, sec) in secs { + let state = py(need(sec, "state", &format!("sections.{key}"))?)?; + match counts.iter_mut().find(|(k, _)| *k == state) { + Some((_, n)) => *n += 1, + None => counts.push((state, 1)), + } + } + counts.sort(); + let parts: Vec<String> = counts.iter().map(|(k, n)| format!("{k} {n}")).collect(); + Ok(format!("Sections: {}", parts.join(", "))) +} + +fn write(path: &str, body: &str) -> std::io::Result<()> { + let mut f = og_io::AtomicFile::create(path)?; + f.write_all(body.as_bytes())?; + f.commit() +} + +/// `og report charts ARGS`. +pub fn cli(args: &[String], out: &mut dyn Write, err: &mut dyn Write) -> u8 { + if args.iter().any(|a| a == "-h" || a == "--help") { + let _ = writeln!(out, "{USAGE}"); + return 0; + } + let (path, dest) = match parse(args) { + Ok(a) => a, + Err(why) => { + let _ = writeln!(err, "{USAGE}\nog report charts: error: {why}"); + return 2; + } + }; + let run = || -> Result<String, String> { + let text = std::fs::read_to_string(&path).map_err(|e| format!("{path}: {e}"))?; + let s = Summary::parse(&text).map_err(|e| format!("{path}: {e}"))?; + if let Some(dest) = &dest { + let v = json(&s).map_err(|e| format!("{path}: {e}"))?; + let opts = Dump { + indent: Some(1), + ..Dump::default() + }; + let body = dumps(&v, &opts).map_err(|e| format!("{path}: {e:?}"))? + "\n"; + write(dest, &body).map_err(|e| format!("{dest}: {e}"))?; + } + state_counts(&s).map_err(|e| format!("{path}: {e}")) + }; + match run() { + Ok(line) => { + let _ = writeln!(out, "{line}"); + 0 + } + Err(why) => { + let _ = writeln!(err, "og report charts: {why}"); + 1 + } + } } diff --git a/rust/crates/og-render/src/charts/svg.rs b/rust/crates/og-render/src/charts/svg.rs new file mode 100644 index 000000000..1a7bdf19c --- /dev/null +++ b/rust/crates/og-render/src/charts/svg.rs @@ -0,0 +1,582 @@ +//! Each chart as inline SVG, the same bytes `bin/report_charts.py` drew: a +//! coordinate with one decimal at most, the arithmetic in Python's order, and +//! `min` and `max` with Python's rules (a NaN passed second never wins). +//! +//! Text uses `currentColor`, so it follows the page's colour on screen and +//! in print. + +use pycompat::fmt::{fixed, general}; +use pycompat::json::Value; +use pycompat::text::html_escape; + +use super::{GRCH38, Kind, MITO_LEN, Mark, MarkKind, Spec, Tone, chrom_len}; +use crate::model::{Malformed, num, py}; + +/// The SVG's width; its height follows the content. +const W: f64 = 640.0; +const FRAME: &str = "#8a909b"; +const LINE: &str = "#4a505b"; + +fn e(s: &str) -> String { + html_escape(s).into_owned() +} + +/// Python's `min(a, b)`: `b` only when `b < a`. +fn pmin(a: f64, b: f64) -> f64 { + if b < a { b } else { a } +} + +/// Python's `max(a, b)`: `b` only when `b > a`. +fn pmax(a: f64, b: f64) -> f64 { + if b > a { b } else { a } +} + +/// A coordinate: one decimal, trailing zeros and point dropped. +fn f(x: f64) -> Result<String, Malformed> { + if !x.is_finite() { + return Err(Malformed(format!( + "a chart coordinate is {}, not a number", + pycompat::fmt::repr(x) + ))); + } + let s = fixed(x, 1); + Ok(s.trim_end_matches('0').trim_end_matches('.').to_owned()) +} + +struct Text<'a> { + size: u32, + anchor: &'a str, + extra: &'a str, +} + +const PLAIN: Text<'static> = Text { + size: 12, + anchor: "start", + extra: "", +}; + +fn text(x: f64, y: f64, s: &str, t: &Text<'_>) -> Result<String, Malformed> { + Ok(format!( + "<text x=\"{}\" y=\"{}\" font-size=\"{}\" text-anchor=\"{}\" fill=\"currentColor\"{}>{}</text>", + f(x)?, + f(y)?, + t.size, + t.anchor, + t.extra, + e(s) + )) +} + +fn sized(size: u32, anchor: &str) -> Text<'_> { + Text { + size, + anchor, + extra: "", + } +} + +/// A mark: a link to its anchor in the report, with its title and id. +fn a(m: &Mark, inner: &str) -> String { + let title = if m.detail.is_empty() { + m.label.clone() + } else { + format!("{}: {}", m.label, m.detail) + }; + format!( + "<a href=\"#{}\" data-mark=\"{}\"><title>{}{inner}", + e(m.anchor.as_deref().unwrap_or("")), + e(&m.id), + e(&title) + ) +} + +fn open(sp: &Spec, h: f64) -> Result { + Ok(format!( + "{}", + e(sp.id), + f(h)?, + e(sp.title), + e(sp.title) + )) +} + +/// Words of `s` in lines of at most `n` characters (a longer word alone). +fn wrap(s: &str, n: usize) -> Vec { + let mut lines = Vec::new(); + let mut cur = String::new(); + for w in pycompat::text::split(s, None, None) { + if !cur.is_empty() && cur.chars().count() + 1 + w.chars().count() > n { + lines.push(std::mem::replace(&mut cur, w.to_owned())); + } else { + cur = if cur.is_empty() { + w.to_owned() + } else { + format!("{cur} {w}") + }; + } + } + if !cur.is_empty() { + lines.push(cur); + } + lines +} + +/// The "Not drawn:" lines under a chart, from `y`, and the y after them. +fn footer(sp: &Spec, y: f64) -> Result<(String, f64), Malformed> { + if sp.not_drawn.is_empty() { + return Ok((String::new(), y)); + } + let parts: Vec = sp + .not_drawn + .iter() + .map(|x| format!("{} {}", x.count, x.what)) + .collect(); + let lines = wrap(&format!("Not drawn: {}.", parts.join("; ")), 100); + let t = Text { + size: 11, + anchor: "start", + extra: " opacity=\"0.75\"", + }; + let mut out = String::new(); + for (i, s) in lines.iter().enumerate() { + out += &text(8.0, y + 14.0 * i as f64, s, &t)?; + } + Ok((out, y + 14.0 * lines.len() as f64)) +} + +/// A mark's value as a number, 0 for `null` (Python's `value or 0`). +fn value(m: &Mark) -> Result { + match &m.value { + Value::Null => Ok(0.0), + v => num(Some(v)) + .ok_or_else(|| Malformed(format!("mark {}: the value is not a number", m.id))), + } +} + +/// A label cut to 40 characters. +fn short(label: &str) -> String { + if label.chars().count() <= 40 { + label.to_owned() + } else { + label.chars().take(38).collect::() + "..." + } +} + +fn bars(sp: &Spec) -> Result { + let vals: Vec = sp.marks.iter().map(value).collect::>()?; + if vals.iter().sum::() == 0.0 { + let h = 96.0; + return Ok(open(sp, h)? + + &format!( + "", + W - 2.0, + h - 2.0 + ) + + &text( + W / 2.0, + 40.0, + "No ClinVar hit in this sample.", + &sized(14, "middle"), + )? + + &text( + W / 2.0, + 64.0, + "No hit is not an all-clear: the screen reads only the variants ClinVar lists.", + &sized(12, "middle"), + )? + + ""); + } + let top = vals.iter().copied().fold(vals[0], pmax); + if top == 0.0 { + return Err(Malformed("ClinVar chart: no bar above 0".into())); + } + let (left, right, row) = (190.0, 60.0, 26.0); + let h = 16.0 + row * sp.marks.len() as f64 + 8.0; + let mut body = String::new(); + for (i, (m, v)) in sp.marks.iter().zip(&vals).enumerate() { + let y = 12.0 + i as f64 * row; + let wbar = (W - left - right) * v / top; + let bar = if *v != 0.0 { + format!( + "", + f(y)?, + f(pmax(wbar, 0.0))?, + m.tone.colour() + ) + } else { + format!( + "", + f(y)? + ) + }; + let inner = text(left - 8.0, y + 13.0, &m.label, &sized(12, "end"))? + + &bar + + &text( + left + pmax(wbar, 2.0) + 6.0, + y + 13.0, + &py(&m.value)?, + &PLAIN, + )?; + body += &a(m, &inner); + } + let (foot, h2) = footer(sp, h + 4.0)?; + Ok(open(sp, h2 + 4.0)? + &body + &foot + "") +} + +/// The ticks of a 0 to 100 axis, at `x(t)`. +fn ticks(x: impl Fn(f64) -> f64, label: impl Fn(u32) -> String) -> Result { + let mut out = String::new(); + for t in [0, 25, 50, 75, 100] { + out += &text(x(f64::from(t)), 10.0, &label(t), &sized(10, "middle"))?; + } + Ok(out) +} + +fn ranges(sp: &Spec) -> Result { + let (left, right, row) = (260.0, 50.0, 22.0); + let (x0, x1) = (left, W - right); + let sx = |v: f64| x0 + (x1 - x0) * pmax(0.0, pmin(100.0, v)) / 100.0; + let info = Tone::Info.colour(); + let mut y = 22.0; + let mut body = String::new(); + let mut group: Option<&str> = None; + let axis = format!("") + + &ticks(sx, |t| format!("{t}%"))?; + for m in &sp.marks { + if m.group.as_deref() != group { + group = m.group.as_deref(); + y += 6.0; + let bold = Text { + size: 12, + anchor: "start", + extra: " font-weight=\"600\"", + }; + body += &text(8.0, y + 10.0, group.unwrap_or("None"), &bold)?; + y += row; + } + let cy = y + 6.0; + let v = value(m)?; + let mut inner = text(left - 8.0, cy + 4.0, &short(&m.label), &sized(12, "end"))?; + if let (Some(lo), Some(hi)) = (num(Some(&m.low)), num(Some(&m.high))) { + inner += &format!( + "", + f(sx(lo))?, + f(cy)?, + f(sx(hi))?, + f(cy)? + ); + } + inner += &format!( + "", + f(sx(v))?, + f(cy)? + ); + inner += &text( + x1 + 6.0, + cy + 4.0, + &format!("{}%", fixed(v, 0)), + &sized(11, "start"), + )?; + body += &a(m, &inner); + y += row; + } + Ok(open(sp, y + 8.0)? + &axis + &body + "") +} + +fn strip(sp: &Spec) -> Result { + let (left, right, row) = (260.0, 120.0, 24.0); + let (x0, x1) = (left, W - right); + let sx = |v: f64| x0 + (x1 - x0) * v / 100.0; + let mut body = format!("") + + &ticks(sx, |t| t.to_string())?; + let mut y = 26.0; + for m in &sp.marks { + let cy = y + 6.0; + let mut inner = text(left - 8.0, cy + 4.0, &short(&m.label), &sized(12, "end"))?; + inner += &format!( + "", + f(cy)?, + f(cy)? + ); + if matches!(m.value, Value::Null) { + let faint = Text { + size: 11, + anchor: "start", + extra: " opacity=\"0.8\"", + }; + inner += &text(x0 + 4.0, cy + 4.0, "no percentile", &faint)?; + } else { + let v = value(m)?; + inner += &format!( + "", + f(sx(v))?, + f(cy)?, + m.tone.colour() + ); + inner += &text(x1 + 8.0, cy + 4.0, &general(v, 6), &sized(11, "start"))?; + } + body += &a(m, &inner); + y += row; + } + Ok(open(sp, y + 8.0)? + &body + "") +} + +fn text_chart(sp: &Spec) -> Result { + let lines = wrap(sp.text.as_deref().unwrap_or(""), 95); + let h = 20.0 + 16.0 * lines.len() as f64; + let mut out = open(sp, h)? + + &format!( + "", + W - 2.0, + f(h - 2.0)? + ); + for (i, s) in lines.iter().enumerate() { + out += &text(12.0, 20.0 + 16.0 * i as f64, s, &PLAIN)?; + } + Ok(out + "") +} + +fn ideogram(sp: &Spec) -> Result { + let (left, right, row) = (46.0, 16.0, 18.0); + let (x0, x1) = (left, W - right); + let top = GRCH38.iter().map(|(_, n)| *n).max().unwrap_or(1) as f64; + let sx = |bp: f64| x0 + (x1 - x0) * bp / top; + let row_y = |c: &str| { + GRCH38 + .iter() + .position(|(n, _)| *n == c) + .map(|i| 10 + i as i64 * 18) + }; + let (attention, info) = (Tone::Attention.colour(), Tone::Info.colour()); + let mut body = String::new(); + for (i, (c, n)) in GRCH38.iter().enumerate() { + let y = 10 + i as i64 * row as i64; + body += &text(left - 6.0, (y + 9) as f64, &c[3..], &sized(10, "end"))?; + body += &format!( + "", + y + 2, + f(sx(*n as f64) - x0)? + ); + } + for m in &sp.marks { + let chrom = m.chrom.as_deref().unwrap_or(""); + let (Some(y), Some(len)) = (row_y(chrom), chrom_len(chrom)) else { + return Err(Malformed(format!( + "mark {}: {chrom} is not a GRCh38 chromosome", + m.id + ))); + }; + let (lo, hi) = (x0, sx(len as f64)); + // The x of a mark w px wide, moved inside its chromosome's outline. + let inside = |a: f64, w: f64| pmax(lo, pmin(a, hi - w)); + let pos = m.pos.unwrap_or(0) as f64; + let span = || { + let a = sx(pos); + let b = sx(m.end.unwrap_or(0) as f64); + (a, b) + }; + let inner = match m.kind { + Some(MarkKind::Roh) => { + let (a, b) = span(); + let w = pmax(b - a, 1.5); + format!( + "", + f(inside(a, w))?, + y + 2, + f(w)? + ) + } + Some(MarkKind::Sv) => { + // An outlined span over the chromosome, at least 5 px so a small deletion is seen. + let (a, b) = span(); + let w = pmax(b - a, 5.0); + format!( + "", + f(inside(a - (w - (b - a)) / 2.0, w))?, + y - 1, + f(w)? + ) + } + Some(MarkKind::Mca) => { + // A bar under the chromosome: a share of the cells, not the whole genome. + let (a, b) = span(); + let w = pmax(b - a, 3.0); + format!( + "", + f(inside(a, w))?, + y + 12, + f(w)? + ) + } + _ => format!( + "", + f(inside(sx(pos) - 1.5, 3.0))?, + y - 1, + m.tone.colour() + ), + }; + body += &a(m, &inner); + } + let mut y = 10 + GRCH38.len() as i64 * row as i64 + 6; + let small = sized(11, "start"); + let mut legend = + format!("") + + &text( + x0 + 20.0, + (y + 8) as f64, + "run of homozygosity, 5 MB or more", + &small, + )? + + &format!( + "", + x0 + 250.0, + y - 2 + ) + + &text(x0 + 258.0, (y + 8) as f64, "ClinVar hit", &small)? + + &format!( + "", + x0 + 340.0, + y - 2, + Tone::Muted.colour() + ) + + &text( + x0 + 348.0, + (y + 8) as f64, + "low-confidence ClinVar call", + &small, + )?; + let has = |k: MarkKind| sp.marks.iter().any(|m| m.kind == Some(k)); + if has(MarkKind::Sv) || has(MarkKind::Mca) { + // A second legend row, drawn only when the chart has these marks. + y += 18; + if has(MarkKind::Sv) { + legend += &format!( + "", + y - 2 + ); + legend += &text(x0 + 20.0, (y + 8) as f64, "AnnotSV class 4 or 5 SV", &small)?; + } + if has(MarkKind::Mca) { + legend += &format!( + "", + x0 + 250.0, + y + 4 + ); + legend += &text( + x0 + 270.0, + (y + 8) as f64, + "mosaic alteration (MoChA), a share of cells", + &small, + )?; + } + } + let (foot, h) = footer(sp, (y + 26) as f64)?; + Ok(open(sp, h + 4.0)? + &body + &legend + &foot + "") +} + +fn scatter(sp: &Spec) -> Result { + let (left, right, tp, bottom) = (44.0, 16.0, 12.0, 30.0); + let h = 200.0; + let (x0, x1, y0, y1) = (left, W - right, tp, h - bottom); + let sx = |p: f64| x0 + (x1 - x0) * (p - 1.0) / (MITO_LEN - 1) as f64; + let sy = |af: f64| y1 - (y1 - y0) * pmax(0.0, pmin(1.0, af)); + let muted = Tone::Muted.colour(); + let mut body = format!( + "", + x1 - x0, + y1 - y0 + ); + for t in [0.0, 0.5, 1.0] { + body += &text(x0 - 6.0, sy(t) + 4.0, &general(t, 6), &sized(10, "end"))?; + } + for (t, anchor) in [ + (1, "start"), + (4000, "middle"), + (8000, "middle"), + (12000, "middle"), + (MITO_LEN, "end"), + ] { + body += &text( + sx(t as f64), + y1 + 14.0, + &format!("m.{t}"), + &sized(10, anchor), + )?; + } + let faint = Text { + size: 10, + anchor: "middle", + extra: " opacity=\"0.8\"", + }; + body += &text( + (x0 + x1) / 2.0, + h - 2.0, + "position on chrM; height: allele fraction", + &faint, + )?; + for (lo, hi) in [(303.0, 315.0), (16184.0, 16193.0)] { + body += &format!( + "", + f(sx(lo) - 1.0)?, + f(pmax(sx(hi) - sx(lo), 2.0))?, + y1 - y0 + ); + } + let missing = sp + .axis + .get("sites_missing") + .is_some_and(crate::model::truthy); + let mid = ((x0 + x1) / 2.0, (y0 + y1) / 2.0); + if missing { + body += &text( + mid.0, + mid.1, + "The positions of the heteroplasmic sites are not in this summary", + &sized(12, "middle"), + )?; + } else if sp.marks.is_empty() { + body += &text( + mid.0, + mid.1, + "No heteroplasmic site between allele fraction 0.05 and 0.95", + &sized(12, "middle"), + )?; + } + for m in &sp.marks { + let (x, y) = (sx(m.pos.unwrap_or(0) as f64), sy(value(m)?)); + let inner = if m.kind == Some(MarkKind::Polyc) { + format!( + "", + f(x - 4.0)?, + f(y - 4.0)? + ) + } else { + format!( + "", + f(x)?, + f(y)?, + Tone::Attention.colour() + ) + }; + body += &a(m, &inner); + } + let (foot, h2) = footer(sp, h + 10.0)?; + Ok(open(sp, h2 + 4.0)? + &body + &foot + "") +} + +/// The chart drawn as SVG, by its kind. +pub fn draw(sp: &Spec) -> Result { + match sp.kind { + Kind::Bars => bars(sp), + Kind::Ranges => ranges(sp), + Kind::Strip => strip(sp), + Kind::Text => text_chart(sp), + Kind::Ideogram => ideogram(sp), + Kind::Scatter => scatter(sp), + } +} diff --git a/rust/crates/og-render/src/index.rs b/rust/crates/og-render/src/index.rs index 5f7797a74..3f74d8619 100644 --- a/rust/crates/og-render/src/index.rs +++ b/rust/crates/og-render/src/index.rs @@ -450,6 +450,13 @@ pub fn build( if !matches!(s.get("state"), Some(Value::Str(st)) if st == "ok" || st == "stale") { continue; } + // The ACMG card of its own section is the card the clinical section + // also holds (`clinical.data.acmg_sf`), which the index already reads. + // Skip it so a gene is not listed twice, until the report readers + // move from the nested card to this section (i411-display-sf). + if key == "acmg_sf" { + continue; + } let field = |k: &str| s.get(k).cloned().unwrap_or(Value::Null); let mut add = |term: &str, txt: &str, locus: Option<&str>| { let items = terms.entry(term.to_owned()).or_default(); diff --git a/rust/crates/og-render/tests/charts.rs b/rust/crates/og-render/tests/charts.rs new file mode 100644 index 000000000..602f93b44 --- /dev/null +++ b/rust/crates/og-render/tests/charts.rs @@ -0,0 +1,852 @@ +//! The report's charts (og report charts), on the invented sections of +//! tests/fixtures/report_charts/sections.json and on changed copies of them. +//! Checks 1 to 6 moved here from tests/test_report_charts.py; each check +//! runs on a broken input too and must catch it. The HTML report's chart +//! placement (old check 7, bar the anchor of a hit past the table) and the +//! two-render check of bin/render_report.py (old check 8) stay in that file +//! until og report render embeds the figures. +//! +//! 1. ClinVar: one bar per star 4 to 0 with the by_stars count, then a grey +//! bar with the low-confidence count; no green; with no hit a grey frame +//! says that no hit is not an all-clear. A hit past the 50-row table links +//! to the section. +//! 2. PRS: no strip without a panel, only the report's note; with a panel a +//! score with no percentile, or one of the other sex, says "no +//! percentile" and gets no dot. +//! 3. Fine-grained ancestry: the groups are the ones the report lists, and +//! each dot lies inside its range line. +//! 4. Genome: an unreadable run of homozygosity stops the chart; a run under +//! 5 MB is not drawn; hits on chrM and on alt contigs, SVs and MoChA calls +//! with no place are counted in not_drawn; every mark is drawn inside its +//! chromosome's outline. +//! 5. Mito: one dot per heteroplasmic site, the poly-C call marked apart. +//! 6. Every caveat is the report's own, and no caveat sentence is written in +//! the charts' source. +//! 7. The charts JSON is what bin/report_charts.py wrote, byte for byte, on +//! the fixture and its changed copies (frozen as hashes of the oracle's +//! files), the same on every run, and the report paths write it. + +use std::path::{Path, PathBuf}; + +use og_render::charts::{self, GRCH38, Kind, MarkKind, Spec, build, chrom_len, draw, figure, json}; +use og_render::model::Summary; +use og_render::notes; +use og_render::sections::{ancestry_fine, prs}; +use pycompat::json::{Dump, Value, dumps, loads}; + +const GREENS: [&str; 5] = ["#d5f5e3", "#1d3b2a", "#8ee0ae", "#196f3d", "green"]; + +fn repo() -> PathBuf { + Path::new(env!("CARGO_MANIFEST_DIR")).join("../../..") +} + +/// The fixture as a summary value: sample S, a fixed clock and its sections. +fn fixture() -> Value { + let text = + std::fs::read_to_string(repo().join("tests/fixtures/report_charts/sections.json")).unwrap(); + let f = loads(&text).unwrap(); + let Value::Object(o) = f else { panic!() }; + let mut s = indexmap::IndexMap::new(); + s.insert("sample".to_owned(), Value::Str("S".into())); + s.insert( + "generated_utc".to_owned(), + Value::Str("2026-01-01 00:00 UTC".into()), + ); + s.insert("sections".to_owned(), o["sections"].clone()); + Value::Object(s) +} + +/// `v[a][b]...` for changing a copy. +fn at<'a>(v: &'a mut Value, path: &[&str]) -> &'a mut Value { + path.iter().fold(v, |v, k| match v { + Value::Object(o) => o.get_mut(*k).unwrap_or_else(|| panic!("no {k}")), + Value::Array(a) => &mut a[k.parse::().unwrap()], + _ => panic!("{k}: not a container"), + }) +} + +fn set(v: &mut Value, path: &[&str], x: &str) { + let (last, head) = path.split_last().unwrap(); + let Value::Object(o) = at(v, head) else { + panic!() + }; + o.insert((*last).to_owned(), loads(x).unwrap()); +} + +fn summary(v: &Value) -> Summary { + Summary::parse(&dumps(v, &Dump::default()).unwrap()).unwrap() +} + +fn charts_of(v: &Value) -> Vec { + build(&summary(v)).expect("the charts") +} + +fn chart(v: &Value, id: &str) -> Spec { + charts_of(v) + .into_iter() + .find(|c| c.id == id) + .unwrap_or_else(|| panic!("no chart {id}")) +} + +fn data<'a>(v: &'a Value, sec: &str) -> &'a Value { + let Value::Object(o) = v else { panic!() }; + let Value::Object(s) = &o["sections"] else { + panic!() + }; + let Value::Object(x) = &s[sec] else { panic!() }; + &x["data"] +} + +fn int(v: &Value) -> f64 { + match v { + Value::Int(i) => *i as f64, + Value::Float(x) => *x, + Value::Str(s) => s.parse().unwrap(), + _ => panic!("{v:?}"), + } +} + +fn num(v: &Value) -> Option { + match v { + Value::Null => None, + v => Some(int(v)), + } +} + +/// The number in attribute `name` of an SVG element's text `piece`. +fn attr(piece: &str, name: &str) -> Option { + let k = format!(" {name}=\""); + let piece = format!(" {piece}"); + let i = piece.find(&k)? + k.len(); + piece[i..].split('"').next()?.parse().ok() +} + +fn redraw(sp: &mut Spec) { + sp.svg = draw(sp).unwrap(); +} + +// --- the detectors, each also run on a broken input --------------------------------------- + +fn clinvar_problems(sp: &Spec, d: &Value) -> Vec { + let mut out = Vec::new(); + let Value::Object(o) = d else { panic!() }; + let Value::Object(by) = &o["by_stars"] else { + panic!() + }; + let mut want: Vec = ["4", "3", "2", "1", "0"] + .iter() + .map(|k| int(&by[*k])) + .collect(); + want.push(int(&o["low_confidence"])); + let got: Vec = sp.marks.iter().map(|m| int(&m.value)).collect(); + if got != want { + out.push(format!( + "bars {got:?} != by_stars and low_confidence {want:?}" + )); + } + if sp.marks.last().unwrap().tone != charts::Tone::Muted { + out.push("the low-confidence bar is not grey".into()); + } + let low = sp.svg.to_lowercase(); + for g in GREENS { + if low.contains(g) { + out.push(format!("green {g} in the chart")); + } + } + out +} + +/// A dot per score with a percentile of the declared sex, "no percentile" +/// for the others. +fn prs_problems(sp: &Spec, scores: &[Value]) -> Vec { + let mut out = Vec::new(); + for (m, r) in sp.marks.iter().zip(scores) { + let Value::Object(r) = r else { panic!() }; + let pct = &r["percentile"]; + let placeable = !matches!(pct, Value::Str(s) if s.is_empty()) + && !matches!(&r["sex_check"], Value::Str(s) if s == prs::NOT_APPLICABLE); + if placeable && num(&m.value) != Some(int(pct)) { + out.push(format!( + "{}: value {:?} is not the percentile", + m.id, m.value + )); + } + if !placeable && num(&m.value).is_some() { + out.push(format!( + "{}: placed with no percentile of the declared sex", + m.id + )); + } + } + let dots = sp.svg.matches("no percentile").count() != sp.marks.len() - want { + out.push("not every score without a percentile says 'no percentile'".into()); + } + out +} + +/// Each mark with a range: its dot between the two ends of its line. +fn whisker_problems(svg: &str) -> Vec { + let mut out = Vec::new(); + for g in svg.split("").next().unwrap(); + let (Some(line), Some(dot)) = (g.find("class=\"whisker\""), g.find(" String { + if c.starts_with("chr") { + c.to_owned() + } else { + format!("chr{c}") + } +} + +/// What the genome chart misses of the AnnotSV rows and MoChA calls on the +/// primary chromosomes. +fn sv_mca_problems(sp: &Spec, svs: &[(&str, bool)], mcas: &[bool]) -> Vec { + let mut out = Vec::new(); + let mark = |id: &str| sp.marks.iter().find(|m| m.id == id); + for (i, (sv, _)) in svs.iter().enumerate() { + if chrom_len(&with_chr(sv.split(':').next().unwrap())).is_none() { + continue; + } + let id = format!("sv-{i}"); + if mark(&id).is_none_or(|m| m.anchor.as_deref() != Some("structural-variants")) + || !sp.svg.contains(&format!("data-mark=\"{id}\"")) + { + out.push(format!("AnnotSV row {sv} not drawn")); + } + } + for (i, placeable) in mcas.iter().enumerate() { + let id = format!("mca-{i}"); + if !placeable { + if mark(&id).is_some() { + out.push(format!( + "MoChA call {i} drawn, but it has no place on the chart" + )); + } + continue; + } + if mark(&id).is_none_or(|m| m.anchor.as_deref() != Some("mosaic-mca")) + || !sp.svg.contains(&format!("data-mark=\"{id}\"")) + { + out.push(format!("MoChA call {i} not drawn")); + } + } + if sp.svg.matches("class=\"sv\"").count() != svs.iter().filter(|(_, p)| *p).count() { + out.push("the outlined spans do not match the rows".into()); + } + if sp.svg.matches("class=\"mca\"").count() != mcas.iter().filter(|p| **p).count() { + out.push("the bars do not match the calls".into()); + } + out +} + +/// The marks of an ideogram drawn past either end of their chromosome's +/// outline: each mark's y is its row's plus a fixed offset per kind. +fn outside_marks(svg: &str) -> Vec { + let mut rows = Vec::new(); + for p in svg.split("").next().unwrap(); + if p.contains("height=\"8\" rx=\"4\" fill=\"none\"") { + let (x, y, w) = ( + attr(p, "x").unwrap(), + attr(p, "y").unwrap(), + attr(p, "width").unwrap(), + ); + rows.push((y - 2.0, x, x + w)); + } + } + let mut out = Vec::new(); + for p in svg.split(" 2.0, + "sv" | "tick" => -1.0, + "mca" => 12.0, + _ => continue, + }; + let p = p.split("/>").next().unwrap(); + let (x, y, w) = ( + attr(p, "x").unwrap(), + attr(p, "y").unwrap(), + attr(p, "width").unwrap(), + ); + match rows.iter().find(|(ry, _, _)| (ry - (y - off)).abs() < 0.01) { + Some((_, lo, hi)) if x >= lo - 0.01 && x + w <= hi + 0.01 => {} + _ => out.push(format!("{kind} at x={x} y={y} width={w}")), + } + } + out +} + +/// Caveat sentences written into a source file instead of taken from notes. +fn note_literals(src: &str) -> Vec { + let mut found: Vec = notes::NOTES + .iter() + .filter(|(_, t)| t.len() > 30 && src.contains(&t[..30])) + .map(|(k, _)| (*k).to_owned()) + .collect(); + if src.lines().any(|l| l.contains("_NOTE: &str =")) { + found.push("a *_NOTE constant".into()); + } + found +} + +// --- the checks --------------------------------------------------------------------------- + +#[test] +fn clinvar_bars_count_the_stars_in_yellow_and_grey() { + let s = fixture(); + let cv = chart(&s, "clinvar-stars"); + let d = data(&s, "clinvar"); + assert_eq!(clinvar_problems(&cv, d), Vec::::new()); + assert!( + cv.marks + .iter() + .all(|m| matches!(m.tone, charts::Tone::Attention | charts::Tone::Muted)) + ); + // Red controls: a green bar, and a bar off by one. + let mut green = cv.clone(); + green.svg = green + .svg + .replace(charts::Tone::Attention.colour(), "#d5f5e3"); + assert!(!clinvar_problems(&green, d).is_empty()); + let mut off = cv.clone(); + off.marks[1].value = Value::Int(int(&off.marks[1].value) as i128 + 1); + assert!(!clinvar_problems(&off, d).is_empty()); +} + +#[test] +fn no_clinvar_hit_is_a_grey_frame_that_is_not_an_all_clear() { + let mut z = fixture(); + set( + &mut z, + &["sections", "clinvar", "data", "by_stars"], + r#"{"4":0,"3":0,"2":0,"1":0,"0":0}"#, + ); + set(&mut z, &["sections", "clinvar", "data", "hits"], "[]"); + set(&mut z, &["sections", "clinvar", "data", "count"], "0"); + set( + &mut z, + &["sections", "clinvar", "data", "low_confidence"], + "0", + ); + let svg = chart(&z, "clinvar-stars").svg; + assert!(svg.contains("No hit is not an all-clear"), "{svg}"); + assert!(!svg.contains(" = g + .marks + .iter() + .filter(|m| m.kind == Some(MarkKind::Hit)) + .collect(); + let want: Vec<&str> = ticks + .iter() + .map(|m| { + if row(m.locus.as_deref().unwrap()) < 50 { + "clinvar-hits" + } else { + "clinvar" + } + }) + .collect(); + let got: Vec<&str> = ticks.iter().map(|m| m.anchor.as_deref().unwrap()).collect(); + assert_eq!(got, want); + assert!(want.contains(&"clinvar")); +} + +#[test] +fn prs_strip_places_only_percentiles_of_the_declared_sex() { + let s = fixture(); + let pr = chart(&s, "prs"); + let Value::Object(d) = data(&s, "prs") else { + panic!() + }; + let Value::Array(scores) = &d["scores"] else { + panic!() + }; + assert_eq!(pr.kind, Kind::Strip); + assert_eq!(prs_problems(&pr, scores), Vec::::new()); + // Red controls: the raw Score_SUM drawn as a dot, and the other sex's percentile. + let field = |i: usize, k: &str| { + let Value::Object(r) = &scores[i] else { + panic!() + }; + int(&r[k]) + }; + let mut raw = pr.clone(); + raw.marks[1].value = Value::Float(field(1, "score")); + redraw(&mut raw); + assert!(!prs_problems(&raw, scores).is_empty()); + let mut other = pr.clone(); + other.marks[2].value = Value::Float(field(2, "percentile")); + redraw(&mut other); + assert!(!prs_problems(&other, scores).is_empty()); +} + +#[test] +fn prs_without_a_panel_is_the_reports_note() { + let mut na = fixture(); + set(&mut na, &["sections", "prs", "data", "adjusted"], "false"); + let nc = chart(&na, "prs"); + assert_eq!(nc.kind, Kind::Text); + assert!(nc.marks.is_empty() && !nc.svg.contains(" = an.marks.iter().map(|m| m.label.clone()).collect(); + assert_eq!(got, want); + assert!(want.iter().any(|g| g == "Invented region B")); + assert!(!want.iter().any(|g| g == "Invented group C")); + assert!(an.svg.contains("whisker")); + assert_eq!(whisker_problems(&an.svg), Vec::::new()); + // Red control: a dot moved outside its range. + let mut off = an.clone(); + off.marks[0].value = Value::Float(99.0); + redraw(&mut off); + assert!(!whisker_problems(&off.svg).is_empty()); +} + +#[test] +fn an_ancestry_range_with_one_bound_is_left_out_of_the_detail() { + let mut half = fixture(); + set( + &mut half, + &["sections", "ancestry_fine", "data"], + r#"{"continent": [{"group": "Invented group D", "fraction": 0.3, "low": 0.2}]}"#, + ); + let m = &chart(&half, "ancestry-fine").marks[0]; + assert!(!m.detail.contains("bootstrap range"), "{}", m.detail); + assert_eq!(m.high, Value::Null); +} + +#[test] +fn genome_draws_runs_of_5_mb_and_counts_what_has_no_place() { + let s = fixture(); + let g = chart(&s, "genome"); + let roh: Vec<&str> = g + .marks + .iter() + .filter(|m| m.kind == Some(MarkKind::Roh)) + .map(|m| m.locus.as_deref().unwrap()) + .collect(); + assert_eq!(roh, ["chr3:10000000-22300000", "chr15:40000000-46100000"]); + let nd = |what: &str| g.not_drawn.iter().find(|x| x.what == what).map(|x| x.count); + assert_eq!(nd("runs of homozygosity under 5 MB"), Some(1)); + assert_eq!(nd("ClinVar hits on chrM"), Some(1)); + assert_eq!(nd("ClinVar hits on other contigs (alt, unplaced)"), Some(1)); + assert!(g.svg.contains("Not drawn:")); + assert!( + !g.marks + .iter() + .any(|m| matches!(m.chrom.as_deref(), Some("chrM" | "chr22_KI270879v1_alt"))) + ); + assert!(!g.svg.contains("AnnotSV class 4 or 5 SV") && !g.svg.contains("MoChA")); + // The floor is the roh section's, the 5 MB the docs promise. + assert_eq!(charts::ROH_MIN_MB, 5.0); + // No genome chart when ROH did not run, even with ClinVar hits. + let mut nr = s.clone(); + set(&mut nr, &["sections", "roh", "state"], "\"missing\""); + assert!(!charts_of(&nr).iter().any(|c| c.id == "genome")); +} + +#[test] +fn an_unreadable_run_of_homozygosity_stops_the_chart() { + for region in ["chr3:10000000_22300000", "3:1-2", "chr3:20-10"] { + let mut bad = fixture(); + set( + &mut bad, + &[ + "sections", + "roh", + "data", + "autosomal_over_5mb", + "0", + "region", + ], + &format!("\"{region}\""), + ); + let e = build(&summary(&bad)).expect_err(region); + assert!( + e.0.starts_with(&format!("run of homozygosity '{region}'")), + "{e}" + ); + } + // Control: the readable regions do not stop it. + assert!(build(&summary(&fixture())).is_ok()); +} + +const SV_ROWS: &str = r#"[ + {"sv": "chr7:117480000-117530000", "type": "DEL", "gt": "0/1", "length": "50000", "acmg_class": "4", "genes": ["CFTR"]}, + {"sv": "chr22_KI270879v1_alt:100-900", "type": "DUP", "gt": "0/1", "length": "800", "acmg_class": "5", "genes": []}, + {"sv": "17:7660000-7690000", "type": "DEL", "gt": "0/1", "length": "30000", "acmg_class": "5", "genes": ["TP53"]}]"#; +const MCA_CALLS: &str = r#"[ + {"chrom": "chr20", "start": "30000000", "end": "42000000", "length_mb": "12.0", "type": "Del", "cell_fraction": "0.12"}, + {"chrom": "chrM", "start": "100", "end": "900", "length_mb": ".", "type": "Del", "cell_fraction": "."}, + {"chrom": "chr3", "start": ".", "end": ".", "length_mb": ".", "type": "Dup", "cell_fraction": "."}, + {"chrom": "20", "start": "50000000", "end": "52000000", "length_mb": "2.0", "type": "Dup", "cell_fraction": "0.05"}]"#; + +fn with_sv_mca(rows: &str, calls: &str) -> Value { + let mut s = fixture(); + set( + &mut s, + &["sections", "annotsv"], + &format!(r#"{{"state": "ok", "data": {{"count": 3, "rows": {rows}}}}}"#), + ); + set( + &mut s, + &["sections", "mosaic"], + &format!(r#"{{"state": "ok", "data": {{"status": "assessed", "calls": {calls}}}}}"#), + ); + s +} + +#[test] +fn genome_draws_annotsv_spans_and_mocha_bars() { + let gm = chart(&with_sv_mca(SV_ROWS, MCA_CALLS), "genome"); + let svs = [ + ("chr7:117480000-117530000", true), + ("chr22_KI270879v1_alt:100-900", false), + ("17:7660000-7690000", true), + ]; + let mcas = [true, false, false, true]; + assert_eq!(sv_mca_problems(&gm, &svs, &mcas), Vec::::new()); + let nd = |what: &str| { + gm.not_drawn + .iter() + .find(|x| x.what == what) + .map(|x| x.count) + }; + assert_eq!(nd("AnnotSV class 4 and 5 SVs on other contigs"), Some(1)); + assert_eq!( + nd("MoChA calls on other contigs or with no position"), + Some(2) + ); + assert!( + gm.svg.contains("AnnotSV class 4 or 5 SV") && gm.svg.contains("mosaic alteration (MoChA)") + ); + // Red control: a genome chart that leaves out the MoChA calls. + let mut lost = gm.clone(); + lost.marks.retain(|m| m.kind != Some(MarkKind::Mca)); + redraw(&mut lost); + assert!(!sv_mca_problems(&lost, &svs, &mcas).is_empty()); +} + +#[test] +fn every_genome_mark_stays_inside_its_chromosome() { + let edge = with_sv_mca( + // past the end of chr21 (46,709,983 bp), and a 10 bp one at the very start of chr1 + r#"[{"sv": "chr21:46700000-46800000", "type": "DUP", "gt": "0/1", "length": "100000", "acmg_class": "4", "genes": []}, + {"sv": "chr1:1-10", "type": "DEL", "gt": "0/1", "length": "10", "acmg_class": "4", "genes": []}]"#, + r#"[{"chrom": "chr22", "start": "50000000", "end": "51000000", "length_mb": "1.0", "type": "Dup", "cell_fraction": "0.1"}, + {"chrom": "chr22", "start": "52000000", "end": "53000000", "length_mb": "1.0", "type": "Del", "cell_fraction": "0.1"}]"#, + ); + let ge = chart(&edge, "genome"); + assert_eq!(outside_marks(&ge.svg), Vec::::new()); + let nd = ge + .not_drawn + .iter() + .find(|x| x.what == "marks past the end of their GRCh38 chromosome"); + assert_eq!(nd.map(|x| x.count), Some(1)); + assert!(ge.marks.iter().all(|m| { + m.end + .is_none_or(|e| e <= chrom_len(m.chrom.as_deref().unwrap()).unwrap()) + })); + assert_eq!(ge.svg.matches("class=\"sv\"").count(), 2); + assert_eq!(ge.svg.matches("class=\"mca\"").count(), 1); + let cut: Vec<(&str, i128)> = ge + .marks + .iter() + .filter(|m| { + matches!(m.kind, Some(MarkKind::Sv | MarkKind::Mca)) && m.pos.unwrap() > 40_000_000 + }) + .map(|m| (m.chrom.as_deref().unwrap(), m.end.unwrap())) + .collect(); + assert_eq!(cut, [("chr21", 46_709_983), ("chr22", 50_818_468)]); + // Red control: a span drawn past its chromosome's end. + let i = ge.svg.find("::new()); + // Red control: a copied caveat is caught. + let copied = format!("{src}\nconst X: &str = \"{}\";\n", notes::ROH_NOTE); + assert_eq!(note_literals(&copied), ["ROH_NOTE"]); +} + +#[test] +fn the_grch38_lengths_are_ucscs() { + assert_eq!(GRCH38.len(), 24); + assert_eq!(chrom_len("chr1"), Some(248_956_422)); + assert_eq!(chrom_len("chrY"), Some(57_227_415)); + assert_eq!(chrom_len("chrM"), None); +} + +/// FNV-1a of a file's bytes: a frozen vector of what the oracle wrote. +fn fnv(bytes: &[u8]) -> u64 { + bytes.iter().fold(0xcbf2_9ce4_8422_2325, |h, b| { + (h ^ u64::from(*b)).wrapping_mul(0x0100_0000_01b3) + }) +} + +fn charts_file(v: &Value) -> String { + let opts = Dump { + indent: Some(1), + ..Dump::default() + }; + dumps(&json(&summary(v)).unwrap(), &opts).unwrap() + "\n" +} + +/// The summaries whose charts JSON is frozen below. With OG_CHARTS_DUMP set +/// to a folder, each is written there, to render it with the oracle +/// (`bin/render_report.py --summary F --charts-json OUT`). +fn frozen() -> Vec<(&'static str, Value)> { + let mut z = fixture(); + set( + &mut z, + &["sections", "clinvar", "data", "by_stars"], + r#"{"4":0,"3":0,"2":0,"1":0,"0":0}"#, + ); + set(&mut z, &["sections", "clinvar", "data", "hits"], "[]"); + set( + &mut z, + &["sections", "clinvar", "data", "low_confidence"], + "0", + ); + let mut na = fixture(); + set(&mut na, &["sections", "prs", "data", "adjusted"], "false"); + let mut old = fixture(); + if let Value::Object(d) = at(&mut old, &["sections", "mito", "data"]) { + d.shift_remove("heteroplasmic_sites"); + } + let edge = with_sv_mca( + r#"[{"sv": "chr21:46700000-46800000", "type": "DUP", "gt": "0/1", "length": "100000", "acmg_class": "4", "genes": []}, + {"sv": "chr1:1-10", "type": "DEL", "gt": "0/1", "length": "10", "acmg_class": "4", "genes": []}]"#, + r#"[{"chrom": "chr22", "start": "50000000", "end": "51000000", "length_mb": "1.0", "type": "Dup", "cell_fraction": "0.1"}, + {"chrom": "chr22", "start": "52000000", "end": "53000000", "length_mb": "1.0", "type": "Del", "cell_fraction": "0.1"}]"#, + ); + let all = vec![ + ("fixture", fixture()), + ("no-hit", z), + ("no-panel", na), + ("no-sites", old), + ("sv-mca", with_sv_mca(SV_ROWS, MCA_CALLS)), + ("edge", edge), + ]; + if let Some(dir) = std::env::var_os("OG_CHARTS_DUMP") { + for (name, v) in &all { + let p = Path::new(&dir).join(format!("{name}.json")); + std::fs::write(p, dumps(v, &Dump::default()).unwrap()).unwrap(); + } + } + all +} + +/// The FNV-1a of the charts JSON `bin/report_charts.py` wrote at commit +/// 65095e97 for each frozen summary (render_report.py --charts-json). A +/// deliberate change to a chart changes its vector: say so in the PR. +const ORACLE: [(&str, u64); 6] = [ + ("fixture", 0x0fb8_e455_9f1d_5688), + ("no-hit", 0x97e4_dae4_149c_3c39), + ("no-panel", 0xd855_b5d4_785b_2c3a), + ("no-sites", 0xa570_9eae_3ca9_1850), + ("sv-mca", 0x003a_8f9c_2441_ba65), + ("edge", 0xca4a_fec8_1f14_13d8), +]; + +#[test] +fn the_charts_json_is_what_the_python_wrote() { + let got: Vec<(&str, u64)> = frozen() + .iter() + .map(|(n, v)| (*n, fnv(charts_file(v).as_bytes()))) + .collect(); + let shown: Vec = got + .iter() + .map(|(n, h)| format!("(\"{n}\", {h:#018x})")) + .collect(); + assert_eq!(got, ORACLE, "now: {}", shown.join(", ")); +} + +#[test] +fn the_charts_json_is_the_same_on_every_run() { + let s = fixture(); + let (a, b) = (charts_file(&s), charts_file(&s)); + assert_eq!(a, b); + let v = loads(&a).unwrap(); + let Value::Object(o) = &v else { panic!() }; + assert_eq!(o["schema_version"], Value::Int(1)); + let Value::Array(c) = &o["charts"] else { + panic!() + }; + let ids: Vec = c + .iter() + .map(|x| { + let Value::Object(x) = x else { panic!() }; + pycompat::value::py_str(&x["id"]).unwrap() + }) + .collect(); + assert_eq!( + ids, + ["clinvar-stars", "genome", "mito", "ancestry-fine", "prs"] + ); + // Red control: one changed value is a different file. + let mut moved = s.clone(); + set( + &mut moved, + &["sections", "mito", "data", "heteroplasmic_sites", "0", "af"], + "0.31", + ); + assert_ne!(charts_file(&moved), a); +} + +#[test] +fn the_verb_writes_the_file_and_counts_the_sections() { + let dir = Path::new(env!("CARGO_TARGET_TMPDIR")).join("charts-verb"); + let _ = std::fs::remove_dir_all(&dir); + std::fs::create_dir_all(&dir).unwrap(); + let inp = dir.join("s.json"); + std::fs::write(&inp, dumps(&fixture(), &Dump::default()).unwrap()).unwrap(); + let outp = dir.join("S_charts.json"); + let args: Vec = [ + "--summary", + inp.to_str().unwrap(), + "--charts-json", + outp.to_str().unwrap(), + ] + .iter() + .map(|s| (*s).to_owned()) + .collect(); + let (mut out, mut err) = (Vec::new(), Vec::new()); + assert_eq!( + charts::cli(&args, &mut out, &mut err), + 0, + "{}", + String::from_utf8_lossy(&err) + ); + assert_eq!(String::from_utf8(out).unwrap(), "Sections: ok 5\n"); + assert_eq!( + std::fs::read_to_string(&outp).unwrap(), + charts_file(&fixture()) + ); + // No summary is a usage error; an unreadable one fails. + let (mut out, mut err) = (Vec::new(), Vec::new()); + assert_eq!( + charts::cli( + &["--charts-json".into(), "x.json".into()], + &mut out, + &mut err + ), + 2 + ); + let missing = dir.join("none.json").to_str().unwrap().to_owned(); + assert_eq!( + charts::cli(&["--summary".into(), missing], &mut out, &mut err), + 1 + ); +} + +#[test] +fn both_report_paths_write_the_charts_beside_the_report() { + let nf = std::fs::read_to_string(repo().join("modules/local/html_report/main.nf")).unwrap(); + let sh = std::fs::read_to_string(repo().join("scripts/24-html-report.sh")).unwrap(); + assert!(nf.contains("--charts-json ${id}_charts.json")); + assert!(nf.contains("path(\"${meta.id}_charts.json\")")); + assert!( + nf.split("stub:") + .nth(1) + .unwrap() + .contains("${meta.id}_charts.json") + ); + assert!(sh.contains("--charts-json \"/genome/${SAMPLE}/${SAMPLE}_charts.json\"")); +} diff --git a/rust/crates/og-render/tests/clinical.rs b/rust/crates/og-render/tests/clinical.rs index 7c142c7ab..6bbd24cee 100644 --- a/rust/crates/og-render/tests/clinical.rs +++ b/rust/crates/og-render/tests/clinical.rs @@ -770,7 +770,7 @@ fn the_tar_deletion_and_the_rbm8a_allele_give_the_tar_line() { .filter(|x| s(at(x, &["gene"])) == "RBM8A") .collect(); assert_eq!(tw.len(), 1); - assert_eq!(s(at(tw[0], &["verdict"])), "biallelic"); + assert_eq!(s(at(tw[0], &["verdict"])), "possibly biallelic"); let lines = carrier::lines(&D::new(&c, "carrier")).unwrap(); let line: Vec<&String> = lines .iter() diff --git a/rust/crates/og-render/tests/port_report_core.rs b/rust/crates/og-render/tests/port_report_core.rs index b8d8d44ca..6f846eeb6 100644 --- a/rust/crates/og-render/tests/port_report_core.rs +++ b/rust/crates/og-render/tests/port_report_core.rs @@ -177,7 +177,7 @@ fn the_release_stands_next_to_the_commit_in_both_reports() { #[test] fn every_summary_key_is_in_exactly_one_section() { let keys: Vec<&str> = summary_keys().map(|s| s.key).collect(); - assert_eq!(keys.len(), 48); + assert_eq!(keys.len(), 49); assert_eq!(key_problems(&CHAPTERS, &keys), Vec::::new()); // Red controls: a key taken out, and a key in two sections, are caught. let cut: Vec<&str> = keys.iter().copied().filter(|k| *k != "telomere").collect(); @@ -202,6 +202,25 @@ fn every_summary_key_is_in_exactly_one_section() { let mut missing = key_problems(&short, &keys); missing.sort(); assert_eq!(missing, ["missing consumer_export", "missing viral"]); + // acmg_sf is shown with clinical, not as a frame key of its own: listing + // it in a section as well is a key shown twice, and the search index + // anchors it to the clinical-filter section. + let mut also = CHAPTERS.to_vec(); + also.push(Chapter { + id: "x", + title: "X", + question: "?", + sections: &[Sec { + id: "x", + title: "X", + keys: &["acmg_sf"], + }], + }); + assert_eq!(key_problems(&also, &keys), ["twice acmg_sf".to_owned()]); + assert_eq!( + og_render::chapters::section_of("acmg_sf").map(|s| s.id), + Some("clinical-filter") + ); } #[test] diff --git a/rust/crates/og-steps/src/pgx_rules.rs b/rust/crates/og-steps/src/pgx_rules.rs index b999f9af5..a6ad63be2 100644 --- a/rust/crates/og-steps/src/pgx_rules.rs +++ b/rust/crates/og-steps/src/pgx_rules.rs @@ -21,8 +21,12 @@ //! `--optitype`, only when OptiType gives the same pair; with //! `--require-optitype` and no OptiType result, neither gene. //! - CYP2D6: only when pypgx (step 32) and Cyrius (step 21) give the same -//! diplotype and the depth check passed. One depth-based call alone can be -//! a false whole-gene deletion that changes a prescription. +//! diplotype and the depth check passed (which needs 10x in the flanks). +//! One depth-based call alone can be a false whole-gene deletion that +//! changes a prescription. A pypgx call whose defining variants are not +//! all `PASS` or not of good quality (step 32's `Defining_filter` and +//! `Quality`) reads `weak evidence (...)` in the Evidence column; Cyrius's +//! agreement still passes it. //! //! The consensus table (`Gene Result Outside_call Reason Evidence`) says //! for each of the three genes what each caller said and what was passed. @@ -716,10 +720,26 @@ fn cell(row: &pycompat::csv::DictRow, key: &str) -> String { strip(row.get(key).flatten().unwrap_or("")).to_owned() } -/// pypgx's CYP2D6 diplotype (`""` when its summary has no CYP2D6 row). -fn read_pypgx(path: &str) -> Result { +/// pypgx's CYP2D6 diplotype (`""` when its summary has no CYP2D6 row) and +/// what is weak in the evidence for it: step 32's `Defining_filter` when it +/// is not `PASS` and its `Quality` when it is not `ok`, `"; "`-joined +/// (`""` when neither is, or the summary is older than those columns). +fn read_pypgx(path: &str) -> Result<(String, String), Error> { let got = dict_rows(path, |row| { - (cell(row, "Gene") == "CYP2D6").then(|| cell(row, "Diplotype")) + (cell(row, "Gene") == "CYP2D6").then(|| { + let filter = cell(row, "Defining_filter"); + let quality = cell(row, "Quality"); + let fine: [(String, &[&str]); 2] = [ + (filter, &["", "PASS", "none", "N/A"]), + (quality, &["", "ok", "N/A"]), + ]; + let weak: Vec = fine + .into_iter() + .filter(|(v, ok)| !ok.contains(&v.as_str())) + .map(|(v, _)| v) + .collect(); + (cell(row, "Diplotype"), weak.join("; ")) + }) })?; Ok(got.unwrap_or_default()) } @@ -758,13 +778,18 @@ pub fn cyp2d6_row( let cy = cyrius.map(read_cyrius).transpose()?; let dc = depth.map(read_depth_check).transpose()?; - let pg_ok = pg.as_deref().is_some_and(is_call); + let pg_ok = pg.as_ref().is_some_and(|(d, _)| is_call(d)); let cy_ok = cy.as_ref().is_some_and(|(g, f)| is_call(g) && f == "PASS"); + // A call on weak evidence is flagged, not withheld: Cyrius reads the + // BAM on its own, so its agreement is the second line of evidence. let pg_txt = match &pg { None => "not run".to_owned(), - Some(p) if pg_ok => p.clone(), - Some(p) if p.is_empty() => "no call (no CYP2D6 row)".to_owned(), - Some(p) => format!("no call ({p})"), + Some((p, weak)) if pg_ok && !weak.is_empty() => { + format!("{p}, weak evidence ({weak})") + } + Some((p, _)) if pg_ok => p.clone(), + Some((p, _)) if p.is_empty() => "no call (no CYP2D6 row)".to_owned(), + Some((p, _)) => format!("no call ({p})"), }; let cy_txt = match &cy { None => "not run".to_owned(), @@ -804,7 +829,7 @@ pub fn cyp2d6_row( if !(pg_ok && cy_ok) { return withheld(ONE_CALLER); } - let (pg, cy) = (pg.unwrap_or_default(), cy.unwrap_or_default()); + let (pg, cy) = (pg.unwrap_or_default().0, cy.unwrap_or_default()); if !same_diplotype(&pg, &cy.0) { return withheld("pypgx and Cyrius disagree"); } @@ -1233,6 +1258,93 @@ mod tests { let _ = std::fs::remove_dir_all(d); } + #[test] + fn shallow_flanks_do_not_count_an_agreement() { + // What `og pgx cyp2d6-check` writes for flanks under 10x (og-bam's + // tests/i411_cyp2d6_gate.rs pins that side). + let d = tmp("shallow"); + let pg = put(&d, "p.tsv", "Gene\tDiplotype\nCYP2D6\t*1/*2\n"); + let head = "Sample\tGenotype\tFilter\n"; + let cy = put(&d, "c.tsv", &format!("{head}S\t*2/*1\tPASS\n")); + let shallow = put( + &d, + "shallow.tsv", + "metric\tvalue\nstatus\tunreliable\nmessage\tCYP2D6 copy number unreliable, \ + agreement not counted (depth): the flanks of CYP2D6 (chr22:42.05-42.25 Mb) \ + have under 10x at MAPQ >= 1, too few reads for a copy-number call\n\ + flank_depth_mapq1\t6.00\n", + ); + let row = cyp2d6_row(Some(&pg), Some(&cy), Some(&shallow)).unwrap(); + assert_eq!(row.decision, Decision::Withheld("indeterminate")); + assert!( + row.reason.contains("agreement not counted (depth)"), + "{}", + row.reason + ); + let _ = std::fs::remove_dir_all(d); + } + + #[test] + fn weak_pypgx_evidence_is_flagged_not_withheld() { + let d = tmp("weak"); + let header = "Gene\tDiplotype\tPhenotype\tCNV_call\tSource\tStatus\tDefining_variants\t\ + Min_GQ\tWeakest_variant\tDefining_filter\tQuality\n"; + let weak = put( + &d, + "weak.tsv", + &format!( + "{header}CYP2D6\t*1/*4\tIntermediate Metabolizer\tNormal\tBAM\tcalled\t\ + 1/2 in the VCF\t8\tchr22:42128945 C>T GQ 8 AD 3,2\t\ + not PASS: chr22:42128945 C>T RefCall\tlow-confidence: check the reads\n" + ), + ); + let no_gq = put( + &d, + "nogq.tsv", + &format!( + "{header}CYP2D6\t*1/*4\tIntermediate Metabolizer\tNormal\tBAM\tcalled\t\ + 2/2 in the VCF\tN/A\tN/A\tPASS\tGQ not in the VCF: check the reads\n" + ), + ); + let clean = put( + &d, + "clean.tsv", + &format!( + "{header}CYP2D6\t*1/*4\tIntermediate Metabolizer\tNormal\tBAM\tcalled\t\ + 2/2 in the VCF\t40\tchr22:42128945 C>T GQ 40 AD 15,14\tPASS\tok\n" + ), + ); + let head = "Sample\tGenotype\tFilter\n"; + let cy = put(&d, "c.tsv", &format!("{head}S\t*4/*1\tPASS\n")); + let ok = put(&d, "ok.tsv", "status\tok\nmessage\t\n"); + + let row = cyp2d6_row(Some(&weak), Some(&cy), Some(&ok)).unwrap(); + assert_eq!(row.decision, Decision::Passed("*1/*4".to_owned())); + assert_eq!(row.reason, "pypgx and Cyrius agree; the depth check passed"); + assert_eq!( + row.evidence, + "pypgx: *1/*4, weak evidence (not PASS: chr22:42128945 C>T RefCall; \ + low-confidence: check the reads); Cyrius: *4/*1; depth check: ok" + ); + + let row = cyp2d6_row(Some(&no_gq), Some(&cy), Some(&ok)).unwrap(); + assert_eq!(row.decision, Decision::Passed("*1/*4".to_owned())); + assert_eq!( + row.evidence, + "pypgx: *1/*4, weak evidence (GQ not in the VCF: check the reads); \ + Cyrius: *4/*1; depth check: ok" + ); + + // One caller only: still withheld, still flagged. + let row = cyp2d6_row(Some(&weak), None, Some(&ok)).unwrap(); + assert_eq!(row.decision, Decision::Withheld("indeterminate")); + assert!(row.evidence.contains("weak evidence"), "{}", row.evidence); + + let row = cyp2d6_row(Some(&clean), Some(&cy), Some(&ok)).unwrap(); + assert_eq!(row.evidence, "pypgx: *1/*4; Cyrius: *4/*1; depth check: ok"); + let _ = std::fs::remove_dir_all(d); + } + #[test] fn both_files_or_neither() { let d = tmp("both"); diff --git a/rust/crates/og-summary/src/collect/acmg.rs b/rust/crates/og-summary/src/collect/acmg.rs index db3077299..c2f58b970 100644 --- a/rust/crates/og-summary/src/collect/acmg.rs +++ b/rust/crates/og-summary/src/collect/acmg.rs @@ -11,17 +11,30 @@ //! deletion counts as the second hit of a gene whose rule needs two //! ([`two_hits`](super::two_hits)), unless read-backed phase puts both on //! one copy. +//! +//! A gene whose rule needs two hits counts the copies of the gene hit, not +//! the alt copies of its records. A homozygote hits both copies. Phased +//! heterozygotes (a `|` GT with a phase set, PS) count the copies their +//! phase set covers: two in cis count once, two in trans twice. The two alt +//! alleles of one split call (`1/.` and `./1` at one position) sit on +//! different copies. Any other heterozygote counts once with its phase +//! unknown, so a pair of them is reported as possibly biallelic. A record +//! with no alt copy called counts nothing, and a combined allele of step 06 +//! counts once with its parts, unless it is unphased and two of its parts +//! are candidates on their own (they may sit on different copies). use super::assets::{ACMG_SF_VERSION, Key, Rule, acmg_sf_rules, carrier_genes}; use super::clinvar::{ COMMON_AF, Floor, Hit, HitRecords, allele_copies, floor_values, obj, opt_int, opt_s, }; use super::text::{self, digits, format_map, gt_field, info_map}; -use super::two_hits::{DeletionInputs, Spans, Variant, gene_deletions, two_hits}; +use super::two_hits::{ + DeletionInputs, Entry, Spans, Variant, Verdict, gene_deletions, phase_haps, two_hits, +}; use indexmap::IndexMap; use pycompat::json::Value; use pycompat::text::isdigit; -use std::collections::{HashMap, HashSet}; +use std::collections::{BTreeSet, HashMap, HashSet}; /// The genotype check's floors: step 06's GQ and DP, the alt read share a /// heterozygote must lie within and a homozygous alt call must reach. @@ -421,22 +434,134 @@ struct Cand { ploidy: usize, gt: String, ps: Option, + /// The parts of a combined allele (step 06's `PGP_JOINED_FROM`). + joined: Vec, +} + +/// One distinct variant of a gene as the verdict counts it: its alt +/// copies, ploidy, GT and phase set, and whether it stands for a combined +/// allele and its parts. +#[derive(Debug, Clone, PartialEq)] +struct Allele { + copies: usize, + ploidy: usize, + gt: String, + ps: Option, + combined: bool, +} + +impl Allele { + fn of(copies: usize, ploidy: usize) -> Allele { + Allele { + copies, + ploidy, + gt: String::new(), + ps: None, + combined: false, + } + } + + /// The copies read-backed phase puts the alt allele on, with its phase + /// set: only a `|` GT with every copy called and a non-empty PS. + fn phased(&self) -> Option<(&str, BTreeSet)> { + let ps = self.ps.as_deref().filter(|p| !p.is_empty())?; + let h = phase_haps(Some(&self.gt)).filter(|h| !h.is_empty())?; + Some((ps, h)) + } + + /// The copy a half call (`1/.`, `./1`) puts its alt allele on. + fn half(&self) -> Option { + let a: Vec<&str> = self.gt.split(['/', '|']).collect(); + match a.as_slice() { + [x, "."] if !matches!(*x, "0" | ".") => Some(0), + [".", y] if !matches!(*y, "0" | ".") => Some(1), + _ => None, + } + } +} + +/// How a gene whose rule needs two hits met it: `biallelic` when a call +/// proves both copies hit, `possibly biallelic` when the count needs a +/// heterozygote of unknown phase; and why. +type Pair = (&'static str, String); + +/// The copies of a gene hit, over its counted variants: the count, the +/// proof of two copies if a call gives one, and the phase sets in which +/// two or more variants sit on one copy (cis). +fn copies_hit(kept: &IndexMap) -> (usize, Option, Vec) { + let mut n = 0; + let mut proof: Option = None; + let mut sets: IndexMap<&str, (BTreeSet, usize)> = IndexMap::new(); + let mut halves: IndexMap<(&str, i128), (BTreeSet, usize)> = IndexMap::new(); + for (k, a) in kept { + let AKey::Small(key) = k else { + n += 1; + continue; + }; + if a.ploidy == 1 { + n += a.copies; + } else if a.copies >= 2 { + n += 2; + proof.get_or_insert_with(|| { + format!( + "homozygous: one call puts {}:{} {}>{} on both copies", + key.0, key.1, key.2, key.3 + ) + }); + } else if let Some((ps, h)) = a.phased() { + let s = sets.entry(ps).or_default(); + s.0.extend(h); + s.1 += 1; + } else if let Some(i) = a.half() { + let s = halves.entry((key.0.as_str(), key.1)).or_default(); + s.0.insert(i); + s.1 += 1; + } else { + n += 1; + } + } + let mut cis = Vec::new(); + for (ps, (h, count)) in &sets { + n += h.len(); + if h.len() >= 2 { + proof.get_or_insert_with(|| { + format!( + "in trans: read-backed phase puts them on different copies (phase set {ps})" + ) + }); + } else if *count >= 2 { + cis.push((*ps).to_owned()); + } + } + for ((chrom, pos), (h, count)) in &halves { + if h.len() >= 2 { + n += 2 + count - h.len(); + proof.get_or_insert_with(|| { + format!("in trans: the two alt alleles of one call at {chrom}:{pos}") + }); + } else { + n += count; + } + } + (n, proof, cis) } /// `sf_verdicts`: for each distinct variant of a gene, `None` (reported) or -/// the reason it is not, and the partial-deficiency note of a reported gene -/// with a hypomorph allele. +/// the reason it is not, the partial-deficiency note of a reported gene +/// with a hypomorph allele, and how a gene whose rule needs two hits met +/// it. `deletion` is the gene's pair with a called deletion, if any. fn sf_verdicts( gene: &str, rule: &Rule, - alleles: &IndexMap, -) -> (HashMap>, Option) { + alleles: &IndexMap, + deletion: Option<&Entry>, +) -> (HashMap>, Option, Option) { let sev = |k: &AKey| match k { AKey::Small(k) => rule.severity.get(k), _ => None, }; let mut out: IndexMap> = IndexMap::new(); - let mut kept: IndexMap = IndexMap::new(); + let mut kept: IndexMap = IndexMap::new(); for (k, cp) in alleles { match sev(k) { Some(a) if a.kind.as_deref() == Some("pseudodeficiency") => { @@ -449,37 +574,60 @@ fn sf_verdicts( ); } _ => { - kept.insert(k.clone(), *cp); + kept.insert(k.clone(), cp.clone()); } } } - let n: usize = kept.values().map(|(c, _)| c).sum(); + let (n, proof, cis) = copies_hit(&kept); let ri = rule.report_if.as_str(); - let hemi = kept.values().any(|(_, p)| *p == 1); - for (k, (c, p)) in &kept { + let hemi = kept.values().any(|a| a.ploidy == 1); + let counted = ri == "biallelic" || (ri == "hemizygous" && !hemi); + let combined = kept.values().any(|a| a.combined); + let one = if let Some(ps) = cis.first() { + format!( + "two heterozygous variants in cis: read-backed phase puts them on the same copy \ + (phase set {ps})" + ) + } else if combined { + "one heterozygous allele: a combined allele and its parts count once".to_owned() + } else { + "one heterozygous variant".to_owned() + }; + for (k, a) in &kept { let good = match ri { "any" | "het_female_too" => true, "biallelic" => n >= 2, "hemizygous" => hemi || n >= 2, - _ => matches!(k, AKey::Small(s) if rule.variants.contains_key(s)) && *c >= 2 && *p == 2, + _ => { + matches!(k, AKey::Small(s) if rule.variants.contains_key(s)) + && a.copies >= 2 + && a.ploidy == 2 + } }; let why = if good { None } else if ri == "hom_variant" { Some(format!("{gene} is reported only for: {}", rule.table_text)) } else if ri == "hemizygous" { - Some(format!( - "one heterozygous variant; {gene} is reported for {}", - rule.table_text - )) + Some(format!("{one}; {gene} is reported for {}", rule.table_text)) } else { Some(format!( - "one heterozygous variant; {gene} is reported with {}", + "{one}; {gene} is reported with {}", rule.table_text )) }; out.insert(k.clone(), why); } + let pair = (counted && n >= 2).then(|| match (proof, deletion) { + (Some(p), _) => ("biallelic", p), + (None, Some(e)) => (e.verdict.word(), format!("with {}: {}", e.deletion, e.why)), + (None, None) => ( + Verdict::PossiblyBiallelic.word(), + "phase unknown: no read-backed phase links the variants, so they may sit on the \ + same copy (cis)" + .to_owned(), + ), + }); let hypo: Vec<&str> = out .iter() .filter(|(_, why)| why.is_none()) @@ -492,7 +640,60 @@ fn sf_verdicts( hypo.join("; ") ) }); - (out.into_iter().collect(), partial) + (out.into_iter().collect(), partial, pair) +} + +/// `CHROM:POS:REF:ALT` joined by `|`, as step 06 writes `PGP_JOINED_FROM`. +fn joined_keys(v: &str) -> Vec { + v.split('|') + .filter_map(|p| { + let mut it = p.rsplitn(4, ':'); + let (alt, r, pos, chrom) = (it.next()?, it.next()?, it.next()?, it.next()?); + let pos = crate::int(pos).ok()?; + Some((chrom.to_owned(), pos, r.to_owned(), alt.to_owned())) + }) + .collect() +} + +/// The key each small candidate of a gene is counted under. A combined +/// allele and the parts of it that are candidates count once, under the +/// combined allele's key, when the combined call is phased or at most one +/// part is a candidate. An unphased combined allele with two or more parts +/// that are candidates counts through its parts, which may sit on +/// different copies. +fn counting_keys(cands: &[&Cand]) -> HashMap<(String, AKey), AKey> { + let mut map = HashMap::new(); + let present: HashSet<(&str, &Key)> = cands + .iter() + .filter_map(|x| match &x.key { + AKey::Small(k) => Some((x.gene.as_str(), k)), + _ => None, + }) + .collect(); + for x in cands.iter().filter(|x| !x.joined.is_empty()) { + let parts: Vec<&Key> = x + .joined + .iter() + .filter(|k| present.contains(&(x.gene.as_str(), *k))) + .collect(); + let phased = Allele { + gt: x.gt.clone(), + ps: x.ps.clone(), + ..Allele::of(x.copies, x.ploidy) + } + .phased() + .is_some(); + if phased || parts.len() <= 1 { + for p in parts { + map.entry((x.gene.clone(), AKey::Small(p.clone()))) + .or_insert_with(|| x.key.clone()); + } + } else { + map.entry((x.gene.clone(), x.key.clone())) + .or_insert_with(|| AKey::Small(parts[0].clone())); + } + } + map } /// `sf_structural`: step 05's class 4 and 5 SVs in genes whose rule allows @@ -574,6 +775,7 @@ fn sf_structural( ploidy: 2, gt: String::new(), ps: None, + joined: Vec::new(), }); } } @@ -633,6 +835,12 @@ fn tier(i: &Inputs) -> Result, String> { let row = Hit::parse(r, *floor)?; let gt = text::gt_of(r).to_owned(); let (copies, ploidy) = allele_copies(>); + let joined = joined_keys( + info_map(&r[7]) + .get("PGP_JOINED_FROM") + .copied() + .unwrap_or(""), + ); for g in row.gene.split(',') { if !rules.contains_key(g) { continue; @@ -644,6 +852,12 @@ fn tier(i: &Inputs) -> Result, String> { f.insert("significance".into(), Value::Str(row.significance.clone())); f.insert("stars".into(), Value::Int(row.stars.into())); f.insert("low_confidence".into(), Value::Bool(row.low_confidence)); + if row.combined_allele != "." { + f.insert( + "combined_allele".into(), + Value::Str(row.combined_allele.clone()), + ); + } clinvar.push(Cand { kind: Kind::ClinVar, gene: g.to_owned(), @@ -653,6 +867,7 @@ fn tier(i: &Inputs) -> Result, String> { ploidy, gt: gt.clone(), ps: gt_field(r, "PS"), + joined: joined.clone(), }); } } @@ -709,28 +924,64 @@ fn tier(i: &Inputs) -> Result, String> { ploidy, gt: x.genotype.clone(), ps: x.ps.clone(), + joined: Vec::new(), }); } } } let (svs, sv_checked, sv_note) = sf_structural(i.deletions, &rules); - // One verdict per gene, over its distinct variants. - let mut alleles: IndexMap> = IndexMap::new(); - for x in clinvar.iter().chain(&high) { + // One verdict per gene, over its distinct variants. A record with no + // alt copy called is no evidence of a hit and is not counted. + let small: Vec<&Cand> = clinvar + .iter() + .chain(&high) + .filter(|x| x.copies > 0) + .collect(); + let units = counting_keys(&small); + let unit = |x: &Cand| { + units + .get(&(x.gene.clone(), x.key.clone())) + .cloned() + .unwrap_or_else(|| x.key.clone()) + }; + let mut alleles: IndexMap> = IndexMap::new(); + // The candidates counted under their own key first, so a combined + // allele's own call stands for its parts. + let (own, folded): (Vec<&Cand>, Vec<&Cand>) = + small.iter().copied().partition(|x| unit(x) == x.key); + for x in &own { let p = if x.ploidy == 0 { 2 } else { x.ploidy }; alleles .entry(x.gene.clone()) .or_default() .entry(x.key.clone()) - .or_insert((x.copies.max(1), p)); + .or_insert(Allele { + gt: x.gt.clone(), + ps: x.ps.clone(), + ..Allele::of(x.copies, p) + }); + } + for x in &folded { + let p = if x.ploidy == 0 { 2 } else { x.ploidy }; + let a = alleles + .entry(x.gene.clone()) + .or_default() + .entry(unit(x)) + .or_insert(Allele { + gt: x.gt.clone(), + ps: x.ps.clone(), + ..Allele::of(x.copies, p) + }); + a.copies = a.copies.max(x.copies); + a.combined = true; } for x in &svs { alleles .entry(x.gene.clone()) .or_default() .entry(x.key.clone()) - .or_insert((1, 2)); + .or_insert(Allele::of(1, 2)); } let (spans, two_hit_note): (Spans, Option) = match carrier_genes(i.assets) { Ok(g) => (g.into_iter().map(|(k, v)| (k, v.span)).collect(), None), @@ -745,7 +996,7 @@ fn tier(i: &Inputs) -> Result, String> { let (dels, _, _) = gene_deletions(i.deletions, &spans); let mut seen = HashSet::new(); let mut variants = Vec::new(); - for x in clinvar.iter().chain(&high) { + for x in &own { let AKey::Small(k) = &x.key else { continue }; let pseudo = rules[&x.gene].severity_kind(k) == Some("pseudodeficiency"); if !pseudo && seen.insert((x.gene.clone(), k.clone())) { @@ -775,7 +1026,7 @@ fn tier(i: &Inputs) -> Result, String> { for g in found.entries.keys() { if matches!(rules[g].report_if.as_str(), "biallelic" | "hemizygous") { if let Some(a) = alleles.get_mut(g) { - a.insert(AKey::Deletion(g.clone()), (1, 2)); + a.insert(AKey::Deletion(g.clone()), Allele::of(1, 2)); } two.extend( found @@ -788,16 +1039,39 @@ fn tier(i: &Inputs) -> Result, String> { } let verdict: HashMap<&String, _> = alleles .iter() - .map(|(g, a)| (g, sf_verdicts(g, &rules[g], a))) + .map(|(g, a)| { + let del = found + .entries + .get(g) + .filter(|_| a.contains_key(&AKey::Deletion(g.clone()))); + (g, sf_verdicts(g, &rules[g], a, del)) + }) .collect(); let mut reported: [Vec; 3] = Default::default(); let mut not_reported = Vec::new(); for x in clinvar.into_iter().chain(high).chain(svs) { - let (whys, partial) = &verdict[&x.gene]; - let why = whys.get(&x.key).cloned().flatten(); + if x.copies == 0 { + not_reported.push(obj([ + ("gene", Value::Str(x.gene.clone())), + ("variant", x.fields["variant"].clone()), + ( + "genotype", + x.fields.get("genotype").cloned().unwrap_or(Value::Null), + ), + ("source", Value::Str(x.kind.source().into())), + ( + "reason", + Value::Str(format!("no alt copy called (GT {}): not counted", x.gt)), + ), + ])); + continue; + } + let key = unit(&x); + let (whys, partial, pair) = &verdict[&x.gene]; + let why = whys.get(&key).cloned().flatten(); let rule = &rules[&x.gene]; let mut f = x.fields; - if let AKey::Small(k) = &x.key + if let AKey::Small(k) = &key && found.hemi.contains_key(&(x.gene.clone(), k.clone())) { f.insert("genotype".into(), Value::Str("hemizygous".into())); @@ -813,11 +1087,15 @@ fn tier(i: &Inputs) -> Result, String> { f.insert("rule_note".into(), opt_s(rule.note.as_deref())); f.insert("severity".into(), opt_s(partial.as_deref())); if x.kind != Kind::Sv - && let AKey::Small(k) = &x.key + && let AKey::Small(k) = &key && let Some(t) = two.get(&(x.gene.clone(), k.clone())) { f.insert("two_hit".into(), Value::Str(t.clone())); } + if let Some((word, phase)) = pair { + f.insert("pair".into(), Value::Str((*word).into())); + f.insert("phase".into(), Value::Str(phase.clone())); + } reported[slot].push(Value::Object(f)); } Some(reason) => not_reported.push(obj([ diff --git a/rust/crates/og-summary/src/collect/acmg_card.rs b/rust/crates/og-summary/src/collect/acmg_card.rs index 9506a9040..dabb42721 100644 --- a/rust/crates/og-summary/src/collect/acmg_card.rs +++ b/rust/crates/og-summary/src/collect/acmg_card.rs @@ -1,2 +1,140 @@ -//! The summary section of the ACMG card, computed from the step 06 hits. -//! Empty until its unit of the 1.0.0 plan lands. +//! The ACMG secondary-findings card as its own summary section, +//! `acmg_sf`, whose state follows step 06: ok when step 06's ClinVar hits +//! VCF is there, not run (or failed) with step 06's reason otherwise. +//! +//! The card's main input needs no VEP: step 06's P/LP hits, step 05's +//! class 4 and 5 SVs and step 35's deletions, with each gene's rule from +//! `assets/acmg_sf.tsv`. Only the rare HIGH-impact source needs step 23's +//! clinical VCF, so a run without the VEP cache still gets the card. The +//! verdicts are [`acmg::acmg_sf`]'s, the one function the clinical section +//! also calls: with the clinical VCF when it is there and readable, without +//! it otherwise. Without it the card says `high_impact_checked: false` and +//! `high_impact_note` names why and what that can miss. With a clinical +//! VCF left by an earlier run (step 23 not ok in this run, the VCF older +//! than the run's start) the card reads it and its `high_impact_note` says +//! the HIGH-impact source is from that earlier run. + +use super::acmg::{self, ClinicalVcf}; +use super::clinvar::HitsVcf; +use super::two_hits::DeletionInputs; +use pycompat::json::Value; + +/// Why step 23's rare HIGH-impact records are not in the card. +#[derive(Debug, Clone, PartialEq)] +pub enum NoHighImpact { + /// The run status gives step 23's result (`failed (exit 1)`, + /// `skipped (needs VEP, ...)`, or `ok` with no clinical VCF left). + Step23(String), + /// No run status names step 23 (a Nextflow report, a folder without + /// `logs/run_status.tsv`). + NotRun, + /// The clinical VCF is there and cannot be read. + Unreadable(String), +} + +impl NoHighImpact { + /// `high_impact_note`: why, then what the card can miss. + pub fn note(&self) -> String { + let why = match self { + NoHighImpact::Step23(r) if r.starts_with("failed") => { + format!("step 23 (clinical filter) {r}") + } + NoHighImpact::Step23(r) if r.starts_with("skipped") => { + format!("step 23 (clinical filter) was {r}") + } + NoHighImpact::Step23(r) => { + format!("step 23 (clinical filter) was {r} but wrote no clinical VCF") + } + NoHighImpact::NotRun => { + "step 23 (clinical filter) did not run; it needs VEP's annotation (step 13) and \ + the VEP cache" + .to_owned() + } + NoHighImpact::Unreadable(e) => format!("step 23's clinical VCF cannot be read: {e}"), + }; + format!( + "Rare HIGH-impact variants were not screened: {why}. This card holds the ClinVar P/LP \ + hits and the class 4 and 5 structural variants only, so it can miss a predicted \ + loss-of-function variant that is not in ClinVar, alone or as the second hit of a \ + recessive gene." + ) + } +} + +/// What the card reads: the step 06 hits, the clinical VCF when step 23 +/// left one, the deletions of the two-hit rule, step 23's result word +/// from the run status, and the clinical VCF's file date when it is from +/// an earlier run. +pub struct Inputs<'a> { + pub assets: &'a str, + pub hits: &'a HitsVcf, + pub clinical: Option<&'a Result>, + pub deletions: &'a DeletionInputs, + pub step23: Option<&'a str>, + /// The clinical VCF's file date (UTC minute) when step 23 was not ok in + /// this run and the VCF was written before the run started. + pub earlier_vcf: Option, +} + +/// `high_impact_note` for a card that read a clinical VCF of an earlier run. +pub fn earlier_note(date: &str, step23: Option<&str>) -> String { + let result = step23.filter(|r| !r.is_empty()).unwrap_or("not run"); + format!( + "Rare HIGH-impact variants come from the clinical VCF of an earlier run ({date}); step \ + 23 (clinical filter) was {result} in this run." + ) +} + +/// The data of the `acmg_sf` section. +#[derive(Debug, Clone, PartialEq)] +pub struct AcmgCard(pub Value); + +impl AcmgCard { + /// The card. An `Err` is the section's note (a hits record whose POS + /// is no integer); a rules list or a hits VCF that cannot be read gives + /// the card's `unavailable` form, as in the clinical section. + pub fn read(i: &Inputs) -> Result { + // A clinical VCF that cannot be read costs the HIGH-impact source + // only, never the ClinVar rows. + let (clinical, missing) = match i.clinical { + Some(Ok(c)) => match &c.high { + Ok(_) => (i.clinical, None), + Err(e) => (None, Some(NoHighImpact::Unreadable(e.clone()))), + }, + Some(Err(e)) => (None, Some(NoHighImpact::Unreadable(e.clone()))), + None => ( + None, + Some( + i.step23 + .map_or(NoHighImpact::NotRun, |r| NoHighImpact::Step23(r.to_owned())), + ), + ), + }; + let mut v = acmg::acmg_sf(&acmg::Inputs { + assets: i.assets, + hits: Some(&i.hits.read), + clinical, + deletions: i.deletions, + })?; + if let Value::Object(m) = &mut v { + let checked = m.get("high_impact_checked").cloned(); + match (missing, &i.earlier_vcf) { + (Some(why), _) if checked == Some(Value::Bool(false)) => { + m.insert("high_impact_note".into(), Value::Str(why.note())); + } + (None, Some(date)) if checked == Some(Value::Bool(true)) => { + m.insert( + "high_impact_note".into(), + Value::Str(earlier_note(date, i.step23)), + ); + } + _ => {} + } + } + Ok(AcmgCard(v)) + } + + pub fn to_json(&self) -> Value { + self.0.clone() + } +} diff --git a/rust/crates/og-summary/src/collect/carrier.rs b/rust/crates/og-summary/src/collect/carrier.rs index 852e35bf3..e02396a91 100644 --- a/rust/crates/og-summary/src/collect/carrier.rs +++ b/rust/crates/og-summary/src/collect/carrier.rs @@ -3,7 +3,9 @@ //! list marks hypomorph or pseudodeficiency is set aside, never a carrier //! finding on its own. The genes of autosomal recessive conditions that a //! called deletion and a hit both reach are listed as two hits, and a hit -//! called homozygous inside a deletion is shown as hemizygous. +//! called homozygous inside a deletion is shown as hemizygous. A hit that +//! is part of step 06's combined allele, or the combined allele itself, +//! carries the note the ClinVar table prints for it. use super::assets::carrier_genes; use super::clinvar::{Floor, Hit, HitRecords, allele_copies, carrier_genotype, obj}; @@ -52,6 +54,12 @@ impl Carrier { item.insert("stars".into(), Value::Int(row.stars.into())); item.insert("inheritance".into(), Value::Str(x.inheritance.clone())); item.insert("condition".into(), Value::Str(x.condition.clone())); + if row.combined_allele != "." { + item.insert( + "combined_allele".into(), + Value::Str(row.combined_allele.clone()), + ); + } let sev = x.severity.get(&key); if let Some(s) = sev { item.insert( @@ -66,7 +74,8 @@ impl Carrier { }; items.push(item); aside.push(sev.is_some()); - if sev.is_none_or(|s| s.kind.as_deref() == Some("hypomorph")) { + // A record with no alt copy called is no hit to pair. + if copies > 0 && sev.is_none_or(|s| s.kind.as_deref() == Some("hypomorph")) { variants.push(( Variant { gene: g.to_owned(), diff --git a/rust/crates/og-summary/src/collect/group_b.rs b/rust/crates/og-summary/src/collect/group_b.rs index 81426f5bb..ab338db0e 100644 --- a/rust/crates/og-summary/src/collect/group_b.rs +++ b/rust/crates/og-summary/src/collect/group_b.rs @@ -1,15 +1,18 @@ //! Group b of `og summary collect`: the clinical sections. ClinVar, the //! carrier list, PharmCAT, CPIC, pypgx, Cyrius, CPSR, the clinical filter -//! with its ACMG secondary-findings tier, slivar, and the `cyp2d6` block. +//! with its ACMG secondary-findings tier, the ACMG card of its own +//! (`acmg_sf`, step 06), slivar, and the `cyp2d6` block. //! //! Each input is read once: the ClinVar hits VCF feeds the ClinVar -//! section, the ACMG tier, the carrier list and CPSR's call floor; the -//! clinical VCF feeds the record count and the ACMG tier; AnnotSV's table +//! section, the ACMG card, the ACMG tier, the carrier list and CPSR's call +//! floor; the clinical VCF feeds the record count, the ACMG card and the +//! ACMG tier; AnnotSV's table //! and step 35's copy-number tables feed both two-hit readings. The //! sections are read one at a time, so the peak memory is the biggest //! section's, not the sum. use super::acmg::{self, ClinicalVcf}; +use super::acmg_card::{self, AcmgCard}; use super::carrier::Carrier; use super::clinical::{Clinical, Slivar}; use super::clinvar::{ClinVar, Floor, HitsVcf}; @@ -22,7 +25,7 @@ use super::two_hits::{self, DeletionInputs}; use super::{Folder, Input, Read, read_at, with_mtime}; /// The sections `og summary collect --only b` reads, in summary.json's order. -pub const GROUP_B: [Spec; 9] = [ +pub const GROUP_B: [Spec; 10] = [ Spec { key: "clinvar", title: "ClinVar screen", @@ -33,6 +36,11 @@ pub const GROUP_B: [Spec; 9] = [ title: "Carrier list", step: "06", }, + Spec { + key: "acmg_sf", + title: "ACMG secondary findings", + step: "06", + }, Spec { key: "pharmcat", title: "PharmCAT", @@ -134,10 +142,39 @@ pub fn read(input: &Input, folder: &Folder) -> Vec
{ Some(h) => ClinVar::read(h, d, &side, &s) .and_then(|data| with_mtime(&h.path, h.rel.clone(), Data::ClinVar(data))), }; + let clinical_vcf = clinical_vcf_at.as_ref().map(|(v, _)| ClinicalVcf::read(v)); + // The card follows step 06: it needs the hits, not step 23. + let step23 = folder + .run + .as_ref() + .and_then(|r| r.steps.get("23")) + .map(String::as_str); + // A clinical VCF older than this run, with step 23 not ok in it, is an + // earlier run's: the card says so, as the clinical section goes stale. + let earlier_vcf = match (&folder.run, &clinical_vcf_at) { + (Some(run), Some((p, _))) if step23 != Some("ok") => run + .started_epoch + .zip(pycompat::mtime::mtime(p).ok()) + .filter(|&(started, m)| super::model::is_stale(m, started)) + .and_then(|(_, m)| super::time::utc_minute(m)), + _ => None, + }; + let acmg_sf: Read = match &hits { + None => Ok(None), + Some(h) => AcmgCard::read(&acmg_card::Inputs { + assets: &input.assets, + hits: h, + clinical: clinical_vcf.as_ref(), + deletions: &deletions, + step23, + earlier_vcf, + }) + .and_then(|c| with_mtime(&h.path, h.rel.clone(), Data::AcmgSf(c))), + }; let clinical: Read = match clinical_table.clone().or_else(|| clinical_vcf_at.clone()) { None => Ok(None), Some((p, rel)) => { - let vcf = clinical_vcf_at.as_ref().map(|(v, _)| ClinicalVcf::read(v)); + let vcf = clinical_vcf; let tier = acmg::Inputs { assets: &input.assets, hits: hits.as_ref().map(|h| &h.read), @@ -155,7 +192,7 @@ pub fn read(input: &Input, folder: &Folder) -> Vec
{ let rest = read_rest(input, &s, index, &find, &hits, &deletions); let [carrier, pharmcat, cpic, pypgx, cyrius, cpsr, slivar] = rest; let reads = [ - clinvar, carrier, pharmcat, cpic, pypgx, cyrius, cpsr, clinical, slivar, + clinvar, carrier, acmg_sf, pharmcat, cpic, pypgx, cyrius, cpsr, clinical, slivar, ]; GROUP_B .iter() diff --git a/rust/crates/og-summary/src/collect/model.rs b/rust/crates/og-summary/src/collect/model.rs index 2d6e7c994..cfeef97c9 100644 --- a/rust/crates/og-summary/src/collect/model.rs +++ b/rust/crates/og-summary/src/collect/model.rs @@ -18,10 +18,10 @@ pub const SCHEMA_VERSION: i128 = 2; /// section of another step (variant calling, step 03, which a run reuses on /// purpose) is never stale. pub const RUN_ALL_STEPS: &[&str] = &[ - "03a", "03b", "03c", "03d", "04", "04b", "05", "06", "07", "08", "09", "09b", "10", "11", "12", - "13", "14", "15", "16", "16b", "17", "18", "19", "20", "21", "22", "23", "25", "26", "26b", - "27", "28", "29", "30", "31", "32", "33", "35", "35b", "37", "38", "39", "40", "41", "42", - "43", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", + "03a", "03b", "03c", "03d", "04", "04a", "04b", "05", "06", "07", "08", "09", "09b", "10", + "11", "12", "13", "14", "15", "16", "16b", "17", "18", "19", "20", "21", "22", "23", "25", + "26", "26b", "27", "28", "29", "30", "31", "32", "33", "35", "35b", "37", "38", "39", "40", + "41", "42", "43", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", ]; /// What a section's answer is worth. diff --git a/rust/crates/og-summary/src/collect/post.rs b/rust/crates/og-summary/src/collect/post.rs index eedb53084..d4a16a7f3 100644 --- a/rust/crates/og-summary/src/collect/post.rs +++ b/rust/crates/og-summary/src/collect/post.rs @@ -35,7 +35,7 @@ use pycompat::value::truthy; use std::path::Path; /// summary.json's sections, in its order. -pub const ORDER: [&str; 48] = [ +pub const ORDER: [&str; 49] = [ "coverage", "callability", "sex_check", @@ -46,6 +46,7 @@ pub const ORDER: [&str; 48] = [ "clinvar", "couple", "carrier", + "acmg_sf", "pharmcat", "cpic", "pypgx", @@ -88,8 +89,9 @@ pub const ORDER: [&str; 48] = [ /// Sections that are no step of their own, so never in `not_run`: the read /// count is written by alignment, which a run from a BAM or a VCF never -/// does; the couple screen and the carrier list come with other steps. -const NOT_A_STEP: [&str; 3] = ["read_count", "couple", "carrier"]; +/// does; the couple screen, the carrier list and the ACMG secondary-findings +/// card come with other steps (39 and 06), whose own sections say not run. +const NOT_A_STEP: [&str; 4] = ["read_count", "couple", "carrier", "acmg_sf"]; /// What no step assesses. const NOT_ASSESSED: [&str; 5] = [ diff --git a/rust/crates/og-summary/src/collect/sections.rs b/rust/crates/og-summary/src/collect/sections.rs index a354c126f..8b5e5f73f 100644 --- a/rust/crates/og-summary/src/collect/sections.rs +++ b/rust/crates/og-summary/src/collect/sections.rs @@ -24,6 +24,7 @@ pub enum Data { Json(Value), ClinVar(super::clinvar::ClinVar), Carrier(super::carrier::Carrier), + AcmgSf(super::acmg_card::AcmgCard), PharmCat(super::pgx::PharmCat), Cpic(super::pgx::Cpic), Pypgx(super::pgx::Pypgx), @@ -46,6 +47,7 @@ impl Data { Data::Json(v) => v.clone(), Data::ClinVar(d) => d.to_json(), Data::Carrier(d) => d.to_json(), + Data::AcmgSf(d) => d.to_json(), Data::PharmCat(d) => d.to_json(), Data::Cpic(d) => d.to_json(), Data::Pypgx(d) => d.to_json(), diff --git a/rust/crates/og-summary/src/collect/two_hits.rs b/rust/crates/og-summary/src/collect/two_hits.rs index de93590e5..3841788ac 100644 --- a/rust/crates/og-summary/src/collect/two_hits.rs +++ b/rust/crates/og-summary/src/collect/two_hits.rs @@ -14,7 +14,10 @@ //! variant sits inside the deletion and is called homozygous (one copy is //! left, and it carries the variant), or both calls carry read-backed phase //! (a `|` GT and the same PS) on different copies. On the same copy (cis) -//! they are no second hit; otherwise they are possibly in trans. +//! they are no second hit; otherwise they are possibly in trans. A +//! hypomorph called homozygous inside a deletion is only possibly +//! biallelic: the call alone cannot say whether the deletion is real, and +//! without it a homozygous hypomorph is no finding. //! //! The readers here take from step 05's and step 35's tables only what the //! rule needs. The AnnotSV and Parascopy sections themselves are read by @@ -173,10 +176,24 @@ pub fn pair_phase(dl: &Deletion, v: &Variant) -> (Verdict, String) { }); } if inside && v.copies >= 2 { + // Nothing here says whether the deletion is real and germline. A + // full loss of function called homozygous hits both copies either + // way; a hypomorph does so only together with a real deletion. + if let Some(a) = &v.allele { + return ( + Verdict::PossiblyBiallelic, + format!( + "a hypomorph ({a}) called homozygous inside a called deletion: biallelic (a \ + null plus the hypomorph) only if the deletion is real; confirm the deletion \ + (array or MLPA): without it this is a homozygous hypomorph, not a finding" + ), + ); + } return ( Verdict::Biallelic, - "the variant is called homozygous inside the deletion: it is hemizygous, on the one \ - copy the deletion leaves" + "the variant is called homozygous inside the deletion: hemizygous on the copy the \ + deletion leaves if the deletion is real, homozygous if not; both copies carry it \ + either way" .into(), ); } @@ -988,6 +1005,21 @@ mod tests { assert!(found.hemi.contains_key(&("G".to_owned(), v.key.clone()))); } + #[test] + fn homozygous_hypomorph_inside_a_deletion_is_only_possibly_biallelic() { + let mut v = var(150, "1/1", None); + v.allele = Some("c.-21G>A".into()); + let found = two_hits( + std::slice::from_ref(&v), + &HashMap::from([("G".to_owned(), vec![del(None, None)])]), + ); + let e = &found.entries["G"]; + assert_eq!(e.verdict, Verdict::PossiblyBiallelic); + assert_eq!(e.genotype, "het", "the genotype is not turned hemizygous"); + assert!(e.why.contains("only if the deletion is real"), "{}", e.why); + assert!(!found.hemi.contains_key(&("G".to_owned(), v.key.clone()))); + } + #[test] fn the_best_pair_of_a_gene_wins() { let v = var(500, "1|0", Some("7")); diff --git a/rust/crates/og-summary/src/mito.rs b/rust/crates/og-summary/src/mito.rs index d447acf9f..f6eed7b76 100644 --- a/rust/crates/og-summary/src/mito.rs +++ b/rust/crates/og-summary/src/mito.rs @@ -3,8 +3,11 @@ //! - `annotate`: each ALT of the filtered chrM VCF with its ClinVar record //! (CLNSIG, CLNREVSTAT, CLNDN) and gnomAD v3.1's chrM sites (AF_hom, //! AF_het, max_hl), matched on the allele trimmed to its shortest form -//! ([`min_allele`]), so Mutect2's, ClinVar's and gnomAD's spellings of one -//! indel meet. `_chrM_annotated.tsv`. +//! ([`min_allele`]), and else on the indel moved to the left end of its +//! repeat on the rCRS ([`left_allele`]), so Mutect2's, ClinVar's and +//! gnomAD's spellings of one indel meet wherever in a homopolymer each put +//! it. `--numt-default` adds a `# numt` line: the NuMT filter had no +//! autosomal depth. `_chrM_annotated.tsv`. //! - `deletions`: eKLIPse's deletions CSV (Goudenege 2019) as a table; the //! deleted length wraps the circular origin. `_chrM_deletions.tsv`. //! - `copies`: the mtDNA copy number, 2 x (chrM reads per base) / (autosomal @@ -71,6 +74,230 @@ const CHRM_NAMES: [&str; 4] = ["chrM", "MT", "chrMT", "M"]; /// One allele as a key: (pos, ref, alt). pub type Allele = (i128, String, String); +/// The `# numt` header line of `annotate --numt-default`: the NuMT filter +/// got no median autosomal depth, ran at 0 and so marked nothing. +pub const NUMT_DEFAULT: &str = "# numt\tNuMT filter used a default depth\tno median autosomal depth \ +was given, so it ran at depth 0 and marked no call as a possible NuMT"; + +/// GRCh38's chrM, the rCRS (NC_012920.1, MD5 +/// c68f52674c9fb33aef52dcf399755519): base `p` at index `p - 1`. +const RCRS: &str = concat!( + "GATCACAGGTCTATCACCCTATTAACCACTCACGGGAGCTCTCCATGCATTTGGTATTTTCGTCTGGGGGGTATGCACGC", + "GATAGCATTGCGAGACGCTGGAGCCGGAGCACCCTATGTCGCAGTATCTGTCTTTGATTCCTGCCTCATCCTATTATTTA", + "TCGCACCTACGTTCAATATTACAGGCGAACATACTTACTAAAGTGTGTTAATTAATTAATGCTTGTAGGACATAATAATA", + "ACAATTGAATGTCTGCACAGCCACTTTCCACACAGACATCATAACAAAAAATTTCCACCAAACCCCCCCTCCCCCGCTTC", + "TGGCCACAGCACTTAAACACATCTCTGCCAAACCCCAAAAACAAAGAACCCTAACACCAGCCTAACCAGATTTCAAATTT", + "TATCTTTTGGCGGTATGCACTTTTAACAGTCACCCCCCAACTAACACATTATTTTCCCCTCCCACTCCCATACTACTAAT", + "CTCATCAATACAACCCCCGCCCATCCTACCCAGCACACACACACCGCTGCTAACCCCATACCCCGAACCAACCAAACCCC", + "AAAGACACCCCCCACAGTTTATGTAGCTTACCTCCTCAAAGCAATACACTGAAAATGTTTAGACGGGCTCACATCACCCC", + "ATAAACAAATAGGTTTGGTCCTAGCCTTTCTATTAGCTCTTAGTAAGATTACACATGCAAGCATCCCCGTTCCAGTGAGT", + "TCACCCTCTAAATCACCACGATCAAAAGGAACAAGCATCAAGCACGCAGCAATGCAGCTCAAAACGCTTAGCCTAGCCAC", + "ACCCCCACGGGAAACAGCAGTGATTAACCTTTAGCAATAAACGAAAGTTTAACTAAGCTATACTAACCCCAGGGTTGGTC", + "AATTTCGTGCCAGCCACCGCGGTCACACGATTAACCCAAGTCAATAGAAGCCGGCGTAAAGAGTGTTTTAGATCACCCCC", + "TCCCCAATAAAGCTAAAACTCACCTGAGTTGTAAAAAACTCCAGTTGACACAAAATAGACTACGAAAGTGGCTTTAACAT", + "ATCTGAACACACAATAGCTAAGACCCAAACTGGGATTAGATACCCCACTATGCTTAGCCCTAAACCTCAACAGTTAAATC", + "AACAAAACTGCTCGCCAGAACACTACGAGCCACAGCTTAAAACTCAAAGGACCTGGCGGTGCTTCATATCCCTCTAGAGG", + "AGCCTGTTCTGTAATCGATAAACCCCGATCAACCTCACCACCTCTTGCTCAGCCTATATACCGCCATCTTCAGCAAACCC", + "TGATGAAGGCTACAAAGTAAGCGCAAGTACCCACGTAAAGACGTTAGGTCAAGGTGTAGCCCATGAGGTGGCAAGAAATG", + "GGCTACATTTTCTACCCCAGAAAACTACGATAGCCCTTATGAAACTTAAGGGTCGAAGGTGGATTTAGCAGTAAACTAAG", + "AGTAGAGTGCTTAGTTGAACAGGGCCCTGAAGCGCGTACACACCGCCCGTCACCCTCCTCAAGTATACTTCAAAGGACAT", + "TTAACTAAAACCCCTACGCATTTATATAGAGGAGACAAGTCGTAACATGGTAAGTGTACTGGAAAGTGCACTTGGACGAA", + "CCAGAGTGTAGCTTAACACAAAGCACCCAACTTACACTTAGGAGATTTCAACTTAACTTGACCGCTCTGAGCTAAACCTA", + "GCCCCAAACCCACTCCACCTTACTACCAGACAACCTTAGCCAAACCATTTACCCAAATAAAGTATAGGCGATAGAAATTG", + "AAACCTGGCGCAATAGATATAGTACCGCAAGGGAAAGATGAAAAATTATAACCAAGCATAATATAGCAAGGACTAACCCC", + "TATACCTTCTGCATAATGAATTAACTAGAAATAACTTTGCAAGGAGAGCCAAAGCTAAGACCCCCGAAACCAGACGAGCT", + "ACCTAAGAACAGCTAAAAGAGCACACCCGTCTATGTAGCAAAATAGTGGGAAGATTTATAGGTAGAGGCGACAAACCTAC", + "CGAGCCTGGTGATAGCTGGTTGTCCAAGATAGAATCTTAGTTCAACTTTAAATTTGCCCACAGAACCCTCTAAATCCCCT", + "TGTAAATTTAACTGTTAGTCCAAAGAGGAACAGCTCTTTGGACACTAGGAAAAAACCTTGTAGAGAGAGTAAAAAATTTA", + "ACACCCATAGTAGGCCTAAAAGCAGCCACCAATTAAGAAAGCGTTCAAGCTCAACACCCACTACCTAAAAAATCCCAAAC", + "ATATAACTGAACTCCTCACACCCAATTGGACCAATCTATCACCCTATAGAAGAACTAATGTTAGTATAAGTAACATGAAA", + "ACATTCTCCTCCGCATAAGCCTGCGTCAGATTAAAACACTGAACTGACAATTAACAGCCCAATATCTACAATCAACCAAC", + "AAGTCATTATTACCCTCACTGTCAACCCAACACAGGCATGCTCATAAGGAAAGGTTAAAAAAAGTAAAAGGAACTCGGCA", + "AATCTTACCCCGCCTGTTTACCAAAAACATCACCTCTAGCATCACCAGTATTAGAGGCACCGCCTGCCCAGTGACACATG", + "TTTAACGGCCGCGGTACCCTAACCGTGCAAAGGTAGCATAATCACTTGTTCCTTAAATAGGGACCTGTATGAATGGCTCC", + "ACGAGGGTTCAGCTGTCTCTTACTTTTAACCAGTGAAATTGACCTGCCCGTGAAGAGGCGGGCATAACACAGCAAGACGA", + "GAAGACCCTATGGAGCTTTAATTTATTAATGCAAACAGTACCTAACAAACCCACAGGTCCTAAACTACCAAACCTGCATT", + "AAAAATTTCGGTTGGGGCGACCTCGGAGCAGAACCCAACCTCCGAGCAGTACATGCTAAGACTTCACCAGTCAAAGCGAA", + "CTACTATACTCAATTGATCCAATAACTTGACCAACGGAACAAGTTACCCTAGGGATAACAGCGCAATCCTATTCTAGAGT", + "CCATATCAACAATAGGGTTTACGACCTCGATGTTGGATCAGGACATCCCGATGGTGCAGCCGCTATTAAAGGTTCGTTTG", + "TTCAACGATTAAAGTCCTACGTGATCTGAGTTCAGACCGGAGTAATCCAGGTCGGTTTCTATCTACNTTCAAATTCCTCC", + "CTGTACGAAAGGACAAGAGAAATAAGGCCTACTTCACAAAGCGCCTTCCCCCGTAAATGATATCATCTCAACTTAGTATT", + "ATACCCACACCCACCCAAGAACAGGGTTTGTTAAGATGGCAGAGCCCGGTAATCGCATAAAACTTAAAACTTTACAGTCA", + "GAGGTTCAATTCCTCTTCTTAACAACATACCCATGGCCAACCTCCTACTCCTCATTGTACCCATTCTAATCGCAATGGCA", + "TTCCTAATGCTTACCGAACGAAAAATTCTAGGCTATATACAACTACGCAAAGGCCCCAACGTTGTAGGCCCCTACGGGCT", + "ACTACAACCCTTCGCTGACGCCATAAAACTCTTCACCAAAGAGCCCCTAAAACCCGCCACATCTACCATCACCCTCTACA", + "TCACCGCCCCGACCTTAGCTCTCACCATCGCTCTTCTACTATGAACCCCCCTCCCCATACCCAACCCCCTGGTCAACCTC", + "AACCTAGGCCTCCTATTTATTCTAGCCACCTCTAGCCTAGCCGTTTACTCAATCCTCTGATCAGGGTGAGCATCAAACTC", + "AAACTACGCCCTGATCGGCGCACTGCGAGCAGTAGCCCAAACAATCTCATATGAAGTCACCCTAGCCATCATTCTACTAT", + "CAACATTACTAATAAGTGGCTCCTTTAACCTCTCCACCCTTATCACAACACAAGAACACCTCTGATTACTCCTGCCATCA", + "TGACCCTTGGCCATAATATGATTTATCTCCACACTAGCAGAGACCAACCGAACCCCCTTCGACCTTGCCGAAGGGGAGTC", + "CGAACTAGTCTCAGGCTTCAACATCGAATACGCCGCAGGCCCCTTCGCCCTATTCTTCATAGCCGAATACACAAACATTA", + "TTATAATAAACACCCTCACCACTACAATCTTCCTAGGAACAACATATGACGCACTCTCCCCTGAACTCTACACAACATAT", + "TTTGTCACCAAGACCCTACTTCTAACCTCCCTGTTCTTATGAATTCGAACAGCATACCCCCGATTCCGCTACGACCAACT", + "CATACACCTCCTATGAAAAAACTTCCTACCACTCACCCTAGCATTACTTATATGATATGTCTCCATACCCATTACAATCT", + "CCAGCATTCCCCCTCAAACCTAAGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGGAGCTTAAACCC", + "CCTTATTTCTAGGACTATGAGAATCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTA", + "AAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAATTAATCCCCT", + "GGCCCAACCCGTCATCTACTCTACCATCTTTGCAGGCACACTCATCACAGCGCTAAGCTCGCACTGATTTTTTACCTGAG", + "TAGGCCTAGAAATAAACATGCTAGCTTTTATTCCAGTTCTAACCAAAAAAATAAACCCTCGTTCCACAGAAGCTGCCATC", + "AAGTATTTCCTCACGCAAGCAACCGCATCCATAATCCTTCTAATAGCTATCCTCTTCAACAATATACTCTCCGGACAATG", + "AACCATAACCAATACTACCAATCAATACTCATCATTAATAATCATAATAGCTATAGCAATAAAACTAGGAATAGCCCCCT", + "TTCACTTCTGAGTCCCAGAGGTTACCCAAGGCACCCCTCTGACATCCGGCCTGCTTCTTCTCACATGACAAAAACTAGCC", + "CCCATCTCAATCATATACCAAATCTCTCCCTCACTAAACGTAAGCCTTCTCCTCACTCTCTCAATCTTATCCATCATAGC", + "AGGCAGTTGAGGTGGATTAAACCAAACCCAGCTACGCAAAATCTTAGCATACTCCTCAATTACCCACATAGGATGAATAA", + "TAGCAGTTCTACCGTACAACCCTAACATAACCATTCTTAATTTAACTATTTATATTATCCTAACTACTACCGCATTCCTA", + "CTACTCAACTTAAACTCCAGCACCACGACCCTACTACTATCTCGCACCTGAAACAAGCTAACATGACTAACACCCTTAAT", + "TCCATCCACCCTCCTCTCCCTAGGAGGCCTGCCCCCGCTAACCGGCTTTTTGCCCAAATGGGCCATTATCGAAGAATTCA", + "CAAAAAACAATAGCCTCATCATCCCCACCATCATAGCCACCATCACCCTCCTTAACCTCTACTTCTACCTACGCCTAATC", + "TACTCCACCTCAATCACACTACTCCCCATATCTAACAACGTAAAAATAAAATGACAGTTTGAACATACAAAACCCACCCC", + "ATTCCTCCCCACACTCATCGCCCTTACCACGCTACTCCTACCTATCTCCCCTTTTATACTAATAATCTTATAGAAATTTA", + "GGTTAAATACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTGCAATACTTAATTTCTGTAACAGCTAAGGACTGCAAAA", + "CCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTACTAGACCAATGGGACTTAAACCCA", + "CAAACACTTAGTTAACAGCTAAGCACCCTAATCAACTGGCTTCAATCTACTTCTCCCGCCGCCGGGAAAAAAGGCGGGAG", + "AAGCCCCGGCAGGTTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAATCACCTCGGAGCTGGTAAAAAGAGGCC", + "TAACCCCTGTCTTTAGATTTACAGTCCAATGCTTCACTCAGCCATTTTACCTCACCCCCACTGATGTTCGCCGACCGTTG", + "ACTATTCTCTACAAACCACAAAGACATTGGAACACTATACCTATTATTCGGCGCATGAGCTGGAGTCCTAGGCACAGCTC", + "TAAGCCTCCTTATTCGAGCCGAGCTGGGCCAGCCAGGCAACCTTCTAGGTAACGACCACATCTACAACGTTATCGTCACA", + "GCCCATGCATTTGTAATAATCTTCTTCATAGTAATACCCATCATAATCGGAGGCTTTGGCAACTGACTAGTTCCCCTAAT", + "AATCGGTGCCCCCGATATGGCGTTTCCCCGCATAAACAACATAAGCTTCTGACTCTTACCTCCCTCTCTCCTACTCCTGC", + "TCGCATCTGCTATAGTGGAGGCCGGAGCAGGAACAGGTTGAACAGTCTACCCTCCCTTAGCAGGGAACTACTCCCACCCT", + "GGAGCCTCCGTAGACCTAACCATCTTCTCCTTACACCTAGCAGGTGTCTCCTCTATCTTAGGGGCCATCAATTTCATCAC", + "AACAATTATCAATATAAAACCCCCTGCCATAACCCAATACCAAACGCCCCTCTTCGTCTGATCCGTCCTAATCACAGCAG", + "TCCTACTTCTCCTATCTCTCCCAGTCCTAGCTGCTGGCATCACTATACTACTAACAGACCGCAACCTCAACACCACCTTC", + "TTCGACCCCGCCGGAGGAGGAGACCCCATTCTATACCAACACCTATTCTGATTTTTCGGTCACCCTGAAGTTTATATTCT", + "TATCCTACCAGGCTTCGGAATAATCTCCCATATTGTAACTTACTACTCCGGAAAAAAAGAACCATTTGGATACATAGGTA", + "TGGTCTGAGCTATGATATCAATTGGCTTCCTAGGGTTTATCGTGTGAGCACACCATATATTTACAGTAGGAATAGACGTA", + "GACACACGAGCATATTTCACCTCCGCTACCATAATCATCGCTATCCCCACCGGCGTCAAAGTATTTAGCTGACTCGCCAC", + "ACTCCACGGAAGCAATATGAAATGATCTGCTGCAGTGCTCTGAGCCCTAGGATTCATCTTTCTTTTCACCGTAGGTGGCC", + "TGACTGGCATTGTATTAGCAAACTCATCACTAGACATCGTACTACACGACACGTACTACGTTGTAGCCCACTTCCACTAT", + "GTCCTATCAATAGGAGCTGTATTTGCCATCATAGGAGGCTTCATTCACTGATTTCCCCTATTCTCAGGCTACACCCTAGA", + "CCAAACCTACGCCAAAATCCATTTCACTATCATATTCATCGGCGTAAATCTAACTTTCTTCCCACAACACTTTCTCGGCC", + "TATCCGGAATGCCCCGACGTTACTCGGACTACCCCGATGCATACACCACATGAAACATCCTATCATCTGTAGGCTCATTC", + "ATTTCTCTAACAGCAGTAATATTAATAATTTTCATGATTTGAGAAGCCTTCGCTTCGAAGCGAAAAGTCCTAATAGTAGA", + "AGAACCCTCCATAAACCTGGAGTGACTATATGGATGCCCCCCACCCTACCACACATTCGAAGAACCCGTATACATAAAAT", + "CTAGACAAAAAAGGAAGGAATCGAACCCCCCAAAGCTGGTTTCAAGCCAACCCCATGGCCTCCATGACTTTTTCAAAAAG", + "GTATTAGAAAAACCATTTCATAACTTTGTCAAAGTTAAATTATAGGCTAAATCCTATATATCTTAATGGCACATGCAGCG", + "CAAGTAGGTCTACAAGACGCTACTTCCCCTATCATAGAAGAGCTTATCACCTTTCATGATCACGCCCTCATAATCATTTT", + "CCTTATCTGCTTCCTAGTCCTGTATGCCCTTTTCCTAACACTCACAACAAAACTAACTAATACTAACATCTCAGACGCTC", + "AGGAAATAGAAACCGTCTGAACTATCCTGCCCGCCATCATCCTAGTCCTCATCGCCCTCCCATCCCTACGCATCCTTTAC", + "ATAACAGACGAGGTCAACGATCCCTCCCTTACCATCAAATCAATTGGCCACCAATGGTACTGAACCTACGAGTACACCGA", + "CTACGGCGGACTAATCTTCAACTCCTACATACTTCCCCCATTATTCCTAGAACCAGGCGACCTGCGACTCCTTGACGTTG", + "ACAATCGAGTAGTACTCCCGATTGAAGCCCCCATTCGTATAATAATTACATCACAAGACGTCTTGCACTCATGAGCTGTC", + "CCCACATTAGGCTTAAAAACAGATGCAATTCCCGGACGTCTAAACCAAACCACTTTCACCGCTACACGACCGGGGGTATA", + "CTACGGTCAATGCTCTGAAATCTGTGGAGCAAACCACAGTTTCATGCCCATCGTCCTAGAATTAATTCCCCTAAAAATCT", + "TTGAAATAGGGCCCGTATTTACCCTATAGCACCCCCTCTACCCCCTCTAGAGCCCACTGTAAAGCTAACTTAGCATTAAC", + "CTTTTAAGTTAAAGATTAAGAGAACCAACACCTCTTTACAGTGAAATGCCCCAACTAAATACTACCGTATGGCCCACCAT", + "AATTACCCCCATACTCCTTACACTATTCCTCATCACCCAACTAAAAATATTAAACACAAACTACCACCTACCTCCCTCAC", + "CAAAGCCCATAAAAATAAAAAATTATAACAAACCCTGAGAACCAAAATGAACGAAAATCTGTTCGCTTCATTCATTGCCC", + "CCACAATCCTAGGCCTACCCGCCGCAGTACTGATCATTCTATTTCCCCCTCTATTGATCCCCACCTCCAAATATCTCATC", + "AACAACCGACTAATCACCACCCAACAATGACTAATCAAACTAACCTCAAAACAAATGATAACCATACACAACACTAAAGG", + "ACGAACCTGATCTCTTATACTAGTATCCTTAATCATTTTTATTGCCACAACTAACCTCCTCGGACTCCTGCCTCACTCAT", + "TTACACCAACCACCCAACTATCTATAAACCTAGCCATGGCCATCCCCTTATGAGCGGGCACAGTGATTATAGGCTTTCGC", + "TCTAAGATTAAAAATGCCCTAGCCCACTTCTTACCACAAGGCACACCTACACCCCTTATCCCCATACTAGTTATTATCGA", + "AACCATCAGCCTACTCATTCAACCAATAGCCCTGGCCGTACGCCTAACCGCTAACATTACTGCAGGCCACCTACTCATGC", + "ACCTAATTGGAAGCGCCACCCTAGCAATATCAACCATTAACCTTCCCTCTACACTTATCATCTTCACAATTCTAATTCTA", + "CTGACTATCCTAGAAATCGCTGTCGCCTTAATCCAAGCCTACGTTTTCACACTTCTAGTAAGCCTCTACCTGCACGACAA", + "CACATAATGACCCACCAATCACATGCCTATCATATAGTAAAACCCAGCCCATGACCCCTAACAGGGGCCCTCTCAGCCCT", + "CCTAATGACCTCCGGCCTAGCCATGTGATTTCACTTCCACTCCATAACGCTCCTCATACTAGGCCTACTAACCAACACAC", + "TAACCATATACCAATGATGGCGCGATGTAACACGAGAAAGCACATACCAAGGCCACCACACACCACCTGTCCAAAAAGGC", + "CTTCGATACGGGATAATCCTATTTATTACCTCAGAAGTTTTTTTCTTCGCAGGATTTTTCTGAGCCTTTTACCACTCCAG", + "CCTAGCCCCTACCCCCCAATTAGGAGGGCACTGGCCCCCAACAGGCATCACCCCGCTAAATCCCCTAGAAGTCCCACTCC", + "TAAACACATCCGTATTACTCGCATCAGGAGTATCAATCACCTGAGCTCACCATAGTCTAATAGAAAACAACCGAAACCAA", + "ATAATTCAAGCACTGCTTATTACAATTTTACTGGGTCTCTATTTTACCCTCCTACAAGCCTCAGAGTACTTCGAGTCTCC", + "CTTCACCATTTCCGACGGCATCTACGGCTCAACATTTTTTGTAGCCACAGGCTTCCACGGACTTCACGTCATTATTGGCT", + "CAACTTTCCTCACTATCTGCTTCATCCGCCAACTAATATTTCACTTTACATCCAAACATCACTTTGGCTTCGAAGCCGCC", + "GCCTGATACTGGCATTTTGTAGATGTGGTTTGACTATTTCTGTATGTCTCCATCTATTGATGAGGGTCTTACTCTTTTAG", + "TATAAATAGTACCGTTAACTTCCAATTAACTAGTTTTGACAACATTCAAAAAAGAGTAATAAACTTCGCCTTAATTTTAA", + "TAATCAACACCCTCCTAGCCTTACTACTAATAATTATTACATTTTGACTACCACAACTCAACGGCTACATAGAAAAATCC", + "ACCCCTTACGAGTGCGGCTTCGACCCTATATCCCCCGCCCGCGTCCCTTTCTCCATAAAATTCTTCTTAGTAGCTATTAC", + "CTTCTTATTATTTGATCTAGAAATTGCCCTCCTTTTACCCCTACCATGAGCCCTACAAACAACTAACCTGCCACTAATAG", + "TTATGTCATCCCTCTTATTAATCATCATCCTAGCCCTAAGTCTGGCCTATGAGTGACTACAAAAAGGATTAGACTGAACC", + "GAATTGGTATATAGTTTAAACAAAACGAATGATTTCGACTCATTAAATTATGATAATCATATTTACCAAATGCCCCTCAT", + "TTACATAAATATTATACTAGCATTTACCATCTCACTTCTAGGAATACTAGTATATCGCTCACACCTCATATCCTCCCTAC", + "TATGCCTAGAAGGAATAATACTATCGCTGTTCATTATAGCTACTCTCATAACCCTCAACACCCACTCCCTCTTAGCCAAT", + "ATTGTGCCTATTGCCATACTAGTCTTTGCCGCCTGCGAAGCAGCGGTGGGCCTAGCCCTACTAGTCTCAATCTCCAACAC", + "ATATGGCCTAGACTACGTACATAACCTAAACCTACTCCAATGCTAAAACTAATCGTCCCAACAATTATATTACTACCACT", + "GACATGACTTTCCAAAAAACACATAATTTGAATCAACACAACCACCCACAGCCTAATTATTAGCATCATCCCTCTACTAT", + "TTTTTAACCAAATCAACAACAACCTATTTAGCTGTTCCCCAACCTTTTCCTCCGACCCCCTAACAACCCCCCTCCTAATA", + "CTAACTACCTGACTCCTACCCCTCACAATCATGGCAAGCCAACGCCACTTATCCAGTGAACCACTATCACGAAAAAAACT", + "CTACCTCTCTATACTAATCTCCCTACAAATCTCCTTAATTATAACATTCACAGCCACAGAACTAATCATATTTTATATCT", + "TCTTCGAAACCACACTTATCCCCACCTTGGCTATCATCACCCGATGAGGCAACCAGCCAGAACGCCTGAACGCAGGCACA", + "TACTTCCTATTCTACACCCTAGTAGGCTCCCTTCCCCTACTCATCGCACTAATTTACACTCACAACACCCTAGGCTCACT", + "AAACATTCTACTACTCACTCTCACTGCCCAAGAACTATCAAACTCCTGAGCCAACAACTTAATATGACTAGCTTACACAA", + "TAGCTTTTATAGTAAAGATACCTCTTTACGGACTCCACTTATGACTCCCTAAAGCCCATGTCGAAGCCCCCATCGCTGGG", + "TCAATAGTACTTGCCGCAGTACTCTTAAAACTAGGCGGCTATGGTATAATACGCCTCACACTCATTCTCAACCCCCTGAC", + "AAAACACATAGCCTACCCCTTCCTTGTACTATCCCTATGAGGCATAATTATAACAAGCTCCATCTGCCTACGACAAACAG", + "ACCTAAAATCGCTCATTGCATACTCTTCAATCAGCCACATAGCCCTCGTAGTAACAGCCATTCTCATCCAAACCCCCTGA", + "AGCTTCACCGGCGCAGTCATTCTCATAATCGCCCACGGGCTTACATCCTCATTACTATTCTGCCTAGCAAACTCAAACTA", + "CGAACGCACTCACAGTCGCATCATAATCCTCTCTCAAGGACTTCAAACTCTACTCCCACTAATAGCTTTTTGATGACTTC", + "TAGCAAGCCTCGCTAACCTCGCCTTACCCCCCACTATTAACCTACTGGGAGAACTCTCTGTGCTAGTAACCACGTTCTCC", + "TGATCAAATATCACTCTCCTACTTACAGGACTCAACATACTAGTCACAGCCCTATACTCCCTCTACATATTTACCACAAC", + "ACAATGGGGCTCACTCACCCACCACATTAACAACATAAAACCCTCATTCACACGAGAAAACACCCTCATGTTCATACACC", + "TATCCCCCATTCTCCTCCTATCCCTCAACCCCGACATCATTACCGGGTTTTCCTCTTGTAAATATAGTTTAACCAAAACA", + "TCAGATTGTGAATCTGACAACAGAGGCTTACGACCCCTTATTTACCGAGAAAGCTCACAAGAACTGCTAACTCATGCCCC", + "CATGTCTAACAACATGGCTTTCTCAACTTTTAAAGGATAACAGCTATCCATTGGTCTTAGGCCCCAAAAATTTTGGTGCA", + "ACTCCAAATAAAAGTAATAACCATGCACACTACTATAACCACCCTAACCCTGACTTCCCTAATTCCCCCCATCCTTACCA", + "CCCTCGTTAACCCTAACAAAAAAAACTCATACCCCCATTATGTAAAATCCATTGTCGCATCCACCTTTATTATCAGTCTC", + "TTCCCCACAACAATATTCATGTGCCTAGACCAAGAAGTTATTATCTCGAACTGACACTGAGCCACAACCCAAACAACCCA", + "GCTCTCCCTAAGCTTCAAACTAGACTACTTCTCCATAATATTCATCCCTGTAGCATTGTTCGTTACATGGTCCATCATAG", + "AATTCTCACTGTGATATATAAACTCAGACCCAAACATTAATCAGTTCTTCAAATATCTACTCATCTTCCTAATTACCATA", + "CTAATCTTAGTTACCGCTAACAACCTATTCCAACTGTTCATCGGCTGAGAGGGCGTAGGAATTATATCCTTCTTGCTCAT", + "CAGTTGATGATACGCCCGAGCAGATGCCAACACAGCAGCCATTCAAGCAATCCTATACAACCGTATCGGCGATATCGGTT", + "TCATCCTCGCCTTAGCATGATTTATCCTACACTCCAACTCATGAGACCCACAACAAATAGCCCTTCTAAACGCTAATCCA", + "AGCCTCACCCCACTACTAGGCCTCCTCCTAGCAGCAGCAGGCAAATCAGCCCAATTAGGTCTCCACCCCTGACTCCCCTC", + "AGCCATAGAAGGCCCCACCCCAGTCTCAGCCCTACTCCACTCAAGCACTATAGTTGTAGCAGGAATCTTCTTACTCATCC", + "GCTTCCACCCCCTAGCAGAAAATAGCCCACTAATCCAAACTCTAACACTATGCTTAGGCGCTATCACCACTCTGTTCGCA", + "GCAGTCTGCGCCCTTACACAAAATGACATCAAAAAAATCGTAGCCTTCTCCACTTCAAGTCAACTAGGACTCATAATAGT", + "TACAATCGGCATCAACCAACCACACCTAGCATTCCTGCACATCTGTACCCACGCCTTCTTCAAAGCCATACTATTTATGT", + "GCTCCGGGTCCATCATCCACAACCTTAACAATGAACAAGATATTCGAAAAATAGGAGGACTACTCAAAACCATACCTCTC", + "ACTTCAACCTCCCTCACCATTGGCAGCCTAGCATTAGCAGGAATACCTTTCCTCACAGGTTTCTACTCCAAAGACCACAT", + "CATCGAAACCGCAAACATATCATACACAAACGCCTGAGCCCTATCTATTACTCTCATCGCTACCTCCCTGACAAGCGCCT", + "ATAGCACTCGAATAATTCTTCTCACCCTAACAGGTCAACCTCGCTTCCCCACCCTTACTAACATTAACGAAAATAACCCC", + "ACCCTACTAAACCCCATTAAACGCCTGGCAGCCGGAAGCCTATTCGCAGGATTTCTCATTACTAACAACATTTCCCCCGC", + "ATCCCCCTTCCAAACAACAATCCCCCTCTACCTAAAACTCACAGCCCTCGCTGTCACTTTCCTAGGACTTCTAACAGCCC", + "TAGACCTCAACTACCTAACCAACAAACTTAAAATAAAATCCCCACTATGCACATTTTATTTCTCCAACATACTCGGATTC", + "TACCCTAGCATCACACACCGCACAATCCCCTATCTAGGCCTTCTTACGAGCCAAAACCTGCCCCTACTCCTCCTAGACCT", + "AACCTGACTAGAAAAGCTATTACCTAAAACAATTTCACAGCACCAAATCTCCACCTCCATCATCACCTCAACCCAAAAAG", + "GCATAATTAAACTTTACTTCCTCTCTTTCTTCTTCCCACTCATCCTAACCCTACTCCTAATCACATAACCTATTCCCCCG", + "AGCAATCTCAATTACAATATATACACCAACAAACAATGTTCAACCAGTAACTACTACTAATCAACGCCCATAATCATACA", + "AAGCCCCCGCACCAATAGGATCCTCCCGAATCAACCCTGACCCCTCTCCTTCATAAATTATTCAGCTTCCTACACTATTA", + "AAGTTTACCACAACCACCACCCCATCATACTCTTTCACCCACAGCACCAATCCTACCTCCATCGCTAACCCCACTAAAAC", + "ACTCACCAAGACCTCAACCCCTGACCCCCATGCCTCAGGATACTCCTCAATAGCCATCGCTGTAGTATATCCAAAGACAA", + "CCATCATTCCCCCTAAATAAATTAAAAAAACTATTAAACCCATATAACCTCCCCCAAAATTCAGAATAATAACACACCCG", + "ACCACACCGCTAACAATCAATACTAAACCCCCATAAATAGGAGAAGGCTTAGAAGAAAACCCCACAAACCCCATTACTAA", + "ACCCACACTCAACAGAAACAAAGCATACATCATTATTCTCGCACGGACTACAACCACGACCAATGATATGAAAAACCATC", + "GTTGTATTTCAACTACAAGAACACCAATGACCCCAATACGCAAAACTAACCCCCTAATAAAATTAATTAACCACTCATTC", + "ATCGACCTCCCCACCCCATCCAACATCTCCGCATGATGAAACTTCGGCTCACTCCTTGGCGCCTGCCTGATCCTCCAAAT", + "CACCACAGGACTATTCCTAGCCATGCACTACTCACCAGACGCCTCAACCGCCTTTTCATCAATCGCCCACATCACTCGAG", + "ACGTAAATTATGGCTGAATCATCCGCTACCTTCACGCCAATGGCGCCTCAATATTCTTTATCTGCCTCTTCCTACACATC", + "GGGCGAGGCCTATATTACGGATCATTTCTCTACTCAGAAACCTGAAACATCGGCATTATCCTCCTGCTTGCAACTATAGC", + "AACAGCCTTCATAGGCTATGTCCTCCCGTGAGGCCAAATATCATTCTGAGGGGCCACAGTAATTACAAACTTACTATCCG", + "CCATCCCATACATTGGGACAGACCTAGTTCAATGAATCTGAGGAGGCTACTCAGTAGACAGTCCCACCCTCACACGATTC", + "TTTACCTTTCACTTCATCTTGCCCTTCATTATTGCAGCCCTAGCAACACTCCACCTCCTATTCTTGCACGAAACGGGATC", + "AAACAACCCCCTAGGAATCACCTCCCATTCCGATAAAATCACCTTCCACCCTTACTACACAATCAAAGACGCCCTCGGCT", + "TACTTCTCTTCCTTCTCTCCTTAATGACATTAACACTATTCTCACCAGACCTCCTAGGCGACCCAGACAATTATACCCTA", + "GCCAACCCCTTAAACACCCCTCCCCACATCAAGCCCGAATGATATTTCCTATTCGCCTACACAATTCTCCGATCCGTCCC", + "TAACAAACTAGGAGGCGTCCTTGCCCTATTACTATCCATCCTCATCCTAGCAATAATCCCCATCCTCCATATATCCAAAC", + "AACAAAGCATAATATTTCGCCCACTAAGCCAATCACTTTATTGACTCCTAGCCGCAGACCTCCTCATTCTAACCTGAATC", + "GGAGGACAACCAGTAAGCTACCCTTTTACCATCATTGGACAAGTAGCATCCGTACTATACTTCACAACAATCCTAATCCT", + "AATACCAACTATCTCCCTAATTGAAAACAAAATACTCAAATGGGCCTGTCCTTGTAGTATAAACTAATACACCAGTCTTG", + "TAAACCGGAGATGAAAACCTTTTTCCAAGGACAAATCAGAGAAAAAGTCTTTAACTCCACCATTAGCACCCAAAGCTAAG", + "ATTCTAATTTAAACTATTCTCTGTTCTTTCATGGGGAAGCAGATTTGGGTACCACCCAAGTATTGACTCACCCATCAACA", + "ACCGCTATGTATTTCGTACATTACTGCCAGCCACCATGAATATTGTACGGTACCATAAATACTTGACCACCTGTAGTACA", + "TAAAAACCCAATCCACATCAAAACCCCCTCCCCATGCTTACAAGCAAGTACAGCAATCAACCCTCAACTATCACACATCA", + "ACTGCAACTCCAAAGCCACCCCTCACCCACTAGGATACCAACAAACCTACCCACCCTTAACAGTACATAGTACATAAAGC", + "CATTTACCGTACATAGCACATTACAGTCAAATCCCTTCTCGTCCCCATGGATGACCCCCCTCAGATAGGGGTCCCTTGAC", + "CACCATCCTCCGTGAAATCAATATCCCGCACAAGAGTGCTACTCTCCTCGCTCCGGGCCCATAACACTTGGGGGTAGCTA", + "AAGTGAACTGTATCCGACATCTGGTTCCTACTTCAGGGTCATAAAGCCTAAATAGCCCACACGTTCCCCTTAAATAAGAC", + "ATCACGATG", +); + +/// The rCRS base at 1-based `pos`. +fn rcrs_base(pos: i128) -> Option { + let i = usize::try_from(pos - 1).ok()?; + RCRS.as_bytes().get(i).map(|b| char::from(*b)) +} + /// `(pos, ref, alt)` without the bases ref and alt share at the end and then /// at the start, one base always kept: Mutect2's `A>AC` of a two-ALT record /// `AC>A,ACC` becomes the same key as ClinVar's and gnomAD's. @@ -88,6 +315,72 @@ pub fn min_allele(mut pos: i128, r: &str, a: &str) -> Allele { (pos, r[k..].iter().collect(), a[k..].iter().collect()) } +/// [`min_allele`] of an indel moved to the left end of its repeat on the +/// rCRS (Tan, Abecasis and Kang 2015): m.315 C>CC and m.310 T>TC, one more C +/// in m.311-315, are both `(310, "T", "TC")`. An allele of equal lengths, +/// or whose REF is not the rCRS there (another chrM), stays as +/// [`min_allele`] gives it. +pub fn left_allele(pos: i128, r: &str, a: &str) -> Allele { + // The whole REF as written, before trimming: m.314 CG>CCG trims to a + // C>CC that is on the rCRS, but its G at m.315 is not. + let on_rcrs = r.chars().enumerate().all(|(k, c)| { + i128::try_from(k) + .ok() + .and_then(|k| rcrs_base(pos + k)) + .is_some_and(|b| b.eq_ignore_ascii_case(&c)) + }); + let (pos, r, a) = min_allele(pos, r, a); + if r.chars().count() == a.chars().count() || !on_rcrs { + return (pos, r, a); + } + let (mut p, mut r, mut a): (i128, Vec, Vec) = + (pos, r.chars().collect(), a.chars().collect()); + // Drop the shared last base; when that would empty an allele, take the + // rCRS base before it first. + while r.last().is_some() && r.last() == a.last() { + if r.len() == 1 || a.len() == 1 { + let Some(b) = rcrs_base(p - 1) else { break }; + p -= 1; + r.insert(0, b); + a.insert(0, b); + } + r.pop(); + a.pop(); + } + let (r, a): (String, String) = (r.into_iter().collect(), a.into_iter().collect()); + min_allele(p, &r, &a) +} + +/// A source's columns by allele: by its exact spelling ([`min_allele`]), +/// and by its leftmost one ([`left_allele`]) for a lookup the exact one +/// misses. The last record of a key wins. +struct ByAllele { + exact: HashMap, + left: HashMap, +} + +impl ByAllele { + fn new() -> Self { + ByAllele { + exact: HashMap::new(), + left: HashMap::new(), + } + } + + fn insert(&mut self, pos: i128, r: &str, a: &str, v: V) { + self.left.insert(left_allele(pos, r, a), v.clone()); + self.exact.insert(min_allele(pos, r, a), v); + } + + /// The exact spelling's columns, else those of the same indel spelt + /// elsewhere in its repeat. + fn get(&self, pos: i128, r: &str, a: &str) -> Option<&V> { + self.exact + .get(&min_allele(pos, r, a)) + .or_else(|| self.left.get(&left_allele(pos, r, a))) + } +} + /// `{k: v}` of a VCF INFO field; a key without `=` maps to `""`. fn info_map(field: &str) -> HashMap<&str, &str> { field @@ -129,13 +422,11 @@ type ClinVar = [String; 4]; /// gnomAD's columns for an allele: AF_hom, AF_het, max_hl. type Gnomad = [String; 3]; -/// The ClinVar records of chrM at the positions `wanted`, each read and its -/// alleles keyed in the order the Python's lookups visited them: for each -/// wanted position in order, the records starting a base before, at and a -/// base after it (ClinVar's record can start a base away from Mutect2's for -/// the same indel), the last visit winning. -fn clinvar_alleles(path: &str, wanted: &[i128]) -> Result, String> { - let mut out = HashMap::new(); +/// The ClinVar records of chrM by allele, in file order. ClinVar's record of +/// an indel can sit anywhere in its repeat, so every chrM record is read +/// (a few thousand). +fn clinvar_alleles(path: &str) -> Result, String> { + let mut out = ByAllele::new(); let mut reader = tabix::Reader::open(path).map_err(|e| format!("{}: {e}", basename(path)))?; let Some(chrom) = ["chrM", "MT"] .into_iter() @@ -143,48 +434,41 @@ fn clinvar_alleles(path: &str, wanted: &[i128]) -> Result>> = HashMap::new(); - let last = wanted.iter().copied().max().unwrap_or(0) + 1; - let end = u64::try_from(last.max(1)).unwrap_or(u64::MAX).min(1 << 29); - for line in reader.query(chrom, 0, end) { + for line in reader.query(chrom, 0, 1 << 29) { let line = line.map_err(|e| format!("{}: {e}", basename(path)))?; let line = String::from_utf8_lossy(&line).into_owned(); - let f: Vec = line.split('\t').map(str::to_owned).collect(); - if f.len() < 3 || f[1].is_empty() || !f[1].bytes().all(|b| b.is_ascii_digit()) { + let c: Vec = line.split('\t').map(str::to_owned).collect(); + if c.len() < 3 || c[1].is_empty() || !c[1].bytes().all(|b| b.is_ascii_digit()) { continue; } - let pos = int(&f[1])?; - at.entry(pos).or_default().push(f); - } - for &pos in wanted { - for q in [pos - 1, pos, pos + 1] { - if q < 1 { - continue; - } - for c in at.get(&q).into_iter().flatten() { - let i = c.get(7).map(|x| info_map(x)).unwrap_or_default(); - let g = |k: &str| i.get(k).copied().unwrap_or(".").to_owned(); - let alts = c.get(4).ok_or_else(|| { - format!("{}: a record with {} fields", basename(path), c.len()) - })?; - for alt in alts.split(',') { - out.insert( - min_allele(q, &c[3], alt), - [c[2].clone(), g("CLNSIG"), g("CLNREVSTAT"), g("CLNDN")], - ); - } - } + let q = int(&c[1])?; + if q < 1 { + continue; + } + let i = c.get(7).map(|x| info_map(x)).unwrap_or_default(); + let g = |k: &str| i.get(k).copied().unwrap_or(".").to_owned(); + let alts = c + .get(4) + .ok_or_else(|| format!("{}: a record with {} fields", basename(path), c.len()))?; + for alt in alts.split(',') { + out.insert( + q, + &c[3], + alt, + [c[2].clone(), g("CLNSIG"), g("CLNREVSTAT"), g("CLNDN")], + ); } } Ok(out) } -/// The annotation table: its two `#` header lines and its rows. +/// The annotation table: its `#` header lines (ClinVar, gnomAD, and with +/// `numt_default` the [`NUMT_DEFAULT`] line) and its rows. pub fn annotate( vcf: &str, clinvar: Option<&str>, gnomad: Option<&str>, + numt_default: bool, ) -> Result<(Vec, Vec<[String; 13]>), String> { let mut head = Vec::new(); let clinvar = match clinvar { @@ -202,7 +486,7 @@ pub fn annotate( None } }; - let mut gn: HashMap = HashMap::new(); + let mut gn: ByAllele = ByAllele::new(); match gnomad { Some(g) if is_file(g) => { head.push(format!("# gnomad\t{}\t-", basename(g))); @@ -214,30 +498,24 @@ pub fn annotate( let v = |k: &str| i.get(k).copied().unwrap_or(".").to_owned(); let pos = int(&r[1])?; for alt in r[4].split(',') { - gn.insert( - min_allele(pos, &r[3], alt), - [v("AF_hom"), v("AF_het"), v("max_hl")], - ); + gn.insert(pos, &r[3], alt, [v("AF_hom"), v("AF_het"), v("max_hl")]); } } } Some(g) => head.push(format!("# gnomad\tnot annotated\tno {g}")), None => head.push("# gnomad\tnot annotated\tno gnomAD chrM file given".into()), } + if numt_default { + head.push(NUMT_DEFAULT.to_owned()); + } let recs = vcf_records(vcf)?; - let mut cv = HashMap::new(); + let mut cv = ByAllele::new(); if let Some(c) = clinvar { - let mut wanted = Vec::new(); + // A call with a bad POS stops the run before ClinVar is read. for r in recs.iter().filter(|r| r.len() >= 5) { - let pos = int(&r[1])?; - wanted.push(pos); - for a in r[4].split(',') { - wanted.push(min_allele(pos, &r[3], a).0); - } + int(&r[1])?; } - wanted.sort_unstable(); - wanted.dedup(); - cv = clinvar_alleles(c, &wanted)?; + cv = clinvar_alleles(c)?; } let dot = || ".".to_owned(); let mut rows = Vec::new(); @@ -255,11 +533,11 @@ pub fn annotate( for (k, alt) in r[4].split(',').enumerate() { let key = min_allele(pos, &r[3], alt); let [cid, sig, rev, dn] = cv - .get(&key) + .get(pos, &r[3], alt) .cloned() .unwrap_or_else(|| [dot(), dot(), dot(), dot()]); let [hom, het, hl] = gn - .get(&key) + .get(pos, &r[3], alt) .cloned() .unwrap_or_else(|| [dot(), dot(), dot()]); rows.push([ @@ -537,7 +815,7 @@ pub fn copies(idxstats: &str) -> Result { } const ANNOTATE_USAGE: &str = - "usage: og mito annotate --vcf VCF [--clinvar VCF] [--gnomad VCF] --out F\n"; + "usage: og mito annotate --vcf VCF [--clinvar VCF] [--gnomad VCF] [--numt-default] --out F\n"; const DELETIONS_USAGE: &str = "usage: og mito deletions --eklipse CSV --out F\n"; const COPIES_USAGE: &str = "usage: og mito copies --idxstats F --out F\n"; @@ -550,6 +828,7 @@ pub fn cli(verb: Option<&str>, argv: &[String], out: &mut impl Write, err: &mut Opt("--vcf", Kind::Value, true), Opt("--clinvar", Kind::Value, false), Opt("--gnomad", Kind::Value, false), + Opt("--numt-default", Kind::Flag, false), Opt("--out", Kind::Value, true), ], ), @@ -591,7 +870,12 @@ pub fn cli(verb: Option<&str>, argv: &[String], out: &mut impl Write, err: &mut match verb { "annotate" => { let some = |k: &str| a.get(k).filter(|v| !v.is_empty()); - let (head, rows) = annotate(a.text("--vcf"), some("--clinvar"), some("--gnomad"))?; + let (head, rows) = annotate( + a.text("--vcf"), + some("--clinvar"), + some("--gnomad"), + a.flag("--numt-default"), + )?; let mut body = String::new(); for h in &head { body.push_str(h); diff --git a/rust/crates/og-summary/src/mito/tests.rs b/rust/crates/og-summary/src/mito/tests.rs index fc6e18b10..7473d76ea 100644 --- a/rust/crates/og-summary/src/mito/tests.rs +++ b/rust/crates/og-summary/src/mito/tests.rs @@ -15,6 +15,29 @@ fn min_allele_trims_the_shared_bases() { assert_eq!(k(10, "AA", "AA"), (10, "A".into(), "A".into())); } +#[test] +fn left_allele_moves_an_indel_to_the_left_end_of_its_repeat() { + let k = |p, r: &str, a: &str| left_allele(p, r, a); + let al = |p, r: &str, a: &str| (p, r.to_owned(), a.to_owned()); + // One more C in m.311-315, spelt three ways. + assert_eq!(k(315, "C", "CC"), al(310, "T", "TC")); + assert_eq!(k(312, "CC", "CCC"), al(310, "T", "TC")); + assert_eq!(k(310, "T", "TC"), al(310, "T", "TC")); + // One C fewer in m.303-309, and one more in m.16190-16193. + assert_eq!(k(308, "CC", "C"), al(302, "AC", "A")); + assert_eq!(k(16193, "C", "CC"), al(16189, "T", "TC")); + // One CA fewer in the m.514-523 CA repeat. + assert_eq!(k(521, "ACA", "A"), al(513, "GCA", "G")); + // An SNV, a REF that is not the rCRS, and nothing before m.1 stay. + assert_eq!(k(3243, "A", "G"), al(3243, "A", "G")); + assert_eq!(k(315, "G", "GG"), al(315, "G", "GG")); + // The whole REF is checked before trimming: m.314-315 is CC on the + // rCRS, so CG>CCG is off it even though its trimmed C>CC is not. + assert_eq!(k(314, "CG", "CCG"), al(314, "C", "CC")); + assert_eq!(k(1, "G", "GG"), al(1, "G", "GG")); + assert_eq!(k(16570, "A", "AA"), al(16570, "A", "AA")); +} + fn idxstats(chrm: u64, per_chrom: u64, m: &str) -> String { let mut s: String = (1..=22) .map(|i| format!("chr{i}\t50000000\t{per_chrom}\t0\n")) @@ -181,7 +204,7 @@ fn annotate_without_clinvar() { let d = Dir::new("mito-annot"); let vcf = d.put_gz("S_chrM_filtered.vcf.gz", MITO_VCF); let gn = d.put("gnomad.vcf", GNOMAD); - let (head, rows) = annotate(&vcf, Some(&d.path("cv.vcf.gz")), Some(&gn)).unwrap(); + let (head, rows) = annotate(&vcf, Some(&d.path("cv.vcf.gz")), Some(&gn), false).unwrap(); assert_eq!( head, [ @@ -233,3 +256,146 @@ fn verbs_and_usage() { assert_eq!(code, 2); assert!(err.contains("required: --idxstats"), "{err}"); } + +/// Writes `text` as a BGZF VCF with its `.tbi` and returns its path. +fn put_indexed(d: &Dir, name: &str, text: &str) -> String { + use std::fs::File; + use std::num::NonZero; + let p = d.path(name); + let mut w = og_io::bgzf::Writer::new(File::create(&p).unwrap(), NonZero::::MIN).unwrap(); + w.write_all(text.as_bytes()).unwrap(); + w.finish().unwrap(); + og_io::tabix_write::build(File::open(&p).unwrap()) + .unwrap() + .write_tbi(std::path::Path::new(&format!("{p}.tbi")), true) + .unwrap(); + p +} + +/// Indels in the D-loop poly-C tracts, each spelled at the other end of its +/// repeat from the known record: the rCRS has A at m.302, C at m.303-309, +/// T at m.310, C at m.311-315 and G at m.316. +const SHIFTED_VCF: &str = "##fileformat=VCFv4.2\n#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO\tFORMAT\tS\n\ +chrM\t302\t.\tAC\tACC\t.\tPASS\t.\tGT:AF\t0/1:0.2\n\ +chrM\t308\tdel\tCC\tC\t.\tPASS\t.\tGT:AF\t0/1:0.3\n\ +chrM\t315\tins\tC\tCC\t.\tPASS\t.\tGT:AF\t0/1:0.4\n\ +chrM\t16193\t.\tC\tCC\t.\tPASS\t.\tGT:AF\t0/1:0.5\n"; + +/// ClinVar and gnomAD spell them leftmost; ClinVar also spells the m.303 +/// insertion a base to the right of its exact match at m.302. +const SHIFTED_CLINVAR: &str = "##fileformat=VCFv4.2\n##fileDate=2026-11-01\n\ +#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO\n\ +chrM\t302\t8\tA\tAC\t.\t.\tCLNSIG=Benign;CLNREVSTAT=criteria_provided,_single_submitter;CLNDN=exact\n\ +chrM\t302\t11\tAC\tA\t.\t.\tCLNSIG=Benign;CLNREVSTAT=no_assertion_criteria_provided;CLNDN=deletion\n\ +chrM\t303\t10\tC\tCC\t.\t.\tCLNSIG=Likely_benign;CLNDN=shifted\n\ +chrM\t310\t12\tT\tTC\t.\t.\tCLNSIG=Benign;CLNREVSTAT=criteria_provided,_single_submitter;CLNDN=poly-C\n"; + +const SHIFTED_GNOMAD: &str = "##fileformat=VCFv4.2\n#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO\n\ +chrM\t302\t.\tAC\tA\t.\tPASS\tAF_hom=0.03;AF_het=0.1;max_hl=0.5\n\ +chrM\t310\t.\tT\tTC\t.\tPASS\tAF_hom=0.4;AF_het=0.3;max_hl=0.99\n\ +chrM\t16189\t.\tT\tTC\t.\tPASS\tAF_hom=0.05;AF_het=0.2;max_hl=0.98\n"; + +#[test] +fn annotate_matches_an_indel_anywhere_in_its_repeat() { + let d = Dir::new("mito-shifted"); + let vcf = d.put_gz("S_chrM_filtered.vcf.gz", SHIFTED_VCF); + let cv = put_indexed(&d, "clinvar_chr.vcf.gz", SHIFTED_CLINVAR); + let gn = d.put("gnomad.vcf", SHIFTED_GNOMAD); + let out = d.path("a.tsv"); + let (code, stdout, err) = run( + cli_of("annotate"), + &[ + "--vcf", + &vcf, + "--clinvar", + &cv, + "--gnomad", + &gn, + "--out", + &out, + ], + ); + assert_eq!(code, 0, "{err}"); + let rows: Vec> = d + .read("a.tsv") + .lines() + .filter(|l| !l.starts_with('#') && !l.starts_with("chrom\t")) + .map(|l| l.split('\t').map(str::to_owned).collect()) + .collect(); + let cols = |r: &Vec| -> Vec { + [1, 2, 3, 6, 9, 10].iter().map(|&k| r[k].clone()).collect() + }; + let want: [[&str; 6]; 4] = [ + // An exact spelling wins over a shifted one (m.303 C>CC). + ["302", "A", "AC", "8", "exact", "."], + // m.308 CC>C is m.302 AC>A, the deletion of one C of m.303-309. + ["308", "CC", "C", "11", "deletion", "0.03"], + // m.315 C>CC is m.310 T>TC, the m.310 poly-C insertion. + ["315", "C", "CC", "12", "poly-C", "0.4"], + // m.16193 C>CC is m.16189 T>TC, in the m.16184-16193 tract. + ["16193", "C", "CC", ".", ".", "0.05"], + ]; + assert_eq!(rows.iter().map(cols).collect::>(), want, "{stdout}"); + assert!( + stdout.ends_with(" 4 chrM alleles: 3 with a ClinVar record, 3 in gnomAD\n"), + "{stdout}" + ); +} + +#[test] +fn annotate_keeps_an_allele_off_the_rcrs_as_it_is() { + // A REF that is not the rCRS there (another chrM) is not moved: m.315 + // is C on the rCRS, so G>GG stays where it is. Moved over the rCRS it + // would read m.314 C>CG and meet that record. + let d = Dir::new("mito-off-rcrs"); + let vcf = d.put_gz( + "S_chrM_filtered.vcf.gz", + "##fileformat=VCFv4.2\n#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO\tFORMAT\tS\n\ + chrM\t315\t.\tG\tGG\t.\tPASS\t.\tGT:AF\t0/1:0.4\n", + ); + let gn = d.put( + "gnomad.vcf", + "#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO\n\ + chrM\t314\t.\tC\tCG\t.\tPASS\tAF_hom=0.7;AF_het=0.1;max_hl=0.9\n", + ); + let out = d.path("a.tsv"); + let (code, _, err) = run( + cli_of("annotate"), + &["--vcf", &vcf, "--gnomad", &gn, "--out", &out], + ); + assert_eq!(code, 0, "{err}"); + let row = d.read("a.tsv").lines().last().unwrap().to_owned(); + assert!(row.starts_with("chrM\t315\tG\tGG\tPASS\t0.4\t"), "{row}"); + assert!(row.ends_with("\t.\t.\t."), "{row}"); +} + +#[test] +fn annotate_says_when_the_numt_filter_had_no_depth() { + let d = Dir::new("mito-numt"); + let vcf = d.put_gz("S_chrM_filtered.vcf.gz", MITO_VCF); + let out = d.path("a.tsv"); + let (code, stdout, err) = run( + cli_of("annotate"), + &["--vcf", &vcf, "--numt-default", "--out", &out], + ); + assert_eq!(code, 0, "{err}"); + let head: Vec = d + .read("a.tsv") + .lines() + .take_while(|l| l.starts_with('#')) + .map(str::to_owned) + .collect(); + assert_eq!( + head[2], + "# numt\tNuMT filter used a default depth\tno median autosomal depth was given, \ + so it ran at depth 0 and marked no call as a possible NuMT" + ); + assert!( + stdout.contains("\n numt: NuMT filter used a default depth (no median autosomal depth"), + "{stdout}" + ); + // Without the flag the table has no numt line, as before. + let (code, _, _) = run(cli_of("annotate"), &["--vcf", &vcf, "--out", &out]); + assert_eq!(code, 0); + assert!(!d.read("a.tsv").contains("# numt")); +} diff --git a/rust/crates/og-summary/tests/i411_sf_haplotype_count.rs b/rust/crates/og-summary/tests/i411_sf_haplotype_count.rs new file mode 100644 index 000000000..496c0158f --- /dev/null +++ b/rust/crates/og-summary/tests/i411_sf_haplotype_count.rs @@ -0,0 +1,384 @@ +//! A recessive secondary finding needs two different copies of the gene. +//! +//! The ACMG SF tier used to add up the alt copies of a gene's records. So +//! two MUTYH variants that read-backed phase puts on one copy (cis), a +//! combined allele counted with its own parts, or a record with no alt copy +//! called could complete the two hits MUTYH needs. These cases run the tier +//! on synthetic hits with the shipped `assets/acmg_sf.tsv`. + +use indexmap::IndexMap; +use og_summary::collect::acmg::{ClinicalVcf, HighRecord, Inputs, acmg_sf}; +use og_summary::collect::clinvar::{Floor, HitRecords}; +use og_summary::collect::two_hits::DeletionInputs; +use pycompat::json::Value; + +const ASSETS: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/../../../assets"); + +// Two public MUTYH pathogenic sites (GRCh38). +const A: (i128, &str, &str) = (45_331_556, "C", "T"); +const B: (i128, &str, &str) = (45_332_803, "T", "C"); + +/// One step 06 hit in `gene`, Pathogenic with 2 stars, GT and PS as given, +/// and `info` added to INFO. +fn hit( + site: (i128, &str, &str), + gene: &str, + gt: &str, + ps: Option<&str>, + info: &str, +) -> Vec { + let (fmt, sample) = match ps { + Some(p) => ("GT:GQ:DP:PS", format!("{gt}:50:30:{p}")), + None => ("GT:GQ:DP", format!("{gt}:50:30")), + }; + let info = format!( + "GENEINFO={gene}:1;CLNSIG=Pathogenic;\ + CLNREVSTAT=criteria_provided,_multiple_submitters,_no_conflicts{info}" + ); + [ + "chr1", + &site.0.to_string(), + ".", + site.1, + site.2, + ".", + "PASS", + &info, + fmt, + &sample, + ] + .iter() + .map(|s| (*s).to_owned()) + .collect() +} + +fn no_deletions() -> DeletionInputs { + DeletionInputs { + annotsv: Ok(None), + step35: Ok(None), + } +} + +fn tier( + hits: Vec>, + high: IndexMap<(String, i128, String, String), HighRecord>, +) -> Value { + let h: Result = Ok((Floor::default(), hits)); + let c: Result = Ok(ClinicalVcf { + records: high.len(), + high: Ok(high), + }); + let d = no_deletions(); + acmg_sf(&Inputs { + assets: ASSETS, + hits: Some(&h), + clinical: Some(&c), + deletions: &d, + }) + .unwrap() +} + +fn rows<'a>(v: &'a Value, k: &str) -> Vec<&'a IndexMap> { + let Value::Object(m) = v else { panic!("{v:?}") }; + let Some(Value::Array(a)) = m.get(k) else { + panic!("{k}: {v:?}") + }; + a.iter() + .map(|x| match x { + Value::Object(o) => o, + _ => panic!("{x:?}"), + }) + .collect() +} + +fn s<'a>(m: &'a IndexMap, k: &str) -> &'a str { + match m.get(k) { + Some(Value::Str(x)) => x, + x => panic!("{k}: {x:?} in {m:?}"), + } +} + +type Row<'a> = &'a IndexMap; + +/// The MUTYH rows of the reported ClinVar hits and of `not_reported`. +fn mutyh(v: &Value) -> (Vec>, Vec>) { + let rep = rows(v, "clinvar_hits") + .into_iter() + .filter(|m| s(m, "gene") == "MUTYH") + .collect(); + let apart = rows(v, "not_reported") + .into_iter() + .filter(|m| s(m, "gene") == "MUTYH") + .collect(); + (rep, apart) +} + +fn none() -> IndexMap<(String, i128, String, String), HighRecord> { + IndexMap::new() +} + +#[test] +fn two_variants_phased_on_one_copy_are_no_finding() { + let v = tier( + vec![ + hit(A, "MUTYH", "0|1", Some("7"), ""), + hit(B, "MUTYH", "0|1", Some("7"), ""), + ], + none(), + ); + let (rep, apart) = mutyh(&v); + assert!(rep.is_empty(), "a cis pair was reported: {rep:?}"); + assert_eq!(apart.len(), 2, "{apart:?}"); + for m in apart { + let r = s(m, "reason"); + assert!( + r.starts_with("two heterozygous variants in cis") && r.contains("phase set 7"), + "{r}" + ); + } +} + +#[test] +fn two_variants_phased_on_different_copies_are_biallelic() { + let v = tier( + vec![ + hit(A, "MUTYH", "0|1", Some("7"), ""), + hit(B, "MUTYH", "1|0", Some("7"), ""), + ], + none(), + ); + let (rep, apart) = mutyh(&v); + assert!(apart.is_empty(), "{apart:?}"); + assert_eq!(rep.len(), 2); + for m in rep { + assert_eq!(s(m, "pair"), "biallelic"); + assert!(s(m, "phase").starts_with("in trans"), "{}", s(m, "phase")); + } +} + +#[test] +fn unphased_or_unlinked_pairs_are_reported_as_possibly_biallelic() { + for (ga, pa, gb, pb) in [ + ("0/1", None, "0/1", None), + // Two phase sets link nothing. + ("0|1", Some("7"), "0|1", Some("8")), + // A "|" GT with no phase set is not phased. + ("0|1", None, "0|1", None), + // A half call never puts its alt on a known copy. + ("1|.", Some("7"), "0|1", Some("7")), + ] { + let v = tier( + vec![hit(A, "MUTYH", ga, pa, ""), hit(B, "MUTYH", gb, pb, "")], + none(), + ); + let (rep, apart) = mutyh(&v); + assert!(apart.is_empty(), "{ga} {gb}: {apart:?}"); + assert_eq!(rep.len(), 2, "{ga} {gb}"); + for m in rep { + assert_eq!(s(m, "pair"), "possibly biallelic", "{ga} {gb}"); + assert!(s(m, "phase").starts_with("phase unknown"), "{ga} {gb}"); + } + } +} + +#[test] +fn the_two_alt_alleles_of_one_split_call_are_biallelic() { + let v = tier( + vec![ + hit((A.0, "C", "T"), "MUTYH", "1/.", None, ""), + hit((A.0, "C", "G"), "MUTYH", "./1", None, ""), + ], + none(), + ); + let (rep, _) = mutyh(&v); + assert_eq!(rep.len(), 2); + for m in rep { + assert_eq!(s(m, "pair"), "biallelic"); + assert!( + s(m, "phase").starts_with("in trans: the two alt alleles of one call"), + "{}", + s(m, "phase") + ); + } +} + +#[test] +fn a_homozygote_is_biallelic_and_one_heterozygote_is_not() { + let v = tier(vec![hit(A, "MUTYH", "1/1", None, "")], none()); + let (rep, _) = mutyh(&v); + assert_eq!(rep.len(), 1); + assert_eq!(s(rep[0], "pair"), "biallelic"); + assert!(s(rep[0], "phase").starts_with("homozygous")); + let v = tier(vec![hit(A, "MUTYH", "0/1", None, "")], none()); + let (rep, apart) = mutyh(&v); + assert!(rep.is_empty()); + assert!(s(apart[0], "reason").starts_with("one heterozygous variant;")); +} + +#[test] +fn a_record_with_no_alt_copy_called_completes_no_pair() { + for gt in ["./.", "0/0"] { + let v = tier( + vec![ + hit(A, "MUTYH", "0/1", None, ""), + hit(B, "MUTYH", gt, None, ""), + ], + none(), + ); + let (rep, apart) = mutyh(&v); + assert!(rep.is_empty(), "GT {gt}: {rep:?}"); + assert_eq!(apart.len(), 2); + let none_row = apart + .iter() + .find(|m| s(m, "variant").contains("45332803")) + .unwrap(); + assert!( + s(none_row, "reason").starts_with("no alt copy called"), + "{gt}" + ); + } +} + +// A combined allele of step 06 and its parts (chr1:100 AGC>A and chr1:105 +// T>TGGG joined as chr1:101 GCCAT>CATGGG). +const PART1: (i128, &str, &str) = (100, "AGC", "A"); +const PART2: (i128, &str, &str) = (105, "T", "TGGG"); +const WHOLE: (i128, &str, &str) = (101, "GCCAT", "CATGGG"); +const JOINED: &str = ";PGP_JOINED_FROM=chr1:100:AGC:A|chr1:105:T:TGGG"; +const PART_OF: &str = ";PGP_PART_OF=chr1:101:GCCAT:CATGGG"; + +#[test] +fn a_combined_allele_counts_once_with_its_part() { + let v = tier( + vec![ + hit(PART1, "MUTYH", "0/1", None, PART_OF), + hit(WHOLE, "MUTYH", "0/1", None, JOINED), + ], + none(), + ); + let (rep, apart) = mutyh(&v); + assert!(rep.is_empty(), "one allele was reported as two: {rep:?}"); + assert_eq!(apart.len(), 2); + assert!( + s(apart[0], "reason").contains("a combined allele and its parts count once"), + "{}", + s(apart[0], "reason") + ); +} + +#[test] +fn a_phased_combined_allele_counts_once_with_both_parts() { + let v = tier( + vec![ + hit(PART1, "MUTYH", "0|1", Some("90"), PART_OF), + hit(WHOLE, "MUTYH", "0|1", Some("90"), JOINED), + hit(PART2, "MUTYH", "0|1", Some("90"), PART_OF), + ], + none(), + ); + let (rep, apart) = mutyh(&v); + assert!(rep.is_empty(), "{rep:?}"); + assert_eq!(apart.len(), 3); +} + +#[test] +fn an_unphased_combined_allele_with_two_candidate_parts_counts_its_parts() { + // The two parts may sit on different copies: possibly biallelic. + let v = tier( + vec![ + hit(PART1, "MUTYH", "0/1", None, PART_OF), + hit(WHOLE, "MUTYH", "0/1", None, JOINED), + hit(PART2, "MUTYH", "0/1", None, PART_OF), + ], + none(), + ); + let (rep, apart) = mutyh(&v); + assert!(apart.is_empty(), "{apart:?}"); + assert_eq!(rep.len(), 3); + assert!(rep.iter().all(|m| s(m, "pair") == "possibly biallelic")); + let whole = rep + .iter() + .find(|m| s(m, "variant").contains("GCCAT")) + .unwrap(); + assert!( + s(whole, "combined_allele") + .ends_with("unphased, so the parts may sit on different haplotypes"), + "{}", + s(whole, "combined_allele") + ); +} + +#[test] +fn a_part_found_as_a_high_impact_record_counts_once_with_the_combined_allele() { + let mut genes = IndexMap::new(); + genes.insert("MUTYH".to_owned(), "frameshift_variant".to_owned()); + let mut high = IndexMap::new(); + high.insert( + ( + "chr1".to_owned(), + PART1.0, + PART1.1.to_owned(), + PART1.2.to_owned(), + ), + HighRecord { + genotype: "0/1".into(), + ps: None, + genes, + transcript: "MANE", + frequency: "rare", + weak: false, + why: Vec::new(), + gq: Some(50), + dp: Some(30), + ad: None, + }, + ); + let v = tier(vec![hit(WHOLE, "MUTYH", "0/1", None, JOINED)], high); + let (rep, _) = mutyh(&v); + assert!(rep.is_empty(), "{rep:?}"); + assert!( + rows(&v, "high_impact") + .iter() + .all(|m| s(m, "gene") != "MUTYH"), + "the part was reported as a second hit" + ); +} + +#[test] +fn a_combined_allele_with_an_unrelated_variant_is_still_two() { + let v = tier( + vec![ + hit(PART1, "MUTYH", "0/1", None, PART_OF), + hit(WHOLE, "MUTYH", "0/1", None, JOINED), + hit(A, "MUTYH", "0/1", None, ""), + ], + none(), + ); + let (rep, apart) = mutyh(&v); + assert!(apart.is_empty(), "{apart:?}"); + assert_eq!(rep.len(), 3); +} + +#[test] +fn a_hemizygous_rule_gene_also_counts_copies_not_records() { + // ABCD1 (rule hemizygous): two heterozygous variants of a woman in cis + // are one copy. + let v = tier( + vec![ + hit(A, "ABCD1", "0|1", Some("3"), ""), + hit(B, "ABCD1", "0|1", Some("3"), ""), + ], + none(), + ); + assert!( + rows(&v, "clinvar_hits") + .iter() + .all(|m| s(m, "gene") != "ABCD1") + ); + let apart: Vec<_> = rows(&v, "not_reported") + .into_iter() + .filter(|m| s(m, "gene") == "ABCD1") + .collect(); + assert_eq!(apart.len(), 2); + assert!(s(apart[0], "reason").contains("in cis")); +} diff --git a/rust/crates/og-summary/tests/screen_acmg_card_section.rs b/rust/crates/og-summary/tests/screen_acmg_card_section.rs new file mode 100644 index 000000000..c3bb2b1d7 --- /dev/null +++ b/rust/crates/og-summary/tests/screen_acmg_card_section.rs @@ -0,0 +1,460 @@ +//! The ACMG secondary-findings card is its own section, `acmg_sf`, and +//! follows step 06: a run without the VEP cache (no step 23, no +//! `clinical/` folder) still gets it from the ClinVar hits. +//! +//! 1. Red first: a folder with step 06's hits (a BRCA2 P/LP heterozygote, +//! two MUTYH heterozygotes) and no `clinical/` folder. Before the +//! section existed it got no card at all. +//! 2. Agreement: every summary-collect parity folder of group b +//! (`tests/parity/gen/summary-clinical.sh`) that has both the hits and +//! the clinical VCF, collected as it is and again without `clinical/`. +//! Without step 23 the card may lose only what the HIGH-impact source +//! brings: (a) every ClinVar row of the card without VEP is in the card +//! with VEP, unchanged, but for the gene's `pair` and `phase` when a +//! HIGH-impact row of its gene joined it; (b) every gene reported without VEP is reported +//! with VEP; (c) a row not reported without VEP stays as it is, or is +//! reported with VEP because a HIGH-impact row of its gene joined it. + +use og_summary::collect::{Group, Input, group_b, post}; +use pycompat::json::Value; +use std::path::{Path, PathBuf}; +use std::process::Command; + +fn repo() -> PathBuf { + Path::new(env!("CARGO_MANIFEST_DIR")).join("../../..") +} + +fn scratch(name: &str) -> PathBuf { + let d = std::env::temp_dir().join(format!("og-screen-acmg-{name}-{}", std::process::id())); + let _ = std::fs::remove_dir_all(&d); + std::fs::create_dir_all(&d).unwrap(); + d +} + +fn put(p: &Path, text: &str) { + std::fs::create_dir_all(p.parent().unwrap()).unwrap(); + std::fs::write(p, text).unwrap(); +} + +fn input(dir: &Path, assets: &Path, group: Group) -> Input { + Input { + sample: "S".into(), + sample_dir: dir.to_str().unwrap().to_owned(), + declared_sex: None, + assets: assets.to_str().unwrap().to_owned(), + group, + tables: og_summary::collect::group_c::util::default_tables(), + } +} + +/// The sections of group b, as summary.json writes them. +fn sections_b(dir: &Path, assets: &Path) -> Value { + let v = group_b::collect(&input(dir, assets, Group::B)) + .unwrap() + .to_json(); + at(&v, &["sections"]).clone() +} + +fn at<'a>(v: &'a Value, path: &[&str]) -> &'a Value { + path.iter().fold(v, |v, k| match v { + Value::Object(m) => m + .get(*k) + .unwrap_or_else(|| panic!("no {k} in {path:?}: {v:?}")), + _ => panic!("{path:?} is no object at {k}"), + }) +} + +fn get<'a>(v: &'a Value, k: &str) -> Option<&'a Value> { + match v { + Value::Object(m) => m.get(k), + _ => None, + } +} + +fn s(v: &Value) -> &str { + match v { + Value::Str(x) => x, + _ => panic!("no string: {v:?}"), + } +} + +fn rows(card: &Value, list: &str) -> Vec { + match get(card, list) { + Some(Value::Array(a)) => a.clone(), + None => Vec::new(), + Some(x) => panic!("{list} is no list: {x:?}"), + } +} + +fn gene_variant(r: &Value) -> (String, String) { + ( + s(at(r, &["gene"])).to_owned(), + s(at(r, &["variant"])).to_owned(), + ) +} + +const HITS_HEAD: &str = "##fileformat=VCFv4.2\n##PGP_CALL_FLOOR=GQ=20,DP=8\n\ +#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO\tFORMAT\tS\n"; +const PL: &str = "CLNREVSTAT=criteria_provided,_multiple_submitters,_no_conflicts"; + +/// Step 06's hits: a BRCA2 P/LP heterozygote and two MUTYH heterozygotes. +fn hits() -> String { + format!( + "{HITS_HEAD}\ +chr13\t32340300\t1\tC\tT\t.\tPASS\tGENEINFO=BRCA2:675;CLNSIG=Pathogenic;{PL}\tGT:GQ:DP\t0/1:60:35\n\ +chr1\t45331556\t2\tC\tT\t.\tPASS\tGENEINFO=MUTYH:4595;CLNSIG=Pathogenic;{PL}\tGT:GQ:DP\t0/1:50:30\n\ +chr1\t45332400\t3\tG\tA\t.\tPASS\tGENEINFO=MUTYH:4595;CLNSIG=Likely_pathogenic;{PL}\tGT:GQ:DP\t0/1:55:32\n" + ) +} + +#[test] +fn a_run_without_step_23_gets_the_card_from_the_clinvar_hits() { + let d = scratch("red"); + let sd = d.join("S"); + put(&sd.join("clinvar/S_clinvar_hits.vcf"), &hits()); + let assets = repo().join("assets"); + let secs = sections_b(&sd, &assets); + assert!( + get(&secs, "clinical").is_some_and(|c| s(at(c, &["state"])) == "missing"), + "no clinical section: step 23 did not run" + ); + let sec = get(&secs, "acmg_sf").expect("summary.json has no acmg_sf section"); + assert_eq!(s(at(sec, &["state"])), "ok", "{sec:?}"); + assert_eq!(s(at(sec, &["title"])), "ACMG secondary findings"); + assert_eq!( + s(at(sec, &["source"])), + "clinvar/S_clinvar_hits.vcf", + "the section's file is step 06's" + ); + let card = at(sec, &["data"]); + assert_eq!(at(card, &["genes_on_list"]), &Value::Int(84)); + let reported: Vec<(String, String)> = rows(card, "clinvar_hits") + .iter() + .map(|r| { + let rule = s(at(r, &["rule"])).to_owned(); + (s(at(r, &["gene"])).to_owned(), rule) + }) + .collect(); + assert_eq!( + reported, + [ + ("BRCA2".to_owned(), "All P and LP".to_owned()), + ("MUTYH".to_owned(), "P and LP (2 variants)".to_owned()), + ("MUTYH".to_owned(), "P and LP (2 variants)".to_owned()), + ], + "BRCA2 and the MUTYH pair are reported under their rules" + ); + assert!(rows(card, "not_reported").is_empty(), "{card:?}"); + assert_eq!(at(card, &["clinvar_checked"]), &Value::Bool(true)); + assert_eq!(at(card, &["high_impact_checked"]), &Value::Bool(false)); + let note = s(at(card, &["high_impact_note"])); + assert!( + note.starts_with( + "Rare HIGH-impact variants were not screened: step 23 (clinical filter) did not run" + ) && note.contains("not in ClinVar"), + "{note}" + ); + + // The run status gives step 23's reason; a failed step 23 is named. + let skip = + "skipped (needs VEP, data not installed: vep_cache/homo_sapiens/116_GRCh38/info.txt)"; + for (word, want) in [ + (skip, format!("step 23 (clinical filter) was {skip}")), + ( + "failed (exit 1)", + "step 23 (clinical filter) failed (exit 1)".to_owned(), + ), + ] { + put( + &sd.join("logs/run_status.tsv"), + &format!("meta\tstarted_utc\t2020-01-01 00:00 UTC\nstep\t06\tok\nstep\t23\t{word}\n"), + ); + let secs = sections_b(&sd, &assets); + let note = s(at(&secs, &["acmg_sf", "data", "high_impact_note"])).to_owned(); + assert!(note.contains(&want), "{note}"); + } +} + +#[test] +fn the_section_follows_step_06_and_is_never_a_not_run_line_of_its_own() { + let d = scratch("state"); + let sd = d.join("S"); + std::fs::create_dir_all(&sd).unwrap(); + let assets = repo().join("assets"); + let secs = sections_b(&sd, &assets); + assert_eq!(s(at(&secs, &["acmg_sf", "state"])), "missing"); + put( + &sd.join("logs/run_status.tsv"), + "meta\tstarted_utc\t2020-01-01 00:00 UTC\nstep\t06\tfailed (exit 2)\n", + ); + let secs = sections_b(&sd, &assets); + assert_eq!(s(at(&secs, &["acmg_sf", "state"])), "failed"); + assert!(s(at(&secs, &["acmg_sf", "note"])).starts_with("step 06 failed")); + // The whole summary: ClinVar screen names the failed step once. + let all = post::collect(&input(&sd, &assets, Group::All)).unwrap(); + let not_run: Vec<&str> = match at(&all, &["not_run"]) { + Value::Array(a) => a.iter().map(s).collect(), + x => panic!("{x:?}"), + }; + assert!( + not_run.contains(&"ClinVar screen (step 06 failed)"), + "{not_run:?}" + ); + assert!( + !not_run + .iter() + .any(|l| l.starts_with("ACMG secondary findings")), + "{not_run:?}" + ); +} + +/// The parity folders of group b, written by their generator. +fn parity_folders(d: &Path) -> PathBuf { + let script = repo().join("tests/parity/gen/summary-clinical.sh"); + let st = Command::new("bash") + .arg(&script) + .current_dir(d) + .env("NO_ORACLE", "1") + .status() + .expect("bash runs"); + assert!(st.success(), "{} failed", script.display()); + for f in ["cb_vep.vcf.gz", "cb_vep.vcf.gz.tbi"] { + std::fs::copy( + repo().join("tests/parity/inputs/summary-collect").join(f), + d.join(f), + ) + .unwrap(); + } + d.join("assets") +} + +/// Copies `from` to `to`, all but its `clinical/` folder (symlinks kept). +fn copy_without_clinical(from: &Path, to: &Path) { + let st = Command::new("cp") + .arg("-PR") + .arg(from) + .arg(to) + .status() + .unwrap(); + assert!(st.success()); + std::fs::remove_dir_all(to.join("clinical")).unwrap(); +} + +/// The three rules of the module doc, for one folder: the reasons it +/// breaks them, none when it keeps them. +fn agreement(with: &Value, without: &Value) -> Vec { + let mut bad = Vec::new(); + let high_genes: Vec = rows(with, "high_impact") + .iter() + .map(|r| gene_variant(r).0) + .collect(); + let with_cv = rows(with, "clinvar_hits"); + let without_cv = rows(without, "clinvar_hits"); + // (a) every ClinVar row without VEP, unchanged with VEP. `pair` and + // `phase` are the gene's verdict, not the row's: a HIGH-impact row of + // the gene can change which pair it names. + let own = |r: &Value| match r { + Value::Object(m) => { + let mut m = m.clone(); + m.shift_remove("pair"); + m.shift_remove("phase"); + Value::Object(m) + } + v => v.clone(), + }; + for r in &without_cv { + let regated = + high_genes.contains(&gene_variant(r).0) && with_cv.iter().any(|w| own(w) == own(r)); + if !with_cv.contains(r) && !regated { + bad.push(format!( + "(a) ClinVar row without VEP not in the card with VEP: {r:?}" + )); + } + } + // (a') a ClinVar row only with VEP is one (c) explains. + let reported_with: Vec<(String, String)> = ["clinvar_hits", "high_impact", "structural"] + .iter() + .flat_map(|l| rows(with, l)) + .map(|r| gene_variant(&r)) + .collect(); + let not_without: Vec<(String, String)> = rows(without, "not_reported") + .iter() + .map(gene_variant) + .collect(); + for r in &with_cv { + if !without_cv.contains(r) { + let gv = gene_variant(r); + let moved = not_without.contains(&gv) && high_genes.contains(&gv.0); + // A row whose fields grew (a two-hit line) is the same row. + let same = without_cv.iter().any(|w| gene_variant(w) == gv); + if !(moved || same) { + bad.push(format!( + "(a) ClinVar row only with VEP, not explained: {r:?}" + )); + } + } + } + // (b) every gene reported without VEP is reported with VEP. + for (g, _) in ["clinvar_hits", "structural"] + .iter() + .flat_map(|l| rows(without, l)) + .map(|r| gene_variant(&r)) + { + if !reported_with.iter().any(|(h, _)| *h == g) { + bad.push(format!("(b) {g} reported without VEP, not with VEP")); + } + } + // (c) a not-reported row stays, or is reported because a HIGH-impact + // row of its gene joined it. + let not_with = rows(with, "not_reported"); + for r in rows(without, "not_reported") { + let gv = gene_variant(&r); + let stays = not_with.contains(&r); + let joined = reported_with.contains(&gv) && high_genes.contains(&gv.0); + if !(stays || joined) { + bad.push(format!( + "(c) not reported without VEP, neither kept nor joined: {r:?}" + )); + } + } + bad +} + +#[test] +fn without_the_clinical_vcf_the_card_loses_only_what_the_high_impact_source_brings() { + let d = scratch("agree"); + let assets = parity_folders(&d); + let mut compared = Vec::new(); + let mut moved = 0; + let mut names: Vec<_> = std::fs::read_dir(&d) + .unwrap() + .map(|e| e.unwrap().path()) + .filter(|p| p.join("clinvar/S_clinvar_hits.vcf").is_file() && p.join("clinical").is_dir()) + .collect(); + names.sort(); + for dir in names { + let name = dir.file_name().unwrap().to_str().unwrap().to_owned(); + let bare = d.join(format!("{name}.noclinical")); + copy_without_clinical(&dir, &bare); + let with = sections_b(&dir, &assets); + let without = sections_b(&bare, &assets); + let wsec = at(&with, &["acmg_sf"]); + let nsec = at(&without, &["acmg_sf"]); + if s(at(wsec, &["state"])) != "ok" { + // A hits VCF that cannot be read is the same note either way. + assert_eq!(wsec, nsec, "{name}"); + continue; + } + let (w, n) = (at(wsec, &["data"]), at(nsec, &["data"])); + assert_eq!( + at(n, &["high_impact_checked"]), + &Value::Bool(false), + "{name}" + ); + assert!( + s(at(n, &["high_impact_note"])).contains("did not run") + || s(at(n, &["high_impact_note"])).contains("wrote no clinical VCF"), + "{name}: {n:?}" + ); + if at(w, &["high_impact_checked"]) == &Value::Bool(false) { + // The clinical VCF is there and cannot be read: the card keeps + // its ClinVar rows and says why. + assert!( + s(at(w, &["high_impact_note"])).contains("clinical VCF cannot be read"), + "{name}: {w:?}" + ); + assert_eq!(rows(w, "clinvar_hits"), rows(n, "clinvar_hits"), "{name}"); + continue; + } + assert!(get(w, "high_impact_note").is_none(), "{name}: {w:?}"); + // The clinical section's own tier, with the same inputs, agrees. + assert_eq!( + Some(w), + get(at(&with, &["clinical", "data"]), "acmg_sf"), + "{name}: the card and the clinical section's tier differ" + ); + let bad = agreement(w, n); + assert!(bad.is_empty(), "{name}:\n{}", bad.join("\n")); + let not_with = rows(w, "not_reported"); + let n_moved = rows(n, "not_reported") + .iter() + .filter(|r| !not_with.contains(r)) + .count(); + eprintln!( + "{name}: ClinVar rows {} without VEP, {} with; not reported {} without, {} with; {n_moved} joined", + rows(n, "clinvar_hits").len(), + rows(w, "clinvar_hits").len(), + rows(n, "not_reported").len(), + not_with.len() + ); + moved += n_moved; + compared.push(name); + } + let _ = std::fs::remove_dir_all(&d); + assert!( + compared.len() >= 5, + "only {compared:?} compared: the generator lost its folders" + ); + assert!( + moved > 0, + "no row moved from not reported to reported with VEP: the folders no longer test rule (c)" + ); +} + +/// A clinical VCF left by an earlier run (step 23 not ok in this run, the +/// VCF written before the run started) is still read, and the card says +/// its HIGH-impact source is from that earlier run. With step 23 ok in +/// this run, or a VCF of this run, the card has no such note. +#[test] +fn a_clinical_vcf_of_an_earlier_run_is_named_in_the_card() { + let d = scratch("earlier"); + let assets = parity_folders(&d); + let mut names: Vec<_> = std::fs::read_dir(&d) + .unwrap() + .map(|e| e.unwrap().path()) + .filter(|p| p.join("clinvar/S_clinvar_hits.vcf").is_file() && p.join("clinical").is_dir()) + .collect(); + names.sort(); + let dir = names + .into_iter() + .find(|p| { + let secs = sections_b(p, &assets); + s(at(&secs, &["acmg_sf", "state"])) == "ok" + && at(&secs, &["acmg_sf", "data", "high_impact_checked"]) == &Value::Bool(true) + }) + .expect("a parity folder with a readable clinical VCF"); + let now = std::time::SystemTime::now() + .duration_since(std::time::UNIX_EPOCH) + .unwrap() + .as_secs(); + let status = |started: u64, step23: &str| { + put( + &dir.join("logs/run_status.tsv"), + &format!("meta\tstarted_epoch\t{started}\nstep\t06\tok\nstep\t23\t{step23}\n"), + ); + sections_b(&dir, &assets) + }; + // The run started after the VCF was written, and step 23 failed in it. + let secs = status(now + 3600, "failed (exit 1)"); + let card = at(&secs, &["acmg_sf", "data"]); + assert_eq!(at(card, &["high_impact_checked"]), &Value::Bool(true)); + let note = s(at(card, &["high_impact_note"])); + assert!( + note.starts_with( + "Rare HIGH-impact variants come from the clinical VCF of an earlier run (" + ) && note.ends_with("step 23 (clinical filter) was failed (exit 1) in this run."), + "{note}" + ); + assert_eq!(s(at(&secs, &["clinical", "state"])), "stale"); + // Step 23 ok in this run, or a VCF written after the run started (the + // generator dates its files in 2021, so a run of 1970 is before them): + // no note. + for (started, step23) in [(now + 3600, "ok"), (1, "failed (exit 1)")] { + let secs = status(started, step23); + assert!( + get(at(&secs, &["acmg_sf", "data"]), "high_impact_note").is_none(), + "{started} {step23}: {secs:?}" + ); + } + let _ = std::fs::remove_dir_all(&d); +} diff --git a/scripts/10-telomere-hunter.sh b/scripts/10-telomere-hunter.sh index 1e5dff7f1..5d68f5cbc 100755 --- a/scripts/10-telomere-hunter.sh +++ b/scripts/10-telomere-hunter.sh @@ -1,7 +1,8 @@ #!/usr/bin/env bash -# TelomereHunter — Estimate telomere length from WGS BAM -# Output: tel_content metric (GC-corrected telomeric reads per million) -# Higher values = longer telomeres. Provides biological age baseline. +# TelomereHunter2: relative telomere content from a WGS BAM +# Output: tel_content (intratelomeric reads per million reads with 48-52% GC). +# A higher value means more telomeric sequence. It is a relative research +# measure for comparing samples from one platform, not an age. set -euo pipefail SAMPLE=${1:?Usage: $0 } @@ -29,40 +30,39 @@ done mkdir -p "$OUTPUT_DIR" -# TelomereHunter sorts reads into intratelomeric, subtelomeric and junction -# classes by chromosome band, and without -b it uses its own hg19 bands -# (`telomerehunter --help`: "If no banding file is specified, the banding -# information of hg19 will be used"). The BAM is GRCh38, so UCSC's GRCh38 -# bands (installed by setup.sh) are passed. -BAND_ARGS=() -if BANDS=$(data_file cytoband); then - echo "Chromosome bands: ${BANDS}" - BAND_ARGS=(-b "$(cpath "$BANDS")") -else - echo "WARNING: the GRCh38 chromosome bands are not installed (${BANDS})." - echo " TelomereHunter falls back to its hg19 bands, so the subtelomeric and" - echo " junction read classes use hg19 band ends on GRCh38 positions." - echo " Install the bands with: ./scripts/setup.sh ${GENOME_DIR}" +# TelomereHunter2 sorts telomeric reads into intratelomeric, subtelomeric and +# junction classes by chromosome band. The BAM is GRCh38, so it always gets +# UCSC's GRCh38 bands: the copy setup.sh installs, or, when that is missing, +# the one the repository ships (assets/reference), installed here first. +if ! BANDS=$(data_file cytoband); then + echo "The GRCh38 chromosome bands are not installed (${BANDS}); installing the copy in assets/reference." + if ! install_data_file cytoband; then + echo "ERROR: could not install the GRCh38 chromosome bands to ${BANDS}" >&2 + exit 1 + fi fi +echo "Chromosome bands: ${BANDS}" -# TelomereHunter has no thread option; THREADS caps the container. -# --plotNone: the Bioconda build's plots fail (its R has no dplyr, and its -# PyPDF2 is written for Python 3, which stops the run after the summary is -# written). The summary and the TVR tables do not need them. +# -c: TelomereHunter2's worker count, THREADS as the container's CPU cap. +# --ulimit: it writes one BAM per contig and merges them at once. A BAM with +# decoy contigs (the HG002 test BAM has 2,580) needs more than the 1,024 open +# files a container gets by default ("Too many open files"). +# --plotNone: nothing in the pipeline reads its plots. run_in \ - --cpus "$THREADS" --memory 4g \ + --cpus "$THREADS" --memory 4g --ulimit nofile=65536:65536 \ "${TELOMEREHUNTER_IMAGE}" \ - telomerehunter \ + telomerehunter2 \ -ibt "/genome/${SAMPLE}/${ALIGN_DIR}/${SAMPLE}_sorted.bam" \ -o "/genome/${SAMPLE}/telomere/${SAMPLE}" \ -p "$SAMPLE" \ + -c "$THREADS" \ --plotNone \ - ${BAND_ARGS[@]+"${BAND_ARGS[@]}"} + -b "$(cpath "$BANDS")" echo "=== TelomereHunter complete ===" SUMMARY="${OUTPUT_DIR}/${SAMPLE}/${SAMPLE}_summary.tsv" if [ -f "$SUMMARY" ]; then echo "Summary: $SUMMARY" - TEL_CONTENT=$(awk -F'\t' 'NR==2 {print $11}' "$SUMMARY") + TEL_CONTENT=$(awk -F'\t' 'NR == 1 {for (i = 1; i <= NF; i++) if ($i == "tel_content") c = i; next} NR == 2 && c {print $c}' "$SUMMARY") echo "Telomere content: ${TEL_CONTENT}" fi diff --git a/scripts/20-mtoolbox.sh b/scripts/20-mtoolbox.sh index b4baa2cf4..f41cb050d 100755 --- a/scripts/20-mtoolbox.sh +++ b/scripts/20-mtoolbox.sh @@ -11,7 +11,8 @@ # the autosomes. GATK's NuMTFilterTool marks an allele as possible_numt when # its depth is what such copies could explain at the sample's median autosomal # coverage. That median is read from step 16b's mosdepth output, or taken from -# AUTOSOMAL_COVERAGE; without either the filter marks nothing. +# AUTOSOMAL_COVERAGE; without either the filter runs at depth 0 and marks +# nothing: the step warns, and the annotation table's '# numt' line says so. # # Last, each call is annotated with its ClinVar record (clinvar/clinvar_chr.vcf.gz, # which setup.sh installs) and with gnomAD v3.1's chrM sites (GNOMAD_MITO_URL in @@ -99,6 +100,7 @@ echo "[5/8] Marking possible NuMTs..." # Median autosomal depth: the depth at which half of the chr1-22 bases are # covered at least that deep, from mosdepth's per-chromosome distribution. MOSDEPTH_PREFIX="${SAMPLE_DIR}/mosdepth/${SAMPLE}.mosdepth" +NUMT_DEFAULT= if [ -n "${AUTOSOMAL_COVERAGE:-}" ]; then echo " Median autosomal coverage: ${AUTOSOMAL_COVERAGE} (AUTOSOMAL_COVERAGE)" elif [ -s "${MOSDEPTH_PREFIX}.summary.txt" ] && [ -s "${MOSDEPTH_PREFIX}.global.dist.txt" ]; then @@ -114,8 +116,9 @@ elif [ -s "${MOSDEPTH_PREFIX}.summary.txt" ] && [ -s "${MOSDEPTH_PREFIX}.global. echo " Median autosomal coverage: ${AUTOSOMAL_COVERAGE} (from ${MOSDEPTH_PREFIX}.global.dist.txt)" else AUTOSOMAL_COVERAGE=0 + NUMT_DEFAULT=--numt-default echo " WARNING: no mosdepth output (run scripts/16b-mosdepth.sh first) and no AUTOSOMAL_COVERAGE:" - echo " the NuMT filter runs with coverage 0 and marks nothing." + echo " the NuMT filter runs with the default depth 0 and marks nothing; the annotation table says so." fi run_in --cpus 2 --memory 4g \ "$GATK_IMAGE" \ @@ -139,6 +142,7 @@ run_in --cpus 1 --memory 2g -v "${PGP_ROOT}/bin:/pgp-bin:ro" "$PYTHON_IMAGE" \ --vcf "/genome/${SAMPLE}/mito/${SAMPLE}_chrM_filtered.vcf.gz" \ --clinvar "$(cpath "$CLINVAR_VCF")" \ --gnomad "$(cpath "$GNOMAD_MITO")" \ + ${NUMT_DEFAULT:+"$NUMT_DEFAULT"} \ --out "/genome/${SAMPLE}/mito/${SAMPLE}_chrM_annotated.tsv" echo "[7/8] mtDNA copy number (chrM against autosomal reads, from the BAM index)..." diff --git a/scripts/41-bloodtype.sh b/scripts/41-bloodtype.sh index 7371f5382..4e5ad002b 100755 --- a/scripts/41-bloodtype.sh +++ b/scripts/41-bloodtype.sh @@ -18,8 +18,9 @@ # Input: vcf/.vcf.gz; the reference (REF_FASTA) with its .fai; # aligned/_sorted.bam with its .bai # (ALIGN_DIR as for the other BAM steps), optional: without it RhD is -# not determined and sites the VCF has no record for are read as -# reference with confidence medium. +# not determined, sites the VCF has no record for are read as +# reference with confidence medium, and a system with no record at +# any of its sites is not assessed. # Output: bloodtype/_bloodtype.tsv one row per system # bloodtype/_bloodtype_evidence.tsv what the VCF and the reads said per site # bloodtype/_bloodtype_depth.tsv samtools bedcov over the sites and RHD (with a BAM) diff --git a/scripts/ci/image-smoke.sh b/scripts/ci/image-smoke.sh index cb9360c1f..ca5b9f895 100755 --- a/scripts/ci/image-smoke.sh +++ b/scripts/ci/image-smoke.sh @@ -49,7 +49,7 @@ ROW_TIMEOUT=${ROW_TIMEOUT:-3600} GH_REPO=${GITHUB_REPOSITORY:-GeiserX/OwnGenome} TAG=$(tr -d '[:space:]' < "${REPO}/tests/fixtures/VERSION") SUMMARY=${GITHUB_STEP_SUMMARY:-/dev/null} -NEEDS_KNOWN="ref reads bam longreads longbam truth fullref slice vcf vcf50 pgxvcf revel sv dels bundle cyrius mito hlareads qc ehcatalog chain annotsv chrx" +NEEDS_KNOWN="ref reads bam longreads longbam truth fullref slice telobam vcf vcf50 pgxvcf revel sv dels bundle cyrius mito hlareads qc ehcatalog chain annotsv chrx" OPTS_KNOWN="root net full also= rw=" # The mini reference: chr20:10,000,001-10,500,000 of the fixture reference as @@ -487,6 +487,30 @@ need_slice() { hsam addreplacerg -r '@RG\tID:HG002\tSM:HG002\tPL:ILLUMINA' -o /in/HG002_slice.bam /fx/HG002_slice.bam && hsam index /in/HG002_slice.bam } +# The slice has no telomeric read, so its tel_content is 0 whatever +# TelomereHunter does. telo.bam is the slice plus 1,100 unmapped telomeric +# reads of 150 bp (600 TTAGGG, 400 CCCTAA, 100 TTAGGG with one TCAGGG in the +# middle), built with the samtools image: the TelomereHunter2 image has no +# samtools. PLANTED=0 plants none, the control that shows the tel_content +# check fails without them. cytoBand.hg38.txt is the repository's GRCh38 +# band file, which step 10 passes as -b. +need_telobam() { + need slice || return 1 + awk -v n="${PLANTED:-1}" 'BEGIN { + q = ""; for (i = 0; i < 150; i++) q = q "I" + if (!n) exit + for (i = 1; i <= 1100; i++) { + if (i <= 600) { s = ""; for (k = 0; k < 25; k++) s = s "TTAGGG" } + else if (i <= 1000) { s = ""; for (k = 0; k < 25; k++) s = s "CCCTAA" } + else { s = ""; for (k = 0; k < 12; k++) s = s "TTAGGG"; s = s "TCAGGG"; for (k = 0; k < 12; k++) s = s "TTAGGG" } + printf "telo%d\t4\t*\t0\t0\t*\t*\t0\t0\t%s\t%s\tRG:Z:HG002\n", i, s, q + } + }' > "${IN}/planted.sam" || return 1 + hrun "$SAMTOOLS_IMAGE" sh -c 'samtools view -h /in/HG002_slice.bam | cat - /in/planted.sam | samtools view -b -o /in/telo.bam -' && + hsam index /in/telo.bam || return 1 + rm -f "${IN}/planted.sam" + cp "${REPO}/assets/reference/cytoBand.hg38.txt" "${IN}/cytoBand.hg38.txt" +} need_vcf() { fx_get HG002_vep.vcf || return 1 hbcf view -Oz -o /in/sample.vcf.gz /fx/HG002_vep.vcf && hbcf index -f -t /in/sample.vcf.gz diff --git a/scripts/owngenome-view.sh b/scripts/owngenome-view.sh index e124b308b..cfbcf5852 100755 --- a/scripts/owngenome-view.sh +++ b/scripts/owngenome-view.sh @@ -7,10 +7,11 @@ # the reference (REF_FASTA), the sample's BAM or CRAM, its small-variant VCF # and its SV VCF, and prints the address to open. The report's positions link # to the same address, so with the viewer running a click on a ClinVar hit -# opens the reads at it. The server (assets/viewer/serve.py) listens on -# 127.0.0.1 only and its pages may not call any other server, so the data never -# leaves this machine; docs/viewer.md says how to reach it from a remote box -# over ssh. Needs python3 on the host. The first run downloads the pinned +# opens the reads at it. The server (og view serve, through bin/og; OG names +# another og binary) listens on 127.0.0.1 only and its pages may not call any +# other server, so the data never leaves this machine; docs/viewer.md says how +# to reach it from a remote box over ssh. It needs og built for this machine +# (scripts/setup.sh --og), not python3. The first run downloads the pinned # igv.js release (IGV_JS_VERSION in versions.env) into GENOME_DIR/tools/ and checks its # sha256; later runs need no network. # @@ -18,8 +19,8 @@ # READS aligned/_sorted.bam, else aligned/_sorted.cram # (ALIGN_DIR as in the steps); "none" leaves the reads out # VCF vcf/.vcf.gz (VCF_DIR as in the steps) -# SV_VCF sv_merged/_sv_consensus.vcf.gz (step 22), else Manta's -# manta/results/variants/diploidSV.vcf.gz (step 4) +# SV_VCF Manta's manta/results/variants/diploidSV.vcf.gz (step 4), else +# sv_merged/_sv_consensus.vcf.gz (step 22) # A file that is not there is left out with a note; the reference is required. set -euo pipefail @@ -42,10 +43,6 @@ if [ ! -d "$S" ]; then echo "ERROR: Sample directory not found: ${S}" >&2 exit 1 fi -if ! command -v python3 >/dev/null 2>&1; then - echo "ERROR: python3 is needed on this computer to serve the viewer." >&2 - exit 1 -fi case "$PORT" in ''|*[!0-9]*) echo "ERROR: OWNGENOME_VIEW_PORT must be a port number, got '${PORT}'" >&2; exit 2 ;; esac @@ -60,11 +57,12 @@ first_file() { READS=${READS:-$(first_file "${ALN}/${SAMPLE}_sorted.bam" "${ALN}/${SAMPLE}_sorted.cram" || true)} VCF=${VCF:-$(first_file "${S}/${VCF_DIR:-vcf}/${SAMPLE}.vcf.gz" || true)} -SV_VCF=${SV_VCF:-$(first_file "${S}/sv_merged/${SAMPLE}_sv_consensus.vcf.gz" \ - "${S}/manta/results/variants/diploidSV.vcf.gz" || true)} +SV_VCF=${SV_VCF:-$(first_file "${S}/manta/results/variants/diploidSV.vcf.gz" \ + "${S}/sv_merged/${SAMPLE}_sv_consensus.vcf.gz" || true)} [ "$READS" != none ] || READS="" -ARGS=(--sample "$SAMPLE" --fasta "$REF_FASTA" --port "$PORT") +OG=${OG:-${PGP_ROOT}/bin/og} +ARGS=(--sample "$SAMPLE" --fasta "$REF_FASTA" --port "$PORT" --assets "${PGP_ROOT}/assets/viewer") [ -n "$LOCUS" ] && ARGS+=(--locus "$LOCUS") for pair in "reads:${READS}" "vcf:${VCF}" "sv-vcf:${SV_VCF}"; do name=${pair%%:*} f=${pair#*:} @@ -91,4 +89,4 @@ echo " Reads: ${READS:-none}" echo " VCF: ${VCF:-none}" echo " SV VCF: ${SV_VCF:-none}" echo "============================================" -exec python3 "${PGP_ROOT}/assets/viewer/serve.py" "${ARGS[@]}" --igv-js "$IGV_JS" +exec "$OG" view serve "${ARGS[@]}" --igv-js "$IGV_JS" diff --git a/scripts/run-all.sh b/scripts/run-all.sh index 35b2555d9..dfa11e549 100755 --- a/scripts/run-all.sh +++ b/scripts/run-all.sh @@ -23,13 +23,18 @@ # the ACMG SF genes; the report's own secondary-findings card from step 23 stays); # HPO=HP:0001250,HP:0001263 (the symptoms as HPO ids: step 48 ranks the variants that could explain them with Exomiser, # after setup.sh --exomiser-data); +# EVERYTHING=true (every optional step of assets/everything.tsv: every --tools name, KIR, HLA_QC, GRIDSS, TIDDIT, +# IMPUTATION, SOMATIC, BENCHMARK and every EXTRA_CALLERS; TOOLS or a switch set to another value stops it with exit 2. +# A step that would be skipped because its data is not installed, or because ANCESTRY_PANEL, ANCESTRY_FINE_DIR or +# ARCHAIC_DIR is none, stops it with exit 2 before Nextflow, naming the setup command; a skip that comes from the +# input stays a skip: no BAM, no gVCF, a female sample for the Y steps, a BAM that is not PacBio HiFi for Paraphase); # REF_FASTA, EH_CATALOG (a file, or bundled), MANTA_CALL_REGIONS, PARASCOPY_POPULATION, PARAPHASE_REGIONS, ANCESTRY_PANEL (--ancestry_ref; none: raw # scores), ANCESTRY_FINE_DIR (--ancestry_fine_panel, step 26b, # always 100 bootstrap replicates; none: skip), ARCHAIC_DIR and ARCHAIC_POP (--archaic_data and --archaic_pop, # step 43; ARCHAIC_DIR=none: skip), PGSC_CALC_DIR (--pgsc_calc), LOCITYPER_DATA (--locityper_data, step 53's # database) and LOCITYPER_BG_REGION (--locityper_bg_region) as for the single steps; the panels, the databases and # pgsc_calc are passed when installed. -# Run as scripts after the pipeline: GRIDSS=true (04b), IMPUTATION=true (14), +# Run as scripts after the pipeline: TIDDIT=true (04a), GRIDSS=true (04b), IMPUTATION=true (14), # SOMATIC=true (29), EXTRA_CALLERS=gatk,freebayes,strelka2,octopus (03a-03d), BENCHMARK=true (needs # EXTRA_CALLERS or a second caller VCF); then the HTML report (24) and the text report, also after a failed pipeline. # FAMILIES=families.tsv (who is related to whom, assets/families.example.tsv): when the sample is in a family, the sex @@ -56,8 +61,8 @@ shift 2; SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd) USER_THREADS=${THREADS:-} # shape back word by word and starts run-all.sh with those arguments, never through a shell; it refuses any other. SWITCHES=(GENOME_DIR SKIP_VALIDATION THREADS SKIP_TRIM INTERVALS ALIGN_DIR TOOLS KIR HLA_QC HPO CPSR_SECONDARY_FINDINGS REF_FASTA EH_CATALOG MANTA_CALL_REGIONS PARASCOPY_POPULATION PARAPHASE_REGIONS ANCESTRY_PANEL ANCESTRY_FINE_DIR ARCHAIC_DIR ARCHAIC_POP - PGSC_CALC_DIR ANCIENT_PANEL_DIR VIRAL_REF MEGANE_KMERS MOCHA_DATA GRIDSS IMPUTATION SOMATIC EXTRA_CALLERS BENCHMARK - FAMILIES OWNGENOME_LIVE_URL LOCITYPER_DATA LOCITYPER_BG_REGION NXF_VER NXF_WORK NXF_HOME NXF_OFFLINE) + PGSC_CALC_DIR ANCIENT_PANEL_DIR VIRAL_REF MEGANE_KMERS MOCHA_DATA GRIDSS TIDDIT IMPUTATION SOMATIC EXTRA_CALLERS BENCHMARK + FAMILIES OWNGENOME_LIVE_URL LOCITYPER_DATA LOCITYPER_BG_REGION EVERYTHING NXF_VER NXF_WORK NXF_HOME NXF_OFFLINE) RERUN_CMD="cd $(printf '%q' "$PWD") && "; for v in "${SWITCHES[@]}"; do [ -z "${!v+x}" ] || RERUN_CMD+="${v}=$(printf '%q' "${!v}") "; done RERUN_CMD+=$(printf '%q ' "${SCRIPT_DIR}/run-all.sh" "$SAMPLE" "$SEX" "$@"); RERUN_CMD=${RERUN_CMD% } # With -bg nextflow returns at once, and the steps would be recorded and the reports written before the run ends. @@ -66,6 +71,25 @@ export GENOME_DIR=${GENOME_DIR:?Set GENOME_DIR to your data directory} # shellcheck source=lib/common.sh . "${SCRIPT_DIR}/lib/common.sh" validate_sample "$SAMPLE" +# EVERYTHING=true: every tool row of assets/everything.tsv goes into TOOLS (html_report aside: this script writes +# the report itself, step 24) and every switch row is set to its value. EVHOW keeps each row's install command. +EV="" EVMISS=(); declare -A EVHOW=() +if [[ "${EVERYTHING:-}" =~ ^(true|1)$ ]]; then + EV=1 EVT="" EVF="${PGP_ROOT}/assets/everything.tsv" + [ -s "$EVF" ] || { echo "ERROR: EVERYTHING=true reads ${EVF}, which is missing" >&2; exit 2; } + [ -z "${TOOLS:-}" ] || { echo "ERROR: EVERYTHING=true names every step itself: unset TOOLS (TOOLS=${TOOLS})" >&2; exit 2; } + while IFS=$'\t' read -r kind name value _; do + case "$kind" in + tool) [ "$name" = html_report ] || EVT+="${EVT:+,}${name}"; EVHOW[$name]=$value ;; + input) EVHOW[$name]=$value ;; + switch) if [ -n "${!name:-}" ] && [ "${!name}" != "$value" ] && ! { [ "$value" = true ] && [ "${!name}" = 1 ]; }; then + echo "ERROR: EVERYTHING=true sets ${name}=${value}: unset ${name} (it is ${!name})" >&2; exit 2; fi + printf -v "$name" '%s' "$value" ;; + esac + done < <(grep -v '^#' "$EVF" | tail -n +2) + TOOLS=$EVT + echo "[Everything] EVERYTHING=true: every optional step (${EVF}); one that lacks its data stops the run before Nextflow" +fi G=$GENOME_DIR S="${GENOME_DIR}/${SAMPLE}" LOG_DIR="${GENOME_DIR}/${SAMPLE}/logs" T=${TOOLS:-} C=${EXTRA_CALLERS:-} on() { [[ "${!1:-}" =~ ^(true|1)$ ]]; } SF=${CPSR_SECONDARY_FINDINGS:-true} # as scripts/17-cpsr.sh reads it: unset or empty is true, else true or false only @@ -108,6 +132,8 @@ fi mkdir -p "${S}/nextflow" "$LOG_DIR" GENOME_DIR="$G" bash "${PGP_ROOT}/bin/write_manifest.sh" "$SAMPLE" run-all.sh "$SEX" || echo "WARNING: could not write ${S}/run_manifest.tsv" STATUS="${LOG_DIR}/run_status.tsv" # bin/collect_summary.py marks results older than this run stale +# EVERYTHING=true can still refuse before Nextflow: keep the last run's status to put back then. +[ -z "$EV" ] || [ ! -f "$STATUS" ] || cp "$STATUS" "${STATUS}.prev" printf '# run-all.sh: when this run started and how each step ended\nmeta\tstarted_epoch\t%s\nmeta\tstarted_utc\t%s\nmeta\tdeclared_sex\t%s\nmeta\tcommand\t%s\nmeta\tswitches\t%s\n' \ "$(date +%s)" "$(date -u '+%Y-%m-%d %H:%M:%S UTC')" "$SEX" "$RERUN_CMD" "${SWITCHES[*]}" > "$STATUS" # As run-all.sh ends, however it ends: a step still 'planned' did not finish, and the time is recorded @@ -130,7 +156,18 @@ plan() { # plan "STEP Label" TOOL [REASON]: 0 when TOOL runs [[ -n "$NOBAM" || " 16 16b 10 20 21 04 19 15 22 08 09 09b 18 05 28 32 33 35 35b 37 45 49 " != *" ${1%% *} "* ]] || r="no BAM" [ -z "$t" ] || [[ ",${t// /}," == *",$2,"* ]] || r=${r:-not in TOOLS} if [ -z "$r" ]; then SEL+=("$2") RUNS+=("${1%% *}") TOOL_OF[${1%% *}]=$2; printf ' %-28s runs\n' "$1"; return 0; fi - printf ' %-28s skipped (%s)\n' "$1" "$r"; printf 'step\t%s\tskipped (%s)\n' "${1%% *}" "$r" >> "$STATUS"; return 1 + printf ' %-28s skipped (%s)\n' "$1" "$r"; printf 'step\t%s\tskipped (%s)\n' "${1%% *}" "$r" >> "$STATUS" + evmiss "$1" "$2" "$r"; return 1 +} +# evmiss "STEP Label" TOOL REASON: with EVERYTHING=true, a skip for data that is not installed, or for X=none, stops +# the run before Nextflow (the list prints after the plan). A skip that comes from the input is not one of them. +evmiss() { + local h=${EVHOW[$2]:-setup.sh}; [ "$h" != - ] || h=setup.sh + [ -n "$EV" ] || return 0 + case "$3" in + *=none) EVMISS+=("$1: $3: unset ${3%%=*}") ;; + "data not installed"*|"not installed"*|"opt-in"*) EVMISS+=("$1: $3; install: $h") ;; + esac } arg() { [ ! -e "$2" ] || NF+=("$1" "$2"); } # arg --param FILE: pass FILE when it exists CV="${G}/clinvar/clinvar_pathogenic_chr.vcf.gz" A="${G}/annotations" CAT=${EH_CATALOG:-} @@ -186,8 +223,9 @@ for p in "07 PharmCAT:pharmcat" "27 CPIC lookup:cpic" "11 ROH:roh" "12 Mito hapl plan "06 ClinVar screen" clinvar "$(need "$CV" "${CV}.tbi")" && NF+=(--clinvar "$CV" --clinvar_index "${CV}.tbi") H=$(data_file hla_dat || true) GT=$(data_file gencode_genes || true) plan "08 HLA typing (T1K)" hla_typing "$(need "$H" "$GT")" && NF+=(--hla_dat "$H" --hla_genes "$GT") \ - && if on KIR; then K="${G}/kir/IPD-KIR_${KIR_DB_RELEASE}/kir.dat"; [ -s "$K" ] && NF+=(--kir true --kir_dat "$K") \ - || echo " KIR typing skipped: data not installed: ${K#"$G"/} (setup.sh --kir-data)"; fi + && if on KIR; then K="${G}/kir/IPD-KIR_${KIR_DB_RELEASE}/kir.dat"; if [ -s "$K" ]; then NF+=(--kir true --kir_dat "$K") + else echo " KIR typing skipped: data not installed: ${K#"$G"/} (setup.sh --kir-data)" + [ -z "$EV" ] || EVMISS+=("08 KIR typing (KIR=true): data not installed: ${K#"$G"/}; install: setup.sh --kir-data"); fi; fi [[ " ${SEL[*]} " != *" hla_typing "* ]] || ! on HLA_QC || { NF+=(--hla_qc true); echo " (HLA_QC=true: OptiType checks T1K's HLA-A and HLA-B)"; } plan "09 ExpansionHunter" expansion_hunter "$(need "$CAT")" && NF+=(--expansion_catalog "$CAT") plan "09b Stranger" stranger "$(need "$CAT")" || true @@ -216,7 +254,18 @@ plan "21 Cyrius CYP2D6" cyrius "$([ -n "$CYOK" ] || if [ -e "${CY}/INSTALLED" ] && NF+=(--cyrius_install "$CY") && { [ -n "$T" ] || echo " (planned because setup.sh --cyrius installed it; TOOLS without cyrius leaves it out)"; } plan "35 Parascopy SMN1/SMN2" parascopy "$(optin parascopy || need "${PS}/homology_table/GRCh38.bed.gz")" && NF+=(--parascopy_data "$PS") \ && NF+=(--parascopy_population "${PARASCOPY_POPULATION:-EUR}") -plan "35b Paraphase (PacBio HiFi)" paraphase "$(optin paraphase)" && { [ -z "${PARAPHASE_REGIONS:-}" ] || NF+=(--paraphase_regions "$PARAPHASE_REGIONS"); } +# Step 35b reads PacBio HiFi reads only. og paraphase check-bam, which PARAPHASE_CHECK runs too, says whether every +# read group of the BAM is PL:PACBIO (exit 3: not). Another BAM is a skip, not a failed step; so is a FASTQ row, which +# the pipeline aligns as short reads. A check that cannot run leaves the step to PARAPHASE_CHECK. +hifi() { + [ -n "$NOBAM" ] || return 0 + [ -n "$fb" ] || { echo 'not PacBio HiFi: a FASTQ row is aligned as short reads'; return 0; } + local rc=0 + run_in --cpus 1 --memory 1g -v "${PGP_ROOT}/bin:/pgp-bin:ro" "$PYTHON_IMAGE" /pgp-bin/og paraphase check-bam "/genome/${fb#"$G"/}" \ + > /dev/null 2>&1 || rc=$? + [ "$rc" -ne 3 ] || echo 'not PacBio HiFi: a read group of the BAM is not PL:PACBIO' +} +plan "35b Paraphase (PacBio HiFi)" paraphase "$(optin paraphase || hifi)" && { [ -z "${PARAPHASE_REGIONS:-}" ] || NF+=(--paraphase_regions "$PARAPHASE_REGIONS"); } plan "25 PRS" prs "$(need "$(compgen -G "${G}/prs_scores/*.txt.gz" | head -n 1 || echo "${G}/prs_scores/.txt.gz")")" && NF+=(--pgs_scoring "${G}/prs_scores") \ && { PC=${PGSC_CALC_DIR:-${G}/tools/pgsc_calc-${PGSC_CALC_VERSION}}; [ ! -f "${PC}/main.nf" ] || NF+=(--pgsc_calc "$PC"); } # Step 26 is pgsc_calc's projection inside the PRS run, with its panel and the site list setup.sh writes beside it. @@ -228,7 +277,8 @@ AF=${ANCESTRY_FINE_DIR:-${G}/reference/ancestry_fine/${ANCESTRY_FINE_PANEL}} plan "26b Fine-grained ancestry" ancestry_fine "$(if [ "$AF" = none ]; then echo 'ANCESTRY_FINE_DIR=none'; else need "${AF}/model/DONE"; fi)" \ && NF+=(--ancestry_fine_panel "$AF") YD="${G}/reference/yleaf-${YLEAF_DATA_VERSION}/data" -plan "37 Y haplogroup (Yleaf)" y_haplogroup "$(optin y_haplogroup || need "${YD}/hg38/new_positions.txt")" && NF+=(--yleaf_data "$YD") +plan "37 Y haplogroup (Yleaf)" y_haplogroup "$(optin y_haplogroup || if [ "$SEX" = male ]; then need "${YD}/hg38/new_positions.txt" + else echo 'female sample: no Y chromosome'; fi)" && NF+=(--yleaf_data "$YD") # Step 40 reads the gVCF: a row that starts from a VCF without one beside it has none. CS="${G}/reference/consumer/23andme_v5_sites_dbsnp${CONSUMER_DBSNP_BUILD}.tsv.gz" plan "40 Raw-data export" consumer_export "$(optin consumer_export || if [ -n "$fv" ] && [ -z "$GROW" ]; then echo 'no gVCF beside the VCF'; else need "$CS"; fi)" \ @@ -292,6 +342,17 @@ case "$LD" in /*) ;; *) LD="${G}/${LD}" ;; esac if [[ ",${T// /}," == *",locityper,"* ]]; then plan "53 Hard loci (Locityper)" locityper "$(if [ -z "$NOBAM" ]; then echo 'no BAM'; else need "${LD}/DONE"; fi)" \ && NF+=(--locityper_data "$LD") && { [ -z "${LOCITYPER_BG_REGION:-}" ] || NF+=(--locityper_bg_region "$LOCITYPER_BG_REGION"); } || true; else KNOWN+=" locityper"; fi for t in ${T//,/ }; do [[ "${KNOWN} " == *" ${t} "* ]] || { echo "ERROR: unknown step '${t}' in TOOLS. Known:${KNOWN}" >&2; exit 2; }; done +# Step 4b (GRIDSS=true) runs after the pipeline, and GRIDSS needs the classic BWA index beside the reference, which +# setup.sh does not build: check it now, so the run stops here and not after hours of pipeline. +if [ -n "$EV" ] && [ -n "$NOBAM" ]; then for e in amb ann bwt pac sa; do [ -f "${REF_FASTA}.${e}" ] || { + EVMISS+=("04b GRIDSS (GRIDSS=true): classic BWA index not installed: ${REF_FASTA#"$G"/}.${e}; install: bwa index (docs/04b-gridss.md)"); break; }; done; fi +if [ "${#EVMISS[@]}" -gt 0 ]; then + { echo "ERROR: EVERYTHING=true runs every optional step, and ${#EVMISS[@]} cannot run (Nextflow did not start):"; printf ' %s\n' "${EVMISS[@]}" + echo "Install what is missing, or run without EVERYTHING=true to skip them."; } >&2 + # Nothing ran: the last run's status stays as it was (or there is none), and no run-finished event goes out. + trap - EXIT; if [ -f "${STATUS}.prev" ]; then mv "${STATUS}.prev" "$STATUS"; else rm -f "$STATUS"; fi; exit 2 +fi +rm -f "${STATUS}.prev" arg --cytoband "$(data_file cytoband || true)"; ! GEX=$(data_file gencode_exons) || NF+=(--gencode_exons "$GEX"); arg --delly_exclude "$(data_file delly_exclude || true)"; arg --manta_call_regions "${MANTA_CALL_REGIONS:-}" # Step 20's annotation of the chrM calls (MITO_VARIANTS_ANNOTATE): ClinVar with its index, and gnomAD's chrM sites. MC="${G}/clinvar/clinvar_chr.vcf.gz"; if [ -s "$MC" ] && [ -s "${MC}.tbi" ]; then NF+=(--mito_clinvar "$MC"); fi; arg --gnomad_mito "${G}/gnomad_mito/${GNOMAD_MITO_URL##*/}" @@ -336,7 +397,7 @@ if [[ " $* " != *" --publish_dir_mode"* && " $* " != *" -w "* && " $* " != *" -w rm -f "$LP" "${S}/.pgp-link-probe.$$" "${G}/.pgp-link-probe.$$" fi if on SKIP_TRIM; then NF+=(--skip_trim true); fi -for v in GRIDSS:04b-gridss IMPUTATION:14-imputation-prep SOMATIC:29-mutect2-somatic; do if on "${v%%:*}"; then OPTIN+=("${v#*:}.sh"); fi; done +for v in TIDDIT:04a-tiddit GRIDSS:04b-gridss IMPUTATION:14-imputation-prep SOMATIC:29-mutect2-somatic; do if on "${v%%:*}"; then OPTIN+=("${v#*:}.sh"); fi; done for c in ${C//,/ }; do OPTIN+=("$(cd "$SCRIPT_DIR" && compgen -G "03[a-d]-${c}*.sh")") || { echo "ERROR: unknown caller '${c}' in EXTRA_CALLERS (gatk, freebayes, strelka2, octopus)" >&2; exit 2; }; done if ! on BENCHMARK; then :; elif [ -n "$C" ] || compgen -G "${S}/vcf_*/${SAMPLE}.vcf.gz" >/dev/null || [ -f "${S}/vcf_strelka2/results/variants/variants.vcf.gz" ]; then OPTIN+=(benchmark-variants.sh) else echo " benchmark-variants skipped (only one caller VCF: set EXTRA_CALLERS, or run a 03a-03d script first)"; fi diff --git a/scripts/validate-setup.sh b/scripts/validate-setup.sh index 5fab6348e..2d3631126 100755 --- a/scripts/validate-setup.sh +++ b/scripts/validate-setup.sh @@ -672,7 +672,7 @@ else for name in $DATA_FILES; do case "$name" in delly_exclude) what="Delly exclude map (step 19 runs without it, slower and with more artefacts)" ;; - cytoband) what="GRCh38 chromosome bands (step 10 falls back to hg19 bands)" ;; + cytoband) what="GRCh38 chromosome bands (step 10 installs them from assets/reference when missing)" ;; hla_dat) what="IPD-IMGT/HLA ${HLA_DB_RELEASE} (step 08 is skipped without it)" ;; gencode_genes) what="GENCODE ${GENCODE_RELEASE} gene coordinates (step 08 is skipped without them)" ;; gencode_exons) what="GENCODE ${GENCODE_RELEASE} exons (steps 06 and 17 skip their cDNA read check without them)" ;; diff --git a/tests/browser/README.md b/tests/browser/README.md index 171686ba9..5c0811833 100644 --- a/tests/browser/README.md +++ b/tests/browser/README.md @@ -21,8 +21,9 @@ Without a Chrome a check prints `[SKIP] no Chrome or Chromium to ...` and passes | `tests/cdp.rs` | the driver: a clean page loads with no page error and answers `eval`; a planted exception and a `console.error` are both reported | | `tests/live_replay.rs` | the live page in replay mode on `tests/fixtures/live/frames.json`: it opens at the last frame, Play replays from the first, the map's roles and labels, a headline opens its step with Enter, the policy blocked nothing, a running replay opens at its first frame. Red control: without `frames.json` the page gets a 404 for it and the first check fails. The policy it is served with must equal the live site's `CSP` | | `tests/live_assets.rs` | `assets/live`, plugins included, has no outside URL, inline script, `on*` attribute or `eval`, with two planted mistakes the scan must catch | +| `rust/crates/og-live/tests/port_viewer.rs` (`cargo test -p og-live`) | the local genome viewer, served by `og view serve` itself on a synthetic sample: igv.js starts on the config (status ready), the policy blocks nothing, and igv.js reads the reference, the BAM, its index and the VCF. Red control: with an empty igv.min.js the page reports an error | -The other browser checks still run in the Python tests that start the live site's Python server (`tests/test_owngenome_live.py`, `test_live_demo.py`, `test_live_viewer.py`, `test_owngenome_live_family.py`, `test_report_charts.py`, `test_viewer.py`). Each moves here when its server is ported to Rust. +The other browser checks still run in the Python tests that start the live site's Python server (`tests/test_owngenome_live.py`, `test_live_demo.py`, `test_live_viewer.py`, `test_owngenome_live_family.py`, `test_report_charts.py`). Each moves here when its server is ported to Rust. ## The API diff --git a/tests/e2e/acmg-sf-rules-1-reports.sh b/tests/e2e/acmg-sf-rules-1-reports.sh index 7660081d8..c31924c80 100755 --- a/tests/e2e/acmg-sf-rules-1-reports.sh +++ b/tests/e2e/acmg-sf-rules-1-reports.sh @@ -9,6 +9,13 @@ # or "not made" line. Control: the same render without the assets # mount (what generate-report.sh did before it mounted assets/) fails # the same checks. +# 1b. No step 23 (a run without the VEP cache): og summary collect on the +# sample's step 06, 05 and 35 outputs with no clinical/ folder still +# writes the ACMG card (sections.acmg_sf) with the 84 rules, says the +# HIGH-impact source was not screened, and keeps every ClinVar row the +# full run's card has. Control: without step 06's hits the section is +# not run. The reports still read the card from the clinical section +# until they move to sections.acmg_sf. # 2. Nextflow: HTML_REPORT on the sample's ClinVar hits and clinical VCF, # with the two assets staged as main.nf stages them, applies the rules, # and its carrier list equals the bash one. Control: the same task @@ -75,6 +82,46 @@ check_eq "control: the text check fails without assets/" "$CT" red if [ -s "${CTL}/summary.json" ] && ! summary_ok "${CTL}/summary.json" > /dev/null; then CS=red; else CS=green; fi check_eq "control: the summary check fails without assets/" "$CS" red +# --- 1b. bash, no step 23 ---------------------------------------------------------- +# card JSON: the ACMG card of a summary.json, or null. +card() { jq -c '.sections.acmg_sf' "$1" 2> /dev/null; } +check "the full run's card is ok and screened the HIGH-impact records" \ + jq -e '.sections.acmg_sf | .state == "ok" and .data.genes_on_list == 84 and .data.high_impact_checked == true' "$SUM" +NC="${CASE_TMP}/no-step23" +rm -rf "$NC" +mkdir -p "${NC}/${SAMPLE}" +for d in clinvar annotsv sv_merged paralogs; do + [ ! -d "${SD}/${d}" ] || cp -R "${SD}/${d}" "${NC}/${SAMPLE}/" +done +"${REPO}/bin/og" summary collect --sample "$SAMPLE" --sample-dir "${NC}/${SAMPLE}" --assets "${REPO}/assets" \ + --out "${NC}/summary.json" > "${NC}/collect.log" 2>&1 +check_eq "og summary collect without clinical/ exits 0" "$?" 0 +echo " card without step 23: $(card "${NC}/summary.json" | cut -c1-300)" +check_eq "without step 23 the clinical section is not run" \ + "$(jq -r '.sections.clinical.state' "${NC}/summary.json" 2> /dev/null)" missing +check "without step 23 the card is ok with the 84 rules" \ + jq -e '.sections.acmg_sf | .state == "ok" and .data.genes_on_list == 84 and (.data | has("unavailable") | not)' "${NC}/summary.json" +check "and says the HIGH-impact source was not screened" \ + jq -e '.sections.acmg_sf.data | .high_impact_checked == false and (.high_impact_note | startswith("Rare HIGH-impact variants were not screened"))' "${NC}/summary.json" +# shellcheck disable=SC2016 # a jq program: $f and $n are jq variables +# pair and phase are the gene's verdict, not the row's: a HIGH-impact row of +# the gene in the full run can change which pair it names (the same rule as +# rust/crates/og-summary/tests/screen_acmg_card_section.rs). +check "every ClinVar row of the card without step 23 is in the full run's card, unchanged" \ + jq -en --slurpfile f "$SUM" --slurpfile n "${NC}/summary.json" \ + '$f[0].sections.acmg_sf.data as $F + | [$F.high_impact[]?.gene] as $hg + | [$F.clinvar_hits[] | del(.pair, .phase)] as $own + | [$n[0].sections.acmg_sf.data.clinvar_hits[] as $r + | select(($F.clinvar_hits | index([$r])) == null) + | select(($hg | index([$r.gene])) == null or ($own | index([$r | del(.pair, .phase)])) == null)] + | length == 0' +rm -rf "${NC}/${SAMPLE}/clinvar" +"${REPO}/bin/og" summary collect --sample "$SAMPLE" --sample-dir "${NC}/${SAMPLE}" --assets "${REPO}/assets" \ + --out "${NC}/control.json" > /dev/null 2>&1 +check_eq "control: without step 06's hits the card is not run" \ + "$(jq -r '.sections.acmg_sf.state' "${NC}/control.json" 2> /dev/null)" missing + # --- 2. Nextflow -------------------------------------------------------------------- if ! command -v nextflow >/dev/null; then fail "nextflow is not on PATH"; finish; fi NP="${CASE_TMP}/project" diff --git a/tests/e2e/bloodtype-1.sh b/tests/e2e/bloodtype-1.sh index ff8e0cb5a..c829c261d 100755 --- a/tests/e2e/bloodtype-1.sh +++ b/tests/e2e/bloodtype-1.sh @@ -16,7 +16,10 @@ # Kell (c.578C>T: K+k+); # - the same reads without any RHD read (both copies deleted) give D-, and # with half of them (one copy) D+ with one copy; -# - the VCF without a BAM gives RhD not determined and ABO O at medium; +# - the VCF without a BAM gives RhD not determined, and ABO, with no +# record at any of its sites (HG002 matches GRCh38 there), not assessed: +# without reads nothing tells that from a VCF that does not cover ABO; +# Kidd, with GIAB's record at c.838, is still read; # - ABO c.1061delC written two bases right (GG>G) gives A2/A2 as the table's # CG>C does, because step 41 left-aligns first (og on the VCF as written # reads A1/A1, the control), and a C>A,G 1/2 at c.803 keeps its one B copy; @@ -148,7 +151,10 @@ sample "$V" "${T}/truth.vcf.gz" step "$V" check_eq "without a BAM RhD is not determined" "$(cell "$V" RhD phenotype)" "not determined" check "and the step says why" has 'No BAM .*RhD needs read depth' "$(cat "$STEP_LOG")" -check_eq "without a BAM ABO is O at medium" "$(cell "$V" ABO phenotype)/$(cell "$V" ABO confidence)" "O/medium" +check_eq "without a BAM and with no ABO record, ABO is not assessed" \ + "$(cell "$V" ABO phenotype)/$(cell "$V" ABO confidence)" "not assessed/not assessed" +check "and the note says why" has 'no VCF record at any of its 5 sites and no BAM' "$(cell "$V" ABO note)" +check_eq "control: Kidd, with GIAB's record at c.838, is read without a BAM" "$(cell "$V" Kidd phenotype)" "Jk(a-b+)" # --- an indel written further right, and a multi-allelic record ------------------------ # og matches a marker by position, REF and ALT. A caller can write ABO c.1061delC diff --git a/tests/e2e/cn-engine-1-parity.sh b/tests/e2e/cn-engine-1-parity.sh index ea9b64143..dd6267231 100755 --- a/tests/e2e/cn-engine-1-parity.sh +++ b/tests/e2e/cn-engine-1-parity.sh @@ -7,8 +7,10 @@ # fixture's header, at full depth and at an eighth of it. For each BAM: # - step 46 of this tree and of the old tree write the same lpa table, byte # for byte, once the old message is put in today's wording; -# - step 41 of this tree and of the old tree write the same RhD row and the -# same RhD evidence rows (other systems may change after the engine); +# - step 41 of this tree and of the old tree write the same RhD row (its +# phenotype, genotype and confidence; step 41's notes are not the +# engine's) and the same RhD evidence rows (other systems may change +# after the engine); # - step 35's HBA block (bedcov all MAPQ and MAPQ >= 1, then the verdict) # writes the same table through og cn as the old hba_copy_number.py # does. @@ -110,7 +112,9 @@ for V in full thin; do done # Step 41: the header and the RhD rows only; other systems are not the engine's. for f in bloodtype evidence; do - for d in "$NEW" "$OLDO"; do awk -F'\t' 'NR == 1 || $1 == "RhD"' "${d}/${f}.tsv" > "${d}/${f}.rhd.tsv"; done + for d in "$NEW" "$OLDO"; do + awk -F'\t' -v OFS='\t' -v f="$f" 'NR == 1 || $1 == "RhD" {if (f == "bloodtype") NF = 4; print}' "${d}/${f}.tsv" > "${d}/${f}.rhd.tsv" + done check_ge "${V}: RhD rows in this tree's ${f} table" "$(($(wc -l < "${NEW}/${f}.rhd.tsv") - 1))" 1 done # Step 46's message names what its interval covers since the old tree diff --git a/tests/e2e/nf-wiring-1-report-tables.sh b/tests/e2e/nf-wiring-1-report-tables.sh index 3a5abadb5..96625a5f4 100755 --- a/tests/e2e/nf-wiring-1-report-tables.sh +++ b/tests/e2e/nf-wiring-1-report-tables.sh @@ -11,8 +11,9 @@ # hits, a VEP file with a gnomAD AF on each hit (3% on the planted one), # CPSR's table and its cDNA read check, step 02's read count and the # clinical filter's and slivar's summary tables. The read_count, clinvar, -# cpsr, clinical and slivar sections of the two summary.json files must -# be equal, with the AF, the CPSR classes and the flagged row in them. +# cpsr, clinical, slivar and acmg_sf sections of the two summary.json +# files must be equal, with the AF, the CPSR classes and the flagged row +# in them. # Control: the module as it was (no place for these tables) stops. # 3. main.nf passes them on: a stub run of every tool (-profile test_all) # stages each table in each HTML_REPORT task whose sample has the step's @@ -203,6 +204,11 @@ sys.exit(bad) PY } check "the five sections of the Nextflow summary equal the bash ones" same_sections "${SD}/summary.json" "$NF_SUM" +# The ACMG card (step 06's section) reads the same hits, clinical VCF and deletions in both. +# shellcheck disable=SC2016 # a jq program: $b, $n and $x are jq variables +check "the ACMG card of the Nextflow summary equals the bash one" \ + jq -en --slurpfile b "${SD}/summary.json" --slurpfile n "$NF_SUM" \ + '($b[0].sections.acmg_sf | del(.file_date)) as $x | $x.state == "ok" and $x == ($n[0].sections.acmg_sf | del(.file_date))' nf_py() { python3 -c "import json, sys; d = json.load(open(sys.argv[1]))['sections']; print($1)" "$NF_SUM" 2>/dev/null; } check_eq "the ClinVar hits' frequencies come from the VEP file" \ "$(nf_py "d['clinvar']['data']['frequency']['source']")" "vep/${S}_vep.vcf.gz" diff --git a/tests/e2e/platelet-antigens-1.sh b/tests/e2e/platelet-antigens-1.sh index e94eaae16..6090e7516 100755 --- a/tests/e2e/platelet-antigens-1.sh +++ b/tests/e2e/platelet-antigens-1.sh @@ -2,13 +2,14 @@ # Step 41's platelet (HPA) and neutrophil (HNA) antigens, through the real # step and its pinned images. The fixture's slices hold none of these genes, # so the case writes a synthetic VCF with planted genotypes at the sites of -# assets/bloodtype_markers.tsv (no BAM: every site with no record is read as -# the reference allele, confidence medium) and checks the rows: +# assets/bloodtype_markers.tsv (no BAM: a site with no record is read as the +# reference allele, confidence medium, when its system has a record at one +# of its sites; a system with none is not assessed) and checks the rows: # - HPA-1 1/1 is HPA-1(a-b+), and the note says the person lacks HPA-1a, # with FNAIT and anti-HPA-1a; # - HPA-6 0/1, HNA-3 0/1 and HNA-4 1/1 flip those systems; # - four FCGR3B markers 0/1 (with c.194 0/1) give HNA-1a/1b at confidence low; -# - control: the same step on a VCF with none of these records gives the +# - control: the same step on a VCF with 0/0 at those sites gives the # reference phenotypes, so the checks above see the planted genotypes. . "$(dirname "$0")/lib.sh" @@ -60,12 +61,12 @@ check_eq "HNA-1 from FCGR3B: a+b+, FCGR3B*01/FCGR3B*02, low" \ check "the evidence file has the HNA-1 sites as called" \ test "$(awk -F'\t' '$2 ~ /^FCGR3B_/ && $9 == "called"' "${G}/${P}/bloodtype/${P}_bloodtype_evidence.tsv" | wc -l)" -eq 5 -# --- control: none of these records ------------------------------------------------ -vcf "${T}/none.vcf.gz" KEL_578:0/1 +# --- control: the reference allele at these sites -------------------------------------- +vcf "${T}/none.vcf.gz" KEL_578:0/1 HPA1_176:0/0 HNA4_230:0/0 HNA3_461:0/0 R="${SAMPLE}plr" sample "$R" "${T}/none.vcf.gz" run_step 41-bloodtype.sh "$R"; check_step_exit 41-bloodtype.sh -check_eq "control: HPA-1 is HPA-1(a+b-) without the planted record" "$(cell "$R" HPA-1 phenotype)" "HPA-1(a+b-)" +check_eq "control: HPA-1 is HPA-1(a+b-) with 0/0 there" "$(cell "$R" HPA-1 phenotype)" "HPA-1(a+b-)" check_eq "control: HNA-4 is HNA-4(a+b-)" "$(cell "$R" HNA-4 phenotype)" "HNA-4(a+b-)" check_eq "control: HNA-3 is GRCh38's HNA-3(a-b+)" "$(cell "$R" HNA-3 phenotype)" "HNA-3(a-b+)" diff --git a/tests/fake-docker/bash-step-hla.sh b/tests/fake-docker/bash-step-hla.sh index 3befd34ad..0cf811eaf 100755 --- a/tests/fake-docker/bash-step-hla.sh +++ b/tests/fake-docker/bash-step-hla.sh @@ -110,9 +110,10 @@ THREADS=2 ALIGN_DIR=aligned_bwamem2 run_expect 0 telomere-no-bands "${SCRIPTS}/1 output_has telomere-no-bands 'GRCh38 chromosome bands are not installed' docker_log_has '^run image=[^ ]*telomerehunter.* --cpus 2 .* -ibt /genome/sample1/aligned_bwamem2/sample1_sorted\.bam ' \ "step 10 did not use THREADS=2 and ALIGN_DIR=aligned_bwamem2" -if awk '/^run / && /telomerehunter/ && / -b / { found = 1 } END { exit !found }' "$FAKE_DOCKER_LOG"; then - fail "step 10 passed -b without an installed band file" -fi +# Missing bands are installed from assets/reference, never left to the tool's +# hg19 fallback (bash-step-setup-data checks the copy). +docker_log_has '^run image=[^ ]*telomerehunter.* -b /genome/reference/cytoBand\.hg38\.txt' \ + "step 10 did not install and pass the GRCh38 bands when they were missing" printf 'chr1\t0\t2300000\tp36.33\tgneg\n' > "${GENOME_DIR}/reference/cytoBand.hg38.txt" : > "$FAKE_DOCKER_LOG" run_expect 0 telomere "${SCRIPTS}/10-telomere-hunter.sh" sample1 diff --git a/tests/fake-docker/bash-step-setup-data.sh b/tests/fake-docker/bash-step-setup-data.sh index 1849987eb..ce63ec291 100755 --- a/tests/fake-docker/bash-step-setup-data.sh +++ b/tests/fake-docker/bash-step-setup-data.sh @@ -61,6 +61,18 @@ output_has validate 'Delly exclude map \(step 19 runs without it' output_has validate 'IPD-IMGT/HLA [0-9.]+ \(step 08 is skipped without it\) not found' output_has validate '\[OK\].*GRCh38 chromosome bands: present' +# --- step 10 without the bands: it installs the shipped GRCh38 copy and passes it --------- +# Before, step 10 warned and ran TelomereHunter with no -b, so the tool used its +# own hg19 band ends on GRCh38 positions. +rm -f "${GENOME_DIR}/reference/cytoBand.hg38.txt" +: > "$FAKE_DOCKER_LOG" +run_expect 0 telomere-no-bands "${SCRIPTS}/10-telomere-hunter.sh" sample1 +output_has telomere-no-bands 'installing the copy in assets/reference' +cmp -s "${REPO_ROOT}/assets/reference/cytoBand.hg38.txt" "${GENOME_DIR}/reference/cytoBand.hg38.txt" \ + || fail "step 10 did not install the chromosome bands from assets/reference" +docker_log_has '^run image=[^ ]*telomerehunter2:.* --ulimit nofile=65536:65536 .* telomerehunter2 -ibt /genome/sample1/aligned/sample1_sorted\.bam .* -b /genome/reference/cytoBand\.hg38\.txt *$' \ + "step 10 did not give TelomereHunter2 the GRCh38 bands" + # --- setup.sh --vep-cache: the VEP cache before the first run ------------------------ # The fake download serves a real tarball of the release versions.env pins, # with the CHECKSUMS line Ensembl publishes (BSD sum), so install_vep_cache diff --git a/tests/fake-docker/bash-step-somatic-mito.sh b/tests/fake-docker/bash-step-somatic-mito.sh index af177e672..a43bf030d 100755 --- a/tests/fake-docker/bash-step-somatic-mito.sh +++ b/tests/fake-docker/bash-step-somatic-mito.sh @@ -8,7 +8,9 @@ # autosomal depth it reads from step 16b's mosdepth output. The Nextflow # MITO_VARIANTS runs the same filter on the same mosdepth files: its script # block, run here with a fake gatk, passes the same depth (30), and 0 when the -# workflow gives it no mosdepth files. The workflow joins MOSDEPTH's output +# workflow gives it no mosdepth files. At depth 0 the filter marks nothing: +# step 20 and the module warn, and the annotation table gets the '# numt' +# line (og mito annotate --numt-default). The workflow joins MOSDEPTH's output # in, and the module stops when mosdepth ran and the join gave it nothing # (the stub runs in nextflow.yml go through that check). # shellcheck source=../../scripts/ci/fake-docker/lib.sh @@ -95,7 +97,9 @@ docker_log_has '^run image=[^ ]*gatk.* Mutect2 ' "step 29 reused a result withou : > "$FAKE_DOCKER_LOG" run_expect 0 mito-no-depth "${SCRIPTS}/20-mtoolbox.sh" sample1 docker_log_has '^run image=[^ ]*gatk.* NuMTFilterTool .*--autosomal-coverage 0 ' "step 20 did not run NuMTFilterTool" -output_has mito-no-depth 'no mosdepth output' +output_has mito-no-depth 'WARNING: no mosdepth output' +docker_log_has '^run image=[^ ]*python.* /pgp-bin/og mito annotate .*--numt-default --out ' \ + "step 20 without a depth did not tell og mito annotate the NuMT filter used the default depth" M="${GENOME_DIR}/sample1/mosdepth" mkdir -p "$M" printf 'chrom\tlength\tbases\tmean\tmin\tmax\nchr1\t1000\t30000\t30.00\t0\t60\nchr2\t1000\t30000\t30.00\t0\t60\nchrM\t16569\t1\t1000.00\t0\t2000\ntotal\t2000\t60000\t30.00\t0\t60\n' \ @@ -113,6 +117,12 @@ run_expect 0 mito "${SCRIPTS}/20-mtoolbox.sh" sample1 docker_log_has '^run image=[^ ]*gatk.* NuMTFilterTool .*--autosomal-coverage 30 ' "step 20 did not pass the median autosomal depth (30)" docker_log_has '^run image=[^ ]*gatk.* NuMTFilterTool .*-O /genome/sample1/mito/sample1_chrM_filtered\.vcf\.gz' \ "NuMTFilterTool does not write the file the reports read" +docker_log_has '^run image=[^ ]*python.* /pgp-bin/og mito annotate ' "step 20 did not annotate its calls" +if grep -q -- '--numt-default' "$FAKE_DOCKER_LOG"; then fail "step 20 with a measured depth still said the NuMT filter used the default"; fi +: > "$FAKE_DOCKER_LOG" +AUTOSOMAL_COVERAGE=25 run_expect 0 mito-given-depth "${SCRIPTS}/20-mtoolbox.sh" sample1 +docker_log_has '^run image=[^ ]*gatk.* NuMTFilterTool .*--autosomal-coverage 25 ' "step 20 did not pass AUTOSOMAL_COVERAGE" +if grep -q -- '--numt-default' "$FAKE_DOCKER_LOG"; then fail "step 20 with AUTOSOMAL_COVERAGE still said the NuMT filter used the default"; fi # --- MITO_VARIANTS (Nextflow) ------------------------------------------------------------ # The shell of the module's script block, with its Groovy values filled in: @@ -151,12 +161,25 @@ grep -q ' FilterMutectCalls .*-O sample1_chrM_mutect2_filtered\.vcf\.gz' "${NFW} || fail "FilterMutectCalls does not write the intermediate file NuMTFilterTool reads" run_mito_module "" grep -q -- '--autosomal-coverage 0 ' <<<"${NUMT} " || fail "MITO_VARIANTS without mosdepth files did not run the filter at depth 0: ${NUMT:-no call}" -grep -q 'mosdepth is not in --tools' "${NFW}/out.txt" || fail "MITO_VARIANTS without mosdepth files does not say why the depth is 0" +grep -q 'WARNING: mosdepth is not in --tools' "${NFW}/out.txt" || fail "MITO_VARIANTS without mosdepth files does not warn why the depth is 0" +# MITO_VARIANTS_ANNOTATE passes --numt-default exactly when mosdepth is not +# in --tools, the case where MITO_VARIANTS had no depth files. +# shellcheck disable=SC2016 # the dollar signs are Groovy placeholders, matched literally +grep -qF "contains('mosdepth') ? '' : '--numt-default'" "$MOD" \ + || fail "MITO_VARIANTS_ANNOTATE does not pass --numt-default without mosdepth in --tools" +# shellcheck disable=SC2016 +grep -qF 'og mito annotate --vcf ${vcf} ${cv} ${gn} ${numt} --out' "$MOD" \ + || fail "MITO_VARIANTS_ANNOTATE does not hand og mito annotate its --numt-default" # The workflow joins MOSDEPTH's summary and distribution in, failing on a BAM # with no mosdepth row (a plain join drops that sample from MITO_VARIANTS), and # the module refuses to go on without them when mosdepth ran. grep -qF 'ch_bam.join(ch_mosdepth_depth, failOnMismatch: true)' "${REPO_ROOT}/workflows/bam_analysis.nf" \ || fail "workflows/bam_analysis.nf does not join MOSDEPTH's output into MITO_VARIANTS with failOnMismatch" +# A task's stderr stays in its work directory when the task succeeds, so the +# workflow itself says on the console that the NuMT filter has no depth. +grep -q 'log.warn "mito_variants: mosdepth is not in --tools, so the NuMT filter runs at the default depth 0' \ + "${REPO_ROOT}/workflows/bam_analysis.nf" \ + || fail "workflows/bam_analysis.nf does not warn on the console when mito_variants runs without mosdepth" [ "$(grep -c "contains('mosdepth') && !mosdepth_summary" "$MOD")" -eq 2 ] \ || fail "MITO_VARIANTS' script and stub do not both stop when mosdepth ran and its output is missing" echo "MITO_VARIANTS marks possible NuMTs at the depth step 20 uses." diff --git a/tests/fake-docker/run-all-everything.sh b/tests/fake-docker/run-all-everything.sh new file mode 100644 index 000000000..616a7ef05 --- /dev/null +++ b/tests/fake-docker/run-all-everything.sh @@ -0,0 +1,137 @@ +#!/usr/bin/env bash +# EVERYTHING=true runs every optional step of assets/everything.tsv. +# all data every data folder stubbed, a male BAM sample: every tool row +# but html_report (run-all.sh writes the report itself) is in +# --tools and listed as runs, with --kir true and --hla_qc +# true, and the scripts of TIDDIT, GRIDSS, IMPUTATION, SOMATIC, +# every EXTRA_CALLERS and BENCHMARK run after the pipeline +# no Yleaf exit 2 before Nextflow, naming setup.sh --yleaf-data, and +# the last run's logs/run_status.tsv is left as it was +# no BWA index exit 2 before Nextflow, naming the classic BWA index that +# script 04b (GRIDSS) needs and bwa index +# female still runs; the two Y steps are skipped (female sample) +# not HiFi a BAM whose read groups are not PL:PACBIO skips Paraphase +# and the run goes on +# conflicts TOOLS, or a switch set to another value, stops it with exit 2 +# Without EVERYTHING the opt-in steps stay out, as before. +# shellcheck source=../../scripts/ci/fake-docker/lib.sh +. "${REPO_ROOT:?}/scripts/ci/fake-docker/lib.sh" + +export GENOME_DIR="${CASE_WORK}/genome" SKIP_VALIDATION=true +G=$GENOME_DIR +seed_reference "$G" +seed_clinvar "$G" +use_output_hook +seed_sample "$G" sample1 +rm -f "${G}/sample1/vcf/sample1.vcf.gz" "${G}/sample1/vcf/sample1.vcf.gz.tbi" # a BAM row: DeepVariant writes the gVCF +# shellcheck source=../../versions.env +. "${REPO_ROOT}/versions.env" +HLA=$(grep -E '^HLA_DB_RELEASE=' "${SCRIPTS}/lib/common.sh" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+') +GC=$(sed -n 's/^GENCODE_RELEASE=\([0-9]*\)$/\1/p' "${SCRIPTS}/lib/common.sh") +[ -n "$HLA" ] && [ -n "$GC" ] || fail "cannot read HLA_DB_RELEASE and GENCODE_RELEASE from scripts/lib/common.sh" + +# Every data folder run-all.sh looks for, as setup.sh leaves it. +f() { local p; for p in "$@"; do mkdir -p "$(dirname "${G}/${p}")"; printf 'placeholder\n' > "${G}/${p}"; done; } +f "hla/IPD-IMGT-HLA_${HLA}/hla.dat" "reference/gencode.v${GC}.basic.genes.gtf" "kir/IPD-KIR_${KIR_DB_RELEASE}/kir.dat" \ + "reference/strchive-${STRCHIVE_VERSION}/catalog.json" \ + "vep_cache/homo_sapiens/${VEP_CACHE_RELEASE}_GRCh38/info.txt" "annotations/revel_grch38.tsv.gz" "annotations/revel_grch38.tsv.gz.tbi" \ + "vep_cache/homo_sapiens/${PCGR_VEP_CACHE_RELEASE}_GRCh38/info.txt" "pcgr_data/${PCGR_DATA_BUNDLE}/data/README" \ + "reference/cnvpytor/gc_hg38.pytor" "annotsv_annotations/Annotations_Human/Genes/GRCh38/README" "reference/pypgx-bundle/README" \ + "reference/somalier/sites.hg38.vcf.gz" \ + "reference/verifybamid2/1000g.phase3.100k.b38.vcf.gz.dat.UD" "reference/verifybamid2/1000g.phase3.100k.b38.vcf.gz.dat.mu" \ + "reference/verifybamid2/1000g.phase3.100k.b38.vcf.gz.dat.bed" \ + "reference/parascopy-${PARASCOPY_DATA_VERSION}/homology_table/GRCh38.bed.gz" "prs_scores/PGS000018.txt.gz" \ + "reference/pgsc_calc/${PGSC_PANEL}.tar.zst" "reference/pgsc_calc/${PGSC_PANEL}_GRCh38_sites.tsv" \ + "reference/ancestry_fine/${ANCESTRY_FINE_PANEL}/model/DONE" "reference/yleaf-${YLEAF_DATA_VERSION}/data/hg38/new_positions.txt" \ + "reference/consumer/23andme_v5_sites_dbsnp${CONSUMER_DBSNP_BUILD}.tsv.gz" \ + "reference/ensembl/Homo_sapiens.GRCh38.${ENSEMBL_GFF_RELEASE}.chr.gff3.gz" "reference/archaic/${ARCHAIC_DATA_VERSION}/DONE" \ + "reference/ancient/aadr_${AADR_VERSION}/DONE" "reference/viral-${VIRAL_REF_VERSION}/viral_genomes.fa" \ + "reference/megane/GRCh38_no_alt_analysis_set.mk" "reference/megane/GRCh38_no_alt_analysis_set.mi" \ + "reference/mocha-${MOCHA_PANEL_VERSION}/DONE" "reference/locityper-${LOCITYPER_PANEL_VERSION}/DONE" +# GRIDSS (script 04b) reads the classic BWA index beside the reference. +BWAX="amb ann bwt pac sa" +for e in $BWAX; do f "reference/GRCh38_no_alt_analysis_set.fasta.${e}"; done +# Cyrius counts as installed when its stamp names this lock file and image (setup.sh --cyrius). +if command -v sha256sum > /dev/null 2>&1; then LOCK=$(sha256sum "${SCRIPTS}/cyrius-constraints.txt"); else LOCK=$(shasum -a 256 "${SCRIPTS}/cyrius-constraints.txt"); fi +mkdir -p "${G}/tools/cyrius-${CYRIUS_VERSION}" +printf 'python=%s lock=%s\n' "$PYTHON_IMAGE" "${LOCK%% *}" > "${G}/tools/cyrius-${CYRIUS_VERSION}/INSTALLED" + +last() { grep '^nextflow :: ' "$FAKE_DOCKER_LOG" | tail -1; } +nfcalls() { grep -c '^nextflow :: ' "$FAKE_DOCKER_LOG" || true; } +has_args() { grep -qF -- "$(printf '%q ' "$@")" <<<"$(last)" || fail "nextflow lacks '$*': $(last)"; } +tools_arg() { grep -oE -- '--tools [^ ]+' <<<"$(last)" | cut -d' ' -f2 | tr -d '\134' | tr ',' '\n' | LC_ALL=C sort; } +STATUS="${G}/sample1/logs/run_status.tsv" +WANT=$(awk -F'\t' '$1 == "tool" && $2 != "html_report" {print $2}' "${REPO_ROOT}/assets/everything.tsv" | LC_ALL=C sort) +[ "$(grep -c . <<<"$WANT")" -ge 40 ] || fail "assets/everything.tsv has fewer than 40 tool rows: ${WANT}" + +# Every data folder there, a male BAM sample: every tool row runs, and every script-only step is queued. +run_rc all env EVERYTHING=true "${SCRIPTS}/run-all.sh" sample1 male +[ "$(nfcalls)" -eq 1 ] || fail "nextflow was not called once" +[ "$(tools_arg)" = "$WANT" ] || fail "--tools is not every tool row of assets/everything.tsv but html_report: +$(diff <(echo "$WANT") <(tools_arg))" +output_lacks all '^ [0-9]+b? .* skipped ' +has_args --kir true +has_args --hla_qc true +output_has all '^\[Everything\] EVERYTHING=true' +for s in 04a-tiddit 04b-gridss 14-imputation-prep 29-mutect2-somatic 03a-gatk-haplotypecaller 03b-freebayes \ + 03c-strelka2-germline 03d-octopus benchmark-variants; do + [ -f "${G}/sample1/logs/${s}.log" ] || fail "scripts/${s}.sh did not run after the pipeline" +done +grep -qE $'^step\t04a\t(ok|failed)$' "$STATUS" || fail "step 04a (TIDDIT=true) has no status line" +grep -qE $'^meta\tcommand\t.*EVERYTHING=true ' "$STATUS" || fail "the recorded command lacks EVERYTHING=true: $(grep command "$STATUS")" +if grep -qE $'^meta\tcommand\t.*TOOLS=' "$STATUS"; then fail "the recorded command names TOOLS: a replay would refuse it"; fi + +# Without Yleaf's tables: exit 2 before Nextflow, naming the install command. +mv "${G}/reference/yleaf-${YLEAF_DATA_VERSION}" "${CASE_WORK}/yleaf-away" +n=$(nfcalls) +cp "$STATUS" "${CASE_WORK}/status-before" +run_expect 2 no-yleaf env EVERYTHING=true "${SCRIPTS}/run-all.sh" sample1 male +[ "$(nfcalls)" -eq "$n" ] || fail "nextflow started without Yleaf's tables" +output_has no-yleaf 'ERROR: EVERYTHING=true runs every optional step, and 1 cannot run \(Nextflow did not start\)' +output_has no-yleaf '^ 37 Y haplogroup \(Yleaf\): data not installed: reference/yleaf-.*; install: setup.sh --yleaf-data$' +cmp -s "${CASE_WORK}/status-before" "$STATUS" || fail "a refused EVERYTHING=true run changed the last run's status: +$(diff "${CASE_WORK}/status-before" "$STATUS")" +[ ! -e "${STATUS}.prev" ] || fail "a refused EVERYTHING=true run left ${STATUS}.prev behind" + +# A female sample still runs without them: the Y steps are skipped for the sample, not for want of data. +run_rc female env EVERYTHING=true IMPUTATION=true "${SCRIPTS}/run-all.sh" sample1 female +[ "$(nfcalls)" -eq $((n + 1)) ] || fail "nextflow did not run for a female sample" +output_has female '^ 37 Y haplogroup \(Yleaf\) +skipped +\(female sample: no Y chromosome\)$' +output_has female '^ 45 Y-STR markers \(HipSTR\) +skipped +\(female sample: no Y chromosome\)$' +if tools_arg | grep -qE '^y_(haplogroup|str)$'; then fail "a Y step reached --tools for a female sample: $(last)"; fi +mv "${CASE_WORK}/yleaf-away" "${G}/reference/yleaf-${YLEAF_DATA_VERSION}" + +# Without the classic BWA index: GRIDSS (script 04b, after the pipeline) would fail hours in, so the run stops first. +for e in $BWAX; do mv "${G}/reference/GRCh38_no_alt_analysis_set.fasta.${e}" "${CASE_WORK}/"; done +run_expect 2 no-bwa env EVERYTHING=true "${SCRIPTS}/run-all.sh" sample1 male +[ "$(nfcalls)" -eq $((n + 1)) ] || fail "nextflow started without the classic BWA index" +output_has no-bwa '^ 04b GRIDSS \(GRIDSS=true\): classic BWA index not installed: reference/GRCh38_no_alt_analysis_set\.fasta\.amb; install: bwa index \(docs/04b-gridss\.md\)$' +for e in $BWAX; do mv "${CASE_WORK}/GRCh38_no_alt_analysis_set.fasta.${e}" "${G}/reference/"; done + +# A BAM that is not PacBio HiFi: og paraphase check-bam exits 3, and step 35b is a skip, not a stop. +cat > "${CASE_WORK}/not-hifi" <<'HOOK' +#!/usr/bin/env bash +case "$*" in *"og paraphase check-bam "*) exit 3 ;; esac +exec "${CASE_WORK}/hook-outputs" "$@" +HOOK +chmod +x "${CASE_WORK}/not-hifi" +run_rc not-hifi env EVERYTHING=true FAKE_DOCKER_RUN_HOOK="${CASE_WORK}/not-hifi" "${SCRIPTS}/run-all.sh" sample1 male +[ "$(nfcalls)" -eq $((n + 2)) ] || fail "nextflow did not run with a BAM that is not PacBio HiFi" +output_has not-hifi '^ 35b Paraphase \(PacBio HiFi\) +skipped +\(not PacBio HiFi: a read group of the BAM is not PL:PACBIO\)$' +if tools_arg | grep -qx paraphase; then fail "paraphase reached --tools for a BAM that is not PacBio HiFi"; fi +docker_log_has 'og paraphase check-bam /genome/sample1/aligned/sample1_sorted\.bam' "run-all.sh did not check the BAM with og paraphase check-bam" + +# EVERYTHING names the steps and sets the switches itself: another value is refused before anything runs. +run_expect 2 with-tools env EVERYTHING=true TOOLS=pharmcat "${SCRIPTS}/run-all.sh" sample1 male +output_has with-tools 'EVERYTHING=true names every step itself: unset TOOLS' +run_expect 2 kir-off env EVERYTHING=true KIR=false "${SCRIPTS}/run-all.sh" sample1 male +output_has kir-off 'EVERYTHING=true sets KIR=true: unset KIR' +run_expect 2 none env EVERYTHING=true ARCHAIC_DIR=none "${SCRIPTS}/run-all.sh" sample1 male +output_has none '^ 43 Archaic ancestry \(IBDmix\): ARCHAIC_DIR=none: unset ARCHAIC_DIR$' +[ "$(nfcalls)" -eq $((n + 2)) ] || fail "nextflow started on a refused EVERYTHING=true run" + +# Without EVERYTHING a default run leaves the opt-in steps out, as before. +run_expect 0 default "${SCRIPTS}/run-all.sh" sample1 male +output_has default '^ 37 Y haplogroup \(Yleaf\) +skipped +\(opt-in: add y_haplogroup to TOOLS\)$' +if grep -qE -- ' --kir true' <<<"$(last)"; then fail "a default run passed --kir true"; fi +echo "EVERYTHING=true runs every optional step, and stops before Nextflow when one lacks its data." diff --git a/tests/parity/cases.tsv b/tests/parity/cases.tsv index bd64723bf..af8ed7f03 100644 --- a/tests/parity/cases.tsv +++ b/tests/parity/cases.tsv @@ -1336,3 +1336,158 @@ report-render m-genome-other gen:report-corpus.sh --summary m-genome-other.json report-render m-genome-stranger gen:report-corpus.sh --summary m-genome-stranger.json -o m-genome-stranger.txt -o m-genome-stranger.html m-genome-stranger.txt,m-genome-stranger.html bytes PYTHON_IMAGE report-render m-genome-outdated gen:report-corpus.sh --summary m-genome-outdated.json -o m-genome-outdated.txt -o m-genome-outdated.html m-genome-outdated.txt,m-genome-outdated.html bytes PYTHON_IMAGE report-render m-genome-no-stranger gen:report-corpus.sh --summary m-genome-no-stranger.json -o m-genome-no-stranger.txt -o m-genome-no-stranger.html m-genome-no-stranger.txt,m-genome-no-stranger.html bytes PYTHON_IMAGE +# report-charts: the five chart specs of every report-render summary, as render_report.py --charts-json wrote them at the oracle commit. +report-charts full gen:report-corpus.sh --summary full.json --charts-json full_charts.json full_charts.json json PYTHON_IMAGE +report-charts nf gen:report-corpus.sh --summary nf.json --charts-json nf_charts.json nf_charts.json json PYTHON_IMAGE +report-charts hidden gen:report-corpus.sh --summary hidden.json --charts-json hidden_charts.json hidden_charts.json json PYTHON_IMAGE +report-charts stale gen:report-corpus.sh --summary stale.json --charts-json stale_charts.json stale_charts.json json PYTHON_IMAGE +report-charts failed gen:report-corpus.sh --summary failed.json --charts-json failed_charts.json failed_charts.json json PYTHON_IMAGE +report-charts failed-nodate gen:report-corpus.sh --summary failed-nodate.json --charts-json failed-nodate_charts.json failed-nodate_charts.json json PYTHON_IMAGE +report-charts failed-emptydate gen:report-corpus.sh --summary failed-emptydate.json --charts-json failed-emptydate_charts.json failed-emptydate_charts.json json PYTHON_IMAGE +report-charts bad-a gen:report-corpus.sh --summary bad-a.json --charts-json bad-a_charts.json bad-a_charts.json json PYTHON_IMAGE +report-charts bad-b gen:report-corpus.sh --summary bad-b.json --charts-json bad-b_charts.json bad-b_charts.json json PYTHON_IMAGE +report-charts bad-c gen:report-corpus.sh --summary bad-c.json --charts-json bad-c_charts.json bad-c_charts.json json PYTHON_IMAGE +report-charts bad-d gen:report-corpus.sh --summary bad-d.json --charts-json bad-d_charts.json bad-d_charts.json json PYTHON_IMAGE +report-charts bad-e gen:report-corpus.sh --summary bad-e.json --charts-json bad-e_charts.json bad-e_charts.json json PYTHON_IMAGE +report-charts badgz gen:report-corpus.sh --summary badgz.json --charts-json badgz_charts.json badgz_charts.json json PYTHON_IMAGE +report-charts kary-1 gen:report-corpus.sh --summary kary-1.json --charts-json kary-1_charts.json kary-1_charts.json json PYTHON_IMAGE +report-charts kary-2 gen:report-corpus.sh --summary kary-2.json --charts-json kary-2_charts.json kary-2_charts.json json PYTHON_IMAGE +report-charts kary-3 gen:report-corpus.sh --summary kary-3.json --charts-json kary-3_charts.json kary-3_charts.json json PYTHON_IMAGE +report-charts kary-4 gen:report-corpus.sh --summary kary-4.json --charts-json kary-4_charts.json kary-4_charts.json json PYTHON_IMAGE +report-charts kary-5 gen:report-corpus.sh --summary kary-5.json --charts-json kary-5_charts.json kary-5_charts.json json PYTHON_IMAGE +report-charts kary-6 gen:report-corpus.sh --summary kary-6.json --charts-json kary-6_charts.json kary-6_charts.json json PYTHON_IMAGE +report-charts kary-7 gen:report-corpus.sh --summary kary-7.json --charts-json kary-7_charts.json kary-7_charts.json json PYTHON_IMAGE +report-charts kary-8 gen:report-corpus.sh --summary kary-8.json --charts-json kary-8_charts.json kary-8_charts.json json PYTHON_IMAGE +report-charts kary-9 gen:report-corpus.sh --summary kary-9.json --charts-json kary-9_charts.json kary-9_charts.json json PYTHON_IMAGE +report-charts kary-10 gen:report-corpus.sh --summary kary-10.json --charts-json kary-10_charts.json kary-10_charts.json json PYTHON_IMAGE +report-charts crlf gen:report-corpus.sh --summary crlf.json --charts-json crlf_charts.json crlf_charts.json json PYTHON_IMAGE +report-charts declared-status gen:report-corpus.sh --summary declared-status.json --charts-json declared-status_charts.json declared-status_charts.json json PYTHON_IMAGE +report-charts declared-manifest gen:report-corpus.sh --summary declared-manifest.json --charts-json declared-manifest_charts.json declared-manifest_charts.json json PYTHON_IMAGE +report-charts declared-qc gen:report-corpus.sh --summary declared-qc.json --charts-json declared-qc_charts.json declared-qc_charts.json json PYTHON_IMAGE +report-charts links gen:report-corpus.sh --summary links.json --charts-json links_charts.json links_charts.json json PYTHON_IMAGE +report-charts notgz gen:report-corpus.sh --summary notgz.json --charts-json notgz_charts.json notgz_charts.json json PYTHON_IMAGE +report-charts empty gen:report-corpus.sh --summary empty.json --charts-json empty_charts.json empty_charts.json json PYTHON_IMAGE +report-charts declared-arg gen:report-corpus.sh --summary declared-arg.json --charts-json declared-arg_charts.json declared-arg_charts.json json PYTHON_IMAGE +report-charts no-assets gen:report-corpus.sh --summary no-assets.json --charts-json no-assets_charts.json no-assets_charts.json json PYTHON_IMAGE +report-charts c-full gen:report-corpus.sh --summary c-full.json --charts-json c-full_charts.json c-full_charts.json json PYTHON_IMAGE +report-charts c-float-nan gen:report-corpus.sh --summary c-float-nan.json --charts-json c-float-nan_charts.json c-float-nan_charts.json json PYTHON_IMAGE +report-charts c-float-inf gen:report-corpus.sh --summary c-float-inf.json --charts-json c-float-inf_charts.json c-float-inf_charts.json json PYTHON_IMAGE +report-charts c-float--inf gen:report-corpus.sh --summary c-float--inf.json --charts-json c-float--inf_charts.json c-float--inf_charts.json json PYTHON_IMAGE +report-charts c-nf gen:report-corpus.sh --summary c-nf.json --charts-json c-nf_charts.json c-nf_charts.json json PYTHON_IMAGE +report-charts c-bad1 gen:report-corpus.sh --summary c-bad1.json --charts-json c-bad1_charts.json c-bad1_charts.json json PYTHON_IMAGE +report-charts c-bad2 gen:report-corpus.sh --summary c-bad2.json --charts-json c-bad2_charts.json c-bad2_charts.json json PYTHON_IMAGE +report-charts c-g2-left gen:report-corpus.sh --summary c-g2-left.json --charts-json c-g2-left_charts.json c-g2-left_charts.json json PYTHON_IMAGE +report-charts c-g2-shifted gen:report-corpus.sh --summary c-g2-shifted.json --charts-json c-g2-shifted_charts.json c-g2-shifted_charts.json json PYTHON_IMAGE +report-charts c-g2-two gen:report-corpus.sh --summary c-g2-two.json --charts-json c-g2-two_charts.json c-g2-two_charts.json json PYTHON_IMAGE +report-charts c-g2-gvcf gen:report-corpus.sh --summary c-g2-gvcf.json --charts-json c-g2-gvcf_charts.json c-g2-gvcf_charts.json json PYTHON_IMAGE +report-charts c-g2-none gen:report-corpus.sh --summary c-g2-none.json --charts-json c-g2-none_charts.json c-g2-none_charts.json json PYTHON_IMAGE +report-charts c-g2-other gen:report-corpus.sh --summary c-g2-other.json --charts-json c-g2-other_charts.json c-g2-other_charts.json json PYTHON_IMAGE +report-charts c-g2-nocall gen:report-corpus.sh --summary c-g2-nocall.json --charts-json c-g2-nocall_charts.json c-g2-nocall_charts.json json PYTHON_IMAGE +report-charts c-g2-novcf gen:report-corpus.sh --summary c-g2-novcf.json --charts-json c-g2-novcf_charts.json c-g2-novcf_charts.json json PYTHON_IMAGE +report-charts cb-full gen:report-corpus.sh --summary cb-full.json --charts-json cb-full_charts.json cb-full_charts.json json PYTHON_IMAGE +report-charts cb-quoted-smn gen:report-corpus.sh --summary cb-quoted-smn.json --charts-json cb-quoted-smn_charts.json cb-quoted-smn_charts.json json PYTHON_IMAGE +report-charts cb-quoted-interval gen:report-corpus.sh --summary cb-quoted-interval.json --charts-json cb-quoted-interval_charts.json cb-quoted-interval_charts.json json PYTHON_IMAGE +report-charts cb-quoted-dosage gen:report-corpus.sh --summary cb-quoted-dosage.json --charts-json cb-quoted-dosage_charts.json cb-quoted-dosage_charts.json json PYTHON_IMAGE +report-charts cb-unicode-contig gen:report-corpus.sh --summary cb-unicode-contig.json --charts-json cb-unicode-contig_charts.json cb-unicode-contig_charts.json json PYTHON_IMAGE +report-charts cb-nf gen:report-corpus.sh --summary cb-nf.json --charts-json cb-nf_charts.json cb-nf_charts.json json PYTHON_IMAGE +report-charts cb-probable gen:report-corpus.sh --summary cb-probable.json --charts-json cb-probable_charts.json cb-probable_charts.json json PYTHON_IMAGE +report-charts cb-failed gen:report-corpus.sh --summary cb-failed.json --charts-json cb-failed_charts.json cb-failed_charts.json json PYTHON_IMAGE +report-charts cb-bad gen:report-corpus.sh --summary cb-bad.json --charts-json cb-bad_charts.json cb-bad_charts.json json PYTHON_IMAGE +report-charts cb-nfbad gen:report-corpus.sh --summary cb-nfbad.json --charts-json cb-nfbad_charts.json cb-nfbad_charts.json json PYTHON_IMAGE +report-charts cb-notbi gen:report-corpus.sh --summary cb-notbi.json --charts-json cb-notbi_charts.json cb-notbi_charts.json json PYTHON_IMAGE +report-charts cb-notgz gen:report-corpus.sh --summary cb-notgz.json --charts-json cb-notgz_charts.json cb-notgz_charts.json json PYTHON_IMAGE +report-charts cb-empty gen:report-corpus.sh --summary cb-empty.json --charts-json cb-empty_charts.json cb-empty_charts.json json PYTHON_IMAGE +report-charts cb-no-assets gen:report-corpus.sh --summary cb-no-assets.json --charts-json cb-no-assets_charts.json cb-no-assets_charts.json json PYTHON_IMAGE +report-charts all gen:report-corpus.sh --summary all.json --charts-json all_charts.json all_charts.json json PYTHON_IMAGE +report-charts all-nf gen:report-corpus.sh --summary all-nf.json --charts-json all-nf_charts.json all-nf_charts.json json PYTHON_IMAGE +report-charts all-bad gen:report-corpus.sh --summary all-bad.json --charts-json all-bad_charts.json all-bad_charts.json json PYTHON_IMAGE +report-charts all-failed gen:report-corpus.sh --summary all-failed.json --charts-json all-failed_charts.json all-failed_charts.json json PYTHON_IMAGE +report-charts all-empty gen:report-corpus.sh --summary all-empty.json --charts-json all-empty_charts.json all-empty_charts.json json PYTHON_IMAGE +report-charts all-history gen:report-corpus.sh --summary all-history.json --charts-json all-history_charts.json all-history_charts.json json PYTHON_IMAGE +report-charts all-history-bad gen:report-corpus.sh --summary all-history-bad.json --charts-json all-history-bad_charts.json all-history-bad_charts.json json PYTHON_IMAGE +report-charts all-inf gen:report-corpus.sh --summary all-inf.json --charts-json all-inf_charts.json all-inf_charts.json json PYTHON_IMAGE +report-charts all-default-out gen:report-corpus.sh --summary all-default-out.json --charts-json all-default-out_charts.json all-default-out_charts.json json PYTHON_IMAGE +report-charts m-counts-float gen:report-corpus.sh --summary m-counts-float.json --charts-json m-counts-float_charts.json m-counts-float_charts.json json PYTHON_IMAGE +report-charts m-counts gen:report-corpus.sh --summary m-counts.json --charts-json m-counts_charts.json m-counts_charts.json json PYTHON_IMAGE +report-charts m-limits gen:report-corpus.sh --summary m-limits.json --charts-json m-limits_charts.json m-limits_charts.json json PYTHON_IMAGE +report-charts m-no-manifest gen:report-corpus.sh --summary m-no-manifest.json --charts-json m-no-manifest_charts.json m-no-manifest_charts.json json PYTHON_IMAGE +report-charts m-qc-failed gen:report-corpus.sh --summary m-qc-failed.json --charts-json m-qc-failed_charts.json m-qc-failed_charts.json json PYTHON_IMAGE +report-charts m-qc-missing gen:report-corpus.sh --summary m-qc-missing.json --charts-json m-qc-missing_charts.json m-qc-missing_charts.json json PYTHON_IMAGE +report-charts m-qc-mixed gen:report-corpus.sh --summary m-qc-mixed.json --charts-json m-qc-mixed_charts.json m-qc-mixed_charts.json json PYTHON_IMAGE +report-charts m-qc-ok gen:report-corpus.sh --summary m-qc-ok.json --charts-json m-qc-ok_charts.json m-qc-ok_charts.json json PYTHON_IMAGE +report-charts m-qc-stale gen:report-corpus.sh --summary m-qc-stale.json --charts-json m-qc-stale_charts.json m-qc-stale_charts.json json PYTHON_IMAGE +report-charts m-qc-unreadable gen:report-corpus.sh --summary m-qc-unreadable.json --charts-json m-qc-unreadable_charts.json m-qc-unreadable_charts.json json PYTHON_IMAGE +report-charts m-recheck-newer gen:report-corpus.sh --summary m-recheck-newer.json --charts-json m-recheck-newer_charts.json m-recheck-newer_charts.json json PYTHON_IMAGE +report-charts m-recheck-none gen:report-corpus.sh --summary m-recheck-none.json --charts-json m-recheck-none_charts.json m-recheck-none_charts.json json PYTHON_IMAGE +report-charts m-release-empty gen:report-corpus.sh --summary m-release-empty.json --charts-json m-release-empty_charts.json m-release-empty_charts.json json PYTHON_IMAGE +report-charts m-release gen:report-corpus.sh --summary m-release.json --charts-json m-release_charts.json m-release_charts.json json PYTHON_IMAGE +report-charts m-sample-escape gen:report-corpus.sh --summary m-sample-escape.json --charts-json m-sample-escape_charts.json m-sample-escape_charts.json json PYTHON_IMAGE +report-charts m-sample-unicode gen:report-corpus.sh --summary m-sample-unicode.json --charts-json m-sample-unicode_charts.json m-sample-unicode_charts.json json PYTHON_IMAGE +report-charts m-sex-agree gen:report-corpus.sh --summary m-sex-agree.json --charts-json m-sex-agree_charts.json m-sex-agree_charts.json json PYTHON_IMAGE +report-charts m-sex gen:report-corpus.sh --summary m-sex.json --charts-json m-sex_charts.json m-sex_charts.json json PYTHON_IMAGE +report-charts m-since-all gen:report-corpus.sh --summary m-since-all.json --charts-json m-since-all_charts.json m-since-all_charts.json json PYTHON_IMAGE +report-charts m-since-empty gen:report-corpus.sh --summary m-since-empty.json --charts-json m-since-empty_charts.json m-since-empty_charts.json json PYTHON_IMAGE +report-charts m-since-qc gen:report-corpus.sh --summary m-since-qc.json --charts-json m-since-qc_charts.json m-since-qc_charts.json json PYTHON_IMAGE +report-charts m-since-text gen:report-corpus.sh --summary m-since-text.json --charts-json m-since-text_charts.json m-since-text_charts.json json PYTHON_IMAGE +report-charts m-started gen:report-corpus.sh --summary m-started.json --charts-json m-started_charts.json m-started_charts.json json PYTHON_IMAGE +report-charts m-variants-failed gen:report-corpus.sh --summary m-variants-failed.json --charts-json m-variants-failed_charts.json m-variants-failed_charts.json json PYTHON_IMAGE +report-charts m-variants-missing gen:report-corpus.sh --summary m-variants-missing.json --charts-json m-variants-missing_charts.json m-variants-missing_charts.json json PYTHON_IMAGE +report-charts m-variants-ok gen:report-corpus.sh --summary m-variants-ok.json --charts-json m-variants-ok_charts.json m-variants-ok_charts.json json PYTHON_IMAGE +report-charts m-variants-stale gen:report-corpus.sh --summary m-variants-stale.json --charts-json m-variants-stale_charts.json m-variants-stale_charts.json json PYTHON_IMAGE +report-charts m-variants-unreadable gen:report-corpus.sh --summary m-variants-unreadable.json --charts-json m-variants-unreadable_charts.json m-variants-unreadable_charts.json json PYTHON_IMAGE +report-charts m-pgx-ok gen:report-corpus.sh --summary m-pgx-ok.json --charts-json m-pgx-ok_charts.json m-pgx-ok_charts.json json PYTHON_IMAGE +report-charts m-pgx-stale gen:report-corpus.sh --summary m-pgx-stale.json --charts-json m-pgx-stale_charts.json m-pgx-stale_charts.json json PYTHON_IMAGE +report-charts m-pgx-states gen:report-corpus.sh --summary m-pgx-states.json --charts-json m-pgx-states_charts.json m-pgx-states_charts.json json PYTHON_IMAGE +report-charts m-pgx-calls gen:report-corpus.sh --summary m-pgx-calls.json --charts-json m-pgx-calls_charts.json m-pgx-calls_charts.json json PYTHON_IMAGE +report-charts m-hla-ok gen:report-corpus.sh --summary m-hla-ok.json --charts-json m-hla-ok_charts.json m-hla-ok_charts.json json PYTHON_IMAGE +report-charts m-hla-none gen:report-corpus.sh --summary m-hla-none.json --charts-json m-hla-none_charts.json m-hla-none_charts.json json PYTHON_IMAGE +report-charts m-hla-failed gen:report-corpus.sh --summary m-hla-failed.json --charts-json m-hla-failed_charts.json m-hla-failed_charts.json json PYTHON_IMAGE +report-charts m-mito-ok gen:report-corpus.sh --summary m-mito-ok.json --charts-json m-mito-ok_charts.json m-mito-ok_charts.json json PYTHON_IMAGE +report-charts m-mito-notes gen:report-corpus.sh --summary m-mito-notes.json --charts-json m-mito-notes_charts.json m-mito-notes_charts.json json PYTHON_IMAGE +report-charts m-mito-copies gen:report-corpus.sh --summary m-mito-copies.json --charts-json m-mito-copies_charts.json m-mito-copies_charts.json json PYTHON_IMAGE +report-charts m-mito-failed gen:report-corpus.sh --summary m-mito-failed.json --charts-json m-mito-failed_charts.json m-mito-failed_charts.json json PYTHON_IMAGE +report-charts m-optin-ok gen:report-corpus.sh --summary m-optin-ok.json --charts-json m-optin-ok_charts.json m-optin-ok_charts.json json PYTHON_IMAGE +report-charts m-optin-stale gen:report-corpus.sh --summary m-optin-stale.json --charts-json m-optin-stale_charts.json m-optin-stale_charts.json json PYTHON_IMAGE +report-charts m-optin-failed gen:report-corpus.sh --summary m-optin-failed.json --charts-json m-optin-failed_charts.json m-optin-failed_charts.json json PYTHON_IMAGE +report-charts m-optin-unreadable gen:report-corpus.sh --summary m-optin-unreadable.json --charts-json m-optin-unreadable_charts.json m-optin-unreadable_charts.json json PYTHON_IMAGE +report-charts m-optin-odd gen:report-corpus.sh --summary m-optin-odd.json --charts-json m-optin-odd_charts.json m-optin-odd_charts.json json PYTHON_IMAGE +report-charts m-optin-since gen:report-corpus.sh --summary m-optin-since.json --charts-json m-optin-since_charts.json m-optin-since_charts.json json PYTHON_IMAGE +report-charts m-optin-empty gen:report-corpus.sh --summary m-optin-empty.json --charts-json m-optin-empty_charts.json m-optin-empty_charts.json json PYTHON_IMAGE +report-charts m-optin-partial gen:report-corpus.sh --summary m-optin-partial.json --charts-json m-optin-partial_charts.json m-optin-partial_charts.json json PYTHON_IMAGE +report-charts m-optin-viral-na gen:report-corpus.sh --summary m-optin-viral-na.json --charts-json m-optin-viral-na_charts.json m-optin-viral-na_charts.json json PYTHON_IMAGE +report-charts m-couple gen:report-corpus.sh --summary m-couple.json --charts-json m-couple_charts.json m-couple_charts.json json PYTHON_IMAGE +report-charts m-couple-empty gen:report-corpus.sh --summary m-couple-empty.json --charts-json m-couple-empty_charts.json m-couple-empty_charts.json json PYTHON_IMAGE +report-charts m-clinical-stale gen:report-corpus.sh --summary m-clinical-stale.json --charts-json m-clinical-stale_charts.json m-clinical-stale_charts.json json PYTHON_IMAGE +report-charts m-clinical-failed gen:report-corpus.sh --summary m-clinical-failed.json --charts-json m-clinical-failed_charts.json m-clinical-failed_charts.json json PYTHON_IMAGE +report-charts m-clinical-unreadable gen:report-corpus.sh --summary m-clinical-unreadable.json --charts-json m-clinical-unreadable_charts.json m-clinical-unreadable_charts.json json PYTHON_IMAGE +report-charts m-clinvar-many gen:report-corpus.sh --summary m-clinvar-many.json --charts-json m-clinvar-many_charts.json m-clinvar-many_charts.json json PYTHON_IMAGE +report-charts m-clinvar-none gen:report-corpus.sh --summary m-clinvar-none.json --charts-json m-clinvar-none_charts.json m-clinvar-none_charts.json json PYTHON_IMAGE +report-charts m-clinvar-freq-note gen:report-corpus.sh --summary m-clinvar-freq-note.json --charts-json m-clinvar-freq-note_charts.json m-clinvar-freq-note_charts.json json PYTHON_IMAGE +report-charts m-cpsr-noown gen:report-corpus.sh --summary m-cpsr-noown.json --charts-json m-cpsr-noown_charts.json m-cpsr-noown_charts.json json PYTHON_IMAGE +report-charts m-cpsr-none gen:report-corpus.sh --summary m-cpsr-none.json --charts-json m-cpsr-none_charts.json m-cpsr-none_charts.json json PYTHON_IMAGE +report-charts m-slivar-phase gen:report-corpus.sh --summary m-slivar-phase.json --charts-json m-slivar-phase_charts.json m-slivar-phase_charts.json json PYTHON_IMAGE +report-charts m-slivar-unphased gen:report-corpus.sh --summary m-slivar-unphased.json --charts-json m-slivar-unphased_charts.json m-slivar-unphased_charts.json json PYTHON_IMAGE +report-charts m-sf-notes gen:report-corpus.sh --summary m-sf-notes.json --charts-json m-sf-notes_charts.json m-sf-notes_charts.json json PYTHON_IMAGE +report-charts m-clinical-escape gen:report-corpus.sh --summary m-clinical-escape.json --charts-json m-clinical-escape_charts.json m-clinical-escape_charts.json json PYTHON_IMAGE +report-charts m-since-clinical gen:report-corpus.sh --summary m-since-clinical.json --charts-json m-since-clinical_charts.json m-since-clinical_charts.json json PYTHON_IMAGE +report-charts a-full gen:report-corpus.sh --summary a-full.json --charts-json a-full_charts.json a-full_charts.json json PYTHON_IMAGE +report-charts a-stale gen:report-corpus.sh --summary a-stale.json --charts-json a-stale_charts.json a-stale_charts.json json PYTHON_IMAGE +report-charts a-failed gen:report-corpus.sh --summary a-failed.json --charts-json a-failed_charts.json a-failed_charts.json json PYTHON_IMAGE +report-charts a-unreadable gen:report-corpus.sh --summary a-unreadable.json --charts-json a-unreadable_charts.json a-unreadable_charts.json json PYTHON_IMAGE +report-charts a-missing gen:report-corpus.sh --summary a-missing.json --charts-json a-missing_charts.json a-missing_charts.json json PYTHON_IMAGE +report-charts a-partial gen:report-corpus.sh --summary a-partial.json --charts-json a-partial_charts.json a-partial_charts.json json PYTHON_IMAGE +report-charts a-escape gen:report-corpus.sh --summary a-escape.json --charts-json a-escape_charts.json a-escape_charts.json json PYTHON_IMAGE +report-charts a-painting gen:report-corpus.sh --summary a-painting.json --charts-json a-painting_charts.json a-painting_charts.json json PYTHON_IMAGE +report-charts a-no-painting gen:report-corpus.sh --summary a-no-painting.json --charts-json a-no-painting_charts.json a-no-painting_charts.json json PYTHON_IMAGE +report-charts a-prs-raw gen:report-corpus.sh --summary a-prs-raw.json --charts-json a-prs-raw_charts.json a-prs-raw_charts.json json PYTHON_IMAGE +report-charts a-prs-sex gen:report-corpus.sh --summary a-prs-sex.json --charts-json a-prs-sex_charts.json a-prs-sex_charts.json json PYTHON_IMAGE +report-charts a-y-calls gen:report-corpus.sh --summary a-y-calls.json --charts-json a-y-calls_charts.json a-y-calls_charts.json json PYTHON_IMAGE +report-charts a-since gen:report-corpus.sh --summary a-since.json --charts-json a-since_charts.json a-since_charts.json json PYTHON_IMAGE +report-charts a-numbers gen:report-corpus.sh --summary a-numbers.json --charts-json a-numbers_charts.json a-numbers_charts.json json PYTHON_IMAGE +report-charts m-genome-ok gen:report-corpus.sh --summary m-genome-ok.json --charts-json m-genome-ok_charts.json m-genome-ok_charts.json json PYTHON_IMAGE +report-charts m-genome-stale gen:report-corpus.sh --summary m-genome-stale.json --charts-json m-genome-stale_charts.json m-genome-stale_charts.json json PYTHON_IMAGE +report-charts m-genome-failed gen:report-corpus.sh --summary m-genome-failed.json --charts-json m-genome-failed_charts.json m-genome-failed_charts.json json PYTHON_IMAGE +report-charts m-genome-other gen:report-corpus.sh --summary m-genome-other.json --charts-json m-genome-other_charts.json m-genome-other_charts.json json PYTHON_IMAGE +report-charts m-genome-stranger gen:report-corpus.sh --summary m-genome-stranger.json --charts-json m-genome-stranger_charts.json m-genome-stranger_charts.json json PYTHON_IMAGE +report-charts m-genome-outdated gen:report-corpus.sh --summary m-genome-outdated.json --charts-json m-genome-outdated_charts.json m-genome-outdated_charts.json json PYTHON_IMAGE +report-charts m-genome-no-stranger gen:report-corpus.sh --summary m-genome-no-stranger.json --charts-json m-genome-no-stranger_charts.json m-genome-no-stranger_charts.json json PYTHON_IMAGE diff --git a/tests/parity/gen/summary-clinical.sh b/tests/parity/gen/summary-clinical.sh index 6d5cfbac3..2d0f7907e 100644 --- a/tests/parity/gen/summary-clinical.sh +++ b/tests/parity/gen/summary-clinical.sh @@ -31,14 +31,17 @@ NEW=202103040506.07 # after it NEWER=202103040507.00 # The helper modules of bin/collect_summary.py, as they were when the -# collector was last the summary's writer. +# collector was last the summary's writer. NO_ORACLE=1 leaves them out: +# og-summary's tests read the folders alone (tests/screen_acmg_card_section.rs). HELPERS=7c1470bc50933f48a1a0dde3c0e0b2b87bc48718 -git -C "$root" cat-file -e "${HELPERS}^{commit}" 2> /dev/null \ - || git -C "$root" fetch -q --depth=1 origin "$HELPERS" -mkdir -p pymods -for m in pgx_outside_calls clip_check annotsv_postfilter paraphase_report traits_report; do - git -C "$root" show "${HELPERS}:bin/${m}.py" > "pymods/${m}.py" -done +if [ "${NO_ORACLE:-}" != 1 ]; then + git -C "$root" cat-file -e "${HELPERS}^{commit}" 2> /dev/null \ + || git -C "$root" fetch -q --depth=1 origin "$HELPERS" + mkdir -p pymods + for m in pgx_outside_calls clip_check annotsv_postfilter paraphase_report traits_report; do + git -C "$root" show "${HELPERS}:bin/${m}.py" > "pymods/${m}.py" + done +fi mkdir -p assets for a in acmg_sf.tsv carrier_genes.tsv paralog_loci.tsv; do diff --git a/tests/parity/golden/bloodtype/abo-ab-duffy-gata-kell-null/stdout b/tests/parity/golden/bloodtype/abo-ab-duffy-gata-kell-null/stdout new file mode 100644 index 000000000..38df98ddc --- /dev/null +++ b/tests/parity/golden/bloodtype/abo-ab-duffy-gata-kell-null/stdout @@ -0,0 +1,56 @@ +Blood groups of S, predicted from the genome (not a serological typing): + Kell K+k- Kp(a-b+) Js(a-b+) high + ABO A2B low + RhD D+ high + RhCE C-c+ E-e+ low + Duffy Fy(a+b-) high + Kidd Jk(a+b-) high + MNS M-N+ S-s+ low + Lutheran Lu(a-b+) high + Diego Di(a-b+) high + Dombrock Do(a-b+) high + Colton Co(a+b-) high + Vel Vel+ high + Langereis Lan+ high + Junior Jr(a+) high + H H+ high + Secretor secretor high + HPA-1 HPA-1(a+b-) high + HPA-2 HPA-2(a+b-) high + HPA-3 HPA-3(a+b-) high + HPA-4 HPA-4(a+b-) high + HPA-5 HPA-5(a+b-) high + HPA-6 HPA-6(a+b-) high + HPA-7 HPA-7(a+b-) high + HPA-8 HPA-8(a+b-) high + HPA-9 HPA-9(a+b-) high + HPA-10 HPA-10(a+b-) high + HPA-11 HPA-11(a+b-) high + HPA-12 HPA-12(a+b-) high + HPA-13 HPA-13(a+b-) high + HPA-14 HPA-14(a+b-) high + HPA-15 HPA-15(a+b-) high + HPA-16 HPA-16(a+b-) high + HPA-17 HPA-17(a+b-) high + HPA-18 HPA-18(a+b-) high + HPA-19 HPA-19(a+b-) high + HPA-20 HPA-20(a+b-) high + HPA-21 HPA-21(a+b-) high + HPA-22 HPA-22(a+b-) high + HPA-23 HPA-23(a+b-) high + HPA-24 HPA-24(a+b-) high + HPA-25 HPA-25(a+b-) high + HPA-26 HPA-26(a+b-) high + HPA-27 HPA-27(a+b-) high + HPA-28 HPA-28(a+b-) high + HPA-29 HPA-29(a+b-) high + HPA-30 HPA-30(a+b-) high + HPA-31 HPA-31(a+b-) high + HPA-32 HPA-32(a+b-) high + HPA-33 HPA-33(a+b-) high + HPA-34 HPA-34(a+b-) high + HPA-35 HPA-35(a+b-) high + HNA-1 HNA-1(a-b+c-) low + HNA-3 HNA-3(a-b+) high + HNA-4 HNA-4(a+b-) high + HNA-5 HNA-5(a+b-) high diff --git a/tests/parity/golden/bloodtype/abo-ab-duffy-gata-kell-null/t.tsv b/tests/parity/golden/bloodtype/abo-ab-duffy-gata-kell-null/t.tsv new file mode 100644 index 000000000..b557124a5 --- /dev/null +++ b/tests/parity/golden/bloodtype/abo-ab-duffy-gata-kell-null/t.tsv @@ -0,0 +1,56 @@ +system phenotype genotype confidence note +Kell K+k- Kp(a-b+) Js(a-b+) K/null Kpb/null Jsb/null high null allele: KEL c.246T>A x1; each null copy is placed with k, Kpb, Jsb first, the alleles the ISBT table finds it with (phase is not read); a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen; lacks k, carried by most people (high prevalence) +ABO A2B A2/B low A1 or A2 rests on ABO c.1061delC, a deletion in a run of C: short-read calls are less reliable here; an A allele is read from a c.261 insertion with neither c.802G>A nor c.803G>C, so an O allele that keeps c.261 (a non-deletional O) or a weak A subgroup also reads A; ABO alleles outside these five variants (weak A and B subgroups, cis-AB, O alleles other than O.01 and O.02) are not assessed; A and B on different chromosomes assumed (no phase) +RhD D+ RHD/RHD*08N.01 (RHD copies by read depth 2.00) high weak and partial D (RHD missense alleles) are not assessed; an RHD gene that is there reads D+: RHD null alleles other than RHD*08N.01, RHD-CE-D hybrids that keep exons 3 to 7, and DEL alleles are not assessed +RhCE C-c+ E-e+ c/c e/e low RHCE exon 2 of a C allele is RHD-like: short reads can place it on RHD +Duffy Fy(a+b-) FY*A/FY*B GATA high c.-67T>C (GATA box) stops Duffy expression on red cells only; with no phase it is placed on the Fyb chromosome first, where it usually lies (FY*02N.01) +Kidd Jk(a+b-) Jka/Jka high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +MNS M-N+ S-s+ N/N s/s low GYPA, GYPB and GYPE are near copies: short reads can misplace these calls +Lutheran Lu(a-b+) Lub/Lub high +Diego Di(a-b+) Dib/Dib high +Dombrock Do(a-b+) Dob/Dob high +Colton Co(a+b-) Coa/Coa high +Vel Vel+ Vel/Vel high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Langereis Lan+ Lan/Lan high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Junior Jr(a+) Jra/Jra high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +H H+ H/H high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Secretor secretor Se/Se high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen; weak secretor alleles (such as FUT2 c.418A>T, also written c.385A>T) and a deletion of the whole FUT2 gene are not assessed +HPA-1 HPA-1(a+b-) 1a/1a high lacks HPA-1b: HPA-1a is the platelet antigen most often behind FNAIT and post-transfusion purpura in white populations: an HPA-1a-negative (HPA-1b/1b) mother can make anti-HPA-1a against an HPA-1a-positive baby; a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-2 HPA-2(a+b-) 2a/2a high lacks HPA-2b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-3 HPA-3(a+b-) 3a/3a high lacks HPA-3b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-4 HPA-4(a+b-) 4a/4a high lacks HPA-4b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-5 HPA-5(a+b-) 5a/5a high lacks HPA-5b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-6 HPA-6(a+b-) 6a/6a high lacks HPA-6b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-7 HPA-7(a+b-) 7a/7a high lacks HPA-7b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-8 HPA-8(a+b-) 8a/8a high lacks HPA-8b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-9 HPA-9(a+b-) 9a/9a high lacks HPA-9b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-10 HPA-10(a+b-) 10a/10a high lacks HPA-10b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-11 HPA-11(a+b-) 11a/11a high lacks HPA-11b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-12 HPA-12(a+b-) 12a/12a high lacks HPA-12b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-13 HPA-13(a+b-) 13a/13a high lacks HPA-13b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-14 HPA-14(a+b-) 14a/14a high lacks HPA-14b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-15 HPA-15(a+b-) 15a/15a high lacks HPA-15b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-16 HPA-16(a+b-) 16a/16a high lacks HPA-16b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-17 HPA-17(a+b-) 17a/17a high lacks HPA-17b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-18 HPA-18(a+b-) 18a/18a high lacks HPA-18b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-19 HPA-19(a+b-) 19a/19a high lacks HPA-19b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-20 HPA-20(a+b-) 20a/20a high lacks HPA-20b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-21 HPA-21(a+b-) 21a/21a high lacks HPA-21b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-22 HPA-22(a+b-) 22a/22a high lacks HPA-22b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-23 HPA-23(a+b-) 23a/23a high lacks HPA-23b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-24 HPA-24(a+b-) 24a/24a high lacks HPA-24b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-25 HPA-25(a+b-) 25a/25a high lacks HPA-25b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-26 HPA-26(a+b-) 26a/26a high lacks HPA-26b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-27 HPA-27(a+b-) 27a/27a high lacks HPA-27b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-28 HPA-28(a+b-) 28a/28a high lacks HPA-28b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-29 HPA-29(a+b-) 29a/29a high lacks HPA-29b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-30 HPA-30(a+b-) 30a/30a high lacks HPA-30b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-31 HPA-31(a+b-) 31a/31a high lacks HPA-31b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-32 HPA-32(a+b-) 32a/32a high lacks HPA-32b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-33 HPA-33(a+b-) 33a/33a high lacks HPA-33b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-34 HPA-34(a+b-) 34a/34a high lacks HPA-34b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-35 HPA-35(a+b-) 35a/35a high lacks HPA-35b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HNA-1 HNA-1(a-b+c-) FCGR3B*02/FCGR3B*02 low FCGR3B c.194A>G (x0) does not match the other FCGR3B markers; lacks HNA-1a, HNA-1c: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI); FCGR3B and FCGR3A are near copies and the FCGR3B copy number varies (none to four or more): short reads can misplace these calls, the copies are not counted, and HNA-1null (no FCGR3B) is not assessed +HNA-3 HNA-3(a-b+) 3b/3b high lacks HNA-3a: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) +HNA-4 HNA-4(a+b-) 4a/4a high lacks HNA-4b: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) +HNA-5 HNA-5(a+b-) 5a/5a high lacks HNA-5b: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) diff --git a/tests/parity/golden/bloodtype/abo-ab-no-bam/stdout b/tests/parity/golden/bloodtype/abo-ab-no-bam/stdout new file mode 100644 index 000000000..7381c46ad --- /dev/null +++ b/tests/parity/golden/bloodtype/abo-ab-no-bam/stdout @@ -0,0 +1,56 @@ +Blood groups of S, predicted from the genome (not a serological typing): + Kell K+k- Kp(a-b+) Js(a-b+) medium + ABO A2B low + RhD not determined not determined + RhCE not assessed not assessed + Duffy Fy(a+b-) medium + Kidd not assessed not assessed + MNS not assessed not assessed + Lutheran not assessed not assessed + Diego not assessed not assessed + Dombrock not assessed not assessed + Colton not assessed not assessed + Vel not assessed not assessed + Langereis not assessed not assessed + Junior not assessed not assessed + H not assessed not assessed + Secretor not assessed not assessed + HPA-1 not assessed not assessed + HPA-2 not assessed not assessed + HPA-3 not assessed not assessed + HPA-4 not assessed not assessed + HPA-5 not assessed not assessed + HPA-6 not assessed not assessed + HPA-7 not assessed not assessed + HPA-8 not assessed not assessed + HPA-9 not assessed not assessed + HPA-10 not assessed not assessed + HPA-11 not assessed not assessed + HPA-12 not assessed not assessed + HPA-13 not assessed not assessed + HPA-14 not assessed not assessed + HPA-15 HPA-15(a+b-) high + HPA-16 not assessed not assessed + HPA-17 not assessed not assessed + HPA-18 not assessed not assessed + HPA-19 not assessed not assessed + HPA-20 not assessed not assessed + HPA-21 not assessed not assessed + HPA-22 not assessed not assessed + HPA-23 not assessed not assessed + HPA-24 not assessed not assessed + HPA-25 not assessed not assessed + HPA-26 not assessed not assessed + HPA-27 not assessed not assessed + HPA-28 not assessed not assessed + HPA-29 not assessed not assessed + HPA-30 not assessed not assessed + HPA-31 not assessed not assessed + HPA-32 not assessed not assessed + HPA-33 not assessed not assessed + HPA-34 not assessed not assessed + HPA-35 not assessed not assessed + HNA-1 not assessed not assessed + HNA-3 not assessed not assessed + HNA-4 not assessed not assessed + HNA-5 not assessed not assessed diff --git a/tests/parity/golden/bloodtype/abo-ab-no-bam/t.tsv b/tests/parity/golden/bloodtype/abo-ab-no-bam/t.tsv new file mode 100644 index 000000000..f6ff12cb0 --- /dev/null +++ b/tests/parity/golden/bloodtype/abo-ab-no-bam/t.tsv @@ -0,0 +1,56 @@ +system phenotype genotype confidence note +Kell K+k- Kp(a-b+) Js(a-b+) K/null Kpb/null Jsb/null medium null allele: KEL c.246T>A x1; each null copy is placed with k, Kpb, Jsb first, the alleles the ISBT table finds it with (phase is not read); a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen; sites with no VCF record read as reference (no BAM depth to confirm them); lacks k, carried by most people (high prevalence) +ABO A2B A2/B low A1 or A2 rests on ABO c.1061delC, a deletion in a run of C: short-read calls are less reliable here; an A allele is read from a c.261 insertion with neither c.802G>A nor c.803G>C, so an O allele that keeps c.261 (a non-deletional O) or a weak A subgroup also reads A; ABO alleles outside these five variants (weak A and B subgroups, cis-AB, O alleles other than O.01 and O.02) are not assessed; A and B on different chromosomes assumed (no phase); sites with no VCF record read as reference (no BAM depth to confirm them) +RhD not determined . not determined needs the BAM: the common RhD-negative allele (RHD*01N.01) deletes the whole RHD gene, which a VCF does not show +RhCE not assessed . not assessed no VCF record at any of its 2 sites and no BAM: a VCF that does not cover chr1 would read as the reference +Duffy Fy(a+b-) FY*A/FY*B GATA medium c.-67T>C (GATA box) stops Duffy expression on red cells only; with no phase it is placed on the Fyb chromosome first, where it usually lies (FY*02N.01); sites with no VCF record read as reference (no BAM depth to confirm them) +Kidd not assessed . not assessed no VCF record at any of its 41 sites and no BAM: a VCF that does not cover chr18 would read as the reference +MNS not assessed . not assessed no VCF record at any of its 2 sites and no BAM: a VCF that does not cover chr4 would read as the reference +Lutheran not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr19 would read as the reference +Diego not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr17 would read as the reference +Dombrock not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr12 would read as the reference +Colton not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr7 would read as the reference +Vel not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr1 would read as the reference +Langereis not assessed . not assessed no VCF record at any of its 36 sites and no BAM: a VCF that does not cover chr2 would read as the reference +Junior not assessed . not assessed no VCF record at any of its 23 sites and no BAM: a VCF that does not cover chr4 would read as the reference +H not assessed . not assessed no VCF record at any of its 34 sites and no BAM: a VCF that does not cover chr19 would read as the reference +Secretor not assessed . not assessed no VCF record at any of its 14 sites and no BAM: a VCF that does not cover chr19 would read as the reference +HPA-1 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr17 would read as the reference +HPA-2 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr17 would read as the reference +HPA-3 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr17 would read as the reference +HPA-4 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr17 would read as the reference +HPA-5 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr5 would read as the reference +HPA-6 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr17 would read as the reference +HPA-7 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr17 would read as the reference +HPA-8 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr17 would read as the reference +HPA-9 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr17 would read as the reference +HPA-10 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr17 would read as the reference +HPA-11 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr17 would read as the reference +HPA-12 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr22 would read as the reference +HPA-13 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr5 would read as the reference +HPA-14 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr17 would read as the reference +HPA-15 HPA-15(a+b-) 15a/15a high lacks HPA-15b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-16 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr17 would read as the reference +HPA-17 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr17 would read as the reference +HPA-18 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr5 would read as the reference +HPA-19 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr17 would read as the reference +HPA-20 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr17 would read as the reference +HPA-21 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr17 would read as the reference +HPA-22 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr17 would read as the reference +HPA-23 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr17 would read as the reference +HPA-24 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr17 would read as the reference +HPA-25 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr5 would read as the reference +HPA-26 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr17 would read as the reference +HPA-27 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr17 would read as the reference +HPA-28 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr17 would read as the reference +HPA-29 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr17 would read as the reference +HPA-30 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr17 would read as the reference +HPA-31 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr3 would read as the reference +HPA-32 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr17 would read as the reference +HPA-33 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr17 would read as the reference +HPA-34 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr17 would read as the reference +HPA-35 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr17 would read as the reference +HNA-1 not assessed . not assessed no VCF record at any of its 6 sites and no BAM: a VCF that does not cover chr1 would read as the reference +HNA-3 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr19 would read as the reference +HNA-4 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr16 would read as the reference +HNA-5 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr16 would read as the reference diff --git a/tests/parity/golden/bloodtype/abo-bad-para-bombay-lan/t.tsv b/tests/parity/golden/bloodtype/abo-bad-para-bombay-lan/t.tsv new file mode 100644 index 000000000..13e7678ae --- /dev/null +++ b/tests/parity/golden/bloodtype/abo-bad-para-bombay-lan/t.tsv @@ -0,0 +1,56 @@ +system phenotype genotype confidence note +Langereis Lan- null/null low null alleles: ABCB6 c.717G>A x1, ABCB6 c.574C>T x1; two different null alleles, assumed to sit on different chromosomes (phase is not read); lacks Lan, carried by most people (high prevalence) +H H- (para-Bombay) h/h high null allele: FUT1 c.695G>A x2; lacks H, carried by most people (high prevalence); para-Bombay: a working FUT2 makes H in secretions, and red cells carry little or none +ABO not determined . not determined the markers do not add up to two ABO alleles (c.261 insertion x1, c.802G>A x1, c.803G>C x2) +RhD D+ RHD/RHD (RHD copies by read depth 2.00) high weak and partial D (RHD missense alleles) are not assessed; an RHD gene that is there reads D+: RHD null alleles other than RHD*08N.01, RHD-CE-D hybrids that keep exons 3 to 7, and DEL alleles are not assessed +RhCE C-c+ E-e+ c/c e/e low RHCE exon 2 of a C allele is RHD-like: short reads can place it on RHD +Kell K-k+ Kp(a-b+) Js(a-b+) k/k Kpb/Kpb Jsb/Jsb high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Duffy Fy(a+b-) FY*A/FY*A high +Kidd Jk(a+b-) Jka/Jka high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +MNS M-N+ S-s+ N/N s/s low GYPA, GYPB and GYPE are near copies: short reads can misplace these calls +Lutheran Lu(a-b+) Lub/Lub high +Diego Di(a-b+) Dib/Dib high +Dombrock Do(a-b+) Dob/Dob high +Colton Co(a+b-) Coa/Coa high +Vel Vel+ Vel/null high null allele: SMIM1 c.64_80delAGCCTAGGGGCTGTGTC x1; a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Junior Jr(a+) Jra/Jra high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Secretor secretor Se/Se high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen; weak secretor alleles (such as FUT2 c.418A>T, also written c.385A>T) and a deletion of the whole FUT2 gene are not assessed +HPA-1 HPA-1(a+b-) 1a/1a high lacks HPA-1b: HPA-1a is the platelet antigen most often behind FNAIT and post-transfusion purpura in white populations: an HPA-1a-negative (HPA-1b/1b) mother can make anti-HPA-1a against an HPA-1a-positive baby; a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-2 HPA-2(a+b-) 2a/2a high lacks HPA-2b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-3 HPA-3(a+b-) 3a/3a high lacks HPA-3b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-4 HPA-4(a+b-) 4a/4a high lacks HPA-4b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-5 HPA-5(a+b-) 5a/5a high lacks HPA-5b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-6 HPA-6(a+b-) 6a/6a high lacks HPA-6b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-7 HPA-7(a+b-) 7a/7a high lacks HPA-7b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-8 HPA-8(a+b-) 8a/8a high lacks HPA-8b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-9 HPA-9(a+b-) 9a/9a high lacks HPA-9b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-10 HPA-10(a+b-) 10a/10a high lacks HPA-10b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-11 HPA-11(a+b-) 11a/11a high lacks HPA-11b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-12 HPA-12(a+b-) 12a/12a high lacks HPA-12b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-13 HPA-13(a+b-) 13a/13a high lacks HPA-13b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-14 HPA-14(a+b-) 14a/14a high lacks HPA-14b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-15 HPA-15(a-b+) 15b/15b high lacks HPA-15a: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-16 HPA-16(a+b-) 16a/16a high lacks HPA-16b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-17 HPA-17(a+b-) 17a/17a high lacks HPA-17b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-18 HPA-18(a+b-) 18a/18a high lacks HPA-18b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-19 HPA-19(a+b-) 19a/19a high lacks HPA-19b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-20 HPA-20(a+b-) 20a/20a high lacks HPA-20b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-21 HPA-21(a+b-) 21a/21a high lacks HPA-21b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-22 HPA-22(a+b-) 22a/22a high lacks HPA-22b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-23 HPA-23(a+b-) 23a/23a high lacks HPA-23b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-24 HPA-24(a+b-) 24a/24a high lacks HPA-24b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-25 HPA-25(a+b-) 25a/25a high lacks HPA-25b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-26 HPA-26(a+b-) 26a/26a high lacks HPA-26b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-27 HPA-27(a+b-) 27a/27a high lacks HPA-27b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-28 HPA-28(a+b-) 28a/28a high lacks HPA-28b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-29 HPA-29(a+b-) 29a/29a high lacks HPA-29b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-30 HPA-30(a+b-) 30a/30a high lacks HPA-30b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-31 HPA-31(a+b-) 31a/31a high lacks HPA-31b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-32 HPA-32(a+b-) 32a/32a high lacks HPA-32b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-33 HPA-33(a+b-) 33a/33a high lacks HPA-33b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-34 HPA-34(a+b-) 34a/34a high lacks HPA-34b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-35 HPA-35(a+b-) 35a/35a high lacks HPA-35b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HNA-1 HNA-1(a-b+c-) FCGR3B*02/FCGR3B*02 low FCGR3B c.194A>G (x0) does not match the other FCGR3B markers; lacks HNA-1a, HNA-1c: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI); FCGR3B and FCGR3A are near copies and the FCGR3B copy number varies (none to four or more): short reads can misplace these calls, the copies are not counted, and HNA-1null (no FCGR3B) is not assessed +HNA-3 HNA-3(a-b+) 3b/3b high lacks HNA-3a: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) +HNA-4 HNA-4(a+b-) 4a/4a high lacks HNA-4b: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) +HNA-5 HNA-5(a+b-) 5a/5a high lacks HNA-5b: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) diff --git a/tests/parity/golden/bloodtype/abo-odd-fyx-kidd-two-nulls/t.tsv b/tests/parity/golden/bloodtype/abo-odd-fyx-kidd-two-nulls/t.tsv new file mode 100644 index 000000000..d3d786a7a --- /dev/null +++ b/tests/parity/golden/bloodtype/abo-odd-fyx-kidd-two-nulls/t.tsv @@ -0,0 +1,56 @@ +system phenotype genotype confidence note +Kidd Jk(a-b-) null/null low two null copies: no Kidd antigen on the red cells (Jk3-); null alleles: SLC14A1 c.118G>A x1, SLC14A1 c.151+1G>C x1; two different null alleles, assumed to sit on different chromosomes (phase is not read); each null copy is placed with the alleles the ISBT table finds it with first (SLC14A1 c.118G>A: Jkb; SLC14A1 c.151+1G>C: Jka; phase is not read); lacks Jk3, carried by most people (high prevalence) +ABO B B/O.01 low c.796C>A (x0) and c.803G>C (x1) disagree: a rare A or B allele; ABO alleles outside these five variants (weak A and B subgroups, cis-AB, O alleles other than O.01 and O.02) are not assessed +RhD D+ RHD/RHD (RHD copies by read depth 2.00) high weak and partial D (RHD missense alleles) are not assessed; an RHD gene that is there reads D+: RHD null alleles other than RHD*08N.01, RHD-CE-D hybrids that keep exons 3 to 7, and DEL alleles are not assessed +RhCE C-c+ E-e+ c/c e/e low RHCE exon 2 of a C allele is RHD-like: short reads can place it on RHD +Kell K-k+ Kp(a-b+) Js(a-b+) k/k Kpb/Kpb Jsb/Jsb high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Duffy Fy(a-b+w) FY*X/FY*X high +MNS M-N+ S-s+ N/N s/s low GYPA, GYPB and GYPE are near copies: short reads can misplace these calls +Lutheran Lu(a-b+) Lub/Lub high +Diego Di(a-b+) Dib/Dib high +Dombrock Do(a-b+) Dob/Dob high +Colton Co(a+b-) Coa/Coa high +Vel Vel+ Vel/Vel high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Langereis Lan+ Lan/Lan high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Junior Jr(a+) Jra/Jra high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +H H+ H/H high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Secretor secretor Se/Se high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen; weak secretor alleles (such as FUT2 c.418A>T, also written c.385A>T) and a deletion of the whole FUT2 gene are not assessed +HPA-1 HPA-1(a+b-) 1a/1a high lacks HPA-1b: HPA-1a is the platelet antigen most often behind FNAIT and post-transfusion purpura in white populations: an HPA-1a-negative (HPA-1b/1b) mother can make anti-HPA-1a against an HPA-1a-positive baby; a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-2 HPA-2(a+b-) 2a/2a high lacks HPA-2b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-3 HPA-3(a+b-) 3a/3a high lacks HPA-3b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-4 HPA-4(a+b-) 4a/4a high lacks HPA-4b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-5 HPA-5(a+b-) 5a/5a high lacks HPA-5b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-6 HPA-6(a+b-) 6a/6a high lacks HPA-6b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-7 HPA-7(a+b-) 7a/7a high lacks HPA-7b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-8 HPA-8(a+b-) 8a/8a high lacks HPA-8b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-9 HPA-9(a+b-) 9a/9a high lacks HPA-9b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-10 HPA-10(a+b-) 10a/10a high lacks HPA-10b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-11 HPA-11(a+b-) 11a/11a high lacks HPA-11b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-12 HPA-12(a+b-) 12a/12a high lacks HPA-12b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-13 HPA-13(a+b-) 13a/13a high lacks HPA-13b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-14 HPA-14(a+b-) 14a/14a high lacks HPA-14b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-15 HPA-15(a-b+) 15b/15b high lacks HPA-15a: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-16 HPA-16(a+b-) 16a/16a high lacks HPA-16b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-17 HPA-17(a+b-) 17a/17a high lacks HPA-17b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-18 HPA-18(a+b-) 18a/18a high lacks HPA-18b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-19 HPA-19(a+b-) 19a/19a high lacks HPA-19b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-20 HPA-20(a+b-) 20a/20a high lacks HPA-20b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-21 HPA-21(a+b-) 21a/21a high lacks HPA-21b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-22 HPA-22(a+b-) 22a/22a high lacks HPA-22b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-23 HPA-23(a+b-) 23a/23a high lacks HPA-23b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-24 HPA-24(a+b-) 24a/24a high lacks HPA-24b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-25 HPA-25(a+b-) 25a/25a high lacks HPA-25b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-26 HPA-26(a+b-) 26a/26a high lacks HPA-26b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-27 HPA-27(a+b-) 27a/27a high lacks HPA-27b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-28 HPA-28(a+b-) 28a/28a high lacks HPA-28b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-29 HPA-29(a+b-) 29a/29a high lacks HPA-29b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-30 HPA-30(a+b-) 30a/30a high lacks HPA-30b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-31 HPA-31(a+b-) 31a/31a high lacks HPA-31b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-32 HPA-32(a+b-) 32a/32a high lacks HPA-32b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-33 HPA-33(a+b-) 33a/33a high lacks HPA-33b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-34 HPA-34(a+b-) 34a/34a high lacks HPA-34b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-35 HPA-35(a+b-) 35a/35a high lacks HPA-35b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HNA-1 HNA-1(a-b+c-) FCGR3B*02/FCGR3B*02 low FCGR3B c.194A>G (x0) does not match the other FCGR3B markers; lacks HNA-1a, HNA-1c: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI); FCGR3B and FCGR3A are near copies and the FCGR3B copy number varies (none to four or more): short reads can misplace these calls, the copies are not counted, and HNA-1null (no FCGR3B) is not assessed +HNA-3 HNA-3(a-b+) 3b/3b high lacks HNA-3a: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) +HNA-4 HNA-4(a+b-) 4a/4a high lacks HNA-4b: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) +HNA-5 HNA-5(a+b-) 5a/5a high lacks HNA-5b: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) diff --git a/tests/parity/golden/bloodtype/bam-without-chr1-chr9/t.tsv b/tests/parity/golden/bloodtype/bam-without-chr1-chr9/t.tsv new file mode 100644 index 000000000..feda5b398 --- /dev/null +++ b/tests/parity/golden/bloodtype/bam-without-chr1-chr9/t.tsv @@ -0,0 +1,56 @@ +system phenotype genotype confidence note +ABO not determined . not determined ABO c.261delG: no call (no VCF record and no depth row (the BAM has no such contig)); ABO c.802G>A: no call (no VCF record and no depth row (the BAM has no such contig)); ABO c.803G>C: no call (no VCF record and no depth row (the BAM has no such contig)) +RhD not determined . not determined no read depth over RHD and its flanks (the BAM has no chr1 contig) +RhCE not determined . not determined RHCE c.307C>T: no call (no VCF record and no depth row (the BAM has no such contig)); RHCE c.676G>C: no call (no VCF record and no depth row (the BAM has no such contig)) +Kell K-k+ Kp(a-b+) Js(a-b+) k/k Kpb/Kpb Jsb/Jsb high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Duffy not determined . not determined ACKR1 c.125G>A: no call (no VCF record and no depth row (the BAM has no such contig)); ACKR1 c.-67T>C: no call (no VCF record and no depth row (the BAM has no such contig)) +Kidd Jk(a+b-) Jka/Jka high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +MNS M-N+ S-s+ N/N s/s low GYPA, GYPB and GYPE are near copies: short reads can misplace these calls +Lutheran Lu(a-b+) Lub/Lub high +Diego Di(a-b+) Dib/Dib high +Dombrock Do(a-b+) Dob/Dob high +Colton Co(a+b-) Coa/Coa high +Vel not determined . not determined no null row of Vel was determined; SMIM1 c.64_80delAGCCTAGGGGCTGTGTC: no call (no VCF record and no depth row (the BAM has no such contig)) +Langereis Lan+ Lan/Lan high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Junior Jr(a+) Jra/Jra high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +H H+ H/H high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Secretor secretor Se/Se high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen; weak secretor alleles (such as FUT2 c.418A>T, also written c.385A>T) and a deletion of the whole FUT2 gene are not assessed +HPA-1 HPA-1(a+b-) 1a/1a high lacks HPA-1b: HPA-1a is the platelet antigen most often behind FNAIT and post-transfusion purpura in white populations: an HPA-1a-negative (HPA-1b/1b) mother can make anti-HPA-1a against an HPA-1a-positive baby; a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-2 HPA-2(a+b-) 2a/2a high lacks HPA-2b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-3 HPA-3(a+b-) 3a/3a high lacks HPA-3b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-4 HPA-4(a+b-) 4a/4a high lacks HPA-4b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-5 HPA-5(a+b-) 5a/5a high lacks HPA-5b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-6 HPA-6(a+b-) 6a/6a high lacks HPA-6b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-7 HPA-7(a+b-) 7a/7a high lacks HPA-7b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-8 HPA-8(a+b-) 8a/8a high lacks HPA-8b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-9 HPA-9(a+b-) 9a/9a high lacks HPA-9b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-10 HPA-10(a+b-) 10a/10a high lacks HPA-10b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-11 HPA-11(a+b-) 11a/11a high lacks HPA-11b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-12 HPA-12(a+b-) 12a/12a high lacks HPA-12b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-13 HPA-13(a+b-) 13a/13a high lacks HPA-13b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-14 HPA-14(a+b-) 14a/14a high lacks HPA-14b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-15 HPA-15(a-b+) 15b/15b high lacks HPA-15a: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-16 HPA-16(a+b-) 16a/16a high lacks HPA-16b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-17 HPA-17(a+b-) 17a/17a high lacks HPA-17b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-18 HPA-18(a+b-) 18a/18a high lacks HPA-18b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-19 HPA-19(a+b-) 19a/19a high lacks HPA-19b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-20 HPA-20(a+b-) 20a/20a high lacks HPA-20b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-21 HPA-21(a+b-) 21a/21a high lacks HPA-21b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-22 HPA-22(a+b-) 22a/22a high lacks HPA-22b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-23 HPA-23(a+b-) 23a/23a high lacks HPA-23b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-24 HPA-24(a+b-) 24a/24a high lacks HPA-24b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-25 HPA-25(a+b-) 25a/25a high lacks HPA-25b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-26 HPA-26(a+b-) 26a/26a high lacks HPA-26b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-27 HPA-27(a+b-) 27a/27a high lacks HPA-27b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-28 HPA-28(a+b-) 28a/28a high lacks HPA-28b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-29 HPA-29(a+b-) 29a/29a high lacks HPA-29b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-30 HPA-30(a+b-) 30a/30a high lacks HPA-30b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-31 HPA-31(a+b-) 31a/31a high lacks HPA-31b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-32 HPA-32(a+b-) 32a/32a high lacks HPA-32b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-33 HPA-33(a+b-) 33a/33a high lacks HPA-33b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-34 HPA-34(a+b-) 34a/34a high lacks HPA-34b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-35 HPA-35(a+b-) 35a/35a high lacks HPA-35b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HNA-1 not determined . not determined FCGR3B c.108G>C: no call (no VCF record and no depth row (the BAM has no such contig)); FCGR3B c.114C>T: no call (no VCF record and no depth row (the BAM has no such contig)); FCGR3B c.244G>A: no call (no VCF record and no depth row (the BAM has no such contig)); FCGR3B c.316G>A: no call (no VCF record and no depth row (the BAM has no such contig)) +HNA-3 HNA-3(a-b+) 3b/3b high lacks HNA-3a: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) +HNA-4 HNA-4(a+b-) 4a/4a high lacks HNA-4b: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) +HNA-5 HNA-5(a+b-) 5a/5a high lacks HNA-5b: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) diff --git a/tests/parity/golden/bloodtype/bgzip-no-index-abo/stdout b/tests/parity/golden/bloodtype/bgzip-no-index-abo/stdout new file mode 100644 index 000000000..38df98ddc --- /dev/null +++ b/tests/parity/golden/bloodtype/bgzip-no-index-abo/stdout @@ -0,0 +1,56 @@ +Blood groups of S, predicted from the genome (not a serological typing): + Kell K+k- Kp(a-b+) Js(a-b+) high + ABO A2B low + RhD D+ high + RhCE C-c+ E-e+ low + Duffy Fy(a+b-) high + Kidd Jk(a+b-) high + MNS M-N+ S-s+ low + Lutheran Lu(a-b+) high + Diego Di(a-b+) high + Dombrock Do(a-b+) high + Colton Co(a+b-) high + Vel Vel+ high + Langereis Lan+ high + Junior Jr(a+) high + H H+ high + Secretor secretor high + HPA-1 HPA-1(a+b-) high + HPA-2 HPA-2(a+b-) high + HPA-3 HPA-3(a+b-) high + HPA-4 HPA-4(a+b-) high + HPA-5 HPA-5(a+b-) high + HPA-6 HPA-6(a+b-) high + HPA-7 HPA-7(a+b-) high + HPA-8 HPA-8(a+b-) high + HPA-9 HPA-9(a+b-) high + HPA-10 HPA-10(a+b-) high + HPA-11 HPA-11(a+b-) high + HPA-12 HPA-12(a+b-) high + HPA-13 HPA-13(a+b-) high + HPA-14 HPA-14(a+b-) high + HPA-15 HPA-15(a+b-) high + HPA-16 HPA-16(a+b-) high + HPA-17 HPA-17(a+b-) high + HPA-18 HPA-18(a+b-) high + HPA-19 HPA-19(a+b-) high + HPA-20 HPA-20(a+b-) high + HPA-21 HPA-21(a+b-) high + HPA-22 HPA-22(a+b-) high + HPA-23 HPA-23(a+b-) high + HPA-24 HPA-24(a+b-) high + HPA-25 HPA-25(a+b-) high + HPA-26 HPA-26(a+b-) high + HPA-27 HPA-27(a+b-) high + HPA-28 HPA-28(a+b-) high + HPA-29 HPA-29(a+b-) high + HPA-30 HPA-30(a+b-) high + HPA-31 HPA-31(a+b-) high + HPA-32 HPA-32(a+b-) high + HPA-33 HPA-33(a+b-) high + HPA-34 HPA-34(a+b-) high + HPA-35 HPA-35(a+b-) high + HNA-1 HNA-1(a-b+c-) low + HNA-3 HNA-3(a-b+) high + HNA-4 HNA-4(a+b-) high + HNA-5 HNA-5(a+b-) high diff --git a/tests/parity/golden/bloodtype/bgzip-no-index-abo/t.tsv b/tests/parity/golden/bloodtype/bgzip-no-index-abo/t.tsv new file mode 100644 index 000000000..b557124a5 --- /dev/null +++ b/tests/parity/golden/bloodtype/bgzip-no-index-abo/t.tsv @@ -0,0 +1,56 @@ +system phenotype genotype confidence note +Kell K+k- Kp(a-b+) Js(a-b+) K/null Kpb/null Jsb/null high null allele: KEL c.246T>A x1; each null copy is placed with k, Kpb, Jsb first, the alleles the ISBT table finds it with (phase is not read); a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen; lacks k, carried by most people (high prevalence) +ABO A2B A2/B low A1 or A2 rests on ABO c.1061delC, a deletion in a run of C: short-read calls are less reliable here; an A allele is read from a c.261 insertion with neither c.802G>A nor c.803G>C, so an O allele that keeps c.261 (a non-deletional O) or a weak A subgroup also reads A; ABO alleles outside these five variants (weak A and B subgroups, cis-AB, O alleles other than O.01 and O.02) are not assessed; A and B on different chromosomes assumed (no phase) +RhD D+ RHD/RHD*08N.01 (RHD copies by read depth 2.00) high weak and partial D (RHD missense alleles) are not assessed; an RHD gene that is there reads D+: RHD null alleles other than RHD*08N.01, RHD-CE-D hybrids that keep exons 3 to 7, and DEL alleles are not assessed +RhCE C-c+ E-e+ c/c e/e low RHCE exon 2 of a C allele is RHD-like: short reads can place it on RHD +Duffy Fy(a+b-) FY*A/FY*B GATA high c.-67T>C (GATA box) stops Duffy expression on red cells only; with no phase it is placed on the Fyb chromosome first, where it usually lies (FY*02N.01) +Kidd Jk(a+b-) Jka/Jka high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +MNS M-N+ S-s+ N/N s/s low GYPA, GYPB and GYPE are near copies: short reads can misplace these calls +Lutheran Lu(a-b+) Lub/Lub high +Diego Di(a-b+) Dib/Dib high +Dombrock Do(a-b+) Dob/Dob high +Colton Co(a+b-) Coa/Coa high +Vel Vel+ Vel/Vel high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Langereis Lan+ Lan/Lan high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Junior Jr(a+) Jra/Jra high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +H H+ H/H high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Secretor secretor Se/Se high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen; weak secretor alleles (such as FUT2 c.418A>T, also written c.385A>T) and a deletion of the whole FUT2 gene are not assessed +HPA-1 HPA-1(a+b-) 1a/1a high lacks HPA-1b: HPA-1a is the platelet antigen most often behind FNAIT and post-transfusion purpura in white populations: an HPA-1a-negative (HPA-1b/1b) mother can make anti-HPA-1a against an HPA-1a-positive baby; a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-2 HPA-2(a+b-) 2a/2a high lacks HPA-2b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-3 HPA-3(a+b-) 3a/3a high lacks HPA-3b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-4 HPA-4(a+b-) 4a/4a high lacks HPA-4b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-5 HPA-5(a+b-) 5a/5a high lacks HPA-5b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-6 HPA-6(a+b-) 6a/6a high lacks HPA-6b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-7 HPA-7(a+b-) 7a/7a high lacks HPA-7b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-8 HPA-8(a+b-) 8a/8a high lacks HPA-8b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-9 HPA-9(a+b-) 9a/9a high lacks HPA-9b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-10 HPA-10(a+b-) 10a/10a high lacks HPA-10b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-11 HPA-11(a+b-) 11a/11a high lacks HPA-11b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-12 HPA-12(a+b-) 12a/12a high lacks HPA-12b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-13 HPA-13(a+b-) 13a/13a high lacks HPA-13b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-14 HPA-14(a+b-) 14a/14a high lacks HPA-14b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-15 HPA-15(a+b-) 15a/15a high lacks HPA-15b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-16 HPA-16(a+b-) 16a/16a high lacks HPA-16b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-17 HPA-17(a+b-) 17a/17a high lacks HPA-17b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-18 HPA-18(a+b-) 18a/18a high lacks HPA-18b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-19 HPA-19(a+b-) 19a/19a high lacks HPA-19b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-20 HPA-20(a+b-) 20a/20a high lacks HPA-20b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-21 HPA-21(a+b-) 21a/21a high lacks HPA-21b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-22 HPA-22(a+b-) 22a/22a high lacks HPA-22b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-23 HPA-23(a+b-) 23a/23a high lacks HPA-23b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-24 HPA-24(a+b-) 24a/24a high lacks HPA-24b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-25 HPA-25(a+b-) 25a/25a high lacks HPA-25b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-26 HPA-26(a+b-) 26a/26a high lacks HPA-26b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-27 HPA-27(a+b-) 27a/27a high lacks HPA-27b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-28 HPA-28(a+b-) 28a/28a high lacks HPA-28b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-29 HPA-29(a+b-) 29a/29a high lacks HPA-29b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-30 HPA-30(a+b-) 30a/30a high lacks HPA-30b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-31 HPA-31(a+b-) 31a/31a high lacks HPA-31b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-32 HPA-32(a+b-) 32a/32a high lacks HPA-32b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-33 HPA-33(a+b-) 33a/33a high lacks HPA-33b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-34 HPA-34(a+b-) 34a/34a high lacks HPA-34b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-35 HPA-35(a+b-) 35a/35a high lacks HPA-35b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HNA-1 HNA-1(a-b+c-) FCGR3B*02/FCGR3B*02 low FCGR3B c.194A>G (x0) does not match the other FCGR3B markers; lacks HNA-1a, HNA-1c: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI); FCGR3B and FCGR3A are near copies and the FCGR3B copy number varies (none to four or more): short reads can misplace these calls, the copies are not counted, and HNA-1null (no FCGR3B) is not assessed +HNA-3 HNA-3(a-b+) 3b/3b high lacks HNA-3a: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) +HNA-4 HNA-4(a+b-) 4a/4a high lacks HNA-4b: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) +HNA-5 HNA-5(a+b-) 5a/5a high lacks HNA-5b: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) diff --git a/tests/parity/golden/bloodtype/bombay-null-null/t.tsv b/tests/parity/golden/bloodtype/bombay-null-null/t.tsv new file mode 100644 index 000000000..1bafc7a1e --- /dev/null +++ b/tests/parity/golden/bloodtype/bombay-null-null/t.tsv @@ -0,0 +1,56 @@ +system phenotype genotype confidence note +Kell K-k- Kp(a-b-) Js(a-b-) null/null high two null copies: no Kell antigen on the red cells (Ku-); null allele: KEL c.246T>A x2; each null copy is placed with k, Kpb, Jsb first, the alleles the ISBT table finds it with (phase is not read); lacks k, Kpb, Jsb, Ku, carried by most people (high prevalence) +Kidd Jk(a-b-) null/null high two null copies: no Kidd antigen on the red cells (Jk3-); null allele: SLC14A1 c.342-1G>A, c.342-1G>C x2; each null copy is placed with Jkb, Jka first, the alleles the ISBT table finds it with (phase is not read); lacks Jk3, carried by most people (high prevalence) +H H- (Bombay, Oh) h/h high null allele: FUT1 c.695G>A x2; lacks H, carried by most people (high prevalence) +ABO O O.01/O.02 high ABO alleles outside these five variants (weak A and B subgroups, cis-AB, O alleles other than O.01 and O.02) are not assessed; no FUT1 (H-): the red cells carry no H (or very little, para-Bombay), so these ABO alleles make little or no A or B on them and the cells usually group as O +RhD D+ RHD/RHD (RHD copies by read depth 2.00) high weak and partial D (RHD missense alleles) are not assessed; an RHD gene that is there reads D+: RHD null alleles other than RHD*08N.01, RHD-CE-D hybrids that keep exons 3 to 7, and DEL alleles are not assessed +RhCE C-c+ E-e+ c/c e/e low RHCE exon 2 of a C allele is RHD-like: short reads can place it on RHD +Duffy Fy(a+b-) FY*A/FY*A high +MNS M-N+ S-s+ N/N s/s low GYPA, GYPB and GYPE are near copies: short reads can misplace these calls +Lutheran Lu(a-b+) Lub/Lub high +Diego Di(a-b+) Dib/Dib high +Dombrock Do(a-b+) Dob/Dob high +Colton Co(a+b-) Coa/Coa high +Vel Vel+ Vel/Vel high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Langereis Lan+ Lan/Lan high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Junior Jr(a+) Jra/Jra high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Secretor non-secretor se/se high null allele: FUT2 c.461G>A x2; weak secretor alleles (such as FUT2 c.418A>T, also written c.385A>T) and a deletion of the whole FUT2 gene are not assessed +HPA-1 HPA-1(a+b-) 1a/1a high lacks HPA-1b: HPA-1a is the platelet antigen most often behind FNAIT and post-transfusion purpura in white populations: an HPA-1a-negative (HPA-1b/1b) mother can make anti-HPA-1a against an HPA-1a-positive baby; a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-2 HPA-2(a+b-) 2a/2a high lacks HPA-2b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-3 HPA-3(a+b-) 3a/3a high lacks HPA-3b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-4 HPA-4(a+b-) 4a/4a high lacks HPA-4b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-5 HPA-5(a+b-) 5a/5a high lacks HPA-5b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-6 HPA-6(a+b-) 6a/6a high lacks HPA-6b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-7 HPA-7(a+b-) 7a/7a high lacks HPA-7b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-8 HPA-8(a+b-) 8a/8a high lacks HPA-8b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-9 HPA-9(a+b-) 9a/9a high lacks HPA-9b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-10 HPA-10(a+b-) 10a/10a high lacks HPA-10b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-11 HPA-11(a+b-) 11a/11a high lacks HPA-11b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-12 HPA-12(a+b-) 12a/12a high lacks HPA-12b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-13 HPA-13(a+b-) 13a/13a high lacks HPA-13b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-14 HPA-14(a+b-) 14a/14a high lacks HPA-14b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-15 HPA-15(a-b+) 15b/15b high lacks HPA-15a: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-16 HPA-16(a+b-) 16a/16a high lacks HPA-16b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-17 HPA-17(a+b-) 17a/17a high lacks HPA-17b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-18 HPA-18(a+b-) 18a/18a high lacks HPA-18b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-19 HPA-19(a+b-) 19a/19a high lacks HPA-19b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-20 HPA-20(a+b-) 20a/20a high lacks HPA-20b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-21 HPA-21(a+b-) 21a/21a high lacks HPA-21b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-22 HPA-22(a+b-) 22a/22a high lacks HPA-22b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-23 HPA-23(a+b-) 23a/23a high lacks HPA-23b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-24 HPA-24(a+b-) 24a/24a high lacks HPA-24b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-25 HPA-25(a+b-) 25a/25a high lacks HPA-25b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-26 HPA-26(a+b-) 26a/26a high lacks HPA-26b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-27 HPA-27(a+b-) 27a/27a high lacks HPA-27b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-28 HPA-28(a+b-) 28a/28a high lacks HPA-28b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-29 HPA-29(a+b-) 29a/29a high lacks HPA-29b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-30 HPA-30(a+b-) 30a/30a high lacks HPA-30b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-31 HPA-31(a+b-) 31a/31a high lacks HPA-31b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-32 HPA-32(a+b-) 32a/32a high lacks HPA-32b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-33 HPA-33(a+b-) 33a/33a high lacks HPA-33b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-34 HPA-34(a+b-) 34a/34a high lacks HPA-34b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-35 HPA-35(a+b-) 35a/35a high lacks HPA-35b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HNA-1 HNA-1(a-b+c-) FCGR3B*02/FCGR3B*02 low FCGR3B c.194A>G (x0) does not match the other FCGR3B markers; lacks HNA-1a, HNA-1c: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI); FCGR3B and FCGR3A are near copies and the FCGR3B copy number varies (none to four or more): short reads can misplace these calls, the copies are not counted, and HNA-1null (no FCGR3B) is not assessed +HNA-3 HNA-3(a-b+) 3b/3b high lacks HNA-3a: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) +HNA-4 HNA-4(a+b-) 4a/4a high lacks HNA-4b: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) +HNA-5 HNA-5(a+b-) 5a/5a high lacks HNA-5b: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) diff --git a/tests/parity/golden/bloodtype/gvcf-hna-disagree/t.tsv b/tests/parity/golden/bloodtype/gvcf-hna-disagree/t.tsv new file mode 100644 index 000000000..9f8dd2b4c --- /dev/null +++ b/tests/parity/golden/bloodtype/gvcf-hna-disagree/t.tsv @@ -0,0 +1,56 @@ +system phenotype genotype confidence note +Kidd Jk(a-b-) null/null high two null copies: no Kidd antigen on the red cells (Jk3-); null allele: SLC14A1 c.342-1G>A, c.342-1G>C x2; each null copy is placed with Jkb, Jka first, the alleles the ISBT table finds it with (phase is not read); lacks Jk3, carried by most people (high prevalence) +HPA-21 HPA-21(a-b+) 21b/21b high lacks HPA-21a: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions); lacks HPA-21a, carried by most people (high prevalence) +ABO O O.01/O.01 high ABO alleles outside these five variants (weak A and B subgroups, cis-AB, O alleles other than O.01 and O.02) are not assessed +RhD D+ RHD/RHD (RHD copies by read depth 2.00) high weak and partial D (RHD missense alleles) are not assessed; an RHD gene that is there reads D+: RHD null alleles other than RHD*08N.01, RHD-CE-D hybrids that keep exons 3 to 7, and DEL alleles are not assessed +RhCE C-c+ E-e+ c/c e/e low RHCE exon 2 of a C allele is RHD-like: short reads can place it on RHD +Kell K-k+ Kp(a-b+) Js(a-b+) k/k Kpb/Kpb Jsb/Jsb high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen; KEL c.1546C>T: another allele at this position (G>T, genotype 0/1) +Duffy Fy(a+b-) FY*A/FY*A high +MNS M-N+ S-s+ N/N s/s low GYPA, GYPB and GYPE are near copies: short reads can misplace these calls +Lutheran Lu(a-b+) Lub/Lub high +Diego Di(a-b+) Dib/Dib high +Dombrock Do(a-b+) Dob/Dob high +Colton Co(a+b-) Coa/Coa high +Vel Vel+ Vel/Vel high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Langereis Lan+ Lan/Lan high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Junior Jr(a+) Jra/Jra high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +H H+ H/H high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Secretor secretor Se/Se high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen; weak secretor alleles (such as FUT2 c.418A>T, also written c.385A>T) and a deletion of the whole FUT2 gene are not assessed +HPA-1 HPA-1(a+b-) 1a/1a high lacks HPA-1b: HPA-1a is the platelet antigen most often behind FNAIT and post-transfusion purpura in white populations: an HPA-1a-negative (HPA-1b/1b) mother can make anti-HPA-1a against an HPA-1a-positive baby; a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-2 HPA-2(a+b-) 2a/2a high lacks HPA-2b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-3 HPA-3(a+b-) 3a/3a high lacks HPA-3b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-4 HPA-4(a+b-) 4a/4a high lacks HPA-4b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-5 HPA-5(a+b-) 5a/5a high lacks HPA-5b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-6 HPA-6(a+b-) 6a/6a high lacks HPA-6b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-7 HPA-7(a+b-) 7a/7a high lacks HPA-7b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-8 HPA-8(a+b-) 8a/8a high lacks HPA-8b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-9 HPA-9(a+b-) 9a/9a high lacks HPA-9b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-10 HPA-10(a+b-) 10a/10a high lacks HPA-10b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-11 HPA-11(a+b-) 11a/11a high lacks HPA-11b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-12 HPA-12(a+b-) 12a/12a high lacks HPA-12b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-13 HPA-13(a+b-) 13a/13a high lacks HPA-13b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-14 HPA-14(a+b-) 14a/14a high lacks HPA-14b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-15 HPA-15(a-b+) 15b/15b high lacks HPA-15a: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-16 HPA-16(a+b-) 16a/16a high lacks HPA-16b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-17 HPA-17(a+b-) 17a/17a high lacks HPA-17b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-18 HPA-18(a+b-) 18a/18a high lacks HPA-18b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-19 HPA-19(a+b-) 19a/19a high lacks HPA-19b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-20 HPA-20(a+b-) 20a/20a high lacks HPA-20b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-22 HPA-22(a+b-) 22a/22a high lacks HPA-22b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-23 HPA-23(a+b-) 23a/23a high lacks HPA-23b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-24 HPA-24(a+b-) 24a/24a high lacks HPA-24b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-25 HPA-25(a+b-) 25a/25a high lacks HPA-25b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-26 HPA-26(a+b-) 26a/26a high lacks HPA-26b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-27 HPA-27(a+b-) 27a/27a high lacks HPA-27b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-28 HPA-28(a+b-) 28a/28a high lacks HPA-28b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-29 HPA-29(a+b-) 29a/29a high lacks HPA-29b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-30 HPA-30(a+b-) 30a/30a high lacks HPA-30b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-31 HPA-31(a+b-) 31a/31a high lacks HPA-31b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-32 HPA-32(a+b-) 32a/32a high lacks HPA-32b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-33 HPA-33(a+b-) 33a/33a high lacks HPA-33b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-34 HPA-34(a+b-) 34a/34a high lacks HPA-34b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-35 HPA-35(a+b-) 35a/35a high lacks HPA-35b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HNA-1 not determined . not determined the FCGR3B markers do not agree on HNA-1a or HNA-1b (FCGR3B c.108G>C x1, FCGR3B c.114C>T x1, FCGR3B c.244G>A x1, FCGR3B c.316G>A x2): an FCGR3A read placed on FCGR3B, an extra FCGR3B copy, or a rare allele; FCGR3B and FCGR3A are near copies and the FCGR3B copy number varies (none to four or more): short reads can misplace these calls, the copies are not counted, and HNA-1null (no FCGR3B) is not assessed +HNA-3 HNA-3(a-b+) 3b/3b high lacks HNA-3a: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) +HNA-4 HNA-4(a+b-) 4a/4a high lacks HNA-4b: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) +HNA-5 HNA-5(a+b-) 5a/5a high lacks HNA-5b: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) diff --git a/tests/parity/golden/bloodtype/hna1c/t.tsv b/tests/parity/golden/bloodtype/hna1c/t.tsv new file mode 100644 index 000000000..5b5ec63ef --- /dev/null +++ b/tests/parity/golden/bloodtype/hna1c/t.tsv @@ -0,0 +1,56 @@ +system phenotype genotype confidence note +ABO O O.01/O.01 high ABO alleles outside these five variants (weak A and B subgroups, cis-AB, O alleles other than O.01 and O.02) are not assessed +RhD D+ RHD/RHD (RHD copies by read depth 2.00) high weak and partial D (RHD missense alleles) are not assessed; an RHD gene that is there reads D+: RHD null alleles other than RHD*08N.01, RHD-CE-D hybrids that keep exons 3 to 7, and DEL alleles are not assessed +RhCE C-c+ E-e+ c/c e/e low RHCE exon 2 of a C allele is RHD-like: short reads can place it on RHD +Kell K-k+ Kp(a-b+) Js(a-b+) k/k Kpb/Kpb Jsb/Jsb high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Duffy Fy(a+b-) FY*A/FY*A high +Kidd Jk(a+b-) Jka/Jka high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +MNS M-N+ S-s+ N/N s/s low GYPA, GYPB and GYPE are near copies: short reads can misplace these calls +Lutheran Lu(a-b+) Lub/Lub high +Diego Di(a-b+) Dib/Dib high +Dombrock Do(a-b+) Dob/Dob high +Colton Co(a+b-) Coa/Coa high +Vel Vel+ Vel/Vel high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Langereis Lan+ Lan/Lan high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Junior Jr(a+) Jra/Jra high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +H H+ H/H high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Secretor secretor Se/Se high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen; weak secretor alleles (such as FUT2 c.418A>T, also written c.385A>T) and a deletion of the whole FUT2 gene are not assessed +HPA-1 HPA-1(a+b-) 1a/1a high lacks HPA-1b: HPA-1a is the platelet antigen most often behind FNAIT and post-transfusion purpura in white populations: an HPA-1a-negative (HPA-1b/1b) mother can make anti-HPA-1a against an HPA-1a-positive baby; a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-2 HPA-2(a+b-) 2a/2a high lacks HPA-2b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-3 HPA-3(a+b-) 3a/3a high lacks HPA-3b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-4 HPA-4(a+b-) 4a/4a high lacks HPA-4b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-5 HPA-5(a+b-) 5a/5a high lacks HPA-5b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-6 HPA-6(a+b-) 6a/6a high lacks HPA-6b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-7 HPA-7(a+b-) 7a/7a high lacks HPA-7b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-8 HPA-8(a+b-) 8a/8a high lacks HPA-8b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-9 HPA-9(a+b-) 9a/9a high lacks HPA-9b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-10 HPA-10(a+b-) 10a/10a high lacks HPA-10b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-11 HPA-11(a+b-) 11a/11a high lacks HPA-11b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-12 HPA-12(a+b-) 12a/12a high lacks HPA-12b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-13 HPA-13(a+b-) 13a/13a high lacks HPA-13b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-14 HPA-14(a+b-) 14a/14a high lacks HPA-14b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-15 HPA-15(a-b+) 15b/15b high lacks HPA-15a: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-16 HPA-16(a+b-) 16a/16a high lacks HPA-16b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-17 HPA-17(a+b-) 17a/17a high lacks HPA-17b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-18 HPA-18(a+b-) 18a/18a high lacks HPA-18b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-19 HPA-19(a+b-) 19a/19a high lacks HPA-19b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-20 HPA-20(a+b-) 20a/20a high lacks HPA-20b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-21 HPA-21(a+b-) 21a/21a high lacks HPA-21b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-22 HPA-22(a+b-) 22a/22a high lacks HPA-22b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-23 HPA-23(a+b-) 23a/23a high lacks HPA-23b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-24 HPA-24(a+b-) 24a/24a high lacks HPA-24b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-25 HPA-25(a+b-) 25a/25a high lacks HPA-25b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-26 HPA-26(a+b-) 26a/26a high lacks HPA-26b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-27 HPA-27(a+b-) 27a/27a high lacks HPA-27b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-28 HPA-28(a+b-) 28a/28a high lacks HPA-28b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-29 HPA-29(a+b-) 29a/29a high lacks HPA-29b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-30 HPA-30(a+b-) 30a/30a high lacks HPA-30b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-31 HPA-31(a+b-) 31a/31a high lacks HPA-31b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-32 HPA-32(a+b-) 32a/32a high lacks HPA-32b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-33 HPA-33(a+b-) 33a/33a high lacks HPA-33b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-34 HPA-34(a+b-) 34a/34a high lacks HPA-34b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-35 HPA-35(a+b-) 35a/35a high lacks HPA-35b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HNA-1 HNA-1(a+b+c+) FCGR3B*01/FCGR3B*03 low FCGR3B c.194A>G (x2) does not match the other FCGR3B markers; HNA-1c with no HNA-1b allele left for it: often an extra FCGR3B copy carrying FCGR3B*03; FCGR3B and FCGR3A are near copies and the FCGR3B copy number varies (none to four or more): short reads can misplace these calls, the copies are not counted, and HNA-1null (no FCGR3B) is not assessed +HNA-3 HNA-3(a-b+) 3b/3b high lacks HNA-3a: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) +HNA-4 HNA-4(a+b-) 4a/4a high lacks HNA-4b: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) +HNA-5 HNA-5(a+b-) 5a/5a high lacks HNA-5b: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) diff --git a/tests/parity/golden/bloodtype/indexed-abo/stdout b/tests/parity/golden/bloodtype/indexed-abo/stdout new file mode 100644 index 000000000..38df98ddc --- /dev/null +++ b/tests/parity/golden/bloodtype/indexed-abo/stdout @@ -0,0 +1,56 @@ +Blood groups of S, predicted from the genome (not a serological typing): + Kell K+k- Kp(a-b+) Js(a-b+) high + ABO A2B low + RhD D+ high + RhCE C-c+ E-e+ low + Duffy Fy(a+b-) high + Kidd Jk(a+b-) high + MNS M-N+ S-s+ low + Lutheran Lu(a-b+) high + Diego Di(a-b+) high + Dombrock Do(a-b+) high + Colton Co(a+b-) high + Vel Vel+ high + Langereis Lan+ high + Junior Jr(a+) high + H H+ high + Secretor secretor high + HPA-1 HPA-1(a+b-) high + HPA-2 HPA-2(a+b-) high + HPA-3 HPA-3(a+b-) high + HPA-4 HPA-4(a+b-) high + HPA-5 HPA-5(a+b-) high + HPA-6 HPA-6(a+b-) high + HPA-7 HPA-7(a+b-) high + HPA-8 HPA-8(a+b-) high + HPA-9 HPA-9(a+b-) high + HPA-10 HPA-10(a+b-) high + HPA-11 HPA-11(a+b-) high + HPA-12 HPA-12(a+b-) high + HPA-13 HPA-13(a+b-) high + HPA-14 HPA-14(a+b-) high + HPA-15 HPA-15(a+b-) high + HPA-16 HPA-16(a+b-) high + HPA-17 HPA-17(a+b-) high + HPA-18 HPA-18(a+b-) high + HPA-19 HPA-19(a+b-) high + HPA-20 HPA-20(a+b-) high + HPA-21 HPA-21(a+b-) high + HPA-22 HPA-22(a+b-) high + HPA-23 HPA-23(a+b-) high + HPA-24 HPA-24(a+b-) high + HPA-25 HPA-25(a+b-) high + HPA-26 HPA-26(a+b-) high + HPA-27 HPA-27(a+b-) high + HPA-28 HPA-28(a+b-) high + HPA-29 HPA-29(a+b-) high + HPA-30 HPA-30(a+b-) high + HPA-31 HPA-31(a+b-) high + HPA-32 HPA-32(a+b-) high + HPA-33 HPA-33(a+b-) high + HPA-34 HPA-34(a+b-) high + HPA-35 HPA-35(a+b-) high + HNA-1 HNA-1(a-b+c-) low + HNA-3 HNA-3(a-b+) high + HNA-4 HNA-4(a+b-) high + HNA-5 HNA-5(a+b-) high diff --git a/tests/parity/golden/bloodtype/indexed-abo/t.tsv b/tests/parity/golden/bloodtype/indexed-abo/t.tsv new file mode 100644 index 000000000..b557124a5 --- /dev/null +++ b/tests/parity/golden/bloodtype/indexed-abo/t.tsv @@ -0,0 +1,56 @@ +system phenotype genotype confidence note +Kell K+k- Kp(a-b+) Js(a-b+) K/null Kpb/null Jsb/null high null allele: KEL c.246T>A x1; each null copy is placed with k, Kpb, Jsb first, the alleles the ISBT table finds it with (phase is not read); a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen; lacks k, carried by most people (high prevalence) +ABO A2B A2/B low A1 or A2 rests on ABO c.1061delC, a deletion in a run of C: short-read calls are less reliable here; an A allele is read from a c.261 insertion with neither c.802G>A nor c.803G>C, so an O allele that keeps c.261 (a non-deletional O) or a weak A subgroup also reads A; ABO alleles outside these five variants (weak A and B subgroups, cis-AB, O alleles other than O.01 and O.02) are not assessed; A and B on different chromosomes assumed (no phase) +RhD D+ RHD/RHD*08N.01 (RHD copies by read depth 2.00) high weak and partial D (RHD missense alleles) are not assessed; an RHD gene that is there reads D+: RHD null alleles other than RHD*08N.01, RHD-CE-D hybrids that keep exons 3 to 7, and DEL alleles are not assessed +RhCE C-c+ E-e+ c/c e/e low RHCE exon 2 of a C allele is RHD-like: short reads can place it on RHD +Duffy Fy(a+b-) FY*A/FY*B GATA high c.-67T>C (GATA box) stops Duffy expression on red cells only; with no phase it is placed on the Fyb chromosome first, where it usually lies (FY*02N.01) +Kidd Jk(a+b-) Jka/Jka high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +MNS M-N+ S-s+ N/N s/s low GYPA, GYPB and GYPE are near copies: short reads can misplace these calls +Lutheran Lu(a-b+) Lub/Lub high +Diego Di(a-b+) Dib/Dib high +Dombrock Do(a-b+) Dob/Dob high +Colton Co(a+b-) Coa/Coa high +Vel Vel+ Vel/Vel high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Langereis Lan+ Lan/Lan high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Junior Jr(a+) Jra/Jra high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +H H+ H/H high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Secretor secretor Se/Se high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen; weak secretor alleles (such as FUT2 c.418A>T, also written c.385A>T) and a deletion of the whole FUT2 gene are not assessed +HPA-1 HPA-1(a+b-) 1a/1a high lacks HPA-1b: HPA-1a is the platelet antigen most often behind FNAIT and post-transfusion purpura in white populations: an HPA-1a-negative (HPA-1b/1b) mother can make anti-HPA-1a against an HPA-1a-positive baby; a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-2 HPA-2(a+b-) 2a/2a high lacks HPA-2b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-3 HPA-3(a+b-) 3a/3a high lacks HPA-3b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-4 HPA-4(a+b-) 4a/4a high lacks HPA-4b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-5 HPA-5(a+b-) 5a/5a high lacks HPA-5b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-6 HPA-6(a+b-) 6a/6a high lacks HPA-6b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-7 HPA-7(a+b-) 7a/7a high lacks HPA-7b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-8 HPA-8(a+b-) 8a/8a high lacks HPA-8b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-9 HPA-9(a+b-) 9a/9a high lacks HPA-9b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-10 HPA-10(a+b-) 10a/10a high lacks HPA-10b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-11 HPA-11(a+b-) 11a/11a high lacks HPA-11b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-12 HPA-12(a+b-) 12a/12a high lacks HPA-12b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-13 HPA-13(a+b-) 13a/13a high lacks HPA-13b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-14 HPA-14(a+b-) 14a/14a high lacks HPA-14b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-15 HPA-15(a+b-) 15a/15a high lacks HPA-15b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-16 HPA-16(a+b-) 16a/16a high lacks HPA-16b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-17 HPA-17(a+b-) 17a/17a high lacks HPA-17b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-18 HPA-18(a+b-) 18a/18a high lacks HPA-18b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-19 HPA-19(a+b-) 19a/19a high lacks HPA-19b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-20 HPA-20(a+b-) 20a/20a high lacks HPA-20b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-21 HPA-21(a+b-) 21a/21a high lacks HPA-21b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-22 HPA-22(a+b-) 22a/22a high lacks HPA-22b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-23 HPA-23(a+b-) 23a/23a high lacks HPA-23b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-24 HPA-24(a+b-) 24a/24a high lacks HPA-24b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-25 HPA-25(a+b-) 25a/25a high lacks HPA-25b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-26 HPA-26(a+b-) 26a/26a high lacks HPA-26b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-27 HPA-27(a+b-) 27a/27a high lacks HPA-27b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-28 HPA-28(a+b-) 28a/28a high lacks HPA-28b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-29 HPA-29(a+b-) 29a/29a high lacks HPA-29b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-30 HPA-30(a+b-) 30a/30a high lacks HPA-30b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-31 HPA-31(a+b-) 31a/31a high lacks HPA-31b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-32 HPA-32(a+b-) 32a/32a high lacks HPA-32b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-33 HPA-33(a+b-) 33a/33a high lacks HPA-33b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-34 HPA-34(a+b-) 34a/34a high lacks HPA-34b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-35 HPA-35(a+b-) 35a/35a high lacks HPA-35b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HNA-1 HNA-1(a-b+c-) FCGR3B*02/FCGR3B*02 low FCGR3B c.194A>G (x0) does not match the other FCGR3B markers; lacks HNA-1a, HNA-1c: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI); FCGR3B and FCGR3A are near copies and the FCGR3B copy number varies (none to four or more): short reads can misplace these calls, the copies are not counted, and HNA-1null (no FCGR3B) is not assessed +HNA-3 HNA-3(a-b+) 3b/3b high lacks HNA-3a: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) +HNA-4 HNA-4(a+b-) 4a/4a high lacks HNA-4b: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) +HNA-5 HNA-5(a+b-) 5a/5a high lacks HNA-5b: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) diff --git a/tests/parity/golden/bloodtype/indexed-blocks/t.tsv b/tests/parity/golden/bloodtype/indexed-blocks/t.tsv new file mode 100644 index 000000000..2a5dd0d22 --- /dev/null +++ b/tests/parity/golden/bloodtype/indexed-blocks/t.tsv @@ -0,0 +1,56 @@ +system phenotype genotype confidence note +ABO O O.01/O.01 high ABO alleles outside these five variants (weak A and B subgroups, cis-AB, O alleles other than O.01 and O.02) are not assessed +RhD D+ RHD/RHD (RHD copies by read depth 2.00) high weak and partial D (RHD missense alleles) are not assessed; an RHD gene that is there reads D+: RHD null alleles other than RHD*08N.01, RHD-CE-D hybrids that keep exons 3 to 7, and DEL alleles are not assessed +RhCE C-c+ E-e+ c/c e/e low RHCE exon 2 of a C allele is RHD-like: short reads can place it on RHD +Kell K-k+ Kp(a-b+) Js(a-b+) k/k Kpb/Kpb Jsb/Jsb high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Duffy Fy(a+b-) FY*A/FY*A high +Kidd Jk(a+b-) Jka/Jka high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +MNS M-N+ S+s+ N/N S/s low GYPA, GYPB and GYPE are near copies: short reads can misplace these calls +Lutheran Lu(a-b+) Lub/Lub high +Diego Di(a-b+) Dib/Dib high +Dombrock Do(a-b+) Dob/Dob high +Colton Co(a+b-) Coa/Coa high +Vel Vel+ Vel/Vel high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Langereis Lan+ Lan/Lan high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Junior Jr(a+) Jra/Jra high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +H H+ H/H high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Secretor secretor Se/Se high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen; weak secretor alleles (such as FUT2 c.418A>T, also written c.385A>T) and a deletion of the whole FUT2 gene are not assessed +HPA-1 HPA-1(a+b-) 1a/1a high lacks HPA-1b: HPA-1a is the platelet antigen most often behind FNAIT and post-transfusion purpura in white populations: an HPA-1a-negative (HPA-1b/1b) mother can make anti-HPA-1a against an HPA-1a-positive baby; a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-2 HPA-2(a+b-) 2a/2a high lacks HPA-2b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-3 HPA-3(a+b-) 3a/3a high lacks HPA-3b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-4 HPA-4(a+b-) 4a/4a high lacks HPA-4b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-5 HPA-5(a+b-) 5a/5a high lacks HPA-5b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-6 HPA-6(a+b-) 6a/6a high lacks HPA-6b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-7 HPA-7(a+b-) 7a/7a high lacks HPA-7b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-8 HPA-8(a+b-) 8a/8a high lacks HPA-8b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-9 HPA-9(a+b-) 9a/9a high lacks HPA-9b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-10 HPA-10(a+b-) 10a/10a high lacks HPA-10b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-11 HPA-11(a+b-) 11a/11a high lacks HPA-11b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-12 HPA-12(a+b-) 12a/12a high lacks HPA-12b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-13 HPA-13(a+b-) 13a/13a high lacks HPA-13b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-14 HPA-14(a+b-) 14a/14a high lacks HPA-14b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-15 HPA-15(a-b+) 15b/15b high lacks HPA-15a: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-16 HPA-16(a+b-) 16a/16a high lacks HPA-16b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-17 HPA-17(a+b-) 17a/17a high lacks HPA-17b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-18 HPA-18(a+b-) 18a/18a high lacks HPA-18b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-19 HPA-19(a+b-) 19a/19a high lacks HPA-19b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-20 HPA-20(a+b-) 20a/20a high lacks HPA-20b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-21 HPA-21(a+b-) 21a/21a high lacks HPA-21b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-22 HPA-22(a+b-) 22a/22a high lacks HPA-22b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-23 HPA-23(a+b-) 23a/23a high lacks HPA-23b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-24 HPA-24(a+b-) 24a/24a high lacks HPA-24b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-25 HPA-25(a+b-) 25a/25a high lacks HPA-25b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-26 HPA-26(a+b-) 26a/26a high lacks HPA-26b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-27 HPA-27(a+b-) 27a/27a high lacks HPA-27b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-28 HPA-28(a+b-) 28a/28a high lacks HPA-28b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-29 HPA-29(a+b-) 29a/29a high lacks HPA-29b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-30 HPA-30(a+b-) 30a/30a high lacks HPA-30b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-31 HPA-31(a+b-) 31a/31a high lacks HPA-31b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-32 HPA-32(a+b-) 32a/32a high lacks HPA-32b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-33 HPA-33(a+b-) 33a/33a high lacks HPA-33b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-34 HPA-34(a+b-) 34a/34a high lacks HPA-34b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-35 HPA-35(a+b-) 35a/35a high lacks HPA-35b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HNA-1 HNA-1(a-b+c-) FCGR3B*02/FCGR3B*02 low FCGR3B c.194A>G (x0) does not match the other FCGR3B markers; lacks HNA-1a, HNA-1c: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI); FCGR3B and FCGR3A are near copies and the FCGR3B copy number varies (none to four or more): short reads can misplace these calls, the copies are not counted, and HNA-1null (no FCGR3B) is not assessed +HNA-3 HNA-3(a-b+) 3b/3b high lacks HNA-3a: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) +HNA-4 HNA-4(a+b-) 4a/4a high lacks HNA-4b: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) +HNA-5 HNA-5(a+b-) 5a/5a high lacks HNA-5b: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) diff --git a/tests/parity/golden/bloodtype/indexed-bombay/t.tsv b/tests/parity/golden/bloodtype/indexed-bombay/t.tsv new file mode 100644 index 000000000..1bafc7a1e --- /dev/null +++ b/tests/parity/golden/bloodtype/indexed-bombay/t.tsv @@ -0,0 +1,56 @@ +system phenotype genotype confidence note +Kell K-k- Kp(a-b-) Js(a-b-) null/null high two null copies: no Kell antigen on the red cells (Ku-); null allele: KEL c.246T>A x2; each null copy is placed with k, Kpb, Jsb first, the alleles the ISBT table finds it with (phase is not read); lacks k, Kpb, Jsb, Ku, carried by most people (high prevalence) +Kidd Jk(a-b-) null/null high two null copies: no Kidd antigen on the red cells (Jk3-); null allele: SLC14A1 c.342-1G>A, c.342-1G>C x2; each null copy is placed with Jkb, Jka first, the alleles the ISBT table finds it with (phase is not read); lacks Jk3, carried by most people (high prevalence) +H H- (Bombay, Oh) h/h high null allele: FUT1 c.695G>A x2; lacks H, carried by most people (high prevalence) +ABO O O.01/O.02 high ABO alleles outside these five variants (weak A and B subgroups, cis-AB, O alleles other than O.01 and O.02) are not assessed; no FUT1 (H-): the red cells carry no H (or very little, para-Bombay), so these ABO alleles make little or no A or B on them and the cells usually group as O +RhD D+ RHD/RHD (RHD copies by read depth 2.00) high weak and partial D (RHD missense alleles) are not assessed; an RHD gene that is there reads D+: RHD null alleles other than RHD*08N.01, RHD-CE-D hybrids that keep exons 3 to 7, and DEL alleles are not assessed +RhCE C-c+ E-e+ c/c e/e low RHCE exon 2 of a C allele is RHD-like: short reads can place it on RHD +Duffy Fy(a+b-) FY*A/FY*A high +MNS M-N+ S-s+ N/N s/s low GYPA, GYPB and GYPE are near copies: short reads can misplace these calls +Lutheran Lu(a-b+) Lub/Lub high +Diego Di(a-b+) Dib/Dib high +Dombrock Do(a-b+) Dob/Dob high +Colton Co(a+b-) Coa/Coa high +Vel Vel+ Vel/Vel high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Langereis Lan+ Lan/Lan high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Junior Jr(a+) Jra/Jra high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Secretor non-secretor se/se high null allele: FUT2 c.461G>A x2; weak secretor alleles (such as FUT2 c.418A>T, also written c.385A>T) and a deletion of the whole FUT2 gene are not assessed +HPA-1 HPA-1(a+b-) 1a/1a high lacks HPA-1b: HPA-1a is the platelet antigen most often behind FNAIT and post-transfusion purpura in white populations: an HPA-1a-negative (HPA-1b/1b) mother can make anti-HPA-1a against an HPA-1a-positive baby; a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-2 HPA-2(a+b-) 2a/2a high lacks HPA-2b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-3 HPA-3(a+b-) 3a/3a high lacks HPA-3b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-4 HPA-4(a+b-) 4a/4a high lacks HPA-4b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-5 HPA-5(a+b-) 5a/5a high lacks HPA-5b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-6 HPA-6(a+b-) 6a/6a high lacks HPA-6b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-7 HPA-7(a+b-) 7a/7a high lacks HPA-7b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-8 HPA-8(a+b-) 8a/8a high lacks HPA-8b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-9 HPA-9(a+b-) 9a/9a high lacks HPA-9b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-10 HPA-10(a+b-) 10a/10a high lacks HPA-10b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-11 HPA-11(a+b-) 11a/11a high lacks HPA-11b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-12 HPA-12(a+b-) 12a/12a high lacks HPA-12b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-13 HPA-13(a+b-) 13a/13a high lacks HPA-13b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-14 HPA-14(a+b-) 14a/14a high lacks HPA-14b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-15 HPA-15(a-b+) 15b/15b high lacks HPA-15a: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-16 HPA-16(a+b-) 16a/16a high lacks HPA-16b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-17 HPA-17(a+b-) 17a/17a high lacks HPA-17b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-18 HPA-18(a+b-) 18a/18a high lacks HPA-18b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-19 HPA-19(a+b-) 19a/19a high lacks HPA-19b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-20 HPA-20(a+b-) 20a/20a high lacks HPA-20b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-21 HPA-21(a+b-) 21a/21a high lacks HPA-21b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-22 HPA-22(a+b-) 22a/22a high lacks HPA-22b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-23 HPA-23(a+b-) 23a/23a high lacks HPA-23b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-24 HPA-24(a+b-) 24a/24a high lacks HPA-24b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-25 HPA-25(a+b-) 25a/25a high lacks HPA-25b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-26 HPA-26(a+b-) 26a/26a high lacks HPA-26b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-27 HPA-27(a+b-) 27a/27a high lacks HPA-27b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-28 HPA-28(a+b-) 28a/28a high lacks HPA-28b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-29 HPA-29(a+b-) 29a/29a high lacks HPA-29b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-30 HPA-30(a+b-) 30a/30a high lacks HPA-30b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-31 HPA-31(a+b-) 31a/31a high lacks HPA-31b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-32 HPA-32(a+b-) 32a/32a high lacks HPA-32b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-33 HPA-33(a+b-) 33a/33a high lacks HPA-33b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-34 HPA-34(a+b-) 34a/34a high lacks HPA-34b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-35 HPA-35(a+b-) 35a/35a high lacks HPA-35b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HNA-1 HNA-1(a-b+c-) FCGR3B*02/FCGR3B*02 low FCGR3B c.194A>G (x0) does not match the other FCGR3B markers; lacks HNA-1a, HNA-1c: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI); FCGR3B and FCGR3A are near copies and the FCGR3B copy number varies (none to four or more): short reads can misplace these calls, the copies are not counted, and HNA-1null (no FCGR3B) is not assessed +HNA-3 HNA-3(a-b+) 3b/3b high lacks HNA-3a: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) +HNA-4 HNA-4(a+b-) 4a/4a high lacks HNA-4b: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) +HNA-5 HNA-5(a+b-) 5a/5a high lacks HNA-5b: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) diff --git a/tests/parity/golden/bloodtype/indexed-gvcf/t.tsv b/tests/parity/golden/bloodtype/indexed-gvcf/t.tsv new file mode 100644 index 000000000..9f8dd2b4c --- /dev/null +++ b/tests/parity/golden/bloodtype/indexed-gvcf/t.tsv @@ -0,0 +1,56 @@ +system phenotype genotype confidence note +Kidd Jk(a-b-) null/null high two null copies: no Kidd antigen on the red cells (Jk3-); null allele: SLC14A1 c.342-1G>A, c.342-1G>C x2; each null copy is placed with Jkb, Jka first, the alleles the ISBT table finds it with (phase is not read); lacks Jk3, carried by most people (high prevalence) +HPA-21 HPA-21(a-b+) 21b/21b high lacks HPA-21a: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions); lacks HPA-21a, carried by most people (high prevalence) +ABO O O.01/O.01 high ABO alleles outside these five variants (weak A and B subgroups, cis-AB, O alleles other than O.01 and O.02) are not assessed +RhD D+ RHD/RHD (RHD copies by read depth 2.00) high weak and partial D (RHD missense alleles) are not assessed; an RHD gene that is there reads D+: RHD null alleles other than RHD*08N.01, RHD-CE-D hybrids that keep exons 3 to 7, and DEL alleles are not assessed +RhCE C-c+ E-e+ c/c e/e low RHCE exon 2 of a C allele is RHD-like: short reads can place it on RHD +Kell K-k+ Kp(a-b+) Js(a-b+) k/k Kpb/Kpb Jsb/Jsb high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen; KEL c.1546C>T: another allele at this position (G>T, genotype 0/1) +Duffy Fy(a+b-) FY*A/FY*A high +MNS M-N+ S-s+ N/N s/s low GYPA, GYPB and GYPE are near copies: short reads can misplace these calls +Lutheran Lu(a-b+) Lub/Lub high +Diego Di(a-b+) Dib/Dib high +Dombrock Do(a-b+) Dob/Dob high +Colton Co(a+b-) Coa/Coa high +Vel Vel+ Vel/Vel high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Langereis Lan+ Lan/Lan high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Junior Jr(a+) Jra/Jra high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +H H+ H/H high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Secretor secretor Se/Se high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen; weak secretor alleles (such as FUT2 c.418A>T, also written c.385A>T) and a deletion of the whole FUT2 gene are not assessed +HPA-1 HPA-1(a+b-) 1a/1a high lacks HPA-1b: HPA-1a is the platelet antigen most often behind FNAIT and post-transfusion purpura in white populations: an HPA-1a-negative (HPA-1b/1b) mother can make anti-HPA-1a against an HPA-1a-positive baby; a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-2 HPA-2(a+b-) 2a/2a high lacks HPA-2b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-3 HPA-3(a+b-) 3a/3a high lacks HPA-3b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-4 HPA-4(a+b-) 4a/4a high lacks HPA-4b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-5 HPA-5(a+b-) 5a/5a high lacks HPA-5b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-6 HPA-6(a+b-) 6a/6a high lacks HPA-6b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-7 HPA-7(a+b-) 7a/7a high lacks HPA-7b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-8 HPA-8(a+b-) 8a/8a high lacks HPA-8b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-9 HPA-9(a+b-) 9a/9a high lacks HPA-9b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-10 HPA-10(a+b-) 10a/10a high lacks HPA-10b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-11 HPA-11(a+b-) 11a/11a high lacks HPA-11b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-12 HPA-12(a+b-) 12a/12a high lacks HPA-12b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-13 HPA-13(a+b-) 13a/13a high lacks HPA-13b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-14 HPA-14(a+b-) 14a/14a high lacks HPA-14b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-15 HPA-15(a-b+) 15b/15b high lacks HPA-15a: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-16 HPA-16(a+b-) 16a/16a high lacks HPA-16b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-17 HPA-17(a+b-) 17a/17a high lacks HPA-17b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-18 HPA-18(a+b-) 18a/18a high lacks HPA-18b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-19 HPA-19(a+b-) 19a/19a high lacks HPA-19b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-20 HPA-20(a+b-) 20a/20a high lacks HPA-20b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-22 HPA-22(a+b-) 22a/22a high lacks HPA-22b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-23 HPA-23(a+b-) 23a/23a high lacks HPA-23b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-24 HPA-24(a+b-) 24a/24a high lacks HPA-24b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-25 HPA-25(a+b-) 25a/25a high lacks HPA-25b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-26 HPA-26(a+b-) 26a/26a high lacks HPA-26b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-27 HPA-27(a+b-) 27a/27a high lacks HPA-27b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-28 HPA-28(a+b-) 28a/28a high lacks HPA-28b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-29 HPA-29(a+b-) 29a/29a high lacks HPA-29b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-30 HPA-30(a+b-) 30a/30a high lacks HPA-30b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-31 HPA-31(a+b-) 31a/31a high lacks HPA-31b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-32 HPA-32(a+b-) 32a/32a high lacks HPA-32b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-33 HPA-33(a+b-) 33a/33a high lacks HPA-33b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-34 HPA-34(a+b-) 34a/34a high lacks HPA-34b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-35 HPA-35(a+b-) 35a/35a high lacks HPA-35b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HNA-1 not determined . not determined the FCGR3B markers do not agree on HNA-1a or HNA-1b (FCGR3B c.108G>C x1, FCGR3B c.114C>T x1, FCGR3B c.244G>A x1, FCGR3B c.316G>A x2): an FCGR3A read placed on FCGR3B, an extra FCGR3B copy, or a rare allele; FCGR3B and FCGR3A are near copies and the FCGR3B copy number varies (none to four or more): short reads can misplace these calls, the copies are not counted, and HNA-1null (no FCGR3B) is not assessed +HNA-3 HNA-3(a-b+) 3b/3b high lacks HNA-3a: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) +HNA-4 HNA-4(a+b-) 4a/4a high lacks HNA-4b: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) +HNA-5 HNA-5(a+b-) 5a/5a high lacks HNA-5b: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) diff --git a/tests/parity/golden/bloodtype/indexed-nochr/stdout b/tests/parity/golden/bloodtype/indexed-nochr/stdout new file mode 100644 index 000000000..d07df796f --- /dev/null +++ b/tests/parity/golden/bloodtype/indexed-nochr/stdout @@ -0,0 +1,56 @@ +Blood groups of S, predicted from the genome (not a serological typing): + ABO A1 low + RhD D+ high + RhCE C-c+ E-e+ low + Kell K-k+ Kp(a-b+) Js(a-b+) high + Duffy Fy(a+b+) high + Kidd Jk(a-b+) high + MNS M-N+ S-s+ low + Lutheran Lu(a-b+) high + Diego Di(a-b+) high + Dombrock Do(a-b+) high + Colton Co(a+b-) high + Vel Vel+ high + Langereis Lan+ high + Junior Jr(a+) high + H H+ high + Secretor secretor high + HPA-1 HPA-1(a+b-) high + HPA-2 HPA-2(a+b-) high + HPA-3 HPA-3(a+b-) high + HPA-4 HPA-4(a+b-) high + HPA-5 HPA-5(a+b-) high + HPA-6 HPA-6(a+b-) high + HPA-7 HPA-7(a+b-) high + HPA-8 HPA-8(a+b-) high + HPA-9 HPA-9(a+b-) high + HPA-10 HPA-10(a+b-) high + HPA-11 HPA-11(a+b-) high + HPA-12 HPA-12(a+b-) high + HPA-13 HPA-13(a+b-) high + HPA-14 HPA-14(a+b-) high + HPA-15 HPA-15(a-b+) high + HPA-16 HPA-16(a+b-) high + HPA-17 HPA-17(a+b-) high + HPA-18 HPA-18(a+b-) high + HPA-19 HPA-19(a+b-) high + HPA-20 HPA-20(a+b-) high + HPA-21 HPA-21(a+b-) high + HPA-22 HPA-22(a+b-) high + HPA-23 HPA-23(a+b-) high + HPA-24 HPA-24(a+b-) high + HPA-25 HPA-25(a+b-) high + HPA-26 HPA-26(a+b-) high + HPA-27 HPA-27(a+b-) high + HPA-28 HPA-28(a+b-) high + HPA-29 HPA-29(a+b-) high + HPA-30 HPA-30(a+b-) high + HPA-31 HPA-31(a+b-) high + HPA-32 HPA-32(a+b-) high + HPA-33 HPA-33(a+b-) high + HPA-34 HPA-34(a+b-) high + HPA-35 HPA-35(a+b-) high + HNA-1 HNA-1(a-b+c-) low + HNA-3 HNA-3(a-b+) high + HNA-4 HNA-4(a+b-) high + HNA-5 HNA-5(a+b-) high diff --git a/tests/parity/golden/bloodtype/indexed-nochr/t.tsv b/tests/parity/golden/bloodtype/indexed-nochr/t.tsv new file mode 100644 index 000000000..5fca1b719 --- /dev/null +++ b/tests/parity/golden/bloodtype/indexed-nochr/t.tsv @@ -0,0 +1,56 @@ +system phenotype genotype confidence note +ABO A1 A1/O.01 low A1 or A2 rests on ABO c.1061delC, a deletion in a run of C: short-read calls are less reliable here; an A allele is read from a c.261 insertion with neither c.802G>A nor c.803G>C, so an O allele that keeps c.261 (a non-deletional O) or a weak A subgroup also reads A; ABO alleles outside these five variants (weak A and B subgroups, cis-AB, O alleles other than O.01 and O.02) are not assessed +RhD D+ RHD/RHD (RHD copies by read depth 2.00) high weak and partial D (RHD missense alleles) are not assessed; an RHD gene that is there reads D+: RHD null alleles other than RHD*08N.01, RHD-CE-D hybrids that keep exons 3 to 7, and DEL alleles are not assessed +RhCE C-c+ E-e+ c/c e/e low RHCE exon 2 of a C allele is RHD-like: short reads can place it on RHD +Kell K-k+ Kp(a-b+) Js(a-b+) k/k Kpb/Kpb Jsb/Jsb high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Duffy Fy(a+b+) FY*A/FY*B high +Kidd Jk(a-b+) Jkb/Jkb high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +MNS M-N+ S-s+ N/N s/s low GYPA, GYPB and GYPE are near copies: short reads can misplace these calls +Lutheran Lu(a-b+) Lub/Lub high +Diego Di(a-b+) Dib/Dib high +Dombrock Do(a-b+) Dob/Dob high +Colton Co(a+b-) Coa/Coa high +Vel Vel+ Vel/Vel high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Langereis Lan+ Lan/Lan high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Junior Jr(a+) Jra/Jra high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +H H+ H/H high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Secretor secretor Se/Se high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen; weak secretor alleles (such as FUT2 c.418A>T, also written c.385A>T) and a deletion of the whole FUT2 gene are not assessed +HPA-1 HPA-1(a+b-) 1a/1a high lacks HPA-1b: HPA-1a is the platelet antigen most often behind FNAIT and post-transfusion purpura in white populations: an HPA-1a-negative (HPA-1b/1b) mother can make anti-HPA-1a against an HPA-1a-positive baby; a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-2 HPA-2(a+b-) 2a/2a high lacks HPA-2b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-3 HPA-3(a+b-) 3a/3a high lacks HPA-3b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-4 HPA-4(a+b-) 4a/4a high lacks HPA-4b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-5 HPA-5(a+b-) 5a/5a high lacks HPA-5b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-6 HPA-6(a+b-) 6a/6a high lacks HPA-6b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-7 HPA-7(a+b-) 7a/7a high lacks HPA-7b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-8 HPA-8(a+b-) 8a/8a high lacks HPA-8b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-9 HPA-9(a+b-) 9a/9a high lacks HPA-9b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-10 HPA-10(a+b-) 10a/10a high lacks HPA-10b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-11 HPA-11(a+b-) 11a/11a high lacks HPA-11b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-12 HPA-12(a+b-) 12a/12a high lacks HPA-12b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-13 HPA-13(a+b-) 13a/13a high lacks HPA-13b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-14 HPA-14(a+b-) 14a/14a high lacks HPA-14b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-15 HPA-15(a-b+) 15b/15b high lacks HPA-15a: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-16 HPA-16(a+b-) 16a/16a high lacks HPA-16b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-17 HPA-17(a+b-) 17a/17a high lacks HPA-17b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-18 HPA-18(a+b-) 18a/18a high lacks HPA-18b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-19 HPA-19(a+b-) 19a/19a high lacks HPA-19b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-20 HPA-20(a+b-) 20a/20a high lacks HPA-20b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-21 HPA-21(a+b-) 21a/21a high lacks HPA-21b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-22 HPA-22(a+b-) 22a/22a high lacks HPA-22b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-23 HPA-23(a+b-) 23a/23a high lacks HPA-23b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-24 HPA-24(a+b-) 24a/24a high lacks HPA-24b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-25 HPA-25(a+b-) 25a/25a high lacks HPA-25b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-26 HPA-26(a+b-) 26a/26a high lacks HPA-26b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-27 HPA-27(a+b-) 27a/27a high lacks HPA-27b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-28 HPA-28(a+b-) 28a/28a high lacks HPA-28b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-29 HPA-29(a+b-) 29a/29a high lacks HPA-29b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-30 HPA-30(a+b-) 30a/30a high lacks HPA-30b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-31 HPA-31(a+b-) 31a/31a high lacks HPA-31b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-32 HPA-32(a+b-) 32a/32a high lacks HPA-32b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-33 HPA-33(a+b-) 33a/33a high lacks HPA-33b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-34 HPA-34(a+b-) 34a/34a high lacks HPA-34b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-35 HPA-35(a+b-) 35a/35a high lacks HPA-35b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HNA-1 HNA-1(a-b+c-) FCGR3B*02/FCGR3B*02 low FCGR3B c.194A>G (x0) does not match the other FCGR3B markers; lacks HNA-1a, HNA-1c: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI); FCGR3B and FCGR3A are near copies and the FCGR3B copy number varies (none to four or more): short reads can misplace these calls, the copies are not counted, and HNA-1null (no FCGR3B) is not assessed +HNA-3 HNA-3(a-b+) 3b/3b high lacks HNA-3a: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) +HNA-4 HNA-4(a+b-) 4a/4a high lacks HNA-4b: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) +HNA-5 HNA-5(a+b-) 5a/5a high lacks HNA-5b: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) diff --git a/tests/parity/golden/bloodtype/indexed-vcf-quirks/t.tsv b/tests/parity/golden/bloodtype/indexed-vcf-quirks/t.tsv new file mode 100644 index 000000000..d9d9298fb --- /dev/null +++ b/tests/parity/golden/bloodtype/indexed-vcf-quirks/t.tsv @@ -0,0 +1,56 @@ +system phenotype genotype confidence note +Kell K-k- Kp(a-b-) Js(a-b-) null/null low two null copies: no Kell antigen on the red cells (Ku-); null allele: KEL c.223+1G>C, c.223+1G>A, c.223+1G>T x2; each null copy is placed with k, Kpb, Jsb first, the alleles the ISBT table finds it with (phase is not read); KEL c.578C>T: another allele at this position (G>C,A, genotype 1/2); lacks k, Kpb, Jsb, Ku, carried by most people (high prevalence) +ABO O O.01/O.01 high ABO alleles outside these five variants (weak A and B subgroups, cis-AB, O alleles other than O.01 and O.02) are not assessed +RhD D+ RHD/RHD (RHD copies by read depth 2.00) high weak and partial D (RHD missense alleles) are not assessed; an RHD gene that is there reads D+: RHD null alleles other than RHD*08N.01, RHD-CE-D hybrids that keep exons 3 to 7, and DEL alleles are not assessed +RhCE C-c+ E-e+ c/c e/e low RHCE exon 2 of a C allele is RHD-like: short reads can place it on RHD +Duffy Fy(a+b-) FY*A/FY*A high +Kidd not determined . not determined SLC14A1 c.838G>A: no call (FILTER LowQual) +MNS M-N+ S-s+ N/N s/s low GYPA, GYPB and GYPE are near copies: short reads can misplace these calls +Lutheran not determined . not determined BCAM c.230G>A: no call (genotype ./.) +Diego not determined . not determined SLC4A1 c.2561C>T: no call (genotype 1) +Dombrock Do(a+b+) Doa/Dob high +Colton not determined . not determined AQP1 c.134C>T: no call (genotype .) +Vel Vel+ Vel/Vel high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Langereis Lan+ Lan/Lan high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Junior Jr(a+) Jra/Jra high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +H H+ H/H high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Secretor secretor Se/Se high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen; weak secretor alleles (such as FUT2 c.418A>T, also written c.385A>T) and a deletion of the whole FUT2 gene are not assessed +HPA-1 not determined . not determined ITGB3 c.176T>C: no call (genotype .) +HPA-2 HPA-2(a+b-) 2a/2a high lacks HPA-2b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-3 HPA-3(a+b-) 3a/3a high lacks HPA-3b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-4 HPA-4(a+b-) 4a/4a high lacks HPA-4b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-5 HPA-5(a+b-) 5a/5a high lacks HPA-5b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-6 HPA-6(a+b-) 6a/6a high lacks HPA-6b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-7 HPA-7(a+b-) 7a/7a high lacks HPA-7b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-8 HPA-8(a+b-) 8a/8a high lacks HPA-8b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-9 HPA-9(a+b-) 9a/9a high lacks HPA-9b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-10 HPA-10(a+b-) 10a/10a high lacks HPA-10b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-11 HPA-11(a+b-) 11a/11a high lacks HPA-11b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-12 HPA-12(a+b-) 12a/12a high lacks HPA-12b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-13 HPA-13(a+b-) 13a/13a high lacks HPA-13b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-14 HPA-14(a+b-) 14a/14a high lacks HPA-14b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-15 HPA-15(a-b+) 15b/15b high lacks HPA-15a: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-16 HPA-16(a+b-) 16a/16a high lacks HPA-16b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-17 HPA-17(a+b-) 17a/17a high lacks HPA-17b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-18 HPA-18(a+b-) 18a/18a high lacks HPA-18b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-19 HPA-19(a+b-) 19a/19a high lacks HPA-19b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-20 HPA-20(a+b-) 20a/20a high lacks HPA-20b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-21 HPA-21(a+b-) 21a/21a high lacks HPA-21b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-22 HPA-22(a+b-) 22a/22a high lacks HPA-22b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-23 HPA-23(a+b-) 23a/23a high lacks HPA-23b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-24 HPA-24(a+b-) 24a/24a high lacks HPA-24b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-25 HPA-25(a+b-) 25a/25a high lacks HPA-25b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-26 HPA-26(a+b-) 26a/26a high lacks HPA-26b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-27 HPA-27(a+b-) 27a/27a high lacks HPA-27b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-28 HPA-28(a+b-) 28a/28a high lacks HPA-28b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-29 HPA-29(a+b-) 29a/29a high lacks HPA-29b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-30 HPA-30(a+b-) 30a/30a high lacks HPA-30b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-31 HPA-31(a+b-) 31a/31a high lacks HPA-31b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-32 HPA-32(a+b-) 32a/32a high lacks HPA-32b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-33 HPA-33(a+b-) 33a/33a high lacks HPA-33b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-34 HPA-34(a+b-) 34a/34a high lacks HPA-34b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-35 HPA-35(a+b-) 35a/35a high lacks HPA-35b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HNA-1 HNA-1(a-b+c-) FCGR3B*02/FCGR3B*02 low FCGR3B c.194A>G (x0) does not match the other FCGR3B markers; lacks HNA-1a, HNA-1c: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI); FCGR3B and FCGR3A are near copies and the FCGR3B copy number varies (none to four or more): short reads can misplace these calls, the copies are not counted, and HNA-1null (no FCGR3B) is not assessed +HNA-3 HNA-3(a-b+) 3b/3b high lacks HNA-3a: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) +HNA-4 HNA-4(a+b-) 4a/4a high lacks HNA-4b: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) +HNA-5 HNA-5(a+b-) 5a/5a high lacks HNA-5b: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) diff --git a/tests/parity/golden/bloodtype/low-site-depth/t.tsv b/tests/parity/golden/bloodtype/low-site-depth/t.tsv new file mode 100644 index 000000000..139a6670b --- /dev/null +++ b/tests/parity/golden/bloodtype/low-site-depth/t.tsv @@ -0,0 +1,56 @@ +system phenotype genotype confidence note +ABO O O.01/O.01 high ABO alleles outside these five variants (weak A and B subgroups, cis-AB, O alleles other than O.01 and O.02) are not assessed +RhD D+ RHD/RHD (RHD copies by read depth 2.00) high weak and partial D (RHD missense alleles) are not assessed; an RHD gene that is there reads D+: RHD null alleles other than RHD*08N.01, RHD-CE-D hybrids that keep exons 3 to 7, and DEL alleles are not assessed +RhCE C-c+ E-e+ c/c e/e low RHCE exon 2 of a C allele is RHD-like: short reads can place it on RHD +Kell K/k not determined Kp(a-b+) Js(a-b+) Kpb/Kpb Jsb/Jsb low KEL c.578C>T: low depth (no VCF record and 3 reads at MAPQ 20 (fewer than 8)); 1 null row not determined (KEL c.246T>A: low depth); a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Duffy Fy(a+b-) FY*A/FY*A high +Kidd Jk(a+b-) Jka/Jka high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +MNS M-N+ S-s+ N/N s/s low GYPA, GYPB and GYPE are near copies: short reads can misplace these calls +Lutheran Lu(a-b+) Lub/Lub high +Diego Di(a-b+) Dib/Dib high +Dombrock Do(a-b+) Dob/Dob high +Colton Co(a+b-) Coa/Coa high +Vel not determined . not determined no null row of Vel was determined; SMIM1 c.64_80delAGCCTAGGGGCTGTGTC: low depth (no VCF record and 2 reads at MAPQ 20 (fewer than 8)) +Langereis Lan+ Lan/Lan high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Junior Jr(a+) Jra/Jra high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +H H+ H/H high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Secretor secretor Se/Se high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen; weak secretor alleles (such as FUT2 c.418A>T, also written c.385A>T) and a deletion of the whole FUT2 gene are not assessed +HPA-1 HPA-1(a+b-) 1a/1a high lacks HPA-1b: HPA-1a is the platelet antigen most often behind FNAIT and post-transfusion purpura in white populations: an HPA-1a-negative (HPA-1b/1b) mother can make anti-HPA-1a against an HPA-1a-positive baby; a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-2 HPA-2(a+b-) 2a/2a high lacks HPA-2b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-3 HPA-3(a+b-) 3a/3a high lacks HPA-3b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-4 HPA-4(a+b-) 4a/4a high lacks HPA-4b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-5 HPA-5(a+b-) 5a/5a high lacks HPA-5b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-6 HPA-6(a+b-) 6a/6a high lacks HPA-6b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-7 HPA-7(a+b-) 7a/7a high lacks HPA-7b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-8 HPA-8(a+b-) 8a/8a high lacks HPA-8b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-9 HPA-9(a+b-) 9a/9a high lacks HPA-9b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-10 HPA-10(a+b-) 10a/10a high lacks HPA-10b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-11 HPA-11(a+b-) 11a/11a high lacks HPA-11b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-12 HPA-12(a+b-) 12a/12a high lacks HPA-12b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-13 HPA-13(a+b-) 13a/13a high lacks HPA-13b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-14 HPA-14(a+b-) 14a/14a high lacks HPA-14b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-15 HPA-15(a-b+) 15b/15b high lacks HPA-15a: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-16 HPA-16(a+b-) 16a/16a high lacks HPA-16b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-17 HPA-17(a+b-) 17a/17a high lacks HPA-17b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-18 HPA-18(a+b-) 18a/18a high lacks HPA-18b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-19 HPA-19(a+b-) 19a/19a high lacks HPA-19b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-20 HPA-20(a+b-) 20a/20a high lacks HPA-20b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-21 HPA-21(a+b-) 21a/21a high lacks HPA-21b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-22 HPA-22(a+b-) 22a/22a high lacks HPA-22b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-23 HPA-23(a+b-) 23a/23a high lacks HPA-23b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-24 HPA-24(a+b-) 24a/24a high lacks HPA-24b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-25 HPA-25(a+b-) 25a/25a high lacks HPA-25b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-26 HPA-26(a+b-) 26a/26a high lacks HPA-26b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-27 HPA-27(a+b-) 27a/27a high lacks HPA-27b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-28 HPA-28(a+b-) 28a/28a high lacks HPA-28b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-29 HPA-29(a+b-) 29a/29a high lacks HPA-29b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-30 HPA-30(a+b-) 30a/30a high lacks HPA-30b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-31 HPA-31(a+b-) 31a/31a high lacks HPA-31b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-32 HPA-32(a+b-) 32a/32a high lacks HPA-32b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-33 HPA-33(a+b-) 33a/33a high lacks HPA-33b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-34 HPA-34(a+b-) 34a/34a high lacks HPA-34b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-35 HPA-35(a+b-) 35a/35a high lacks HPA-35b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HNA-1 HNA-1(a-b+c-) FCGR3B*02/FCGR3B*02 low FCGR3B c.194A>G (x0) does not match the other FCGR3B markers; lacks HNA-1a, HNA-1c: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI); FCGR3B and FCGR3A are near copies and the FCGR3B copy number varies (none to four or more): short reads can misplace these calls, the copies are not counted, and HNA-1null (no FCGR3B) is not assessed +HNA-3 HNA-3(a-b+) 3b/3b high lacks HNA-3a: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) +HNA-4 HNA-4(a+b-) 4a/4a high lacks HNA-4b: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) +HNA-5 HNA-5(a+b-) 5a/5a high lacks HNA-5b: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) diff --git a/tests/parity/golden/bloodtype/plain-nochr/stdout b/tests/parity/golden/bloodtype/plain-nochr/stdout new file mode 100644 index 000000000..d07df796f --- /dev/null +++ b/tests/parity/golden/bloodtype/plain-nochr/stdout @@ -0,0 +1,56 @@ +Blood groups of S, predicted from the genome (not a serological typing): + ABO A1 low + RhD D+ high + RhCE C-c+ E-e+ low + Kell K-k+ Kp(a-b+) Js(a-b+) high + Duffy Fy(a+b+) high + Kidd Jk(a-b+) high + MNS M-N+ S-s+ low + Lutheran Lu(a-b+) high + Diego Di(a-b+) high + Dombrock Do(a-b+) high + Colton Co(a+b-) high + Vel Vel+ high + Langereis Lan+ high + Junior Jr(a+) high + H H+ high + Secretor secretor high + HPA-1 HPA-1(a+b-) high + HPA-2 HPA-2(a+b-) high + HPA-3 HPA-3(a+b-) high + HPA-4 HPA-4(a+b-) high + HPA-5 HPA-5(a+b-) high + HPA-6 HPA-6(a+b-) high + HPA-7 HPA-7(a+b-) high + HPA-8 HPA-8(a+b-) high + HPA-9 HPA-9(a+b-) high + HPA-10 HPA-10(a+b-) high + HPA-11 HPA-11(a+b-) high + HPA-12 HPA-12(a+b-) high + HPA-13 HPA-13(a+b-) high + HPA-14 HPA-14(a+b-) high + HPA-15 HPA-15(a-b+) high + HPA-16 HPA-16(a+b-) high + HPA-17 HPA-17(a+b-) high + HPA-18 HPA-18(a+b-) high + HPA-19 HPA-19(a+b-) high + HPA-20 HPA-20(a+b-) high + HPA-21 HPA-21(a+b-) high + HPA-22 HPA-22(a+b-) high + HPA-23 HPA-23(a+b-) high + HPA-24 HPA-24(a+b-) high + HPA-25 HPA-25(a+b-) high + HPA-26 HPA-26(a+b-) high + HPA-27 HPA-27(a+b-) high + HPA-28 HPA-28(a+b-) high + HPA-29 HPA-29(a+b-) high + HPA-30 HPA-30(a+b-) high + HPA-31 HPA-31(a+b-) high + HPA-32 HPA-32(a+b-) high + HPA-33 HPA-33(a+b-) high + HPA-34 HPA-34(a+b-) high + HPA-35 HPA-35(a+b-) high + HNA-1 HNA-1(a-b+c-) low + HNA-3 HNA-3(a-b+) high + HNA-4 HNA-4(a+b-) high + HNA-5 HNA-5(a+b-) high diff --git a/tests/parity/golden/bloodtype/plain-nochr/t.tsv b/tests/parity/golden/bloodtype/plain-nochr/t.tsv new file mode 100644 index 000000000..5fca1b719 --- /dev/null +++ b/tests/parity/golden/bloodtype/plain-nochr/t.tsv @@ -0,0 +1,56 @@ +system phenotype genotype confidence note +ABO A1 A1/O.01 low A1 or A2 rests on ABO c.1061delC, a deletion in a run of C: short-read calls are less reliable here; an A allele is read from a c.261 insertion with neither c.802G>A nor c.803G>C, so an O allele that keeps c.261 (a non-deletional O) or a weak A subgroup also reads A; ABO alleles outside these five variants (weak A and B subgroups, cis-AB, O alleles other than O.01 and O.02) are not assessed +RhD D+ RHD/RHD (RHD copies by read depth 2.00) high weak and partial D (RHD missense alleles) are not assessed; an RHD gene that is there reads D+: RHD null alleles other than RHD*08N.01, RHD-CE-D hybrids that keep exons 3 to 7, and DEL alleles are not assessed +RhCE C-c+ E-e+ c/c e/e low RHCE exon 2 of a C allele is RHD-like: short reads can place it on RHD +Kell K-k+ Kp(a-b+) Js(a-b+) k/k Kpb/Kpb Jsb/Jsb high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Duffy Fy(a+b+) FY*A/FY*B high +Kidd Jk(a-b+) Jkb/Jkb high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +MNS M-N+ S-s+ N/N s/s low GYPA, GYPB and GYPE are near copies: short reads can misplace these calls +Lutheran Lu(a-b+) Lub/Lub high +Diego Di(a-b+) Dib/Dib high +Dombrock Do(a-b+) Dob/Dob high +Colton Co(a+b-) Coa/Coa high +Vel Vel+ Vel/Vel high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Langereis Lan+ Lan/Lan high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Junior Jr(a+) Jra/Jra high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +H H+ H/H high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Secretor secretor Se/Se high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen; weak secretor alleles (such as FUT2 c.418A>T, also written c.385A>T) and a deletion of the whole FUT2 gene are not assessed +HPA-1 HPA-1(a+b-) 1a/1a high lacks HPA-1b: HPA-1a is the platelet antigen most often behind FNAIT and post-transfusion purpura in white populations: an HPA-1a-negative (HPA-1b/1b) mother can make anti-HPA-1a against an HPA-1a-positive baby; a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-2 HPA-2(a+b-) 2a/2a high lacks HPA-2b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-3 HPA-3(a+b-) 3a/3a high lacks HPA-3b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-4 HPA-4(a+b-) 4a/4a high lacks HPA-4b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-5 HPA-5(a+b-) 5a/5a high lacks HPA-5b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-6 HPA-6(a+b-) 6a/6a high lacks HPA-6b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-7 HPA-7(a+b-) 7a/7a high lacks HPA-7b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-8 HPA-8(a+b-) 8a/8a high lacks HPA-8b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-9 HPA-9(a+b-) 9a/9a high lacks HPA-9b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-10 HPA-10(a+b-) 10a/10a high lacks HPA-10b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-11 HPA-11(a+b-) 11a/11a high lacks HPA-11b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-12 HPA-12(a+b-) 12a/12a high lacks HPA-12b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-13 HPA-13(a+b-) 13a/13a high lacks HPA-13b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-14 HPA-14(a+b-) 14a/14a high lacks HPA-14b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-15 HPA-15(a-b+) 15b/15b high lacks HPA-15a: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-16 HPA-16(a+b-) 16a/16a high lacks HPA-16b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-17 HPA-17(a+b-) 17a/17a high lacks HPA-17b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-18 HPA-18(a+b-) 18a/18a high lacks HPA-18b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-19 HPA-19(a+b-) 19a/19a high lacks HPA-19b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-20 HPA-20(a+b-) 20a/20a high lacks HPA-20b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-21 HPA-21(a+b-) 21a/21a high lacks HPA-21b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-22 HPA-22(a+b-) 22a/22a high lacks HPA-22b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-23 HPA-23(a+b-) 23a/23a high lacks HPA-23b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-24 HPA-24(a+b-) 24a/24a high lacks HPA-24b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-25 HPA-25(a+b-) 25a/25a high lacks HPA-25b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-26 HPA-26(a+b-) 26a/26a high lacks HPA-26b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-27 HPA-27(a+b-) 27a/27a high lacks HPA-27b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-28 HPA-28(a+b-) 28a/28a high lacks HPA-28b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-29 HPA-29(a+b-) 29a/29a high lacks HPA-29b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-30 HPA-30(a+b-) 30a/30a high lacks HPA-30b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-31 HPA-31(a+b-) 31a/31a high lacks HPA-31b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-32 HPA-32(a+b-) 32a/32a high lacks HPA-32b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-33 HPA-33(a+b-) 33a/33a high lacks HPA-33b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-34 HPA-34(a+b-) 34a/34a high lacks HPA-34b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-35 HPA-35(a+b-) 35a/35a high lacks HPA-35b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HNA-1 HNA-1(a-b+c-) FCGR3B*02/FCGR3B*02 low FCGR3B c.194A>G (x0) does not match the other FCGR3B markers; lacks HNA-1a, HNA-1c: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI); FCGR3B and FCGR3A are near copies and the FCGR3B copy number varies (none to four or more): short reads can misplace these calls, the copies are not counted, and HNA-1null (no FCGR3B) is not assessed +HNA-3 HNA-3(a-b+) 3b/3b high lacks HNA-3a: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) +HNA-4 HNA-4(a+b-) 4a/4a high lacks HNA-4b: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) +HNA-5 HNA-5(a+b-) 5a/5a high lacks HNA-5b: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) diff --git a/tests/parity/golden/bloodtype/pseudogene-one-copy/stdout b/tests/parity/golden/bloodtype/pseudogene-one-copy/stdout new file mode 100644 index 000000000..25c11a35d --- /dev/null +++ b/tests/parity/golden/bloodtype/pseudogene-one-copy/stdout @@ -0,0 +1,56 @@ +Blood groups of S, predicted from the genome (not a serological typing): + Kell K+k- Kp(a-b+) Js(a-b+) high + ABO A2B low + RhD D- high + RhCE C-c+ E-e+ low + Duffy Fy(a+b-) high + Kidd Jk(a+b-) high + MNS M-N+ S-s+ low + Lutheran Lu(a-b+) high + Diego Di(a-b+) high + Dombrock Do(a-b+) high + Colton Co(a+b-) high + Vel Vel+ high + Langereis Lan+ high + Junior Jr(a+) high + H H+ high + Secretor secretor high + HPA-1 HPA-1(a+b-) high + HPA-2 HPA-2(a+b-) high + HPA-3 HPA-3(a+b-) high + HPA-4 HPA-4(a+b-) high + HPA-5 HPA-5(a+b-) high + HPA-6 HPA-6(a+b-) high + HPA-7 HPA-7(a+b-) high + HPA-8 HPA-8(a+b-) high + HPA-9 HPA-9(a+b-) high + HPA-10 HPA-10(a+b-) high + HPA-11 HPA-11(a+b-) high + HPA-12 HPA-12(a+b-) high + HPA-13 HPA-13(a+b-) high + HPA-14 HPA-14(a+b-) high + HPA-15 HPA-15(a+b-) high + HPA-16 HPA-16(a+b-) high + HPA-17 HPA-17(a+b-) high + HPA-18 HPA-18(a+b-) high + HPA-19 HPA-19(a+b-) high + HPA-20 HPA-20(a+b-) high + HPA-21 HPA-21(a+b-) high + HPA-22 HPA-22(a+b-) high + HPA-23 HPA-23(a+b-) high + HPA-24 HPA-24(a+b-) high + HPA-25 HPA-25(a+b-) high + HPA-26 HPA-26(a+b-) high + HPA-27 HPA-27(a+b-) high + HPA-28 HPA-28(a+b-) high + HPA-29 HPA-29(a+b-) high + HPA-30 HPA-30(a+b-) high + HPA-31 HPA-31(a+b-) high + HPA-32 HPA-32(a+b-) high + HPA-33 HPA-33(a+b-) high + HPA-34 HPA-34(a+b-) high + HPA-35 HPA-35(a+b-) high + HNA-1 HNA-1(a-b+c-) low + HNA-3 HNA-3(a-b+) high + HNA-4 HNA-4(a+b-) high + HNA-5 HNA-5(a+b-) high diff --git a/tests/parity/golden/bloodtype/pseudogene-one-copy/t.tsv b/tests/parity/golden/bloodtype/pseudogene-one-copy/t.tsv new file mode 100644 index 000000000..9a23d33ca --- /dev/null +++ b/tests/parity/golden/bloodtype/pseudogene-one-copy/t.tsv @@ -0,0 +1,56 @@ +system phenotype genotype confidence note +Kell K+k- Kp(a-b+) Js(a-b+) K/null Kpb/null Jsb/null high null allele: KEL c.246T>A x1; each null copy is placed with k, Kpb, Jsb first, the alleles the ISBT table finds it with (phase is not read); a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen; lacks k, carried by most people (high prevalence) +ABO A2B A2/B low A1 or A2 rests on ABO c.1061delC, a deletion in a run of C: short-read calls are less reliable here; an A allele is read from a c.261 insertion with neither c.802G>A nor c.803G>C, so an O allele that keeps c.261 (a non-deletional O) or a weak A subgroup also reads A; ABO alleles outside these five variants (weak A and B subgroups, cis-AB, O alleles other than O.01 and O.02) are not assessed; A and B on different chromosomes assumed (no phase) +RhD D- RHD*08N.01/RHD deleted (RHD copies by read depth 1.00) high weak and partial D (RHD missense alleles) are not assessed +RhCE C-c+ E-e+ c/c e/e low RHCE exon 2 of a C allele is RHD-like: short reads can place it on RHD +Duffy Fy(a+b-) FY*A/FY*B GATA high c.-67T>C (GATA box) stops Duffy expression on red cells only; with no phase it is placed on the Fyb chromosome first, where it usually lies (FY*02N.01) +Kidd Jk(a+b-) Jka/Jka high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +MNS M-N+ S-s+ N/N s/s low GYPA, GYPB and GYPE are near copies: short reads can misplace these calls +Lutheran Lu(a-b+) Lub/Lub high +Diego Di(a-b+) Dib/Dib high +Dombrock Do(a-b+) Dob/Dob high +Colton Co(a+b-) Coa/Coa high +Vel Vel+ Vel/Vel high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Langereis Lan+ Lan/Lan high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Junior Jr(a+) Jra/Jra high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +H H+ H/H high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Secretor secretor Se/Se high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen; weak secretor alleles (such as FUT2 c.418A>T, also written c.385A>T) and a deletion of the whole FUT2 gene are not assessed +HPA-1 HPA-1(a+b-) 1a/1a high lacks HPA-1b: HPA-1a is the platelet antigen most often behind FNAIT and post-transfusion purpura in white populations: an HPA-1a-negative (HPA-1b/1b) mother can make anti-HPA-1a against an HPA-1a-positive baby; a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-2 HPA-2(a+b-) 2a/2a high lacks HPA-2b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-3 HPA-3(a+b-) 3a/3a high lacks HPA-3b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-4 HPA-4(a+b-) 4a/4a high lacks HPA-4b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-5 HPA-5(a+b-) 5a/5a high lacks HPA-5b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-6 HPA-6(a+b-) 6a/6a high lacks HPA-6b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-7 HPA-7(a+b-) 7a/7a high lacks HPA-7b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-8 HPA-8(a+b-) 8a/8a high lacks HPA-8b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-9 HPA-9(a+b-) 9a/9a high lacks HPA-9b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-10 HPA-10(a+b-) 10a/10a high lacks HPA-10b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-11 HPA-11(a+b-) 11a/11a high lacks HPA-11b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-12 HPA-12(a+b-) 12a/12a high lacks HPA-12b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-13 HPA-13(a+b-) 13a/13a high lacks HPA-13b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-14 HPA-14(a+b-) 14a/14a high lacks HPA-14b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-15 HPA-15(a+b-) 15a/15a high lacks HPA-15b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-16 HPA-16(a+b-) 16a/16a high lacks HPA-16b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-17 HPA-17(a+b-) 17a/17a high lacks HPA-17b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-18 HPA-18(a+b-) 18a/18a high lacks HPA-18b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-19 HPA-19(a+b-) 19a/19a high lacks HPA-19b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-20 HPA-20(a+b-) 20a/20a high lacks HPA-20b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-21 HPA-21(a+b-) 21a/21a high lacks HPA-21b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-22 HPA-22(a+b-) 22a/22a high lacks HPA-22b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-23 HPA-23(a+b-) 23a/23a high lacks HPA-23b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-24 HPA-24(a+b-) 24a/24a high lacks HPA-24b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-25 HPA-25(a+b-) 25a/25a high lacks HPA-25b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-26 HPA-26(a+b-) 26a/26a high lacks HPA-26b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-27 HPA-27(a+b-) 27a/27a high lacks HPA-27b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-28 HPA-28(a+b-) 28a/28a high lacks HPA-28b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-29 HPA-29(a+b-) 29a/29a high lacks HPA-29b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-30 HPA-30(a+b-) 30a/30a high lacks HPA-30b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-31 HPA-31(a+b-) 31a/31a high lacks HPA-31b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-32 HPA-32(a+b-) 32a/32a high lacks HPA-32b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-33 HPA-33(a+b-) 33a/33a high lacks HPA-33b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-34 HPA-34(a+b-) 34a/34a high lacks HPA-34b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-35 HPA-35(a+b-) 35a/35a high lacks HPA-35b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HNA-1 HNA-1(a-b+c-) FCGR3B*02/FCGR3B*02 low FCGR3B c.194A>G (x0) does not match the other FCGR3B markers; lacks HNA-1a, HNA-1c: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI); FCGR3B and FCGR3A are near copies and the FCGR3B copy number varies (none to four or more): short reads can misplace these calls, the copies are not counted, and HNA-1null (no FCGR3B) is not assessed +HNA-3 HNA-3(a-b+) 3b/3b high lacks HNA-3a: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) +HNA-4 HNA-4(a+b-) 4a/4a high lacks HNA-4b: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) +HNA-5 HNA-5(a+b-) 5a/5a high lacks HNA-5b: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) diff --git a/tests/parity/golden/bloodtype/ref-blocks-second-record/t.tsv b/tests/parity/golden/bloodtype/ref-blocks-second-record/t.tsv new file mode 100644 index 000000000..2a5dd0d22 --- /dev/null +++ b/tests/parity/golden/bloodtype/ref-blocks-second-record/t.tsv @@ -0,0 +1,56 @@ +system phenotype genotype confidence note +ABO O O.01/O.01 high ABO alleles outside these five variants (weak A and B subgroups, cis-AB, O alleles other than O.01 and O.02) are not assessed +RhD D+ RHD/RHD (RHD copies by read depth 2.00) high weak and partial D (RHD missense alleles) are not assessed; an RHD gene that is there reads D+: RHD null alleles other than RHD*08N.01, RHD-CE-D hybrids that keep exons 3 to 7, and DEL alleles are not assessed +RhCE C-c+ E-e+ c/c e/e low RHCE exon 2 of a C allele is RHD-like: short reads can place it on RHD +Kell K-k+ Kp(a-b+) Js(a-b+) k/k Kpb/Kpb Jsb/Jsb high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Duffy Fy(a+b-) FY*A/FY*A high +Kidd Jk(a+b-) Jka/Jka high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +MNS M-N+ S+s+ N/N S/s low GYPA, GYPB and GYPE are near copies: short reads can misplace these calls +Lutheran Lu(a-b+) Lub/Lub high +Diego Di(a-b+) Dib/Dib high +Dombrock Do(a-b+) Dob/Dob high +Colton Co(a+b-) Coa/Coa high +Vel Vel+ Vel/Vel high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Langereis Lan+ Lan/Lan high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Junior Jr(a+) Jra/Jra high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +H H+ H/H high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Secretor secretor Se/Se high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen; weak secretor alleles (such as FUT2 c.418A>T, also written c.385A>T) and a deletion of the whole FUT2 gene are not assessed +HPA-1 HPA-1(a+b-) 1a/1a high lacks HPA-1b: HPA-1a is the platelet antigen most often behind FNAIT and post-transfusion purpura in white populations: an HPA-1a-negative (HPA-1b/1b) mother can make anti-HPA-1a against an HPA-1a-positive baby; a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-2 HPA-2(a+b-) 2a/2a high lacks HPA-2b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-3 HPA-3(a+b-) 3a/3a high lacks HPA-3b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-4 HPA-4(a+b-) 4a/4a high lacks HPA-4b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-5 HPA-5(a+b-) 5a/5a high lacks HPA-5b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-6 HPA-6(a+b-) 6a/6a high lacks HPA-6b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-7 HPA-7(a+b-) 7a/7a high lacks HPA-7b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-8 HPA-8(a+b-) 8a/8a high lacks HPA-8b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-9 HPA-9(a+b-) 9a/9a high lacks HPA-9b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-10 HPA-10(a+b-) 10a/10a high lacks HPA-10b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-11 HPA-11(a+b-) 11a/11a high lacks HPA-11b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-12 HPA-12(a+b-) 12a/12a high lacks HPA-12b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-13 HPA-13(a+b-) 13a/13a high lacks HPA-13b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-14 HPA-14(a+b-) 14a/14a high lacks HPA-14b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-15 HPA-15(a-b+) 15b/15b high lacks HPA-15a: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-16 HPA-16(a+b-) 16a/16a high lacks HPA-16b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-17 HPA-17(a+b-) 17a/17a high lacks HPA-17b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-18 HPA-18(a+b-) 18a/18a high lacks HPA-18b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-19 HPA-19(a+b-) 19a/19a high lacks HPA-19b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-20 HPA-20(a+b-) 20a/20a high lacks HPA-20b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-21 HPA-21(a+b-) 21a/21a high lacks HPA-21b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-22 HPA-22(a+b-) 22a/22a high lacks HPA-22b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-23 HPA-23(a+b-) 23a/23a high lacks HPA-23b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-24 HPA-24(a+b-) 24a/24a high lacks HPA-24b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-25 HPA-25(a+b-) 25a/25a high lacks HPA-25b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-26 HPA-26(a+b-) 26a/26a high lacks HPA-26b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-27 HPA-27(a+b-) 27a/27a high lacks HPA-27b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-28 HPA-28(a+b-) 28a/28a high lacks HPA-28b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-29 HPA-29(a+b-) 29a/29a high lacks HPA-29b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-30 HPA-30(a+b-) 30a/30a high lacks HPA-30b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-31 HPA-31(a+b-) 31a/31a high lacks HPA-31b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-32 HPA-32(a+b-) 32a/32a high lacks HPA-32b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-33 HPA-33(a+b-) 33a/33a high lacks HPA-33b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-34 HPA-34(a+b-) 34a/34a high lacks HPA-34b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-35 HPA-35(a+b-) 35a/35a high lacks HPA-35b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HNA-1 HNA-1(a-b+c-) FCGR3B*02/FCGR3B*02 low FCGR3B c.194A>G (x0) does not match the other FCGR3B markers; lacks HNA-1a, HNA-1c: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI); FCGR3B and FCGR3A are near copies and the FCGR3B copy number varies (none to four or more): short reads can misplace these calls, the copies are not counted, and HNA-1null (no FCGR3B) is not assessed +HNA-3 HNA-3(a-b+) 3b/3b high lacks HNA-3a: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) +HNA-4 HNA-4(a+b-) 4a/4a high lacks HNA-4b: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) +HNA-5 HNA-5(a+b-) 5a/5a high lacks HNA-5b: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) diff --git a/tests/parity/golden/bloodtype/ref-no-bam/stdout b/tests/parity/golden/bloodtype/ref-no-bam/stdout new file mode 100644 index 000000000..c15683e01 --- /dev/null +++ b/tests/parity/golden/bloodtype/ref-no-bam/stdout @@ -0,0 +1,56 @@ +Blood groups of S, predicted from the genome (not a serological typing): + ABO not assessed not assessed + RhD not determined not determined + RhCE not assessed not assessed + Kell not assessed not assessed + Duffy not assessed not assessed + Kidd not assessed not assessed + MNS not assessed not assessed + Lutheran not assessed not assessed + Diego not assessed not assessed + Dombrock not assessed not assessed + Colton not assessed not assessed + Vel not assessed not assessed + Langereis not assessed not assessed + Junior not assessed not assessed + H not assessed not assessed + Secretor not assessed not assessed + HPA-1 not assessed not assessed + HPA-2 not assessed not assessed + HPA-3 not assessed not assessed + HPA-4 not assessed not assessed + HPA-5 not assessed not assessed + HPA-6 not assessed not assessed + HPA-7 not assessed not assessed + HPA-8 not assessed not assessed + HPA-9 not assessed not assessed + HPA-10 not assessed not assessed + HPA-11 not assessed not assessed + HPA-12 not assessed not assessed + HPA-13 not assessed not assessed + HPA-14 not assessed not assessed + HPA-15 not assessed not assessed + HPA-16 not assessed not assessed + HPA-17 not assessed not assessed + HPA-18 not assessed not assessed + HPA-19 not assessed not assessed + HPA-20 not assessed not assessed + HPA-21 not assessed not assessed + HPA-22 not assessed not assessed + HPA-23 not assessed not assessed + HPA-24 not assessed not assessed + HPA-25 not assessed not assessed + HPA-26 not assessed not assessed + HPA-27 not assessed not assessed + HPA-28 not assessed not assessed + HPA-29 not assessed not assessed + HPA-30 not assessed not assessed + HPA-31 not assessed not assessed + HPA-32 not assessed not assessed + HPA-33 not assessed not assessed + HPA-34 not assessed not assessed + HPA-35 not assessed not assessed + HNA-1 not assessed not assessed + HNA-3 not assessed not assessed + HNA-4 not assessed not assessed + HNA-5 not assessed not assessed diff --git a/tests/parity/golden/bloodtype/ref-no-bam/t.tsv b/tests/parity/golden/bloodtype/ref-no-bam/t.tsv new file mode 100644 index 000000000..32e35dd8f --- /dev/null +++ b/tests/parity/golden/bloodtype/ref-no-bam/t.tsv @@ -0,0 +1,56 @@ +system phenotype genotype confidence note +ABO not assessed . not assessed no VCF record at any of its 5 sites and no BAM: a VCF that does not cover chr9 would read as the reference +RhD not determined . not determined needs the BAM: the common RhD-negative allele (RHD*01N.01) deletes the whole RHD gene, which a VCF does not show +RhCE not assessed . not assessed no VCF record at any of its 2 sites and no BAM: a VCF that does not cover chr1 would read as the reference +Kell not assessed . not assessed no VCF record at any of its 60 sites and no BAM: a VCF that does not cover chr7 would read as the reference +Duffy not assessed . not assessed no VCF record at any of its 3 sites and no BAM: a VCF that does not cover chr1 would read as the reference +Kidd not assessed . not assessed no VCF record at any of its 41 sites and no BAM: a VCF that does not cover chr18 would read as the reference +MNS not assessed . not assessed no VCF record at any of its 2 sites and no BAM: a VCF that does not cover chr4 would read as the reference +Lutheran not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr19 would read as the reference +Diego not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr17 would read as the reference +Dombrock not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr12 would read as the reference +Colton not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr7 would read as the reference +Vel not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr1 would read as the reference +Langereis not assessed . not assessed no VCF record at any of its 36 sites and no BAM: a VCF that does not cover chr2 would read as the reference +Junior not assessed . not assessed no VCF record at any of its 23 sites and no BAM: a VCF that does not cover chr4 would read as the reference +H not assessed . not assessed no VCF record at any of its 34 sites and no BAM: a VCF that does not cover chr19 would read as the reference +Secretor not assessed . not assessed no VCF record at any of its 14 sites and no BAM: a VCF that does not cover chr19 would read as the reference +HPA-1 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr17 would read as the reference +HPA-2 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr17 would read as the reference +HPA-3 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr17 would read as the reference +HPA-4 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr17 would read as the reference +HPA-5 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr5 would read as the reference +HPA-6 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr17 would read as the reference +HPA-7 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr17 would read as the reference +HPA-8 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr17 would read as the reference +HPA-9 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr17 would read as the reference +HPA-10 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr17 would read as the reference +HPA-11 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr17 would read as the reference +HPA-12 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr22 would read as the reference +HPA-13 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr5 would read as the reference +HPA-14 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr17 would read as the reference +HPA-15 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr6 would read as the reference +HPA-16 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr17 would read as the reference +HPA-17 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr17 would read as the reference +HPA-18 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr5 would read as the reference +HPA-19 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr17 would read as the reference +HPA-20 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr17 would read as the reference +HPA-21 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr17 would read as the reference +HPA-22 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr17 would read as the reference +HPA-23 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr17 would read as the reference +HPA-24 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr17 would read as the reference +HPA-25 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr5 would read as the reference +HPA-26 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr17 would read as the reference +HPA-27 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr17 would read as the reference +HPA-28 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr17 would read as the reference +HPA-29 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr17 would read as the reference +HPA-30 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr17 would read as the reference +HPA-31 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr3 would read as the reference +HPA-32 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr17 would read as the reference +HPA-33 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr17 would read as the reference +HPA-34 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr17 would read as the reference +HPA-35 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr17 would read as the reference +HNA-1 not assessed . not assessed no VCF record at any of its 6 sites and no BAM: a VCF that does not cover chr1 would read as the reference +HNA-3 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr19 would read as the reference +HNA-4 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr16 would read as the reference +HNA-5 not assessed . not assessed no VCF record at any of its 1 site and no BAM: a VCF that does not cover chr16 would read as the reference diff --git a/tests/parity/golden/bloodtype/ref-reads/t.tsv b/tests/parity/golden/bloodtype/ref-reads/t.tsv new file mode 100644 index 000000000..f9adef07c --- /dev/null +++ b/tests/parity/golden/bloodtype/ref-reads/t.tsv @@ -0,0 +1,56 @@ +system phenotype genotype confidence note +ABO O O.01/O.01 high ABO alleles outside these five variants (weak A and B subgroups, cis-AB, O alleles other than O.01 and O.02) are not assessed +RhD D+ RHD/RHD (RHD copies by read depth 2.00) high weak and partial D (RHD missense alleles) are not assessed; an RHD gene that is there reads D+: RHD null alleles other than RHD*08N.01, RHD-CE-D hybrids that keep exons 3 to 7, and DEL alleles are not assessed +RhCE C-c+ E-e+ c/c e/e low RHCE exon 2 of a C allele is RHD-like: short reads can place it on RHD +Kell K-k+ Kp(a-b+) Js(a-b+) k/k Kpb/Kpb Jsb/Jsb high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Duffy Fy(a+b-) FY*A/FY*A high +Kidd Jk(a+b-) Jka/Jka high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +MNS M-N+ S-s+ N/N s/s low GYPA, GYPB and GYPE are near copies: short reads can misplace these calls +Lutheran Lu(a-b+) Lub/Lub high +Diego Di(a-b+) Dib/Dib high +Dombrock Do(a-b+) Dob/Dob high +Colton Co(a+b-) Coa/Coa high +Vel Vel+ Vel/Vel high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Langereis Lan+ Lan/Lan high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Junior Jr(a+) Jra/Jra high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +H H+ H/H high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Secretor secretor Se/Se high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen; weak secretor alleles (such as FUT2 c.418A>T, also written c.385A>T) and a deletion of the whole FUT2 gene are not assessed +HPA-1 HPA-1(a+b-) 1a/1a high lacks HPA-1b: HPA-1a is the platelet antigen most often behind FNAIT and post-transfusion purpura in white populations: an HPA-1a-negative (HPA-1b/1b) mother can make anti-HPA-1a against an HPA-1a-positive baby; a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-2 HPA-2(a+b-) 2a/2a high lacks HPA-2b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-3 HPA-3(a+b-) 3a/3a high lacks HPA-3b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-4 HPA-4(a+b-) 4a/4a high lacks HPA-4b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-5 HPA-5(a+b-) 5a/5a high lacks HPA-5b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-6 HPA-6(a+b-) 6a/6a high lacks HPA-6b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-7 HPA-7(a+b-) 7a/7a high lacks HPA-7b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-8 HPA-8(a+b-) 8a/8a high lacks HPA-8b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-9 HPA-9(a+b-) 9a/9a high lacks HPA-9b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-10 HPA-10(a+b-) 10a/10a high lacks HPA-10b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-11 HPA-11(a+b-) 11a/11a high lacks HPA-11b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-12 HPA-12(a+b-) 12a/12a high lacks HPA-12b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-13 HPA-13(a+b-) 13a/13a high lacks HPA-13b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-14 HPA-14(a+b-) 14a/14a high lacks HPA-14b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-15 HPA-15(a-b+) 15b/15b high lacks HPA-15a: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-16 HPA-16(a+b-) 16a/16a high lacks HPA-16b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-17 HPA-17(a+b-) 17a/17a high lacks HPA-17b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-18 HPA-18(a+b-) 18a/18a high lacks HPA-18b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-19 HPA-19(a+b-) 19a/19a high lacks HPA-19b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-20 HPA-20(a+b-) 20a/20a high lacks HPA-20b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-21 HPA-21(a+b-) 21a/21a high lacks HPA-21b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-22 HPA-22(a+b-) 22a/22a high lacks HPA-22b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-23 HPA-23(a+b-) 23a/23a high lacks HPA-23b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-24 HPA-24(a+b-) 24a/24a high lacks HPA-24b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-25 HPA-25(a+b-) 25a/25a high lacks HPA-25b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-26 HPA-26(a+b-) 26a/26a high lacks HPA-26b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-27 HPA-27(a+b-) 27a/27a high lacks HPA-27b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-28 HPA-28(a+b-) 28a/28a high lacks HPA-28b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-29 HPA-29(a+b-) 29a/29a high lacks HPA-29b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-30 HPA-30(a+b-) 30a/30a high lacks HPA-30b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-31 HPA-31(a+b-) 31a/31a high lacks HPA-31b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-32 HPA-32(a+b-) 32a/32a high lacks HPA-32b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-33 HPA-33(a+b-) 33a/33a high lacks HPA-33b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-34 HPA-34(a+b-) 34a/34a high lacks HPA-34b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-35 HPA-35(a+b-) 35a/35a high lacks HPA-35b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HNA-1 HNA-1(a-b+c-) FCGR3B*02/FCGR3B*02 low FCGR3B c.194A>G (x0) does not match the other FCGR3B markers; lacks HNA-1a, HNA-1c: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI); FCGR3B and FCGR3A are near copies and the FCGR3B copy number varies (none to four or more): short reads can misplace these calls, the copies are not counted, and HNA-1null (no FCGR3B) is not assessed +HNA-3 HNA-3(a-b+) 3b/3b high lacks HNA-3a: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) +HNA-4 HNA-4(a+b-) 4a/4a high lacks HNA-4b: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) +HNA-5 HNA-5(a+b-) 5a/5a high lacks HNA-5b: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) diff --git a/tests/parity/golden/bloodtype/rhd-boundary/t.tsv b/tests/parity/golden/bloodtype/rhd-boundary/t.tsv new file mode 100644 index 000000000..b4e6f7743 --- /dev/null +++ b/tests/parity/golden/bloodtype/rhd-boundary/t.tsv @@ -0,0 +1,56 @@ +system phenotype genotype confidence note +ABO O O.01/O.01 high ABO alleles outside these five variants (weak A and B subgroups, cis-AB, O alleles other than O.01 and O.02) are not assessed +RhD D+ RHD/RHD deleted (RHD copies by read depth 1.45) low read depth 1.45 copies is near a copy-number boundary; weak and partial D (RHD missense alleles) are not assessed; an RHD gene that is there reads D+: RHD null alleles other than RHD*08N.01, RHD-CE-D hybrids that keep exons 3 to 7, and DEL alleles are not assessed +RhCE C-c+ E-e+ c/c e/e low RHCE exon 2 of a C allele is RHD-like: short reads can place it on RHD +Kell K-k+ Kp(a-b+) Js(a-b+) k/k Kpb/Kpb Jsb/Jsb high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Duffy Fy(a+b-) FY*A/FY*A high +Kidd Jk(a+b-) Jka/Jka high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +MNS M-N+ S-s+ N/N s/s low GYPA, GYPB and GYPE are near copies: short reads can misplace these calls +Lutheran Lu(a-b+) Lub/Lub high +Diego Di(a-b+) Dib/Dib high +Dombrock Do(a-b+) Dob/Dob high +Colton Co(a+b-) Coa/Coa high +Vel Vel+ Vel/Vel high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Langereis Lan+ Lan/Lan high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Junior Jr(a+) Jra/Jra high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +H H+ H/H high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Secretor secretor Se/Se high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen; weak secretor alleles (such as FUT2 c.418A>T, also written c.385A>T) and a deletion of the whole FUT2 gene are not assessed +HPA-1 HPA-1(a+b-) 1a/1a high lacks HPA-1b: HPA-1a is the platelet antigen most often behind FNAIT and post-transfusion purpura in white populations: an HPA-1a-negative (HPA-1b/1b) mother can make anti-HPA-1a against an HPA-1a-positive baby; a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-2 HPA-2(a+b-) 2a/2a high lacks HPA-2b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-3 HPA-3(a+b-) 3a/3a high lacks HPA-3b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-4 HPA-4(a+b-) 4a/4a high lacks HPA-4b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-5 HPA-5(a+b-) 5a/5a high lacks HPA-5b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-6 HPA-6(a+b-) 6a/6a high lacks HPA-6b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-7 HPA-7(a+b-) 7a/7a high lacks HPA-7b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-8 HPA-8(a+b-) 8a/8a high lacks HPA-8b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-9 HPA-9(a+b-) 9a/9a high lacks HPA-9b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-10 HPA-10(a+b-) 10a/10a high lacks HPA-10b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-11 HPA-11(a+b-) 11a/11a high lacks HPA-11b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-12 HPA-12(a+b-) 12a/12a high lacks HPA-12b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-13 HPA-13(a+b-) 13a/13a high lacks HPA-13b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-14 HPA-14(a+b-) 14a/14a high lacks HPA-14b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-15 HPA-15(a-b+) 15b/15b high lacks HPA-15a: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-16 HPA-16(a+b-) 16a/16a high lacks HPA-16b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-17 HPA-17(a+b-) 17a/17a high lacks HPA-17b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-18 HPA-18(a+b-) 18a/18a high lacks HPA-18b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-19 HPA-19(a+b-) 19a/19a high lacks HPA-19b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-20 HPA-20(a+b-) 20a/20a high lacks HPA-20b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-21 HPA-21(a+b-) 21a/21a high lacks HPA-21b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-22 HPA-22(a+b-) 22a/22a high lacks HPA-22b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-23 HPA-23(a+b-) 23a/23a high lacks HPA-23b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-24 HPA-24(a+b-) 24a/24a high lacks HPA-24b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-25 HPA-25(a+b-) 25a/25a high lacks HPA-25b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-26 HPA-26(a+b-) 26a/26a high lacks HPA-26b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-27 HPA-27(a+b-) 27a/27a high lacks HPA-27b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-28 HPA-28(a+b-) 28a/28a high lacks HPA-28b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-29 HPA-29(a+b-) 29a/29a high lacks HPA-29b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-30 HPA-30(a+b-) 30a/30a high lacks HPA-30b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-31 HPA-31(a+b-) 31a/31a high lacks HPA-31b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-32 HPA-32(a+b-) 32a/32a high lacks HPA-32b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-33 HPA-33(a+b-) 33a/33a high lacks HPA-33b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-34 HPA-34(a+b-) 34a/34a high lacks HPA-34b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-35 HPA-35(a+b-) 35a/35a high lacks HPA-35b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HNA-1 HNA-1(a-b+c-) FCGR3B*02/FCGR3B*02 low FCGR3B c.194A>G (x0) does not match the other FCGR3B markers; lacks HNA-1a, HNA-1c: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI); FCGR3B and FCGR3A are near copies and the FCGR3B copy number varies (none to four or more): short reads can misplace these calls, the copies are not counted, and HNA-1null (no FCGR3B) is not assessed +HNA-3 HNA-3(a-b+) 3b/3b high lacks HNA-3a: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) +HNA-4 HNA-4(a+b-) 4a/4a high lacks HNA-4b: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) +HNA-5 HNA-5(a+b-) 5a/5a high lacks HNA-5b: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) diff --git a/tests/parity/golden/bloodtype/rhd-broken-flank/t.tsv b/tests/parity/golden/bloodtype/rhd-broken-flank/t.tsv new file mode 100644 index 000000000..969c8b5f6 --- /dev/null +++ b/tests/parity/golden/bloodtype/rhd-broken-flank/t.tsv @@ -0,0 +1,56 @@ +system phenotype genotype confidence note +ABO O O.01/O.01 high ABO alleles outside these five variants (weak A and B subgroups, cis-AB, O alleles other than O.01 and O.02) are not assessed +RhD not determined . not determined BROKEN_CONTROL: control segment RHD_FLANK_DOWN of RHD has no read while the other controls have 30.0x; check its coordinates in bin/cn_loci.tsv (or the sample lacks that stretch) +RhCE C-c+ E-e+ c/c e/e low RHCE exon 2 of a C allele is RHD-like: short reads can place it on RHD +Kell K-k+ Kp(a-b+) Js(a-b+) k/k Kpb/Kpb Jsb/Jsb high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Duffy Fy(a+b-) FY*A/FY*A high +Kidd Jk(a+b-) Jka/Jka high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +MNS M-N+ S-s+ N/N s/s low GYPA, GYPB and GYPE are near copies: short reads can misplace these calls +Lutheran Lu(a-b+) Lub/Lub high +Diego Di(a-b+) Dib/Dib high +Dombrock Do(a-b+) Dob/Dob high +Colton Co(a+b-) Coa/Coa high +Vel Vel+ Vel/Vel high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Langereis Lan+ Lan/Lan high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Junior Jr(a+) Jra/Jra high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +H H+ H/H high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Secretor secretor Se/Se high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen; weak secretor alleles (such as FUT2 c.418A>T, also written c.385A>T) and a deletion of the whole FUT2 gene are not assessed +HPA-1 HPA-1(a+b-) 1a/1a high lacks HPA-1b: HPA-1a is the platelet antigen most often behind FNAIT and post-transfusion purpura in white populations: an HPA-1a-negative (HPA-1b/1b) mother can make anti-HPA-1a against an HPA-1a-positive baby; a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-2 HPA-2(a+b-) 2a/2a high lacks HPA-2b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-3 HPA-3(a+b-) 3a/3a high lacks HPA-3b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-4 HPA-4(a+b-) 4a/4a high lacks HPA-4b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-5 HPA-5(a+b-) 5a/5a high lacks HPA-5b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-6 HPA-6(a+b-) 6a/6a high lacks HPA-6b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-7 HPA-7(a+b-) 7a/7a high lacks HPA-7b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-8 HPA-8(a+b-) 8a/8a high lacks HPA-8b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-9 HPA-9(a+b-) 9a/9a high lacks HPA-9b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-10 HPA-10(a+b-) 10a/10a high lacks HPA-10b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-11 HPA-11(a+b-) 11a/11a high lacks HPA-11b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-12 HPA-12(a+b-) 12a/12a high lacks HPA-12b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-13 HPA-13(a+b-) 13a/13a high lacks HPA-13b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-14 HPA-14(a+b-) 14a/14a high lacks HPA-14b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-15 HPA-15(a-b+) 15b/15b high lacks HPA-15a: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-16 HPA-16(a+b-) 16a/16a high lacks HPA-16b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-17 HPA-17(a+b-) 17a/17a high lacks HPA-17b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-18 HPA-18(a+b-) 18a/18a high lacks HPA-18b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-19 HPA-19(a+b-) 19a/19a high lacks HPA-19b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-20 HPA-20(a+b-) 20a/20a high lacks HPA-20b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-21 HPA-21(a+b-) 21a/21a high lacks HPA-21b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-22 HPA-22(a+b-) 22a/22a high lacks HPA-22b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-23 HPA-23(a+b-) 23a/23a high lacks HPA-23b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-24 HPA-24(a+b-) 24a/24a high lacks HPA-24b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-25 HPA-25(a+b-) 25a/25a high lacks HPA-25b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-26 HPA-26(a+b-) 26a/26a high lacks HPA-26b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-27 HPA-27(a+b-) 27a/27a high lacks HPA-27b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-28 HPA-28(a+b-) 28a/28a high lacks HPA-28b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-29 HPA-29(a+b-) 29a/29a high lacks HPA-29b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-30 HPA-30(a+b-) 30a/30a high lacks HPA-30b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-31 HPA-31(a+b-) 31a/31a high lacks HPA-31b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-32 HPA-32(a+b-) 32a/32a high lacks HPA-32b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-33 HPA-33(a+b-) 33a/33a high lacks HPA-33b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-34 HPA-34(a+b-) 34a/34a high lacks HPA-34b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-35 HPA-35(a+b-) 35a/35a high lacks HPA-35b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HNA-1 HNA-1(a-b+c-) FCGR3B*02/FCGR3B*02 low FCGR3B c.194A>G (x0) does not match the other FCGR3B markers; lacks HNA-1a, HNA-1c: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI); FCGR3B and FCGR3A are near copies and the FCGR3B copy number varies (none to four or more): short reads can misplace these calls, the copies are not counted, and HNA-1null (no FCGR3B) is not assessed +HNA-3 HNA-3(a-b+) 3b/3b high lacks HNA-3a: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) +HNA-4 HNA-4(a+b-) 4a/4a high lacks HNA-4b: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) +HNA-5 HNA-5(a+b-) 5a/5a high lacks HNA-5b: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) diff --git a/tests/parity/golden/bloodtype/rhd-hybrid/t.tsv b/tests/parity/golden/bloodtype/rhd-hybrid/t.tsv new file mode 100644 index 000000000..2d90e0a4a --- /dev/null +++ b/tests/parity/golden/bloodtype/rhd-hybrid/t.tsv @@ -0,0 +1,56 @@ +system phenotype genotype confidence note +ABO O O.01/O.01 high ABO alleles outside these five variants (weak A and B subgroups, cis-AB, O alleles other than O.01 and O.02) are not assessed +RhD not determined RHD/RHD (RHD copies by read depth 1.60) not determined RHD exons 3, 4, 5, 6, 7 without RHD reads while the gene has 1.60 copies: the pattern of an RHD-RHCE hybrid gene (such as RHD*03N.01) or a partial deletion. Copies per exon: exon 1 1.60, exon 2 1.60, exon 3 0.00, exon 4 0.00, exon 5 0.00, exon 6 0.00, exon 7 0.00, exon 8 1.60, exon 9 1.60, exon 10 1.60 +RhCE C-c+ E-e+ c/c e/e low RHCE exon 2 of a C allele is RHD-like: short reads can place it on RHD +Kell K-k+ Kp(a-b+) Js(a-b+) k/k Kpb/Kpb Jsb/Jsb high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Duffy Fy(a+b-) FY*A/FY*A high +Kidd Jk(a+b-) Jka/Jka high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +MNS M-N+ S-s+ N/N s/s low GYPA, GYPB and GYPE are near copies: short reads can misplace these calls +Lutheran Lu(a-b+) Lub/Lub high +Diego Di(a-b+) Dib/Dib high +Dombrock Do(a-b+) Dob/Dob high +Colton Co(a+b-) Coa/Coa high +Vel Vel+ Vel/Vel high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Langereis Lan+ Lan/Lan high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Junior Jr(a+) Jra/Jra high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +H H+ H/H high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Secretor secretor Se/Se high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen; weak secretor alleles (such as FUT2 c.418A>T, also written c.385A>T) and a deletion of the whole FUT2 gene are not assessed +HPA-1 HPA-1(a+b-) 1a/1a high lacks HPA-1b: HPA-1a is the platelet antigen most often behind FNAIT and post-transfusion purpura in white populations: an HPA-1a-negative (HPA-1b/1b) mother can make anti-HPA-1a against an HPA-1a-positive baby; a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-2 HPA-2(a+b-) 2a/2a high lacks HPA-2b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-3 HPA-3(a+b-) 3a/3a high lacks HPA-3b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-4 HPA-4(a+b-) 4a/4a high lacks HPA-4b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-5 HPA-5(a+b-) 5a/5a high lacks HPA-5b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-6 HPA-6(a+b-) 6a/6a high lacks HPA-6b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-7 HPA-7(a+b-) 7a/7a high lacks HPA-7b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-8 HPA-8(a+b-) 8a/8a high lacks HPA-8b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-9 HPA-9(a+b-) 9a/9a high lacks HPA-9b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-10 HPA-10(a+b-) 10a/10a high lacks HPA-10b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-11 HPA-11(a+b-) 11a/11a high lacks HPA-11b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-12 HPA-12(a+b-) 12a/12a high lacks HPA-12b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-13 HPA-13(a+b-) 13a/13a high lacks HPA-13b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-14 HPA-14(a+b-) 14a/14a high lacks HPA-14b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-15 HPA-15(a-b+) 15b/15b high lacks HPA-15a: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-16 HPA-16(a+b-) 16a/16a high lacks HPA-16b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-17 HPA-17(a+b-) 17a/17a high lacks HPA-17b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-18 HPA-18(a+b-) 18a/18a high lacks HPA-18b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-19 HPA-19(a+b-) 19a/19a high lacks HPA-19b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-20 HPA-20(a+b-) 20a/20a high lacks HPA-20b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-21 HPA-21(a+b-) 21a/21a high lacks HPA-21b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-22 HPA-22(a+b-) 22a/22a high lacks HPA-22b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-23 HPA-23(a+b-) 23a/23a high lacks HPA-23b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-24 HPA-24(a+b-) 24a/24a high lacks HPA-24b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-25 HPA-25(a+b-) 25a/25a high lacks HPA-25b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-26 HPA-26(a+b-) 26a/26a high lacks HPA-26b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-27 HPA-27(a+b-) 27a/27a high lacks HPA-27b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-28 HPA-28(a+b-) 28a/28a high lacks HPA-28b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-29 HPA-29(a+b-) 29a/29a high lacks HPA-29b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-30 HPA-30(a+b-) 30a/30a high lacks HPA-30b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-31 HPA-31(a+b-) 31a/31a high lacks HPA-31b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-32 HPA-32(a+b-) 32a/32a high lacks HPA-32b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-33 HPA-33(a+b-) 33a/33a high lacks HPA-33b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-34 HPA-34(a+b-) 34a/34a high lacks HPA-34b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-35 HPA-35(a+b-) 35a/35a high lacks HPA-35b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HNA-1 HNA-1(a-b+c-) FCGR3B*02/FCGR3B*02 low FCGR3B c.194A>G (x0) does not match the other FCGR3B markers; lacks HNA-1a, HNA-1c: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI); FCGR3B and FCGR3A are near copies and the FCGR3B copy number varies (none to four or more): short reads can misplace these calls, the copies are not counted, and HNA-1null (no FCGR3B) is not assessed +HNA-3 HNA-3(a-b+) 3b/3b high lacks HNA-3a: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) +HNA-4 HNA-4(a+b-) 4a/4a high lacks HNA-4b: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) +HNA-5 HNA-5(a+b-) 5a/5a high lacks HNA-5b: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) diff --git a/tests/parity/golden/bloodtype/rhd-low-flank/t.tsv b/tests/parity/golden/bloodtype/rhd-low-flank/t.tsv new file mode 100644 index 000000000..37daa8762 --- /dev/null +++ b/tests/parity/golden/bloodtype/rhd-low-flank/t.tsv @@ -0,0 +1,56 @@ +system phenotype genotype confidence note +ABO O O.01/O.01 high ABO alleles outside these five variants (weak A and B subgroups, cis-AB, O alleles other than O.01 and O.02) are not assessed +RhD not determined . not determined too few reads beside RHD (6.0x) for a copy number (at least 10x) +RhCE C-c+ E-e+ c/c e/e low RHCE exon 2 of a C allele is RHD-like: short reads can place it on RHD +Kell K-k+ Kp(a-b+) Js(a-b+) k/k Kpb/Kpb Jsb/Jsb high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Duffy Fy(a+b-) FY*A/FY*A high +Kidd Jk(a+b-) Jka/Jka high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +MNS M-N+ S-s+ N/N s/s low GYPA, GYPB and GYPE are near copies: short reads can misplace these calls +Lutheran Lu(a-b+) Lub/Lub high +Diego Di(a-b+) Dib/Dib high +Dombrock Do(a-b+) Dob/Dob high +Colton Co(a+b-) Coa/Coa high +Vel Vel+ Vel/Vel high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Langereis Lan+ Lan/Lan high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Junior Jr(a+) Jra/Jra high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +H H+ H/H high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Secretor secretor Se/Se high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen; weak secretor alleles (such as FUT2 c.418A>T, also written c.385A>T) and a deletion of the whole FUT2 gene are not assessed +HPA-1 HPA-1(a+b-) 1a/1a high lacks HPA-1b: HPA-1a is the platelet antigen most often behind FNAIT and post-transfusion purpura in white populations: an HPA-1a-negative (HPA-1b/1b) mother can make anti-HPA-1a against an HPA-1a-positive baby; a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-2 HPA-2(a+b-) 2a/2a high lacks HPA-2b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-3 HPA-3(a+b-) 3a/3a high lacks HPA-3b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-4 HPA-4(a+b-) 4a/4a high lacks HPA-4b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-5 HPA-5(a+b-) 5a/5a high lacks HPA-5b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-6 HPA-6(a+b-) 6a/6a high lacks HPA-6b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-7 HPA-7(a+b-) 7a/7a high lacks HPA-7b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-8 HPA-8(a+b-) 8a/8a high lacks HPA-8b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-9 HPA-9(a+b-) 9a/9a high lacks HPA-9b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-10 HPA-10(a+b-) 10a/10a high lacks HPA-10b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-11 HPA-11(a+b-) 11a/11a high lacks HPA-11b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-12 HPA-12(a+b-) 12a/12a high lacks HPA-12b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-13 HPA-13(a+b-) 13a/13a high lacks HPA-13b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-14 HPA-14(a+b-) 14a/14a high lacks HPA-14b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-15 HPA-15(a-b+) 15b/15b high lacks HPA-15a: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-16 HPA-16(a+b-) 16a/16a high lacks HPA-16b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-17 HPA-17(a+b-) 17a/17a high lacks HPA-17b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-18 HPA-18(a+b-) 18a/18a high lacks HPA-18b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-19 HPA-19(a+b-) 19a/19a high lacks HPA-19b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-20 HPA-20(a+b-) 20a/20a high lacks HPA-20b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-21 HPA-21(a+b-) 21a/21a high lacks HPA-21b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-22 HPA-22(a+b-) 22a/22a high lacks HPA-22b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-23 HPA-23(a+b-) 23a/23a high lacks HPA-23b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-24 HPA-24(a+b-) 24a/24a high lacks HPA-24b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-25 HPA-25(a+b-) 25a/25a high lacks HPA-25b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-26 HPA-26(a+b-) 26a/26a high lacks HPA-26b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-27 HPA-27(a+b-) 27a/27a high lacks HPA-27b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-28 HPA-28(a+b-) 28a/28a high lacks HPA-28b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-29 HPA-29(a+b-) 29a/29a high lacks HPA-29b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-30 HPA-30(a+b-) 30a/30a high lacks HPA-30b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-31 HPA-31(a+b-) 31a/31a high lacks HPA-31b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-32 HPA-32(a+b-) 32a/32a high lacks HPA-32b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-33 HPA-33(a+b-) 33a/33a high lacks HPA-33b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-34 HPA-34(a+b-) 34a/34a high lacks HPA-34b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-35 HPA-35(a+b-) 35a/35a high lacks HPA-35b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HNA-1 HNA-1(a-b+c-) FCGR3B*02/FCGR3B*02 low FCGR3B c.194A>G (x0) does not match the other FCGR3B markers; lacks HNA-1a, HNA-1c: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI); FCGR3B and FCGR3A are near copies and the FCGR3B copy number varies (none to four or more): short reads can misplace these calls, the copies are not counted, and HNA-1null (no FCGR3B) is not assessed +HNA-3 HNA-3(a-b+) 3b/3b high lacks HNA-3a: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) +HNA-4 HNA-4(a+b-) 4a/4a high lacks HNA-4b: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) +HNA-5 HNA-5(a+b-) 5a/5a high lacks HNA-5b: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) diff --git a/tests/parity/golden/bloodtype/rhd-none/t.tsv b/tests/parity/golden/bloodtype/rhd-none/t.tsv new file mode 100644 index 000000000..47f01d6a2 --- /dev/null +++ b/tests/parity/golden/bloodtype/rhd-none/t.tsv @@ -0,0 +1,56 @@ +system phenotype genotype confidence note +ABO O O.01/O.01 high ABO alleles outside these five variants (weak A and B subgroups, cis-AB, O alleles other than O.01 and O.02) are not assessed +RhD D- RHD deleted/RHD deleted (RHD copies by read depth 0.00) high weak and partial D (RHD missense alleles) are not assessed +RhCE C-c+ E-e+ c/c e/e low RHCE exon 2 of a C allele is RHD-like: short reads can place it on RHD +Kell K-k+ Kp(a-b+) Js(a-b+) k/k Kpb/Kpb Jsb/Jsb high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Duffy Fy(a+b-) FY*A/FY*A high +Kidd Jk(a+b-) Jka/Jka high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +MNS M-N+ S-s+ N/N s/s low GYPA, GYPB and GYPE are near copies: short reads can misplace these calls +Lutheran Lu(a-b+) Lub/Lub high +Diego Di(a-b+) Dib/Dib high +Dombrock Do(a-b+) Dob/Dob high +Colton Co(a+b-) Coa/Coa high +Vel Vel+ Vel/Vel high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Langereis Lan+ Lan/Lan high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Junior Jr(a+) Jra/Jra high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +H H+ H/H high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Secretor secretor Se/Se high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen; weak secretor alleles (such as FUT2 c.418A>T, also written c.385A>T) and a deletion of the whole FUT2 gene are not assessed +HPA-1 HPA-1(a+b-) 1a/1a high lacks HPA-1b: HPA-1a is the platelet antigen most often behind FNAIT and post-transfusion purpura in white populations: an HPA-1a-negative (HPA-1b/1b) mother can make anti-HPA-1a against an HPA-1a-positive baby; a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-2 HPA-2(a+b-) 2a/2a high lacks HPA-2b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-3 HPA-3(a+b-) 3a/3a high lacks HPA-3b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-4 HPA-4(a+b-) 4a/4a high lacks HPA-4b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-5 HPA-5(a+b-) 5a/5a high lacks HPA-5b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-6 HPA-6(a+b-) 6a/6a high lacks HPA-6b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-7 HPA-7(a+b-) 7a/7a high lacks HPA-7b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-8 HPA-8(a+b-) 8a/8a high lacks HPA-8b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-9 HPA-9(a+b-) 9a/9a high lacks HPA-9b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-10 HPA-10(a+b-) 10a/10a high lacks HPA-10b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-11 HPA-11(a+b-) 11a/11a high lacks HPA-11b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-12 HPA-12(a+b-) 12a/12a high lacks HPA-12b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-13 HPA-13(a+b-) 13a/13a high lacks HPA-13b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-14 HPA-14(a+b-) 14a/14a high lacks HPA-14b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-15 HPA-15(a-b+) 15b/15b high lacks HPA-15a: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-16 HPA-16(a+b-) 16a/16a high lacks HPA-16b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-17 HPA-17(a+b-) 17a/17a high lacks HPA-17b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-18 HPA-18(a+b-) 18a/18a high lacks HPA-18b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-19 HPA-19(a+b-) 19a/19a high lacks HPA-19b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-20 HPA-20(a+b-) 20a/20a high lacks HPA-20b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-21 HPA-21(a+b-) 21a/21a high lacks HPA-21b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-22 HPA-22(a+b-) 22a/22a high lacks HPA-22b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-23 HPA-23(a+b-) 23a/23a high lacks HPA-23b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-24 HPA-24(a+b-) 24a/24a high lacks HPA-24b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-25 HPA-25(a+b-) 25a/25a high lacks HPA-25b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-26 HPA-26(a+b-) 26a/26a high lacks HPA-26b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-27 HPA-27(a+b-) 27a/27a high lacks HPA-27b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-28 HPA-28(a+b-) 28a/28a high lacks HPA-28b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-29 HPA-29(a+b-) 29a/29a high lacks HPA-29b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-30 HPA-30(a+b-) 30a/30a high lacks HPA-30b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-31 HPA-31(a+b-) 31a/31a high lacks HPA-31b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-32 HPA-32(a+b-) 32a/32a high lacks HPA-32b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-33 HPA-33(a+b-) 33a/33a high lacks HPA-33b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-34 HPA-34(a+b-) 34a/34a high lacks HPA-34b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-35 HPA-35(a+b-) 35a/35a high lacks HPA-35b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HNA-1 HNA-1(a-b+c-) FCGR3B*02/FCGR3B*02 low FCGR3B c.194A>G (x0) does not match the other FCGR3B markers; lacks HNA-1a, HNA-1c: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI); FCGR3B and FCGR3A are near copies and the FCGR3B copy number varies (none to four or more): short reads can misplace these calls, the copies are not counted, and HNA-1null (no FCGR3B) is not assessed +HNA-3 HNA-3(a-b+) 3b/3b high lacks HNA-3a: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) +HNA-4 HNA-4(a+b-) 4a/4a high lacks HNA-4b: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) +HNA-5 HNA-5(a+b-) 5a/5a high lacks HNA-5b: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) diff --git a/tests/parity/golden/bloodtype/rhd-one/t.tsv b/tests/parity/golden/bloodtype/rhd-one/t.tsv new file mode 100644 index 000000000..6f7f8fe36 --- /dev/null +++ b/tests/parity/golden/bloodtype/rhd-one/t.tsv @@ -0,0 +1,56 @@ +system phenotype genotype confidence note +ABO O O.01/O.01 high ABO alleles outside these five variants (weak A and B subgroups, cis-AB, O alleles other than O.01 and O.02) are not assessed +RhD D+ RHD/RHD deleted (RHD copies by read depth 1.00) high weak and partial D (RHD missense alleles) are not assessed; an RHD gene that is there reads D+: RHD null alleles other than RHD*08N.01, RHD-CE-D hybrids that keep exons 3 to 7, and DEL alleles are not assessed +RhCE C-c+ E-e+ c/c e/e low RHCE exon 2 of a C allele is RHD-like: short reads can place it on RHD +Kell K-k+ Kp(a-b+) Js(a-b+) k/k Kpb/Kpb Jsb/Jsb high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Duffy Fy(a+b-) FY*A/FY*A high +Kidd Jk(a+b-) Jka/Jka high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +MNS M-N+ S-s+ N/N s/s low GYPA, GYPB and GYPE are near copies: short reads can misplace these calls +Lutheran Lu(a-b+) Lub/Lub high +Diego Di(a-b+) Dib/Dib high +Dombrock Do(a-b+) Dob/Dob high +Colton Co(a+b-) Coa/Coa high +Vel Vel+ Vel/Vel high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Langereis Lan+ Lan/Lan high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Junior Jr(a+) Jra/Jra high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +H H+ H/H high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Secretor secretor Se/Se high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen; weak secretor alleles (such as FUT2 c.418A>T, also written c.385A>T) and a deletion of the whole FUT2 gene are not assessed +HPA-1 HPA-1(a+b-) 1a/1a high lacks HPA-1b: HPA-1a is the platelet antigen most often behind FNAIT and post-transfusion purpura in white populations: an HPA-1a-negative (HPA-1b/1b) mother can make anti-HPA-1a against an HPA-1a-positive baby; a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-2 HPA-2(a+b-) 2a/2a high lacks HPA-2b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-3 HPA-3(a+b-) 3a/3a high lacks HPA-3b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-4 HPA-4(a+b-) 4a/4a high lacks HPA-4b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-5 HPA-5(a+b-) 5a/5a high lacks HPA-5b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-6 HPA-6(a+b-) 6a/6a high lacks HPA-6b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-7 HPA-7(a+b-) 7a/7a high lacks HPA-7b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-8 HPA-8(a+b-) 8a/8a high lacks HPA-8b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-9 HPA-9(a+b-) 9a/9a high lacks HPA-9b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-10 HPA-10(a+b-) 10a/10a high lacks HPA-10b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-11 HPA-11(a+b-) 11a/11a high lacks HPA-11b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-12 HPA-12(a+b-) 12a/12a high lacks HPA-12b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-13 HPA-13(a+b-) 13a/13a high lacks HPA-13b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-14 HPA-14(a+b-) 14a/14a high lacks HPA-14b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-15 HPA-15(a-b+) 15b/15b high lacks HPA-15a: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-16 HPA-16(a+b-) 16a/16a high lacks HPA-16b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-17 HPA-17(a+b-) 17a/17a high lacks HPA-17b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-18 HPA-18(a+b-) 18a/18a high lacks HPA-18b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-19 HPA-19(a+b-) 19a/19a high lacks HPA-19b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-20 HPA-20(a+b-) 20a/20a high lacks HPA-20b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-21 HPA-21(a+b-) 21a/21a high lacks HPA-21b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-22 HPA-22(a+b-) 22a/22a high lacks HPA-22b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-23 HPA-23(a+b-) 23a/23a high lacks HPA-23b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-24 HPA-24(a+b-) 24a/24a high lacks HPA-24b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-25 HPA-25(a+b-) 25a/25a high lacks HPA-25b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-26 HPA-26(a+b-) 26a/26a high lacks HPA-26b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-27 HPA-27(a+b-) 27a/27a high lacks HPA-27b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-28 HPA-28(a+b-) 28a/28a high lacks HPA-28b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-29 HPA-29(a+b-) 29a/29a high lacks HPA-29b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-30 HPA-30(a+b-) 30a/30a high lacks HPA-30b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-31 HPA-31(a+b-) 31a/31a high lacks HPA-31b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-32 HPA-32(a+b-) 32a/32a high lacks HPA-32b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-33 HPA-33(a+b-) 33a/33a high lacks HPA-33b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-34 HPA-34(a+b-) 34a/34a high lacks HPA-34b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-35 HPA-35(a+b-) 35a/35a high lacks HPA-35b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HNA-1 HNA-1(a-b+c-) FCGR3B*02/FCGR3B*02 low FCGR3B c.194A>G (x0) does not match the other FCGR3B markers; lacks HNA-1a, HNA-1c: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI); FCGR3B and FCGR3A are near copies and the FCGR3B copy number varies (none to four or more): short reads can misplace these calls, the copies are not counted, and HNA-1null (no FCGR3B) is not assessed +HNA-3 HNA-3(a-b+) 3b/3b high lacks HNA-3a: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) +HNA-4 HNA-4(a+b-) 4a/4a high lacks HNA-4b: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) +HNA-5 HNA-5(a+b-) 5a/5a high lacks HNA-5b: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) diff --git a/tests/parity/golden/bloodtype/rhd-three/t.tsv b/tests/parity/golden/bloodtype/rhd-three/t.tsv new file mode 100644 index 000000000..d1c427e75 --- /dev/null +++ b/tests/parity/golden/bloodtype/rhd-three/t.tsv @@ -0,0 +1,56 @@ +system phenotype genotype confidence note +ABO O O.01/O.01 high ABO alleles outside these five variants (weak A and B subgroups, cis-AB, O alleles other than O.01 and O.02) are not assessed +RhD D+ RHD/RHD (RHD copies by read depth 3.10) high read depth gives 3.10 RHD copies, more than two; weak and partial D (RHD missense alleles) are not assessed; an RHD gene that is there reads D+: RHD null alleles other than RHD*08N.01, RHD-CE-D hybrids that keep exons 3 to 7, and DEL alleles are not assessed +RhCE C-c+ E-e+ c/c e/e low RHCE exon 2 of a C allele is RHD-like: short reads can place it on RHD +Kell K-k+ Kp(a-b+) Js(a-b+) k/k Kpb/Kpb Jsb/Jsb high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Duffy Fy(a+b-) FY*A/FY*A high +Kidd Jk(a+b-) Jka/Jka high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +MNS M-N+ S-s+ N/N s/s low GYPA, GYPB and GYPE are near copies: short reads can misplace these calls +Lutheran Lu(a-b+) Lub/Lub high +Diego Di(a-b+) Dib/Dib high +Dombrock Do(a-b+) Dob/Dob high +Colton Co(a+b-) Coa/Coa high +Vel Vel+ Vel/Vel high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Langereis Lan+ Lan/Lan high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Junior Jr(a+) Jra/Jra high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +H H+ H/H high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Secretor secretor Se/Se high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen; weak secretor alleles (such as FUT2 c.418A>T, also written c.385A>T) and a deletion of the whole FUT2 gene are not assessed +HPA-1 HPA-1(a+b-) 1a/1a high lacks HPA-1b: HPA-1a is the platelet antigen most often behind FNAIT and post-transfusion purpura in white populations: an HPA-1a-negative (HPA-1b/1b) mother can make anti-HPA-1a against an HPA-1a-positive baby; a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-2 HPA-2(a+b-) 2a/2a high lacks HPA-2b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-3 HPA-3(a+b-) 3a/3a high lacks HPA-3b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-4 HPA-4(a+b-) 4a/4a high lacks HPA-4b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-5 HPA-5(a+b-) 5a/5a high lacks HPA-5b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-6 HPA-6(a+b-) 6a/6a high lacks HPA-6b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-7 HPA-7(a+b-) 7a/7a high lacks HPA-7b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-8 HPA-8(a+b-) 8a/8a high lacks HPA-8b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-9 HPA-9(a+b-) 9a/9a high lacks HPA-9b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-10 HPA-10(a+b-) 10a/10a high lacks HPA-10b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-11 HPA-11(a+b-) 11a/11a high lacks HPA-11b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-12 HPA-12(a+b-) 12a/12a high lacks HPA-12b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-13 HPA-13(a+b-) 13a/13a high lacks HPA-13b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-14 HPA-14(a+b-) 14a/14a high lacks HPA-14b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-15 HPA-15(a-b+) 15b/15b high lacks HPA-15a: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-16 HPA-16(a+b-) 16a/16a high lacks HPA-16b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-17 HPA-17(a+b-) 17a/17a high lacks HPA-17b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-18 HPA-18(a+b-) 18a/18a high lacks HPA-18b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-19 HPA-19(a+b-) 19a/19a high lacks HPA-19b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-20 HPA-20(a+b-) 20a/20a high lacks HPA-20b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-21 HPA-21(a+b-) 21a/21a high lacks HPA-21b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-22 HPA-22(a+b-) 22a/22a high lacks HPA-22b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-23 HPA-23(a+b-) 23a/23a high lacks HPA-23b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-24 HPA-24(a+b-) 24a/24a high lacks HPA-24b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-25 HPA-25(a+b-) 25a/25a high lacks HPA-25b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-26 HPA-26(a+b-) 26a/26a high lacks HPA-26b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-27 HPA-27(a+b-) 27a/27a high lacks HPA-27b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-28 HPA-28(a+b-) 28a/28a high lacks HPA-28b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-29 HPA-29(a+b-) 29a/29a high lacks HPA-29b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-30 HPA-30(a+b-) 30a/30a high lacks HPA-30b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-31 HPA-31(a+b-) 31a/31a high lacks HPA-31b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-32 HPA-32(a+b-) 32a/32a high lacks HPA-32b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-33 HPA-33(a+b-) 33a/33a high lacks HPA-33b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-34 HPA-34(a+b-) 34a/34a high lacks HPA-34b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-35 HPA-35(a+b-) 35a/35a high lacks HPA-35b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HNA-1 HNA-1(a-b+c-) FCGR3B*02/FCGR3B*02 low FCGR3B c.194A>G (x0) does not match the other FCGR3B markers; lacks HNA-1a, HNA-1c: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI); FCGR3B and FCGR3A are near copies and the FCGR3B copy number varies (none to four or more): short reads can misplace these calls, the copies are not counted, and HNA-1null (no FCGR3B) is not assessed +HNA-3 HNA-3(a-b+) 3b/3b high lacks HNA-3a: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) +HNA-4 HNA-4(a+b-) 4a/4a high lacks HNA-4b: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) +HNA-5 HNA-5(a+b-) 5a/5a high lacks HNA-5b: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) diff --git a/tests/parity/golden/bloodtype/vcf-quirks/t.tsv b/tests/parity/golden/bloodtype/vcf-quirks/t.tsv new file mode 100644 index 000000000..d9d9298fb --- /dev/null +++ b/tests/parity/golden/bloodtype/vcf-quirks/t.tsv @@ -0,0 +1,56 @@ +system phenotype genotype confidence note +Kell K-k- Kp(a-b-) Js(a-b-) null/null low two null copies: no Kell antigen on the red cells (Ku-); null allele: KEL c.223+1G>C, c.223+1G>A, c.223+1G>T x2; each null copy is placed with k, Kpb, Jsb first, the alleles the ISBT table finds it with (phase is not read); KEL c.578C>T: another allele at this position (G>C,A, genotype 1/2); lacks k, Kpb, Jsb, Ku, carried by most people (high prevalence) +ABO O O.01/O.01 high ABO alleles outside these five variants (weak A and B subgroups, cis-AB, O alleles other than O.01 and O.02) are not assessed +RhD D+ RHD/RHD (RHD copies by read depth 2.00) high weak and partial D (RHD missense alleles) are not assessed; an RHD gene that is there reads D+: RHD null alleles other than RHD*08N.01, RHD-CE-D hybrids that keep exons 3 to 7, and DEL alleles are not assessed +RhCE C-c+ E-e+ c/c e/e low RHCE exon 2 of a C allele is RHD-like: short reads can place it on RHD +Duffy Fy(a+b-) FY*A/FY*A high +Kidd not determined . not determined SLC14A1 c.838G>A: no call (FILTER LowQual) +MNS M-N+ S-s+ N/N s/s low GYPA, GYPB and GYPE are near copies: short reads can misplace these calls +Lutheran not determined . not determined BCAM c.230G>A: no call (genotype ./.) +Diego not determined . not determined SLC4A1 c.2561C>T: no call (genotype 1) +Dombrock Do(a+b+) Doa/Dob high +Colton not determined . not determined AQP1 c.134C>T: no call (genotype .) +Vel Vel+ Vel/Vel high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Langereis Lan+ Lan/Lan high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Junior Jr(a+) Jra/Jra high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +H H+ H/H high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen +Secretor secretor Se/Se high a null allele the table does not hold (one of two or more variants, or a large deletion) goes unseen; weak secretor alleles (such as FUT2 c.418A>T, also written c.385A>T) and a deletion of the whole FUT2 gene are not assessed +HPA-1 not determined . not determined ITGB3 c.176T>C: no call (genotype .) +HPA-2 HPA-2(a+b-) 2a/2a high lacks HPA-2b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-3 HPA-3(a+b-) 3a/3a high lacks HPA-3b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-4 HPA-4(a+b-) 4a/4a high lacks HPA-4b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-5 HPA-5(a+b-) 5a/5a high lacks HPA-5b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-6 HPA-6(a+b-) 6a/6a high lacks HPA-6b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-7 HPA-7(a+b-) 7a/7a high lacks HPA-7b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-8 HPA-8(a+b-) 8a/8a high lacks HPA-8b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-9 HPA-9(a+b-) 9a/9a high lacks HPA-9b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-10 HPA-10(a+b-) 10a/10a high lacks HPA-10b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-11 HPA-11(a+b-) 11a/11a high lacks HPA-11b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-12 HPA-12(a+b-) 12a/12a high lacks HPA-12b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-13 HPA-13(a+b-) 13a/13a high lacks HPA-13b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-14 HPA-14(a+b-) 14a/14a high lacks HPA-14b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-15 HPA-15(a-b+) 15b/15b high lacks HPA-15a: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-16 HPA-16(a+b-) 16a/16a high lacks HPA-16b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-17 HPA-17(a+b-) 17a/17a high lacks HPA-17b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-18 HPA-18(a+b-) 18a/18a high lacks HPA-18b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-19 HPA-19(a+b-) 19a/19a high lacks HPA-19b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-20 HPA-20(a+b-) 20a/20a high lacks HPA-20b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-21 HPA-21(a+b-) 21a/21a high lacks HPA-21b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-22 HPA-22(a+b-) 22a/22a high lacks HPA-22b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-23 HPA-23(a+b-) 23a/23a high lacks HPA-23b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-24 HPA-24(a+b-) 24a/24a high lacks HPA-24b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-25 HPA-25(a+b-) 25a/25a high lacks HPA-25b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-26 HPA-26(a+b-) 26a/26a high lacks HPA-26b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-27 HPA-27(a+b-) 27a/27a high lacks HPA-27b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-28 HPA-28(a+b-) 28a/28a high lacks HPA-28b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-29 HPA-29(a+b-) 29a/29a high lacks HPA-29b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-30 HPA-30(a+b-) 30a/30a high lacks HPA-30b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-31 HPA-31(a+b-) 31a/31a high lacks HPA-31b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-32 HPA-32(a+b-) 32a/32a high lacks HPA-32b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-33 HPA-33(a+b-) 33a/33a high lacks HPA-33b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-34 HPA-34(a+b-) 34a/34a high lacks HPA-34b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HPA-35 HPA-35(a+b-) 35a/35a high lacks HPA-35b: a platelet antigen a person lacks can raise antibodies in a pregnancy (against the baby's platelets: fetal and neonatal alloimmune thrombocytopenia, FNAIT) or after a transfusion (post-transfusion purpura, refractoriness to platelet transfusions) +HNA-1 HNA-1(a-b+c-) FCGR3B*02/FCGR3B*02 low FCGR3B c.194A>G (x0) does not match the other FCGR3B markers; lacks HNA-1a, HNA-1c: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI); FCGR3B and FCGR3A are near copies and the FCGR3B copy number varies (none to four or more): short reads can misplace these calls, the copies are not counted, and HNA-1null (no FCGR3B) is not assessed +HNA-3 HNA-3(a-b+) 3b/3b high lacks HNA-3a: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) +HNA-4 HNA-4(a+b-) 4a/4a high lacks HNA-4b: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) +HNA-5 HNA-5(a+b-) 5a/5a high lacks HNA-5b: a neutrophil antigen a person lacks can raise antibodies in a pregnancy or after a transfusion; such antibodies cause neonatal alloimmune neutropenia and transfusion-related acute lung injury (TRALI) diff --git a/tests/parity/golden/summary-collect/all-bad/all-bad.json b/tests/parity/golden/summary-collect/all-bad/all-bad.json index 24bc28580..13c65ca8c 100644 --- a/tests/parity/golden/summary-collect/all-bad/all-bad.json +++ b/tests/parity/golden/summary-collect/all-bad/all-bad.json @@ -1,759 +1,768 @@ { - "schema_version": 2, - "sample": "S", - "generated_utc": "2026-11-15 00:19 UTC", - "run": { - "status_file": false, - "started_utc": null, - "declared_sex": null - }, - "databases": { - "clinvar_release": null, - "cpsr_clinvar_release": null, - "hla_database": null - }, - "manifest": [], - "sections": { - "coverage": { - "title": "Coverage (mosdepth)", - "step": "16b", - "state": "unreadable", - "source": null, - "file_date": null, - "note": "ValueError: could not convert string to float: 'abc'", - "data": {} - }, - "callability": { - "title": "Gene callability (mosdepth)", - "step": "16b", - "state": "unreadable", - "source": null, - "file_date": null, - "note": "S_callability.bed.gz is not mosdepth's thresholds table of one depth", - "data": {} - }, - "sex_check": { - "title": "Sex check (indexcov)", - "step": "16", - "state": "unreadable", - "source": null, - "file_date": null, - "note": "indexcov-indexcov.ped has no sex column or no sample row", - "data": {} - }, - "sample_qc": { - "title": "Sample identity and contamination (somalier, VerifyBamID2)", - "step": "33", - "state": "unreadable", - "source": null, - "file_date": null, - "note": "S_sample_qc.tsv has no inferred_sex row", - "data": {} - }, - "mosaic_sex_loss": { - "title": "Mosaic loss of chromosome Y or X", - "step": "33", - "state": "unreadable", - "source": null, - "file_date": null, - "note": "S_sample_qc.tsv has no mosaic_call row (detected, not_detected, gain, not_estimated)", - "data": {} - }, - "read_count": { - "title": "Reads kept by alignment", - "step": "02", - "state": "unreadable", - "source": null, - "file_date": null, - "note": "S_read_count.tsv has no whole number for input_reads", - "data": {} - }, - "variants": { - "title": "Variant calling", - "step": "03", - "state": "unreadable", - "source": null, - "file_date": null, - "note": "S.vcf.gz: Compressed file ended before the end-of-stream marker was reached", - "data": {} - }, - "clinvar": { - "title": "ClinVar screen", - "step": "06", - "state": "unreadable", - "source": null, - "file_date": null, - "note": "ValueError: invalid literal for int() with base 10: 'x'", - "data": {} - }, - "couple": { - "title": "Couple carrier screen", - "step": "39", - "state": "unreadable", - "source": null, - "file_date": null, - "note": "S_couple_carrier.tsv line 2 is not a row of S's couple table", - "data": {} - }, - "carrier": { - "title": "Carrier list", - "step": "06", - "state": "unreadable", - "source": null, - "file_date": null, - "note": "ValueError: invalid literal for int() with base 10: 'x'", - "data": {} - }, - "pharmcat": { - "title": "PharmCAT", - "step": "07", - "state": "unreadable", - "source": null, - "file_date": null, - "note": "S.report.json: Expecting value: line 1 column 21 (char 20)", - "data": {} - }, - "cpic": { - "title": "CPIC drug-gene recommendations", - "step": "27", - "state": "ok", - "source": "cpic/S_phenotypes.tsv", - "file_date": "2021-03-04 05:06 UTC", - "note": null, - "data": { - "genes": [], - "non_normal": 0, - "ambiguous": 0, - "not_called": 0, - "unclassified": 0, - "parse_failed": true, - "warnings": [] - } - }, - "pypgx": { - "title": "pypgx", - "step": "32", - "state": "unreadable", - "source": null, - "file_date": null, - "note": "KeyError: 'Gene'", - "data": {} - }, - "cyrius": { - "title": "Cyrius (CYP2D6)", - "step": "21", - "state": "ok", - "source": "cyrius/S_cyp2d6.tsv", - "file_date": "2021-03-04 05:06 UTC", - "note": null, - "data": { - "genotype": "none", - "filter": "" - } - }, - "parascopy": { - "title": "SMN1/SMN2 copy number (Parascopy, short reads)", - "step": "35", - "state": "unreadable", - "source": null, - "file_date": null, - "note": "S_smn_copy_number.tsv lacks the chrom, start, end, agCN, agCN_filter, agCN_qual, psCN, psCN_qual or psCN_filter column", - "data": {} - }, - "paralogs": { - "title": "Paralog genes (Paraphase, PacBio HiFi)", - "step": "35b", - "state": "unreadable", - "source": null, - "file_date": null, - "note": "S_paraphase_copy_number.tsv lacks the region, gene, copy_number or status column", - "data": {} - }, - "hla": { - "title": "HLA typing (T1K)", - "step": "08", - "state": "ok", - "source": "hla_t1k/S_hla_genotype.tsv", - "file_date": "2021-03-04 05:06 UTC", - "note": null, - "data": { - "loci": [ - { - "gene": "HLA-A", - "alleles": [ - "A*02:01" - ], - "quality": [ - "x" - ], - "low_confidence": true, - "withheld_from_pharmcat": true, - "candidates": [ - 1 - ], - "one_allele_type": false - } - ], - "derived": { - "coeliac": { - "status": "not_determined", - "reason": "HLA-DQA1 not typed; HLA-DQB1 not typed", - "dq2_5": null, - "dq2_5_phase": null, - "dq2_2": null, - "dq8": null, - "dqb1_02_dose": null - }, - "alleles": [ - { - "allele": "A*31:01", - "kind": "drug", - "association": "carbamazepine hypersensitivity reactions in Europeans", - "pmids": "21428769", - "citation": "McCormack 2011, N Engl J Med", - "state": "not_determined", - "reason": "HLA-A low confidence" - }, - { - "allele": "B*15:02", - "kind": "drug", - "association": "carbamazepine Stevens-Johnson syndrome in Han Chinese", - "pmids": "15057820", - "citation": "Chung 2004, Nature", - "state": "not_determined", - "reason": "HLA-B not typed" - }, - { - "allele": "B*57:01", - "kind": "drug", - "association": "abacavir hypersensitivity; flucloxacillin liver injury", - "pmids": "18256392,19483685", - "citation": "Mallal 2008, N Engl J Med; Daly 2009, Nat Genet", - "state": "not_determined", - "reason": "HLA-B not typed" - }, - { - "allele": "B*58:01", - "kind": "drug", - "association": "allopurinol severe skin reactions", - "pmids": "15743917", - "citation": "Hung 2005, Proc Natl Acad Sci U S A", - "state": "not_determined", - "reason": "HLA-B not typed" - }, - { - "allele": "B*27", - "kind": "disease", - "association": "ankylosing spondylitis", - "pmids": "4123836,4688372", - "citation": "Brewerton 1973, Lancet; Schlosstein 1973, N Engl J Med", - "state": "not_determined", - "reason": "HLA-B not typed" - }, - { - "allele": "C*06:02", - "kind": "disease", - "association": "psoriasis", - "pmids": "16642438", - "citation": "Nair 2006, Am J Hum Genet", - "state": "not_determined", - "reason": "HLA-C not typed" - }, - { - "allele": "DQB1*06:02", - "kind": "disease", - "association": "narcolepsy with cataplexy", - "pmids": "11179016", - "citation": "Mignot 2001, Am J Hum Genet", - "state": "not_determined", - "reason": "HLA-DQB1 not typed" - }, - { - "allele": "DRB1*15:01", - "kind": "disease", - "association": "multiple sclerosis", - "pmids": "12557126", - "citation": "Barcellos 2003, Am J Hum Genet", - "state": "not_determined", - "reason": "HLA-DRB1 not typed" - }, - { - "allele": "DRB1*01:01", - "kind": "disease", - "association": "rheumatoid arthritis, shared epitope allele", - "pmids": "2446635", - "citation": "Gregersen 1987, Arthritis Rheum", - "state": "not_determined", - "reason": "HLA-DRB1 not typed" - }, - { - "allele": "DRB1*04:01", - "kind": "disease", - "association": "rheumatoid arthritis, shared epitope allele", - "pmids": "2446635", - "citation": "Gregersen 1987, Arthritis Rheum", - "state": "not_determined", - "reason": "HLA-DRB1 not typed" - }, - { - "allele": "DRB1*04:04", - "kind": "disease", - "association": "rheumatoid arthritis, shared epitope allele", - "pmids": "2446635", - "citation": "Gregersen 1987, Arthritis Rheum", - "state": "not_determined", - "reason": "HLA-DRB1 not typed" - }, - { - "allele": "DRB1*04:05", - "kind": "disease", - "association": "rheumatoid arthritis, shared epitope allele", - "pmids": "2446635", - "citation": "Gregersen 1987, Arthritis Rheum", - "state": "not_determined", - "reason": "HLA-DRB1 not typed" - }, - { - "allele": "DRB1*04:08", - "kind": "disease", - "association": "rheumatoid arthritis, shared epitope allele", - "pmids": "2446635", - "citation": "Gregersen 1987, Arthritis Rheum", - "state": "not_determined", - "reason": "HLA-DRB1 not typed" - }, - { - "allele": "DRB1*14:02", - "kind": "disease", - "association": "rheumatoid arthritis, shared epitope allele", - "pmids": "2446635", - "citation": "Gregersen 1987, Arthritis Rheum", - "state": "not_determined", - "reason": "HLA-DRB1 not typed" - } - ] - } - } - }, - "prs": { - "title": "Polygenic risk scores", - "step": "25", - "state": "missing", - "source": null, - "file_date": null, - "note": null, - "data": {} - }, - "ancestry_fine": { - "title": "Fine-grained ancestry (ADMIXTURE, RFMix)", - "step": "26b", - "state": "unreadable", - "source": null, - "file_date": null, - "note": "S_ancestry_fine.tsv has no rows or lacks a column of ['code', 'fraction', 'group', 'high', 'level', 'low', 'se']", - "data": {} - }, - "manta": { - "title": "Structural variants (Manta)", - "step": "04", - "state": "missing", - "source": null, - "file_date": null, - "note": null, - "data": {} - }, - "delly": { - "title": "Structural variants (Delly)", - "step": "19", - "state": "missing", - "source": null, - "file_date": null, - "note": null, - "data": {} - }, - "cnvpytor": { - "title": "Copy number (CNVpytor)", - "step": "18", - "state": "missing", - "source": null, - "file_date": null, - "note": null, - "data": {} - }, - "sv_consensus": { - "title": "SV consensus merge", - "step": "22", - "state": "missing", - "source": null, - "file_date": null, - "note": null, - "data": {} - }, - "annotsv": { - "title": "Structural variants, class 4 and 5 (AnnotSV)", - "step": "05", - "state": "unreadable", - "source": null, - "file_date": null, - "note": "S_sv_class4_5_checked.tsv lacks a column of ['ACMG_class', 'Caller', 'Common', 'Exon_edge', 'Population_AF', 'SV_chrom', 'SV_end', 'SV_start', 'SV_type']", - "data": {} - }, - "expansions": { - "title": "Repeat expansions (ExpansionHunter)", - "step": "09", - "state": "ok", - "source": "expansion_hunter/S_eh.vcf", - "file_date": "2021-03-04 05:06 UTC", - "note": null, - "data": { - "records": 2, - "key_loci": [ - { - "locus": "HTT", - "repeat_count": "not in output" - }, - { - "locus": "FMR1", - "repeat_count": "not in output" - }, - { - "locus": "C9ORF72", - "repeat_count": "not in output" - }, - { - "locus": "ATXN1", - "repeat_count": "not in output" - }, - { - "locus": "DMPK", - "repeat_count": "not in output" - } - ], - "loci": [ - { - "locus": "CFTR_T", - "repeat_count": "7/9", - "status": "", - "normal_max": "", - "pathologic_min": "", - "support": "SPANNING/SPANNING", - "adsp": "8/9", - "ci": "7-7/9-9", - "sizing": "sized", - "allele_sizing": "sized/sized", - "zone": "", - "zone_label": "", - "zone_citation": "" - }, - { - "locus": "CFTR_TG", - "repeat_count": "11/12", - "status": "", - "normal_max": "", - "pathologic_min": "", - "support": "SPANNING/FLANKING", - "adsp": "8/0", - "ci": "11-11/12-12", - "sizing": "flanking_only", - "allele_sizing": "sized/flanking_only", - "zone": "", - "zone_label": "", - "zone_citation": "" - } - ], - "stranger": false, - "stranger_outdated": false, - "unsized": [ - "CFTR_TG" - ], - "intermediate": [], - "readings": [ - { - "locus": "CFTR", - "repeat": "intron 9 (legacy IVS8) TG and poly-T tract", - "source": "Deignan et al. 2020, PMID 32404922", - "status": "not_sized", - "genotype": ".", - "phase": ".", - "reading": "ExpansionHunter did not size both tracts (TG 11/12, flanking_only; poly-T 7/9, sized): not read." - }, - { - "locus": "UGT1A1", - "repeat": "promoter TA repeat", - "source": "Gammal et al. 2016, PMID 26417955", - "status": "not_sized", - "genotype": ".", - "pharmcat": ".", - "agreement": "not_compared", - "reading": "not in step 09's output: STR_EXTRA_LOCI=yes ./scripts/setup.sh --strchive-data adds the repeat to the catalog (docs/09-str-expansions.md). PharmCAT (step 7) still reads UGT1A1 *28." - }, - { - "locus": "SLC6A4", - "repeat": "5-HTTLPR promoter length polymorphism", - "status": "not_tested", - "genotype": ".", - "reading": "not tested by any step. CPIC's 2023 SSRI guideline (Bousman et al. 2023, PMID 37032427) found that the data on SLC6A4 do not support its use in antidepressant prescribing, so a result would carry no recommendation.", - "source": "Bousman et al. 2023, PMID 37032427" - } - ] - } - }, - "telomere": { - "title": "Telomere content (TelomereHunter)", - "step": "10", - "state": "ok", - "source": "telomere/S/S_summary.tsv", - "file_date": "2021-03-04 05:06 UTC", - "note": null, - "data": { - "tel_content": "1.5", - "intratelomeric_reads": 40, - "read_check": "depth unknown (no total_reads or read_lengths in the summary): not checked" - } - }, - "roh": { - "title": "Runs of homozygosity", - "step": "11", - "state": "ok", - "source": "vcf/S_roh.txt", - "file_date": "2021-03-04 05:06 UTC", - "note": null, - "data": { - "segments": 0, - "total_mb": 0.0, - "largest_mb": 0.0, - "autosomal_over_5mb": [], - "masked_mb": 0.0, - "sex_chromosome_segments": 0, - "long_mb": 0.0, - "f_roh": null, - "relationship": null, - "upd_flag": null, - "scope": { - "source": "segments_only", - "autosomes": [], - "unmasked_bp": 0, - "partial": true, - "note": "Partial or unverified chromosome scope: no relationship band or UPD flag. F_ROH uses only the listed chromosomes, not callable bases." - } + "schema_version": 2, + "sample": "S", + "generated_utc": "2026-11-19 23:58 UTC", + "run": { + "status_file": false, + "started_utc": null, + "declared_sex": null + }, + "databases": { + "clinvar_release": null, + "cpsr_clinvar_release": null, + "hla_database": null + }, + "manifest": [], + "sections": { + "coverage": { + "title": "Coverage (mosdepth)", + "step": "16b", + "state": "unreadable", + "source": null, + "file_date": null, + "note": "ValueError: could not convert string to float: 'abc'", + "data": {} + }, + "callability": { + "title": "Gene callability (mosdepth)", + "step": "16b", + "state": "unreadable", + "source": null, + "file_date": null, + "note": "S_callability.bed.gz is not mosdepth's thresholds table of one depth", + "data": {} + }, + "sex_check": { + "title": "Sex check (indexcov)", + "step": "16", + "state": "unreadable", + "source": null, + "file_date": null, + "note": "indexcov-indexcov.ped has no sex column or no sample row", + "data": {} + }, + "sample_qc": { + "title": "Sample identity and contamination (somalier, VerifyBamID2)", + "step": "33", + "state": "unreadable", + "source": null, + "file_date": null, + "note": "S_sample_qc.tsv has no inferred_sex row", + "data": {} + }, + "mosaic_sex_loss": { + "title": "Mosaic loss of chromosome Y or X", + "step": "33", + "state": "unreadable", + "source": null, + "file_date": null, + "note": "S_sample_qc.tsv has no mosaic_call row (detected, not_detected, gain, not_estimated)", + "data": {} + }, + "read_count": { + "title": "Reads kept by alignment", + "step": "02", + "state": "unreadable", + "source": null, + "file_date": null, + "note": "S_read_count.tsv has no whole number for input_reads", + "data": {} + }, + "variants": { + "title": "Variant calling", + "step": "03", + "state": "unreadable", + "source": null, + "file_date": null, + "note": "S.vcf.gz: Compressed file ended before the end-of-stream marker was reached", + "data": {} + }, + "clinvar": { + "title": "ClinVar screen", + "step": "06", + "state": "unreadable", + "source": null, + "file_date": null, + "note": "ValueError: invalid literal for int() with base 10: 'x'", + "data": {} + }, + "couple": { + "title": "Couple carrier screen", + "step": "39", + "state": "unreadable", + "source": null, + "file_date": null, + "note": "S_couple_carrier.tsv line 2 is not a row of S's couple table", + "data": {} + }, + "carrier": { + "title": "Carrier list", + "step": "06", + "state": "unreadable", + "source": null, + "file_date": null, + "note": "ValueError: invalid literal for int() with base 10: 'x'", + "data": {} + }, + "acmg_sf": { + "title": "ACMG secondary findings", + "step": "06", + "state": "unreadable", + "source": null, + "file_date": null, + "note": "ValueError: invalid literal for int() with base 10: 'x'", + "data": {} + }, + "pharmcat": { + "title": "PharmCAT", + "step": "07", + "state": "unreadable", + "source": null, + "file_date": null, + "note": "S.report.json: Expecting value: line 1 column 21 (char 20)", + "data": {} + }, + "cpic": { + "title": "CPIC drug-gene recommendations", + "step": "27", + "state": "ok", + "source": "cpic/S_phenotypes.tsv", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "genes": [], + "non_normal": 0, + "ambiguous": 0, + "not_called": 0, + "unclassified": 0, + "parse_failed": true, + "warnings": [] + } + }, + "pypgx": { + "title": "pypgx", + "step": "32", + "state": "unreadable", + "source": null, + "file_date": null, + "note": "KeyError: 'Gene'", + "data": {} + }, + "cyrius": { + "title": "Cyrius (CYP2D6)", + "step": "21", + "state": "ok", + "source": "cyrius/S_cyp2d6.tsv", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "genotype": "none", + "filter": "" + } + }, + "parascopy": { + "title": "SMN1/SMN2 copy number (Parascopy, short reads)", + "step": "35", + "state": "unreadable", + "source": null, + "file_date": null, + "note": "S_smn_copy_number.tsv lacks the chrom, start, end, agCN, agCN_filter, agCN_qual, psCN, psCN_qual or psCN_filter column", + "data": {} + }, + "paralogs": { + "title": "Paralog genes (Paraphase, PacBio HiFi)", + "step": "35b", + "state": "unreadable", + "source": null, + "file_date": null, + "note": "S_paraphase_copy_number.tsv lacks the region, gene, copy_number or status column", + "data": {} + }, + "hla": { + "title": "HLA typing (T1K)", + "step": "08", + "state": "ok", + "source": "hla_t1k/S_hla_genotype.tsv", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "loci": [ + { + "gene": "HLA-A", + "alleles": [ + "A*02:01" + ], + "quality": [ + "x" + ], + "low_confidence": true, + "withheld_from_pharmcat": true, + "candidates": [ + 1 + ], + "one_allele_type": false + } + ], + "derived": { + "coeliac": { + "status": "not_determined", + "reason": "HLA-DQA1 not typed; HLA-DQB1 not typed", + "dq2_5": null, + "dq2_5_phase": null, + "dq2_2": null, + "dq8": null, + "dqb1_02_dose": null + }, + "alleles": [ + { + "allele": "A*31:01", + "kind": "drug", + "association": "carbamazepine hypersensitivity reactions in Europeans", + "pmids": "21428769", + "citation": "McCormack 2011, N Engl J Med", + "state": "not_determined", + "reason": "HLA-A low confidence" + }, + { + "allele": "B*15:02", + "kind": "drug", + "association": "carbamazepine Stevens-Johnson syndrome in Han Chinese", + "pmids": "15057820", + "citation": "Chung 2004, Nature", + "state": "not_determined", + "reason": "HLA-B not typed" + }, + { + "allele": "B*57:01", + "kind": "drug", + "association": "abacavir hypersensitivity; flucloxacillin liver injury", + "pmids": "18256392,19483685", + "citation": "Mallal 2008, N Engl J Med; Daly 2009, Nat Genet", + "state": "not_determined", + "reason": "HLA-B not typed" + }, + { + "allele": "B*58:01", + "kind": "drug", + "association": "allopurinol severe skin reactions", + "pmids": "15743917", + "citation": "Hung 2005, Proc Natl Acad Sci U S A", + "state": "not_determined", + "reason": "HLA-B not typed" + }, + { + "allele": "B*27", + "kind": "disease", + "association": "ankylosing spondylitis", + "pmids": "4123836,4688372", + "citation": "Brewerton 1973, Lancet; Schlosstein 1973, N Engl J Med", + "state": "not_determined", + "reason": "HLA-B not typed" + }, + { + "allele": "C*06:02", + "kind": "disease", + "association": "psoriasis", + "pmids": "16642438", + "citation": "Nair 2006, Am J Hum Genet", + "state": "not_determined", + "reason": "HLA-C not typed" + }, + { + "allele": "DQB1*06:02", + "kind": "disease", + "association": "narcolepsy with cataplexy", + "pmids": "11179016", + "citation": "Mignot 2001, Am J Hum Genet", + "state": "not_determined", + "reason": "HLA-DQB1 not typed" + }, + { + "allele": "DRB1*15:01", + "kind": "disease", + "association": "multiple sclerosis", + "pmids": "12557126", + "citation": "Barcellos 2003, Am J Hum Genet", + "state": "not_determined", + "reason": "HLA-DRB1 not typed" + }, + { + "allele": "DRB1*01:01", + "kind": "disease", + "association": "rheumatoid arthritis, shared epitope allele", + "pmids": "2446635", + "citation": "Gregersen 1987, Arthritis Rheum", + "state": "not_determined", + "reason": "HLA-DRB1 not typed" + }, + { + "allele": "DRB1*04:01", + "kind": "disease", + "association": "rheumatoid arthritis, shared epitope allele", + "pmids": "2446635", + "citation": "Gregersen 1987, Arthritis Rheum", + "state": "not_determined", + "reason": "HLA-DRB1 not typed" + }, + { + "allele": "DRB1*04:04", + "kind": "disease", + "association": "rheumatoid arthritis, shared epitope allele", + "pmids": "2446635", + "citation": "Gregersen 1987, Arthritis Rheum", + "state": "not_determined", + "reason": "HLA-DRB1 not typed" + }, + { + "allele": "DRB1*04:05", + "kind": "disease", + "association": "rheumatoid arthritis, shared epitope allele", + "pmids": "2446635", + "citation": "Gregersen 1987, Arthritis Rheum", + "state": "not_determined", + "reason": "HLA-DRB1 not typed" + }, + { + "allele": "DRB1*04:08", + "kind": "disease", + "association": "rheumatoid arthritis, shared epitope allele", + "pmids": "2446635", + "citation": "Gregersen 1987, Arthritis Rheum", + "state": "not_determined", + "reason": "HLA-DRB1 not typed" + }, + { + "allele": "DRB1*14:02", + "kind": "disease", + "association": "rheumatoid arthritis, shared epitope allele", + "pmids": "2446635", + "citation": "Gregersen 1987, Arthritis Rheum", + "state": "not_determined", + "reason": "HLA-DRB1 not typed" } - }, - "haplogroup": { - "title": "Mitochondrial haplogroup", - "step": "12", - "state": "unreadable", - "source": null, - "file_date": null, - "note": "S_haplocheck.txt has no Contamination Status column", - "data": {} - }, - "y_haplogroup": { - "title": "Y-chromosome haplogroup (Yleaf)", - "step": "37", - "state": "unreadable", - "source": null, - "file_date": null, - "note": "S_y_haplogroup.txt has no Hg column or no sample row", - "data": {} - }, - "y_tree": { - "title": "Y placement on the current public tree", - "step": "37", - "state": "unreadable", - "source": null, - "file_date": null, - "note": "S_y_tree.txt lacks a column of Hg, Level, Tree", - "data": {} - }, - "y_str": { - "title": "Y-STR markers (HipSTR)", - "step": "45", - "state": "unreadable", - "source": null, - "file_date": null, - "note": "S_y_str.tsv has a confidence other than high, low, no call or not callable", - "data": {} - }, - "consumer_export": { - "title": "Raw-data export (23andMe v5 layout)", - "step": "40", - "state": "unreadable", - "source": null, - "file_date": null, - "note": "S_consumer_export.tsv has no whole-number 'sites' row", - "data": {} - }, - "bloodtype": { - "title": "Blood groups (predicted)", - "step": "41", - "state": "unreadable", - "source": null, - "file_date": null, - "note": "S_bloodtype.tsv has no system, phenotype and confidence columns, or no row", - "data": {} - }, - "lpa": { - "title": "Lp(a): LPA KIV-2 repeat count", - "step": "46", - "state": "unreadable", - "source": null, - "file_date": null, - "note": "S_lpa_kiv2.tsv has no status row (estimated, too little depth or not assessed)", - "data": {} - }, - "vntyper": { - "title": "MUC1 VNTR frameshifts (VNtyper)", - "step": "52", - "state": "unreadable", - "source": null, - "file_date": null, - "note": "S_vntyper.tsv has no status row (positive, possible, negative, not assessed)", - "data": {} - }, - "locityper": { - "title": "Locityper second opinion at hard loci", - "step": "53", - "state": "unreadable", - "source": null, - "file_date": null, - "note": "S_locityper.tsv lacks a row or one of the columns locus, region, status, genotype, haplotype_1, haplotype_2, quality, total_reads, unexplained_reads, weighted_distance, warnings, filter, reason", - "data": {} - }, - "mito": { - "title": "Mitochondrial variants", - "step": "20", - "state": "unreadable", - "source": null, - "file_date": null, - "note": "KeyError: 'length'", - "data": {} - }, - "traits": { - "title": "Traits panel", - "step": "42", - "state": "unreadable", - "source": null, - "file_date": null, - "note": "S_traits.tsv line 2 does not have one field per column", - "data": {} - }, - "archaic": { - "title": "Archaic ancestry (IBDmix)", - "step": "43", - "state": "unreadable", - "source": null, - "file_date": null, - "note": "S_archaic.tsv has no percentage for neanderthal_percent", - "data": {} - }, - "ancient": { - "title": "Ancient populations (AADR PCA)", - "step": "44", - "state": "unreadable", - "source": null, - "file_date": null, - "note": "S_ancient.tsv has no rows or lacks a column of ['country', 'dates', 'distance', 'group', 'locality', 'n', 'rank']", - "data": {} - }, - "viral": { - "title": "Viral DNA in the unmapped reads", - "step": "47", - "state": "unreadable", - "source": null, - "file_date": null, - "note": "S_viral.tsv has no rows or lacks a column of virus, accession, reads, breadth, relative_depth, copies_per_cell, call", - "data": {} - }, - "exomiser": { - "title": "Symptom-driven ranking (Exomiser)", - "step": "48", - "state": "unreadable", - "source": null, - "file_date": null, - "note": "S_exomiser_top.tsv lacks a column of rank, gene, moi, exomiser_score, phenotype_score, variant, genotype, consequence, hgvs, acmg, disease", - "data": {} - }, - "chip": { - "title": "Clonal haematopoiesis (CHIP)", - "step": "49", - "state": "unreadable", - "source": null, - "file_date": null, - "note": "S_chip.tsv lacks a column of gene, protein_change, vaf, alt_reads, depth, status, note", - "data": {} - }, - "mei": { - "title": "Mobile element insertions (MEGAnE)", - "step": "50", - "state": "unreadable", - "source": null, - "file_date": null, - "note": "S_mei.tsv is missing beside S_mei_sites.tsv", - "data": {} - }, - "mosaic": { - "title": "Mosaic chromosomal alterations (MoChA)", - "step": "51", - "state": "unreadable", - "source": null, - "file_date": null, - "note": "S_mocha.tsv has 1 reported calls, S_mocha_summary.tsv says 2", - "data": {} - }, - "cpsr": { - "title": "Cancer predisposition (CPSR)", - "step": "17", - "state": "unreadable", - "source": null, - "file_date": null, - "note": "S.cpsr.grch38.classification.tsv.gz: Compressed file ended before the end-of-stream marker was reached", - "data": {} - }, - "clinical": { - "title": "Clinical variant filter", - "step": "23", - "state": "unreadable", - "source": null, - "file_date": null, - "note": "ValueError: invalid literal for int() with base 10: 'x'", - "data": {} - }, - "slivar": { - "title": "Variant prioritization (slivar)", - "step": "31", - "state": "unreadable", - "source": null, - "file_date": null, - "note": "S_prioritized.vcf.gz: Compressed file ended before the end-of-stream marker was reached", - "data": {} + ] + } + } + }, + "prs": { + "title": "Polygenic risk scores", + "step": "25", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "ancestry_fine": { + "title": "Fine-grained ancestry (ADMIXTURE, RFMix)", + "step": "26b", + "state": "unreadable", + "source": null, + "file_date": null, + "note": "S_ancestry_fine.tsv has no rows or lacks a column of ['code', 'fraction', 'group', 'high', 'level', 'low', 'se']", + "data": {} + }, + "manta": { + "title": "Structural variants (Manta)", + "step": "04", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "delly": { + "title": "Structural variants (Delly)", + "step": "19", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "cnvpytor": { + "title": "Copy number (CNVpytor)", + "step": "18", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "sv_consensus": { + "title": "SV consensus merge", + "step": "22", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "annotsv": { + "title": "Structural variants, class 4 and 5 (AnnotSV)", + "step": "05", + "state": "unreadable", + "source": null, + "file_date": null, + "note": "S_sv_class4_5_checked.tsv lacks a column of ['ACMG_class', 'Caller', 'Common', 'Exon_edge', 'Population_AF', 'SV_chrom', 'SV_end', 'SV_start', 'SV_type']", + "data": {} + }, + "expansions": { + "title": "Repeat expansions (ExpansionHunter)", + "step": "09", + "state": "ok", + "source": "expansion_hunter/S_eh.vcf", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "records": 2, + "key_loci": [ + { + "locus": "HTT", + "repeat_count": "not in output" + }, + { + "locus": "FMR1", + "repeat_count": "not in output" + }, + { + "locus": "C9ORF72", + "repeat_count": "not in output" + }, + { + "locus": "ATXN1", + "repeat_count": "not in output" + }, + { + "locus": "DMPK", + "repeat_count": "not in output" + } + ], + "loci": [ + { + "locus": "CFTR_T", + "repeat_count": "7/9", + "status": "", + "normal_max": "", + "pathologic_min": "", + "support": "SPANNING/SPANNING", + "adsp": "8/9", + "ci": "7-7/9-9", + "sizing": "sized", + "allele_sizing": "sized/sized", + "zone": "", + "zone_label": "", + "zone_citation": "" + }, + { + "locus": "CFTR_TG", + "repeat_count": "11/12", + "status": "", + "normal_max": "", + "pathologic_min": "", + "support": "SPANNING/FLANKING", + "adsp": "8/0", + "ci": "11-11/12-12", + "sizing": "flanking_only", + "allele_sizing": "sized/flanking_only", + "zone": "", + "zone_label": "", + "zone_citation": "" + } + ], + "stranger": false, + "stranger_outdated": false, + "unsized": [ + "CFTR_TG" + ], + "intermediate": [], + "readings": [ + { + "locus": "CFTR", + "repeat": "intron 9 (legacy IVS8) TG and poly-T tract", + "source": "Deignan et al. 2020, PMID 32404922", + "status": "not_sized", + "genotype": ".", + "phase": ".", + "reading": "ExpansionHunter did not size both tracts (TG 11/12, flanking_only; poly-T 7/9, sized): not read." + }, + { + "locus": "UGT1A1", + "repeat": "promoter TA repeat", + "source": "Gammal et al. 2016, PMID 26417955", + "status": "not_sized", + "genotype": ".", + "pharmcat": ".", + "agreement": "not_compared", + "reading": "not in step 09's output: STR_EXTRA_LOCI=yes ./scripts/setup.sh --strchive-data adds the repeat to the catalog (docs/09-str-expansions.md). PharmCAT (step 7) still reads UGT1A1 *28." + }, + { + "locus": "SLC6A4", + "repeat": "5-HTTLPR promoter length polymorphism", + "status": "not_tested", + "genotype": ".", + "reading": "not tested by any step. CPIC's 2023 SSRI guideline (Bousman et al. 2023, PMID 37032427) found that the data on SLC6A4 do not support its use in antidepressant prescribing, so a result would carry no recommendation.", + "source": "Bousman et al. 2023, PMID 37032427" + } + ] + } + }, + "telomere": { + "title": "Telomere content (TelomereHunter)", + "step": "10", + "state": "ok", + "source": "telomere/S/S_summary.tsv", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "tel_content": "1.5", + "intratelomeric_reads": 40, + "read_check": "depth unknown (no total_reads or read_lengths in the summary): not checked" + } + }, + "roh": { + "title": "Runs of homozygosity", + "step": "11", + "state": "ok", + "source": "vcf/S_roh.txt", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "segments": 0, + "total_mb": 0.0, + "largest_mb": 0.0, + "autosomal_over_5mb": [], + "masked_mb": 0.0, + "sex_chromosome_segments": 0, + "long_mb": 0.0, + "f_roh": null, + "relationship": null, + "upd_flag": null, + "scope": { + "source": "segments_only", + "autosomes": [], + "unmasked_bp": 0, + "partial": true, + "note": "Partial or unverified chromosome scope: no relationship band or UPD flag. F_ROH uses only the listed chromosomes, not callable bases." } + } + }, + "haplogroup": { + "title": "Mitochondrial haplogroup", + "step": "12", + "state": "unreadable", + "source": null, + "file_date": null, + "note": "S_haplocheck.txt has no Contamination Status column", + "data": {} + }, + "y_haplogroup": { + "title": "Y-chromosome haplogroup (Yleaf)", + "step": "37", + "state": "unreadable", + "source": null, + "file_date": null, + "note": "S_y_haplogroup.txt has no Hg column or no sample row", + "data": {} + }, + "y_tree": { + "title": "Y placement on the current public tree", + "step": "37", + "state": "unreadable", + "source": null, + "file_date": null, + "note": "S_y_tree.txt lacks a column of Hg, Level, Tree", + "data": {} + }, + "y_str": { + "title": "Y-STR markers (HipSTR)", + "step": "45", + "state": "unreadable", + "source": null, + "file_date": null, + "note": "S_y_str.tsv has a confidence other than high, low, no call or not callable", + "data": {} + }, + "consumer_export": { + "title": "Raw-data export (23andMe v5 layout)", + "step": "40", + "state": "unreadable", + "source": null, + "file_date": null, + "note": "S_consumer_export.tsv has no whole-number 'sites' row", + "data": {} + }, + "bloodtype": { + "title": "Blood groups (predicted)", + "step": "41", + "state": "unreadable", + "source": null, + "file_date": null, + "note": "S_bloodtype.tsv has no system, phenotype and confidence columns, or no row", + "data": {} + }, + "lpa": { + "title": "Lp(a): LPA KIV-2 repeat count", + "step": "46", + "state": "unreadable", + "source": null, + "file_date": null, + "note": "S_lpa_kiv2.tsv has no status row (estimated, too little depth or not assessed)", + "data": {} + }, + "vntyper": { + "title": "MUC1 VNTR frameshifts (VNtyper)", + "step": "52", + "state": "unreadable", + "source": null, + "file_date": null, + "note": "S_vntyper.tsv has no status row (positive, possible, negative, not assessed)", + "data": {} + }, + "locityper": { + "title": "Locityper second opinion at hard loci", + "step": "53", + "state": "unreadable", + "source": null, + "file_date": null, + "note": "S_locityper.tsv lacks a row or one of the columns locus, region, status, genotype, haplotype_1, haplotype_2, quality, total_reads, unexplained_reads, weighted_distance, warnings, filter, reason", + "data": {} + }, + "mito": { + "title": "Mitochondrial variants", + "step": "20", + "state": "unreadable", + "source": null, + "file_date": null, + "note": "KeyError: 'length'", + "data": {} + }, + "traits": { + "title": "Traits panel", + "step": "42", + "state": "unreadable", + "source": null, + "file_date": null, + "note": "S_traits.tsv line 2 does not have one field per column", + "data": {} + }, + "archaic": { + "title": "Archaic ancestry (IBDmix)", + "step": "43", + "state": "unreadable", + "source": null, + "file_date": null, + "note": "S_archaic.tsv has no percentage for neanderthal_percent", + "data": {} + }, + "ancient": { + "title": "Ancient populations (AADR PCA)", + "step": "44", + "state": "unreadable", + "source": null, + "file_date": null, + "note": "S_ancient.tsv has no rows or lacks a column of ['country', 'dates', 'distance', 'group', 'locality', 'n', 'rank']", + "data": {} + }, + "viral": { + "title": "Viral DNA in the unmapped reads", + "step": "47", + "state": "unreadable", + "source": null, + "file_date": null, + "note": "S_viral.tsv has no rows or lacks a column of virus, accession, reads, breadth, relative_depth, copies_per_cell, call", + "data": {} + }, + "exomiser": { + "title": "Symptom-driven ranking (Exomiser)", + "step": "48", + "state": "unreadable", + "source": null, + "file_date": null, + "note": "S_exomiser_top.tsv lacks a column of rank, gene, moi, exomiser_score, phenotype_score, variant, genotype, consequence, hgvs, acmg, disease", + "data": {} + }, + "chip": { + "title": "Clonal haematopoiesis (CHIP)", + "step": "49", + "state": "unreadable", + "source": null, + "file_date": null, + "note": "S_chip.tsv lacks a column of gene, protein_change, vaf, alt_reads, depth, status, note", + "data": {} + }, + "mei": { + "title": "Mobile element insertions (MEGAnE)", + "step": "50", + "state": "unreadable", + "source": null, + "file_date": null, + "note": "S_mei.tsv is missing beside S_mei_sites.tsv", + "data": {} + }, + "mosaic": { + "title": "Mosaic chromosomal alterations (MoChA)", + "step": "51", + "state": "unreadable", + "source": null, + "file_date": null, + "note": "S_mocha.tsv has 1 reported calls, S_mocha_summary.tsv says 2", + "data": {} + }, + "cpsr": { + "title": "Cancer predisposition (CPSR)", + "step": "17", + "state": "unreadable", + "source": null, + "file_date": null, + "note": "S.cpsr.grch38.classification.tsv.gz: Compressed file ended before the end-of-stream marker was reached", + "data": {} + }, + "clinical": { + "title": "Clinical variant filter", + "step": "23", + "state": "unreadable", + "source": null, + "file_date": null, + "note": "ValueError: invalid literal for int() with base 10: 'x'", + "data": {} + }, + "slivar": { + "title": "Variant prioritization (slivar)", + "step": "31", + "state": "unreadable", + "source": null, + "file_date": null, + "note": "S_prioritized.vcf.gz: Compressed file ended before the end-of-stream marker was reached", + "data": {} + } + }, + "cyp2d6": { + "calls": { + "PharmCAT": null, + "pypgx": null, + "Cyrius": "none" }, - "cyp2d6": { - "calls": { - "PharmCAT": null, - "pypgx": null, - "Cyrius": "none" - }, - "agree": null, - "consensus": null, - "probable": null - }, - "not_run": [ - "Polygenic risk scores", - "Structural variants (Manta)", - "Structural variants (Delly)", - "Copy number (CNVpytor)", - "SV consensus merge" - ], - "not_assessed": [ - "Mosaic and low-fraction small variants (only chrM heteroplasmy is reported, and with step 49 the CHIP genes)", - "Methylation and imprinting", - "Repeat expansions outside the ExpansionHunter catalog", - "Phase: two variants in one gene are compound-het candidates, not confirmed", - "Variants of uncertain significance (not interpreted)", - "Polygenic score percentiles: no ancestry reference panel was used, so the scores are raw sums", - "HBA1/HBA2 copy number (alpha-thalassaemia deletions): neither step 35's read-depth count (short reads) nor step 35b (Paraphase, PacBio HiFi) made a call", - "MUC1 VNTR frameshifts (ADTKD-MUC1): step 52 (VNtyper, opt-in) gave no reading; no standard caller sees them", - "Autosomal mosaic chromosomal alterations (large gains, losses and copy-neutral LOH in a share of the blood cells): step 51 (MoChA) did not assess this sample" - ] + "agree": null, + "consensus": null, + "probable": null + }, + "not_run": [ + "Polygenic risk scores", + "Structural variants (Manta)", + "Structural variants (Delly)", + "Copy number (CNVpytor)", + "SV consensus merge" + ], + "not_assessed": [ + "Mosaic and low-fraction small variants (only chrM heteroplasmy is reported, and with step 49 the CHIP genes)", + "Methylation and imprinting", + "Repeat expansions outside the ExpansionHunter catalog", + "Phase: two variants in one gene are compound-het candidates, not confirmed", + "Variants of uncertain significance (not interpreted)", + "Polygenic score percentiles: no ancestry reference panel was used, so the scores are raw sums", + "HBA1/HBA2 copy number (alpha-thalassaemia deletions): neither step 35's read-depth count (short reads) nor step 35b (Paraphase, PacBio HiFi) made a call", + "MUC1 VNTR frameshifts (ADTKD-MUC1): step 52 (VNtyper, opt-in) gave no reading; no standard caller sees them", + "Autosomal mosaic chromosomal alterations (large gains, losses and copy-neutral LOH in a share of the blood cells): step 51 (MoChA) did not assess this sample" + ] } diff --git a/tests/parity/golden/summary-collect/all-default-out/history-bad/summary.json b/tests/parity/golden/summary-collect/all-default-out/history-bad/summary.json new file mode 100644 index 000000000..519ac21be --- /dev/null +++ b/tests/parity/golden/summary-collect/all-default-out/history-bad/summary.json @@ -0,0 +1,534 @@ +{ + "schema_version": 2, + "sample": "S", + "generated_utc": "2026-11-19 23:58 UTC", + "run": { + "status_file": false, + "started_utc": null, + "declared_sex": null + }, + "databases": { + "clinvar_release": null, + "cpsr_clinvar_release": null, + "hla_database": null + }, + "manifest": [ + [ + "run", + "written_utc", + "2021-03-04 05:06:07 UTC" + ] + ], + "sections": { + "coverage": { + "title": "Coverage (mosdepth)", + "step": "16b", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "callability": { + "title": "Gene callability (mosdepth)", + "step": "16b", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "sex_check": { + "title": "Sex check (indexcov)", + "step": "16", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "sample_qc": { + "title": "Sample identity and contamination (somalier, VerifyBamID2)", + "step": "33", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "mosaic_sex_loss": { + "title": "Mosaic loss of chromosome Y or X", + "step": "33", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "read_count": { + "title": "Reads kept by alignment", + "step": "02", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "variants": { + "title": "Variant calling", + "step": "03", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "clinvar": { + "title": "ClinVar screen", + "step": "06", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "couple": { + "title": "Couple carrier screen", + "step": "39", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "carrier": { + "title": "Carrier list", + "step": "06", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "acmg_sf": { + "title": "ACMG secondary findings", + "step": "06", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "pharmcat": { + "title": "PharmCAT", + "step": "07", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "cpic": { + "title": "CPIC drug-gene recommendations", + "step": "27", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "pypgx": { + "title": "pypgx", + "step": "32", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "cyrius": { + "title": "Cyrius (CYP2D6)", + "step": "21", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "parascopy": { + "title": "SMN1/SMN2 copy number (Parascopy, short reads)", + "step": "35", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "paralogs": { + "title": "Paralog genes (Paraphase, PacBio HiFi)", + "step": "35b", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "hla": { + "title": "HLA typing (T1K)", + "step": "08", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "prs": { + "title": "Polygenic risk scores", + "step": "25", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "ancestry_fine": { + "title": "Fine-grained ancestry (ADMIXTURE, RFMix)", + "step": "26b", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "manta": { + "title": "Structural variants (Manta)", + "step": "04", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "delly": { + "title": "Structural variants (Delly)", + "step": "19", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "cnvpytor": { + "title": "Copy number (CNVpytor)", + "step": "18", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "sv_consensus": { + "title": "SV consensus merge", + "step": "22", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "annotsv": { + "title": "Structural variants, class 4 and 5 (AnnotSV)", + "step": "05", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "expansions": { + "title": "Repeat expansions (ExpansionHunter)", + "step": "09", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "telomere": { + "title": "Telomere content (TelomereHunter)", + "step": "10", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "roh": { + "title": "Runs of homozygosity", + "step": "11", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "haplogroup": { + "title": "Mitochondrial haplogroup", + "step": "12", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "y_haplogroup": { + "title": "Y-chromosome haplogroup (Yleaf)", + "step": "37", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "y_tree": { + "title": "Y placement on the current public tree", + "step": "37", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "y_str": { + "title": "Y-STR markers (HipSTR)", + "step": "45", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "consumer_export": { + "title": "Raw-data export (23andMe v5 layout)", + "step": "40", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "bloodtype": { + "title": "Blood groups (predicted)", + "step": "41", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "lpa": { + "title": "Lp(a): LPA KIV-2 repeat count", + "step": "46", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "vntyper": { + "title": "MUC1 VNTR frameshifts (VNtyper)", + "step": "52", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "locityper": { + "title": "Locityper second opinion at hard loci", + "step": "53", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "mito": { + "title": "Mitochondrial variants", + "step": "20", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "traits": { + "title": "Traits panel", + "step": "42", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "archaic": { + "title": "Archaic ancestry (IBDmix)", + "step": "43", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "ancient": { + "title": "Ancient populations (AADR PCA)", + "step": "44", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "viral": { + "title": "Viral DNA in the unmapped reads", + "step": "47", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "exomiser": { + "title": "Symptom-driven ranking (Exomiser)", + "step": "48", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "chip": { + "title": "Clonal haematopoiesis (CHIP)", + "step": "49", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "mei": { + "title": "Mobile element insertions (MEGAnE)", + "step": "50", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "mosaic": { + "title": "Mosaic chromosomal alterations (MoChA)", + "step": "51", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "cpsr": { + "title": "Cancer predisposition (CPSR)", + "step": "17", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "clinical": { + "title": "Clinical variant filter", + "step": "23", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "slivar": { + "title": "Variant prioritization (slivar)", + "step": "31", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + } + }, + "cyp2d6": { + "calls": { + "PharmCAT": null, + "pypgx": null, + "Cyrius": null + }, + "agree": null, + "consensus": null, + "probable": null + }, + "not_run": [ + "Coverage (mosdepth)", + "Gene callability (mosdepth)", + "Sex check (indexcov)", + "Sample identity and contamination (somalier, VerifyBamID2)", + "Mosaic loss of chromosome Y or X", + "Variant calling", + "ClinVar screen", + "PharmCAT", + "CPIC drug-gene recommendations", + "pypgx", + "Cyrius (CYP2D6)", + "SMN1/SMN2 copy number (Parascopy, short reads)", + "Paralog genes (Paraphase, PacBio HiFi)", + "HLA typing (T1K)", + "Polygenic risk scores", + "Fine-grained ancestry (ADMIXTURE, RFMix)", + "Structural variants (Manta)", + "Structural variants (Delly)", + "Copy number (CNVpytor)", + "SV consensus merge", + "Structural variants, class 4 and 5 (AnnotSV)", + "Repeat expansions (ExpansionHunter)", + "Telomere content (TelomereHunter)", + "Runs of homozygosity", + "Mitochondrial haplogroup", + "Y-chromosome haplogroup (Yleaf)", + "Y placement on the current public tree", + "Y-STR markers (HipSTR)", + "Raw-data export (23andMe v5 layout)", + "Blood groups (predicted)", + "Lp(a): LPA KIV-2 repeat count", + "MUC1 VNTR frameshifts (VNtyper)", + "Locityper second opinion at hard loci", + "Mitochondrial variants", + "Traits panel", + "Archaic ancestry (IBDmix)", + "Ancient populations (AADR PCA)", + "Viral DNA in the unmapped reads", + "Symptom-driven ranking (Exomiser)", + "Clonal haematopoiesis (CHIP)", + "Mobile element insertions (MEGAnE)", + "Mosaic chromosomal alterations (MoChA)", + "Cancer predisposition (CPSR)", + "Clinical variant filter", + "Variant prioritization (slivar)" + ], + "not_assessed": [ + "Mosaic and low-fraction small variants (only chrM heteroplasmy is reported, and with step 49 the CHIP genes)", + "Methylation and imprinting", + "Repeat expansions outside the ExpansionHunter catalog", + "Phase: two variants in one gene are compound-het candidates, not confirmed", + "Variants of uncertain significance (not interpreted)", + "Polygenic score percentiles: no ancestry reference panel was used, so the scores are raw sums", + "HBA1/HBA2 copy number (alpha-thalassaemia deletions): neither step 35's read-depth count (short reads) nor step 35b (Paraphase, PacBio HiFi) made a call", + "Mobile element insertions (Alu, L1 and SVA, the FKTN, TAF1 and BBS1 SVA insertions among them): not looked for (step 50, MEGAnE, is opt-in)", + "MUC1 VNTR frameshifts (ADTKD-MUC1): step 52 (VNtyper, opt-in) gave no reading; no standard caller sees them", + "Autosomal mosaic chromosomal alterations (large gains, losses and copy-neutral LOH in a share of the blood cells): step 51 (MoChA) did not assess this sample" + ] +} diff --git a/tests/parity/golden/summary-collect/all-empty/all-empty.json b/tests/parity/golden/summary-collect/all-empty/all-empty.json new file mode 100644 index 000000000..b6d46c0f2 --- /dev/null +++ b/tests/parity/golden/summary-collect/all-empty/all-empty.json @@ -0,0 +1,528 @@ +{ + "schema_version": 2, + "sample": "S", + "generated_utc": "2026-11-19 23:58 UTC", + "run": { + "status_file": false, + "started_utc": null, + "declared_sex": null + }, + "databases": { + "clinvar_release": null, + "cpsr_clinvar_release": null, + "hla_database": null + }, + "manifest": [], + "sections": { + "coverage": { + "title": "Coverage (mosdepth)", + "step": "16b", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "callability": { + "title": "Gene callability (mosdepth)", + "step": "16b", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "sex_check": { + "title": "Sex check (indexcov)", + "step": "16", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "sample_qc": { + "title": "Sample identity and contamination (somalier, VerifyBamID2)", + "step": "33", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "mosaic_sex_loss": { + "title": "Mosaic loss of chromosome Y or X", + "step": "33", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "read_count": { + "title": "Reads kept by alignment", + "step": "02", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "variants": { + "title": "Variant calling", + "step": "03", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "clinvar": { + "title": "ClinVar screen", + "step": "06", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "couple": { + "title": "Couple carrier screen", + "step": "39", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "carrier": { + "title": "Carrier list", + "step": "06", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "acmg_sf": { + "title": "ACMG secondary findings", + "step": "06", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "pharmcat": { + "title": "PharmCAT", + "step": "07", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "cpic": { + "title": "CPIC drug-gene recommendations", + "step": "27", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "pypgx": { + "title": "pypgx", + "step": "32", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "cyrius": { + "title": "Cyrius (CYP2D6)", + "step": "21", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "parascopy": { + "title": "SMN1/SMN2 copy number (Parascopy, short reads)", + "step": "35", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "paralogs": { + "title": "Paralog genes (Paraphase, PacBio HiFi)", + "step": "35b", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "hla": { + "title": "HLA typing (T1K)", + "step": "08", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "prs": { + "title": "Polygenic risk scores", + "step": "25", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "ancestry_fine": { + "title": "Fine-grained ancestry (ADMIXTURE, RFMix)", + "step": "26b", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "manta": { + "title": "Structural variants (Manta)", + "step": "04", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "delly": { + "title": "Structural variants (Delly)", + "step": "19", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "cnvpytor": { + "title": "Copy number (CNVpytor)", + "step": "18", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "sv_consensus": { + "title": "SV consensus merge", + "step": "22", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "annotsv": { + "title": "Structural variants, class 4 and 5 (AnnotSV)", + "step": "05", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "expansions": { + "title": "Repeat expansions (ExpansionHunter)", + "step": "09", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "telomere": { + "title": "Telomere content (TelomereHunter)", + "step": "10", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "roh": { + "title": "Runs of homozygosity", + "step": "11", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "haplogroup": { + "title": "Mitochondrial haplogroup", + "step": "12", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "y_haplogroup": { + "title": "Y-chromosome haplogroup (Yleaf)", + "step": "37", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "y_tree": { + "title": "Y placement on the current public tree", + "step": "37", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "y_str": { + "title": "Y-STR markers (HipSTR)", + "step": "45", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "consumer_export": { + "title": "Raw-data export (23andMe v5 layout)", + "step": "40", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "bloodtype": { + "title": "Blood groups (predicted)", + "step": "41", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "lpa": { + "title": "Lp(a): LPA KIV-2 repeat count", + "step": "46", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "vntyper": { + "title": "MUC1 VNTR frameshifts (VNtyper)", + "step": "52", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "locityper": { + "title": "Locityper second opinion at hard loci", + "step": "53", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "mito": { + "title": "Mitochondrial variants", + "step": "20", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "traits": { + "title": "Traits panel", + "step": "42", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "archaic": { + "title": "Archaic ancestry (IBDmix)", + "step": "43", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "ancient": { + "title": "Ancient populations (AADR PCA)", + "step": "44", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "viral": { + "title": "Viral DNA in the unmapped reads", + "step": "47", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "exomiser": { + "title": "Symptom-driven ranking (Exomiser)", + "step": "48", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "chip": { + "title": "Clonal haematopoiesis (CHIP)", + "step": "49", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "mei": { + "title": "Mobile element insertions (MEGAnE)", + "step": "50", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "mosaic": { + "title": "Mosaic chromosomal alterations (MoChA)", + "step": "51", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "cpsr": { + "title": "Cancer predisposition (CPSR)", + "step": "17", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "clinical": { + "title": "Clinical variant filter", + "step": "23", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "slivar": { + "title": "Variant prioritization (slivar)", + "step": "31", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + } + }, + "cyp2d6": { + "calls": { + "PharmCAT": null, + "pypgx": null, + "Cyrius": null + }, + "agree": null, + "consensus": null, + "probable": null + }, + "not_run": [ + "Coverage (mosdepth)", + "Gene callability (mosdepth)", + "Sex check (indexcov)", + "Sample identity and contamination (somalier, VerifyBamID2)", + "Mosaic loss of chromosome Y or X", + "Variant calling", + "ClinVar screen", + "PharmCAT", + "CPIC drug-gene recommendations", + "pypgx", + "Cyrius (CYP2D6)", + "SMN1/SMN2 copy number (Parascopy, short reads)", + "Paralog genes (Paraphase, PacBio HiFi)", + "HLA typing (T1K)", + "Polygenic risk scores", + "Fine-grained ancestry (ADMIXTURE, RFMix)", + "Structural variants (Manta)", + "Structural variants (Delly)", + "Copy number (CNVpytor)", + "SV consensus merge", + "Structural variants, class 4 and 5 (AnnotSV)", + "Repeat expansions (ExpansionHunter)", + "Telomere content (TelomereHunter)", + "Runs of homozygosity", + "Mitochondrial haplogroup", + "Y-chromosome haplogroup (Yleaf)", + "Y placement on the current public tree", + "Y-STR markers (HipSTR)", + "Raw-data export (23andMe v5 layout)", + "Blood groups (predicted)", + "Lp(a): LPA KIV-2 repeat count", + "MUC1 VNTR frameshifts (VNtyper)", + "Locityper second opinion at hard loci", + "Mitochondrial variants", + "Traits panel", + "Archaic ancestry (IBDmix)", + "Ancient populations (AADR PCA)", + "Viral DNA in the unmapped reads", + "Symptom-driven ranking (Exomiser)", + "Clonal haematopoiesis (CHIP)", + "Mobile element insertions (MEGAnE)", + "Mosaic chromosomal alterations (MoChA)", + "Cancer predisposition (CPSR)", + "Clinical variant filter", + "Variant prioritization (slivar)" + ], + "not_assessed": [ + "Mosaic and low-fraction small variants (only chrM heteroplasmy is reported, and with step 49 the CHIP genes)", + "Methylation and imprinting", + "Repeat expansions outside the ExpansionHunter catalog", + "Phase: two variants in one gene are compound-het candidates, not confirmed", + "Variants of uncertain significance (not interpreted)", + "Polygenic score percentiles: no ancestry reference panel was used, so the scores are raw sums", + "HBA1/HBA2 copy number (alpha-thalassaemia deletions): neither step 35's read-depth count (short reads) nor step 35b (Paraphase, PacBio HiFi) made a call", + "Mobile element insertions (Alu, L1 and SVA, the FKTN, TAF1 and BBS1 SVA insertions among them): not looked for (step 50, MEGAnE, is opt-in)", + "MUC1 VNTR frameshifts (ADTKD-MUC1): step 52 (VNtyper, opt-in) gave no reading; no standard caller sees them", + "Autosomal mosaic chromosomal alterations (large gains, losses and copy-neutral LOH in a share of the blood cells): step 51 (MoChA) did not assess this sample" + ] +} diff --git a/tests/parity/golden/summary-collect/all-failed/all-failed.json b/tests/parity/golden/summary-collect/all-failed/all-failed.json new file mode 100644 index 000000000..e8350a12e --- /dev/null +++ b/tests/parity/golden/summary-collect/all-failed/all-failed.json @@ -0,0 +1,528 @@ +{ + "schema_version": 2, + "sample": "S", + "generated_utc": "2026-11-19 23:58 UTC", + "run": { + "status_file": true, + "started_utc": "2020-02-02 02:02 UTC", + "declared_sex": null + }, + "databases": { + "clinvar_release": null, + "cpsr_clinvar_release": null, + "hla_database": null + }, + "manifest": [], + "sections": { + "coverage": { + "title": "Coverage (mosdepth)", + "step": "16b", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "callability": { + "title": "Gene callability (mosdepth)", + "step": "16b", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "sex_check": { + "title": "Sex check (indexcov)", + "step": "16", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "sample_qc": { + "title": "Sample identity and contamination (somalier, VerifyBamID2)", + "step": "33", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "mosaic_sex_loss": { + "title": "Mosaic loss of chromosome Y or X", + "step": "33", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "read_count": { + "title": "Reads kept by alignment", + "step": "02", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "variants": { + "title": "Variant calling", + "step": "03", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "clinvar": { + "title": "ClinVar screen", + "step": "06", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "couple": { + "title": "Couple carrier screen", + "step": "39", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "carrier": { + "title": "Carrier list", + "step": "06", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "acmg_sf": { + "title": "ACMG secondary findings", + "step": "06", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "pharmcat": { + "title": "PharmCAT", + "step": "07", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "cpic": { + "title": "CPIC drug-gene recommendations", + "step": "27", + "state": "failed", + "source": null, + "file_date": null, + "note": "step 27 failed in the run of 2020-02-02 02:02 UTC; its log is in logs/", + "data": {} + }, + "pypgx": { + "title": "pypgx", + "step": "32", + "state": "failed", + "source": null, + "file_date": null, + "note": "step 32 failed in the run of 2020-02-02 02:02 UTC; its log is in logs/", + "data": {} + }, + "cyrius": { + "title": "Cyrius (CYP2D6)", + "step": "21", + "state": "failed", + "source": null, + "file_date": null, + "note": "step 21 failed in the run of 2020-02-02 02:02 UTC; its log is in logs/", + "data": {} + }, + "parascopy": { + "title": "SMN1/SMN2 copy number (Parascopy, short reads)", + "step": "35", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "paralogs": { + "title": "Paralog genes (Paraphase, PacBio HiFi)", + "step": "35b", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "hla": { + "title": "HLA typing (T1K)", + "step": "08", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "prs": { + "title": "Polygenic risk scores", + "step": "25", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "ancestry_fine": { + "title": "Fine-grained ancestry (ADMIXTURE, RFMix)", + "step": "26b", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "manta": { + "title": "Structural variants (Manta)", + "step": "04", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "delly": { + "title": "Structural variants (Delly)", + "step": "19", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "cnvpytor": { + "title": "Copy number (CNVpytor)", + "step": "18", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "sv_consensus": { + "title": "SV consensus merge", + "step": "22", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "annotsv": { + "title": "Structural variants, class 4 and 5 (AnnotSV)", + "step": "05", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "expansions": { + "title": "Repeat expansions (ExpansionHunter)", + "step": "09", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "telomere": { + "title": "Telomere content (TelomereHunter)", + "step": "10", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "roh": { + "title": "Runs of homozygosity", + "step": "11", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "haplogroup": { + "title": "Mitochondrial haplogroup", + "step": "12", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "y_haplogroup": { + "title": "Y-chromosome haplogroup (Yleaf)", + "step": "37", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "y_tree": { + "title": "Y placement on the current public tree", + "step": "37", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "y_str": { + "title": "Y-STR markers (HipSTR)", + "step": "45", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "consumer_export": { + "title": "Raw-data export (23andMe v5 layout)", + "step": "40", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "bloodtype": { + "title": "Blood groups (predicted)", + "step": "41", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "lpa": { + "title": "Lp(a): LPA KIV-2 repeat count", + "step": "46", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "vntyper": { + "title": "MUC1 VNTR frameshifts (VNtyper)", + "step": "52", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "locityper": { + "title": "Locityper second opinion at hard loci", + "step": "53", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "mito": { + "title": "Mitochondrial variants", + "step": "20", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "traits": { + "title": "Traits panel", + "step": "42", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "archaic": { + "title": "Archaic ancestry (IBDmix)", + "step": "43", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "ancient": { + "title": "Ancient populations (AADR PCA)", + "step": "44", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "viral": { + "title": "Viral DNA in the unmapped reads", + "step": "47", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "exomiser": { + "title": "Symptom-driven ranking (Exomiser)", + "step": "48", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "chip": { + "title": "Clonal haematopoiesis (CHIP)", + "step": "49", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "mei": { + "title": "Mobile element insertions (MEGAnE)", + "step": "50", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "mosaic": { + "title": "Mosaic chromosomal alterations (MoChA)", + "step": "51", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "cpsr": { + "title": "Cancer predisposition (CPSR)", + "step": "17", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "clinical": { + "title": "Clinical variant filter", + "step": "23", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "slivar": { + "title": "Variant prioritization (slivar)", + "step": "31", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + } + }, + "cyp2d6": { + "calls": { + "PharmCAT": "failed (step 27)", + "pypgx": "failed (step 32)", + "Cyrius": "failed (step 21)" + }, + "agree": null, + "consensus": null, + "probable": null + }, + "not_run": [ + "Coverage (mosdepth)", + "Gene callability (mosdepth)", + "Sex check (indexcov)", + "Sample identity and contamination (somalier, VerifyBamID2)", + "Mosaic loss of chromosome Y or X", + "Variant calling", + "ClinVar screen", + "PharmCAT", + "CPIC drug-gene recommendations (step 27 failed)", + "pypgx (step 32 failed)", + "Cyrius (CYP2D6) (step 21 failed)", + "SMN1/SMN2 copy number (Parascopy, short reads)", + "Paralog genes (Paraphase, PacBio HiFi)", + "HLA typing (T1K)", + "Polygenic risk scores", + "Fine-grained ancestry (ADMIXTURE, RFMix)", + "Structural variants (Manta)", + "Structural variants (Delly)", + "Copy number (CNVpytor)", + "SV consensus merge", + "Structural variants, class 4 and 5 (AnnotSV)", + "Repeat expansions (ExpansionHunter)", + "Telomere content (TelomereHunter)", + "Runs of homozygosity", + "Mitochondrial haplogroup", + "Y-chromosome haplogroup (Yleaf)", + "Y placement on the current public tree", + "Y-STR markers (HipSTR)", + "Raw-data export (23andMe v5 layout)", + "Blood groups (predicted)", + "Lp(a): LPA KIV-2 repeat count", + "MUC1 VNTR frameshifts (VNtyper)", + "Locityper second opinion at hard loci", + "Mitochondrial variants", + "Traits panel", + "Archaic ancestry (IBDmix)", + "Ancient populations (AADR PCA)", + "Viral DNA in the unmapped reads", + "Symptom-driven ranking (Exomiser)", + "Clonal haematopoiesis (CHIP)", + "Mobile element insertions (MEGAnE)", + "Mosaic chromosomal alterations (MoChA)", + "Cancer predisposition (CPSR)", + "Clinical variant filter", + "Variant prioritization (slivar)" + ], + "not_assessed": [ + "Mosaic and low-fraction small variants (only chrM heteroplasmy is reported, and with step 49 the CHIP genes)", + "Methylation and imprinting", + "Repeat expansions outside the ExpansionHunter catalog", + "Phase: two variants in one gene are compound-het candidates, not confirmed", + "Variants of uncertain significance (not interpreted)", + "Polygenic score percentiles: no ancestry reference panel was used, so the scores are raw sums", + "HBA1/HBA2 copy number (alpha-thalassaemia deletions): neither step 35's read-depth count (short reads) nor step 35b (Paraphase, PacBio HiFi) made a call", + "Mobile element insertions (Alu, L1 and SVA, the FKTN, TAF1 and BBS1 SVA insertions among them): not looked for (step 50, MEGAnE, is opt-in)", + "MUC1 VNTR frameshifts (ADTKD-MUC1): step 52 (VNtyper, opt-in) gave no reading; no standard caller sees them", + "Autosomal mosaic chromosomal alterations (large gains, losses and copy-neutral LOH in a share of the blood cells): step 51 (MoChA) did not assess this sample" + ] +} diff --git a/tests/parity/golden/summary-collect/all-history-bad/all-history-bad.json b/tests/parity/golden/summary-collect/all-history-bad/all-history-bad.json new file mode 100644 index 000000000..519ac21be --- /dev/null +++ b/tests/parity/golden/summary-collect/all-history-bad/all-history-bad.json @@ -0,0 +1,534 @@ +{ + "schema_version": 2, + "sample": "S", + "generated_utc": "2026-11-19 23:58 UTC", + "run": { + "status_file": false, + "started_utc": null, + "declared_sex": null + }, + "databases": { + "clinvar_release": null, + "cpsr_clinvar_release": null, + "hla_database": null + }, + "manifest": [ + [ + "run", + "written_utc", + "2021-03-04 05:06:07 UTC" + ] + ], + "sections": { + "coverage": { + "title": "Coverage (mosdepth)", + "step": "16b", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "callability": { + "title": "Gene callability (mosdepth)", + "step": "16b", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "sex_check": { + "title": "Sex check (indexcov)", + "step": "16", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "sample_qc": { + "title": "Sample identity and contamination (somalier, VerifyBamID2)", + "step": "33", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "mosaic_sex_loss": { + "title": "Mosaic loss of chromosome Y or X", + "step": "33", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "read_count": { + "title": "Reads kept by alignment", + "step": "02", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "variants": { + "title": "Variant calling", + "step": "03", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "clinvar": { + "title": "ClinVar screen", + "step": "06", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "couple": { + "title": "Couple carrier screen", + "step": "39", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "carrier": { + "title": "Carrier list", + "step": "06", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "acmg_sf": { + "title": "ACMG secondary findings", + "step": "06", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "pharmcat": { + "title": "PharmCAT", + "step": "07", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "cpic": { + "title": "CPIC drug-gene recommendations", + "step": "27", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "pypgx": { + "title": "pypgx", + "step": "32", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "cyrius": { + "title": "Cyrius (CYP2D6)", + "step": "21", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "parascopy": { + "title": "SMN1/SMN2 copy number (Parascopy, short reads)", + "step": "35", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "paralogs": { + "title": "Paralog genes (Paraphase, PacBio HiFi)", + "step": "35b", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "hla": { + "title": "HLA typing (T1K)", + "step": "08", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "prs": { + "title": "Polygenic risk scores", + "step": "25", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "ancestry_fine": { + "title": "Fine-grained ancestry (ADMIXTURE, RFMix)", + "step": "26b", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "manta": { + "title": "Structural variants (Manta)", + "step": "04", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "delly": { + "title": "Structural variants (Delly)", + "step": "19", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "cnvpytor": { + "title": "Copy number (CNVpytor)", + "step": "18", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "sv_consensus": { + "title": "SV consensus merge", + "step": "22", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "annotsv": { + "title": "Structural variants, class 4 and 5 (AnnotSV)", + "step": "05", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "expansions": { + "title": "Repeat expansions (ExpansionHunter)", + "step": "09", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "telomere": { + "title": "Telomere content (TelomereHunter)", + "step": "10", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "roh": { + "title": "Runs of homozygosity", + "step": "11", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "haplogroup": { + "title": "Mitochondrial haplogroup", + "step": "12", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "y_haplogroup": { + "title": "Y-chromosome haplogroup (Yleaf)", + "step": "37", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "y_tree": { + "title": "Y placement on the current public tree", + "step": "37", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "y_str": { + "title": "Y-STR markers (HipSTR)", + "step": "45", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "consumer_export": { + "title": "Raw-data export (23andMe v5 layout)", + "step": "40", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "bloodtype": { + "title": "Blood groups (predicted)", + "step": "41", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "lpa": { + "title": "Lp(a): LPA KIV-2 repeat count", + "step": "46", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "vntyper": { + "title": "MUC1 VNTR frameshifts (VNtyper)", + "step": "52", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "locityper": { + "title": "Locityper second opinion at hard loci", + "step": "53", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "mito": { + "title": "Mitochondrial variants", + "step": "20", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "traits": { + "title": "Traits panel", + "step": "42", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "archaic": { + "title": "Archaic ancestry (IBDmix)", + "step": "43", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "ancient": { + "title": "Ancient populations (AADR PCA)", + "step": "44", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "viral": { + "title": "Viral DNA in the unmapped reads", + "step": "47", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "exomiser": { + "title": "Symptom-driven ranking (Exomiser)", + "step": "48", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "chip": { + "title": "Clonal haematopoiesis (CHIP)", + "step": "49", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "mei": { + "title": "Mobile element insertions (MEGAnE)", + "step": "50", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "mosaic": { + "title": "Mosaic chromosomal alterations (MoChA)", + "step": "51", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "cpsr": { + "title": "Cancer predisposition (CPSR)", + "step": "17", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "clinical": { + "title": "Clinical variant filter", + "step": "23", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "slivar": { + "title": "Variant prioritization (slivar)", + "step": "31", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + } + }, + "cyp2d6": { + "calls": { + "PharmCAT": null, + "pypgx": null, + "Cyrius": null + }, + "agree": null, + "consensus": null, + "probable": null + }, + "not_run": [ + "Coverage (mosdepth)", + "Gene callability (mosdepth)", + "Sex check (indexcov)", + "Sample identity and contamination (somalier, VerifyBamID2)", + "Mosaic loss of chromosome Y or X", + "Variant calling", + "ClinVar screen", + "PharmCAT", + "CPIC drug-gene recommendations", + "pypgx", + "Cyrius (CYP2D6)", + "SMN1/SMN2 copy number (Parascopy, short reads)", + "Paralog genes (Paraphase, PacBio HiFi)", + "HLA typing (T1K)", + "Polygenic risk scores", + "Fine-grained ancestry (ADMIXTURE, RFMix)", + "Structural variants (Manta)", + "Structural variants (Delly)", + "Copy number (CNVpytor)", + "SV consensus merge", + "Structural variants, class 4 and 5 (AnnotSV)", + "Repeat expansions (ExpansionHunter)", + "Telomere content (TelomereHunter)", + "Runs of homozygosity", + "Mitochondrial haplogroup", + "Y-chromosome haplogroup (Yleaf)", + "Y placement on the current public tree", + "Y-STR markers (HipSTR)", + "Raw-data export (23andMe v5 layout)", + "Blood groups (predicted)", + "Lp(a): LPA KIV-2 repeat count", + "MUC1 VNTR frameshifts (VNtyper)", + "Locityper second opinion at hard loci", + "Mitochondrial variants", + "Traits panel", + "Archaic ancestry (IBDmix)", + "Ancient populations (AADR PCA)", + "Viral DNA in the unmapped reads", + "Symptom-driven ranking (Exomiser)", + "Clonal haematopoiesis (CHIP)", + "Mobile element insertions (MEGAnE)", + "Mosaic chromosomal alterations (MoChA)", + "Cancer predisposition (CPSR)", + "Clinical variant filter", + "Variant prioritization (slivar)" + ], + "not_assessed": [ + "Mosaic and low-fraction small variants (only chrM heteroplasmy is reported, and with step 49 the CHIP genes)", + "Methylation and imprinting", + "Repeat expansions outside the ExpansionHunter catalog", + "Phase: two variants in one gene are compound-het candidates, not confirmed", + "Variants of uncertain significance (not interpreted)", + "Polygenic score percentiles: no ancestry reference panel was used, so the scores are raw sums", + "HBA1/HBA2 copy number (alpha-thalassaemia deletions): neither step 35's read-depth count (short reads) nor step 35b (Paraphase, PacBio HiFi) made a call", + "Mobile element insertions (Alu, L1 and SVA, the FKTN, TAF1 and BBS1 SVA insertions among them): not looked for (step 50, MEGAnE, is opt-in)", + "MUC1 VNTR frameshifts (ADTKD-MUC1): step 52 (VNtyper, opt-in) gave no reading; no standard caller sees them", + "Autosomal mosaic chromosomal alterations (large gains, losses and copy-neutral LOH in a share of the blood cells): step 51 (MoChA) did not assess this sample" + ] +} diff --git a/tests/parity/golden/summary-collect/all-history/all-history.json b/tests/parity/golden/summary-collect/all-history/all-history.json index e663f2649..1a66e86c7 100644 --- a/tests/parity/golden/summary-collect/all-history/all-history.json +++ b/tests/parity/golden/summary-collect/all-history/all-history.json @@ -1,7 +1,7 @@ { "schema_version": 2, "sample": "S", - "generated_utc": "2026-11-19 11:33 UTC", + "generated_utc": "2026-11-20 10:24 UTC", "run": { "status_file": true, "started_utc": "2020-01-01 00:00 UTC", @@ -12717,7 +12717,8 @@ "significance": "Likely pathogenic", "stars": 1, "inheritance": "AR", - "condition": "Nonsyndromic hearing loss, recessive (DFNB1A)" + "condition": "Nonsyndromic hearing loss, recessive (DFNB1A)", + "combined_allele": "combined allele of chr13:20189473 C>T + chr13:20189475 G>A" }, { "gene": "BRCA1", @@ -12726,7 +12727,8 @@ "significance": "Pathogenic", "stars": 3, "inheritance": "AR", - "condition": "Fanconi anemia" + "condition": "Fanconi anemia", + "combined_allele": "part of a combined allele: chr17:43057100 C>T, chr17:43057102 A>G; unphased, so the parts may sit on different haplotypes" }, { "gene": "GLA", @@ -12735,7 +12737,8 @@ "significance": "Pathogenic", "stars": 0, "inheritance": "XL", - "condition": "Fabry disease" + "condition": "Fabry disease", + "combined_allele": "possibly one allele with chrX:101398004 G>A: check ClinVar for a combined record" }, { "gene": "HBA1", @@ -12775,7 +12778,7 @@ { "gene": "SMN1", "verdict": "biallelic", - "why": "the variant is called homozygous inside the deletion: it is hemizygous, on the one copy the deletion leaves", + "why": "the variant is called homozygous inside the deletion: hemizygous on the copy the deletion leaves if the deletion is real, homozygous if not; both copies carry it either way", "deletion": "one SMN1 copy (Parascopy, step 35)", "variant": "chr5:70951946 C>T", "genotype": "hemizygous", @@ -12795,6 +12798,145 @@ } } }, + "acmg_sf": { + "title": "ACMG secondary findings", + "step": "06", + "state": "ok", + "source": "clinvar/S_clinvar_hits.vcf", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "version": "ACMG SF v3.3", + "genes_on_list": 84, + "rules": "assets/acmg_sf.tsv", + "clinvar_hits": [ + { + "gene": "MUTYH", + "variant": "chr1:45331556 C>T", + "genotype": "het", + "significance": "Pathogenic", + "stars": 2, + "low_confidence": false, + "rule": "P and LP (2 variants)", + "rule_note": null, + "severity": null, + "pair": "biallelic", + "phase": "in trans: read-backed phase puts them on different copies (phase set 45331000)" + }, + { + "gene": "BRCA1", + "variant": "chr17:43057100 C>T", + "genotype": "het", + "significance": "Pathogenic", + "stars": 3, + "low_confidence": false, + "combined_allele": "part of a combined allele: chr17:43057100 C>T, chr17:43057102 A>G; unphased, so the parts may sit on different haplotypes", + "rule": "All P and LP", + "rule_note": null, + "severity": null + }, + { + "gene": "GLA", + "variant": "chrX:101398000 C>T", + "genotype": "1", + "significance": "Pathogenic", + "stars": 0, + "low_confidence": false, + "combined_allele": "possibly one allele with chrX:101398004 G>A: check ClinVar for a combined record", + "rule": "All hemi, het, homozygous P and LP", + "rule_note": null, + "severity": null + } + ], + "clinvar_checked": true, + "high_impact": [ + { + "gene": "MUTYH", + "variant": "chr1:45332000 G>A", + "genotype": "het", + "consequence": "stop_gained", + "transcript": "MANE", + "frequency": "rare", + "frequency_unknown": false, + "weak_call": false, + "call_note": null, + "gq": 40, + "dp": 30, + "ad": "15,15", + "rule": "P and LP (2 variants)", + "rule_note": null, + "severity": null, + "pair": "biallelic", + "phase": "in trans: read-backed phase puts them on different copies (phase set 45331000)" + }, + { + "gene": "MYBPC3", + "variant": "chr11:47332000 G>A", + "genotype": "het", + "consequence": "splice_donor_variant,intron_variant", + "transcript": "ANY", + "frequency": "rare", + "frequency_unknown": false, + "weak_call": false, + "call_note": null, + "gq": null, + "dp": null, + "ad": null, + "rule": "All P and LP", + "rule_note": null, + "severity": null + }, + { + "gene": "MSH2", + "variant": "chr2:47414000 A>AT", + "genotype": "het", + "consequence": "frameshift_variant", + "transcript": "CANONICAL", + "frequency": "rare", + "frequency_unknown": false, + "weak_call": true, + "call_note": "alt reads 0.07 of the depth on a heterozygote", + "gq": 50, + "dp": 30, + "ad": "28,2", + "rule": "All P and LP", + "rule_note": "A deletion of the 3' end of EPCAM silences MSH2 and counts as an MSH2 finding.", + "severity": null + } + ], + "high_impact_checked": true, + "high_impact_rare": 2, + "high_impact_weak": 1, + "high_impact_frequency_unknown": 0, + "structural": [], + "structural_checked": true, + "structural_note": null, + "not_reported": [ + { + "gene": "HFE", + "variant": "chr6:26092913 G>A", + "genotype": "het", + "source": "ClinVar", + "reason": "HFE is reported only for: HFE p.C282Y homozygotes only" + }, + { + "gene": "BTD", + "variant": "chr3:15645186 G>C", + "genotype": "het", + "source": "ClinVar", + "reason": "one heterozygous variant; BTD is reported with P and LP (2 variants)" + }, + { + "gene": "HFE", + "variant": "chr6:26093000 C>T", + "genotype": "hom", + "source": "HIGH impact", + "reason": "HFE is reported only for: HFE p.C282Y homozygotes only" + } + ], + "two_hit_note": null + } + }, "pharmcat": { "title": "PharmCAT", "step": "07", @@ -15281,7 +15423,9 @@ "low_confidence": false, "rule": "P and LP (2 variants)", "rule_note": null, - "severity": null + "severity": null, + "pair": "biallelic", + "phase": "in trans: read-backed phase puts them on different copies (phase set 45331000)" }, { "gene": "BRCA1", @@ -15290,6 +15434,7 @@ "significance": "Pathogenic", "stars": 3, "low_confidence": false, + "combined_allele": "part of a combined allele: chr17:43057100 C>T, chr17:43057102 A>G; unphased, so the parts may sit on different haplotypes", "rule": "All P and LP", "rule_note": null, "severity": null @@ -15301,6 +15446,7 @@ "significance": "Pathogenic", "stars": 0, "low_confidence": false, + "combined_allele": "possibly one allele with chrX:101398004 G>A: check ClinVar for a combined record", "rule": "All hemi, het, homozygous P and LP", "rule_note": null, "severity": null @@ -15323,7 +15469,9 @@ "ad": "15,15", "rule": "P and LP (2 variants)", "rule_note": null, - "severity": null + "severity": null, + "pair": "biallelic", + "phase": "in trans: read-backed phase puts them on different copies (phase set 45331000)" }, { "gene": "MYBPC3", @@ -15582,6 +15730,7 @@ "new_since": { "previous_utc": "2021-01-01 00:00 UTC", "sections": [ + "acmg_sf", "ancestry_fine", "ancient", "annotsv", diff --git a/tests/parity/golden/summary-collect/all-inf/all-inf.json b/tests/parity/golden/summary-collect/all-inf/all-inf.json index 99b10ea8d..52705535b 100644 --- a/tests/parity/golden/summary-collect/all-inf/all-inf.json +++ b/tests/parity/golden/summary-collect/all-inf/all-inf.json @@ -1,7 +1,7 @@ { "schema_version": 2, "sample": "S", - "generated_utc": "2026-11-13 23:22 UTC", + "generated_utc": "2026-11-19 23:58 UTC", "run": { "status_file": true, "started_utc": "2020-01-01 00:00 UTC", @@ -137,6 +137,15 @@ "note": null, "data": {} }, + "acmg_sf": { + "title": "ACMG secondary findings", + "step": "06", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, "pharmcat": { "title": "PharmCAT", "step": "07", diff --git a/tests/parity/golden/summary-collect/all-nf/all-nf.json b/tests/parity/golden/summary-collect/all-nf/all-nf.json index 9008bdbca..e88319c52 100644 --- a/tests/parity/golden/summary-collect/all-nf/all-nf.json +++ b/tests/parity/golden/summary-collect/all-nf/all-nf.json @@ -1,7 +1,7 @@ { "schema_version": 2, "sample": "S", - "generated_utc": "2026-11-15 22:16 UTC", + "generated_utc": "2026-11-20 10:24 UTC", "run": { "status_file": true, "started_utc": "2020-01-01 00:00 UTC", @@ -12526,7 +12526,8 @@ "significance": "Likely pathogenic", "stars": 1, "inheritance": "AR", - "condition": "Nonsyndromic hearing loss, recessive (DFNB1A)" + "condition": "Nonsyndromic hearing loss, recessive (DFNB1A)", + "combined_allele": "combined allele of chr13:20189473 C>T + chr13:20189475 G>A" }, { "gene": "BRCA1", @@ -12535,7 +12536,8 @@ "significance": "Pathogenic", "stars": 3, "inheritance": "AR", - "condition": "Fanconi anemia" + "condition": "Fanconi anemia", + "combined_allele": "part of a combined allele: chr17:43057100 C>T, chr17:43057102 A>G; unphased, so the parts may sit on different haplotypes" }, { "gene": "GLA", @@ -12544,7 +12546,8 @@ "significance": "Pathogenic", "stars": 0, "inheritance": "XL", - "condition": "Fabry disease" + "condition": "Fabry disease", + "combined_allele": "possibly one allele with chrX:101398004 G>A: check ClinVar for a combined record" }, { "gene": "HBA1", @@ -12603,6 +12606,145 @@ } } }, + "acmg_sf": { + "title": "ACMG secondary findings", + "step": "06", + "state": "ok", + "source": "clinvar/S_clinvar_hits.vcf", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "version": "ACMG SF v3.3", + "genes_on_list": 84, + "rules": "assets/acmg_sf.tsv", + "clinvar_hits": [ + { + "gene": "MUTYH", + "variant": "chr1:45331556 C>T", + "genotype": "het", + "significance": "Pathogenic", + "stars": 2, + "low_confidence": false, + "rule": "P and LP (2 variants)", + "rule_note": null, + "severity": null, + "pair": "biallelic", + "phase": "in trans: read-backed phase puts them on different copies (phase set 45331000)" + }, + { + "gene": "BRCA1", + "variant": "chr17:43057100 C>T", + "genotype": "het", + "significance": "Pathogenic", + "stars": 3, + "low_confidence": false, + "combined_allele": "part of a combined allele: chr17:43057100 C>T, chr17:43057102 A>G; unphased, so the parts may sit on different haplotypes", + "rule": "All P and LP", + "rule_note": null, + "severity": null + }, + { + "gene": "GLA", + "variant": "chrX:101398000 C>T", + "genotype": "1", + "significance": "Pathogenic", + "stars": 0, + "low_confidence": false, + "combined_allele": "possibly one allele with chrX:101398004 G>A: check ClinVar for a combined record", + "rule": "All hemi, het, homozygous P and LP", + "rule_note": null, + "severity": null + } + ], + "clinvar_checked": true, + "high_impact": [ + { + "gene": "MUTYH", + "variant": "chr1:45332000 G>A", + "genotype": "het", + "consequence": "stop_gained", + "transcript": "MANE", + "frequency": "rare", + "frequency_unknown": false, + "weak_call": false, + "call_note": null, + "gq": 40, + "dp": 30, + "ad": "15,15", + "rule": "P and LP (2 variants)", + "rule_note": null, + "severity": null, + "pair": "biallelic", + "phase": "in trans: read-backed phase puts them on different copies (phase set 45331000)" + }, + { + "gene": "MYBPC3", + "variant": "chr11:47332000 G>A", + "genotype": "het", + "consequence": "splice_donor_variant,intron_variant", + "transcript": "ANY", + "frequency": "rare", + "frequency_unknown": false, + "weak_call": false, + "call_note": null, + "gq": null, + "dp": null, + "ad": null, + "rule": "All P and LP", + "rule_note": null, + "severity": null + }, + { + "gene": "MSH2", + "variant": "chr2:47414000 A>AT", + "genotype": "het", + "consequence": "frameshift_variant", + "transcript": "CANONICAL", + "frequency": "rare", + "frequency_unknown": false, + "weak_call": true, + "call_note": "alt reads 0.07 of the depth on a heterozygote", + "gq": 50, + "dp": 30, + "ad": "28,2", + "rule": "All P and LP", + "rule_note": "A deletion of the 3' end of EPCAM silences MSH2 and counts as an MSH2 finding.", + "severity": null + } + ], + "high_impact_checked": true, + "high_impact_rare": 2, + "high_impact_weak": 1, + "high_impact_frequency_unknown": 0, + "structural": [], + "structural_checked": true, + "structural_note": null, + "not_reported": [ + { + "gene": "HFE", + "variant": "chr6:26092913 G>A", + "genotype": "het", + "source": "ClinVar", + "reason": "HFE is reported only for: HFE p.C282Y homozygotes only" + }, + { + "gene": "BTD", + "variant": "chr3:15645186 G>C", + "genotype": "het", + "source": "ClinVar", + "reason": "one heterozygous variant; BTD is reported with P and LP (2 variants)" + }, + { + "gene": "HFE", + "variant": "chr6:26093000 C>T", + "genotype": "hom", + "source": "HIGH impact", + "reason": "HFE is reported only for: HFE p.C282Y homozygotes only" + } + ], + "two_hit_note": null + } + }, "pharmcat": { "title": "PharmCAT", "step": "07", @@ -13782,7 +13924,9 @@ "low_confidence": false, "rule": "P and LP (2 variants)", "rule_note": null, - "severity": null + "severity": null, + "pair": "biallelic", + "phase": "in trans: read-backed phase puts them on different copies (phase set 45331000)" }, { "gene": "BRCA1", @@ -13791,6 +13935,7 @@ "significance": "Pathogenic", "stars": 3, "low_confidence": false, + "combined_allele": "part of a combined allele: chr17:43057100 C>T, chr17:43057102 A>G; unphased, so the parts may sit on different haplotypes", "rule": "All P and LP", "rule_note": null, "severity": null @@ -13802,6 +13947,7 @@ "significance": "Pathogenic", "stars": 0, "low_confidence": false, + "combined_allele": "possibly one allele with chrX:101398004 G>A: check ClinVar for a combined record", "rule": "All hemi, het, homozygous P and LP", "rule_note": null, "severity": null @@ -13824,7 +13970,9 @@ "ad": "15,15", "rule": "P and LP (2 variants)", "rule_note": null, - "severity": null + "severity": null, + "pair": "biallelic", + "phase": "in trans: read-backed phase puts them on different copies (phase set 45331000)" }, { "gene": "MYBPC3", diff --git a/tests/parity/golden/summary-collect/all/all.json b/tests/parity/golden/summary-collect/all/all.json index 240801087..47472619f 100644 --- a/tests/parity/golden/summary-collect/all/all.json +++ b/tests/parity/golden/summary-collect/all/all.json @@ -1,7 +1,7 @@ { "schema_version": 2, "sample": "S", - "generated_utc": "2026-11-19 11:33 UTC", + "generated_utc": "2026-11-20 10:24 UTC", "run": { "status_file": true, "started_utc": "2020-01-01 00:00 UTC", @@ -12722,7 +12722,8 @@ "significance": "Likely pathogenic", "stars": 1, "inheritance": "AR", - "condition": "Nonsyndromic hearing loss, recessive (DFNB1A)" + "condition": "Nonsyndromic hearing loss, recessive (DFNB1A)", + "combined_allele": "combined allele of chr13:20189473 C>T + chr13:20189475 G>A" }, { "gene": "BRCA1", @@ -12731,7 +12732,8 @@ "significance": "Pathogenic", "stars": 3, "inheritance": "AR", - "condition": "Fanconi anemia" + "condition": "Fanconi anemia", + "combined_allele": "part of a combined allele: chr17:43057100 C>T, chr17:43057102 A>G; unphased, so the parts may sit on different haplotypes" }, { "gene": "GLA", @@ -12740,7 +12742,8 @@ "significance": "Pathogenic", "stars": 0, "inheritance": "XL", - "condition": "Fabry disease" + "condition": "Fabry disease", + "combined_allele": "possibly one allele with chrX:101398004 G>A: check ClinVar for a combined record" }, { "gene": "HBA1", @@ -12780,7 +12783,7 @@ { "gene": "SMN1", "verdict": "biallelic", - "why": "the variant is called homozygous inside the deletion: it is hemizygous, on the one copy the deletion leaves", + "why": "the variant is called homozygous inside the deletion: hemizygous on the copy the deletion leaves if the deletion is real, homozygous if not; both copies carry it either way", "deletion": "one SMN1 copy (Parascopy, step 35)", "variant": "chr5:70951946 C>T", "genotype": "hemizygous", @@ -12800,6 +12803,145 @@ } } }, + "acmg_sf": { + "title": "ACMG secondary findings", + "step": "06", + "state": "ok", + "source": "clinvar/S_clinvar_hits.vcf", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "version": "ACMG SF v3.3", + "genes_on_list": 84, + "rules": "assets/acmg_sf.tsv", + "clinvar_hits": [ + { + "gene": "MUTYH", + "variant": "chr1:45331556 C>T", + "genotype": "het", + "significance": "Pathogenic", + "stars": 2, + "low_confidence": false, + "rule": "P and LP (2 variants)", + "rule_note": null, + "severity": null, + "pair": "biallelic", + "phase": "in trans: read-backed phase puts them on different copies (phase set 45331000)" + }, + { + "gene": "BRCA1", + "variant": "chr17:43057100 C>T", + "genotype": "het", + "significance": "Pathogenic", + "stars": 3, + "low_confidence": false, + "combined_allele": "part of a combined allele: chr17:43057100 C>T, chr17:43057102 A>G; unphased, so the parts may sit on different haplotypes", + "rule": "All P and LP", + "rule_note": null, + "severity": null + }, + { + "gene": "GLA", + "variant": "chrX:101398000 C>T", + "genotype": "1", + "significance": "Pathogenic", + "stars": 0, + "low_confidence": false, + "combined_allele": "possibly one allele with chrX:101398004 G>A: check ClinVar for a combined record", + "rule": "All hemi, het, homozygous P and LP", + "rule_note": null, + "severity": null + } + ], + "clinvar_checked": true, + "high_impact": [ + { + "gene": "MUTYH", + "variant": "chr1:45332000 G>A", + "genotype": "het", + "consequence": "stop_gained", + "transcript": "MANE", + "frequency": "rare", + "frequency_unknown": false, + "weak_call": false, + "call_note": null, + "gq": 40, + "dp": 30, + "ad": "15,15", + "rule": "P and LP (2 variants)", + "rule_note": null, + "severity": null, + "pair": "biallelic", + "phase": "in trans: read-backed phase puts them on different copies (phase set 45331000)" + }, + { + "gene": "MYBPC3", + "variant": "chr11:47332000 G>A", + "genotype": "het", + "consequence": "splice_donor_variant,intron_variant", + "transcript": "ANY", + "frequency": "rare", + "frequency_unknown": false, + "weak_call": false, + "call_note": null, + "gq": null, + "dp": null, + "ad": null, + "rule": "All P and LP", + "rule_note": null, + "severity": null + }, + { + "gene": "MSH2", + "variant": "chr2:47414000 A>AT", + "genotype": "het", + "consequence": "frameshift_variant", + "transcript": "CANONICAL", + "frequency": "rare", + "frequency_unknown": false, + "weak_call": true, + "call_note": "alt reads 0.07 of the depth on a heterozygote", + "gq": 50, + "dp": 30, + "ad": "28,2", + "rule": "All P and LP", + "rule_note": "A deletion of the 3' end of EPCAM silences MSH2 and counts as an MSH2 finding.", + "severity": null + } + ], + "high_impact_checked": true, + "high_impact_rare": 2, + "high_impact_weak": 1, + "high_impact_frequency_unknown": 0, + "structural": [], + "structural_checked": true, + "structural_note": null, + "not_reported": [ + { + "gene": "HFE", + "variant": "chr6:26092913 G>A", + "genotype": "het", + "source": "ClinVar", + "reason": "HFE is reported only for: HFE p.C282Y homozygotes only" + }, + { + "gene": "BTD", + "variant": "chr3:15645186 G>C", + "genotype": "het", + "source": "ClinVar", + "reason": "one heterozygous variant; BTD is reported with P and LP (2 variants)" + }, + { + "gene": "HFE", + "variant": "chr6:26093000 C>T", + "genotype": "hom", + "source": "HIGH impact", + "reason": "HFE is reported only for: HFE p.C282Y homozygotes only" + } + ], + "two_hit_note": null + } + }, "pharmcat": { "title": "PharmCAT", "step": "07", @@ -15286,7 +15428,9 @@ "low_confidence": false, "rule": "P and LP (2 variants)", "rule_note": null, - "severity": null + "severity": null, + "pair": "biallelic", + "phase": "in trans: read-backed phase puts them on different copies (phase set 45331000)" }, { "gene": "BRCA1", @@ -15295,6 +15439,7 @@ "significance": "Pathogenic", "stars": 3, "low_confidence": false, + "combined_allele": "part of a combined allele: chr17:43057100 C>T, chr17:43057102 A>G; unphased, so the parts may sit on different haplotypes", "rule": "All P and LP", "rule_note": null, "severity": null @@ -15306,6 +15451,7 @@ "significance": "Pathogenic", "stars": 0, "low_confidence": false, + "combined_allele": "possibly one allele with chrX:101398004 G>A: check ClinVar for a combined record", "rule": "All hemi, het, homozygous P and LP", "rule_note": null, "severity": null @@ -15328,7 +15474,9 @@ "ad": "15,15", "rule": "P and LP (2 variants)", "rule_note": null, - "severity": null + "severity": null, + "pair": "biallelic", + "phase": "in trans: read-backed phase puts them on different copies (phase set 45331000)" }, { "gene": "MYBPC3", diff --git a/tests/parity/golden/summary-collect/cb-full/cb-full.json b/tests/parity/golden/summary-collect/cb-full/cb-full.json new file mode 100644 index 000000000..86fc5522d --- /dev/null +++ b/tests/parity/golden/summary-collect/cb-full/cb-full.json @@ -0,0 +1,1111 @@ +{ + "schema_version": 2, + "sample": "S", + "generated_utc": "2026-11-19 23:00 UTC", + "run": { + "status_file": true, + "started_utc": "2020-01-01 00:00 UTC", + "declared_sex": null + }, + "databases": { + "clinvar_release": null, + "cpsr_clinvar_release": null, + "hla_database": null + }, + "manifest": [], + "sections": { + "clinvar": { + "title": "ClinVar screen", + "step": "06", + "state": "ok", + "source": "clinvar/S_clinvar_hits.vcf", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "count": 8, + "by_stars": { + "4": 0, + "3": 2, + "2": 3, + "1": 1, + "0": 2 + }, + "hits": [ + { + "stars": 4, + "chrom": "chr7", + "pos": 117559590, + "ref": "ATCT", + "alt": "A", + "genotype": "het", + "gene": "CFTR", + "significance": "Pathogenic", + "review_status": "practice guideline", + "combined_allele": ".", + "dp": 30, + "gq": 15, + "low_confidence": true, + "gnomad_exome_af": 0.008, + "gnomad_genome_af": 0.007, + "rsids": [ + "rs113993960" + ], + "af": 0.008, + "common": false, + "cdna": { + "check": "not_checked", + "note": "not in the read-check table", + "alt_reads": null, + "alt_clipped": null, + "ref_reads": null, + "ref_clipped": null + } + }, + { + "stars": 3, + "chrom": "chr17", + "pos": 43057100, + "ref": "C", + "alt": "T", + "genotype": "het", + "gene": "BRCA1,NBR2", + "significance": "Pathogenic", + "review_status": "reviewed by expert panel", + "combined_allele": "part of a combined allele: chr17:43057100 C>T, chr17:43057102 A>G; unphased, so the parts may sit on different haplotypes", + "dp": 35, + "gq": 60, + "low_confidence": false, + "gnomad_exome_af": null, + "gnomad_genome_af": null, + "rsids": [], + "af": null, + "common": false, + "cdna": { + "check": "not_checked", + "note": "not in the read-check table", + "alt_reads": null, + "alt_clipped": null, + "ref_reads": null, + "ref_clipped": null + } + }, + { + "stars": 3, + "chrom": "chr6", + "pos": 26092913, + "ref": "G", + "alt": "A", + "genotype": "het", + "gene": "HFE", + "significance": "Pathogenic", + "review_status": "reviewed by expert panel", + "combined_allele": ".", + "dp": 40, + "gq": 99, + "low_confidence": false, + "gnomad_exome_af": 0.06, + "gnomad_genome_af": 0.05, + "rsids": [ + "rs99", + "rs1800562" + ], + "af": 0.06, + "common": true, + "cdna": { + "check": "clean", + "note": "", + "alt_reads": 20, + "alt_clipped": 0, + "ref_reads": 20, + "ref_clipped": 0, + "construct": null + } + }, + { + "stars": 2, + "chrom": "chr1", + "pos": 45331556, + "ref": "C", + "alt": "T", + "genotype": "het", + "gene": "MUTYH", + "significance": "Pathogenic", + "review_status": "criteria provided, multiple submitters, no conflicts", + "combined_allele": ".", + "dp": 30, + "gq": 50, + "low_confidence": false, + "gnomad_exome_af": 0.002, + "gnomad_genome_af": 0.0005, + "rsids": [ + "rs36053993" + ], + "af": 0.002, + "common": false, + "cdna": { + "check": "flagged", + "note": "possible cDNA/transgene contamination: check the reads", + "alt_reads": 12, + "alt_clipped": 6, + "ref_reads": 10, + "ref_clipped": 0, + "construct": "yes" + } + }, + { + "stars": 2, + "chrom": "chr16", + "pos": 176700, + "ref": "G", + "alt": "A", + "genotype": "het", + "gene": "HBA1", + "significance": "Pathogenic", + "review_status": "criteria provided, multiple submitters, no conflicts", + "combined_allele": ".", + "dp": 31, + "gq": 45, + "low_confidence": false, + "gnomad_exome_af": null, + "gnomad_genome_af": null, + "rsids": [], + "af": null, + "common": false, + "cdna": { + "check": "not_checked", + "note": "not in the read-check table", + "alt_reads": null, + "alt_clipped": null, + "ref_reads": null, + "ref_clipped": null + } + }, + { + "stars": 2, + "chrom": "chr5", + "pos": 70951946, + "ref": "C", + "alt": "T", + "genotype": "hom", + "gene": "SMN1", + "significance": "Pathogenic", + "review_status": "criteria provided, multiple submitters, no conflicts", + "combined_allele": ".", + "dp": 31, + "gq": 45, + "low_confidence": false, + "gnomad_exome_af": null, + "gnomad_genome_af": null, + "rsids": [], + "af": null, + "common": false, + "cdna": { + "check": "not_checked", + "note": "not in the read-check table", + "alt_reads": null, + "alt_clipped": null, + "ref_reads": null, + "ref_clipped": null + } + }, + { + "stars": 1, + "chrom": "chr13", + "pos": 20189473, + "ref": "C", + "alt": "T", + "genotype": "one copy, other copy not called ref (1/.)", + "gene": "GJB2", + "significance": "Likely pathogenic", + "review_status": "criteria provided, single submitter", + "combined_allele": "combined allele of chr13:20189473 C>T + chr13:20189475 G>A", + "dp": 5, + "gq": 40, + "low_confidence": true, + "gnomad_exome_af": 0.03, + "gnomad_genome_af": null, + "rsids": [ + "rs80338939" + ], + "af": 0.03, + "common": true, + "cdna": { + "check": "not_checked", + "note": "not in the read-check table", + "alt_reads": null, + "alt_clipped": null, + "ref_reads": null, + "ref_clipped": null + } + }, + { + "stars": 1, + "chrom": "chr3", + "pos": 15645186, + "ref": "G", + "alt": "C", + "genotype": "het", + "gene": "BTD", + "significance": "Pathogenic/Likely pathogenic", + "review_status": "criteria provided, conflicting classifications", + "combined_allele": ".", + "dp": null, + "gq": null, + "low_confidence": false, + "gnomad_exome_af": null, + "gnomad_genome_af": null, + "rsids": [], + "af": null, + "common": false, + "cdna": { + "check": "not_checked", + "note": "not in the read-check table", + "alt_reads": null, + "alt_clipped": null, + "ref_reads": null, + "ref_clipped": null + } + }, + { + "stars": 0, + "chrom": "chr2", + "pos": 100, + "ref": "A", + "alt": "G", + "genotype": "het", + "gene": ".", + "significance": ".", + "review_status": ".", + "combined_allele": ".", + "dp": null, + "gq": null, + "low_confidence": false, + "gnomad_exome_af": null, + "gnomad_genome_af": null, + "rsids": [], + "af": null, + "common": false, + "cdna": { + "check": "not_checked", + "note": "not in the read-check table", + "alt_reads": null, + "alt_clipped": null, + "ref_reads": null, + "ref_clipped": null + } + }, + { + "stars": 0, + "chrom": "chrX", + "pos": 101398000, + "ref": "C", + "alt": "T", + "genotype": "1", + "gene": "GLA", + "significance": "Pathogenic", + "review_status": "no assertion criteria provided", + "combined_allele": "possibly one allele with chrX:101398004 G>A: check ClinVar for a combined record", + "dp": null, + "gq": null, + "low_confidence": false, + "gnomad_exome_af": null, + "gnomad_genome_af": null, + "rsids": [], + "af": null, + "common": false, + "cdna": { + "check": "not_checked", + "note": "not in the read-check table", + "alt_reads": null, + "alt_clipped": null, + "ref_reads": null, + "ref_clipped": null + } + } + ], + "low_confidence": 2, + "call_floor": { + "GQ": 20, + "DP": 8 + }, + "frequency": { + "source": "vep/S_vep.vcf.gz", + "note": null, + "common_af": 0.01 + }, + "cdna_flagged": 1, + "construct_sites": 1, + "cdna_scan": { + "note": "2 genes with spliced reads", + "loci": [ + { + "chrom": "chr1", + "start": 100, + "end": 200, + "junctions": 2, + "reads": 5, + "junction_list": "A:1-2,A:3-4" + } + ] + }, + "deep_intronic": [ + { + "chrom": "chr7", + "pos": 117639961, + "ref": "C", + "alt": "T", + "gene": "CFTR", + "hgvs": "c.3718-2477C>T", + "clinvar_id": "7129", + "call": "no call", + "detail": "" + } + ] + } + }, + "carrier": { + "title": "Carrier list", + "step": "06", + "state": "ok", + "source": "clinvar/S_clinvar_hits.vcf", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "genes_on_list": 3292, + "list": "assets/carrier_genes.tsv", + "carriers": [ + { + "gene": "MUTYH", + "variant": "chr1:45331556 C>T", + "genotype": "het", + "significance": "Pathogenic", + "stars": 2, + "inheritance": "AR", + "condition": "MUTYH-related polyposis" + }, + { + "gene": "HFE", + "variant": "chr6:26092913 G>A", + "genotype": "het", + "significance": "Pathogenic", + "stars": 3, + "inheritance": "AR", + "condition": "Symptomatic form of HFE-related hemochromatosis" + }, + { + "gene": "CFTR", + "variant": "chr7:117559590 ATCT>A", + "genotype": "het", + "significance": "Pathogenic", + "stars": 4, + "inheritance": "AR", + "condition": "Cystic fibrosis" + }, + { + "gene": "GJB2", + "variant": "chr13:20189473 C>T", + "genotype": "one copy, other copy not called ref (1/.)", + "significance": "Likely pathogenic", + "stars": 1, + "inheritance": "AR", + "condition": "Nonsyndromic hearing loss, recessive (DFNB1A)", + "combined_allele": "combined allele of chr13:20189473 C>T + chr13:20189475 G>A" + }, + { + "gene": "BRCA1", + "variant": "chr17:43057100 C>T", + "genotype": "het", + "significance": "Pathogenic", + "stars": 3, + "inheritance": "AR", + "condition": "Fanconi anemia", + "combined_allele": "part of a combined allele: chr17:43057100 C>T, chr17:43057102 A>G; unphased, so the parts may sit on different haplotypes" + }, + { + "gene": "GLA", + "variant": "chrX:101398000 C>T", + "genotype": "hemizygous", + "significance": "Pathogenic", + "stars": 0, + "inheritance": "XL", + "condition": "Fabry disease", + "combined_allele": "possibly one allele with chrX:101398004 G>A: check ClinVar for a combined record" + }, + { + "gene": "HBA1", + "variant": "chr16:176700 G>A", + "genotype": "het", + "significance": "Pathogenic", + "stars": 2, + "inheritance": "AR", + "condition": "Alpha-thalassemia" + }, + { + "gene": "SMN1", + "variant": "chr5:70951946 C>T", + "genotype": "hemizygous", + "significance": "Pathogenic", + "stars": 2, + "inheritance": "AR", + "condition": "Spinal muscular atrophy", + "hemizygous": "called homozygous inside one SMN1 copy (Parascopy, step 35)" + } + ], + "set_aside": [ + { + "gene": "BTD", + "variant": "chr3:15645186 G>C", + "genotype": "het", + "significance": "Pathogenic/Likely pathogenic", + "stars": 1, + "inheritance": "AR", + "condition": "Biotinidase deficiency", + "kind": "hypomorph", + "name": "p.Asp444His (p.Asp424His on NM_001370658.1), partial biotinidase deficiency" + } + ], + "two_hits": { + "genes": [ + { + "gene": "CFTR", + "verdict": "possibly biallelic", + "why": "a heterozygous call inside a called deletion: one of the two calls may be wrong; check the reads", + "deletion": "CFTR_del deletion, 1 of 2 copies (read depth, step 35)", + "variant": "chr7:117559590 ATCT>A", + "genotype": "het", + "allele": null, + "condition": "Cystic fibrosis", + "inheritance": "AR" + }, + { + "gene": "GJB2", + "verdict": "possibly biallelic", + "why": "a heterozygous call inside a called deletion: one of the two calls may be wrong; check the reads", + "deletion": "DEL chr13:20180000-20200000 (AnnotSV class 4, Manta)", + "variant": "chr13:20189473 C>T", + "genotype": "one copy, other copy not called ref (1/.)", + "allele": null, + "condition": "Nonsyndromic hearing loss, recessive (DFNB1A)", + "inheritance": "AR" + }, + { + "gene": "HBA1", + "verdict": "possibly biallelic", + "why": "phase unknown, possibly in trans (no read-backed phase links the two calls)", + "deletion": "3 of 4 alpha-globin genes (read depth, step 35)", + "variant": "chr16:176700 G>A", + "genotype": "het", + "allele": null, + "condition": "Alpha-thalassemia", + "inheritance": "AR" + }, + { + "gene": "MUTYH", + "verdict": "biallelic", + "why": "in trans: read-backed phase puts them on different copies (phase set 45331000)", + "deletion": "DEL chr1:45338000-45340000 (AnnotSV class 5, Manta)", + "variant": "chr1:45331556 C>T", + "genotype": "het", + "allele": null, + "condition": "MUTYH-related polyposis", + "inheritance": "AR" + }, + { + "gene": "SMN1", + "verdict": "biallelic", + "why": "the variant is called homozygous inside the deletion: hemizygous on the copy the deletion leaves if the deletion is real, homozygous if not; both copies carry it either way", + "deletion": "one SMN1 copy (Parascopy, step 35)", + "variant": "chr5:70951946 C>T", + "genotype": "hemizygous", + "allele": null, + "condition": "Spinal muscular atrophy", + "inheritance": "AR" + } + ], + "deletions_read": [ + "AnnotSV class 4 and 5 deletions (step 05)", + "step 35's interval table (read depth)", + "step 35's HBA1/HBA2 count", + "Parascopy's SMN1 count (step 35)" + ], + "deletions_not_read": [] + } + } + }, + "pharmcat": { + "title": "PharmCAT", + "step": "07", + "state": "ok", + "source": "pharmcat/S.report.json", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "version": "3.4.0", + "html_report": true + } + }, + "cpic": { + "title": "CPIC drug-gene recommendations", + "step": "27", + "state": "ok", + "source": "cpic/S_phenotypes.tsv", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "genes": [ + { + "gene": "CYP2D6", + "diplotype": "*1/*4", + "phenotype": "Intermediate Metabolizer", + "status": "non-normal" + }, + { + "gene": "CYP2C19", + "diplotype": "*1/*17", + "phenotype": "Rapid", + "status": "ambiguous" + }, + { + "gene": "CYP2C9", + "diplotype": "*1/*1", + "phenotype": "Normal", + "status": "normal" + }, + { + "gene": "DPYD", + "diplotype": null, + "phenotype": null, + "status": null + } + ], + "non_normal": 1, + "ambiguous": 1, + "not_called": 0, + "unclassified": 0, + "parse_failed": false, + "warnings": [ + "CYP2C19 has two possible phenotypes", + "last" + ] + } + }, + "pypgx": { + "title": "pypgx", + "step": "32", + "state": "ok", + "source": "pypgx/S_pypgx_summary.tsv", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "genes_total": 6, + "genes_called": 3, + "cyp2d6": "*1/*2", + "cnv_call": { + "CYP2D6": "Normal", + "CYP2A6": "not called: pypgx failed", + "CYP2B6": "not called: the CYP2D6 depth check failed", + "SLCO1B1": "not called: pypgx gave no copy-number call" + }, + "not_callable": [ + "CYP2E1" + ], + "low_gq": [ + { + "gene": "UGT1A1", + "diplotype": "Indeterminate", + "min_gq": 12, + "weakest": "chr2:1:A:G" + }, + { + "gene": "SLCO1B1", + "diplotype": "*1/*5", + "min_gq": null, + "weakest": "" + } + ], + "cyp2d6_evidence": { + "phenotype": "Normal Metabolizer", + "defining_filter": "PASS", + "quality": "ok" + }, + "depth_check": { + "status": "ok", + "gene_mapq1_share": "0.99", + "body_mapq20_share": "0.95" + }, + "comparison": { + "conflicts": 1, + "one_tool_only": 2, + "concordant": 1 + } + } + }, + "cyrius": { + "title": "Cyrius (CYP2D6)", + "step": "21", + "state": "ok", + "source": "cyrius/S_cyp2d6.tsv", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "genotype": "*2/*1", + "filter": "PASS" + } + }, + "cpsr": { + "title": "Cancer predisposition (CPSR)", + "step": "17", + "state": "ok", + "source": "cpsr/S.cpsr.grch38.classification.tsv.gz", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "html_report": true, + "classification_column": "CLASSIFICATION", + "classification": { + "Pathogenic": 1, + "Likely_Pathogenic": 1, + "VUS": 1, + "Benign": 1, + ".": 1 + }, + "plp": [ + { + "variant": "17:43057100 C>T", + "gene": "BRCA1", + "final": "Pathogenic", + "cpsr": "Likely_Benign", + "clinvar": "Pathogenic", + "authority": "ClinVar", + "acmg_codes": "PVS1", + "dp": 6, + "low_confidence": true, + "cdna": { + "check": "flagged", + "note": "splice", + "alt_reads": 5, + "alt_clipped": 5, + "ref_reads": 9, + "ref_clipped": 0, + "construct": null + } + }, + { + "variant": "13:32338000 G>A", + "gene": "BRCA2", + "final": "Likely_Pathogenic", + "cpsr": "VUS", + "clinvar": null, + "authority": "CPSR", + "acmg_codes": null, + "dp": 40, + "low_confidence": false, + "cdna": { + "check": "not_checked", + "note": "not in the read-check table", + "alt_reads": null, + "alt_clipped": null, + "ref_reads": null, + "ref_clipped": null + } + }, + { + "variant": "2:47403000 A>G", + "gene": "MSH2", + "final": "VUS", + "cpsr": "LP", + "clinvar": "B", + "authority": null, + "acmg_codes": null, + "dp": null, + "low_confidence": false, + "cdna": { + "check": "not_checked", + "note": "not in the read-check table", + "alt_reads": null, + "alt_clipped": null, + "ref_reads": null, + "ref_clipped": null + } + }, + { + "variant": "5:112839000 A>T", + "gene": "APC", + "final": ".", + "cpsr": "Pathogenic", + "clinvar": null, + "authority": null, + "acmg_codes": null, + "dp": 30, + "low_confidence": false, + "cdna": { + "check": "not_checked", + "note": "not in the read-check table", + "alt_reads": null, + "alt_clipped": null, + "ref_reads": null, + "ref_clipped": null + } + } + ], + "disagreements": [ + { + "variant": "17:43057100 C>T", + "gene": "BRCA1", + "final": "Pathogenic", + "cpsr": "Likely_Benign", + "clinvar": "Pathogenic", + "authority": "ClinVar", + "acmg_codes": "PVS1", + "dp": 6, + "low_confidence": true, + "cdna": { + "check": "flagged", + "note": "splice", + "alt_reads": 5, + "alt_clipped": 5, + "ref_reads": 9, + "ref_clipped": 0, + "construct": null + } + }, + { + "variant": "2:47403000 A>G", + "gene": "MSH2", + "final": "VUS", + "cpsr": "LP", + "clinvar": "B", + "authority": null, + "acmg_codes": null, + "dp": null, + "low_confidence": false, + "cdna": { + "check": "not_checked", + "note": "not in the read-check table", + "alt_reads": null, + "alt_clipped": null, + "ref_reads": null, + "ref_clipped": null + } + } + ], + "final_plp_own_benign": 1, + "own_class_column": "CPSR_CLASSIFICATION", + "low_confidence": 1, + "call_floor_dp": 8, + "cdna_flagged": 1 + } + }, + "clinical": { + "title": "Clinical variant filter", + "step": "23", + "state": "ok", + "source": "clinical/S_clinical_summary.tsv", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "variants": 5, + "by_impact": { + "HIGH": 3, + "MODERATE": 1, + ".": 1 + }, + "genes": 3, + "acmg_sf": { + "version": "ACMG SF v3.3", + "genes_on_list": 84, + "rules": "assets/acmg_sf.tsv", + "clinvar_hits": [ + { + "gene": "MUTYH", + "variant": "chr1:45331556 C>T", + "genotype": "het", + "significance": "Pathogenic", + "stars": 2, + "low_confidence": false, + "rule": "P and LP (2 variants)", + "rule_note": null, + "severity": null, + "two_hit": "biallelic with DEL chr1:45338000-45340000 (AnnotSV class 5, Manta): in trans: read-backed phase puts them on different copies (phase set 45331000)", + "pair": "biallelic", + "phase": "in trans: read-backed phase puts them on different copies (phase set 45331000)" + }, + { + "gene": "BRCA1", + "variant": "chr17:43057100 C>T", + "genotype": "het", + "significance": "Pathogenic", + "stars": 3, + "low_confidence": false, + "combined_allele": "part of a combined allele: chr17:43057100 C>T, chr17:43057102 A>G; unphased, so the parts may sit on different haplotypes", + "rule": "All P and LP", + "rule_note": null, + "severity": null + }, + { + "gene": "GLA", + "variant": "chrX:101398000 C>T", + "genotype": "1", + "significance": "Pathogenic", + "stars": 0, + "low_confidence": false, + "combined_allele": "possibly one allele with chrX:101398004 G>A: check ClinVar for a combined record", + "rule": "All hemi, het, homozygous P and LP", + "rule_note": null, + "severity": null + } + ], + "clinvar_checked": true, + "high_impact": [ + { + "gene": "MUTYH", + "variant": "chr1:45332000 G>A", + "genotype": "het", + "consequence": "stop_gained", + "transcript": "MANE", + "frequency": "rare", + "frequency_unknown": false, + "weak_call": false, + "call_note": null, + "gq": 40, + "dp": 30, + "ad": "15,15", + "rule": "P and LP (2 variants)", + "rule_note": null, + "severity": null, + "pair": "biallelic", + "phase": "in trans: read-backed phase puts them on different copies (phase set 45331000)" + }, + { + "gene": "MYBPC3", + "variant": "chr11:47332000 G>A", + "genotype": "het", + "consequence": "splice_donor_variant,intron_variant", + "transcript": "ANY", + "frequency": "rare", + "frequency_unknown": false, + "weak_call": false, + "call_note": null, + "gq": null, + "dp": null, + "ad": null, + "rule": "All P and LP", + "rule_note": null, + "severity": null + }, + { + "gene": "MSH2", + "variant": "chr2:47414000 A>AT", + "genotype": "het", + "consequence": "frameshift_variant", + "transcript": "CANONICAL", + "frequency": "rare", + "frequency_unknown": false, + "weak_call": true, + "call_note": "alt reads 0.07 of the depth on a heterozygote", + "gq": 50, + "dp": 30, + "ad": "28,2", + "rule": "All P and LP", + "rule_note": "A deletion of the 3' end of EPCAM silences MSH2 and counts as an MSH2 finding.", + "severity": null + } + ], + "high_impact_checked": true, + "high_impact_rare": 2, + "high_impact_weak": 1, + "high_impact_frequency_unknown": 0, + "structural": [ + { + "gene": "MSH2", + "variant": "DEL chr2:47386000-47388000", + "acmg_class": "4", + "caller": "Delly", + "support": 1, + "via": "EPCAM exons 8 and 9, the 3' end (ENST00000263735)", + "rule": "All P and LP", + "rule_note": "A deletion of the 3' end of EPCAM silences MSH2 and counts as an MSH2 finding.", + "severity": null + }, + { + "gene": "BRCA1", + "variant": "DUP chr17:43000000-43100000", + "acmg_class": "4", + "caller": "CNVpytor", + "support": 1, + "via": null, + "rule": "All P and LP", + "rule_note": null, + "severity": null + } + ], + "structural_checked": true, + "structural_note": null, + "not_reported": [ + { + "gene": "HFE", + "variant": "chr6:26092913 G>A", + "genotype": "het", + "source": "ClinVar", + "reason": "HFE is reported only for: HFE p.C282Y homozygotes only" + }, + { + "gene": "BTD", + "variant": "chr3:15645186 G>C", + "genotype": "het", + "source": "ClinVar", + "reason": "one heterozygous variant; BTD is reported with P and LP (2 variants)" + }, + { + "gene": "HFE", + "variant": "chr6:26093000 C>T", + "genotype": "hom", + "source": "HIGH impact", + "reason": "HFE is reported only for: HFE p.C282Y homozygotes only" + } + ], + "two_hit_note": null + }, + "frequency_unknown": 1, + "weak_calls": 2 + } + }, + "slivar": { + "title": "Variant prioritization (slivar)", + "step": "31", + "state": "ok", + "source": "slivar/S_slivar_summary.tsv", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "prioritized": 2, + "frequency_unknown": 1, + "compound_het_variants": 4, + "compound_het_genes": 2, + "compound_het_pairs": 26, + "compound_het_phase": { + "trans": 23, + "cis": 1, + "unknown": 1 + }, + "compound_het_trans": [ + { + "gene": "G1", + "variants": "chr1:10 A>G + chr1:15 C>T", + "reads": "1 of 2" + }, + { + "gene": "G2", + "variants": "chr1:20 A>G + chr1:25 C>T", + "reads": "2 of 3" + }, + { + "gene": "G3", + "variants": "chr1:30 A>G + chr1:35 C>T", + "reads": "3 of 4" + }, + { + "gene": "G4", + "variants": "chr1:40 A>G + chr1:45 C>T", + "reads": "4 of 5" + }, + { + "gene": "G5", + "variants": "chr1:50 A>G + chr1:55 C>T", + "reads": "5 of 6" + }, + { + "gene": "G6", + "variants": "chr1:60 A>G + chr1:65 C>T", + "reads": "6 of 7" + }, + { + "gene": "G7", + "variants": "chr1:70 A>G + chr1:75 C>T", + "reads": "7 of 8" + }, + { + "gene": "G8", + "variants": "chr1:80 A>G + chr1:85 C>T", + "reads": "8 of 9" + }, + { + "gene": "G9", + "variants": "chr1:90 A>G + chr1:95 C>T", + "reads": "9 of 10" + }, + { + "gene": "G10", + "variants": "chr1:100 A>G + chr1:105 C>T", + "reads": "10 of 11" + }, + { + "gene": "G11", + "variants": "chr1:110 A>G + chr1:115 C>T", + "reads": "11 of 12" + }, + { + "gene": "G12", + "variants": "chr1:120 A>G + chr1:125 C>T", + "reads": "12 of 13" + }, + { + "gene": "G13", + "variants": "chr1:130 A>G + chr1:135 C>T", + "reads": "13 of 14" + }, + { + "gene": "G14", + "variants": "chr1:140 A>G + chr1:145 C>T", + "reads": "14 of 15" + }, + { + "gene": "G15", + "variants": "chr1:150 A>G + chr1:155 C>T", + "reads": "15 of 16" + }, + { + "gene": "G16", + "variants": "chr1:160 A>G + chr1:165 C>T", + "reads": "16 of 17" + }, + { + "gene": "G17", + "variants": "chr1:170 A>G + chr1:175 C>T", + "reads": "17 of 18" + }, + { + "gene": "G18", + "variants": "chr1:180 A>G + chr1:185 C>T", + "reads": "18 of 19" + }, + { + "gene": "G19", + "variants": "chr1:190 A>G + chr1:195 C>T", + "reads": "19 of 20" + }, + { + "gene": "G20", + "variants": "chr1:200 A>G + chr1:205 C>T", + "reads": "20 of 21" + } + ] + } + } + }, + "cyp2d6": { + "calls": { + "PharmCAT": "*1/*4", + "pypgx": "*1/*2", + "Cyrius": "*2/*1" + }, + "agree": true, + "consensus": { + "result": "*1/*2", + "passed_to_pharmcat": true, + "reason": "pypgx and Cyrius agree", + "source": "pgx_consensus/S_pgx_consensus.tsv" + }, + "probable": null + } +} diff --git a/tests/parity/golden/summary-collect/cb-nf/cb-nf.json b/tests/parity/golden/summary-collect/cb-nf/cb-nf.json new file mode 100644 index 000000000..ea2911faa --- /dev/null +++ b/tests/parity/golden/summary-collect/cb-nf/cb-nf.json @@ -0,0 +1,771 @@ +{ + "schema_version": 2, + "sample": "S", + "generated_utc": "2026-11-19 23:00 UTC", + "run": { + "status_file": true, + "started_utc": "2020-01-01 00:00 UTC", + "declared_sex": null + }, + "databases": { + "clinvar_release": null, + "cpsr_clinvar_release": null, + "hla_database": null + }, + "manifest": [], + "sections": { + "clinvar": { + "title": "ClinVar screen", + "step": "06", + "state": "ok", + "source": "clinvar/S_clinvar_hits.vcf", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "count": 8, + "by_stars": { + "4": 0, + "3": 2, + "2": 3, + "1": 1, + "0": 2 + }, + "hits": [ + { + "stars": 4, + "chrom": "chr7", + "pos": 117559590, + "ref": "ATCT", + "alt": "A", + "genotype": "het", + "gene": "CFTR", + "significance": "Pathogenic", + "review_status": "practice guideline", + "combined_allele": ".", + "dp": 30, + "gq": 15, + "low_confidence": true, + "gnomad_exome_af": null, + "gnomad_genome_af": null, + "rsids": [], + "af": null, + "common": false + }, + { + "stars": 3, + "chrom": "chr17", + "pos": 43057100, + "ref": "C", + "alt": "T", + "genotype": "het", + "gene": "BRCA1,NBR2", + "significance": "Pathogenic", + "review_status": "reviewed by expert panel", + "combined_allele": "part of a combined allele: chr17:43057100 C>T, chr17:43057102 A>G; unphased, so the parts may sit on different haplotypes", + "dp": 35, + "gq": 60, + "low_confidence": false, + "gnomad_exome_af": null, + "gnomad_genome_af": null, + "rsids": [], + "af": null, + "common": false + }, + { + "stars": 3, + "chrom": "chr6", + "pos": 26092913, + "ref": "G", + "alt": "A", + "genotype": "het", + "gene": "HFE", + "significance": "Pathogenic", + "review_status": "reviewed by expert panel", + "combined_allele": ".", + "dp": 40, + "gq": 99, + "low_confidence": false, + "gnomad_exome_af": null, + "gnomad_genome_af": null, + "rsids": [], + "af": null, + "common": false + }, + { + "stars": 2, + "chrom": "chr1", + "pos": 45331556, + "ref": "C", + "alt": "T", + "genotype": "het", + "gene": "MUTYH", + "significance": "Pathogenic", + "review_status": "criteria provided, multiple submitters, no conflicts", + "combined_allele": ".", + "dp": 30, + "gq": 50, + "low_confidence": false, + "gnomad_exome_af": null, + "gnomad_genome_af": null, + "rsids": [], + "af": null, + "common": false + }, + { + "stars": 2, + "chrom": "chr16", + "pos": 176700, + "ref": "G", + "alt": "A", + "genotype": "het", + "gene": "HBA1", + "significance": "Pathogenic", + "review_status": "criteria provided, multiple submitters, no conflicts", + "combined_allele": ".", + "dp": 31, + "gq": 45, + "low_confidence": false, + "gnomad_exome_af": null, + "gnomad_genome_af": null, + "rsids": [], + "af": null, + "common": false + }, + { + "stars": 2, + "chrom": "chr5", + "pos": 70951946, + "ref": "C", + "alt": "T", + "genotype": "hom", + "gene": "SMN1", + "significance": "Pathogenic", + "review_status": "criteria provided, multiple submitters, no conflicts", + "combined_allele": ".", + "dp": 31, + "gq": 45, + "low_confidence": false, + "gnomad_exome_af": null, + "gnomad_genome_af": null, + "rsids": [], + "af": null, + "common": false + }, + { + "stars": 1, + "chrom": "chr13", + "pos": 20189473, + "ref": "C", + "alt": "T", + "genotype": "one copy, other copy not called ref (1/.)", + "gene": "GJB2", + "significance": "Likely pathogenic", + "review_status": "criteria provided, single submitter", + "combined_allele": "combined allele of chr13:20189473 C>T + chr13:20189475 G>A", + "dp": 5, + "gq": 40, + "low_confidence": true, + "gnomad_exome_af": null, + "gnomad_genome_af": null, + "rsids": [], + "af": null, + "common": false + }, + { + "stars": 1, + "chrom": "chr3", + "pos": 15645186, + "ref": "G", + "alt": "C", + "genotype": "het", + "gene": "BTD", + "significance": "Pathogenic/Likely pathogenic", + "review_status": "criteria provided, conflicting classifications", + "combined_allele": ".", + "dp": null, + "gq": null, + "low_confidence": false, + "gnomad_exome_af": null, + "gnomad_genome_af": null, + "rsids": [], + "af": null, + "common": false + }, + { + "stars": 0, + "chrom": "chr2", + "pos": 100, + "ref": "A", + "alt": "G", + "genotype": "het", + "gene": ".", + "significance": ".", + "review_status": ".", + "combined_allele": ".", + "dp": null, + "gq": null, + "low_confidence": false, + "gnomad_exome_af": null, + "gnomad_genome_af": null, + "rsids": [], + "af": null, + "common": false + }, + { + "stars": 0, + "chrom": "chrX", + "pos": 101398000, + "ref": "C", + "alt": "T", + "genotype": "1", + "gene": "GLA", + "significance": "Pathogenic", + "review_status": "no assertion criteria provided", + "combined_allele": "possibly one allele with chrX:101398004 G>A: check ClinVar for a combined record", + "dp": null, + "gq": null, + "low_confidence": false, + "gnomad_exome_af": null, + "gnomad_genome_af": null, + "rsids": [], + "af": null, + "common": false + } + ], + "low_confidence": 2, + "call_floor": { + "GQ": 20, + "DP": 8 + }, + "frequency": { + "source": null, + "note": "no VEP output (step 13) in this folder", + "common_af": 0.01 + } + } + }, + "carrier": { + "title": "Carrier list", + "step": "06", + "state": "ok", + "source": "clinvar/S_clinvar_hits.vcf", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "genes_on_list": 3292, + "list": "assets/carrier_genes.tsv", + "carriers": [ + { + "gene": "MUTYH", + "variant": "chr1:45331556 C>T", + "genotype": "het", + "significance": "Pathogenic", + "stars": 2, + "inheritance": "AR", + "condition": "MUTYH-related polyposis" + }, + { + "gene": "HFE", + "variant": "chr6:26092913 G>A", + "genotype": "het", + "significance": "Pathogenic", + "stars": 3, + "inheritance": "AR", + "condition": "Symptomatic form of HFE-related hemochromatosis" + }, + { + "gene": "CFTR", + "variant": "chr7:117559590 ATCT>A", + "genotype": "het", + "significance": "Pathogenic", + "stars": 4, + "inheritance": "AR", + "condition": "Cystic fibrosis" + }, + { + "gene": "GJB2", + "variant": "chr13:20189473 C>T", + "genotype": "one copy, other copy not called ref (1/.)", + "significance": "Likely pathogenic", + "stars": 1, + "inheritance": "AR", + "condition": "Nonsyndromic hearing loss, recessive (DFNB1A)", + "combined_allele": "combined allele of chr13:20189473 C>T + chr13:20189475 G>A" + }, + { + "gene": "BRCA1", + "variant": "chr17:43057100 C>T", + "genotype": "het", + "significance": "Pathogenic", + "stars": 3, + "inheritance": "AR", + "condition": "Fanconi anemia", + "combined_allele": "part of a combined allele: chr17:43057100 C>T, chr17:43057102 A>G; unphased, so the parts may sit on different haplotypes" + }, + { + "gene": "GLA", + "variant": "chrX:101398000 C>T", + "genotype": "hemizygous", + "significance": "Pathogenic", + "stars": 0, + "inheritance": "XL", + "condition": "Fabry disease", + "combined_allele": "possibly one allele with chrX:101398004 G>A: check ClinVar for a combined record" + }, + { + "gene": "HBA1", + "variant": "chr16:176700 G>A", + "genotype": "het", + "significance": "Pathogenic", + "stars": 2, + "inheritance": "AR", + "condition": "Alpha-thalassemia" + }, + { + "gene": "SMN1", + "variant": "chr5:70951946 C>T", + "genotype": "hom", + "significance": "Pathogenic", + "stars": 2, + "inheritance": "AR", + "condition": "Spinal muscular atrophy" + } + ], + "set_aside": [ + { + "gene": "BTD", + "variant": "chr3:15645186 G>C", + "genotype": "het", + "significance": "Pathogenic/Likely pathogenic", + "stars": 1, + "inheritance": "AR", + "condition": "Biotinidase deficiency", + "kind": "hypomorph", + "name": "p.Asp444His (p.Asp424His on NM_001370658.1), partial biotinidase deficiency" + } + ], + "two_hits": { + "genes": [ + { + "gene": "CFTR", + "verdict": "possibly biallelic", + "why": "a heterozygous call inside a called deletion: one of the two calls may be wrong; check the reads", + "deletion": "CFTR_del deletion, 1 of 2 copies (read depth, step 35)", + "variant": "chr7:117559590 ATCT>A", + "genotype": "het", + "allele": null, + "condition": "Cystic fibrosis", + "inheritance": "AR" + } + ], + "deletions_read": [ + "AnnotSV class 4 and 5 deletions (step 05)", + "step 35's interval table (read depth)" + ], + "deletions_not_read": [ + "step 35's HBA1/HBA2 count: not called", + "Parascopy's SMN1 count: not resolved" + ] + } + } + }, + "pharmcat": { + "title": "PharmCAT", + "step": "07", + "state": "ok", + "source": "vcf/B.report.json", + "file_date": "2021-03-04 05:07 UTC", + "note": null, + "data": { + "version": "", + "html_report": false + } + }, + "cpic": { + "title": "CPIC drug-gene recommendations", + "step": "27", + "state": "stale", + "source": "cpic/S_phenotypes.tsv", + "file_date": "2019-06-01 12:30 UTC", + "note": "from an earlier run (2019-06-01 12:30 UTC); step 27 was skipped in the run of 2020-01-01 00:00 UTC", + "data": { + "genes": [ + { + "gene": "CYP2D6", + "diplotype": "*4/*4", + "phenotype": "Poor", + "status": "not called" + } + ], + "non_normal": 0, + "ambiguous": 0, + "not_called": 1, + "unclassified": 0, + "parse_failed": false, + "warnings": [] + } + }, + "pypgx": { + "title": "pypgx", + "step": "32", + "state": "ok", + "source": "pypgx/S_pypgx_summary.tsv", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "genes_total": 6, + "genes_called": 3, + "cyp2d6": "*1/*2", + "cnv_call": { + "CYP2D6": "Normal", + "CYP2A6": "not called: pypgx failed", + "CYP2B6": "not called: the CYP2D6 depth check failed", + "SLCO1B1": "not called: pypgx gave no copy-number call" + }, + "not_callable": [ + "CYP2E1" + ], + "low_gq": [ + { + "gene": "UGT1A1", + "diplotype": "Indeterminate", + "min_gq": 12, + "weakest": "chr2:1:A:G" + }, + { + "gene": "SLCO1B1", + "diplotype": "*1/*5", + "min_gq": null, + "weakest": "" + } + ], + "cyp2d6_evidence": { + "phenotype": "Normal Metabolizer", + "defining_filter": "PASS", + "quality": "ok" + } + } + }, + "cyrius": { + "title": "Cyrius (CYP2D6)", + "step": "21", + "state": "ok", + "source": "cyrius/T_cyp2d6.tsv", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "genotype": "*1/*2", + "filter": "LowQ" + } + }, + "cpsr": { + "title": "Cancer predisposition (CPSR)", + "step": "17", + "state": "ok", + "source": "cpsr/T.cpsr.grch37.classification.tsv.gz", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "html_report": true, + "classification_column": "FINAL_CLASSIFICATION", + "classification": { + "Pathogenic": 1, + ".": 1 + }, + "plp": [ + { + "variant": ".", + "gene": "A", + "final": "Pathogenic", + "cpsr": "Benign", + "clinvar": null, + "authority": null, + "acmg_codes": null, + "dp": null, + "low_confidence": false + } + ], + "disagreements": [], + "final_plp_own_benign": 1, + "own_class_column": "CPSR_CLASSIFICATION", + "low_confidence": 0, + "call_floor_dp": 8 + } + }, + "clinical": { + "title": "Clinical variant filter", + "step": "23", + "state": "ok", + "source": "clinical/S_clinical.vcf.gz", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "variants": 6, + "acmg_sf": { + "version": "ACMG SF v3.3", + "genes_on_list": 84, + "rules": "assets/acmg_sf.tsv", + "clinvar_hits": [ + { + "gene": "MUTYH", + "variant": "chr1:45331556 C>T", + "genotype": "het", + "significance": "Pathogenic", + "stars": 2, + "low_confidence": false, + "rule": "P and LP (2 variants)", + "rule_note": null, + "severity": null, + "pair": "biallelic", + "phase": "in trans: read-backed phase puts them on different copies (phase set 45331000)" + }, + { + "gene": "BRCA1", + "variant": "chr17:43057100 C>T", + "genotype": "het", + "significance": "Pathogenic", + "stars": 3, + "low_confidence": false, + "combined_allele": "part of a combined allele: chr17:43057100 C>T, chr17:43057102 A>G; unphased, so the parts may sit on different haplotypes", + "rule": "All P and LP", + "rule_note": null, + "severity": null + }, + { + "gene": "GLA", + "variant": "chrX:101398000 C>T", + "genotype": "1", + "significance": "Pathogenic", + "stars": 0, + "low_confidence": false, + "combined_allele": "possibly one allele with chrX:101398004 G>A: check ClinVar for a combined record", + "rule": "All hemi, het, homozygous P and LP", + "rule_note": null, + "severity": null + } + ], + "clinvar_checked": true, + "high_impact": [ + { + "gene": "MUTYH", + "variant": "chr1:45332000 G>A", + "genotype": "het", + "consequence": "stop_gained", + "transcript": "MANE", + "frequency": "rare", + "frequency_unknown": false, + "weak_call": false, + "call_note": null, + "gq": 40, + "dp": 30, + "ad": "15,15", + "rule": "P and LP (2 variants)", + "rule_note": null, + "severity": null, + "pair": "biallelic", + "phase": "in trans: read-backed phase puts them on different copies (phase set 45331000)" + }, + { + "gene": "MYBPC3", + "variant": "chr11:47332000 G>A", + "genotype": "het", + "consequence": "splice_donor_variant,intron_variant", + "transcript": "ANY", + "frequency": "rare", + "frequency_unknown": false, + "weak_call": false, + "call_note": null, + "gq": null, + "dp": null, + "ad": null, + "rule": "All P and LP", + "rule_note": null, + "severity": null + }, + { + "gene": "MSH2", + "variant": "chr2:47414000 A>AT", + "genotype": "het", + "consequence": "frameshift_variant", + "transcript": "CANONICAL", + "frequency": "rare", + "frequency_unknown": false, + "weak_call": true, + "call_note": "alt reads 0.07 of the depth on a heterozygote", + "gq": 50, + "dp": 30, + "ad": "28,2", + "rule": "All P and LP", + "rule_note": "A deletion of the 3' end of EPCAM silences MSH2 and counts as an MSH2 finding.", + "severity": null + } + ], + "high_impact_checked": true, + "high_impact_rare": 2, + "high_impact_weak": 1, + "high_impact_frequency_unknown": 0, + "structural": [], + "structural_checked": true, + "structural_note": null, + "not_reported": [ + { + "gene": "HFE", + "variant": "chr6:26092913 G>A", + "genotype": "het", + "source": "ClinVar", + "reason": "HFE is reported only for: HFE p.C282Y homozygotes only" + }, + { + "gene": "BTD", + "variant": "chr3:15645186 G>C", + "genotype": "het", + "source": "ClinVar", + "reason": "one heterozygous variant; BTD is reported with P and LP (2 variants)" + }, + { + "gene": "HFE", + "variant": "chr6:26093000 C>T", + "genotype": "hom", + "source": "HIGH impact", + "reason": "HFE is reported only for: HFE p.C282Y homozygotes only" + } + ], + "two_hit_note": null + } + } + }, + "slivar": { + "title": "Variant prioritization (slivar)", + "step": "31", + "state": "ok", + "source": "slivar/S_prioritized.vcf.gz", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "prioritized": 2, + "compound_het_pairs": 26, + "compound_het_phase": { + "trans": 23, + "cis": 1, + "unknown": 1 + }, + "compound_het_trans": [ + { + "gene": "G1", + "variants": "chr1:10 A>G + chr1:15 C>T", + "reads": "1 of 2" + }, + { + "gene": "G2", + "variants": "chr1:20 A>G + chr1:25 C>T", + "reads": "2 of 3" + }, + { + "gene": "G3", + "variants": "chr1:30 A>G + chr1:35 C>T", + "reads": "3 of 4" + }, + { + "gene": "G4", + "variants": "chr1:40 A>G + chr1:45 C>T", + "reads": "4 of 5" + }, + { + "gene": "G5", + "variants": "chr1:50 A>G + chr1:55 C>T", + "reads": "5 of 6" + }, + { + "gene": "G6", + "variants": "chr1:60 A>G + chr1:65 C>T", + "reads": "6 of 7" + }, + { + "gene": "G7", + "variants": "chr1:70 A>G + chr1:75 C>T", + "reads": "7 of 8" + }, + { + "gene": "G8", + "variants": "chr1:80 A>G + chr1:85 C>T", + "reads": "8 of 9" + }, + { + "gene": "G9", + "variants": "chr1:90 A>G + chr1:95 C>T", + "reads": "9 of 10" + }, + { + "gene": "G10", + "variants": "chr1:100 A>G + chr1:105 C>T", + "reads": "10 of 11" + }, + { + "gene": "G11", + "variants": "chr1:110 A>G + chr1:115 C>T", + "reads": "11 of 12" + }, + { + "gene": "G12", + "variants": "chr1:120 A>G + chr1:125 C>T", + "reads": "12 of 13" + }, + { + "gene": "G13", + "variants": "chr1:130 A>G + chr1:135 C>T", + "reads": "13 of 14" + }, + { + "gene": "G14", + "variants": "chr1:140 A>G + chr1:145 C>T", + "reads": "14 of 15" + }, + { + "gene": "G15", + "variants": "chr1:150 A>G + chr1:155 C>T", + "reads": "15 of 16" + }, + { + "gene": "G16", + "variants": "chr1:160 A>G + chr1:165 C>T", + "reads": "16 of 17" + }, + { + "gene": "G17", + "variants": "chr1:170 A>G + chr1:175 C>T", + "reads": "17 of 18" + }, + { + "gene": "G18", + "variants": "chr1:180 A>G + chr1:185 C>T", + "reads": "18 of 19" + }, + { + "gene": "G19", + "variants": "chr1:190 A>G + chr1:195 C>T", + "reads": "19 of 20" + }, + { + "gene": "G20", + "variants": "chr1:200 A>G + chr1:205 C>T", + "reads": "20 of 21" + } + ] + } + } + }, + "cyp2d6": { + "calls": { + "PharmCAT": "not called", + "pypgx": "*1/*2", + "Cyrius": "*1/*2 (not usable: Filter LowQ)" + }, + "agree": null, + "consensus": null, + "probable": { + "diplotype": "*1/*2", + "phenotype": "Normal Metabolizer", + "label": "probable (one caller: pypgx)" + } + } +} diff --git a/tests/parity/golden/summary-collect/cb-nfbad/cb-nfbad.json b/tests/parity/golden/summary-collect/cb-nfbad/cb-nfbad.json new file mode 100644 index 000000000..76b421bcc --- /dev/null +++ b/tests/parity/golden/summary-collect/cb-nfbad/cb-nfbad.json @@ -0,0 +1,433 @@ +{ + "schema_version": 2, + "sample": "S", + "generated_utc": "2026-11-19 23:00 UTC", + "run": { + "status_file": false, + "started_utc": null, + "declared_sex": null + }, + "databases": { + "clinvar_release": null, + "cpsr_clinvar_release": null, + "hla_database": null + }, + "manifest": [], + "sections": { + "clinvar": { + "title": "ClinVar screen", + "step": "06", + "state": "ok", + "source": "clinvar/S_clinvar_hits.vcf", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "count": 8, + "by_stars": { + "4": 0, + "3": 2, + "2": 3, + "1": 1, + "0": 2 + }, + "hits": [ + { + "stars": 4, + "chrom": "chr7", + "pos": 117559590, + "ref": "ATCT", + "alt": "A", + "genotype": "het", + "gene": "CFTR", + "significance": "Pathogenic", + "review_status": "practice guideline", + "combined_allele": ".", + "dp": 30, + "gq": 15, + "low_confidence": true, + "gnomad_exome_af": null, + "gnomad_genome_af": null, + "rsids": [], + "af": null, + "common": false + }, + { + "stars": 3, + "chrom": "chr17", + "pos": 43057100, + "ref": "C", + "alt": "T", + "genotype": "het", + "gene": "BRCA1,NBR2", + "significance": "Pathogenic", + "review_status": "reviewed by expert panel", + "combined_allele": "part of a combined allele: chr17:43057100 C>T, chr17:43057102 A>G; unphased, so the parts may sit on different haplotypes", + "dp": 35, + "gq": 60, + "low_confidence": false, + "gnomad_exome_af": null, + "gnomad_genome_af": null, + "rsids": [], + "af": null, + "common": false + }, + { + "stars": 3, + "chrom": "chr6", + "pos": 26092913, + "ref": "G", + "alt": "A", + "genotype": "het", + "gene": "HFE", + "significance": "Pathogenic", + "review_status": "reviewed by expert panel", + "combined_allele": ".", + "dp": 40, + "gq": 99, + "low_confidence": false, + "gnomad_exome_af": null, + "gnomad_genome_af": null, + "rsids": [], + "af": null, + "common": false + }, + { + "stars": 2, + "chrom": "chr1", + "pos": 45331556, + "ref": "C", + "alt": "T", + "genotype": "het", + "gene": "MUTYH", + "significance": "Pathogenic", + "review_status": "criteria provided, multiple submitters, no conflicts", + "combined_allele": ".", + "dp": 30, + "gq": 50, + "low_confidence": false, + "gnomad_exome_af": null, + "gnomad_genome_af": null, + "rsids": [], + "af": null, + "common": false + }, + { + "stars": 2, + "chrom": "chr16", + "pos": 176700, + "ref": "G", + "alt": "A", + "genotype": "het", + "gene": "HBA1", + "significance": "Pathogenic", + "review_status": "criteria provided, multiple submitters, no conflicts", + "combined_allele": ".", + "dp": 31, + "gq": 45, + "low_confidence": false, + "gnomad_exome_af": null, + "gnomad_genome_af": null, + "rsids": [], + "af": null, + "common": false + }, + { + "stars": 2, + "chrom": "chr5", + "pos": 70951946, + "ref": "C", + "alt": "T", + "genotype": "hom", + "gene": "SMN1", + "significance": "Pathogenic", + "review_status": "criteria provided, multiple submitters, no conflicts", + "combined_allele": ".", + "dp": 31, + "gq": 45, + "low_confidence": false, + "gnomad_exome_af": null, + "gnomad_genome_af": null, + "rsids": [], + "af": null, + "common": false + }, + { + "stars": 1, + "chrom": "chr13", + "pos": 20189473, + "ref": "C", + "alt": "T", + "genotype": "one copy, other copy not called ref (1/.)", + "gene": "GJB2", + "significance": "Likely pathogenic", + "review_status": "criteria provided, single submitter", + "combined_allele": "combined allele of chr13:20189473 C>T + chr13:20189475 G>A", + "dp": 5, + "gq": 40, + "low_confidence": true, + "gnomad_exome_af": null, + "gnomad_genome_af": null, + "rsids": [], + "af": null, + "common": false + }, + { + "stars": 1, + "chrom": "chr3", + "pos": 15645186, + "ref": "G", + "alt": "C", + "genotype": "het", + "gene": "BTD", + "significance": "Pathogenic/Likely pathogenic", + "review_status": "criteria provided, conflicting classifications", + "combined_allele": ".", + "dp": null, + "gq": null, + "low_confidence": false, + "gnomad_exome_af": null, + "gnomad_genome_af": null, + "rsids": [], + "af": null, + "common": false + }, + { + "stars": 0, + "chrom": "chr2", + "pos": 100, + "ref": "A", + "alt": "G", + "genotype": "het", + "gene": ".", + "significance": ".", + "review_status": ".", + "combined_allele": ".", + "dp": null, + "gq": null, + "low_confidence": false, + "gnomad_exome_af": null, + "gnomad_genome_af": null, + "rsids": [], + "af": null, + "common": false + }, + { + "stars": 0, + "chrom": "chrX", + "pos": 101398000, + "ref": "C", + "alt": "T", + "genotype": "1", + "gene": "GLA", + "significance": "Pathogenic", + "review_status": "no assertion criteria provided", + "combined_allele": "possibly one allele with chrX:101398004 G>A: check ClinVar for a combined record", + "dp": null, + "gq": null, + "low_confidence": false, + "gnomad_exome_af": null, + "gnomad_genome_af": null, + "rsids": [], + "af": null, + "common": false + } + ], + "low_confidence": 2, + "call_floor": { + "GQ": 20, + "DP": 8 + }, + "frequency": { + "source": null, + "note": "no VEP output (step 13) in this folder", + "common_af": 0.01 + } + } + }, + "carrier": { + "title": "Carrier list", + "step": "06", + "state": "ok", + "source": "clinvar/S_clinvar_hits.vcf", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "genes_on_list": 3292, + "list": "assets/carrier_genes.tsv", + "carriers": [ + { + "gene": "MUTYH", + "variant": "chr1:45331556 C>T", + "genotype": "het", + "significance": "Pathogenic", + "stars": 2, + "inheritance": "AR", + "condition": "MUTYH-related polyposis" + }, + { + "gene": "HFE", + "variant": "chr6:26092913 G>A", + "genotype": "het", + "significance": "Pathogenic", + "stars": 3, + "inheritance": "AR", + "condition": "Symptomatic form of HFE-related hemochromatosis" + }, + { + "gene": "CFTR", + "variant": "chr7:117559590 ATCT>A", + "genotype": "het", + "significance": "Pathogenic", + "stars": 4, + "inheritance": "AR", + "condition": "Cystic fibrosis" + }, + { + "gene": "GJB2", + "variant": "chr13:20189473 C>T", + "genotype": "one copy, other copy not called ref (1/.)", + "significance": "Likely pathogenic", + "stars": 1, + "inheritance": "AR", + "condition": "Nonsyndromic hearing loss, recessive (DFNB1A)", + "combined_allele": "combined allele of chr13:20189473 C>T + chr13:20189475 G>A" + }, + { + "gene": "BRCA1", + "variant": "chr17:43057100 C>T", + "genotype": "het", + "significance": "Pathogenic", + "stars": 3, + "inheritance": "AR", + "condition": "Fanconi anemia", + "combined_allele": "part of a combined allele: chr17:43057100 C>T, chr17:43057102 A>G; unphased, so the parts may sit on different haplotypes" + }, + { + "gene": "GLA", + "variant": "chrX:101398000 C>T", + "genotype": "hemizygous", + "significance": "Pathogenic", + "stars": 0, + "inheritance": "XL", + "condition": "Fabry disease", + "combined_allele": "possibly one allele with chrX:101398004 G>A: check ClinVar for a combined record" + }, + { + "gene": "HBA1", + "variant": "chr16:176700 G>A", + "genotype": "het", + "significance": "Pathogenic", + "stars": 2, + "inheritance": "AR", + "condition": "Alpha-thalassemia" + }, + { + "gene": "SMN1", + "variant": "chr5:70951946 C>T", + "genotype": "hom", + "significance": "Pathogenic", + "stars": 2, + "inheritance": "AR", + "condition": "Spinal muscular atrophy" + } + ], + "set_aside": [ + { + "gene": "BTD", + "variant": "chr3:15645186 G>C", + "genotype": "het", + "significance": "Pathogenic/Likely pathogenic", + "stars": 1, + "inheritance": "AR", + "condition": "Biotinidase deficiency", + "kind": "hypomorph", + "name": "p.Asp444His (p.Asp424His on NM_001370658.1), partial biotinidase deficiency" + } + ], + "two_hits": { + "genes": [], + "deletions_read": [], + "deletions_not_read": [ + "AnnotSV (step 05): no table", + "step 35's interval table: none", + "step 35's HBA1/HBA2 count: not assessed: S_hba_copy_number.tsv has no status row", + "Parascopy's SMN1 count: not resolved" + ] + } + } + }, + "pharmcat": { + "title": "PharmCAT", + "step": "07", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "cpic": { + "title": "CPIC drug-gene recommendations", + "step": "27", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "pypgx": { + "title": "pypgx", + "step": "32", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "cyrius": { + "title": "Cyrius (CYP2D6)", + "step": "21", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "cpsr": { + "title": "Cancer predisposition (CPSR)", + "step": "17", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "clinical": { + "title": "Clinical variant filter", + "step": "23", + "state": "unreadable", + "source": null, + "file_date": null, + "note": "S_clinical.vcf.gz: Compressed file ended before the end-of-stream marker was reached", + "data": {} + }, + "slivar": { + "title": "Variant prioritization (slivar)", + "step": "31", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + } + }, + "cyp2d6": { + "calls": { + "PharmCAT": null, + "pypgx": null, + "Cyrius": null + }, + "agree": null, + "consensus": null, + "probable": null + } +} diff --git a/tests/parity/golden/summary-collect/cb-notbi/cb-notbi.json b/tests/parity/golden/summary-collect/cb-notbi/cb-notbi.json new file mode 100644 index 000000000..c7668ea8a --- /dev/null +++ b/tests/parity/golden/summary-collect/cb-notbi/cb-notbi.json @@ -0,0 +1,434 @@ +{ + "schema_version": 2, + "sample": "S", + "generated_utc": "2026-11-19 23:00 UTC", + "run": { + "status_file": false, + "started_utc": null, + "declared_sex": null + }, + "databases": { + "clinvar_release": null, + "cpsr_clinvar_release": null, + "hla_database": null + }, + "manifest": [], + "sections": { + "clinvar": { + "title": "ClinVar screen", + "step": "06", + "state": "ok", + "source": "clinvar/S_clinvar_hits.vcf", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "count": 8, + "by_stars": { + "4": 0, + "3": 2, + "2": 3, + "1": 1, + "0": 2 + }, + "hits": [ + { + "stars": 4, + "chrom": "chr7", + "pos": 117559590, + "ref": "ATCT", + "alt": "A", + "genotype": "het", + "gene": "CFTR", + "significance": "Pathogenic", + "review_status": "practice guideline", + "combined_allele": ".", + "dp": 30, + "gq": 15, + "low_confidence": true, + "gnomad_exome_af": null, + "gnomad_genome_af": null, + "rsids": [], + "af": null, + "common": false + }, + { + "stars": 3, + "chrom": "chr17", + "pos": 43057100, + "ref": "C", + "alt": "T", + "genotype": "het", + "gene": "BRCA1,NBR2", + "significance": "Pathogenic", + "review_status": "reviewed by expert panel", + "combined_allele": "part of a combined allele: chr17:43057100 C>T, chr17:43057102 A>G; unphased, so the parts may sit on different haplotypes", + "dp": 35, + "gq": 60, + "low_confidence": false, + "gnomad_exome_af": null, + "gnomad_genome_af": null, + "rsids": [], + "af": null, + "common": false + }, + { + "stars": 3, + "chrom": "chr6", + "pos": 26092913, + "ref": "G", + "alt": "A", + "genotype": "het", + "gene": "HFE", + "significance": "Pathogenic", + "review_status": "reviewed by expert panel", + "combined_allele": ".", + "dp": 40, + "gq": 99, + "low_confidence": false, + "gnomad_exome_af": null, + "gnomad_genome_af": null, + "rsids": [], + "af": null, + "common": false + }, + { + "stars": 2, + "chrom": "chr1", + "pos": 45331556, + "ref": "C", + "alt": "T", + "genotype": "het", + "gene": "MUTYH", + "significance": "Pathogenic", + "review_status": "criteria provided, multiple submitters, no conflicts", + "combined_allele": ".", + "dp": 30, + "gq": 50, + "low_confidence": false, + "gnomad_exome_af": null, + "gnomad_genome_af": null, + "rsids": [], + "af": null, + "common": false + }, + { + "stars": 2, + "chrom": "chr16", + "pos": 176700, + "ref": "G", + "alt": "A", + "genotype": "het", + "gene": "HBA1", + "significance": "Pathogenic", + "review_status": "criteria provided, multiple submitters, no conflicts", + "combined_allele": ".", + "dp": 31, + "gq": 45, + "low_confidence": false, + "gnomad_exome_af": null, + "gnomad_genome_af": null, + "rsids": [], + "af": null, + "common": false + }, + { + "stars": 2, + "chrom": "chr5", + "pos": 70951946, + "ref": "C", + "alt": "T", + "genotype": "hom", + "gene": "SMN1", + "significance": "Pathogenic", + "review_status": "criteria provided, multiple submitters, no conflicts", + "combined_allele": ".", + "dp": 31, + "gq": 45, + "low_confidence": false, + "gnomad_exome_af": null, + "gnomad_genome_af": null, + "rsids": [], + "af": null, + "common": false + }, + { + "stars": 1, + "chrom": "chr13", + "pos": 20189473, + "ref": "C", + "alt": "T", + "genotype": "one copy, other copy not called ref (1/.)", + "gene": "GJB2", + "significance": "Likely pathogenic", + "review_status": "criteria provided, single submitter", + "combined_allele": "combined allele of chr13:20189473 C>T + chr13:20189475 G>A", + "dp": 5, + "gq": 40, + "low_confidence": true, + "gnomad_exome_af": null, + "gnomad_genome_af": null, + "rsids": [], + "af": null, + "common": false + }, + { + "stars": 1, + "chrom": "chr3", + "pos": 15645186, + "ref": "G", + "alt": "C", + "genotype": "het", + "gene": "BTD", + "significance": "Pathogenic/Likely pathogenic", + "review_status": "criteria provided, conflicting classifications", + "combined_allele": ".", + "dp": null, + "gq": null, + "low_confidence": false, + "gnomad_exome_af": null, + "gnomad_genome_af": null, + "rsids": [], + "af": null, + "common": false + }, + { + "stars": 0, + "chrom": "chr2", + "pos": 100, + "ref": "A", + "alt": "G", + "genotype": "het", + "gene": ".", + "significance": ".", + "review_status": ".", + "combined_allele": ".", + "dp": null, + "gq": null, + "low_confidence": false, + "gnomad_exome_af": null, + "gnomad_genome_af": null, + "rsids": [], + "af": null, + "common": false + }, + { + "stars": 0, + "chrom": "chrX", + "pos": 101398000, + "ref": "C", + "alt": "T", + "genotype": "1", + "gene": "GLA", + "significance": "Pathogenic", + "review_status": "no assertion criteria provided", + "combined_allele": "possibly one allele with chrX:101398004 G>A: check ClinVar for a combined record", + "dp": null, + "gq": null, + "low_confidence": false, + "gnomad_exome_af": null, + "gnomad_genome_af": null, + "rsids": [], + "af": null, + "common": false + } + ], + "low_confidence": 2, + "call_floor": { + "GQ": 20, + "DP": 8 + }, + "frequency": { + "source": null, + "note": "vep/S_vep.vcf.gz has no .tbi index", + "common_af": 0.01 + } + } + }, + "carrier": { + "title": "Carrier list", + "step": "06", + "state": "ok", + "source": "clinvar/S_clinvar_hits.vcf", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "genes_on_list": 3292, + "list": "assets/carrier_genes.tsv", + "carriers": [ + { + "gene": "MUTYH", + "variant": "chr1:45331556 C>T", + "genotype": "het", + "significance": "Pathogenic", + "stars": 2, + "inheritance": "AR", + "condition": "MUTYH-related polyposis" + }, + { + "gene": "HFE", + "variant": "chr6:26092913 G>A", + "genotype": "het", + "significance": "Pathogenic", + "stars": 3, + "inheritance": "AR", + "condition": "Symptomatic form of HFE-related hemochromatosis" + }, + { + "gene": "CFTR", + "variant": "chr7:117559590 ATCT>A", + "genotype": "het", + "significance": "Pathogenic", + "stars": 4, + "inheritance": "AR", + "condition": "Cystic fibrosis" + }, + { + "gene": "GJB2", + "variant": "chr13:20189473 C>T", + "genotype": "one copy, other copy not called ref (1/.)", + "significance": "Likely pathogenic", + "stars": 1, + "inheritance": "AR", + "condition": "Nonsyndromic hearing loss, recessive (DFNB1A)", + "combined_allele": "combined allele of chr13:20189473 C>T + chr13:20189475 G>A" + }, + { + "gene": "BRCA1", + "variant": "chr17:43057100 C>T", + "genotype": "het", + "significance": "Pathogenic", + "stars": 3, + "inheritance": "AR", + "condition": "Fanconi anemia", + "combined_allele": "part of a combined allele: chr17:43057100 C>T, chr17:43057102 A>G; unphased, so the parts may sit on different haplotypes" + }, + { + "gene": "GLA", + "variant": "chrX:101398000 C>T", + "genotype": "hemizygous", + "significance": "Pathogenic", + "stars": 0, + "inheritance": "XL", + "condition": "Fabry disease", + "combined_allele": "possibly one allele with chrX:101398004 G>A: check ClinVar for a combined record" + }, + { + "gene": "HBA1", + "variant": "chr16:176700 G>A", + "genotype": "het", + "significance": "Pathogenic", + "stars": 2, + "inheritance": "AR", + "condition": "Alpha-thalassemia" + }, + { + "gene": "SMN1", + "variant": "chr5:70951946 C>T", + "genotype": "hom", + "significance": "Pathogenic", + "stars": 2, + "inheritance": "AR", + "condition": "Spinal muscular atrophy" + } + ], + "set_aside": [ + { + "gene": "BTD", + "variant": "chr3:15645186 G>C", + "genotype": "het", + "significance": "Pathogenic/Likely pathogenic", + "stars": 1, + "inheritance": "AR", + "condition": "Biotinidase deficiency", + "kind": "hypomorph", + "name": "p.Asp444His (p.Asp424His on NM_001370658.1), partial biotinidase deficiency" + } + ], + "two_hits": { + "genes": [], + "deletions_read": [ + "step 35's HBA1/HBA2 count" + ], + "deletions_not_read": [ + "AnnotSV (step 05): no table", + "step 35's interval table: none", + "Parascopy's SMN1 count: not resolved" + ] + } + } + }, + "pharmcat": { + "title": "PharmCAT", + "step": "07", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "cpic": { + "title": "CPIC drug-gene recommendations", + "step": "27", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "pypgx": { + "title": "pypgx", + "step": "32", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "cyrius": { + "title": "Cyrius (CYP2D6)", + "step": "21", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "cpsr": { + "title": "Cancer predisposition (CPSR)", + "step": "17", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "clinical": { + "title": "Clinical variant filter", + "step": "23", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + }, + "slivar": { + "title": "Variant prioritization (slivar)", + "step": "31", + "state": "missing", + "source": null, + "file_date": null, + "note": null, + "data": {} + } + }, + "cyp2d6": { + "calls": { + "PharmCAT": null, + "pypgx": null, + "Cyrius": null + }, + "agree": null, + "consensus": null, + "probable": null + } +} diff --git a/tests/parity/golden/summary-collect/cb-quoted-dosage/cb-quoted-dosage.json b/tests/parity/golden/summary-collect/cb-quoted-dosage/cb-quoted-dosage.json new file mode 100644 index 000000000..86fc5522d --- /dev/null +++ b/tests/parity/golden/summary-collect/cb-quoted-dosage/cb-quoted-dosage.json @@ -0,0 +1,1111 @@ +{ + "schema_version": 2, + "sample": "S", + "generated_utc": "2026-11-19 23:00 UTC", + "run": { + "status_file": true, + "started_utc": "2020-01-01 00:00 UTC", + "declared_sex": null + }, + "databases": { + "clinvar_release": null, + "cpsr_clinvar_release": null, + "hla_database": null + }, + "manifest": [], + "sections": { + "clinvar": { + "title": "ClinVar screen", + "step": "06", + "state": "ok", + "source": "clinvar/S_clinvar_hits.vcf", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "count": 8, + "by_stars": { + "4": 0, + "3": 2, + "2": 3, + "1": 1, + "0": 2 + }, + "hits": [ + { + "stars": 4, + "chrom": "chr7", + "pos": 117559590, + "ref": "ATCT", + "alt": "A", + "genotype": "het", + "gene": "CFTR", + "significance": "Pathogenic", + "review_status": "practice guideline", + "combined_allele": ".", + "dp": 30, + "gq": 15, + "low_confidence": true, + "gnomad_exome_af": 0.008, + "gnomad_genome_af": 0.007, + "rsids": [ + "rs113993960" + ], + "af": 0.008, + "common": false, + "cdna": { + "check": "not_checked", + "note": "not in the read-check table", + "alt_reads": null, + "alt_clipped": null, + "ref_reads": null, + "ref_clipped": null + } + }, + { + "stars": 3, + "chrom": "chr17", + "pos": 43057100, + "ref": "C", + "alt": "T", + "genotype": "het", + "gene": "BRCA1,NBR2", + "significance": "Pathogenic", + "review_status": "reviewed by expert panel", + "combined_allele": "part of a combined allele: chr17:43057100 C>T, chr17:43057102 A>G; unphased, so the parts may sit on different haplotypes", + "dp": 35, + "gq": 60, + "low_confidence": false, + "gnomad_exome_af": null, + "gnomad_genome_af": null, + "rsids": [], + "af": null, + "common": false, + "cdna": { + "check": "not_checked", + "note": "not in the read-check table", + "alt_reads": null, + "alt_clipped": null, + "ref_reads": null, + "ref_clipped": null + } + }, + { + "stars": 3, + "chrom": "chr6", + "pos": 26092913, + "ref": "G", + "alt": "A", + "genotype": "het", + "gene": "HFE", + "significance": "Pathogenic", + "review_status": "reviewed by expert panel", + "combined_allele": ".", + "dp": 40, + "gq": 99, + "low_confidence": false, + "gnomad_exome_af": 0.06, + "gnomad_genome_af": 0.05, + "rsids": [ + "rs99", + "rs1800562" + ], + "af": 0.06, + "common": true, + "cdna": { + "check": "clean", + "note": "", + "alt_reads": 20, + "alt_clipped": 0, + "ref_reads": 20, + "ref_clipped": 0, + "construct": null + } + }, + { + "stars": 2, + "chrom": "chr1", + "pos": 45331556, + "ref": "C", + "alt": "T", + "genotype": "het", + "gene": "MUTYH", + "significance": "Pathogenic", + "review_status": "criteria provided, multiple submitters, no conflicts", + "combined_allele": ".", + "dp": 30, + "gq": 50, + "low_confidence": false, + "gnomad_exome_af": 0.002, + "gnomad_genome_af": 0.0005, + "rsids": [ + "rs36053993" + ], + "af": 0.002, + "common": false, + "cdna": { + "check": "flagged", + "note": "possible cDNA/transgene contamination: check the reads", + "alt_reads": 12, + "alt_clipped": 6, + "ref_reads": 10, + "ref_clipped": 0, + "construct": "yes" + } + }, + { + "stars": 2, + "chrom": "chr16", + "pos": 176700, + "ref": "G", + "alt": "A", + "genotype": "het", + "gene": "HBA1", + "significance": "Pathogenic", + "review_status": "criteria provided, multiple submitters, no conflicts", + "combined_allele": ".", + "dp": 31, + "gq": 45, + "low_confidence": false, + "gnomad_exome_af": null, + "gnomad_genome_af": null, + "rsids": [], + "af": null, + "common": false, + "cdna": { + "check": "not_checked", + "note": "not in the read-check table", + "alt_reads": null, + "alt_clipped": null, + "ref_reads": null, + "ref_clipped": null + } + }, + { + "stars": 2, + "chrom": "chr5", + "pos": 70951946, + "ref": "C", + "alt": "T", + "genotype": "hom", + "gene": "SMN1", + "significance": "Pathogenic", + "review_status": "criteria provided, multiple submitters, no conflicts", + "combined_allele": ".", + "dp": 31, + "gq": 45, + "low_confidence": false, + "gnomad_exome_af": null, + "gnomad_genome_af": null, + "rsids": [], + "af": null, + "common": false, + "cdna": { + "check": "not_checked", + "note": "not in the read-check table", + "alt_reads": null, + "alt_clipped": null, + "ref_reads": null, + "ref_clipped": null + } + }, + { + "stars": 1, + "chrom": "chr13", + "pos": 20189473, + "ref": "C", + "alt": "T", + "genotype": "one copy, other copy not called ref (1/.)", + "gene": "GJB2", + "significance": "Likely pathogenic", + "review_status": "criteria provided, single submitter", + "combined_allele": "combined allele of chr13:20189473 C>T + chr13:20189475 G>A", + "dp": 5, + "gq": 40, + "low_confidence": true, + "gnomad_exome_af": 0.03, + "gnomad_genome_af": null, + "rsids": [ + "rs80338939" + ], + "af": 0.03, + "common": true, + "cdna": { + "check": "not_checked", + "note": "not in the read-check table", + "alt_reads": null, + "alt_clipped": null, + "ref_reads": null, + "ref_clipped": null + } + }, + { + "stars": 1, + "chrom": "chr3", + "pos": 15645186, + "ref": "G", + "alt": "C", + "genotype": "het", + "gene": "BTD", + "significance": "Pathogenic/Likely pathogenic", + "review_status": "criteria provided, conflicting classifications", + "combined_allele": ".", + "dp": null, + "gq": null, + "low_confidence": false, + "gnomad_exome_af": null, + "gnomad_genome_af": null, + "rsids": [], + "af": null, + "common": false, + "cdna": { + "check": "not_checked", + "note": "not in the read-check table", + "alt_reads": null, + "alt_clipped": null, + "ref_reads": null, + "ref_clipped": null + } + }, + { + "stars": 0, + "chrom": "chr2", + "pos": 100, + "ref": "A", + "alt": "G", + "genotype": "het", + "gene": ".", + "significance": ".", + "review_status": ".", + "combined_allele": ".", + "dp": null, + "gq": null, + "low_confidence": false, + "gnomad_exome_af": null, + "gnomad_genome_af": null, + "rsids": [], + "af": null, + "common": false, + "cdna": { + "check": "not_checked", + "note": "not in the read-check table", + "alt_reads": null, + "alt_clipped": null, + "ref_reads": null, + "ref_clipped": null + } + }, + { + "stars": 0, + "chrom": "chrX", + "pos": 101398000, + "ref": "C", + "alt": "T", + "genotype": "1", + "gene": "GLA", + "significance": "Pathogenic", + "review_status": "no assertion criteria provided", + "combined_allele": "possibly one allele with chrX:101398004 G>A: check ClinVar for a combined record", + "dp": null, + "gq": null, + "low_confidence": false, + "gnomad_exome_af": null, + "gnomad_genome_af": null, + "rsids": [], + "af": null, + "common": false, + "cdna": { + "check": "not_checked", + "note": "not in the read-check table", + "alt_reads": null, + "alt_clipped": null, + "ref_reads": null, + "ref_clipped": null + } + } + ], + "low_confidence": 2, + "call_floor": { + "GQ": 20, + "DP": 8 + }, + "frequency": { + "source": "vep/S_vep.vcf.gz", + "note": null, + "common_af": 0.01 + }, + "cdna_flagged": 1, + "construct_sites": 1, + "cdna_scan": { + "note": "2 genes with spliced reads", + "loci": [ + { + "chrom": "chr1", + "start": 100, + "end": 200, + "junctions": 2, + "reads": 5, + "junction_list": "A:1-2,A:3-4" + } + ] + }, + "deep_intronic": [ + { + "chrom": "chr7", + "pos": 117639961, + "ref": "C", + "alt": "T", + "gene": "CFTR", + "hgvs": "c.3718-2477C>T", + "clinvar_id": "7129", + "call": "no call", + "detail": "" + } + ] + } + }, + "carrier": { + "title": "Carrier list", + "step": "06", + "state": "ok", + "source": "clinvar/S_clinvar_hits.vcf", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "genes_on_list": 3292, + "list": "assets/carrier_genes.tsv", + "carriers": [ + { + "gene": "MUTYH", + "variant": "chr1:45331556 C>T", + "genotype": "het", + "significance": "Pathogenic", + "stars": 2, + "inheritance": "AR", + "condition": "MUTYH-related polyposis" + }, + { + "gene": "HFE", + "variant": "chr6:26092913 G>A", + "genotype": "het", + "significance": "Pathogenic", + "stars": 3, + "inheritance": "AR", + "condition": "Symptomatic form of HFE-related hemochromatosis" + }, + { + "gene": "CFTR", + "variant": "chr7:117559590 ATCT>A", + "genotype": "het", + "significance": "Pathogenic", + "stars": 4, + "inheritance": "AR", + "condition": "Cystic fibrosis" + }, + { + "gene": "GJB2", + "variant": "chr13:20189473 C>T", + "genotype": "one copy, other copy not called ref (1/.)", + "significance": "Likely pathogenic", + "stars": 1, + "inheritance": "AR", + "condition": "Nonsyndromic hearing loss, recessive (DFNB1A)", + "combined_allele": "combined allele of chr13:20189473 C>T + chr13:20189475 G>A" + }, + { + "gene": "BRCA1", + "variant": "chr17:43057100 C>T", + "genotype": "het", + "significance": "Pathogenic", + "stars": 3, + "inheritance": "AR", + "condition": "Fanconi anemia", + "combined_allele": "part of a combined allele: chr17:43057100 C>T, chr17:43057102 A>G; unphased, so the parts may sit on different haplotypes" + }, + { + "gene": "GLA", + "variant": "chrX:101398000 C>T", + "genotype": "hemizygous", + "significance": "Pathogenic", + "stars": 0, + "inheritance": "XL", + "condition": "Fabry disease", + "combined_allele": "possibly one allele with chrX:101398004 G>A: check ClinVar for a combined record" + }, + { + "gene": "HBA1", + "variant": "chr16:176700 G>A", + "genotype": "het", + "significance": "Pathogenic", + "stars": 2, + "inheritance": "AR", + "condition": "Alpha-thalassemia" + }, + { + "gene": "SMN1", + "variant": "chr5:70951946 C>T", + "genotype": "hemizygous", + "significance": "Pathogenic", + "stars": 2, + "inheritance": "AR", + "condition": "Spinal muscular atrophy", + "hemizygous": "called homozygous inside one SMN1 copy (Parascopy, step 35)" + } + ], + "set_aside": [ + { + "gene": "BTD", + "variant": "chr3:15645186 G>C", + "genotype": "het", + "significance": "Pathogenic/Likely pathogenic", + "stars": 1, + "inheritance": "AR", + "condition": "Biotinidase deficiency", + "kind": "hypomorph", + "name": "p.Asp444His (p.Asp424His on NM_001370658.1), partial biotinidase deficiency" + } + ], + "two_hits": { + "genes": [ + { + "gene": "CFTR", + "verdict": "possibly biallelic", + "why": "a heterozygous call inside a called deletion: one of the two calls may be wrong; check the reads", + "deletion": "CFTR_del deletion, 1 of 2 copies (read depth, step 35)", + "variant": "chr7:117559590 ATCT>A", + "genotype": "het", + "allele": null, + "condition": "Cystic fibrosis", + "inheritance": "AR" + }, + { + "gene": "GJB2", + "verdict": "possibly biallelic", + "why": "a heterozygous call inside a called deletion: one of the two calls may be wrong; check the reads", + "deletion": "DEL chr13:20180000-20200000 (AnnotSV class 4, Manta)", + "variant": "chr13:20189473 C>T", + "genotype": "one copy, other copy not called ref (1/.)", + "allele": null, + "condition": "Nonsyndromic hearing loss, recessive (DFNB1A)", + "inheritance": "AR" + }, + { + "gene": "HBA1", + "verdict": "possibly biallelic", + "why": "phase unknown, possibly in trans (no read-backed phase links the two calls)", + "deletion": "3 of 4 alpha-globin genes (read depth, step 35)", + "variant": "chr16:176700 G>A", + "genotype": "het", + "allele": null, + "condition": "Alpha-thalassemia", + "inheritance": "AR" + }, + { + "gene": "MUTYH", + "verdict": "biallelic", + "why": "in trans: read-backed phase puts them on different copies (phase set 45331000)", + "deletion": "DEL chr1:45338000-45340000 (AnnotSV class 5, Manta)", + "variant": "chr1:45331556 C>T", + "genotype": "het", + "allele": null, + "condition": "MUTYH-related polyposis", + "inheritance": "AR" + }, + { + "gene": "SMN1", + "verdict": "biallelic", + "why": "the variant is called homozygous inside the deletion: hemizygous on the copy the deletion leaves if the deletion is real, homozygous if not; both copies carry it either way", + "deletion": "one SMN1 copy (Parascopy, step 35)", + "variant": "chr5:70951946 C>T", + "genotype": "hemizygous", + "allele": null, + "condition": "Spinal muscular atrophy", + "inheritance": "AR" + } + ], + "deletions_read": [ + "AnnotSV class 4 and 5 deletions (step 05)", + "step 35's interval table (read depth)", + "step 35's HBA1/HBA2 count", + "Parascopy's SMN1 count (step 35)" + ], + "deletions_not_read": [] + } + } + }, + "pharmcat": { + "title": "PharmCAT", + "step": "07", + "state": "ok", + "source": "pharmcat/S.report.json", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "version": "3.4.0", + "html_report": true + } + }, + "cpic": { + "title": "CPIC drug-gene recommendations", + "step": "27", + "state": "ok", + "source": "cpic/S_phenotypes.tsv", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "genes": [ + { + "gene": "CYP2D6", + "diplotype": "*1/*4", + "phenotype": "Intermediate Metabolizer", + "status": "non-normal" + }, + { + "gene": "CYP2C19", + "diplotype": "*1/*17", + "phenotype": "Rapid", + "status": "ambiguous" + }, + { + "gene": "CYP2C9", + "diplotype": "*1/*1", + "phenotype": "Normal", + "status": "normal" + }, + { + "gene": "DPYD", + "diplotype": null, + "phenotype": null, + "status": null + } + ], + "non_normal": 1, + "ambiguous": 1, + "not_called": 0, + "unclassified": 0, + "parse_failed": false, + "warnings": [ + "CYP2C19 has two possible phenotypes", + "last" + ] + } + }, + "pypgx": { + "title": "pypgx", + "step": "32", + "state": "ok", + "source": "pypgx/S_pypgx_summary.tsv", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "genes_total": 6, + "genes_called": 3, + "cyp2d6": "*1/*2", + "cnv_call": { + "CYP2D6": "Normal", + "CYP2A6": "not called: pypgx failed", + "CYP2B6": "not called: the CYP2D6 depth check failed", + "SLCO1B1": "not called: pypgx gave no copy-number call" + }, + "not_callable": [ + "CYP2E1" + ], + "low_gq": [ + { + "gene": "UGT1A1", + "diplotype": "Indeterminate", + "min_gq": 12, + "weakest": "chr2:1:A:G" + }, + { + "gene": "SLCO1B1", + "diplotype": "*1/*5", + "min_gq": null, + "weakest": "" + } + ], + "cyp2d6_evidence": { + "phenotype": "Normal Metabolizer", + "defining_filter": "PASS", + "quality": "ok" + }, + "depth_check": { + "status": "ok", + "gene_mapq1_share": "0.99", + "body_mapq20_share": "0.95" + }, + "comparison": { + "conflicts": 1, + "one_tool_only": 2, + "concordant": 1 + } + } + }, + "cyrius": { + "title": "Cyrius (CYP2D6)", + "step": "21", + "state": "ok", + "source": "cyrius/S_cyp2d6.tsv", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "genotype": "*2/*1", + "filter": "PASS" + } + }, + "cpsr": { + "title": "Cancer predisposition (CPSR)", + "step": "17", + "state": "ok", + "source": "cpsr/S.cpsr.grch38.classification.tsv.gz", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "html_report": true, + "classification_column": "CLASSIFICATION", + "classification": { + "Pathogenic": 1, + "Likely_Pathogenic": 1, + "VUS": 1, + "Benign": 1, + ".": 1 + }, + "plp": [ + { + "variant": "17:43057100 C>T", + "gene": "BRCA1", + "final": "Pathogenic", + "cpsr": "Likely_Benign", + "clinvar": "Pathogenic", + "authority": "ClinVar", + "acmg_codes": "PVS1", + "dp": 6, + "low_confidence": true, + "cdna": { + "check": "flagged", + "note": "splice", + "alt_reads": 5, + "alt_clipped": 5, + "ref_reads": 9, + "ref_clipped": 0, + "construct": null + } + }, + { + "variant": "13:32338000 G>A", + "gene": "BRCA2", + "final": "Likely_Pathogenic", + "cpsr": "VUS", + "clinvar": null, + "authority": "CPSR", + "acmg_codes": null, + "dp": 40, + "low_confidence": false, + "cdna": { + "check": "not_checked", + "note": "not in the read-check table", + "alt_reads": null, + "alt_clipped": null, + "ref_reads": null, + "ref_clipped": null + } + }, + { + "variant": "2:47403000 A>G", + "gene": "MSH2", + "final": "VUS", + "cpsr": "LP", + "clinvar": "B", + "authority": null, + "acmg_codes": null, + "dp": null, + "low_confidence": false, + "cdna": { + "check": "not_checked", + "note": "not in the read-check table", + "alt_reads": null, + "alt_clipped": null, + "ref_reads": null, + "ref_clipped": null + } + }, + { + "variant": "5:112839000 A>T", + "gene": "APC", + "final": ".", + "cpsr": "Pathogenic", + "clinvar": null, + "authority": null, + "acmg_codes": null, + "dp": 30, + "low_confidence": false, + "cdna": { + "check": "not_checked", + "note": "not in the read-check table", + "alt_reads": null, + "alt_clipped": null, + "ref_reads": null, + "ref_clipped": null + } + } + ], + "disagreements": [ + { + "variant": "17:43057100 C>T", + "gene": "BRCA1", + "final": "Pathogenic", + "cpsr": "Likely_Benign", + "clinvar": "Pathogenic", + "authority": "ClinVar", + "acmg_codes": "PVS1", + "dp": 6, + "low_confidence": true, + "cdna": { + "check": "flagged", + "note": "splice", + "alt_reads": 5, + "alt_clipped": 5, + "ref_reads": 9, + "ref_clipped": 0, + "construct": null + } + }, + { + "variant": "2:47403000 A>G", + "gene": "MSH2", + "final": "VUS", + "cpsr": "LP", + "clinvar": "B", + "authority": null, + "acmg_codes": null, + "dp": null, + "low_confidence": false, + "cdna": { + "check": "not_checked", + "note": "not in the read-check table", + "alt_reads": null, + "alt_clipped": null, + "ref_reads": null, + "ref_clipped": null + } + } + ], + "final_plp_own_benign": 1, + "own_class_column": "CPSR_CLASSIFICATION", + "low_confidence": 1, + "call_floor_dp": 8, + "cdna_flagged": 1 + } + }, + "clinical": { + "title": "Clinical variant filter", + "step": "23", + "state": "ok", + "source": "clinical/S_clinical_summary.tsv", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "variants": 5, + "by_impact": { + "HIGH": 3, + "MODERATE": 1, + ".": 1 + }, + "genes": 3, + "acmg_sf": { + "version": "ACMG SF v3.3", + "genes_on_list": 84, + "rules": "assets/acmg_sf.tsv", + "clinvar_hits": [ + { + "gene": "MUTYH", + "variant": "chr1:45331556 C>T", + "genotype": "het", + "significance": "Pathogenic", + "stars": 2, + "low_confidence": false, + "rule": "P and LP (2 variants)", + "rule_note": null, + "severity": null, + "two_hit": "biallelic with DEL chr1:45338000-45340000 (AnnotSV class 5, Manta): in trans: read-backed phase puts them on different copies (phase set 45331000)", + "pair": "biallelic", + "phase": "in trans: read-backed phase puts them on different copies (phase set 45331000)" + }, + { + "gene": "BRCA1", + "variant": "chr17:43057100 C>T", + "genotype": "het", + "significance": "Pathogenic", + "stars": 3, + "low_confidence": false, + "combined_allele": "part of a combined allele: chr17:43057100 C>T, chr17:43057102 A>G; unphased, so the parts may sit on different haplotypes", + "rule": "All P and LP", + "rule_note": null, + "severity": null + }, + { + "gene": "GLA", + "variant": "chrX:101398000 C>T", + "genotype": "1", + "significance": "Pathogenic", + "stars": 0, + "low_confidence": false, + "combined_allele": "possibly one allele with chrX:101398004 G>A: check ClinVar for a combined record", + "rule": "All hemi, het, homozygous P and LP", + "rule_note": null, + "severity": null + } + ], + "clinvar_checked": true, + "high_impact": [ + { + "gene": "MUTYH", + "variant": "chr1:45332000 G>A", + "genotype": "het", + "consequence": "stop_gained", + "transcript": "MANE", + "frequency": "rare", + "frequency_unknown": false, + "weak_call": false, + "call_note": null, + "gq": 40, + "dp": 30, + "ad": "15,15", + "rule": "P and LP (2 variants)", + "rule_note": null, + "severity": null, + "pair": "biallelic", + "phase": "in trans: read-backed phase puts them on different copies (phase set 45331000)" + }, + { + "gene": "MYBPC3", + "variant": "chr11:47332000 G>A", + "genotype": "het", + "consequence": "splice_donor_variant,intron_variant", + "transcript": "ANY", + "frequency": "rare", + "frequency_unknown": false, + "weak_call": false, + "call_note": null, + "gq": null, + "dp": null, + "ad": null, + "rule": "All P and LP", + "rule_note": null, + "severity": null + }, + { + "gene": "MSH2", + "variant": "chr2:47414000 A>AT", + "genotype": "het", + "consequence": "frameshift_variant", + "transcript": "CANONICAL", + "frequency": "rare", + "frequency_unknown": false, + "weak_call": true, + "call_note": "alt reads 0.07 of the depth on a heterozygote", + "gq": 50, + "dp": 30, + "ad": "28,2", + "rule": "All P and LP", + "rule_note": "A deletion of the 3' end of EPCAM silences MSH2 and counts as an MSH2 finding.", + "severity": null + } + ], + "high_impact_checked": true, + "high_impact_rare": 2, + "high_impact_weak": 1, + "high_impact_frequency_unknown": 0, + "structural": [ + { + "gene": "MSH2", + "variant": "DEL chr2:47386000-47388000", + "acmg_class": "4", + "caller": "Delly", + "support": 1, + "via": "EPCAM exons 8 and 9, the 3' end (ENST00000263735)", + "rule": "All P and LP", + "rule_note": "A deletion of the 3' end of EPCAM silences MSH2 and counts as an MSH2 finding.", + "severity": null + }, + { + "gene": "BRCA1", + "variant": "DUP chr17:43000000-43100000", + "acmg_class": "4", + "caller": "CNVpytor", + "support": 1, + "via": null, + "rule": "All P and LP", + "rule_note": null, + "severity": null + } + ], + "structural_checked": true, + "structural_note": null, + "not_reported": [ + { + "gene": "HFE", + "variant": "chr6:26092913 G>A", + "genotype": "het", + "source": "ClinVar", + "reason": "HFE is reported only for: HFE p.C282Y homozygotes only" + }, + { + "gene": "BTD", + "variant": "chr3:15645186 G>C", + "genotype": "het", + "source": "ClinVar", + "reason": "one heterozygous variant; BTD is reported with P and LP (2 variants)" + }, + { + "gene": "HFE", + "variant": "chr6:26093000 C>T", + "genotype": "hom", + "source": "HIGH impact", + "reason": "HFE is reported only for: HFE p.C282Y homozygotes only" + } + ], + "two_hit_note": null + }, + "frequency_unknown": 1, + "weak_calls": 2 + } + }, + "slivar": { + "title": "Variant prioritization (slivar)", + "step": "31", + "state": "ok", + "source": "slivar/S_slivar_summary.tsv", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "prioritized": 2, + "frequency_unknown": 1, + "compound_het_variants": 4, + "compound_het_genes": 2, + "compound_het_pairs": 26, + "compound_het_phase": { + "trans": 23, + "cis": 1, + "unknown": 1 + }, + "compound_het_trans": [ + { + "gene": "G1", + "variants": "chr1:10 A>G + chr1:15 C>T", + "reads": "1 of 2" + }, + { + "gene": "G2", + "variants": "chr1:20 A>G + chr1:25 C>T", + "reads": "2 of 3" + }, + { + "gene": "G3", + "variants": "chr1:30 A>G + chr1:35 C>T", + "reads": "3 of 4" + }, + { + "gene": "G4", + "variants": "chr1:40 A>G + chr1:45 C>T", + "reads": "4 of 5" + }, + { + "gene": "G5", + "variants": "chr1:50 A>G + chr1:55 C>T", + "reads": "5 of 6" + }, + { + "gene": "G6", + "variants": "chr1:60 A>G + chr1:65 C>T", + "reads": "6 of 7" + }, + { + "gene": "G7", + "variants": "chr1:70 A>G + chr1:75 C>T", + "reads": "7 of 8" + }, + { + "gene": "G8", + "variants": "chr1:80 A>G + chr1:85 C>T", + "reads": "8 of 9" + }, + { + "gene": "G9", + "variants": "chr1:90 A>G + chr1:95 C>T", + "reads": "9 of 10" + }, + { + "gene": "G10", + "variants": "chr1:100 A>G + chr1:105 C>T", + "reads": "10 of 11" + }, + { + "gene": "G11", + "variants": "chr1:110 A>G + chr1:115 C>T", + "reads": "11 of 12" + }, + { + "gene": "G12", + "variants": "chr1:120 A>G + chr1:125 C>T", + "reads": "12 of 13" + }, + { + "gene": "G13", + "variants": "chr1:130 A>G + chr1:135 C>T", + "reads": "13 of 14" + }, + { + "gene": "G14", + "variants": "chr1:140 A>G + chr1:145 C>T", + "reads": "14 of 15" + }, + { + "gene": "G15", + "variants": "chr1:150 A>G + chr1:155 C>T", + "reads": "15 of 16" + }, + { + "gene": "G16", + "variants": "chr1:160 A>G + chr1:165 C>T", + "reads": "16 of 17" + }, + { + "gene": "G17", + "variants": "chr1:170 A>G + chr1:175 C>T", + "reads": "17 of 18" + }, + { + "gene": "G18", + "variants": "chr1:180 A>G + chr1:185 C>T", + "reads": "18 of 19" + }, + { + "gene": "G19", + "variants": "chr1:190 A>G + chr1:195 C>T", + "reads": "19 of 20" + }, + { + "gene": "G20", + "variants": "chr1:200 A>G + chr1:205 C>T", + "reads": "20 of 21" + } + ] + } + } + }, + "cyp2d6": { + "calls": { + "PharmCAT": "*1/*4", + "pypgx": "*1/*2", + "Cyrius": "*2/*1" + }, + "agree": true, + "consensus": { + "result": "*1/*2", + "passed_to_pharmcat": true, + "reason": "pypgx and Cyrius agree", + "source": "pgx_consensus/S_pgx_consensus.tsv" + }, + "probable": null + } +} diff --git a/tests/parity/golden/summary-collect/cb-quoted-interval/cb-quoted-interval.json b/tests/parity/golden/summary-collect/cb-quoted-interval/cb-quoted-interval.json new file mode 100644 index 000000000..86fc5522d --- /dev/null +++ b/tests/parity/golden/summary-collect/cb-quoted-interval/cb-quoted-interval.json @@ -0,0 +1,1111 @@ +{ + "schema_version": 2, + "sample": "S", + "generated_utc": "2026-11-19 23:00 UTC", + "run": { + "status_file": true, + "started_utc": "2020-01-01 00:00 UTC", + "declared_sex": null + }, + "databases": { + "clinvar_release": null, + "cpsr_clinvar_release": null, + "hla_database": null + }, + "manifest": [], + "sections": { + "clinvar": { + "title": "ClinVar screen", + "step": "06", + "state": "ok", + "source": "clinvar/S_clinvar_hits.vcf", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "count": 8, + "by_stars": { + "4": 0, + "3": 2, + "2": 3, + "1": 1, + "0": 2 + }, + "hits": [ + { + "stars": 4, + "chrom": "chr7", + "pos": 117559590, + "ref": "ATCT", + "alt": "A", + "genotype": "het", + "gene": "CFTR", + "significance": "Pathogenic", + "review_status": "practice guideline", + "combined_allele": ".", + "dp": 30, + "gq": 15, + "low_confidence": true, + "gnomad_exome_af": 0.008, + "gnomad_genome_af": 0.007, + "rsids": [ + "rs113993960" + ], + "af": 0.008, + "common": false, + "cdna": { + "check": "not_checked", + "note": "not in the read-check table", + "alt_reads": null, + "alt_clipped": null, + "ref_reads": null, + "ref_clipped": null + } + }, + { + "stars": 3, + "chrom": "chr17", + "pos": 43057100, + "ref": "C", + "alt": "T", + "genotype": "het", + "gene": "BRCA1,NBR2", + "significance": "Pathogenic", + "review_status": "reviewed by expert panel", + "combined_allele": "part of a combined allele: chr17:43057100 C>T, chr17:43057102 A>G; unphased, so the parts may sit on different haplotypes", + "dp": 35, + "gq": 60, + "low_confidence": false, + "gnomad_exome_af": null, + "gnomad_genome_af": null, + "rsids": [], + "af": null, + "common": false, + "cdna": { + "check": "not_checked", + "note": "not in the read-check table", + "alt_reads": null, + "alt_clipped": null, + "ref_reads": null, + "ref_clipped": null + } + }, + { + "stars": 3, + "chrom": "chr6", + "pos": 26092913, + "ref": "G", + "alt": "A", + "genotype": "het", + "gene": "HFE", + "significance": "Pathogenic", + "review_status": "reviewed by expert panel", + "combined_allele": ".", + "dp": 40, + "gq": 99, + "low_confidence": false, + "gnomad_exome_af": 0.06, + "gnomad_genome_af": 0.05, + "rsids": [ + "rs99", + "rs1800562" + ], + "af": 0.06, + "common": true, + "cdna": { + "check": "clean", + "note": "", + "alt_reads": 20, + "alt_clipped": 0, + "ref_reads": 20, + "ref_clipped": 0, + "construct": null + } + }, + { + "stars": 2, + "chrom": "chr1", + "pos": 45331556, + "ref": "C", + "alt": "T", + "genotype": "het", + "gene": "MUTYH", + "significance": "Pathogenic", + "review_status": "criteria provided, multiple submitters, no conflicts", + "combined_allele": ".", + "dp": 30, + "gq": 50, + "low_confidence": false, + "gnomad_exome_af": 0.002, + "gnomad_genome_af": 0.0005, + "rsids": [ + "rs36053993" + ], + "af": 0.002, + "common": false, + "cdna": { + "check": "flagged", + "note": "possible cDNA/transgene contamination: check the reads", + "alt_reads": 12, + "alt_clipped": 6, + "ref_reads": 10, + "ref_clipped": 0, + "construct": "yes" + } + }, + { + "stars": 2, + "chrom": "chr16", + "pos": 176700, + "ref": "G", + "alt": "A", + "genotype": "het", + "gene": "HBA1", + "significance": "Pathogenic", + "review_status": "criteria provided, multiple submitters, no conflicts", + "combined_allele": ".", + "dp": 31, + "gq": 45, + "low_confidence": false, + "gnomad_exome_af": null, + "gnomad_genome_af": null, + "rsids": [], + "af": null, + "common": false, + "cdna": { + "check": "not_checked", + "note": "not in the read-check table", + "alt_reads": null, + "alt_clipped": null, + "ref_reads": null, + "ref_clipped": null + } + }, + { + "stars": 2, + "chrom": "chr5", + "pos": 70951946, + "ref": "C", + "alt": "T", + "genotype": "hom", + "gene": "SMN1", + "significance": "Pathogenic", + "review_status": "criteria provided, multiple submitters, no conflicts", + "combined_allele": ".", + "dp": 31, + "gq": 45, + "low_confidence": false, + "gnomad_exome_af": null, + "gnomad_genome_af": null, + "rsids": [], + "af": null, + "common": false, + "cdna": { + "check": "not_checked", + "note": "not in the read-check table", + "alt_reads": null, + "alt_clipped": null, + "ref_reads": null, + "ref_clipped": null + } + }, + { + "stars": 1, + "chrom": "chr13", + "pos": 20189473, + "ref": "C", + "alt": "T", + "genotype": "one copy, other copy not called ref (1/.)", + "gene": "GJB2", + "significance": "Likely pathogenic", + "review_status": "criteria provided, single submitter", + "combined_allele": "combined allele of chr13:20189473 C>T + chr13:20189475 G>A", + "dp": 5, + "gq": 40, + "low_confidence": true, + "gnomad_exome_af": 0.03, + "gnomad_genome_af": null, + "rsids": [ + "rs80338939" + ], + "af": 0.03, + "common": true, + "cdna": { + "check": "not_checked", + "note": "not in the read-check table", + "alt_reads": null, + "alt_clipped": null, + "ref_reads": null, + "ref_clipped": null + } + }, + { + "stars": 1, + "chrom": "chr3", + "pos": 15645186, + "ref": "G", + "alt": "C", + "genotype": "het", + "gene": "BTD", + "significance": "Pathogenic/Likely pathogenic", + "review_status": "criteria provided, conflicting classifications", + "combined_allele": ".", + "dp": null, + "gq": null, + "low_confidence": false, + "gnomad_exome_af": null, + "gnomad_genome_af": null, + "rsids": [], + "af": null, + "common": false, + "cdna": { + "check": "not_checked", + "note": "not in the read-check table", + "alt_reads": null, + "alt_clipped": null, + "ref_reads": null, + "ref_clipped": null + } + }, + { + "stars": 0, + "chrom": "chr2", + "pos": 100, + "ref": "A", + "alt": "G", + "genotype": "het", + "gene": ".", + "significance": ".", + "review_status": ".", + "combined_allele": ".", + "dp": null, + "gq": null, + "low_confidence": false, + "gnomad_exome_af": null, + "gnomad_genome_af": null, + "rsids": [], + "af": null, + "common": false, + "cdna": { + "check": "not_checked", + "note": "not in the read-check table", + "alt_reads": null, + "alt_clipped": null, + "ref_reads": null, + "ref_clipped": null + } + }, + { + "stars": 0, + "chrom": "chrX", + "pos": 101398000, + "ref": "C", + "alt": "T", + "genotype": "1", + "gene": "GLA", + "significance": "Pathogenic", + "review_status": "no assertion criteria provided", + "combined_allele": "possibly one allele with chrX:101398004 G>A: check ClinVar for a combined record", + "dp": null, + "gq": null, + "low_confidence": false, + "gnomad_exome_af": null, + "gnomad_genome_af": null, + "rsids": [], + "af": null, + "common": false, + "cdna": { + "check": "not_checked", + "note": "not in the read-check table", + "alt_reads": null, + "alt_clipped": null, + "ref_reads": null, + "ref_clipped": null + } + } + ], + "low_confidence": 2, + "call_floor": { + "GQ": 20, + "DP": 8 + }, + "frequency": { + "source": "vep/S_vep.vcf.gz", + "note": null, + "common_af": 0.01 + }, + "cdna_flagged": 1, + "construct_sites": 1, + "cdna_scan": { + "note": "2 genes with spliced reads", + "loci": [ + { + "chrom": "chr1", + "start": 100, + "end": 200, + "junctions": 2, + "reads": 5, + "junction_list": "A:1-2,A:3-4" + } + ] + }, + "deep_intronic": [ + { + "chrom": "chr7", + "pos": 117639961, + "ref": "C", + "alt": "T", + "gene": "CFTR", + "hgvs": "c.3718-2477C>T", + "clinvar_id": "7129", + "call": "no call", + "detail": "" + } + ] + } + }, + "carrier": { + "title": "Carrier list", + "step": "06", + "state": "ok", + "source": "clinvar/S_clinvar_hits.vcf", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "genes_on_list": 3292, + "list": "assets/carrier_genes.tsv", + "carriers": [ + { + "gene": "MUTYH", + "variant": "chr1:45331556 C>T", + "genotype": "het", + "significance": "Pathogenic", + "stars": 2, + "inheritance": "AR", + "condition": "MUTYH-related polyposis" + }, + { + "gene": "HFE", + "variant": "chr6:26092913 G>A", + "genotype": "het", + "significance": "Pathogenic", + "stars": 3, + "inheritance": "AR", + "condition": "Symptomatic form of HFE-related hemochromatosis" + }, + { + "gene": "CFTR", + "variant": "chr7:117559590 ATCT>A", + "genotype": "het", + "significance": "Pathogenic", + "stars": 4, + "inheritance": "AR", + "condition": "Cystic fibrosis" + }, + { + "gene": "GJB2", + "variant": "chr13:20189473 C>T", + "genotype": "one copy, other copy not called ref (1/.)", + "significance": "Likely pathogenic", + "stars": 1, + "inheritance": "AR", + "condition": "Nonsyndromic hearing loss, recessive (DFNB1A)", + "combined_allele": "combined allele of chr13:20189473 C>T + chr13:20189475 G>A" + }, + { + "gene": "BRCA1", + "variant": "chr17:43057100 C>T", + "genotype": "het", + "significance": "Pathogenic", + "stars": 3, + "inheritance": "AR", + "condition": "Fanconi anemia", + "combined_allele": "part of a combined allele: chr17:43057100 C>T, chr17:43057102 A>G; unphased, so the parts may sit on different haplotypes" + }, + { + "gene": "GLA", + "variant": "chrX:101398000 C>T", + "genotype": "hemizygous", + "significance": "Pathogenic", + "stars": 0, + "inheritance": "XL", + "condition": "Fabry disease", + "combined_allele": "possibly one allele with chrX:101398004 G>A: check ClinVar for a combined record" + }, + { + "gene": "HBA1", + "variant": "chr16:176700 G>A", + "genotype": "het", + "significance": "Pathogenic", + "stars": 2, + "inheritance": "AR", + "condition": "Alpha-thalassemia" + }, + { + "gene": "SMN1", + "variant": "chr5:70951946 C>T", + "genotype": "hemizygous", + "significance": "Pathogenic", + "stars": 2, + "inheritance": "AR", + "condition": "Spinal muscular atrophy", + "hemizygous": "called homozygous inside one SMN1 copy (Parascopy, step 35)" + } + ], + "set_aside": [ + { + "gene": "BTD", + "variant": "chr3:15645186 G>C", + "genotype": "het", + "significance": "Pathogenic/Likely pathogenic", + "stars": 1, + "inheritance": "AR", + "condition": "Biotinidase deficiency", + "kind": "hypomorph", + "name": "p.Asp444His (p.Asp424His on NM_001370658.1), partial biotinidase deficiency" + } + ], + "two_hits": { + "genes": [ + { + "gene": "CFTR", + "verdict": "possibly biallelic", + "why": "a heterozygous call inside a called deletion: one of the two calls may be wrong; check the reads", + "deletion": "CFTR_del deletion, 1 of 2 copies (read depth, step 35)", + "variant": "chr7:117559590 ATCT>A", + "genotype": "het", + "allele": null, + "condition": "Cystic fibrosis", + "inheritance": "AR" + }, + { + "gene": "GJB2", + "verdict": "possibly biallelic", + "why": "a heterozygous call inside a called deletion: one of the two calls may be wrong; check the reads", + "deletion": "DEL chr13:20180000-20200000 (AnnotSV class 4, Manta)", + "variant": "chr13:20189473 C>T", + "genotype": "one copy, other copy not called ref (1/.)", + "allele": null, + "condition": "Nonsyndromic hearing loss, recessive (DFNB1A)", + "inheritance": "AR" + }, + { + "gene": "HBA1", + "verdict": "possibly biallelic", + "why": "phase unknown, possibly in trans (no read-backed phase links the two calls)", + "deletion": "3 of 4 alpha-globin genes (read depth, step 35)", + "variant": "chr16:176700 G>A", + "genotype": "het", + "allele": null, + "condition": "Alpha-thalassemia", + "inheritance": "AR" + }, + { + "gene": "MUTYH", + "verdict": "biallelic", + "why": "in trans: read-backed phase puts them on different copies (phase set 45331000)", + "deletion": "DEL chr1:45338000-45340000 (AnnotSV class 5, Manta)", + "variant": "chr1:45331556 C>T", + "genotype": "het", + "allele": null, + "condition": "MUTYH-related polyposis", + "inheritance": "AR" + }, + { + "gene": "SMN1", + "verdict": "biallelic", + "why": "the variant is called homozygous inside the deletion: hemizygous on the copy the deletion leaves if the deletion is real, homozygous if not; both copies carry it either way", + "deletion": "one SMN1 copy (Parascopy, step 35)", + "variant": "chr5:70951946 C>T", + "genotype": "hemizygous", + "allele": null, + "condition": "Spinal muscular atrophy", + "inheritance": "AR" + } + ], + "deletions_read": [ + "AnnotSV class 4 and 5 deletions (step 05)", + "step 35's interval table (read depth)", + "step 35's HBA1/HBA2 count", + "Parascopy's SMN1 count (step 35)" + ], + "deletions_not_read": [] + } + } + }, + "pharmcat": { + "title": "PharmCAT", + "step": "07", + "state": "ok", + "source": "pharmcat/S.report.json", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "version": "3.4.0", + "html_report": true + } + }, + "cpic": { + "title": "CPIC drug-gene recommendations", + "step": "27", + "state": "ok", + "source": "cpic/S_phenotypes.tsv", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "genes": [ + { + "gene": "CYP2D6", + "diplotype": "*1/*4", + "phenotype": "Intermediate Metabolizer", + "status": "non-normal" + }, + { + "gene": "CYP2C19", + "diplotype": "*1/*17", + "phenotype": "Rapid", + "status": "ambiguous" + }, + { + "gene": "CYP2C9", + "diplotype": "*1/*1", + "phenotype": "Normal", + "status": "normal" + }, + { + "gene": "DPYD", + "diplotype": null, + "phenotype": null, + "status": null + } + ], + "non_normal": 1, + "ambiguous": 1, + "not_called": 0, + "unclassified": 0, + "parse_failed": false, + "warnings": [ + "CYP2C19 has two possible phenotypes", + "last" + ] + } + }, + "pypgx": { + "title": "pypgx", + "step": "32", + "state": "ok", + "source": "pypgx/S_pypgx_summary.tsv", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "genes_total": 6, + "genes_called": 3, + "cyp2d6": "*1/*2", + "cnv_call": { + "CYP2D6": "Normal", + "CYP2A6": "not called: pypgx failed", + "CYP2B6": "not called: the CYP2D6 depth check failed", + "SLCO1B1": "not called: pypgx gave no copy-number call" + }, + "not_callable": [ + "CYP2E1" + ], + "low_gq": [ + { + "gene": "UGT1A1", + "diplotype": "Indeterminate", + "min_gq": 12, + "weakest": "chr2:1:A:G" + }, + { + "gene": "SLCO1B1", + "diplotype": "*1/*5", + "min_gq": null, + "weakest": "" + } + ], + "cyp2d6_evidence": { + "phenotype": "Normal Metabolizer", + "defining_filter": "PASS", + "quality": "ok" + }, + "depth_check": { + "status": "ok", + "gene_mapq1_share": "0.99", + "body_mapq20_share": "0.95" + }, + "comparison": { + "conflicts": 1, + "one_tool_only": 2, + "concordant": 1 + } + } + }, + "cyrius": { + "title": "Cyrius (CYP2D6)", + "step": "21", + "state": "ok", + "source": "cyrius/S_cyp2d6.tsv", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "genotype": "*2/*1", + "filter": "PASS" + } + }, + "cpsr": { + "title": "Cancer predisposition (CPSR)", + "step": "17", + "state": "ok", + "source": "cpsr/S.cpsr.grch38.classification.tsv.gz", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "html_report": true, + "classification_column": "CLASSIFICATION", + "classification": { + "Pathogenic": 1, + "Likely_Pathogenic": 1, + "VUS": 1, + "Benign": 1, + ".": 1 + }, + "plp": [ + { + "variant": "17:43057100 C>T", + "gene": "BRCA1", + "final": "Pathogenic", + "cpsr": "Likely_Benign", + "clinvar": "Pathogenic", + "authority": "ClinVar", + "acmg_codes": "PVS1", + "dp": 6, + "low_confidence": true, + "cdna": { + "check": "flagged", + "note": "splice", + "alt_reads": 5, + "alt_clipped": 5, + "ref_reads": 9, + "ref_clipped": 0, + "construct": null + } + }, + { + "variant": "13:32338000 G>A", + "gene": "BRCA2", + "final": "Likely_Pathogenic", + "cpsr": "VUS", + "clinvar": null, + "authority": "CPSR", + "acmg_codes": null, + "dp": 40, + "low_confidence": false, + "cdna": { + "check": "not_checked", + "note": "not in the read-check table", + "alt_reads": null, + "alt_clipped": null, + "ref_reads": null, + "ref_clipped": null + } + }, + { + "variant": "2:47403000 A>G", + "gene": "MSH2", + "final": "VUS", + "cpsr": "LP", + "clinvar": "B", + "authority": null, + "acmg_codes": null, + "dp": null, + "low_confidence": false, + "cdna": { + "check": "not_checked", + "note": "not in the read-check table", + "alt_reads": null, + "alt_clipped": null, + "ref_reads": null, + "ref_clipped": null + } + }, + { + "variant": "5:112839000 A>T", + "gene": "APC", + "final": ".", + "cpsr": "Pathogenic", + "clinvar": null, + "authority": null, + "acmg_codes": null, + "dp": 30, + "low_confidence": false, + "cdna": { + "check": "not_checked", + "note": "not in the read-check table", + "alt_reads": null, + "alt_clipped": null, + "ref_reads": null, + "ref_clipped": null + } + } + ], + "disagreements": [ + { + "variant": "17:43057100 C>T", + "gene": "BRCA1", + "final": "Pathogenic", + "cpsr": "Likely_Benign", + "clinvar": "Pathogenic", + "authority": "ClinVar", + "acmg_codes": "PVS1", + "dp": 6, + "low_confidence": true, + "cdna": { + "check": "flagged", + "note": "splice", + "alt_reads": 5, + "alt_clipped": 5, + "ref_reads": 9, + "ref_clipped": 0, + "construct": null + } + }, + { + "variant": "2:47403000 A>G", + "gene": "MSH2", + "final": "VUS", + "cpsr": "LP", + "clinvar": "B", + "authority": null, + "acmg_codes": null, + "dp": null, + "low_confidence": false, + "cdna": { + "check": "not_checked", + "note": "not in the read-check table", + "alt_reads": null, + "alt_clipped": null, + "ref_reads": null, + "ref_clipped": null + } + } + ], + "final_plp_own_benign": 1, + "own_class_column": "CPSR_CLASSIFICATION", + "low_confidence": 1, + "call_floor_dp": 8, + "cdna_flagged": 1 + } + }, + "clinical": { + "title": "Clinical variant filter", + "step": "23", + "state": "ok", + "source": "clinical/S_clinical_summary.tsv", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "variants": 5, + "by_impact": { + "HIGH": 3, + "MODERATE": 1, + ".": 1 + }, + "genes": 3, + "acmg_sf": { + "version": "ACMG SF v3.3", + "genes_on_list": 84, + "rules": "assets/acmg_sf.tsv", + "clinvar_hits": [ + { + "gene": "MUTYH", + "variant": "chr1:45331556 C>T", + "genotype": "het", + "significance": "Pathogenic", + "stars": 2, + "low_confidence": false, + "rule": "P and LP (2 variants)", + "rule_note": null, + "severity": null, + "two_hit": "biallelic with DEL chr1:45338000-45340000 (AnnotSV class 5, Manta): in trans: read-backed phase puts them on different copies (phase set 45331000)", + "pair": "biallelic", + "phase": "in trans: read-backed phase puts them on different copies (phase set 45331000)" + }, + { + "gene": "BRCA1", + "variant": "chr17:43057100 C>T", + "genotype": "het", + "significance": "Pathogenic", + "stars": 3, + "low_confidence": false, + "combined_allele": "part of a combined allele: chr17:43057100 C>T, chr17:43057102 A>G; unphased, so the parts may sit on different haplotypes", + "rule": "All P and LP", + "rule_note": null, + "severity": null + }, + { + "gene": "GLA", + "variant": "chrX:101398000 C>T", + "genotype": "1", + "significance": "Pathogenic", + "stars": 0, + "low_confidence": false, + "combined_allele": "possibly one allele with chrX:101398004 G>A: check ClinVar for a combined record", + "rule": "All hemi, het, homozygous P and LP", + "rule_note": null, + "severity": null + } + ], + "clinvar_checked": true, + "high_impact": [ + { + "gene": "MUTYH", + "variant": "chr1:45332000 G>A", + "genotype": "het", + "consequence": "stop_gained", + "transcript": "MANE", + "frequency": "rare", + "frequency_unknown": false, + "weak_call": false, + "call_note": null, + "gq": 40, + "dp": 30, + "ad": "15,15", + "rule": "P and LP (2 variants)", + "rule_note": null, + "severity": null, + "pair": "biallelic", + "phase": "in trans: read-backed phase puts them on different copies (phase set 45331000)" + }, + { + "gene": "MYBPC3", + "variant": "chr11:47332000 G>A", + "genotype": "het", + "consequence": "splice_donor_variant,intron_variant", + "transcript": "ANY", + "frequency": "rare", + "frequency_unknown": false, + "weak_call": false, + "call_note": null, + "gq": null, + "dp": null, + "ad": null, + "rule": "All P and LP", + "rule_note": null, + "severity": null + }, + { + "gene": "MSH2", + "variant": "chr2:47414000 A>AT", + "genotype": "het", + "consequence": "frameshift_variant", + "transcript": "CANONICAL", + "frequency": "rare", + "frequency_unknown": false, + "weak_call": true, + "call_note": "alt reads 0.07 of the depth on a heterozygote", + "gq": 50, + "dp": 30, + "ad": "28,2", + "rule": "All P and LP", + "rule_note": "A deletion of the 3' end of EPCAM silences MSH2 and counts as an MSH2 finding.", + "severity": null + } + ], + "high_impact_checked": true, + "high_impact_rare": 2, + "high_impact_weak": 1, + "high_impact_frequency_unknown": 0, + "structural": [ + { + "gene": "MSH2", + "variant": "DEL chr2:47386000-47388000", + "acmg_class": "4", + "caller": "Delly", + "support": 1, + "via": "EPCAM exons 8 and 9, the 3' end (ENST00000263735)", + "rule": "All P and LP", + "rule_note": "A deletion of the 3' end of EPCAM silences MSH2 and counts as an MSH2 finding.", + "severity": null + }, + { + "gene": "BRCA1", + "variant": "DUP chr17:43000000-43100000", + "acmg_class": "4", + "caller": "CNVpytor", + "support": 1, + "via": null, + "rule": "All P and LP", + "rule_note": null, + "severity": null + } + ], + "structural_checked": true, + "structural_note": null, + "not_reported": [ + { + "gene": "HFE", + "variant": "chr6:26092913 G>A", + "genotype": "het", + "source": "ClinVar", + "reason": "HFE is reported only for: HFE p.C282Y homozygotes only" + }, + { + "gene": "BTD", + "variant": "chr3:15645186 G>C", + "genotype": "het", + "source": "ClinVar", + "reason": "one heterozygous variant; BTD is reported with P and LP (2 variants)" + }, + { + "gene": "HFE", + "variant": "chr6:26093000 C>T", + "genotype": "hom", + "source": "HIGH impact", + "reason": "HFE is reported only for: HFE p.C282Y homozygotes only" + } + ], + "two_hit_note": null + }, + "frequency_unknown": 1, + "weak_calls": 2 + } + }, + "slivar": { + "title": "Variant prioritization (slivar)", + "step": "31", + "state": "ok", + "source": "slivar/S_slivar_summary.tsv", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "prioritized": 2, + "frequency_unknown": 1, + "compound_het_variants": 4, + "compound_het_genes": 2, + "compound_het_pairs": 26, + "compound_het_phase": { + "trans": 23, + "cis": 1, + "unknown": 1 + }, + "compound_het_trans": [ + { + "gene": "G1", + "variants": "chr1:10 A>G + chr1:15 C>T", + "reads": "1 of 2" + }, + { + "gene": "G2", + "variants": "chr1:20 A>G + chr1:25 C>T", + "reads": "2 of 3" + }, + { + "gene": "G3", + "variants": "chr1:30 A>G + chr1:35 C>T", + "reads": "3 of 4" + }, + { + "gene": "G4", + "variants": "chr1:40 A>G + chr1:45 C>T", + "reads": "4 of 5" + }, + { + "gene": "G5", + "variants": "chr1:50 A>G + chr1:55 C>T", + "reads": "5 of 6" + }, + { + "gene": "G6", + "variants": "chr1:60 A>G + chr1:65 C>T", + "reads": "6 of 7" + }, + { + "gene": "G7", + "variants": "chr1:70 A>G + chr1:75 C>T", + "reads": "7 of 8" + }, + { + "gene": "G8", + "variants": "chr1:80 A>G + chr1:85 C>T", + "reads": "8 of 9" + }, + { + "gene": "G9", + "variants": "chr1:90 A>G + chr1:95 C>T", + "reads": "9 of 10" + }, + { + "gene": "G10", + "variants": "chr1:100 A>G + chr1:105 C>T", + "reads": "10 of 11" + }, + { + "gene": "G11", + "variants": "chr1:110 A>G + chr1:115 C>T", + "reads": "11 of 12" + }, + { + "gene": "G12", + "variants": "chr1:120 A>G + chr1:125 C>T", + "reads": "12 of 13" + }, + { + "gene": "G13", + "variants": "chr1:130 A>G + chr1:135 C>T", + "reads": "13 of 14" + }, + { + "gene": "G14", + "variants": "chr1:140 A>G + chr1:145 C>T", + "reads": "14 of 15" + }, + { + "gene": "G15", + "variants": "chr1:150 A>G + chr1:155 C>T", + "reads": "15 of 16" + }, + { + "gene": "G16", + "variants": "chr1:160 A>G + chr1:165 C>T", + "reads": "16 of 17" + }, + { + "gene": "G17", + "variants": "chr1:170 A>G + chr1:175 C>T", + "reads": "17 of 18" + }, + { + "gene": "G18", + "variants": "chr1:180 A>G + chr1:185 C>T", + "reads": "18 of 19" + }, + { + "gene": "G19", + "variants": "chr1:190 A>G + chr1:195 C>T", + "reads": "19 of 20" + }, + { + "gene": "G20", + "variants": "chr1:200 A>G + chr1:205 C>T", + "reads": "20 of 21" + } + ] + } + } + }, + "cyp2d6": { + "calls": { + "PharmCAT": "*1/*4", + "pypgx": "*1/*2", + "Cyrius": "*2/*1" + }, + "agree": true, + "consensus": { + "result": "*1/*2", + "passed_to_pharmcat": true, + "reason": "pypgx and Cyrius agree", + "source": "pgx_consensus/S_pgx_consensus.tsv" + }, + "probable": null + } +} diff --git a/tests/parity/golden/summary-collect/cb-quoted-smn/cb-quoted-smn.json b/tests/parity/golden/summary-collect/cb-quoted-smn/cb-quoted-smn.json new file mode 100644 index 000000000..86fc5522d --- /dev/null +++ b/tests/parity/golden/summary-collect/cb-quoted-smn/cb-quoted-smn.json @@ -0,0 +1,1111 @@ +{ + "schema_version": 2, + "sample": "S", + "generated_utc": "2026-11-19 23:00 UTC", + "run": { + "status_file": true, + "started_utc": "2020-01-01 00:00 UTC", + "declared_sex": null + }, + "databases": { + "clinvar_release": null, + "cpsr_clinvar_release": null, + "hla_database": null + }, + "manifest": [], + "sections": { + "clinvar": { + "title": "ClinVar screen", + "step": "06", + "state": "ok", + "source": "clinvar/S_clinvar_hits.vcf", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "count": 8, + "by_stars": { + "4": 0, + "3": 2, + "2": 3, + "1": 1, + "0": 2 + }, + "hits": [ + { + "stars": 4, + "chrom": "chr7", + "pos": 117559590, + "ref": "ATCT", + "alt": "A", + "genotype": "het", + "gene": "CFTR", + "significance": "Pathogenic", + "review_status": "practice guideline", + "combined_allele": ".", + "dp": 30, + "gq": 15, + "low_confidence": true, + "gnomad_exome_af": 0.008, + "gnomad_genome_af": 0.007, + "rsids": [ + "rs113993960" + ], + "af": 0.008, + "common": false, + "cdna": { + "check": "not_checked", + "note": "not in the read-check table", + "alt_reads": null, + "alt_clipped": null, + "ref_reads": null, + "ref_clipped": null + } + }, + { + "stars": 3, + "chrom": "chr17", + "pos": 43057100, + "ref": "C", + "alt": "T", + "genotype": "het", + "gene": "BRCA1,NBR2", + "significance": "Pathogenic", + "review_status": "reviewed by expert panel", + "combined_allele": "part of a combined allele: chr17:43057100 C>T, chr17:43057102 A>G; unphased, so the parts may sit on different haplotypes", + "dp": 35, + "gq": 60, + "low_confidence": false, + "gnomad_exome_af": null, + "gnomad_genome_af": null, + "rsids": [], + "af": null, + "common": false, + "cdna": { + "check": "not_checked", + "note": "not in the read-check table", + "alt_reads": null, + "alt_clipped": null, + "ref_reads": null, + "ref_clipped": null + } + }, + { + "stars": 3, + "chrom": "chr6", + "pos": 26092913, + "ref": "G", + "alt": "A", + "genotype": "het", + "gene": "HFE", + "significance": "Pathogenic", + "review_status": "reviewed by expert panel", + "combined_allele": ".", + "dp": 40, + "gq": 99, + "low_confidence": false, + "gnomad_exome_af": 0.06, + "gnomad_genome_af": 0.05, + "rsids": [ + "rs99", + "rs1800562" + ], + "af": 0.06, + "common": true, + "cdna": { + "check": "clean", + "note": "", + "alt_reads": 20, + "alt_clipped": 0, + "ref_reads": 20, + "ref_clipped": 0, + "construct": null + } + }, + { + "stars": 2, + "chrom": "chr1", + "pos": 45331556, + "ref": "C", + "alt": "T", + "genotype": "het", + "gene": "MUTYH", + "significance": "Pathogenic", + "review_status": "criteria provided, multiple submitters, no conflicts", + "combined_allele": ".", + "dp": 30, + "gq": 50, + "low_confidence": false, + "gnomad_exome_af": 0.002, + "gnomad_genome_af": 0.0005, + "rsids": [ + "rs36053993" + ], + "af": 0.002, + "common": false, + "cdna": { + "check": "flagged", + "note": "possible cDNA/transgene contamination: check the reads", + "alt_reads": 12, + "alt_clipped": 6, + "ref_reads": 10, + "ref_clipped": 0, + "construct": "yes" + } + }, + { + "stars": 2, + "chrom": "chr16", + "pos": 176700, + "ref": "G", + "alt": "A", + "genotype": "het", + "gene": "HBA1", + "significance": "Pathogenic", + "review_status": "criteria provided, multiple submitters, no conflicts", + "combined_allele": ".", + "dp": 31, + "gq": 45, + "low_confidence": false, + "gnomad_exome_af": null, + "gnomad_genome_af": null, + "rsids": [], + "af": null, + "common": false, + "cdna": { + "check": "not_checked", + "note": "not in the read-check table", + "alt_reads": null, + "alt_clipped": null, + "ref_reads": null, + "ref_clipped": null + } + }, + { + "stars": 2, + "chrom": "chr5", + "pos": 70951946, + "ref": "C", + "alt": "T", + "genotype": "hom", + "gene": "SMN1", + "significance": "Pathogenic", + "review_status": "criteria provided, multiple submitters, no conflicts", + "combined_allele": ".", + "dp": 31, + "gq": 45, + "low_confidence": false, + "gnomad_exome_af": null, + "gnomad_genome_af": null, + "rsids": [], + "af": null, + "common": false, + "cdna": { + "check": "not_checked", + "note": "not in the read-check table", + "alt_reads": null, + "alt_clipped": null, + "ref_reads": null, + "ref_clipped": null + } + }, + { + "stars": 1, + "chrom": "chr13", + "pos": 20189473, + "ref": "C", + "alt": "T", + "genotype": "one copy, other copy not called ref (1/.)", + "gene": "GJB2", + "significance": "Likely pathogenic", + "review_status": "criteria provided, single submitter", + "combined_allele": "combined allele of chr13:20189473 C>T + chr13:20189475 G>A", + "dp": 5, + "gq": 40, + "low_confidence": true, + "gnomad_exome_af": 0.03, + "gnomad_genome_af": null, + "rsids": [ + "rs80338939" + ], + "af": 0.03, + "common": true, + "cdna": { + "check": "not_checked", + "note": "not in the read-check table", + "alt_reads": null, + "alt_clipped": null, + "ref_reads": null, + "ref_clipped": null + } + }, + { + "stars": 1, + "chrom": "chr3", + "pos": 15645186, + "ref": "G", + "alt": "C", + "genotype": "het", + "gene": "BTD", + "significance": "Pathogenic/Likely pathogenic", + "review_status": "criteria provided, conflicting classifications", + "combined_allele": ".", + "dp": null, + "gq": null, + "low_confidence": false, + "gnomad_exome_af": null, + "gnomad_genome_af": null, + "rsids": [], + "af": null, + "common": false, + "cdna": { + "check": "not_checked", + "note": "not in the read-check table", + "alt_reads": null, + "alt_clipped": null, + "ref_reads": null, + "ref_clipped": null + } + }, + { + "stars": 0, + "chrom": "chr2", + "pos": 100, + "ref": "A", + "alt": "G", + "genotype": "het", + "gene": ".", + "significance": ".", + "review_status": ".", + "combined_allele": ".", + "dp": null, + "gq": null, + "low_confidence": false, + "gnomad_exome_af": null, + "gnomad_genome_af": null, + "rsids": [], + "af": null, + "common": false, + "cdna": { + "check": "not_checked", + "note": "not in the read-check table", + "alt_reads": null, + "alt_clipped": null, + "ref_reads": null, + "ref_clipped": null + } + }, + { + "stars": 0, + "chrom": "chrX", + "pos": 101398000, + "ref": "C", + "alt": "T", + "genotype": "1", + "gene": "GLA", + "significance": "Pathogenic", + "review_status": "no assertion criteria provided", + "combined_allele": "possibly one allele with chrX:101398004 G>A: check ClinVar for a combined record", + "dp": null, + "gq": null, + "low_confidence": false, + "gnomad_exome_af": null, + "gnomad_genome_af": null, + "rsids": [], + "af": null, + "common": false, + "cdna": { + "check": "not_checked", + "note": "not in the read-check table", + "alt_reads": null, + "alt_clipped": null, + "ref_reads": null, + "ref_clipped": null + } + } + ], + "low_confidence": 2, + "call_floor": { + "GQ": 20, + "DP": 8 + }, + "frequency": { + "source": "vep/S_vep.vcf.gz", + "note": null, + "common_af": 0.01 + }, + "cdna_flagged": 1, + "construct_sites": 1, + "cdna_scan": { + "note": "2 genes with spliced reads", + "loci": [ + { + "chrom": "chr1", + "start": 100, + "end": 200, + "junctions": 2, + "reads": 5, + "junction_list": "A:1-2,A:3-4" + } + ] + }, + "deep_intronic": [ + { + "chrom": "chr7", + "pos": 117639961, + "ref": "C", + "alt": "T", + "gene": "CFTR", + "hgvs": "c.3718-2477C>T", + "clinvar_id": "7129", + "call": "no call", + "detail": "" + } + ] + } + }, + "carrier": { + "title": "Carrier list", + "step": "06", + "state": "ok", + "source": "clinvar/S_clinvar_hits.vcf", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "genes_on_list": 3292, + "list": "assets/carrier_genes.tsv", + "carriers": [ + { + "gene": "MUTYH", + "variant": "chr1:45331556 C>T", + "genotype": "het", + "significance": "Pathogenic", + "stars": 2, + "inheritance": "AR", + "condition": "MUTYH-related polyposis" + }, + { + "gene": "HFE", + "variant": "chr6:26092913 G>A", + "genotype": "het", + "significance": "Pathogenic", + "stars": 3, + "inheritance": "AR", + "condition": "Symptomatic form of HFE-related hemochromatosis" + }, + { + "gene": "CFTR", + "variant": "chr7:117559590 ATCT>A", + "genotype": "het", + "significance": "Pathogenic", + "stars": 4, + "inheritance": "AR", + "condition": "Cystic fibrosis" + }, + { + "gene": "GJB2", + "variant": "chr13:20189473 C>T", + "genotype": "one copy, other copy not called ref (1/.)", + "significance": "Likely pathogenic", + "stars": 1, + "inheritance": "AR", + "condition": "Nonsyndromic hearing loss, recessive (DFNB1A)", + "combined_allele": "combined allele of chr13:20189473 C>T + chr13:20189475 G>A" + }, + { + "gene": "BRCA1", + "variant": "chr17:43057100 C>T", + "genotype": "het", + "significance": "Pathogenic", + "stars": 3, + "inheritance": "AR", + "condition": "Fanconi anemia", + "combined_allele": "part of a combined allele: chr17:43057100 C>T, chr17:43057102 A>G; unphased, so the parts may sit on different haplotypes" + }, + { + "gene": "GLA", + "variant": "chrX:101398000 C>T", + "genotype": "hemizygous", + "significance": "Pathogenic", + "stars": 0, + "inheritance": "XL", + "condition": "Fabry disease", + "combined_allele": "possibly one allele with chrX:101398004 G>A: check ClinVar for a combined record" + }, + { + "gene": "HBA1", + "variant": "chr16:176700 G>A", + "genotype": "het", + "significance": "Pathogenic", + "stars": 2, + "inheritance": "AR", + "condition": "Alpha-thalassemia" + }, + { + "gene": "SMN1", + "variant": "chr5:70951946 C>T", + "genotype": "hemizygous", + "significance": "Pathogenic", + "stars": 2, + "inheritance": "AR", + "condition": "Spinal muscular atrophy", + "hemizygous": "called homozygous inside one SMN1 copy (Parascopy, step 35)" + } + ], + "set_aside": [ + { + "gene": "BTD", + "variant": "chr3:15645186 G>C", + "genotype": "het", + "significance": "Pathogenic/Likely pathogenic", + "stars": 1, + "inheritance": "AR", + "condition": "Biotinidase deficiency", + "kind": "hypomorph", + "name": "p.Asp444His (p.Asp424His on NM_001370658.1), partial biotinidase deficiency" + } + ], + "two_hits": { + "genes": [ + { + "gene": "CFTR", + "verdict": "possibly biallelic", + "why": "a heterozygous call inside a called deletion: one of the two calls may be wrong; check the reads", + "deletion": "CFTR_del deletion, 1 of 2 copies (read depth, step 35)", + "variant": "chr7:117559590 ATCT>A", + "genotype": "het", + "allele": null, + "condition": "Cystic fibrosis", + "inheritance": "AR" + }, + { + "gene": "GJB2", + "verdict": "possibly biallelic", + "why": "a heterozygous call inside a called deletion: one of the two calls may be wrong; check the reads", + "deletion": "DEL chr13:20180000-20200000 (AnnotSV class 4, Manta)", + "variant": "chr13:20189473 C>T", + "genotype": "one copy, other copy not called ref (1/.)", + "allele": null, + "condition": "Nonsyndromic hearing loss, recessive (DFNB1A)", + "inheritance": "AR" + }, + { + "gene": "HBA1", + "verdict": "possibly biallelic", + "why": "phase unknown, possibly in trans (no read-backed phase links the two calls)", + "deletion": "3 of 4 alpha-globin genes (read depth, step 35)", + "variant": "chr16:176700 G>A", + "genotype": "het", + "allele": null, + "condition": "Alpha-thalassemia", + "inheritance": "AR" + }, + { + "gene": "MUTYH", + "verdict": "biallelic", + "why": "in trans: read-backed phase puts them on different copies (phase set 45331000)", + "deletion": "DEL chr1:45338000-45340000 (AnnotSV class 5, Manta)", + "variant": "chr1:45331556 C>T", + "genotype": "het", + "allele": null, + "condition": "MUTYH-related polyposis", + "inheritance": "AR" + }, + { + "gene": "SMN1", + "verdict": "biallelic", + "why": "the variant is called homozygous inside the deletion: hemizygous on the copy the deletion leaves if the deletion is real, homozygous if not; both copies carry it either way", + "deletion": "one SMN1 copy (Parascopy, step 35)", + "variant": "chr5:70951946 C>T", + "genotype": "hemizygous", + "allele": null, + "condition": "Spinal muscular atrophy", + "inheritance": "AR" + } + ], + "deletions_read": [ + "AnnotSV class 4 and 5 deletions (step 05)", + "step 35's interval table (read depth)", + "step 35's HBA1/HBA2 count", + "Parascopy's SMN1 count (step 35)" + ], + "deletions_not_read": [] + } + } + }, + "pharmcat": { + "title": "PharmCAT", + "step": "07", + "state": "ok", + "source": "pharmcat/S.report.json", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "version": "3.4.0", + "html_report": true + } + }, + "cpic": { + "title": "CPIC drug-gene recommendations", + "step": "27", + "state": "ok", + "source": "cpic/S_phenotypes.tsv", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "genes": [ + { + "gene": "CYP2D6", + "diplotype": "*1/*4", + "phenotype": "Intermediate Metabolizer", + "status": "non-normal" + }, + { + "gene": "CYP2C19", + "diplotype": "*1/*17", + "phenotype": "Rapid", + "status": "ambiguous" + }, + { + "gene": "CYP2C9", + "diplotype": "*1/*1", + "phenotype": "Normal", + "status": "normal" + }, + { + "gene": "DPYD", + "diplotype": null, + "phenotype": null, + "status": null + } + ], + "non_normal": 1, + "ambiguous": 1, + "not_called": 0, + "unclassified": 0, + "parse_failed": false, + "warnings": [ + "CYP2C19 has two possible phenotypes", + "last" + ] + } + }, + "pypgx": { + "title": "pypgx", + "step": "32", + "state": "ok", + "source": "pypgx/S_pypgx_summary.tsv", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "genes_total": 6, + "genes_called": 3, + "cyp2d6": "*1/*2", + "cnv_call": { + "CYP2D6": "Normal", + "CYP2A6": "not called: pypgx failed", + "CYP2B6": "not called: the CYP2D6 depth check failed", + "SLCO1B1": "not called: pypgx gave no copy-number call" + }, + "not_callable": [ + "CYP2E1" + ], + "low_gq": [ + { + "gene": "UGT1A1", + "diplotype": "Indeterminate", + "min_gq": 12, + "weakest": "chr2:1:A:G" + }, + { + "gene": "SLCO1B1", + "diplotype": "*1/*5", + "min_gq": null, + "weakest": "" + } + ], + "cyp2d6_evidence": { + "phenotype": "Normal Metabolizer", + "defining_filter": "PASS", + "quality": "ok" + }, + "depth_check": { + "status": "ok", + "gene_mapq1_share": "0.99", + "body_mapq20_share": "0.95" + }, + "comparison": { + "conflicts": 1, + "one_tool_only": 2, + "concordant": 1 + } + } + }, + "cyrius": { + "title": "Cyrius (CYP2D6)", + "step": "21", + "state": "ok", + "source": "cyrius/S_cyp2d6.tsv", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "genotype": "*2/*1", + "filter": "PASS" + } + }, + "cpsr": { + "title": "Cancer predisposition (CPSR)", + "step": "17", + "state": "ok", + "source": "cpsr/S.cpsr.grch38.classification.tsv.gz", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "html_report": true, + "classification_column": "CLASSIFICATION", + "classification": { + "Pathogenic": 1, + "Likely_Pathogenic": 1, + "VUS": 1, + "Benign": 1, + ".": 1 + }, + "plp": [ + { + "variant": "17:43057100 C>T", + "gene": "BRCA1", + "final": "Pathogenic", + "cpsr": "Likely_Benign", + "clinvar": "Pathogenic", + "authority": "ClinVar", + "acmg_codes": "PVS1", + "dp": 6, + "low_confidence": true, + "cdna": { + "check": "flagged", + "note": "splice", + "alt_reads": 5, + "alt_clipped": 5, + "ref_reads": 9, + "ref_clipped": 0, + "construct": null + } + }, + { + "variant": "13:32338000 G>A", + "gene": "BRCA2", + "final": "Likely_Pathogenic", + "cpsr": "VUS", + "clinvar": null, + "authority": "CPSR", + "acmg_codes": null, + "dp": 40, + "low_confidence": false, + "cdna": { + "check": "not_checked", + "note": "not in the read-check table", + "alt_reads": null, + "alt_clipped": null, + "ref_reads": null, + "ref_clipped": null + } + }, + { + "variant": "2:47403000 A>G", + "gene": "MSH2", + "final": "VUS", + "cpsr": "LP", + "clinvar": "B", + "authority": null, + "acmg_codes": null, + "dp": null, + "low_confidence": false, + "cdna": { + "check": "not_checked", + "note": "not in the read-check table", + "alt_reads": null, + "alt_clipped": null, + "ref_reads": null, + "ref_clipped": null + } + }, + { + "variant": "5:112839000 A>T", + "gene": "APC", + "final": ".", + "cpsr": "Pathogenic", + "clinvar": null, + "authority": null, + "acmg_codes": null, + "dp": 30, + "low_confidence": false, + "cdna": { + "check": "not_checked", + "note": "not in the read-check table", + "alt_reads": null, + "alt_clipped": null, + "ref_reads": null, + "ref_clipped": null + } + } + ], + "disagreements": [ + { + "variant": "17:43057100 C>T", + "gene": "BRCA1", + "final": "Pathogenic", + "cpsr": "Likely_Benign", + "clinvar": "Pathogenic", + "authority": "ClinVar", + "acmg_codes": "PVS1", + "dp": 6, + "low_confidence": true, + "cdna": { + "check": "flagged", + "note": "splice", + "alt_reads": 5, + "alt_clipped": 5, + "ref_reads": 9, + "ref_clipped": 0, + "construct": null + } + }, + { + "variant": "2:47403000 A>G", + "gene": "MSH2", + "final": "VUS", + "cpsr": "LP", + "clinvar": "B", + "authority": null, + "acmg_codes": null, + "dp": null, + "low_confidence": false, + "cdna": { + "check": "not_checked", + "note": "not in the read-check table", + "alt_reads": null, + "alt_clipped": null, + "ref_reads": null, + "ref_clipped": null + } + } + ], + "final_plp_own_benign": 1, + "own_class_column": "CPSR_CLASSIFICATION", + "low_confidence": 1, + "call_floor_dp": 8, + "cdna_flagged": 1 + } + }, + "clinical": { + "title": "Clinical variant filter", + "step": "23", + "state": "ok", + "source": "clinical/S_clinical_summary.tsv", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "variants": 5, + "by_impact": { + "HIGH": 3, + "MODERATE": 1, + ".": 1 + }, + "genes": 3, + "acmg_sf": { + "version": "ACMG SF v3.3", + "genes_on_list": 84, + "rules": "assets/acmg_sf.tsv", + "clinvar_hits": [ + { + "gene": "MUTYH", + "variant": "chr1:45331556 C>T", + "genotype": "het", + "significance": "Pathogenic", + "stars": 2, + "low_confidence": false, + "rule": "P and LP (2 variants)", + "rule_note": null, + "severity": null, + "two_hit": "biallelic with DEL chr1:45338000-45340000 (AnnotSV class 5, Manta): in trans: read-backed phase puts them on different copies (phase set 45331000)", + "pair": "biallelic", + "phase": "in trans: read-backed phase puts them on different copies (phase set 45331000)" + }, + { + "gene": "BRCA1", + "variant": "chr17:43057100 C>T", + "genotype": "het", + "significance": "Pathogenic", + "stars": 3, + "low_confidence": false, + "combined_allele": "part of a combined allele: chr17:43057100 C>T, chr17:43057102 A>G; unphased, so the parts may sit on different haplotypes", + "rule": "All P and LP", + "rule_note": null, + "severity": null + }, + { + "gene": "GLA", + "variant": "chrX:101398000 C>T", + "genotype": "1", + "significance": "Pathogenic", + "stars": 0, + "low_confidence": false, + "combined_allele": "possibly one allele with chrX:101398004 G>A: check ClinVar for a combined record", + "rule": "All hemi, het, homozygous P and LP", + "rule_note": null, + "severity": null + } + ], + "clinvar_checked": true, + "high_impact": [ + { + "gene": "MUTYH", + "variant": "chr1:45332000 G>A", + "genotype": "het", + "consequence": "stop_gained", + "transcript": "MANE", + "frequency": "rare", + "frequency_unknown": false, + "weak_call": false, + "call_note": null, + "gq": 40, + "dp": 30, + "ad": "15,15", + "rule": "P and LP (2 variants)", + "rule_note": null, + "severity": null, + "pair": "biallelic", + "phase": "in trans: read-backed phase puts them on different copies (phase set 45331000)" + }, + { + "gene": "MYBPC3", + "variant": "chr11:47332000 G>A", + "genotype": "het", + "consequence": "splice_donor_variant,intron_variant", + "transcript": "ANY", + "frequency": "rare", + "frequency_unknown": false, + "weak_call": false, + "call_note": null, + "gq": null, + "dp": null, + "ad": null, + "rule": "All P and LP", + "rule_note": null, + "severity": null + }, + { + "gene": "MSH2", + "variant": "chr2:47414000 A>AT", + "genotype": "het", + "consequence": "frameshift_variant", + "transcript": "CANONICAL", + "frequency": "rare", + "frequency_unknown": false, + "weak_call": true, + "call_note": "alt reads 0.07 of the depth on a heterozygote", + "gq": 50, + "dp": 30, + "ad": "28,2", + "rule": "All P and LP", + "rule_note": "A deletion of the 3' end of EPCAM silences MSH2 and counts as an MSH2 finding.", + "severity": null + } + ], + "high_impact_checked": true, + "high_impact_rare": 2, + "high_impact_weak": 1, + "high_impact_frequency_unknown": 0, + "structural": [ + { + "gene": "MSH2", + "variant": "DEL chr2:47386000-47388000", + "acmg_class": "4", + "caller": "Delly", + "support": 1, + "via": "EPCAM exons 8 and 9, the 3' end (ENST00000263735)", + "rule": "All P and LP", + "rule_note": "A deletion of the 3' end of EPCAM silences MSH2 and counts as an MSH2 finding.", + "severity": null + }, + { + "gene": "BRCA1", + "variant": "DUP chr17:43000000-43100000", + "acmg_class": "4", + "caller": "CNVpytor", + "support": 1, + "via": null, + "rule": "All P and LP", + "rule_note": null, + "severity": null + } + ], + "structural_checked": true, + "structural_note": null, + "not_reported": [ + { + "gene": "HFE", + "variant": "chr6:26092913 G>A", + "genotype": "het", + "source": "ClinVar", + "reason": "HFE is reported only for: HFE p.C282Y homozygotes only" + }, + { + "gene": "BTD", + "variant": "chr3:15645186 G>C", + "genotype": "het", + "source": "ClinVar", + "reason": "one heterozygous variant; BTD is reported with P and LP (2 variants)" + }, + { + "gene": "HFE", + "variant": "chr6:26093000 C>T", + "genotype": "hom", + "source": "HIGH impact", + "reason": "HFE is reported only for: HFE p.C282Y homozygotes only" + } + ], + "two_hit_note": null + }, + "frequency_unknown": 1, + "weak_calls": 2 + } + }, + "slivar": { + "title": "Variant prioritization (slivar)", + "step": "31", + "state": "ok", + "source": "slivar/S_slivar_summary.tsv", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "prioritized": 2, + "frequency_unknown": 1, + "compound_het_variants": 4, + "compound_het_genes": 2, + "compound_het_pairs": 26, + "compound_het_phase": { + "trans": 23, + "cis": 1, + "unknown": 1 + }, + "compound_het_trans": [ + { + "gene": "G1", + "variants": "chr1:10 A>G + chr1:15 C>T", + "reads": "1 of 2" + }, + { + "gene": "G2", + "variants": "chr1:20 A>G + chr1:25 C>T", + "reads": "2 of 3" + }, + { + "gene": "G3", + "variants": "chr1:30 A>G + chr1:35 C>T", + "reads": "3 of 4" + }, + { + "gene": "G4", + "variants": "chr1:40 A>G + chr1:45 C>T", + "reads": "4 of 5" + }, + { + "gene": "G5", + "variants": "chr1:50 A>G + chr1:55 C>T", + "reads": "5 of 6" + }, + { + "gene": "G6", + "variants": "chr1:60 A>G + chr1:65 C>T", + "reads": "6 of 7" + }, + { + "gene": "G7", + "variants": "chr1:70 A>G + chr1:75 C>T", + "reads": "7 of 8" + }, + { + "gene": "G8", + "variants": "chr1:80 A>G + chr1:85 C>T", + "reads": "8 of 9" + }, + { + "gene": "G9", + "variants": "chr1:90 A>G + chr1:95 C>T", + "reads": "9 of 10" + }, + { + "gene": "G10", + "variants": "chr1:100 A>G + chr1:105 C>T", + "reads": "10 of 11" + }, + { + "gene": "G11", + "variants": "chr1:110 A>G + chr1:115 C>T", + "reads": "11 of 12" + }, + { + "gene": "G12", + "variants": "chr1:120 A>G + chr1:125 C>T", + "reads": "12 of 13" + }, + { + "gene": "G13", + "variants": "chr1:130 A>G + chr1:135 C>T", + "reads": "13 of 14" + }, + { + "gene": "G14", + "variants": "chr1:140 A>G + chr1:145 C>T", + "reads": "14 of 15" + }, + { + "gene": "G15", + "variants": "chr1:150 A>G + chr1:155 C>T", + "reads": "15 of 16" + }, + { + "gene": "G16", + "variants": "chr1:160 A>G + chr1:165 C>T", + "reads": "16 of 17" + }, + { + "gene": "G17", + "variants": "chr1:170 A>G + chr1:175 C>T", + "reads": "17 of 18" + }, + { + "gene": "G18", + "variants": "chr1:180 A>G + chr1:185 C>T", + "reads": "18 of 19" + }, + { + "gene": "G19", + "variants": "chr1:190 A>G + chr1:195 C>T", + "reads": "19 of 20" + }, + { + "gene": "G20", + "variants": "chr1:200 A>G + chr1:205 C>T", + "reads": "20 of 21" + } + ] + } + } + }, + "cyp2d6": { + "calls": { + "PharmCAT": "*1/*4", + "pypgx": "*1/*2", + "Cyrius": "*2/*1" + }, + "agree": true, + "consensus": { + "result": "*1/*2", + "passed_to_pharmcat": true, + "reason": "pypgx and Cyrius agree", + "source": "pgx_consensus/S_pgx_consensus.tsv" + }, + "probable": null + } +} diff --git a/tests/parity/golden/summary-collect/cb-unicode-contig/cb-unicode-contig.json b/tests/parity/golden/summary-collect/cb-unicode-contig/cb-unicode-contig.json new file mode 100644 index 000000000..86fc5522d --- /dev/null +++ b/tests/parity/golden/summary-collect/cb-unicode-contig/cb-unicode-contig.json @@ -0,0 +1,1111 @@ +{ + "schema_version": 2, + "sample": "S", + "generated_utc": "2026-11-19 23:00 UTC", + "run": { + "status_file": true, + "started_utc": "2020-01-01 00:00 UTC", + "declared_sex": null + }, + "databases": { + "clinvar_release": null, + "cpsr_clinvar_release": null, + "hla_database": null + }, + "manifest": [], + "sections": { + "clinvar": { + "title": "ClinVar screen", + "step": "06", + "state": "ok", + "source": "clinvar/S_clinvar_hits.vcf", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "count": 8, + "by_stars": { + "4": 0, + "3": 2, + "2": 3, + "1": 1, + "0": 2 + }, + "hits": [ + { + "stars": 4, + "chrom": "chr7", + "pos": 117559590, + "ref": "ATCT", + "alt": "A", + "genotype": "het", + "gene": "CFTR", + "significance": "Pathogenic", + "review_status": "practice guideline", + "combined_allele": ".", + "dp": 30, + "gq": 15, + "low_confidence": true, + "gnomad_exome_af": 0.008, + "gnomad_genome_af": 0.007, + "rsids": [ + "rs113993960" + ], + "af": 0.008, + "common": false, + "cdna": { + "check": "not_checked", + "note": "not in the read-check table", + "alt_reads": null, + "alt_clipped": null, + "ref_reads": null, + "ref_clipped": null + } + }, + { + "stars": 3, + "chrom": "chr17", + "pos": 43057100, + "ref": "C", + "alt": "T", + "genotype": "het", + "gene": "BRCA1,NBR2", + "significance": "Pathogenic", + "review_status": "reviewed by expert panel", + "combined_allele": "part of a combined allele: chr17:43057100 C>T, chr17:43057102 A>G; unphased, so the parts may sit on different haplotypes", + "dp": 35, + "gq": 60, + "low_confidence": false, + "gnomad_exome_af": null, + "gnomad_genome_af": null, + "rsids": [], + "af": null, + "common": false, + "cdna": { + "check": "not_checked", + "note": "not in the read-check table", + "alt_reads": null, + "alt_clipped": null, + "ref_reads": null, + "ref_clipped": null + } + }, + { + "stars": 3, + "chrom": "chr6", + "pos": 26092913, + "ref": "G", + "alt": "A", + "genotype": "het", + "gene": "HFE", + "significance": "Pathogenic", + "review_status": "reviewed by expert panel", + "combined_allele": ".", + "dp": 40, + "gq": 99, + "low_confidence": false, + "gnomad_exome_af": 0.06, + "gnomad_genome_af": 0.05, + "rsids": [ + "rs99", + "rs1800562" + ], + "af": 0.06, + "common": true, + "cdna": { + "check": "clean", + "note": "", + "alt_reads": 20, + "alt_clipped": 0, + "ref_reads": 20, + "ref_clipped": 0, + "construct": null + } + }, + { + "stars": 2, + "chrom": "chr1", + "pos": 45331556, + "ref": "C", + "alt": "T", + "genotype": "het", + "gene": "MUTYH", + "significance": "Pathogenic", + "review_status": "criteria provided, multiple submitters, no conflicts", + "combined_allele": ".", + "dp": 30, + "gq": 50, + "low_confidence": false, + "gnomad_exome_af": 0.002, + "gnomad_genome_af": 0.0005, + "rsids": [ + "rs36053993" + ], + "af": 0.002, + "common": false, + "cdna": { + "check": "flagged", + "note": "possible cDNA/transgene contamination: check the reads", + "alt_reads": 12, + "alt_clipped": 6, + "ref_reads": 10, + "ref_clipped": 0, + "construct": "yes" + } + }, + { + "stars": 2, + "chrom": "chr16", + "pos": 176700, + "ref": "G", + "alt": "A", + "genotype": "het", + "gene": "HBA1", + "significance": "Pathogenic", + "review_status": "criteria provided, multiple submitters, no conflicts", + "combined_allele": ".", + "dp": 31, + "gq": 45, + "low_confidence": false, + "gnomad_exome_af": null, + "gnomad_genome_af": null, + "rsids": [], + "af": null, + "common": false, + "cdna": { + "check": "not_checked", + "note": "not in the read-check table", + "alt_reads": null, + "alt_clipped": null, + "ref_reads": null, + "ref_clipped": null + } + }, + { + "stars": 2, + "chrom": "chr5", + "pos": 70951946, + "ref": "C", + "alt": "T", + "genotype": "hom", + "gene": "SMN1", + "significance": "Pathogenic", + "review_status": "criteria provided, multiple submitters, no conflicts", + "combined_allele": ".", + "dp": 31, + "gq": 45, + "low_confidence": false, + "gnomad_exome_af": null, + "gnomad_genome_af": null, + "rsids": [], + "af": null, + "common": false, + "cdna": { + "check": "not_checked", + "note": "not in the read-check table", + "alt_reads": null, + "alt_clipped": null, + "ref_reads": null, + "ref_clipped": null + } + }, + { + "stars": 1, + "chrom": "chr13", + "pos": 20189473, + "ref": "C", + "alt": "T", + "genotype": "one copy, other copy not called ref (1/.)", + "gene": "GJB2", + "significance": "Likely pathogenic", + "review_status": "criteria provided, single submitter", + "combined_allele": "combined allele of chr13:20189473 C>T + chr13:20189475 G>A", + "dp": 5, + "gq": 40, + "low_confidence": true, + "gnomad_exome_af": 0.03, + "gnomad_genome_af": null, + "rsids": [ + "rs80338939" + ], + "af": 0.03, + "common": true, + "cdna": { + "check": "not_checked", + "note": "not in the read-check table", + "alt_reads": null, + "alt_clipped": null, + "ref_reads": null, + "ref_clipped": null + } + }, + { + "stars": 1, + "chrom": "chr3", + "pos": 15645186, + "ref": "G", + "alt": "C", + "genotype": "het", + "gene": "BTD", + "significance": "Pathogenic/Likely pathogenic", + "review_status": "criteria provided, conflicting classifications", + "combined_allele": ".", + "dp": null, + "gq": null, + "low_confidence": false, + "gnomad_exome_af": null, + "gnomad_genome_af": null, + "rsids": [], + "af": null, + "common": false, + "cdna": { + "check": "not_checked", + "note": "not in the read-check table", + "alt_reads": null, + "alt_clipped": null, + "ref_reads": null, + "ref_clipped": null + } + }, + { + "stars": 0, + "chrom": "chr2", + "pos": 100, + "ref": "A", + "alt": "G", + "genotype": "het", + "gene": ".", + "significance": ".", + "review_status": ".", + "combined_allele": ".", + "dp": null, + "gq": null, + "low_confidence": false, + "gnomad_exome_af": null, + "gnomad_genome_af": null, + "rsids": [], + "af": null, + "common": false, + "cdna": { + "check": "not_checked", + "note": "not in the read-check table", + "alt_reads": null, + "alt_clipped": null, + "ref_reads": null, + "ref_clipped": null + } + }, + { + "stars": 0, + "chrom": "chrX", + "pos": 101398000, + "ref": "C", + "alt": "T", + "genotype": "1", + "gene": "GLA", + "significance": "Pathogenic", + "review_status": "no assertion criteria provided", + "combined_allele": "possibly one allele with chrX:101398004 G>A: check ClinVar for a combined record", + "dp": null, + "gq": null, + "low_confidence": false, + "gnomad_exome_af": null, + "gnomad_genome_af": null, + "rsids": [], + "af": null, + "common": false, + "cdna": { + "check": "not_checked", + "note": "not in the read-check table", + "alt_reads": null, + "alt_clipped": null, + "ref_reads": null, + "ref_clipped": null + } + } + ], + "low_confidence": 2, + "call_floor": { + "GQ": 20, + "DP": 8 + }, + "frequency": { + "source": "vep/S_vep.vcf.gz", + "note": null, + "common_af": 0.01 + }, + "cdna_flagged": 1, + "construct_sites": 1, + "cdna_scan": { + "note": "2 genes with spliced reads", + "loci": [ + { + "chrom": "chr1", + "start": 100, + "end": 200, + "junctions": 2, + "reads": 5, + "junction_list": "A:1-2,A:3-4" + } + ] + }, + "deep_intronic": [ + { + "chrom": "chr7", + "pos": 117639961, + "ref": "C", + "alt": "T", + "gene": "CFTR", + "hgvs": "c.3718-2477C>T", + "clinvar_id": "7129", + "call": "no call", + "detail": "" + } + ] + } + }, + "carrier": { + "title": "Carrier list", + "step": "06", + "state": "ok", + "source": "clinvar/S_clinvar_hits.vcf", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "genes_on_list": 3292, + "list": "assets/carrier_genes.tsv", + "carriers": [ + { + "gene": "MUTYH", + "variant": "chr1:45331556 C>T", + "genotype": "het", + "significance": "Pathogenic", + "stars": 2, + "inheritance": "AR", + "condition": "MUTYH-related polyposis" + }, + { + "gene": "HFE", + "variant": "chr6:26092913 G>A", + "genotype": "het", + "significance": "Pathogenic", + "stars": 3, + "inheritance": "AR", + "condition": "Symptomatic form of HFE-related hemochromatosis" + }, + { + "gene": "CFTR", + "variant": "chr7:117559590 ATCT>A", + "genotype": "het", + "significance": "Pathogenic", + "stars": 4, + "inheritance": "AR", + "condition": "Cystic fibrosis" + }, + { + "gene": "GJB2", + "variant": "chr13:20189473 C>T", + "genotype": "one copy, other copy not called ref (1/.)", + "significance": "Likely pathogenic", + "stars": 1, + "inheritance": "AR", + "condition": "Nonsyndromic hearing loss, recessive (DFNB1A)", + "combined_allele": "combined allele of chr13:20189473 C>T + chr13:20189475 G>A" + }, + { + "gene": "BRCA1", + "variant": "chr17:43057100 C>T", + "genotype": "het", + "significance": "Pathogenic", + "stars": 3, + "inheritance": "AR", + "condition": "Fanconi anemia", + "combined_allele": "part of a combined allele: chr17:43057100 C>T, chr17:43057102 A>G; unphased, so the parts may sit on different haplotypes" + }, + { + "gene": "GLA", + "variant": "chrX:101398000 C>T", + "genotype": "hemizygous", + "significance": "Pathogenic", + "stars": 0, + "inheritance": "XL", + "condition": "Fabry disease", + "combined_allele": "possibly one allele with chrX:101398004 G>A: check ClinVar for a combined record" + }, + { + "gene": "HBA1", + "variant": "chr16:176700 G>A", + "genotype": "het", + "significance": "Pathogenic", + "stars": 2, + "inheritance": "AR", + "condition": "Alpha-thalassemia" + }, + { + "gene": "SMN1", + "variant": "chr5:70951946 C>T", + "genotype": "hemizygous", + "significance": "Pathogenic", + "stars": 2, + "inheritance": "AR", + "condition": "Spinal muscular atrophy", + "hemizygous": "called homozygous inside one SMN1 copy (Parascopy, step 35)" + } + ], + "set_aside": [ + { + "gene": "BTD", + "variant": "chr3:15645186 G>C", + "genotype": "het", + "significance": "Pathogenic/Likely pathogenic", + "stars": 1, + "inheritance": "AR", + "condition": "Biotinidase deficiency", + "kind": "hypomorph", + "name": "p.Asp444His (p.Asp424His on NM_001370658.1), partial biotinidase deficiency" + } + ], + "two_hits": { + "genes": [ + { + "gene": "CFTR", + "verdict": "possibly biallelic", + "why": "a heterozygous call inside a called deletion: one of the two calls may be wrong; check the reads", + "deletion": "CFTR_del deletion, 1 of 2 copies (read depth, step 35)", + "variant": "chr7:117559590 ATCT>A", + "genotype": "het", + "allele": null, + "condition": "Cystic fibrosis", + "inheritance": "AR" + }, + { + "gene": "GJB2", + "verdict": "possibly biallelic", + "why": "a heterozygous call inside a called deletion: one of the two calls may be wrong; check the reads", + "deletion": "DEL chr13:20180000-20200000 (AnnotSV class 4, Manta)", + "variant": "chr13:20189473 C>T", + "genotype": "one copy, other copy not called ref (1/.)", + "allele": null, + "condition": "Nonsyndromic hearing loss, recessive (DFNB1A)", + "inheritance": "AR" + }, + { + "gene": "HBA1", + "verdict": "possibly biallelic", + "why": "phase unknown, possibly in trans (no read-backed phase links the two calls)", + "deletion": "3 of 4 alpha-globin genes (read depth, step 35)", + "variant": "chr16:176700 G>A", + "genotype": "het", + "allele": null, + "condition": "Alpha-thalassemia", + "inheritance": "AR" + }, + { + "gene": "MUTYH", + "verdict": "biallelic", + "why": "in trans: read-backed phase puts them on different copies (phase set 45331000)", + "deletion": "DEL chr1:45338000-45340000 (AnnotSV class 5, Manta)", + "variant": "chr1:45331556 C>T", + "genotype": "het", + "allele": null, + "condition": "MUTYH-related polyposis", + "inheritance": "AR" + }, + { + "gene": "SMN1", + "verdict": "biallelic", + "why": "the variant is called homozygous inside the deletion: hemizygous on the copy the deletion leaves if the deletion is real, homozygous if not; both copies carry it either way", + "deletion": "one SMN1 copy (Parascopy, step 35)", + "variant": "chr5:70951946 C>T", + "genotype": "hemizygous", + "allele": null, + "condition": "Spinal muscular atrophy", + "inheritance": "AR" + } + ], + "deletions_read": [ + "AnnotSV class 4 and 5 deletions (step 05)", + "step 35's interval table (read depth)", + "step 35's HBA1/HBA2 count", + "Parascopy's SMN1 count (step 35)" + ], + "deletions_not_read": [] + } + } + }, + "pharmcat": { + "title": "PharmCAT", + "step": "07", + "state": "ok", + "source": "pharmcat/S.report.json", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "version": "3.4.0", + "html_report": true + } + }, + "cpic": { + "title": "CPIC drug-gene recommendations", + "step": "27", + "state": "ok", + "source": "cpic/S_phenotypes.tsv", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "genes": [ + { + "gene": "CYP2D6", + "diplotype": "*1/*4", + "phenotype": "Intermediate Metabolizer", + "status": "non-normal" + }, + { + "gene": "CYP2C19", + "diplotype": "*1/*17", + "phenotype": "Rapid", + "status": "ambiguous" + }, + { + "gene": "CYP2C9", + "diplotype": "*1/*1", + "phenotype": "Normal", + "status": "normal" + }, + { + "gene": "DPYD", + "diplotype": null, + "phenotype": null, + "status": null + } + ], + "non_normal": 1, + "ambiguous": 1, + "not_called": 0, + "unclassified": 0, + "parse_failed": false, + "warnings": [ + "CYP2C19 has two possible phenotypes", + "last" + ] + } + }, + "pypgx": { + "title": "pypgx", + "step": "32", + "state": "ok", + "source": "pypgx/S_pypgx_summary.tsv", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "genes_total": 6, + "genes_called": 3, + "cyp2d6": "*1/*2", + "cnv_call": { + "CYP2D6": "Normal", + "CYP2A6": "not called: pypgx failed", + "CYP2B6": "not called: the CYP2D6 depth check failed", + "SLCO1B1": "not called: pypgx gave no copy-number call" + }, + "not_callable": [ + "CYP2E1" + ], + "low_gq": [ + { + "gene": "UGT1A1", + "diplotype": "Indeterminate", + "min_gq": 12, + "weakest": "chr2:1:A:G" + }, + { + "gene": "SLCO1B1", + "diplotype": "*1/*5", + "min_gq": null, + "weakest": "" + } + ], + "cyp2d6_evidence": { + "phenotype": "Normal Metabolizer", + "defining_filter": "PASS", + "quality": "ok" + }, + "depth_check": { + "status": "ok", + "gene_mapq1_share": "0.99", + "body_mapq20_share": "0.95" + }, + "comparison": { + "conflicts": 1, + "one_tool_only": 2, + "concordant": 1 + } + } + }, + "cyrius": { + "title": "Cyrius (CYP2D6)", + "step": "21", + "state": "ok", + "source": "cyrius/S_cyp2d6.tsv", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "genotype": "*2/*1", + "filter": "PASS" + } + }, + "cpsr": { + "title": "Cancer predisposition (CPSR)", + "step": "17", + "state": "ok", + "source": "cpsr/S.cpsr.grch38.classification.tsv.gz", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "html_report": true, + "classification_column": "CLASSIFICATION", + "classification": { + "Pathogenic": 1, + "Likely_Pathogenic": 1, + "VUS": 1, + "Benign": 1, + ".": 1 + }, + "plp": [ + { + "variant": "17:43057100 C>T", + "gene": "BRCA1", + "final": "Pathogenic", + "cpsr": "Likely_Benign", + "clinvar": "Pathogenic", + "authority": "ClinVar", + "acmg_codes": "PVS1", + "dp": 6, + "low_confidence": true, + "cdna": { + "check": "flagged", + "note": "splice", + "alt_reads": 5, + "alt_clipped": 5, + "ref_reads": 9, + "ref_clipped": 0, + "construct": null + } + }, + { + "variant": "13:32338000 G>A", + "gene": "BRCA2", + "final": "Likely_Pathogenic", + "cpsr": "VUS", + "clinvar": null, + "authority": "CPSR", + "acmg_codes": null, + "dp": 40, + "low_confidence": false, + "cdna": { + "check": "not_checked", + "note": "not in the read-check table", + "alt_reads": null, + "alt_clipped": null, + "ref_reads": null, + "ref_clipped": null + } + }, + { + "variant": "2:47403000 A>G", + "gene": "MSH2", + "final": "VUS", + "cpsr": "LP", + "clinvar": "B", + "authority": null, + "acmg_codes": null, + "dp": null, + "low_confidence": false, + "cdna": { + "check": "not_checked", + "note": "not in the read-check table", + "alt_reads": null, + "alt_clipped": null, + "ref_reads": null, + "ref_clipped": null + } + }, + { + "variant": "5:112839000 A>T", + "gene": "APC", + "final": ".", + "cpsr": "Pathogenic", + "clinvar": null, + "authority": null, + "acmg_codes": null, + "dp": 30, + "low_confidence": false, + "cdna": { + "check": "not_checked", + "note": "not in the read-check table", + "alt_reads": null, + "alt_clipped": null, + "ref_reads": null, + "ref_clipped": null + } + } + ], + "disagreements": [ + { + "variant": "17:43057100 C>T", + "gene": "BRCA1", + "final": "Pathogenic", + "cpsr": "Likely_Benign", + "clinvar": "Pathogenic", + "authority": "ClinVar", + "acmg_codes": "PVS1", + "dp": 6, + "low_confidence": true, + "cdna": { + "check": "flagged", + "note": "splice", + "alt_reads": 5, + "alt_clipped": 5, + "ref_reads": 9, + "ref_clipped": 0, + "construct": null + } + }, + { + "variant": "2:47403000 A>G", + "gene": "MSH2", + "final": "VUS", + "cpsr": "LP", + "clinvar": "B", + "authority": null, + "acmg_codes": null, + "dp": null, + "low_confidence": false, + "cdna": { + "check": "not_checked", + "note": "not in the read-check table", + "alt_reads": null, + "alt_clipped": null, + "ref_reads": null, + "ref_clipped": null + } + } + ], + "final_plp_own_benign": 1, + "own_class_column": "CPSR_CLASSIFICATION", + "low_confidence": 1, + "call_floor_dp": 8, + "cdna_flagged": 1 + } + }, + "clinical": { + "title": "Clinical variant filter", + "step": "23", + "state": "ok", + "source": "clinical/S_clinical_summary.tsv", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "variants": 5, + "by_impact": { + "HIGH": 3, + "MODERATE": 1, + ".": 1 + }, + "genes": 3, + "acmg_sf": { + "version": "ACMG SF v3.3", + "genes_on_list": 84, + "rules": "assets/acmg_sf.tsv", + "clinvar_hits": [ + { + "gene": "MUTYH", + "variant": "chr1:45331556 C>T", + "genotype": "het", + "significance": "Pathogenic", + "stars": 2, + "low_confidence": false, + "rule": "P and LP (2 variants)", + "rule_note": null, + "severity": null, + "two_hit": "biallelic with DEL chr1:45338000-45340000 (AnnotSV class 5, Manta): in trans: read-backed phase puts them on different copies (phase set 45331000)", + "pair": "biallelic", + "phase": "in trans: read-backed phase puts them on different copies (phase set 45331000)" + }, + { + "gene": "BRCA1", + "variant": "chr17:43057100 C>T", + "genotype": "het", + "significance": "Pathogenic", + "stars": 3, + "low_confidence": false, + "combined_allele": "part of a combined allele: chr17:43057100 C>T, chr17:43057102 A>G; unphased, so the parts may sit on different haplotypes", + "rule": "All P and LP", + "rule_note": null, + "severity": null + }, + { + "gene": "GLA", + "variant": "chrX:101398000 C>T", + "genotype": "1", + "significance": "Pathogenic", + "stars": 0, + "low_confidence": false, + "combined_allele": "possibly one allele with chrX:101398004 G>A: check ClinVar for a combined record", + "rule": "All hemi, het, homozygous P and LP", + "rule_note": null, + "severity": null + } + ], + "clinvar_checked": true, + "high_impact": [ + { + "gene": "MUTYH", + "variant": "chr1:45332000 G>A", + "genotype": "het", + "consequence": "stop_gained", + "transcript": "MANE", + "frequency": "rare", + "frequency_unknown": false, + "weak_call": false, + "call_note": null, + "gq": 40, + "dp": 30, + "ad": "15,15", + "rule": "P and LP (2 variants)", + "rule_note": null, + "severity": null, + "pair": "biallelic", + "phase": "in trans: read-backed phase puts them on different copies (phase set 45331000)" + }, + { + "gene": "MYBPC3", + "variant": "chr11:47332000 G>A", + "genotype": "het", + "consequence": "splice_donor_variant,intron_variant", + "transcript": "ANY", + "frequency": "rare", + "frequency_unknown": false, + "weak_call": false, + "call_note": null, + "gq": null, + "dp": null, + "ad": null, + "rule": "All P and LP", + "rule_note": null, + "severity": null + }, + { + "gene": "MSH2", + "variant": "chr2:47414000 A>AT", + "genotype": "het", + "consequence": "frameshift_variant", + "transcript": "CANONICAL", + "frequency": "rare", + "frequency_unknown": false, + "weak_call": true, + "call_note": "alt reads 0.07 of the depth on a heterozygote", + "gq": 50, + "dp": 30, + "ad": "28,2", + "rule": "All P and LP", + "rule_note": "A deletion of the 3' end of EPCAM silences MSH2 and counts as an MSH2 finding.", + "severity": null + } + ], + "high_impact_checked": true, + "high_impact_rare": 2, + "high_impact_weak": 1, + "high_impact_frequency_unknown": 0, + "structural": [ + { + "gene": "MSH2", + "variant": "DEL chr2:47386000-47388000", + "acmg_class": "4", + "caller": "Delly", + "support": 1, + "via": "EPCAM exons 8 and 9, the 3' end (ENST00000263735)", + "rule": "All P and LP", + "rule_note": "A deletion of the 3' end of EPCAM silences MSH2 and counts as an MSH2 finding.", + "severity": null + }, + { + "gene": "BRCA1", + "variant": "DUP chr17:43000000-43100000", + "acmg_class": "4", + "caller": "CNVpytor", + "support": 1, + "via": null, + "rule": "All P and LP", + "rule_note": null, + "severity": null + } + ], + "structural_checked": true, + "structural_note": null, + "not_reported": [ + { + "gene": "HFE", + "variant": "chr6:26092913 G>A", + "genotype": "het", + "source": "ClinVar", + "reason": "HFE is reported only for: HFE p.C282Y homozygotes only" + }, + { + "gene": "BTD", + "variant": "chr3:15645186 G>C", + "genotype": "het", + "source": "ClinVar", + "reason": "one heterozygous variant; BTD is reported with P and LP (2 variants)" + }, + { + "gene": "HFE", + "variant": "chr6:26093000 C>T", + "genotype": "hom", + "source": "HIGH impact", + "reason": "HFE is reported only for: HFE p.C282Y homozygotes only" + } + ], + "two_hit_note": null + }, + "frequency_unknown": 1, + "weak_calls": 2 + } + }, + "slivar": { + "title": "Variant prioritization (slivar)", + "step": "31", + "state": "ok", + "source": "slivar/S_slivar_summary.tsv", + "file_date": "2021-03-04 05:06 UTC", + "note": null, + "data": { + "prioritized": 2, + "frequency_unknown": 1, + "compound_het_variants": 4, + "compound_het_genes": 2, + "compound_het_pairs": 26, + "compound_het_phase": { + "trans": 23, + "cis": 1, + "unknown": 1 + }, + "compound_het_trans": [ + { + "gene": "G1", + "variants": "chr1:10 A>G + chr1:15 C>T", + "reads": "1 of 2" + }, + { + "gene": "G2", + "variants": "chr1:20 A>G + chr1:25 C>T", + "reads": "2 of 3" + }, + { + "gene": "G3", + "variants": "chr1:30 A>G + chr1:35 C>T", + "reads": "3 of 4" + }, + { + "gene": "G4", + "variants": "chr1:40 A>G + chr1:45 C>T", + "reads": "4 of 5" + }, + { + "gene": "G5", + "variants": "chr1:50 A>G + chr1:55 C>T", + "reads": "5 of 6" + }, + { + "gene": "G6", + "variants": "chr1:60 A>G + chr1:65 C>T", + "reads": "6 of 7" + }, + { + "gene": "G7", + "variants": "chr1:70 A>G + chr1:75 C>T", + "reads": "7 of 8" + }, + { + "gene": "G8", + "variants": "chr1:80 A>G + chr1:85 C>T", + "reads": "8 of 9" + }, + { + "gene": "G9", + "variants": "chr1:90 A>G + chr1:95 C>T", + "reads": "9 of 10" + }, + { + "gene": "G10", + "variants": "chr1:100 A>G + chr1:105 C>T", + "reads": "10 of 11" + }, + { + "gene": "G11", + "variants": "chr1:110 A>G + chr1:115 C>T", + "reads": "11 of 12" + }, + { + "gene": "G12", + "variants": "chr1:120 A>G + chr1:125 C>T", + "reads": "12 of 13" + }, + { + "gene": "G13", + "variants": "chr1:130 A>G + chr1:135 C>T", + "reads": "13 of 14" + }, + { + "gene": "G14", + "variants": "chr1:140 A>G + chr1:145 C>T", + "reads": "14 of 15" + }, + { + "gene": "G15", + "variants": "chr1:150 A>G + chr1:155 C>T", + "reads": "15 of 16" + }, + { + "gene": "G16", + "variants": "chr1:160 A>G + chr1:165 C>T", + "reads": "16 of 17" + }, + { + "gene": "G17", + "variants": "chr1:170 A>G + chr1:175 C>T", + "reads": "17 of 18" + }, + { + "gene": "G18", + "variants": "chr1:180 A>G + chr1:185 C>T", + "reads": "18 of 19" + }, + { + "gene": "G19", + "variants": "chr1:190 A>G + chr1:195 C>T", + "reads": "19 of 20" + }, + { + "gene": "G20", + "variants": "chr1:200 A>G + chr1:205 C>T", + "reads": "20 of 21" + } + ] + } + } + }, + "cyp2d6": { + "calls": { + "PharmCAT": "*1/*4", + "pypgx": "*1/*2", + "Cyrius": "*2/*1" + }, + "agree": true, + "consensus": { + "result": "*1/*2", + "passed_to_pharmcat": true, + "reason": "pypgx and Cyrius agree", + "source": "pgx_consensus/S_pgx_consensus.tsv" + }, + "probable": null + } +} diff --git a/tests/parity/oracle.ref b/tests/parity/oracle.ref index a53cf25c9..40becd735 100644 --- a/tests/parity/oracle.ref +++ b/tests/parity/oracle.ref @@ -98,5 +98,6 @@ roh-summary 7c1470bc50933f48a1a0dde3c0e0b2b87bc48718 file:scripts/11-roh-analysi couple-screen d4d3d4b629fc77a058bbbbd302c75bbfae1a01c2 file:bin/couple_report.py sh -c 'exec sh ./oracle.sh "$0" screen "$@"' couple screen couple-genes d4d3d4b629fc77a058bbbbd302c75bbfae1a01c2 file:bin/couple_report.py sh -c 'exec sh ./oracle.sh "$0" genes "$@"' couple genes report-render 65095e975bea01c74ed92a4f1b8c1bd00d05caaa file:bin/render_report.py sh ./oracle.sh report render +report-charts 65095e975bea01c74ed92a4f1b8c1bd00d05caaa file:bin/render_report.py sh ./oracle.sh report charts archaic-compare 65095e975bea01c74ed92a4f1b8c1bd00d05caaa file:bin/archaic_compare.py sh -c 'exec python3 "$0" compare "$@"' archaic compare archaic-genomes 65095e975bea01c74ed92a4f1b8c1bd00d05caaa file:bin/archaic_compare.py sh -c 'exec python3 "$0" genomes "$@"' archaic genomes diff --git a/tests/schema/summary.schema.json b/tests/schema/summary.schema.json index d08df0c14..db8383557 100644 --- a/tests/schema/summary.schema.json +++ b/tests/schema/summary.schema.json @@ -1348,6 +1348,66 @@ } ] }, + "acmg_sf": { + "allOf": [ + { + "$ref": "#/definitions/section" + }, + { + "properties": { + "data": { + "type": "object", + "properties": { + "version": { + "type": "string" + }, + "unavailable": { + "type": "string" + }, + "clinvar_hits": { + "type": "array", + "items": { + "type": "object", + "required": [ + "gene", + "variant", + "genotype" + ] + } + }, + "clinvar_checked": { + "type": "boolean" + }, + "high_impact": { + "type": "array" + }, + "high_impact_checked": { + "type": "boolean" + }, + "high_impact_note": { + "type": "string" + }, + "structural": { + "type": "array" + }, + "not_reported": { + "type": "array", + "items": { + "type": "object", + "required": [ + "gene", + "variant", + "source", + "reason" + ] + } + } + } + } + } + } + ] + }, "cpsr": { "allOf": [ { diff --git a/tests/smoke/README.md b/tests/smoke/README.md index 07610905d..58d050346 100644 --- a/tests/smoke/README.md +++ b/tests/smoke/README.md @@ -54,6 +54,7 @@ at the planted deletion), `vcf_field`, `tsv_cell`, `tsv_count`, `csv_cell`, | longreads, longbam | Synthetic HiFi reads from both truth haplotypes, and their alignment. | | fullref | The whole fixture reference, `ref.fa`. | | slice | The fixture's GIAB BAM, `HG002_slice.bam`, with a read group for sample HG002 added. | +| telobam | `telo.bam`: `slice` plus 1,100 unmapped telomeric reads (`PLANTED=0` plants none), and `cytoBand.hg38.txt`, the repository's GRCh38 bands. | | vcf, vcf50 | The fixture's VEP-annotated VCF, and its first 50 records without CSQ. | | pgxvcf | Every site of chr10:94.7-95.0 Mb (CYP2C19, CYP2C9) called from `slice` with bcftools, reference sites included: PharmCAT counts a missing position as missing, not as reference. | | revel, sv, cyrius | Fixture files: synthetic REVEL scores, the ten-record SV VCF, the Cyrius BAM. | diff --git a/tests/smoke/commands.tsv b/tests/smoke/commands.tsv index 685c453a7..59ecdbc75 100644 --- a/tests/smoke/commands.tsv +++ b/tests/smoke/commands.tsv @@ -36,7 +36,7 @@ VEP_IMAGE net vcf50 sh /smoke/vep-clinvar-custom.sh contains "ClinVar_CLNSIG in PCGR_IMAGE net vcf50 sh /smoke/pcgr.sh has "cpsr --version names the release line of the image tag (2.3.2 says cpsr 2.3.0)" "$(cat cpsr_version.txt)" "cpsr $(echo "${PCGR_IMAGE##*:}" | cut -d. -f1-2)"; same "records the bundled VEP annotates" "$(grep -v "^#" vep.vcf | grep -c "CSQ=")" 50; has "the pcgrr R package is the release of the image tag" "$(cat pcgrr_version.txt)" "^${PCGR_IMAGE##*:}"; same "flags of step 17 that cpsr --help does not list" "$(grep -c . cpsr_missing_flags.txt)" 0 PHARMCAT_IMAGE - fullref,pgxvcf python3 /pharmcat/pharmcat_vcf_preprocessor -vcf /in/pgx.vcf.gz -refFna /in/ref.fa -o /out/ -bf HG002 && java -jar /pharmcat/pharmcat.jar -vcf /out/HG002.preprocessed.vcf.bgz -o /out/ -bf HG002 -reporterJson -reporterHtml check_pharmcat "genes with a named diplotype in report.json" HG002.report.json PYPGX_IMAGE also=PYPGX_BUNDLE_VERSION fullref,slice,bundle sh /smoke/pypgx.sh has "CYP2D6 genotype" "$(cat CYP2D6.genotype.txt)" "^\*[0-9]" -TELOMEREHUNTER_IMAGE - slice sh /smoke/telomerehunter.sh same "intratelomeric reads (1,100 planted)" "$(tsv_cell th/HG002/HG002_summary.tsv intratel_reads)" 1100; between "tel_content of the planted reads (5347.26 with 1.1.0 on fixture-v7; 5594.23 before its chrY stretches)" "$(tsv_cell th/HG002/HG002_summary.tsv tel_content)" 5347 5348; between "TCAGGG per intratelomeric read (100 of 1,100)" "$(tsv_cell th/HG002/HG002_summary.tsv TCAGGG_arbitrary_context_norm_by_intratel_reads)" 0.09 0.092 +TELOMEREHUNTER_IMAGE - telobam sh /smoke/telomerehunter.sh same "intratelomeric reads (1,100 planted)" "$(tsv_cell th/HG002/HG002_summary.tsv intratelomeric_reads)" 1100; between "tel_content of the planted reads (5347.26 with TelomereHunter 1.1.0 and 2 1.0.12 on fixture-v8)" "$(tsv_cell th/HG002/HG002_summary.tsv tel_content)" 5347 5348; between "TCAGGG per intratelomeric read (100 of 1,100)" "$(tsv_cell th/HG002/HG002_summary.tsv TCAGGG_arbitrary_context_norm_by_intratel_reads)" 0.09 0.092 HAPLOGREP3_IMAGE - mito sh /smoke/haplogrep3.sh has "haplogroup" "$(tsv_cell haplogroup.txt Haplogroup)" "^[A-Z]"; at_least "haplogroup quality" "$(tsv_cell haplogroup.txt Quality)" 0.8 HAPLOCHECK_IMAGE - mito haplocheck --out /out/haplocheck.txt /in/mito.vcf.gz && cat /out/haplocheck.txt has "contamination status" "$(tsv_cell haplocheck.txt 'Contamination Status')" '^(YES|NO|ND)$'; at_least "mean read depth at the chrM variants haplocheck read" "$(tsv_cell haplocheck.txt 'Sample Coverage')" 50 EKLIPSE_IMAGE - - mkdir -p tmp && EK=$(command -v eKLIPse.py) && python3 "$EK" -out /out -tmp /out/tmp --test > eklipse.log 2>&1; tail -n 30 eklipse.log; find /out -name eKLIPse_deletions.csv > csv.txt nonempty "eKLIPse wrote its deletions table" "$(head -n 1 csv.txt | sed "s|^/out/||")"; at_least "deletions eKLIPse finds in its own test BAMs" "$(awk "NR > 1" "$(head -n 1 csv.txt | sed "s|^/out/||")" | wc -l)" 1; contains "the table has eKLIPse's header" "$(head -n 1 csv.txt | sed "s|^/out/||")" "^\"Title\";\"5' breakpoint\"" diff --git a/tests/smoke/telomerehunter.sh b/tests/smoke/telomerehunter.sh index eb34f43ed..52a8902d1 100644 --- a/tests/smoke/telomerehunter.sh +++ b/tests/smoke/telomerehunter.sh @@ -1,24 +1,11 @@ # shellcheck shell=sh -# TELOMEREHUNTER_IMAGE row. The fixture BAM has no telomeric read, so its -# tel_content is 0 whatever the tool does. This plants 1,100 unmapped -# telomeric reads of 150 bp (600 TTAGGG, 400 CCCTAA, 100 TTAGGG with one -# TCAGGG in the middle) with the image's own samtools, then runs TelomereHunter -# as step 10 does (--plotNone). PLANTED=0 plants none, the control that shows -# the tel_content check fails without them. +# TELOMEREHUNTER_IMAGE row: TelomereHunter2 on telo.bam (the slice plus 1,100 +# planted telomeric reads, input telobam) with the GRCh38 bands, as step 10 +# runs it. TelomereHunter2 writes one BAM per contig and merges them at once: +# the slice's 2,580 contigs need more than the default 1,024 open files, so +# the soft limit goes up to the hard one, as the Nextflow module does. set -e -n=${PLANTED:-1} -awk -v n="$n" 'BEGIN { - q = ""; for (i = 0; i < 150; i++) q = q "I" - if (!n) exit - for (i = 1; i <= 1100; i++) { - if (i <= 600) { s = ""; for (k = 0; k < 25; k++) s = s "TTAGGG" } - else if (i <= 1000) { s = ""; for (k = 0; k < 25; k++) s = s "CCCTAA" } - else { s = ""; for (k = 0; k < 12; k++) s = s "TTAGGG"; s = s "TCAGGG"; for (k = 0; k < 12; k++) s = s "TTAGGG" } - printf "telo%d\t4\t*\t0\t0\t*\t*\t0\t0\t%s\t%s\tRG:Z:HG002\n", i, s, q - } -}' > planted.sam -samtools view -h /in/HG002_slice.bam | cat - planted.sam | samtools view -b -o telo.bam - -samtools index telo.bam -echo "telo.bam: $(samtools view -c telo.bam) reads, $(samtools view -c -f 4 telo.bam) unmapped" -telomerehunter -ibt telo.bam -o th -p HG002 --plotNone +# shellcheck disable=SC3045 # the image's sh is bash, which has ulimit -n and -H +ulimit -n "$(ulimit -Hn)" +telomerehunter2 -ibt /in/telo.bam -o th -p HG002 -c 4 --plotNone -b /in/cytoBand.hg38.txt cat th/HG002/HG002_summary.tsv diff --git a/tests/test_live_demo.py b/tests/test_live_demo.py index 07d4292d1..e241c9d54 100644 --- a/tests/test_live_demo.py +++ b/tests/test_live_demo.py @@ -2987,6 +2987,17 @@ def bare_core(source): SEARCH_CLOSED = 'Results this page keeps closed are left out of the search until they are opened.' +# The gate transparency check compares two renders' DOM as text. A browser keeps an element's attributes in the order +# they were set, and the page's scripts set the data-pgp-* attributes as their files arrive, in any order. So +# each element of the clone gets its attributes back sorted by name before it is serialized: the order no longer +# counts, while a changed value, an added or a missing attribute still makes the two texts differ. +SORT_ATTRS = """[clone].concat(Array.from(clone.querySelectorAll('*'))).forEach(function (n) { + var as=Array.from(n.attributes).sort(function (a, z) { return a.name < z.name ? -1 : a.name > z.name ? 1 : 0; }); + as.forEach(function (a) { n.removeAttributeNode(a); }); + as.forEach(function (a) { n.setAttributeNodeNS(a); }); + });""" + + def type_search(b, term): """Type TERM in the header search once its index has loaded; the text of what it shows.""" assert b.wait("document.querySelector('input[type=search]') && !document.querySelector('input[type=search]').disabled"), 'search never loaded' @@ -3029,6 +3040,7 @@ def capture(route, apoe=False, timeout=20, search=None, family=True): clone.querySelectorAll('[data-pgp-map-paint-ms],[data-pgp-map-parse-ms]').forEach(function (n) { n.removeAttribute('data-pgp-map-paint-ms'); n.removeAttribute('data-pgp-map-parse-ms'); }); + """ + SORT_ATTRS + """ return [clone.outerHTML, location.hash, Array.from(document.querySelectorAll('canvas')).map(function(c){return c.toDataURL();}), performance.getEntriesByType('resource').map(function (r) { return new URL(r.name).pathname; }), window.ogRequests || []]; }())""") diff --git a/tests/test_owngenome_view.sh b/tests/test_owngenome_view.sh new file mode 100644 index 000000000..6612a1263 --- /dev/null +++ b/tests/test_owngenome_view.sh @@ -0,0 +1,149 @@ +#!/usr/bin/env bash +# og-leg: OG_REQUIRED +# scripts/owngenome-view.sh, the launcher of the local genome viewer, with +# the og on this machine (OG, else bin/og). The server itself (og view +# serve) is tested in rust/crates/og-live/tests/port_viewer.rs; this checks +# what the script adds, on a 3 kb reference with no reads. +# +# Checks: +# 1. it downloads the igv.js versions.env pins into GENOME_DIR/tools with +# its sha256, and sets no pin of its own; +# 2. it starts og view serve and prints the address with the locus; +# 3. it picks Manta's diploid SVs before step 22's consensus; +# 4. the server answers on 127.0.0.1, and refuses a foreign Host and a +# request a proxy forwarded (403); +# 5. it logs each request on stderr and closes each connection; +# 6. a reversed locus stops it with exit 2 before it serves; +# 7. it needs no python3: every run has a python3 that fails first on PATH. +# Needs curl and the network once (igv.js). Without og the test is skipped +# with a note; with OG_REQUIRED set, the skip is a failure. +set -euo pipefail + +REPO=$(cd "$(dirname "$0")/.." && pwd) +OG=${OG:-${REPO}/bin/og} +WORK=$(mktemp -d) +SERVER="" +cleanup() { + [ -z "$SERVER" ] || kill "$SERVER" 2> /dev/null || true + rm -rf "$WORK" +} +trap cleanup EXIT + +FAILS=0 +fail() { echo "FAIL: $*"; FAILS=$((FAILS + 1)); } +pass() { echo "ok: $*"; } + +if ! "$OG" version > /dev/null 2>&1; then + if [ -n "${OG_REQUIRED:-}" ]; then echo "FAIL: og is not built (scripts/setup.sh --og)"; exit 1; fi + echo "skip: og is not built for this machine, and the viewer runs it (scripts/setup.sh --og)" + exit 0 +fi +export OG + +# A 3 kb chr1, its .fai, and sample S with both SV VCFs and no reads. +G="${WORK}/genome" +mkdir -p "${G}/reference" "${G}/S/manta/results/variants" "${G}/S/sv_merged" +bases=$(head -c 3000 < /dev/zero | tr '\0' 'A') +{ echo ">chr1"; fold -w 60 <<< "$bases"; } > "${G}/reference/synthetic.fasta" +printf 'chr1\t3000\t6\t60\t61\n' > "${G}/reference/synthetic.fasta.fai" +: > "${G}/S/manta/results/variants/diploidSV.vcf.gz" +: > "${G}/S/sv_merged/S_sv_consensus.vcf.gz" +PORT=$((20000 + RANDOM % 20000)) + +# A python3 that fails, first on PATH: the viewer must not need one. +NOPY="${WORK}/nopy" +mkdir -p "$NOPY" +printf '#!/bin/sh\necho "python3 was called: $*" >&2\nexit 127\n' > "${NOPY}/python3" +chmod 755 "${NOPY}/python3" + +view() { + GENOME_DIR="$G" REF_FASTA="${G}/reference/synthetic.fasta" OWNGENOME_VIEW_PORT="$PORT" READS=none \ + PATH="${NOPY}:${PATH}" bash "${REPO}/scripts/owngenome-view.sh" "$@" +} + +# --- 1-2. start it ------------------------------------------------------------------------ +view S chr1:451 > "${WORK}/server.log" 2>&1 & +SERVER=$! +up="" +for _ in $(seq 1 240); do + kill -0 "$SERVER" 2> /dev/null || break + if grep -qF "Viewer for S: http://127.0.0.1:${PORT}/#chr1:451" "${WORK}/server.log"; then up=1; break; fi + sleep 0.5 +done +if [ -n "$up" ]; then pass "owngenome-view.sh starts og view serve and prints the address"; else + fail "the viewer did not start: $(cat "${WORK}/server.log")" + exit 1 +fi + +# shellcheck source=../versions.env +. "${REPO}/versions.env" +igv="${G}/tools/igv.js-${IGV_JS_VERSION}/igv.min.js" +sum=$( (sha256sum "$igv" 2> /dev/null || shasum -a 256 "$igv") | cut -d' ' -f1) +if [ "$sum" = "$IGV_JS_SHA256" ]; then pass "igv.js ${IGV_JS_VERSION} is downloaded with the pinned sha256"; else + fail "igv.js has sha256 '${sum}', versions.env pins ${IGV_JS_SHA256}" +fi +if grep -Eq '^[[:space:]]*IGV_JS_(VERSION|SHA256)=' "${REPO}/scripts/owngenome-view.sh"; then + fail "owngenome-view.sh sets an igv.js pin of its own" +else pass "owngenome-view.sh sets no igv.js pin of its own"; fi + +# --- 3. the SV track ---------------------------------------------------------------------- +if grep -q 'SV VCF: .*manta/results/variants/diploidSV.vcf.gz' "${WORK}/server.log"; then + pass "Manta's diploid SVs are picked before step 22's consensus" +else fail "the SV VCF is not Manta's: $(grep 'SV VCF' "${WORK}/server.log")"; fi + +# --- 4. what it answers ------------------------------------------------------------------- +base="http://127.0.0.1:${PORT}" +code() { curl -s -o /dev/null -w '%{http_code}' "$@"; } +cfg=$(curl -s "${base}/config.json") +if grep -q '"url": "data/2/diploidSV.vcf.gz"' <<< "$cfg"; then pass "the config names Manta's SV VCF"; else + fail "the config: ${cfg}" +fi +# status DESC WANT CURL-ARGS...: the request answers WANT. +status() { + local desc=$1 want=$2 got + shift 2 + got=$(code "$@") + if [ "$got" = "$want" ]; then pass "${desc} (${got})"; else fail "${desc}: got ${got}, want ${want}"; fi +} +status "the page is served" 200 "${base}/" +status "a foreign Host is refused" 403 -H 'Host: attacker.example' "${base}/config.json" +status "a forwarded request is refused" 403 -H 'X-Forwarded-For: 203.0.113.9' "${base}/config.json" + +# --- 4b. it logs each request and closes each connection ---------------------------------- +# A handler that blocks on the log keeps its socket open: the client still +# gets the answer (Content-Length), but the server runs out of descriptors. +logged="" +for _ in $(seq 1 20); do + if grep -qF '"GET /config.json HTTP/1.1" 200 -' "${WORK}/server.log"; then logged=1; break; fi + sleep 0.5 +done +if [ -n "$logged" ]; then pass "each request is logged on stderr"; else + fail "no request was logged: $(cat "${WORK}/server.log")" +fi +closed="" +if exec 3<> "/dev/tcp/127.0.0.1/${PORT}"; then + printf 'GET /config.json HTTP/1.1\r\nHost: 127.0.0.1:%s\r\n\r\n' "$PORT" >&3 + # Read to the end of the stream, at most 10 s. A timeout ends the loop too + # (and with status 1 when a partial line was read, on some bash), so the + # time it took is what tells the two apart. + start=$SECONDS + while IFS= read -r -t 10 _ <&3; do :; done + [ $((SECONDS - start)) -lt 9 ] && closed=1 + exec 3<&- +fi +if [ -n "$closed" ]; then pass "the server closes the connection after the answer"; else + fail "the connection was still open 10 s after the answer" +fi +kill "$SERVER" 2> /dev/null || true +wait "$SERVER" 2> /dev/null || true +SERVER="" + +# --- 5. a reversed locus ------------------------------------------------------------------ +rc=0 +out=$(view S chr1:2000-1000 2>&1) || rc=$? +if [ "$rc" -eq 2 ] && grep -q "ends before it starts" <<< "$out"; then pass "a reversed locus stops it (exit 2)"; else + fail "a reversed locus: exit ${rc}: ${out}" +fi + +echo +if [ "$FAILS" -eq 0 ]; then echo "RESULT: ALL PASS"; else echo "RESULT: ${FAILS} FAILED"; exit 1; fi diff --git a/tests/test_report_charts.py b/tests/test_report_charts.py index 23dc05b2d..dcb1fea5c 100755 --- a/tests/test_report_charts.py +++ b/tests/test_report_charts.py @@ -1,37 +1,19 @@ #!/usr/bin/env python3 -"""The report's charts (bin/report_charts.py) and where bin/render_report.py -puts them, on the invented sections of tests/fixtures/report_charts/ and on -DEMO-001, the invented demo sample. +"""The report's charts in the HTML report and on the live page, on the invented +sections of tests/fixtures/report_charts/ and on DEMO-001, the invented demo +sample. + +The cargo tests in rust/crates/og-render/tests/charts.rs check og report +charts and hold it to the output of bin/report_charts.py frozen at 65095e97. +What stays here checks what bin/render_report.py still ships: -Checks, each with a red control that feeds it a broken input: - 1. ClinVar: one bar per star 4 to 0 with the by_stars count, and one grey - bar with the low-confidence count; no green in the chart; with no hit a - grey frame says that no hit is not an all-clear; - 2. PRS: no strip without a panel (adjusted false), only the report's note; - with a panel a score with no percentile, or one of the other sex, says - "no percentile" and gets no dot; - 3. fine-grained ancestry: the groups are render_report.ancestry_fine_rows, - and each dot lies inside its range line; - 4. genome: a run of homozygosity whose region cannot be read stops the - chart; a run under 5 MB is not drawn; ClinVar hits on chrM and on alt - contigs are counted in not_drawn; ROH_MIN_MB is collect_summary's; - each AnnotSV class 4 or 5 row is an outlined span and each reported MoChA - call a bar under its chromosome, linked to their sections, and one on - another contig is counted in not_drawn; every mark is drawn inside its - chromosome's outline (a span past its end is cut there, a mark that - starts past it is counted in not_drawn); - 5. mito: one dot per heteroplasmic site, the poly-C call marked apart; - 6. no caveat sentence is written in report_charts.py: they come from - render_report's *_NOTE constants; 7. the HTML report: no