Skip to content

Commit

Permalink
fix edgecase for .sl(gap), fix copy for now
Browse files Browse the repository at this point in the history
  • Loading branch information
trichter committed Oct 24, 2024
1 parent a69a968 commit 856f335
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion sugar/core/seq.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ class _BioSeqStr():
def __init__(self, parent):
self.__parent = parent

def __deepcopy__(self, orig):
# TODO test
return self


def center(self, width, *args):
self.__parent.data = self.__parent.data.center(width, *args)
return self.__parent
Expand Down Expand Up @@ -456,7 +461,7 @@ def getitem(self, index, inplace=False, gap=None):
if gap is not None:
# from bisect import bisect
nogaps = [i for i, nt in enumerate(self.data) if nt not in gap]
adj = lambda i: nogaps[i] if i is not None else None
adj = lambda i: nogaps[i] if i is not None and i < len(nogaps) else None
if isinstance(index, int):
index = adj(index)
elif isinstance(index, slice):
Expand Down

0 comments on commit 856f335

Please sign in to comment.