This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Is there any format specifier in BLAST+ which enables to get full length of fasta sequences (subject) in the output along with other specifiers?

Hi,

I am using blast+ and have a database of thousands of protein sequences. Could you please tell me how to get the entire length of every sequence in the output file along with other specifiers. I tried with sseqid but it gives out only the ids not the entire sequence.

sequence blast alignment

3 answers

What about sseq (means Aligned part of subject sequence)? Have you checked the "Formatting options" in blast help?

Thank you so much :) exactly what I was looking for.

I'm not sure I follow exactly what it is you want to achieve...

Do you want to extract the sequences in fasta format or do you just want the lengths of the sequences?

If you want the fasta sequences, my recommendation would be to parse the output file and write the ID's of the sequences you want to extract to a new file. Then, you can use blastdbcmd with the ID list as input to extract all the sequences.

If you only want to have the lengths of the sequences displayed, you could use the flag -outfmt to format your output to include the information you want.

Example:

blastp -db <database> -query <input sequences> -out <output file> -outfmt '7 stitle sacc bitscore pident qlen SLEN'

slen (subject len) will list the length of the sequence your input has hit.

blastp -help

Log in to answer this question.