Trim long header and make it shorter

I have assembled contigs (more than 64000 contigs) with a long header. How can I make the header shorter using one of Galaxy’s tools? please

1 Like

Hi @Adnan

Thanks for posting publicly.

FAQ Fasta format

There are many ways to shorten or modify fasta title lines (what is on the > lines) … maybe try a few different ways to get exactly what you want.

Tips: Be sure that what remains for the >identifier content (not including anything after the first whitespace) will be unique within the file, or expect problems. Be aware that some tools will fail when any description content (whatever is after the first whitespace, if anything) is present, so that is enough for some people.

with the option to trim the header at the first whitespace

  • Good for preserving original >identifier content and removing excess trailing description content.

Text transformation with sed

  • The tool form has examples, or see the link outs for more.
  • Anchoring to title lines with ^> would probably be involved (line starts with a > character)

More manipulations, including several Replace function variations are here. Some may require tabular format, so: fasta > tabular > do stuff > fasta. Data Manipulation Olympics

1 Like

Dear jennaj,
Thank you so much for your attention to this matter. Your email was very helpful.
June 15,

‫في الجمعة، 16 يونيو 2023 في 12:43 ص تمت كتابة ما يلي بواسطة ‪Jennifer Hillman-Jackson via Galaxy Community Help‬‏ <‪‬‏>:‬