diff --git a/anglerfish/demux/adaptor.py b/anglerfish/demux/adaptor.py index a6b271e..e662d5b 100644 --- a/anglerfish/demux/adaptor.py +++ b/anglerfish/demux/adaptor.py @@ -139,7 +139,9 @@ def get_mask(self, insert_Ns: bool = True) -> str: insert_Ns = True -> Returns the sequence with index and UMI tokens replaced with Ns of the correct length insert_Ns = False -> Returns the sequence without index and UMI tokens """ - index_length = len(self.index_seq) if self.index_seq is not None and insert_Ns else 0 + index_length = ( + len(self.index_seq) if self.index_seq is not None and insert_Ns else 0 + ) umi_length = ( max(self.len_umi_after_index, self.len_umi_before_index) if insert_Ns else 0 ) diff --git a/anglerfish/demux/kladd.py b/anglerfish/demux/kladd.py deleted file mode 100644 index ede5191..0000000 --- a/anglerfish/demux/kladd.py +++ /dev/null @@ -1,16 +0,0 @@ - -attrs = ["name", -"sequence_token", -"index", -"has_index", -"len_index", -"len_before_index", -"len_after_index", -"has_umi", -"len_umi", -"len_umi_before_index", -"len_umi_after_index",] - -for attr in attrs: - e = eval(f"self.{attr}") - print(f"self.{attr} = {e}") \ No newline at end of file diff --git a/anglerfish/demux/samplesheet.py b/anglerfish/demux/samplesheet.py index 27bbc8a..90adbe5 100644 --- a/anglerfish/demux/samplesheet.py +++ b/anglerfish/demux/samplesheet.py @@ -125,7 +125,9 @@ def minimum_bc_distance(self) -> int: testset[ont_barcode] = [] for adaptor in adaptors: if adaptor.i5.has_index: - testset[ont_barcode].append(adaptor.i5.index_seq + adaptor.i7.index_seq) + testset[ont_barcode].append( + adaptor.i5.index_seq + adaptor.i7.index_seq + ) else: testset[ont_barcode].append(adaptor.i7.index_seq) diff --git a/anglerfish/explore/explore.py b/anglerfish/explore/explore.py index 1e11219..83c2f4f 100644 --- a/anglerfish/explore/explore.py +++ b/anglerfish/explore/explore.py @@ -106,12 +106,8 @@ def run_explore( ): if adaptor_end.has_index: # Alignment thresholds - before_thres = round( - adaptor_end.len_before_index * good_hit_threshold - ) - after_thres = round( - adaptor_end.len_after_index * good_hit_threshold - ) + before_thres = round(adaptor_end.len_before_index * good_hit_threshold) + after_thres = round(adaptor_end.len_after_index * good_hit_threshold) insert_thres_low = insert_thres_low insert_thres_high = insert_thres_high @@ -139,10 +135,7 @@ def run_explore( ) thres = round( - ( - adaptor_end.len_before_index - + adaptor_end.len_after_index - ) + (adaptor_end.len_before_index + adaptor_end.len_after_index) * good_hit_threshold ) df_good_hits = df_good_hits[df_good_hits["match_1_len"] >= thres]