From fb8481b4d745d55ae863ae6d37a2f2d78bdd6b5a Mon Sep 17 00:00:00 2001 From: kclem Date: Wed, 27 Aug 2025 17:50:31 -0600 Subject: [PATCH] Force cloned include_idxs to be np.arrays (otherwise breaks downstream batch processing) --- CRISPResso2/CRISPRessoCORE.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CRISPResso2/CRISPRessoCORE.py b/CRISPResso2/CRISPRessoCORE.py index b79d9198..26bea954 100644 --- a/CRISPResso2/CRISPRessoCORE.py +++ b/CRISPResso2/CRISPRessoCORE.py @@ -3010,8 +3010,8 @@ def get_prime_editing_guides(this_amp_seq, this_amp_name, ref0_seq, prime_edited 'exon_len_mods': this_exon_len_mods, 'exon_intervals': this_exon_intervals, 'splicing_positions': this_splicing_positions, - 'include_idxs': this_include_idxs, - 'exclude_idxs': this_exclude_idxs, + 'include_idxs': np.array(this_include_idxs), + 'exclude_idxs': np.array(this_exclude_idxs), 'idx_cloned_from': None, 'fw_seeds': seeds, 'rc_seeds': rc_seeds, @@ -3183,7 +3183,7 @@ def get_prime_editing_guides(this_amp_seq, this_amp_name, ref0_seq, prime_edited refs[ref_name]['sgRNA_mismatches'] = this_sgRNA_mismatches refs[ref_name]['sgRNA_orig_sequences'] = refs[clone_ref_name]['sgRNA_orig_sequences'] refs[ref_name]['sgRNA_names'] = refs[clone_ref_name]['sgRNA_names'] - refs[ref_name]['include_idxs'] = this_include_idxs + refs[ref_name]['include_idxs'] = np.array(this_include_idxs) refs[ref_name]['contains_guide'] = refs[clone_ref_name]['contains_guide'] #quantification window coordinates override other options @@ -3199,8 +3199,8 @@ def get_prime_editing_guides(this_amp_seq, this_amp_name, ref0_seq, prime_edited #subtract any indices in 'exclude_idxs' -- e.g. in case some of the cloned include_idxs were near the read ends (excluded) this_exclude_idxs = sorted(map(int, set(refs[ref_name]['exclude_idxs']))) this_include_idxs = sorted(map(int, set(np.setdiff1d(this_include_idxs, this_exclude_idxs)))) - refs[ref_name]['include_idxs'] = this_include_idxs - refs[ref_name]['exclude_idxs'] = this_exclude_idxs + refs[ref_name]['include_idxs'] = np.array(this_include_idxs) + refs[ref_name]['exclude_idxs'] = np.array(this_exclude_idxs) if needs_exon_positions and clone_has_exons: this_exon_positions = set()