title: Search for characters string in a DNA sequence
body: <p>I'm trying to look at certain patterns of nucleotide in a gene sequence. I've just done <code>read.table</code> to get it in but I've tried converting it to vectors and data frames as well.</p>
  
  <p>How do I search for a pattern (such as <code>AACG</code>) or even just a single nucleotide character? I've tried <code>grep</code> and <code>%in%</code> but those are returning null results. It's probably something relatively simple I'm overlooking.</p>
  
  <p>This is how I'm getting the data into the program. It's a huge file; 20,347 letters, all <code>ACTG</code>.</p>
  
  <pre><code>data &lt;- read.table(MTHFR.txt) 
  </code></pre>
  
  <p>I've been trying to get it into a character vector this way;</p>
  
  <pre><code>data.cv &lt;- as.character(data)
  </code></pre>
  
  <p>But that's creating a list of what appears to be row numbers, instead of the sequence of nucleotides.</p>
  
  <p>The <strong>data</strong> is available <a href="https://www.ncbi.nlm.nih.gov/nuccore/NC_000001.11?report=fasta&amp;from=11785730&amp;to=11806103&amp;strand=true" rel="nofollow noreferrer">online here</a>. As of right now this is what the head of the data is:</p>
  
  <pre><code>head(data)
                                                                        V1
  1 ATGACGATAAAGGCACGGCCTCCAACGAGACCTGTGGGCACGGCCATGTTGGGGGCGGGGCTTCCGGTCA
  2 CCCGCGCCGGTGGTTTCCGCCCTGTAGGCCCGCCTCTCCAGCAACCTGACACCTGCGCCGCGCCCCTTCA
  3 CTGCGTTCCCCGCCCCTGCAGCGGCCACAGTGGTGCGGCCGGCGGCCGAGCGTTCTGAGTCACCCGGGAC
  4 TGGAGGGTGAGTGACGGCGAGGCCGGGGTCGCCGGGAGGGAGATCCTGGAGCCGGCAAACAACCTCCCGG
  5 GGGCAAGGACGTGCTTGTGGGCGGGGAGCGCTGGAGGCCGGCCTGCCTCTCTTCTTGGGGGGGGCTGCCG
  6 CCTCCCTTGCGCACCCTTCGCGGGATTAGTGTAACTCCCAATGGCTACCACTTCCAGCGACCGCCAACCC
  </code></pre>