From 0484ace9f78236be513594171948965cf6de6021 Mon Sep 17 00:00:00 2001 From: Danila Bredikhin Date: Wed, 7 Jun 2023 12:45:12 +0400 Subject: [PATCH] Fix ac.tl.nucleosome_signal (#105) --- muon/_atac/tools.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/muon/_atac/tools.py b/muon/_atac/tools.py index b0e1c2a..a58d0f3 100644 --- a/muon/_atac/tools.py +++ b/muon/_atac/tools.py @@ -1153,14 +1153,14 @@ def nucleosome_signal( for i in tqdm(range(n), desc="Reading Fragments"): try: - f = fr.next() + f = next(fr) length = f.end - f.start row_ind = d[f.name] if length < nucleosome_free_upper_bound: mat[row_ind, 0] += 1 elif length < mononuleosomal_upper_bound: mat[row_ind, 1] += 1 - except: + except KeyError: pass # if i % 1000000 == 0: # print(f"Read {i/1000000} Mio. fragments.", end='\r')