title: Multifasta file header trimming
body: <p>I have a Multi-fasta file, and I want to delete specific parts of the headers for every fasta header in the file. For example:</p>
  <pre><code>&gt;Viridibacillus_arenosi_FSL_R5_0213-BK137_RS04360-22-CBS_domain-containing_protein &lt;unknown description&gt;
  GCTAATGAAGTTATTGGCCTAGTGACAGAAAGGGATATAAAAAACGCGCTTCCTTCTTCC
  CTGCTC------AAA
  &gt;Viridibacillus_arvi_DSM16317-AMD00_RS08865-16-acetoin_utilization_protein_AcuB &lt;unknown description&gt;
  GCGAATGAAGTTATTGGCCTAGTAACAGAAAGGGATATAAAAAACGCCCTTCCATCTTCC
  CTGCTC------AAA
  </code></pre>
  <p>I want to delete the parts after &quot;-&quot; in the header that is <code>-BK137_RS04360-22-CBS_domain-containing_protein &lt;unknown description&gt;</code> and <code>-AMD00_RS08865-16-acetoin_utilization_protein_AcuB &lt;unknown description&gt;</code>.</p>
  <p>I tried</p>
  <pre><code> cut -d '-' -f 1 your_file.fasta &gt; new_file.fasta
  </code></pre>
  <p>and</p>
  <pre><code> awk '{split($0,a,&quot;-&quot;); if(a[1]) print &quot;&gt;&quot;a[1]; else print; }' my_file.fasta &gt; new_file.fasta
  </code></pre>
  <p>But this is an alignment file, and it removed the <strong>&quot;-&quot;</strong> in my sequence as well, which of course I don't want.</p>
  <p>My expected output is:</p>
  <pre><code>&gt;Viridibacillus_arenosi_FSL_R5_0213
  GCTAATGAAGTTATTGGCCTAGTGACAGAAAGGGATATAAAAAACGCGCTTCCTTCTTCC
  CTGCTC------AAA
  &gt;Viridibacillus_arvi_DSM16317-AMD00_RS08865
  GCGAATGAAGTTATTGGCCTAGTAACAGAAAGGGATATAAAAAACGCCCTTCCATCTTCC
  CTGCTC------AAA
  </code></pre>