From 7740a33a2a0ae35302d223e9dbf14f7e2c353cd5 Mon Sep 17 00:00:00 2001 From: Brent Pedersen Date: Wed, 20 Sep 2023 11:01:23 +0200 Subject: [PATCH] close #123 --- CHANGES.md | 4 ++++ somalier.nimble | 2 +- src/somalierpkg/relate.nim | 6 +++++- src/somalierpkg/version.nim | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index aac24ad..23ebfba 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,7 @@ +v0.2.19 +======= ++ [relate/infer] fix check that would prevent some inference (#123) + v0.2.18 ======= + [find_sites] handle empty alternate alleles (#121) diff --git a/somalier.nimble b/somalier.nimble index 522bc31..03bd6d5 100644 --- a/somalier.nimble +++ b/somalier.nimble @@ -1,6 +1,6 @@ #import somalierpkg/version as _ -version = "0.2.18" #somalierVersion +version = "0.2.19" #somalierVersion author = "Brent Pedersen" description = "sample-swap checking directly on BAMs/CRAMs for cancer data" license = "MIT" diff --git a/src/somalierpkg/relate.nim b/src/somalierpkg/relate.nim index ff42e84..4be879b 100644 --- a/src/somalierpkg/relate.nim +++ b/src/somalierpkg/relate.nim @@ -456,7 +456,10 @@ proc high_quality(gt_counts: array[5, seq[uint16]], i:int): bool {.inline.} = result = gt_counts[4][i].float / (gt_counts[0][i] + gt_counts[1][i] + gt_counts[2][i] + gt_counts[3][i] + gt_counts[4][i]).float < 0.06 if not result: return false - result = gt_counts[2][i].float / gt_counts[1][i].float > 0.7 + + # should have fewer hom-alts[2] than hets[1] + result = gt_counts[2][i].float / gt_counts[1][i].float < 0.7 + proc samples_have_y_depth(stats: seq[Stat4]): bool = var n = 0 @@ -821,6 +824,7 @@ proc write_ped(fh:File, final: var relation_matrices, stats: seq[Stat4], gt_coun fh.write("X_depth_mean\tX_n\tX_hom_ref\tX_het\tX_hom_alt\t") fh.write("Y_depth_mean\tY_n\n") + if infer: final.remove_spurious_parent_ids(L, stats) for i, sample_name in L.sample_names: diff --git a/src/somalierpkg/version.nim b/src/somalierpkg/version.nim index 3cf73c1..b14b446 100644 --- a/src/somalierpkg/version.nim +++ b/src/somalierpkg/version.nim @@ -1 +1 @@ -let somalierVersion* = "0.2.18" +let somalierVersion* = "0.2.19"