This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Extracting the aligned sequence from a BLAST output in a multi-fasta file

Dear All,

I am trying to extract the aligned sequences from my query search from a BLAST output in a single multi-fasta file. How do I go about doing so?

Thank you in advanced.

blast

1 answer

What is your blast output format? and which sequences you want to extract? queries or subjects?

If your output format is 6 (outfmt 6), you can use the information of query/subject names and query/subject positions.

For example, if you need to extract the positions of the subjects that show any match, you can cut the columns of subject name (2), subject start (9) and subject end (10), and use this information in Bedtools (https://bedtools.readthedocs.io/en/latest/content/tools/getfasta.html)

If you need all-region (independent of alignment region) you can retrieve the name of sequences and use the seqtk tool (Seqtk subseq: structure of file name.lst)

Probably are solutions more efficient, but I'm still a beginner in bioinformatics.

@flogin, thank you very much for pushing me in the correct direction!

You're welcome !!! :D

Log in to answer this question.