Obtaining only the aligned regions in BLAST
0
0
Entering edit mode
8.1 years ago
arya ▴ 10

Hello I have a subject nucleotide sequence which I would like to align to various complete genomes. I am using standalone blastn for the same. Can someone pls tell me how I can retrieve the aligned regions in a separate file. Thanks

blast blastn standaloneblast • 2.8k views
ADD COMMENT
0
Entering edit mode
blastn -help

Check the formatting options

ADD REPLY
0
Entering edit mode

add sseq to output format. -outfmt '6 std sseq'. for more details get the full help as mentioned by @5heikki

ADD REPLY
0
Entering edit mode

Thank you! But from the above output format we will get the positions of the aligned regions alone in the genome. Is there any way to obtain the sequence in a separate file?

ADD REPLY
0
Entering edit mode

From the above you should get 13 column output where the last column displays aligned subject sequence. If you're on Windows, use -outfmt "6 std sseq" instead of -outfmt '6 std sseq'

ADD REPLY
0
Entering edit mode

Assuming your BLAST output goes into a file called blastout.tsv and you used -outfmt '6 std sseq' , then

cut -f 2,13 blastout.tsv | awk '{printf(">%s\n%s\n", $1, $2); }' > blastout.aligned.fasta

should do the trick (not on Windows, unless you're using Cygwin or something similar).

ADD REPLY

Login before adding your answer.

Traffic: 1653 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6