From 3073c74b11e6f5197b05b73fe616a80d06c17f67 Mon Sep 17 00:00:00 2001 From: GeiserX <9169332+GeiserX@users.noreply.github.com> Date: Fri, 20 Nov 2026 00:04:41 +0100 Subject: [PATCH 01/50] fix(acmg): count the copies of a recessive gene hit, not the alt copies of its records Two variants phased on one copy, a combined allele counted with its own parts, or a record with no alt copy called could complete the two hits a recessive ACMG SF gene needs. The tier now counts haplotypes: a phased heterozygote needs a "|" GT, a non-empty PS and every copy called; a half call or a "|" GT without PS is phase unknown. Each finding of a two-hit gene gets pair (biallelic or possibly biallelic) and phase fields, and a ClinVar finding that is a combined allele keeps its combined_allele note. Bead: clin-01 Bead: clin-02 Bead: clin-03 Bead: clin-04 Bead: clin-06 Bead: clin-29 --- rust/crates/og-summary/src/collect/acmg.rs | 338 +++++++++++++-- .../tests/i411_sf_haplotype_count.rs | 384 ++++++++++++++++++ 2 files changed, 692 insertions(+), 30 deletions(-) create mode 100644 rust/crates/og-summary/tests/i411_sf_haplotype_count.rs 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/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")); +} From 0d3893b03a5e46686664e3042ce87f492f3ff4e0 Mon Sep 17 00:00:00 2001 From: GeiserX <9169332+GeiserX@users.noreply.github.com> Date: Fri, 20 Nov 2026 00:04:41 +0100 Subject: [PATCH 02/50] fix(two-hits): a homozygous hypomorph inside a deletion is only possibly biallelic Nothing says whether the deletion is real. A full loss of function called homozygous hits both copies either way, so it stays biallelic with a reason that says so; a hypomorph is biallelic only with a real deletion. Bead: clin-32 --- .../crates/og-summary/src/collect/two_hits.rs | 38 +++++++++++++++++-- 1 file changed, 35 insertions(+), 3 deletions(-) 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")); From 286b476351b876046b10bbc9a20e4b25352d7cbd Mon Sep 17 00:00:00 2001 From: GeiserX <9169332+GeiserX@users.noreply.github.com> Date: Fri, 20 Nov 2026 00:04:41 +0100 Subject: [PATCH 03/50] fix(carrier): keep the combined-allele note, and pair no record without an alt copy Bead: clin-29 Bead: clin-04 --- rust/crates/og-summary/src/collect/carrier.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) 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(), From 3c9d5656f72b43243f53b869940b4067a0ba3fab Mon Sep 17 00:00:00 2001 From: GeiserX <9169332+GeiserX@users.noreply.github.com> Date: Fri, 20 Nov 2026 00:04:41 +0100 Subject: [PATCH 04/50] docs(acmg): state the haplotype rule in the four places it lives, and record the goldens The summary-collect goldens change only by the new pair, phase and combined_allele fields and the two-hit reason wording. Bead: clin-01 Bead: D14 --- CHANGELOG.md | 5 + assets/acmg_sf.tsv | 24 +- docs/23-clinical-filter.md | 2 +- docs/results/secondary-findings.md | 6 +- .../all-history/all-history.json | 21 +- .../golden/summary-collect/all-nf/all-nf.json | 19 +- .../golden/summary-collect/all/all.json | 21 +- .../summary-collect/cb-full/cb-full.json | 1111 +++++++++++++++++ .../golden/summary-collect/cb-nf/cb-nf.json | 771 ++++++++++++ .../summary-collect/cb-nfbad/cb-nfbad.json | 433 +++++++ .../summary-collect/cb-notbi/cb-notbi.json | 434 +++++++ .../cb-quoted-dosage/cb-quoted-dosage.json | 1111 +++++++++++++++++ .../cb-quoted-interval.json | 1111 +++++++++++++++++ .../cb-quoted-smn/cb-quoted-smn.json | 1111 +++++++++++++++++ .../cb-unicode-contig/cb-unicode-contig.json | 1111 +++++++++++++++++ 15 files changed, 7262 insertions(+), 29 deletions(-) create mode 100644 tests/parity/golden/summary-collect/cb-full/cb-full.json create mode 100644 tests/parity/golden/summary-collect/cb-nf/cb-nf.json create mode 100644 tests/parity/golden/summary-collect/cb-nfbad/cb-nfbad.json create mode 100644 tests/parity/golden/summary-collect/cb-notbi/cb-notbi.json create mode 100644 tests/parity/golden/summary-collect/cb-quoted-dosage/cb-quoted-dosage.json create mode 100644 tests/parity/golden/summary-collect/cb-quoted-interval/cb-quoted-interval.json create mode 100644 tests/parity/golden/summary-collect/cb-quoted-smn/cb-quoted-smn.json create mode 100644 tests/parity/golden/summary-collect/cb-unicode-contig/cb-unicode-contig.json diff --git a/CHANGELOG.md b/CHANGELOG.md index ed5d083b5..0a6be7ea1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ Each release's notes. From 1.0.0 on, a major or minor release has hand-written n ## Unreleased +- 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. - 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`. 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/docs/23-clinical-filter.md b/docs/23-clinical-filter.md index 28388bf82..3139c0f79 100644 --- a/docs/23-clinical-filter.md +++ b/docs/23-clinical-filter.md @@ -88,7 +88,7 @@ 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. 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/results/secondary-findings.md b/docs/results/secondary-findings.md index 5afe3222e..544020d8e 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`: - 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,7 +25,7 @@ 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. 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 e6d8efc33..62364b8b1 100644 --- a/tests/parity/golden/summary-collect/all-history/all-history.json +++ b/tests/parity/golden/summary-collect/all-history/all-history.json @@ -12716,7 +12716,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", @@ -12725,7 +12726,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", @@ -12734,7 +12736,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", @@ -12774,7 +12777,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", @@ -15257,7 +15260,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", @@ -15266,6 +15271,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 @@ -15277,6 +15283,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 @@ -15299,7 +15306,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-nf/all-nf.json b/tests/parity/golden/summary-collect/all-nf/all-nf.json index e61cb5810..ecde747fd 100644 --- a/tests/parity/golden/summary-collect/all-nf/all-nf.json +++ b/tests/parity/golden/summary-collect/all-nf/all-nf.json @@ -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", @@ -13773,7 +13776,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", @@ -13782,6 +13787,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 @@ -13793,6 +13799,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 @@ -13815,7 +13822,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 fabbf7ce7..e942bfe27 100644 --- a/tests/parity/golden/summary-collect/all/all.json +++ b/tests/parity/golden/summary-collect/all/all.json @@ -12721,7 +12721,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", @@ -12730,7 +12731,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", @@ -12739,7 +12741,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", @@ -12779,7 +12782,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", @@ -15262,7 +15265,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", @@ -15271,6 +15276,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 @@ -15282,6 +15288,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 @@ -15304,7 +15311,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 + } +} From 1100d0bab77f33c7de4e7cefb4482a4cb47da7d1 Mon Sep 17 00:00:00 2001 From: GeiserX <9169332+GeiserX@users.noreply.github.com> Date: Fri, 20 Nov 2026 00:24:32 +0100 Subject: [PATCH 05/50] fix(bloodtype): mark calls under GQ 20 or DP 8 as weak and keep their phase A present genotype was used whatever its quality. The reader now marks a call with GQ under 20 or DP (else MIN_DP) under 8 as weak, keeping its genotype, and keeps the haplotype of the marker's ALT and the phase set of a phased call, for the rules to use. Bead: trait-31 Bead: D10 --- rust/crates/og-bloodtype/src/genotypes.rs | 184 +++++++++++++++++++++- 1 file changed, 181 insertions(+), 3 deletions(-) diff --git a/rust/crates/og-bloodtype/src/genotypes.rs b/rust/crates/og-bloodtype/src/genotypes.rs index f2506464b..d3c4809ef 100644 --- a/rust/crates/og-bloodtype/src/genotypes.rs +++ b/rust/crates/og-bloodtype/src/genotypes.rs @@ -27,6 +27,12 @@ //! - 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. +//! +//! 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 +40,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 +78,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 +96,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 +110,8 @@ impl Site { n: None, depth: None, note: String::new(), + weak: String::new(), + phase: None, } } } @@ -178,6 +203,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,10 +216,68 @@ 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(", ") + } +} + /// Everything the records said about one site so far. #[derive(Debug, Default)] struct Evidence { @@ -205,10 +291,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 +346,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()) @@ -318,10 +422,11 @@ fn apply_record( .copied() .unwrap_or("."); let alleles: Vec<&str> = gt.split(['/', '|']).collect(); + let quality = Quality::of(&fmt, &smp, gt); for (&at, names) in hits { 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 +473,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 +539,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 +553,8 @@ fn read_record( n: Some(n), note, alts: called_alts, + weak: quality.weak(), + phase, }) } @@ -658,7 +770,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 +905,72 @@ 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 depth_decides_a_site_with_no_record() { let mut g: Genotyped = IndexMap::new(); From 017ef8756f6215428709e7337358a9ce3c61fc27 Mon Sep 17 00:00:00 2001 From: GeiserX <9169332+GeiserX@users.noreply.github.com> Date: Fri, 20 Nov 2026 00:24:32 +0100 Subject: [PATCH 06/50] fix(bloodtype): lower confidence for weak calls and stop reading a missing chr9 as type O A weak call gives its system confidence low and is named in the note. Without a BAM, a system with no VCF record at any of its sites reads not assessed instead of the reference phenotype at confidence medium. Duffy places a GATA box phased with one Fyb on the chromosome the VCF gives. An ABO A allele reads low, since no variant shows it. The ABO, RhD and null-row notes say what the DNA cannot check. The bloodtype parity goldens record these changes on purpose. Bead: trait-31 Bead: trait-28 Bead: trait-32 Bead: trait-33 Bead: trait-35 Bead: trait-36 Bead: trait-37 Bead: D10 --- rust/crates/og-bloodtype/src/rules.rs | 142 +++++++++++++++-- .../tests/port_tests_cn_traits.rs | 19 +-- rust/crates/og-bloodtype/tests/report.rs | 143 +++++++++++++++++- .../abo-ab-duffy-gata-kell-null/stdout | 56 +++++++ .../abo-ab-duffy-gata-kell-null/t.tsv | 56 +++++++ .../golden/bloodtype/abo-ab-no-bam/stdout | 56 +++++++ .../golden/bloodtype/abo-ab-no-bam/t.tsv | 56 +++++++ .../bloodtype/abo-bad-para-bombay-lan/t.tsv | 56 +++++++ .../abo-odd-fyx-kidd-two-nulls/t.tsv | 56 +++++++ .../bloodtype/bam-without-chr1-chr9/t.tsv | 56 +++++++ .../bloodtype/bgzip-no-index-abo/stdout | 56 +++++++ .../golden/bloodtype/bgzip-no-index-abo/t.tsv | 56 +++++++ .../golden/bloodtype/bombay-null-null/t.tsv | 56 +++++++ .../golden/bloodtype/gvcf-hna-disagree/t.tsv | 56 +++++++ tests/parity/golden/bloodtype/hna1c/t.tsv | 56 +++++++ .../golden/bloodtype/indexed-abo/stdout | 56 +++++++ .../parity/golden/bloodtype/indexed-abo/t.tsv | 56 +++++++ .../golden/bloodtype/indexed-blocks/t.tsv | 56 +++++++ .../golden/bloodtype/indexed-bombay/t.tsv | 56 +++++++ .../golden/bloodtype/indexed-gvcf/t.tsv | 56 +++++++ .../golden/bloodtype/indexed-nochr/stdout | 56 +++++++ .../golden/bloodtype/indexed-nochr/t.tsv | 56 +++++++ .../golden/bloodtype/indexed-vcf-quirks/t.tsv | 56 +++++++ .../golden/bloodtype/low-site-depth/t.tsv | 56 +++++++ .../golden/bloodtype/plain-nochr/stdout | 56 +++++++ .../parity/golden/bloodtype/plain-nochr/t.tsv | 56 +++++++ .../bloodtype/pseudogene-one-copy/stdout | 56 +++++++ .../bloodtype/pseudogene-one-copy/t.tsv | 56 +++++++ .../bloodtype/ref-blocks-second-record/t.tsv | 56 +++++++ .../parity/golden/bloodtype/ref-no-bam/stdout | 56 +++++++ .../parity/golden/bloodtype/ref-no-bam/t.tsv | 56 +++++++ tests/parity/golden/bloodtype/ref-reads/t.tsv | 56 +++++++ .../golden/bloodtype/rhd-boundary/t.tsv | 56 +++++++ .../golden/bloodtype/rhd-broken-flank/t.tsv | 56 +++++++ .../parity/golden/bloodtype/rhd-hybrid/t.tsv | 56 +++++++ .../golden/bloodtype/rhd-low-flank/t.tsv | 56 +++++++ tests/parity/golden/bloodtype/rhd-none/t.tsv | 56 +++++++ tests/parity/golden/bloodtype/rhd-one/t.tsv | 56 +++++++ tests/parity/golden/bloodtype/rhd-three/t.tsv | 56 +++++++ .../parity/golden/bloodtype/vcf-quirks/t.tsv | 56 +++++++ 40 files changed, 2348 insertions(+), 28 deletions(-) create mode 100644 tests/parity/golden/bloodtype/abo-ab-duffy-gata-kell-null/stdout create mode 100644 tests/parity/golden/bloodtype/abo-ab-duffy-gata-kell-null/t.tsv create mode 100644 tests/parity/golden/bloodtype/abo-ab-no-bam/stdout create mode 100644 tests/parity/golden/bloodtype/abo-ab-no-bam/t.tsv create mode 100644 tests/parity/golden/bloodtype/abo-bad-para-bombay-lan/t.tsv create mode 100644 tests/parity/golden/bloodtype/abo-odd-fyx-kidd-two-nulls/t.tsv create mode 100644 tests/parity/golden/bloodtype/bam-without-chr1-chr9/t.tsv create mode 100644 tests/parity/golden/bloodtype/bgzip-no-index-abo/stdout create mode 100644 tests/parity/golden/bloodtype/bgzip-no-index-abo/t.tsv create mode 100644 tests/parity/golden/bloodtype/bombay-null-null/t.tsv create mode 100644 tests/parity/golden/bloodtype/gvcf-hna-disagree/t.tsv create mode 100644 tests/parity/golden/bloodtype/hna1c/t.tsv create mode 100644 tests/parity/golden/bloodtype/indexed-abo/stdout create mode 100644 tests/parity/golden/bloodtype/indexed-abo/t.tsv create mode 100644 tests/parity/golden/bloodtype/indexed-blocks/t.tsv create mode 100644 tests/parity/golden/bloodtype/indexed-bombay/t.tsv create mode 100644 tests/parity/golden/bloodtype/indexed-gvcf/t.tsv create mode 100644 tests/parity/golden/bloodtype/indexed-nochr/stdout create mode 100644 tests/parity/golden/bloodtype/indexed-nochr/t.tsv create mode 100644 tests/parity/golden/bloodtype/indexed-vcf-quirks/t.tsv create mode 100644 tests/parity/golden/bloodtype/low-site-depth/t.tsv create mode 100644 tests/parity/golden/bloodtype/plain-nochr/stdout create mode 100644 tests/parity/golden/bloodtype/plain-nochr/t.tsv create mode 100644 tests/parity/golden/bloodtype/pseudogene-one-copy/stdout create mode 100644 tests/parity/golden/bloodtype/pseudogene-one-copy/t.tsv create mode 100644 tests/parity/golden/bloodtype/ref-blocks-second-record/t.tsv create mode 100644 tests/parity/golden/bloodtype/ref-no-bam/stdout create mode 100644 tests/parity/golden/bloodtype/ref-no-bam/t.tsv create mode 100644 tests/parity/golden/bloodtype/ref-reads/t.tsv create mode 100644 tests/parity/golden/bloodtype/rhd-boundary/t.tsv create mode 100644 tests/parity/golden/bloodtype/rhd-broken-flank/t.tsv create mode 100644 tests/parity/golden/bloodtype/rhd-hybrid/t.tsv create mode 100644 tests/parity/golden/bloodtype/rhd-low-flank/t.tsv create mode 100644 tests/parity/golden/bloodtype/rhd-none/t.tsv create mode 100644 tests/parity/golden/bloodtype/rhd-one/t.tsv create mode 100644 tests/parity/golden/bloodtype/rhd-three/t.tsv create mode 100644 tests/parity/golden/bloodtype/vcf-quirks/t.tsv diff --git a/rust/crates/og-bloodtype/src/rules.rs b/rust/crates/og-bloodtype/src/rules.rs index c1f8c654a..f7bf85e2c 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) } @@ -882,6 +906,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 +943,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 +977,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 +1188,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-" }, @@ -1183,6 +1243,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 +1304,10 @@ pub fn predict(sites: &Genotyped, rhd: &RhdDepth, rhd_row: &Locus) -> Result system_abo(sites), ("RhD", _) => system_rhd(sites, rhd, rhd_row)?, @@ -1206,6 +1319,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 +1356,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..d38212d2d 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,142 @@ 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")); +} 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..6cee1eb25 --- /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); 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 +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) From 4a5da3fe609dfb005e6157c14e12a49a16c7c8f6 Mon Sep 17 00:00:00 2001 From: GeiserX <9169332+GeiserX@users.noreply.github.com> Date: Fri, 20 Nov 2026 00:24:32 +0100 Subject: [PATCH 07/50] docs(bloodtype): say what a weak call, a missing record and phase do, and fix the position count The step page, the script and module headers, the VCF-only page and the e2e case now match the new rules. The crate doc said the VCF is read at 318 positions; the marker table has 271. Bead: trait-39 Bead: trait-33 --- CHANGELOG.md | 1 + docs/41-bloodtype.md | 28 +++++++++++++++++++++------- docs/vcf-first.md | 2 +- modules/local/bloodtype/main.nf | 6 ++++-- rust/crates/og-bloodtype/src/lib.rs | 2 +- scripts/41-bloodtype.sh | 5 +++-- tests/e2e/bloodtype-1.sh | 10 ++++++++-- 7 files changed, 39 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ed5d083b5..73981bbf5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ Each release's notes. From 1.0.0 on, a major or minor release has hand-written n ## Unreleased +- 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+)). 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. - 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. - 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`. diff --git a/docs/41-bloodtype.md b/docs/41-bloodtype.md index 650c9de24..d749dea21 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,7 +54,7 @@ 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 | @@ -64,7 +64,20 @@ With `run-all.sh`: `TOOLS=...,bloodtype`. It is opt-in and needs no data, so a r | 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. + +### 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 has a record at every site 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/vcf-first.md b/docs/vcf-first.md index 35cf56a68..703b7d992 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 (`bloodtype`) run too, 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/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/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/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/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 From 262a4c06516e96d456528c43a5ee8c18bd209340 Mon Sep 17 00:00:00 2001 From: GeiserX <9169332+GeiserX@users.noreply.github.com> Date: Fri, 20 Nov 2026 00:41:08 +0100 Subject: [PATCH 08/50] fix(bloodtype): read a gVCF block that reaches a marker through END as a reference call A reference block that starts before a marker and covers it through INFO/END was ignored, so without a BAM a gVCF could read a system as not assessed although it covers it. Such a block is now a reference call at the marker, with its GQ and MIN_DP. ABO's c.796C>A call now counts in the ABO confidence and notes, and the VCF-only page says the blood groups are opt-in. Bead: trait-28 Bead: D10 --- docs/41-bloodtype.md | 4 +- docs/vcf-first.md | 2 +- rust/crates/og-bloodtype/src/genotypes.rs | 93 ++++++++++++++++++++++- rust/crates/og-bloodtype/src/rules.rs | 3 + rust/crates/og-bloodtype/tests/report.rs | 35 +++++++++ 5 files changed, 130 insertions(+), 7 deletions(-) diff --git a/docs/41-bloodtype.md b/docs/41-bloodtype.md index d749dea21..cddab690e 100644 --- a/docs/41-bloodtype.md +++ b/docs/41-bloodtype.md @@ -64,7 +64,7 @@ With `run-all.sh`: `TOOLS=...,bloodtype`. It is opt-in and needs no data, so a r | 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 (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 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 `MIN_DP` (see [Weak calls](#weak-calls)). ### Without the BAM @@ -73,7 +73,7 @@ A VCF lists where the genome differs from the reference. A site with no record i - 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 has a record at every site and needs no BAM for this. RhD needs the BAM in every case. +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 diff --git a/docs/vcf-first.md b/docs/vcf-first.md index 703b7d992..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`. The blood groups (`bloodtype`) run too, 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)). +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/rust/crates/og-bloodtype/src/genotypes.rs b/rust/crates/og-bloodtype/src/genotypes.rs index d3c4809ef..1a5c9ce65 100644 --- a/rust/crates/og-bloodtype/src/genotypes.rs +++ b/rust/crates/og-bloodtype/src/genotypes.rs @@ -26,7 +26,10 @@ //! 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`, @@ -373,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, @@ -384,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; @@ -401,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)) @@ -423,7 +473,25 @@ fn apply_record( .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, &quality) { @@ -971,6 +1039,23 @@ mod tests { 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/rules.rs b/rust/crates/og-bloodtype/src/rules.rs index f7bf85e2c..c1d54bab9 100644 --- a/rust/crates/og-bloodtype/src/rules.rs +++ b/rust/crates/og-bloodtype/src/rules.rs @@ -893,6 +893,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 diff --git a/rust/crates/og-bloodtype/tests/report.rs b/rust/crates/og-bloodtype/tests/report.rs index d38212d2d..46971d0b4 100644 --- a/rust/crates/og-bloodtype/tests/report.rs +++ b/rust/crates/og-bloodtype/tests/report.rs @@ -679,3 +679,38 @@ fn rows_state_what_dna_cannot_check() { 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"); +} From 678520c18da281481cb984efefb325a26733ac45 Mon Sep 17 00:00:00 2001 From: GeiserX <9169332+GeiserX@users.noreply.github.com> Date: Fri, 20 Nov 2026 01:04:24 +0100 Subject: [PATCH 09/50] test(acmg): a run without step 23 must get the secondary-findings card Red first: summary.json has no ACMG card when clinical/ is missing, and the agreement test compares every group b parity folder with and without its clinical VCF. summary-clinical.sh gets NO_ORACLE=1 so the test can write the folders without the oracle's helper modules. Bead: D11 Bead: D14 --- .../tests/screen_acmg_card_section.rs | 365 ++++++++++++++++++ tests/parity/gen/summary-clinical.sh | 17 +- 2 files changed, 375 insertions(+), 7 deletions(-) create mode 100644 rust/crates/og-summary/tests/screen_acmg_card_section.rs 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..f783f956c --- /dev/null +++ b/rust/crates/og-summary/tests/screen_acmg_card_section.rs @@ -0,0 +1,365 @@ +//! 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; (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. + for r in &without_cv { + if !with_cv.contains(r) { + 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)" + ); +} 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 From b625fd2a80d2e820646f29c026d590fcabfc83cb Mon Sep 17 00:00:00 2001 From: GeiserX <9169332+GeiserX@users.noreply.github.com> Date: Fri, 20 Nov 2026 01:04:24 +0100 Subject: [PATCH 10/50] feat(acmg): write the secondary-findings card as its own section from step 06 sections.acmg_sf follows step 06: ok when the ClinVar hits VCF is there, not run or failed with step 06's reason otherwise. The verdicts come from the same acmg::acmg_sf the clinical section calls. Without step 23's clinical VCF the card says high_impact_checked false and high_impact_note names why and what it can miss; an unreadable clinical VCF costs only the HIGH-impact source. The clinical section keeps its nested card for the readers that still use it. The full-summary parity goldens gain the section. Bead: D11 Bead: D14 --- .../og-summary/src/collect/acmg_card.rs | 115 +- rust/crates/og-summary/src/collect/group_b.rs | 37 +- rust/crates/og-summary/src/collect/post.rs | 8 +- .../crates/og-summary/src/collect/sections.rs | 2 + .../summary-collect/all-bad/all-bad.json | 1517 +++++++++-------- .../all-default-out/history-bad/summary.json | 534 ++++++ .../summary-collect/all-empty/all-empty.json | 528 ++++++ .../all-failed/all-failed.json | 528 ++++++ .../all-history-bad/all-history-bad.json | 534 ++++++ .../all-history/all-history.json | 136 +- .../summary-collect/all-inf/all-inf.json | 11 +- .../golden/summary-collect/all-nf/all-nf.json | 135 +- .../golden/summary-collect/all/all.json | 135 +- tests/schema/summary.schema.json | 60 + 14 files changed, 3511 insertions(+), 769 deletions(-) create mode 100644 tests/parity/golden/summary-collect/all-default-out/history-bad/summary.json create mode 100644 tests/parity/golden/summary-collect/all-empty/all-empty.json create mode 100644 tests/parity/golden/summary-collect/all-failed/all-failed.json create mode 100644 tests/parity/golden/summary-collect/all-history-bad/all-history-bad.json diff --git a/rust/crates/og-summary/src/collect/acmg_card.rs b/rust/crates/og-summary/src/collect/acmg_card.rs index 9506a9040..d492a368d 100644 --- a/rust/crates/og-summary/src/collect/acmg_card.rs +++ b/rust/crates/og-summary/src/collect/acmg_card.rs @@ -1,2 +1,113 @@ -//! 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. + +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, and step 23's result word +/// from the run status. +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 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), Some(why)) = (&mut v, missing) + && m.get("high_impact_checked") == Some(&Value::Bool(false)) + { + m.insert("high_impact_note".into(), Value::Str(why.note())); + } + Ok(AcmgCard(v)) + } + + pub fn to_json(&self) -> Value { + self.0.clone() + } +} diff --git a/rust/crates/og-summary/src/collect/group_b.rs b/rust/crates/og-summary/src/collect/group_b.rs index 81426f5bb..7da3e7096 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,27 @@ 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 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: folder + .run + .as_ref() + .and_then(|r| r.steps.get("23")) + .map(String::as_str), + }) + .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 +180,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/post.rs b/rust/crates/og-summary/src/collect/post.rs index 305bc87ac..b528b9b59 100644 --- a/rust/crates/og-summary/src/collect/post.rs +++ b/rust/crates/og-summary/src/collect/post.rs @@ -32,7 +32,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", @@ -43,6 +43,7 @@ pub const ORDER: [&str; 48] = [ "clinvar", "couple", "carrier", + "acmg_sf", "pharmcat", "cpic", "pypgx", @@ -85,8 +86,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/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 e6d8efc33..e8e8ff9d1 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-16 16:16 UTC", + "generated_utc": "2026-11-19 23:58 UTC", "run": { "status_file": true, "started_utc": "2020-01-01 00:00 UTC", @@ -12794,6 +12794,139 @@ } } }, + "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 + }, + { + "gene": "BRCA1", + "variant": "chr17:43057100 C>T", + "genotype": "het", + "significance": "Pathogenic", + "stars": 3, + "low_confidence": false, + "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, + "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 + }, + { + "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", @@ -15548,6 +15681,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 e61cb5810..25063129a 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-19 23:58 UTC", "run": { "status_file": true, "started_utc": "2020-01-01 00:00 UTC", @@ -12603,6 +12603,139 @@ } } }, + "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 + }, + { + "gene": "BRCA1", + "variant": "chr17:43057100 C>T", + "genotype": "het", + "significance": "Pathogenic", + "stars": 3, + "low_confidence": false, + "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, + "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 + }, + { + "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", diff --git a/tests/parity/golden/summary-collect/all/all.json b/tests/parity/golden/summary-collect/all/all.json index fabbf7ce7..2f2b646f8 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-16 16:16 UTC", + "generated_utc": "2026-11-19 23:58 UTC", "run": { "status_file": true, "started_utc": "2020-01-01 00:00 UTC", @@ -12799,6 +12799,139 @@ } } }, + "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 + }, + { + "gene": "BRCA1", + "variant": "chr17:43057100 C>T", + "genotype": "het", + "significance": "Pathogenic", + "stars": 3, + "low_confidence": false, + "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, + "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 + }, + { + "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", diff --git a/tests/schema/summary.schema.json b/tests/schema/summary.schema.json index df7c1dbe4..073ead0e1 100644 --- a/tests/schema/summary.schema.json +++ b/tests/schema/summary.schema.json @@ -1290,6 +1290,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": [ { From f77cc34696d9872b92d2df248ad409b0fda01c2c Mon Sep 17 00:00:00 2001 From: GeiserX <9169332+GeiserX@users.noreply.github.com> Date: Fri, 20 Nov 2026 01:04:24 +0100 Subject: [PATCH 11/50] docs(acmg): say where the secondary-findings card lives, and check it in e2e acmg-sf-rules-1-reports gains a cell without clinical/: the card is there with the 84 rules, says the HIGH-impact source was not screened and keeps every ClinVar row of the full run's card. nf-wiring-1-report-tables compares the card of the bash and the Nextflow summaries. Bead: D11 Bead: D14 --- CHANGELOG.md | 1 + docs/06-clinvar-screen.md | 2 ++ docs/23-clinical-filter.md | 2 ++ docs/24-html-report.md | 2 +- docs/results/secondary-findings.md | 4 ++- tests/e2e/acmg-sf-rules-1-reports.sh | 38 ++++++++++++++++++++++++++ tests/e2e/nf-wiring-1-report-tables.sh | 10 +++++-- 7 files changed, 55 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ed5d083b5..c372b3de1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ Each release's notes. From 1.0.0 on, a major or minor release has hand-written n ## Unreleased +- 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. - 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. - 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`. diff --git a/docs/06-clinvar-screen.md b/docs/06-clinvar-screen.md index 408a289e6..3ef0aea0e 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/23-clinical-filter.md b/docs/23-clinical-filter.md index 28388bf82..ce1807e00 100644 --- a/docs/23-clinical-filter.md +++ b/docs/23-clinical-filter.md @@ -90,6 +90,8 @@ The Nextflow `CLINICAL_FILTER` module applies the same tiers, ranking, frequency 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. +summary.json holds the card twice. `sections.clinical.data.acmg_sf` is the card as both reports read it, there only when this step ran. `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. A clinical VCF that cannot be read makes the clinical section's card unavailable, while `sections.acmg_sf` keeps its ClinVar rows and says the VCF could not be read. + 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. ## Runtime 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/results/secondary-findings.md b/docs/results/secondary-findings.md index 5afe3222e..6adc278cf 100644 --- a/docs/results/secondary-findings.md +++ b/docs/results/secondary-findings.md @@ -14,7 +14,7 @@ The most common "pathogenic" finding in any genome is **heterozygous carrier sta **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. -**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; @@ -31,6 +31,8 @@ The most common "pathogenic" finding in any genome is **heterozygous carrier sta 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 step 23 (no VEP cache, or step 23 failed) 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. + 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/tests/e2e/acmg-sf-rules-1-reports.sh b/tests/e2e/acmg-sf-rules-1-reports.sh index 7660081d8..3ce2098aa 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,37 @@ 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 +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" \ + '($n[0].sections.acmg_sf.data.clinvar_hits - $f[0].sections.acmg_sf.data.clinvar_hits) | 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/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" From 1048f98ffff7bf8f08866a621fccb31077e3ce04 Mon Sep 17 00:00:00 2001 From: GeiserX <9169332+GeiserX@users.noreply.github.com> Date: Fri, 20 Nov 2026 01:04:47 +0100 Subject: [PATCH 12/50] style(acmg): cargo fmt Bead: D11 --- .../og-summary/src/collect/acmg_card.rs | 7 ++- .../tests/screen_acmg_card_section.rs | 57 +++++++++++++------ 2 files changed, 44 insertions(+), 20 deletions(-) diff --git a/rust/crates/og-summary/src/collect/acmg_card.rs b/rust/crates/og-summary/src/collect/acmg_card.rs index d492a368d..bc7e96a12 100644 --- a/rust/crates/og-summary/src/collect/acmg_card.rs +++ b/rust/crates/og-summary/src/collect/acmg_card.rs @@ -88,9 +88,10 @@ impl AcmgCard { Some(Err(e)) => (None, Some(NoHighImpact::Unreadable(e.clone()))), None => ( None, - Some(i.step23.map_or(NoHighImpact::NotRun, |r| { - NoHighImpact::Step23(r.to_owned()) - })), + Some( + i.step23 + .map_or(NoHighImpact::NotRun, |r| NoHighImpact::Step23(r.to_owned())), + ), ), }; let mut v = acmg::acmg_sf(&acmg::Inputs { diff --git a/rust/crates/og-summary/tests/screen_acmg_card_section.rs b/rust/crates/og-summary/tests/screen_acmg_card_section.rs index f783f956c..73af19fc3 100644 --- a/rust/crates/og-summary/tests/screen_acmg_card_section.rs +++ b/rust/crates/og-summary/tests/screen_acmg_card_section.rs @@ -24,10 +24,7 @@ fn repo() -> PathBuf { } fn scratch(name: &str) -> PathBuf { - let d = std::env::temp_dir().join(format!( - "og-screen-acmg-{name}-{}", - std::process::id() - )); + 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 @@ -151,16 +148,21 @@ fn a_run_without_step_23_gets_the_card_from_the_clinvar_hits() { 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.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)"; + 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()), + ( + "failed (exit 1)", + "step 23 (clinical filter) failed (exit 1)".to_owned(), + ), ] { put( &sd.join("logs/run_status.tsv"), @@ -193,9 +195,14 @@ fn the_section_follows_step_06_and_is_never_a_not_run_line_of_its_own() { 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.contains(&"ClinVar screen (step 06 failed)"), + "{not_run:?}" + ); + assert!( + !not_run + .iter() + .any(|l| l.starts_with("ACMG secondary findings")), "{not_run:?}" ); } @@ -211,7 +218,11 @@ fn parity_folders(d: &Path) -> PathBuf { .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(); + std::fs::copy( + repo().join("tests/parity/inputs/summary-collect").join(f), + d.join(f), + ) + .unwrap(); } d.join("assets") } @@ -241,7 +252,9 @@ fn agreement(with: &Value, without: &Value) -> Vec { // (a) every ClinVar row without VEP, unchanged with VEP. for r in &without_cv { if !with_cv.contains(r) { - bad.push(format!("(a) ClinVar row without VEP not in the card with VEP: {r:?}")); + 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. @@ -250,8 +263,10 @@ fn agreement(with: &Value, without: &Value) -> Vec { .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(); + 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); @@ -259,7 +274,9 @@ fn agreement(with: &Value, without: &Value) -> Vec { // 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:?}")); + bad.push(format!( + "(a) ClinVar row only with VEP, not explained: {r:?}" + )); } } } @@ -281,7 +298,9 @@ fn agreement(with: &Value, without: &Value) -> Vec { 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.push(format!( + "(c) not reported without VEP, neither kept nor joined: {r:?}" + )); } } bad @@ -313,7 +332,11 @@ fn without_the_clinical_vcf_the_card_loses_only_what_the_high_impact_source_brin continue; } let (w, n) = (at(wsec, &["data"]), at(nsec, &["data"])); - assert_eq!(at(n, &["high_impact_checked"]), &Value::Bool(false), "{name}"); + 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"), From 2c9e3ec5d5683c6caa17154f2217dd9049b6ae3a Mon Sep 17 00:00:00 2001 From: GeiserX <9169332+GeiserX@users.noreply.github.com> Date: Fri, 20 Nov 2026 01:13:19 +0100 Subject: [PATCH 13/50] test(e2e): keep the platelet and copy-number cases true with not assessed systems and new RhD notes Without a BAM, the platelet case's control VCF had no record at the HPA-1, HNA-3 and HNA-4 sites, which now read not assessed; it now plants 0/0 there. The copy-number case compared step 41's whole RhD row with the tree before the engine, notes included; it now compares the phenotype, genotype and confidence, the engine's result. Bead: trait-28 Bead: trait-35 --- tests/e2e/cn-engine-1-parity.sh | 10 +++++++--- tests/e2e/platelet-antigens-1.sh | 11 ++++++----- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/tests/e2e/cn-engine-1-parity.sh b/tests/e2e/cn-engine-1-parity.sh index a4b04c253..eddf0e962 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; -# - 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 for f in lpa bloodtype.rhd evidence.rhd hba; do diff --git a/tests/e2e/platelet-antigens-1.sh b/tests/e2e/platelet-antigens-1.sh index e94eaae16..76017a53a 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,8 +61,8 @@ 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 From 54d65da22bc5a46eb6bbd81d782ef386e638300f Mon Sep 17 00:00:00 2001 From: GeiserX <9169332+GeiserX@users.noreply.github.com> Date: Fri, 20 Nov 2026 01:31:49 +0100 Subject: [PATCH 14/50] test(render): expect the TAR pair as possibly biallelic A homozygous hypomorphic allele inside a deletion is one copy, so the two-hit verdict for RBM8A is now 'possibly biallelic'. The og-render clinical test still asserted the old 'biallelic' and was the one red test of Guard rust on this branch. Bead: clin-32 --- rust/crates/og-render/tests/clinical.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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() From 8e2025dcebc02f439baad57530e990d840efd8a5 Mon Sep 17 00:00:00 2001 From: GeiserX <9169332+GeiserX@users.noreply.github.com> Date: Fri, 20 Nov 2026 01:53:16 +0100 Subject: [PATCH 15/50] fix(telomere): pass the shipped GRCh38 bands in both mirrors, never hg19 Step 10 warned and ran TelomereHunter without -b when the band file was missing, and the Nextflow module did so whenever --cytoband was unset (the default), so reads were sorted by hg19 band ends on GRCh38 positions. The script now installs assets/reference/cytoBand.hg38.txt first; the workflow passes that copy when --cytoband is unset. Bead: trait-46 Bead: trait-47 --- docs/00-reference-setup.md | 2 +- docs/getting-started.md | 2 +- docs/nextflow.md | 4 +- docs/parameters.md | 2 +- modules/local/telomere_hunter/main.nf | 31 ++++++++------ nextflow.config | 2 +- nextflow_schema.json | 2 +- scripts/10-telomere-hunter.sh | 50 +++++++++++------------ scripts/validate-setup.sh | 2 +- tests/fake-docker/bash-step-hla.sh | 7 ++-- tests/fake-docker/bash-step-setup-data.sh | 12 ++++++ workflows/bam_analysis.nf | 12 +++--- 12 files changed, 73 insertions(+), 55 deletions(-) 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/getting-started.md b/docs/getting-started.md index 9e37ca022..044cb6d34 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -199,7 +199,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. diff --git a/docs/nextflow.md b/docs/nextflow.md index 544cc1d86..b8cbc424b 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..b1b1d0ab6 100644 --- a/docs/parameters.md +++ b/docs/parameters.md @@ -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/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..b5ed47bcb 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/) 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/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/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/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/workflows/bam_analysis.nf b/workflows/bam_analysis.nf index 71214cb51..c69eea0ad 100644 --- a/workflows/bam_analysis.nf +++ b/workflows/bam_analysis.nf @@ -47,7 +47,7 @@ workflow BAM_ANALYSIS { ch_expansion_catalog // channel: val(path) — ExpansionHunter variant catalog JSON ch_hla_dat // channel: val(path) — Pre-downloaded IPD-IMGT/HLA hla.dat ch_hla_genes // channel: val(path) — gene annotation (GTF) T1K takes coordinates from - ch_cytoband // channel: val(path) — UCSC GRCh38 chromosome bands or [] + ch_cytoband // channel: val(path) — UCSC GRCh38 chromosome bands or [] (then the copy in assets/reference) ch_somalier_sites // channel: val(path) — somalier sites VCF or [] ch_verifybamid2_panel // channel: val(path) — folder of VerifyBamID2's .UD/.mu/.bed panel or [] ch_kir_dat // channel: val(path) — IPD-KIR kir.dat (--kir) or [] @@ -180,12 +180,10 @@ workflow BAM_ANALYSIS { // Gates on: params.tools contains 'telomere_hunter' // if (params.tools && params.tools.split(',').collect{it.trim()}.contains('telomere_hunter')) { - if (!params.cytoband) { - log.warn "telomere_hunter: --cytoband is not set, so TelomereHunter classifies reads by its own hg19 " + - "chromosome bands on GRCh38 positions. Pass UCSC's GRCh38 bands (scripts/setup.sh installs " + - "reference/cytoBand.hg38.txt)." - } - TELOMERE_HUNTER(ch_bam, ch_cytoband) + // The BAM is GRCh38: without --cytoband the module gets the GRCh38 + // bands the repository ships, never TelomereHunter's own fallback. + ch_bands = ch_cytoband.map { f -> f instanceof List ? file("${projectDir}/assets/reference/cytoBand.hg38.txt", checkIfExists: true) : f } + TELOMERE_HUNTER(ch_bam, ch_bands) ch_telomere_results = TELOMERE_HUNTER.out.telomere_results ch_versions = ch_versions.mix(TELOMERE_HUNTER.out.versions) } From db50aaf685d46d97ce172fca6a139e37691234be Mon Sep 17 00:00:00 2001 From: GeiserX <9169332+GeiserX@users.noreply.github.com> Date: Fri, 20 Nov 2026 01:53:16 +0100 Subject: [PATCH 16/50] build(telomere): move step 10 to TelomereHunter2 1.0.12 TelomereHunter 1.1.0 is Python 2.7 code. TelomereHunter2 1.0.12 gives the same tel_content on the planted test BAM (5347.255643 with 1,100 reads, 5337.585253 with 1,098, both versions). Its image has no samtools, so the image test builds telo.bam with the samtools image (new input telobam). It needs more than 1,024 open files on a BAM with many contigs; the script and module raise the limit. Bead: trait-49 --- conf/containers.config | 2 +- docs/versions.md | 2 +- scripts/ci/image-smoke.sh | 26 +++++++++++++++++++++++++- tests/smoke/README.md | 1 + tests/smoke/commands.tsv | 2 +- tests/smoke/telomerehunter.sh | 29 ++++++++--------------------- versions.env | 2 +- 7 files changed, 38 insertions(+), 26 deletions(-) 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/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/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/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/versions.env b/versions.env index 44d81f911..5925e6792 100644 --- a/versions.env +++ b/versions.env @@ -66,7 +66,7 @@ PHARMCAT_IMAGE="pgkb/pharmcat:3.4.0" PYPGX_IMAGE="quay.io/biocontainers/pypgx:0.26.0--pyh7e72e81_0" # --- Specialized analysis --- -TELOMEREHUNTER_IMAGE="quay.io/biocontainers/telomerehunter:1.1.0--pyhdfd78af_0" # run with --plotNone: the plots of this build fail (its R lacks dplyr) +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 HAPLOGREP3_IMAGE="quay.io/biocontainers/haplogrep3:3.2.2--hdfd78af_1" HAPLOCHECK_IMAGE="quay.io/biocontainers/haplocheck:1.3.3--h2a3209d_2" # step 12: mtDNA contamination; legacy: no automated bumps (last release 2022) 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) From cd72dd138dc2c1d06f3371ac3af2f135211d6ddc Mon Sep 17 00:00:00 2001 From: GeiserX <9169332+GeiserX@users.noreply.github.com> Date: Fri, 20 Nov 2026 01:53:17 +0100 Subject: [PATCH 17/50] docs(telomere): describe tel_content as relative, never an age The step script and module called the value a biological age baseline. Reworded, the step doc covers TelomereHunter2 and the bands, and tests/test_telomere_wording.sh fails when a file that describes step 10 uses the phrase (with a planted control). Bead: trait-48 Bead: trait-49 --- CHANGELOG.md | 1 + docs/10-telomere-analysis.md | 38 +++++++++------- docs/results/traits-and-somatic.md | 2 +- tests/test_telomere_wording.sh | 72 ++++++++++++++++++++++++++++++ 4 files changed, 95 insertions(+), 18 deletions(-) create mode 100755 tests/test_telomere_wording.sh diff --git a/CHANGELOG.md b/CHANGELOG.md index eb7a130e7..680a01596 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ Each release's notes. From 1.0.0 on, a major or minor release has hand-written n ## Unreleased +- 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). - 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). 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/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/tests/test_telomere_wording.sh b/tests/test_telomere_wording.sh new file mode 100755 index 000000000..3dc6e1f6d --- /dev/null +++ b/tests/test_telomere_wording.sh @@ -0,0 +1,72 @@ +#!/usr/bin/env bash +# Step 10 measures a relative telomere content (intratelomeric reads per +# million reads with 48-52% GC). It is not an age, so no text that describes +# the step or its result may call it "biological age" (or ageing, aging). +# +# The files checked are the ones that describe step 10 or print its result. +# A listed file that a later change removes is skipped with a note; the step +# script and its Nextflow module must exist. +# +# 1. Control: the check run on a planted copy of the step script with the +# phrase fails, so the check can fail. +# 2. The real files: none has the phrase. +set -uo pipefail + +REPO="$(cd "$(dirname "$0")/.." && pwd)" +FILES=( + scripts/10-telomere-hunter.sh + modules/local/telomere_hunter/main.nf + docs/10-telomere-analysis.md + docs/results/traits-and-somatic.md + rust/crates/og-render/src/notes.rs + rust/crates/og-render/src/sections/telomere.rs + bin/render_report.py +) +REQUIRED="scripts/10-telomere-hunter.sh modules/local/telomere_hunter/main.nf" +PHRASE='biological[[:space:]-]+(age|ageing|aging)' +fails=0 +ok() { echo "PASS $*"; } +bad() { echo "FAIL $*"; fails=$((fails + 1)); } + +# check ROOT: print each line of the listed files under ROOT that has the +# phrase; exit 1 when one does or a required file is missing. +check() { + local root=$1 f rc=0 + for f in "${FILES[@]}"; do + if [ ! -f "${root}/${f}" ]; then + case " $REQUIRED " in + *" $f "*) echo "missing: ${f}"; rc=1 ;; + *) echo "note: ${f} is gone, skipped" ;; + esac + continue + fi + if grep -n -i -E "$PHRASE" "${root}/${f}" | sed "s|^|${f}:|"; then rc=1; fi + done + return "$rc" +} + +T=$(mktemp -d) +trap 'rm -rf "$T"' EXIT +for f in "${FILES[@]}"; do + [ -f "${REPO}/${f}" ] || continue + mkdir -p "${T}/$(dirname "$f")" + cp "${REPO}/${f}" "${T}/${f}" +done +printf '# Higher values = longer telomeres. Provides a Biological Age baseline.\n' >> "${T}/scripts/10-telomere-hunter.sh" +if out=$(check "$T"); then + bad "control: a planted 'Biological Age' line in the step script passed the check" +elif grep -q '^scripts/10-telomere-hunter.sh:[0-9]*:.*Biological Age' <<< "$out"; then + ok "control: the planted line fails the check and is named" +else + bad "control: the check failed without naming the planted line: ${out}" +fi + +if out=$(check "$REPO"); then + ok "no file that describes step 10 calls its result a biological age" +else + bad "step 10's wording:" + printf '%s\n' "$out" +fi + +[ "$fails" -eq 0 ] || { echo "${fails} check(s) failed"; exit 1; } +echo "all checks passed" From 22f66801037da067f3d0faa6e062669c3fd93a60 Mon Sep 17 00:00:00 2001 From: GeiserX <9169332+GeiserX@users.noreply.github.com> Date: Fri, 20 Nov 2026 01:55:25 +0100 Subject: [PATCH 18/50] fix(bloodtype): name a weak c.1061delC call and keep the Bombay note off an unread ABO row Also correct the gVCF block wording (DP, else MIN_DP) and the platelet control label. --- CHANGELOG.md | 2 +- docs/41-bloodtype.md | 4 +-- rust/crates/og-bloodtype/src/rules.rs | 8 ++++++ rust/crates/og-bloodtype/tests/report.rs | 27 +++++++++++++++++++ tests/e2e/platelet-antigens-1.sh | 2 +- .../bloodtype/abo-bad-para-bombay-lan/t.tsv | 2 +- 6 files changed, 40 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b7e6b945..e16816b5a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ Each release's notes. From 1.0.0 on, a major or minor release has hand-written n ## Unreleased -- 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+)). 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. +- 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. - 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). diff --git a/docs/41-bloodtype.md b/docs/41-bloodtype.md index cddab690e..2fc8e8d10 100644 --- a/docs/41-bloodtype.md +++ b/docs/41-bloodtype.md @@ -59,12 +59,12 @@ With `run-all.sh`: `TOOLS=...,bloodtype`. It is opt-in and needs no data, so a r | 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 (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 `MIN_DP` (see [Weak calls](#weak-calls)). +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 diff --git a/rust/crates/og-bloodtype/src/rules.rs b/rust/crates/og-bloodtype/src/rules.rs index c1d54bab9..90cfc1836 100644 --- a/rust/crates/og-bloodtype/src/rules.rs +++ b/rust/crates/og-bloodtype/src/rules.rs @@ -880,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))); @@ -1230,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", ); diff --git a/rust/crates/og-bloodtype/tests/report.rs b/rust/crates/og-bloodtype/tests/report.rs index 46971d0b4..ce97841d9 100644 --- a/rust/crates/og-bloodtype/tests/report.rs +++ b/rust/crates/og-bloodtype/tests/report.rs @@ -714,3 +714,30 @@ fn a_gvcf_block_that_reaches_a_marker_through_end_is_a_reference_call() { 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/tests/e2e/platelet-antigens-1.sh b/tests/e2e/platelet-antigens-1.sh index 76017a53a..6090e7516 100755 --- a/tests/e2e/platelet-antigens-1.sh +++ b/tests/e2e/platelet-antigens-1.sh @@ -66,7 +66,7 @@ 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/parity/golden/bloodtype/abo-bad-para-bombay-lan/t.tsv b/tests/parity/golden/bloodtype/abo-bad-para-bombay-lan/t.tsv index 6cee1eb25..13e7678ae 100644 --- a/tests/parity/golden/bloodtype/abo-bad-para-bombay-lan/t.tsv +++ b/tests/parity/golden/bloodtype/abo-bad-para-bombay-lan/t.tsv @@ -1,7 +1,7 @@ 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); 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 +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 From 8e9d9e8197693def6711cc8d7f95d2375430a620 Mon Sep 17 00:00:00 2001 From: GeiserX <9169332+GeiserX@users.noreply.github.com> Date: Fri, 20 Nov 2026 02:29:39 +0100 Subject: [PATCH 19/50] fix(acmg): name a clinical VCF of an earlier run in the secondary-findings card When step 23 is not ok in this run and its clinical VCF predates the run, sections.acmg_sf still reads that VCF. The card now says so in high_impact_note, with the VCF's date and step 23's result, as the clinical section goes stale. --- docs/23-clinical-filter.md | 2 +- docs/results/secondary-findings.md | 2 +- .../og-summary/src/collect/acmg_card.rs | 40 ++++++++++--- rust/crates/og-summary/src/collect/group_b.rs | 22 +++++-- .../tests/screen_acmg_card_section.rs | 58 +++++++++++++++++++ 5 files changed, 110 insertions(+), 14 deletions(-) diff --git a/docs/23-clinical-filter.md b/docs/23-clinical-filter.md index ce1807e00..6e68c692d 100644 --- a/docs/23-clinical-filter.md +++ b/docs/23-clinical-filter.md @@ -90,7 +90,7 @@ The Nextflow `CLINICAL_FILTER` module applies the same tiers, ranking, frequency 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. -summary.json holds the card twice. `sections.clinical.data.acmg_sf` is the card as both reports read it, there only when this step ran. `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. A clinical VCF that cannot be read makes the clinical section's card unavailable, while `sections.acmg_sf` keeps its ClinVar rows and says the VCF could not be read. +summary.json holds the card twice. `sections.clinical.data.acmg_sf` is the card as both reports read it, there only when this step ran. `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 makes the clinical section's card unavailable, while `sections.acmg_sf` keeps its ClinVar rows and says the VCF could not be read. 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/results/secondary-findings.md b/docs/results/secondary-findings.md index 63df53e20..ee96e62c4 100644 --- a/docs/results/secondary-findings.md +++ b/docs/results/secondary-findings.md @@ -31,7 +31,7 @@ The most common "pathogenic" finding in any genome is **heterozygous carrier sta 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. +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/rust/crates/og-summary/src/collect/acmg_card.rs b/rust/crates/og-summary/src/collect/acmg_card.rs index bc7e96a12..dabb42721 100644 --- a/rust/crates/og-summary/src/collect/acmg_card.rs +++ b/rust/crates/og-summary/src/collect/acmg_card.rs @@ -9,7 +9,10 @@ //! 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. +//! `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; @@ -59,14 +62,27 @@ impl NoHighImpact { } /// What the card reads: the step 06 hits, the clinical VCF when step 23 -/// left one, the deletions of the two-hit rule, and step 23's result word -/// from the run status. +/// 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. @@ -100,10 +116,20 @@ impl AcmgCard { clinical, deletions: i.deletions, })?; - if let (Value::Object(m), Some(why)) = (&mut v, missing) - && m.get("high_impact_checked") == Some(&Value::Bool(false)) - { - m.insert("high_impact_note".into(), Value::Str(why.note())); + 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)) } diff --git a/rust/crates/og-summary/src/collect/group_b.rs b/rust/crates/og-summary/src/collect/group_b.rs index 7da3e7096..ab338db0e 100644 --- a/rust/crates/og-summary/src/collect/group_b.rs +++ b/rust/crates/og-summary/src/collect/group_b.rs @@ -144,6 +144,21 @@ pub fn read(input: &Input, folder: &Folder) -> Vec
{ }; 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 { @@ -151,11 +166,8 @@ pub fn read(input: &Input, folder: &Folder) -> Vec
{ hits: h, clinical: clinical_vcf.as_ref(), deletions: &deletions, - step23: folder - .run - .as_ref() - .and_then(|r| r.steps.get("23")) - .map(String::as_str), + step23, + earlier_vcf, }) .and_then(|c| with_mtime(&h.path, h.rel.clone(), Data::AcmgSf(c))), }; diff --git a/rust/crates/og-summary/tests/screen_acmg_card_section.rs b/rust/crates/og-summary/tests/screen_acmg_card_section.rs index 73af19fc3..539218b06 100644 --- a/rust/crates/og-summary/tests/screen_acmg_card_section.rs +++ b/rust/crates/og-summary/tests/screen_acmg_card_section.rs @@ -386,3 +386,61 @@ fn without_the_clinical_vcf_the_card_loses_only_what_the_high_impact_source_brin "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); +} From fa18468e315ca078b31489ff4e50733602a034a5 Mon Sep 17 00:00:00 2001 From: GeiserX <9169332+GeiserX@users.noreply.github.com> Date: Fri, 20 Nov 2026 02:59:19 +0100 Subject: [PATCH 20/50] fix(report): map the acmg_sf section to the clinical-filter frame and keep it out of the search index --- rust/crates/og-render/src/chapters.rs | 2 +- rust/crates/og-render/src/index.rs | 7 +++++++ rust/crates/og-render/tests/port_report_core.rs | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/rust/crates/og-render/src/chapters.rs b/rust/crates/og-render/src/chapters.rs index ea46924ed..ba09cc68e 100644 --- a/rust/crates/og-render/src/chapters.rs +++ b/rust/crates/og-render/src/chapters.rs @@ -58,7 +58,7 @@ pub const CHAPTERS: [Chapter; 7] = [ sec( "clinical-filter", "Clinical filter and secondary findings", - &["clinical"], + &["clinical", "acmg_sf"], ), sec("cpsr", "Cancer predisposition", &["cpsr"]), sec("slivar", "Variant prioritization", &["slivar"]), 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/port_report_core.rs b/rust/crates/og-render/tests/port_report_core.rs index b8d8d44ca..f4b27baaa 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(); From 9fe3ecea0c04efd7e1c798311fc26e29247aee27 Mon Sep 17 00:00:00 2001 From: GeiserX <9169332+GeiserX@users.noreply.github.com> Date: Fri, 20 Nov 2026 03:40:54 +0100 Subject: [PATCH 21/50] fix(report): show acmg_sf with the clinical section so the HTML frame keeps parity --- rust/crates/og-render/src/chapters.rs | 26 ++++++++++++++++--- .../og-render/tests/port_report_core.rs | 19 ++++++++++++++ 2 files changed, 42 insertions(+), 3 deletions(-) diff --git a/rust/crates/og-render/src/chapters.rs b/rust/crates/og-render/src/chapters.rs index ba09cc68e..7ea79341b 100644 --- a/rust/crates/og-render/src/chapters.rs +++ b/rust/crates/og-render/src/chapters.rs @@ -58,7 +58,7 @@ pub const CHAPTERS: [Chapter; 7] = [ sec( "clinical-filter", "Clinical filter and secondary findings", - &["clinical", "acmg_sf"], + &["clinical"], ), sec("cpsr", "Cancer predisposition", &["cpsr"]), sec("slivar", "Variant prioritization", &["slivar"]), @@ -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/tests/port_report_core.rs b/rust/crates/og-render/tests/port_report_core.rs index f4b27baaa..6f846eeb6 100644 --- a/rust/crates/og-render/tests/port_report_core.rs +++ b/rust/crates/og-render/tests/port_report_core.rs @@ -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] From 4321a1987ddfa2c807aa95bf840eae7bb023e0ba Mon Sep 17 00:00:00 2001 From: GeiserX <9169332+GeiserX@users.noreply.github.com> Date: Fri, 20 Nov 2026 03:45:39 +0100 Subject: [PATCH 22/50] docs(acmg): say when each summary card is there and when the two differ --- docs/23-clinical-filter.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/23-clinical-filter.md b/docs/23-clinical-filter.md index 6e68c692d..697ad788f 100644 --- a/docs/23-clinical-filter.md +++ b/docs/23-clinical-filter.md @@ -90,7 +90,7 @@ The Nextflow `CLINICAL_FILTER` module applies the same tiers, ranking, frequency 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. -summary.json holds the card twice. `sections.clinical.data.acmg_sf` is the card as both reports read it, there only when this step ran. `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 makes the clinical section's card unavailable, while `sections.acmg_sf` keeps its ClinVar rows and says the VCF could not be read. +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. From c9961b9e88d2a352cad59c8606a35f6e847943a1 Mon Sep 17 00:00:00 2001 From: GeiserX <9169332+GeiserX@users.noreply.github.com> Date: Fri, 20 Nov 2026 11:02:57 +0100 Subject: [PATCH 23/50] fix(ci): let a HIGH-impact row change the gene's pair in the ACMG card agreement test #531 (i411-sf-haplotype-count) gives each reported row of a recessive gene the gene's own verdict, `pair` and `phase`. #533 (screen-acmg-card-section) checks that every ClinVar row of the card without VEP is in the card with VEP, unchanged. Together, cb-full fails: with step 23's clinical VCF a HIGH-impact MUTYH row joins, and the gene's phase sentence names that pair instead of the deletion. The row's own fields are the same. Rule (a) now compares the row without `pair` and `phase` only when a HIGH-impact row of its gene joined it; any other change still fails. --- .../tests/screen_acmg_card_section.rs | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/rust/crates/og-summary/tests/screen_acmg_card_section.rs b/rust/crates/og-summary/tests/screen_acmg_card_section.rs index 539218b06..c3bb2b1d7 100644 --- a/rust/crates/og-summary/tests/screen_acmg_card_section.rs +++ b/rust/crates/og-summary/tests/screen_acmg_card_section.rs @@ -10,7 +10,8 @@ //! 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; (b) every gene reported without VEP is reported +//! 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. @@ -249,9 +250,22 @@ fn agreement(with: &Value, without: &Value) -> Vec { .collect(); let with_cv = rows(with, "clinvar_hits"); let without_cv = rows(without, "clinvar_hits"); - // (a) every ClinVar row without VEP, unchanged with VEP. + // (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 { - if !with_cv.contains(r) { + 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:?}" )); From 912466da701264a07fb7a75314602e45464cebb7 Mon Sep 17 00:00:00 2001 From: GeiserX <9169332+GeiserX@users.noreply.github.com> Date: Fri, 20 Nov 2026 11:04:21 +0100 Subject: [PATCH 24/50] test(mito): a shifted poly-C indel and a NuMT filter without depth must show in the annotation The m.315 C>CC call is the m.310 T>TC insertion ClinVar and gnomAD list, and m.308 CC>C is m.302 AC>A; today neither meets its record. A run whose NuMT filter had no autosomal depth must say so in the table. Both tests fail on main. Bead: lin-35 Bead: lin-32 --- rust/crates/og-summary/src/mito/tests.rs | 143 +++++++++++++++++++++++ 1 file changed, 143 insertions(+) diff --git a/rust/crates/og-summary/src/mito/tests.rs b/rust/crates/og-summary/src/mito/tests.rs index fc6e18b10..6c41f95e5 100644 --- a/rust/crates/og-summary/src/mito/tests.rs +++ b/rust/crates/og-summary/src/mito/tests.rs @@ -233,3 +233,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")); +} From 48505ed74fa39429aff8ad681bd23a0dc0d8a3ac Mon Sep 17 00:00:00 2001 From: GeiserX <9169332+GeiserX@users.noreply.github.com> Date: Fri, 20 Nov 2026 11:06:00 +0100 Subject: [PATCH 25/50] fix(pgx): require 10x in the CYP2D6 flanks before the depth check passes The CYP2D6 depth check read only the share of MAPQ 0 reads, so flanks at 6x with every read mapped well passed as fit for a copy-number call, and two callers could agree on too few reads. Flanks under 10x at MAPQ >= 1 now make the verdict unreliable, with the message "agreement not counted (depth)". Multi-mapped reads are still named first. Bead: pgx-09 Bead: D10 --- rust/crates/og-bam/src/cyp2d6.rs | 27 ++++- rust/crates/og-bam/tests/i411_cyp2d6_gate.rs | 121 +++++++++++++++++++ 2 files changed, 145 insertions(+), 3 deletions(-) create mode 100644 rust/crates/og-bam/tests/i411_cyp2d6_gate.rs 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}"); +} From d9ad330f2aaf376d1942a9c68eb3235fde034f60 Mon Sep 17 00:00:00 2001 From: GeiserX <9169332+GeiserX@users.noreply.github.com> Date: Fri, 20 Nov 2026 11:06:00 +0100 Subject: [PATCH 26/50] fix(pgx): flag weak pypgx evidence in the step 36 consensus table A pypgx CYP2D6 call whose defining variants are not all PASS, or not of good quality, now reads "weak evidence (...)" in the Evidence column of pgx_consensus.tsv. A call Cyrius agrees with is still passed: the flag shows the weakness, it does not withhold the call. Bead: pgx-01 --- rust/crates/og-steps/src/pgx_rules.rs | 132 ++++++++++++++++++++++++-- 1 file changed, 122 insertions(+), 10 deletions(-) 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"); From 7e6654efff98b59e5155d6cb6874677e7900241f Mon Sep 17 00:00:00 2001 From: GeiserX <9169332+GeiserX@users.noreply.github.com> Date: Fri, 20 Nov 2026 11:06:00 +0100 Subject: [PATCH 27/50] docs(pgx): say the CYP2D6 depth check needs 10x flanks and how weak pypgx evidence shows Bead: pgx-09 Bead: pgx-01 --- CHANGELOG.md | 1 + docs/21-cyrius.md | 2 +- docs/32-pypgx.md | 5 +++-- docs/36-pgx-consensus.md | 6 +++--- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eb7a130e7..831389120 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ Each release's notes. From 1.0.0 on, a major or minor release has hand-written n ## Unreleased +- 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). - 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). 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/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]`. From 102771bceadbaca4eaabd9af904dc834c47ac3cc Mon Sep 17 00:00:00 2001 From: GeiserX <9169332+GeiserX@users.noreply.github.com> Date: Fri, 20 Nov 2026 11:08:15 +0100 Subject: [PATCH 28/50] fix(mito): match a chrM indel at the left end of its repeat, and name a NuMT filter without depth og mito annotate matched an indel only on its exact trimmed spelling, and looked for ClinVar's record at most one base away, so m.315 C>CC never met the m.310 T>TC record of the same poly-C insertion. When the exact spelling finds nothing, both sides are now moved to the left end of their repeat on the rCRS (embedded, GRCh38's chrM, MD5 c68f5267...) and matched there. An exact match still wins, so every table that matched before is unchanged; an allele whose REF is not the rCRS is not moved. ClinVar's chrM records are now read whole, since a record can sit anywhere in its repeat. --numt-default adds a '# numt' header line: the NuMT filter used a default depth (0) and marked nothing. Without it the table is as before. Bead: lin-35 Bead: lin-32 --- rust/crates/og-summary/src/mito.rs | 396 +++++++++++++++++++---- rust/crates/og-summary/src/mito/tests.rs | 22 +- 2 files changed, 360 insertions(+), 58 deletions(-) diff --git a/rust/crates/og-summary/src/mito.rs b/rust/crates/og-summary/src/mito.rs index d447acf9f..d0da82b04 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,70 @@ 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 { + let (pos, r, a) = min_allele(pos, r, a); + 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)) + }); + 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 +420,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 +432,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 +484,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 +496,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 +531,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 +813,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 +826,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 +868,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 6c41f95e5..5922fc9f3 100644 --- a/rust/crates/og-summary/src/mito/tests.rs +++ b/rust/crates/og-summary/src/mito/tests.rs @@ -15,6 +15,26 @@ 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")); + 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 +201,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, [ From df8550be15d4bc517253548edf5c56c316f33e02 Mon Sep 17 00:00:00 2001 From: GeiserX <9169332+GeiserX@users.noreply.github.com> Date: Fri, 20 Nov 2026 11:08:15 +0100 Subject: [PATCH 29/50] fix(mito): warn and flag the table when the NuMT filter has no autosomal depth Step 20 already warned; it now passes --numt-default to og mito annotate when neither mosdepth output nor AUTOSOMAL_COVERAGE gives a depth. The Nextflow MITO_VARIANTS prints its message as a WARNING on stderr, and MITO_VARIANTS_ANNOTATE passes --numt-default when mosdepth is not in --tools, the one case where MITO_VARIANTS has no depth files. The fake-docker case checks both paths and fails on main. Bead: lin-32 --- modules/local/mito_variants/main.nf | 13 +++++++---- scripts/20-mtoolbox.sh | 8 +++++-- tests/fake-docker/bash-step-somatic-mito.sh | 24 ++++++++++++++++++--- 3 files changed, 36 insertions(+), 9 deletions(-) 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/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/tests/fake-docker/bash-step-somatic-mito.sh b/tests/fake-docker/bash-step-somatic-mito.sh index af177e672..f23363af8 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,7 +161,15 @@ 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. From f74af7a39a5a24045e6353f9654ca8a4ca28e71a Mon Sep 17 00:00:00 2001 From: GeiserX <9169332+GeiserX@users.noreply.github.com> Date: Fri, 20 Nov 2026 11:08:15 +0100 Subject: [PATCH 30/50] docs(mito): say how indels are matched and what the numt line means Bead: lin-35 Bead: lin-32 --- CHANGELOG.md | 2 ++ docs/20-mtoolbox.md | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eb7a130e7..9bd31d786 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,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 is not the rCRS is not moved. `_chrM_annotated.tsv` keeps its columns and each call's own position, REF and ALT; only `.` cells can now hold a value. Part of #411 (lin-35). +- Step 20 and the Nextflow `MITO_VARIANTS` 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. diff --git a/docs/20-mtoolbox.md b/docs/20-mtoolbox.md index 964e5f859..7d77a456d 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 is not the rCRS at its position is not moved. The table keeps each call's own position, REF and ALT. 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 task warns, 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 From 10ad32d5472f0f7254a34e7786f72bafaf229113 Mon Sep 17 00:00:00 2001 From: GeiserX <9169332+GeiserX@users.noreply.github.com> Date: Fri, 20 Nov 2026 11:18:18 +0100 Subject: [PATCH 31/50] refactor(report): build the five chart specs and their SVG in og-render og report charts --summary IN --charts-json OUT writes what bin/render_report.py --charts-json writes, byte for byte, and prints the same Sections line, so both run with the same arguments. The specs are built once (charts::build) for the HTML report (charts::figure) and the live page (charts::json). Bead: D1 --- rust/crates/og-render/src/charts/build.rs | 792 ++++++++++++++++++++++ rust/crates/og-render/src/charts/mod.rs | 417 +++++++++++- rust/crates/og-render/src/charts/svg.rs | 582 ++++++++++++++++ 3 files changed, 1783 insertions(+), 8 deletions(-) create mode 100644 rust/crates/og-render/src/charts/build.rs create mode 100644 rust/crates/og-render/src/charts/svg.rs 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), + } +} From 29e8d4486c9c2155f1e77318fd34233b0d2dfa1d Mon Sep 17 00:00:00 2001 From: GeiserX <9169332+GeiserX@users.noreply.github.com> Date: Fri, 20 Nov 2026 11:18:18 +0100 Subject: [PATCH 32/50] test(report): move the chart checks to cargo Every non-browser check of tests/test_report_charts.py now runs on og report charts in rust/crates/og-render/tests/charts.rs, each with its red control, plus frozen hashes of the oracle's charts JSON on the fixture and five changed copies. The Python file keeps only the live page's browser check, which needs the Python live server. Bead: D1 --- rust/crates/og-render/tests/charts.rs | 849 ++++++++++++++++++++++++++ tests/test_report_charts.py | 409 +------------ 2 files changed, 856 insertions(+), 402 deletions(-) create mode 100644 rust/crates/og-render/tests/charts.rs diff --git a/rust/crates/og-render/tests/charts.rs b/rust/crates/og-render/tests/charts.rs new file mode 100644 index 000000000..aaacc6bf8 --- /dev/null +++ b/rust/crates/og-render/tests/charts.rs @@ -0,0 +1,849 @@ +//! The report's charts (og report charts), on the invented sections of +//! tests/fixtures/report_charts/sections.json and on changed copies of them. +//! Moved here from tests/test_report_charts.py, check for check; each check +//! runs on a broken input too and must catch it. +//! +//! 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/tests/test_report_charts.py b/tests/test_report_charts.py index 23dc05b2d..58e6b4856 100755 --- a/tests/test_report_charts.py +++ b/tests/test_report_charts.py @@ -1,37 +1,10 @@ #!/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 on the live page, on DEMO-001, the invented demo sample. + +The charts' own checks (bin/report_charts.py, og report charts) are cargo +tests now: rust/crates/og-render/tests/charts.rs. What stays here is the +browser check of the live page, which needs the live site's Python server: -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