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

Overlapping restriction enzymes gives a value error. #224

Open
BjornFJohansson opened this issue Apr 30, 2024 · 2 comments
Open

Overlapping restriction enzymes gives a value error. #224

BjornFJohansson opened this issue Apr 30, 2024 · 2 comments

Comments

@BjornFJohansson
Copy link
Owner

from Bio.Restriction import AatII, ZraI
from pydna.dseq import Dseq

s = Dseq("GACGTC")

s.cut(AatII)

# (Dseq(-5)
#  GACGT
#  C,
#  Dseq(-5)
#      C
#  TGCAG)

s.cut(ZraI)

# (Dseq(-3)
#  GAC
#  CTG,
#  Dseq(-3)
#  GTC
#  CAG)

s.cut(AatII + ZraI)

# ValueError: Cuts overlap

@manulera
Copy link
Collaborator

manulera commented Apr 30, 2024

Hi @BjornFJohansson yes, I added this in the PR about cutsites, the tests for the feature are here:

https://github.com/BjornFJohansson/pydna/blob/989e76eec0e46775aac7df1cab7c957834117608/tests/test_module_dseq.py#L876C46-L930C17

Shouldn't this be the desired behaviour? Or you mean that it should return a different type of error?

@BjornFJohansson
Copy link
Owner Author

BjornFJohansson commented Apr 30, 2024

Not sure yet, This is what happens in the old version. This is not
good as it actually hides the problem.

(n39) bjorn@bjorn-ThinkPad-T450s:~$ python
Python 3.9.19 | packaged by conda-forge | (main, Mar 20 2024, 12:50:21) 
[GCC 12.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from Bio.Restriction import AatII, ZraI
>>> from pydna.dseq import Dseq
>>> s = Dseq("GACGTC")
>>> s.cut(AatII)
(Dseq(-5)
GACGT
C, Dseq(-5)
    C
TGCAG)
>>> s.cut(ZraI)
(Dseq(-3)
GAC
CTG, Dseq(-3)
GTC
CAG)
>>> s.cut(AatII + ZraI)
(Dseq(-3)
GAC
CTG, Dseq(-3)
GTC
CAG)
>>> s.cut(ZraI+AatII)
(Dseq(-3)
GAC
CTG, Dseq(-3)
GTC
CAG)
>>> s.cut(ZraI,AatII)
(Dseq(-3)
GAC
CTG, Dseq(-3)
GTC
CAG)
>>> s.cut(AatII, ZraI)
(Dseq(-5)
GACGT
C, Dseq(-5)
    C
TGCAG)
>>> import pydna
>>> pydna.__version__
'5.2.0'
>>> 

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

2 participants