Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-11-01T14:58:35.130Z
Answers.LastActivityDate: 2022-11-01T14:58:35.130Z
Answers.UserDisplayName: Pallie
Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-11-01T22:17:59.073Z
Answers.LastActivityDate: 2022-11-01T22:17:59.073Z
Answers.UserDisplayName: stefanH
Body: <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>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-11-01T14:34:31.607Z
Comments.Text: 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.
Comments.UserDisplayName: M__
Tags: <python><r><linux><fasta>
Title: How to find restriction enzyme frequency in whole genome and count the distance between them?
ThreadText: # 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.
  
  
  ---
  
  