This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to get blast tabular output

Hi everyone, i am using bioperl to do blast 2 sequence. I need to output as a tabular format. I saw some post where they mention we need to use -m8 to get tabular output. But in my code its not working. Can anyone help me out what i am missing in this code.

use Bio::Tools::Run::StandAloneBlastPlus;
#use Excel::Writer::XLSX;
use strict;
use Bio::SearchIO;

my $factory = Bio::Tools::Run::StandAloneBlastPlus->new(
    -db_data =>'test.fasta', # Specifies the file to use for database
    -create =>1 # Creates a new temporary database
    );
my $result = $factory->blastn(
    -query =>'H1.fasta', # Specifies the query file
    -outfmt => -m8,
    -outfile =>'out_H1' # Specifies the output location
    ); 
$factory->cleanup; # Deletes the temporary database files

blast

2 answers

-m 8 is for pre-blast+ (legacy blast), in your code you seem to be using blast+ so -outfmt 6 is the correct flag for tabular output.

As far as I remember the -outfmt 6 stands for tabular output. See Blast - Formatting Output

@mikhail You can write this as answer not a comment ;)

Well I have not checked this code actually ("my code its not working"), so I don't know if the OP has any other issues and just wrote a quick suggestion :)

@mikhail... After I answered the OP question , I realized it was exactly like yours ... So, I deleted it after posting although I'm almost sure it's the correct answer !!

Good luck with up voted answers ;)

Log in to answer this question.