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

Examples from Quickstart result in AttributeError #10

Open
pmaen opened this issue Aug 25, 2022 · 0 comments
Open

Examples from Quickstart result in AttributeError #10

pmaen opened this issue Aug 25, 2022 · 0 comments

Comments

@pmaen
Copy link

pmaen commented Aug 25, 2022

The first example from https://github.com/biosustain/co/blob/c2be2cf358bccb7ee775b52feeab78f948a61f27/docs/quickstart.rst

>>> from co import Component
>>> from co.mutation import *
>>> hello = Component('Hello X!')
>>> hello.seq
Seq('Hello X!', Alphabet())
>>> hello_world = hello.mutate([Mutation(6, 1, 'world')])
>>> hello_world.seq
Seq('Hello world!', Alphabet())

results in the following output/error:

Hello X!
/home/paul/.local/lib/python3.10/site-packages/Bio/Seq.py:1754: BiopythonDeprecationWarning: myseq.tomutable() is deprecated; please use MutableSeq(myseq) instead.
  warnings.warn(
Traceback (most recent call last):
  File "/home/paul/Desktop/testfile.py", line 5, in <module>
    hello_world = hello.mutate([Mutation(6, 1, 'world')])
  File "/home/paul/.local/lib/python3.10/site-packages/co/component.py", line 237, in mutate
    affected_features = features.overlap(mutation.position, mutation.end)
  File "/home/paul/.local/lib/python3.10/site-packages/co/feature.py", line 288, in overlap
    intersect = set(super(ComponentFeatureSet, self).overlap(start, end))
  File "/home/paul/.local/lib/python3.10/site-packages/co/feature.py", line 115, in overlap
    for f in sorted(self._features.search(start, end + 1)):
AttributeError: 'IntervalTree' object has no attribute 'search'
pmaen added a commit to pmaen/co that referenced this issue Aug 25, 2022
Ensure compatibility with latest `intervaltree` version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant