Skip to content

Commit

Permalink
Update jabba.py
Browse files Browse the repository at this point in the history
  • Loading branch information
chenxinye committed Jul 9, 2024
1 parent 00d0f59 commit 0748593
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fABBA/jabba/jabba.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def symbolsAssign(clusters, alphabet_set=0):
labels to symbols, repectively.
"""
N = len(clusters.unique())

if alphabet_set == 0:
alphabets = ['A','a','B','b','C','c','D','d','E','e',
Expand All @@ -68,7 +69,7 @@ def symbolsAssign(clusters, alphabet_set=0):
'w', 'x', 'y', 'z']

elif isinstance(alphabet_set, list):
if len(clusters) <= len(alphabet_set):
if N <= len(alphabet_set):
alphabets = alphabet_set
else:
raise ValueError("Please ensure the length of ``alphabet_set`` is greatere than ``clusters``.")
Expand All @@ -81,7 +82,6 @@ def symbolsAssign(clusters, alphabet_set=0):
'W', 'X', 'Y', 'Z']

clusters = pd.Series(clusters)
N = len(clusters.unique())

cluster_sort = [0] * N
counter = collections.Counter(clusters)
Expand Down

0 comments on commit 0748593

Please sign in to comment.