This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Extracting fasta sequences from headers

Hi all,

I have a list of fasta headers:

>Strain1_XX
>Strain2_YY
>Strain3_ZZ

I have a multifasta file:

>Strain1_XX
AAAA
>Strain2_YY
AAAA
>Strain3_ZZ
AAAA

And I would like to extract specifically the strain number 2 meaning its fasta sequence + headers.

I tried using awk because I know how powerful this tool is but I can't seemed to find how to do it.

If you have any ideas, the help would be so appreciated.

Thank you!

fasta

faSomeRecords utility from Jim Kent would likely be the fastest option, if you have an exact list of headers you want to pull sequences for. If you need to extract based on some pattern then seqkit grep would likely be the choice.

Please search biostars for past answers for both.

This is quite possibly the most asked question on the forum. Please use the search bar or the related posts pane on the right to find number of similar threads which will work for you.

Hello Audrey!

We believe that this post does not fit the main topic of this site.

This question has been asked and answered a number of times on the forum. Please try searching using Google before creating new posts on forums.

For this reason we have closed your question. This allows us to keep the site focused on the topics that the community can help with.

If you disagree please tell us why in a reply below, we'll be happy to talk about it.

Cheers!

0 answers

No answers yet.

Log in to answer this question.