From b816065bac15fb4af138b2e97998b18a28a1cfac Mon Sep 17 00:00:00 2001 From: silastittes Date: Tue, 30 Jul 2024 11:51:44 -0700 Subject: [PATCH] more updates based on code review --- workflows/ts2fs.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/workflows/ts2fs.py b/workflows/ts2fs.py index c7059e3..b8a1d24 100644 --- a/workflows/ts2fs.py +++ b/workflows/ts2fs.py @@ -93,6 +93,8 @@ def f(x): # apply masks if mask_file is not None: mask_intervals = masks.get_mask_from_file_dfe(mask_file, chrm) + assert mask_intervals.shape[1] == 2 + mask_length = sum([interval[1] - interval[0] for interval in mask_intervals]) ts = ts.delete_intervals(mask_intervals) # grab coding regions @@ -105,7 +107,7 @@ def f(x): non_neutral_anc_count += exon_len * nonneu_prop neutral_anc_count += exon_len * neutral_prop else: - seq_len += chrom_length + seq_len += chrom_length - mask_length non_neutral_anc_count += chrom_length * nonneu_prop neutral_anc_count += chrom_length * neutral_prop