Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Customizing output of BLAST?

I know this is a very specific question relating to BLAST and Bioinformatics but here goes:

I am attempting to use standalone BLAST (I already have downloaded it and tested it running on the command line) to perform a DNA sequence alignment (blastn). I need to be able to provide both my own query file (fasta format) and my own database file (also fasta format).

The key is that I want to have the program only output 2 fields rather than the detailed reports that it usually outputs. I only want the highest score and the e-value for the alignment to be output. The idea is that once I have this working, I can wrap this in my own control program and automatically run it many times with different query sequences and log the scores and e-values.

I know this is a long shot, but does anybody have an idea on how I can go about doing this? The two hurdles for me are using my own database file and customizing the output.

like image 908
oym Avatar asked Dec 29 '25 02:12

oym


1 Answers

in fact it's simple: blastall has several command line option that will help you:

  • to output only the single strongest hit for each query: -v 1 -b 1
  • to output in table format: -m 8

so you'll be running something like this:

blastall -p blastn -i queries.fasta -d database -v1 -b1 -m8 > resultTable.txt

The table output has several columns however. I don't recall the order of columns, but you can use the cut tool to select only your columns of interest. For example the following command would select only columns 1, 7 and 8 from the blastoutput

cut -d '\t' -f 1,7,8 < resultTable.txt

yannick

like image 130
Yannick Wurm Avatar answered Jan 01 '26 10:01

Yannick Wurm



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!