Skip to content

Commit

Permalink
formatting, bugfix, remove prints
Browse files Browse the repository at this point in the history
  • Loading branch information
kedhammar committed May 29, 2024
1 parent ff0e531 commit c310094
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
3 changes: 2 additions & 1 deletion anglerfish/anglerfish.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,8 @@ def run_demux(args):
sample_dists = [
(
lev.distance(
i[0], f"{x.adaptor.i7.index_seq}+{x.adaptor.i5.index_seq}".lower()
i[0],
f"{x.adaptor.i7.index_seq}+{x.adaptor.i5.index_seq}".lower(),
),
x.sample_name,
)
Expand Down
13 changes: 4 additions & 9 deletions anglerfish/demux/adaptor.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ class AdaptorPart:

def __init__(self, sequence_token: str, name: str, index_seq: str | None):
# Assign attributes from args
print(name, sequence_token, index_seq)
self.sequence_token: str = sequence_token
self.name: str = name
self.index_seq: str | None = index_seq
Expand Down Expand Up @@ -133,14 +132,13 @@ def __init__(self, sequence_token: str, name: str, index_seq: str | None):
self.len_umi_before_index = 0
self.len_umi_after_index = 0
self.len_before_index = len(split_by_index[0])
self.len_after_index = len(split_by_index[1])
self.len_after_index = len(split_by_index[-1])

elif not self.has_index and self.has_umi:
# No index, UMI
self.len_umi_before_index = None
self.len_umi_after_index = None
self.len_before_index = len(split_by_index[0])
self.len_after_index = len(split_by_index[1])
raise UserWarning(
f"Adaptor {self.name} has UMI but no index. This is not supported."
)

else:
# No index, no UMI
Expand All @@ -149,9 +147,6 @@ def __init__(self, sequence_token: str, name: str, index_seq: str | None):
self.len_before_index = None
self.len_after_index = None

# Sanity check
print(self.__dict__)

def get_mask(self, insert_Ns: bool = True) -> str:
"""Get the mask of the adaptor part.
Expand Down

0 comments on commit c310094

Please sign in to comment.