From 2ef5083d5ca30ba5517ec5283cc436597518029b Mon Sep 17 00:00:00 2001 From: Austin Wang Date: Wed, 5 Nov 2025 21:00:00 -0500 Subject: [PATCH] Handle bigwig indexing at chromosome edges --- src/finemo/data_io.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/finemo/data_io.py b/src/finemo/data_io.py index d5b119a..a0e0092 100644 --- a/src/finemo/data_io.py +++ b/src/finemo/data_io.py @@ -107,7 +107,7 @@ def load_regions_from_bw(peaks, fa_path, bw_paths, half_width): sequences[ind,:,a:b] = one_hot_encode(sequence) for j, bw in enumerate(bws): - contrib_buffer[j,:] = np.nan_to_num(bw.values(chrom, start_adj, end_adj, numpy=True)) + contrib_buffer[j,a:b] = np.nan_to_num(bw.values(chrom, start_adj, end_adj, numpy=True)) contribs[ind,a:b] = np.mean(contrib_buffer, axis=0)