<p>Biopython has a module dedicated to working with <a href="http://biopython.org/DIST/docs/cookbook/Restriction.html" rel="nofollow noreferrer">restriction enzymes</a>. Without any code examples we cannot help you much further.</p>

CC BY-SA 4.0
2022-11-01T14:58:35.130Z
2022-11-01T14:58:35.130Z
Pallie
<p>The <code>diffHic</code> package might have solved this issue in R.</p>
<pre><code># Load the genomic data
genome &lt;- biostrings::readDNAStringSet(&quot;your_file.fa&quot;)

# Run the in silico restriction digest 
cuts &lt;- cutGenome(genome, &quot;CCGCGG&quot;, overhang=2L) # SacII
</code></pre>
<p>the <code>cuts</code> GRanges object contains the boundaries of each restriction fragment for given genome.</p>

CC BY-SA 4.0
2022-11-01T22:17:59.073Z
2022-11-01T22:17:59.073Z
stefanH
<p>I am having possibly a simple question which is proving difficult.</p>
<p>My objective is to take the reference FASTA file and flat file database with 1500 restriction enzymes with its cutting sites (mostly pattern I would say).</p>
<ol>
<li>I first want to see that how many times each enzyme cut the FASTA file and;</li>
<li>second to check the number and size of fragment that each enzyme would give me, this output pregerably would be a CSV file may be.</li>
</ol>
<p><strong>Background</strong> I tried to do pattern search using R, but its just collapsing my system. I am looking for bash command may be.</p>

CC BY-SA 4.0
2022-11-01T14:34:31.607Z
This looks like the RAM load of the reg-ex in R. Bash isn't the best for reg-ex style commands IMO, Python can do this, I would assume awk too, and dare I say Perl is really good.
M__
<python><r><linux><fasta>
How to find restriction enzyme frequency in whole genome and count the distance between them?
# How to find restriction enzyme frequency in whole genome and count the distance between them?

(Asked by: username_0 on 2022-11-01)

I am having possibly a simple question which is proving difficult.

My objective is to take the reference FASTA file and flat file database with 1500 restriction enzymes with its cutting sites (mostly pattern I would say).

1. I first want to see that how many times each enzyme cut the FASTA file and;
2. second to check the number and size of fragment that each enzyme would give me, this output pregerably would be a CSV file may be.

**Background** I tried to do pattern search using R, but its just collapsing my system. I am looking for bash command may be.

**Tags:** python, r, linux, fasta
> **Comments:**
> **username_1**: This looks like the RAM load of the reg-ex in R. Bash isn't the best for reg-ex style commands IMO, Python can do this, I would assume awk too, and dare I say Perl is really good.  

---

## 2 answers

### Answer by username_2 on 2022-11-01. Score: 2

Biopython has a module dedicated to working with [restriction enzymes](http://biopython.org/DIST/docs/cookbook/Restriction.html). Without any code examples we cannot help you much further.


---

### Answer by username_3 on 2022-11-01. Score: 2

The diffHic package might have solved this issue in R.
# Load the genomic data
genome <- biostrings::readDNAStringSet("your_file.fa")

# Run the in silico restriction digest 
cuts <- cutGenome(genome, "CCGCGG", overhang=2L) # SacII

the cuts GRanges object contains the boundaries of each restriction fragment for given genome.


---

