text: user7236: I have a fasta file and the sequences in them are arranged like this:
  >chr8:106028475-106028517()
  GTaccaggcctagggttgcactcctgtagtctcagcattggg
  >chr8:106040430-106040472()
  TAACCGGCTCTCCGCTGCCCTCATCTGTCTAGAATTCAGGTA
  >chr9:100245605-100245648()
  TACCACCTCCCTCACTCTTTCCCAAATTTATGAGTTAGGCTAT
  
  I want to extract only those which begin with TA. so my final output should look like
  >chr8:106040430-106040472()
  TAACCGGCTCTCCGCTGCCCTCATCTGTCTAGAATTCAGGTA
  >chr9:100245605-100245648()
  TACCACCTCCCTCACTCTTTCCCAAATTTATGAGTTAGGCTAT
  
  Kindly help.
  
  user4980: seqmagick has a handy --seq-pattern-include feature that works similarly to what Kamil did with a regular grep.
  $ cat sequences.fasta 
  >chr8:106028475-106028517()
  GTaccaggcctagggttgcactcctgtagtctcagcattggg
  >chr8:106040430-106040472()
  TAACCGGCTCTCCGCTGCCCTCATCTGTCTAGAATTCAGGTA
  >chr9:100245605-100245648()
  TACCACCTCCCTCACTCTTTCCCAAATTTATGAGTTAGGCTAT
  
  $ seqmagick convert --seq-pattern-include "^TA" sequences.fasta -
  >chr8:106040430-106040472()
  TAACCGGCTCTCCGCTGCCCTCATCTGTCTAGAATTCAGGTA
  >chr9:100245605-100245648()
  TACCACCTCCCTCACTCTTTCCCAAATTTATGAGTTAGGCTAT
  
  It's a great little tool for this sort of thing built around Biopython, though it's been falling behind in compatibility with the latest versions as you can see from some of the open GitHub issues.
  
original_text: 7236: <p>I have a fasta file and the sequences in them are arranged like this:</p>
  <pre><code>&gt;chr8:106028475-106028517()
  GTaccaggcctagggttgcactcctgtagtctcagcattggg
  &gt;chr8:106040430-106040472()
  TAACCGGCTCTCCGCTGCCCTCATCTGTCTAGAATTCAGGTA
  &gt;chr9:100245605-100245648()
  TACCACCTCCCTCACTCTTTCCCAAATTTATGAGTTAGGCTAT
  </code></pre>
  <p>I want to extract only those which begin with TA. so my final output should look like</p>
  <pre><code>&gt;chr8:106040430-106040472()
  TAACCGGCTCTCCGCTGCCCTCATCTGTCTAGAATTCAGGTA
  &gt;chr9:100245605-100245648()
  TACCACCTCCCTCACTCTTTCCCAAATTTATGAGTTAGGCTAT
  </code></pre>
  <p>Kindly help.</p>
   4980: <p><a href="https://github.com/fhcrc/seqmagick" rel="nofollow noreferrer">seqmagick</a> has a handy <code>--seq-pattern-include</code> feature that works similarly to what Kamil did with a regular grep.</p>
  <pre><code>$ cat sequences.fasta 
  &gt;chr8:106028475-106028517()
  GTaccaggcctagggttgcactcctgtagtctcagcattggg
  &gt;chr8:106040430-106040472()
  TAACCGGCTCTCCGCTGCCCTCATCTGTCTAGAATTCAGGTA
  &gt;chr9:100245605-100245648()
  TACCACCTCCCTCACTCTTTCCCAAATTTATGAGTTAGGCTAT
  
  $ seqmagick convert --seq-pattern-include &quot;^TA&quot; sequences.fasta -
  &gt;chr8:106040430-106040472()
  TAACCGGCTCTCCGCTGCCCTCATCTGTCTAGAATTCAGGTA
  &gt;chr9:100245605-100245648()
  TACCACCTCCCTCACTCTTTCCCAAATTTATGAGTTAGGCTAT
  </code></pre>
  <p>It's a great little tool for this sort of thing built around Biopython, though it's been falling behind in compatibility with the latest versions as you can see from some of the open GitHub issues.</p>
  