Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when extracting composed features from overhangs #181

Open
manulera opened this issue Jan 19, 2024 · 0 comments
Open

Error when extracting composed features from overhangs #181

manulera opened this issue Jan 19, 2024 · 0 comments
Assignees
Labels

Comments

@manulera
Copy link
Collaborator

manulera commented Jan 19, 2024

Not a priority to fix, but still a bug.

seq = Dseq.from_full_sequence_and_overhangs('AATTAA', 2, 2)
print(seq.__repr__())

# Extract simple features
loc = SimpleLocation(0, 2, strand=1)
print(loc, loc.extract(seq))
loc = SimpleLocation(0, 2, strand=-1)
print(loc, loc.extract(seq))


# Extract composed feature where there is no overhang
loc = SimpleLocation(2, 3, strand=1) + SimpleLocation(3, 4, strand=1)
print(loc, loc.extract(seq))
# Raises error on overhang
loc = SimpleLocation(0, 1, strand=1) + SimpleLocation(1, 2, strand=1)
print(loc, loc.extract(seq))

returns

Dseq(-6)
  TTAA
TTAA
[0:2](+) AA
[0:2](-) TT
join{[2:3](+), [3:4](+)} TT
Traceback (most recent call last):
  File "/Users/Manu/Documents/OpenSource/pydna/dummy.py", line 78, in <module>
    print(loc, loc.extract(seq))
               ^^^^^^^^^^^^^^^^
  File "/Users/Manu/Documents/OpenSource/pydna/.venv/lib/python3.11/site-packages/Bio/SeqFeature.py", line 1774, in extract
    f_seq = functools.reduce(lambda x, y: x + y, parts)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/Manu/Documents/OpenSource/pydna/.venv/lib/python3.11/site-packages/Bio/SeqFeature.py", line 1774, in <lambda>
    f_seq = functools.reduce(lambda x, y: x + y, parts)
                                          ~~^~~
  File "/Users/Manu/Documents/OpenSource/pydna/src/pydna/dseq.py", line 1049, in __add__
    raise TypeError("sticky ends not compatible!")
TypeError: sticky ends not compatible!
@manulera manulera added the bug label Jan 19, 2024
@manulera manulera self-assigned this Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant