<pre><code>import Bio
from Bio.Seq import Seq
my_seq = Seq(&quot;aaaaaaaaaaatttttttttttgaattccccccccccggggggggggg&quot;)
from Bio.Restriction import *
print(EcoRI.search(my_seq))
print(EcoRI.catalyse(my_seq))
</code></pre>
<blockquote>
<p>Actully the EcoRI cuts the DNA after G in restriction site GAATTC.</p>
</blockquote>

CC BY-SA 4.0
2020-11-10T12:22:25.473Z
Okay my apologies, optical analysis is one of the reasons why bioinformatics is so important. You can mark your post as 'accepted'.
M__
CC BY-SA 4.0
2020-11-10T04:25:06.340Z
2020-11-10T04:25:06.340Z
amardeep
<p>Seq =
AAAAAAAAAAATTTTTTTTTTTGAATTCCCCCCCCCCCGGGGGGGGGGG</p>
<p>Restriction site = GAATTC</p>
<p>I want to cut the sequence at GA/ATTC</p>
<p>I tried split method in python but It does not cut at GA/ATTC.
Please help</p>

CC BY-SA 4.0
2020-11-08T12:06:31.357Z
Have you looked up the documentation on working with restriction enzymes in biopython? http://biopython.org/DIST/docs/cookbook/Restriction.html#1.3
Devon Ryan
CC BY-SA 4.0
2020-11-08T13:44:16.373Z
Nice documentation It really helped me. Thanks.
amardeep
CC BY-SA 4.0
2020-11-08T14:01:28.127Z
If you're able to do this after actually reading the documentation then please post a working example as an answer for others.
Devon Ryan
CC BY-SA 4.0
2020-11-10T06:03:19.717Z
The obvious bare native Python `'AAAAAAAAAAATTTTTTTTTTTGAATTCCCCCCCCCCCGGGGGGGGGGG'.split('GAATTC')` produces what I expect.
tripleee
CC BY-SA 4.0
2020-11-10T14:45:27.303Z
@tripleee, your solution would not reflect the "true biology" The restriction enzyme cuts within the recognized bases and the two resulting fragments would contain a part (different parts obviously) of the restriction site.
haci
<python>
I want to write python program to cut a DNA sequence at an EcoRI restriction site and print the two fragments after cutting
# I want to write python program to cut a DNA sequence at an EcoRI restriction site and print the two fragments after cutting

(Asked by: username_0 on 2020-11-08)

Seq =
AAAAAAAAAAATTTTTTTTTTTGAATTCCCCCCCCCCCGGGGGGGGGGG

Restriction site = GAATTC

I want to cut the sequence at GA/ATTC

I tried split method in python but It does not cut at GA/ATTC.
Please help

**Tags:** python
> **Comments:**
> **username_1**: Have you looked up the documentation on working with restriction enzymes in biopython? http://biopython.org/DIST/docs/cookbook/Restriction.html#1.3  
> **username_0**: Nice documentation It really helped me. Thanks.  
> **username_1**: If you're able to do this after actually reading the documentation then please post a working example as an answer for others.  
> **username_2**: The obvious bare native Python `'AAAAAAAAAAATTTTTTTTTTTGAATTCCCCCCCCCCCGGGGGGGGGGG'.split('GAATTC')` produces what I expect.  
> **username_3**: @tripleee, your solution would not reflect the "true biology" The restriction enzyme cuts within the recognized bases and the two resulting fragments would contain a part (different parts obviously) of the restriction site.  

---

## 1 answers

### Answer by username_0 on 2020-11-10. Score: 3 | Accepted answer

import Bio
from Bio.Seq import Seq
my_seq = Seq("aaaaaaaaaaatttttttttttgaattccccccccccggggggggggg")
from Bio.Restriction import *
print(EcoRI.search(my_seq))
print(EcoRI.catalyse(my_seq))


Actully the EcoRI cuts the DNA after G in restriction site GAATTC.

> **Comments:**
> **username_4**: Okay my apologies, optical analysis is one of the reasons why bioinformatics is so important. You can mark your post as 'accepted'.  

---

