[Bioperl-l] formatdb with the nr database

Nagesh Chakka nagesh.chakka at anu.edu.au
Tue Jan 24 03:00:02 EST 2006


I could get the following code working. The only problem I had was with
using the method outfile which I defined differently.

#!/usr/local/bin/perl -w
BEGIN
{
  	$ENV{BLASTDIR}="/usr/local/blast/bin";
    	$ENV{BLASTDATADIR}= "/home/nagesh/blast/nr.00";  
}

use Bio::Tools::Run::StandAloneBlast;
use Bio::Seq;
use Bio::SeqIO;
use strict;



# parameters
my $expect_value = 20000;
#my $filter_query_sequence = 'F';
my $one_line_description = 1000;
my $alignments = 1000;
# my $strands = 1;
my $count = 1;
my @params = ('program' => 'blastp','database' => 'nr.00', 'outfile' =>
'temp.out');
#my $progress_interval = 100;


my $seqio_obj = Bio::SeqIO->new(
  -file   => "blastInput.txt",
  -format => "fasta",
);

# create factory object and set parameters
my $factory = Bio::Tools::Run::StandAloneBlast->new(@params);

$factory->e($expect_value);
#$factory->F($filter_query_sequence);
$factory->v($one_line_description);
$factory->b($alignments);
#$factory->S($strands);


# get query

while ( my $query = $seqio_obj->next_seq) {
      my $blast_report = $factory->blastall($query);
      print "$blast_report\n";
#      $factory->outfile("temp.out");
      print $query->seq;
      print "\n";
   $count++;
}


On Mon, 2006-01-23 at 19:41 -0600, Hubert Prielinger wrote:
> hi,
> sorry, but what do you mean with is your blast database in /nr...
> my database is located in the path /home/Hubert/blast/blast-2.2.13/data
> 
> 
> 
> Nagesh Chakka wrote:
> 
> > Can you just run the blast from the command line.
> > Is your blast database in "/nr".
> >
> > Hubert Prielinger wrote:
> >
> >> Hi Nagesh,
> >> thank you very much, I put my database into the data folder, run the 
> >> program and got the following error message:
> >>
> >> submit Sequence...just do it....
> >> sh: /home/Hubert/blast/blast-2.2.13/bin/blastall: cannot execute 
> >> binary file
> >>
> >> ------------- EXCEPTION  -------------
> >> MSG: blastall call crashed: 32256 
> >> /home/Hubert/blast/blast-2.2.13/bin/blastall -p  blastp  -d  "/nr"  
> >> -i  /tmp/QTZfYMbgLM  -e  20000  -o  /tmp/v3YwWvONZ1  -v  1000  -b  1000
> >>
> >> STACK Bio::Tools::Run::StandAloneBlast::_runblast 
> >> /usr/lib/perl5/site_perl/5.8.6/Bio/Tools/Run/StandAloneBlast.pm:759
> >> STACK Bio::Tools::Run::StandAloneBlast::_generic_local_blast 
> >> /usr/lib/perl5/site_perl/5.8.6/Bio/Tools/Run/StandAloneBlast.pm:706
> >> STACK Bio::Tools::Run::StandAloneBlast::blastall 
> >> /usr/lib/perl5/site_perl/5.8.6/Bio/Tools/Run/StandAloneBlast.pm:557
> >> STACK toplevel 
> >> /home/Hubert/installed/eclipse/workspace/Database_Search/standalone_blast.pl:46 
> >>
> >>
> >> --------------------------------------
> >>
> >> Why it did not find my binary file, but it is there
> >>
> >> regards
> >>
> >> Nagesh Chakka wrote:
> >>
> >>> Hi,
> >>> The following is from the StandAloneBlast.pm documentation
> >>> " If the databases which will be searched by BLAST are located in the
> >>> data subdirectory of the blast program directory (the default
> >>> installation location), StandAloneBlast will find them; however, if the
> >>> database files are located in any other location, environmental 
> >>> variable
> >>> $BLASTDATADIR will need to be set to point to that directory."
> >>> Please note that I have not used this module before.
> >>> Nagesh
> >>>
> >>>
> >>>
> >>> On Mon, 2006-01-23 at 17:08 -0600, Hubert Prielinger wrote:
> >>>  
> >>>
> >>>> Hi,
> >>>> thank you very much for the help, another questions that raises up, 
> >>>> do I have to write the path to the database files as well, I guess 
> >>>> so, but how I do that, the same way I write the path to teh blast 
> >>>> bin files?
> >>>> Does anybody know how to set the Composition based statistics 
> >>>> parameter?
> >>>> there is my code:
> >>>>
> >>>> #!/usr/bin/perl -w
> >>>>
> >>>> use Bio::Tools::Run::StandAloneBlast;
> >>>> use Bio::Seq;
> >>>> use Bio::SeqIO;
> >>>> use strict;
> >>>>
> >>>> BEGIN
> >>>> {
> >>>>    $ENV{PATH}=":/home/Hubert/blast/blast-2.2.13/bin/:";
> >>>> }
> >>>>
> >>>>
> >>>> # parameters
> >>>> my $expect_value = 20000;
> >>>> #my $filter_query_sequence = 'F';
> >>>> my $one_line_description = 1000;
> >>>> my $alignments = 1000;
> >>>> # my $strands = 1;
> >>>> my $count = 1;
> >>>>
> >>>> my @params = ('program' => 'blastp', 'database' => 'nr');
> >>>> #my $progress_interval = 100;
> >>>>
> >>>>
> >>>> my $seqio_obj = Bio::SeqIO->new(
> >>>>  -file   => "Perm.txt",
> >>>>  -format => "raw",
> >>>> );
> >>>>
> >>>> # create factory object and set parameters
> >>>> my $factory = Bio::Tools::Run::StandAloneBlast->new(@params);
> >>>>
> >>>> $factory->e($expect_value);
> >>>> #$factory->F($filter_query_sequence);
> >>>> $factory->v($one_line_description);
> >>>> $factory->b($alignments);
> >>>> #$factory->S($strands);
> >>>>
> >>>>
> >>>> # get query
> >>>>
> >>>> while ( my $query = $seqio_obj->next_seq ) {
> >>>>      my $blast_report = $factory->blastall($query);
> >>>>      my $filename = "comp_$count.txt";
> >>>>      my $factory->outfile($filename);
> >>>>      print $query->seq;
> >>>>      print "\n";
> >>>>
> >>>>  $count++;
> >>>> }
> >>>>
> >>>> thank you very much in advance
> >>>> Hubert
> >>>>
> >>>>
> >>>>
> >>>> Nagesh Chakka wrote:
> >>>>
> >>>>  
> >>>>
> >>>>> Hi Hubert,
> >>>>> I downloaded the nr.00.tar.gz file a week ago. I was able to get 
> >>>>> the following files
> >>>>> .phr, .pin, .pnd, .pni, .ppd, .ppi, .psd, .psi, .psq, .pal files. 
> >>>>> I have no trouble in running standalone blast. You are not 
> >>>>> required to run formardb on the downloaded blast databases and 
> >>>>> that may be the reason why the sequences are not included as it 
> >>>>> will also reduce the size of the file.
> >>>>> Did you try to run a blast search, if so is it giving you any errors?
> >>>>> Nagesh
> >>>>>
> >>>>>
> >>>>>
> >>>>> Hubert Prielinger wrote:
> >>>>>
> >>>>>    
> >>>>>
> >>>>>> Hi,
> >>>>>> I have downloaded the nr database for doing a blast search 
> >>>>>> locally, now I'm supposed to index the database with formatdb, 
> >>>>>> but it doesn't work...
> >>>>>> The online help says that you need a fasta file that is indexed 
> >>>>>> to use for searching the database, but when I uncompressed the 
> >>>>>> zip file, there were only .phr, .pnd, .pin, .pni, .ppd file....
> >>>>>> Is there anybody who can tell me, how to use formatdb with the nr 
> >>>>>> database...
> >>>>>>
> >>>>>> Help is very appreciated
> >>>>>> Thank you very much in advance
> >>>>>>
> >>>>>> Hubert
> >>>>>>
> >>>>>> _______________________________________________
> >>>>>> Bioperl-l mailing list
> >>>>>> Bioperl-l at portal.open-bio.org
> >>>>>> http://portal.open-bio.org/mailman/listinfo/bioperl-l
> >>>>>>       
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>     
> >>>>
> >>>>
> >>>
> >>>
> >>>  
> >>>
> >>
> >
> >
> 
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l



More information about the Bioperl-l mailing list