[BioRuby] Help with Bio::Blast

Naohisa GOTO ngoto at gen-info.osaka-u.ac.jp
Wed Aug 13 03:53:17 UTC 2008


Related topic: 

I modified your code below.
However, because of the change of the behavior of remote site
(http://blast.genome.jp/), it may not work with long query sequences.

  res = []
  blast = Bio::Blast.remote('blastn', 'nr-nt', '-e 0.1')
  files.each do |file|
     Bio::FlatFile.foreach(Bio::FastaFormat, file) do |c|
        reports = blast.query(c.naseq.to_fasta(c.definition, 70))
        reports.each { |report| res << report.query_seq }

Naohisa Goto
ngoto at gen-info.osaka-u.ac.jp / ng at bioruby.org

On Tue, 12 Aug 2008 14:09:56 -0400
Greg Traub <gtraub at flmnh.ufl.edu> wrote:

> Hello,
> I'm new to BioRuby but not new to Ruby. I've been trying to write code 
> to submit a fasta formated sequence for BLAST search, however I never 
> get back anything thats usable. After reading the documentation, I 
> should be receiving xml formated responses to my search, but I dont 
> receive anything. I altered the code in Bio::Blast class to print out 
> whatever raw data was being sent back from my request and to my 
> surprise, I keep receiving standard formated HTML page that tells me my 
> request is either requesting the wrong program or the wrong database . 
> I've been trying to use 'blastn' with 'nr' or 'nr-nt' ...documentation 
> seems differ as to what the name of the databases are, so I've tried all 
> of them with no luck. Now what really gets me is that i should be 
> getting back XML. I would even an expect the error message to be in XML 
> but instead its in a  HTML page  with javascript included.  This makes 
> me think that the request is going to URL not intended for XML 
> responses. Can anybody help me?  I've pasted some example code that I've 
> tried below.
> Thanks,
> Greg
> #files is array of file locations
> #res is response
> #im just trying to get back any info i can from the request
> #in the example code below
> blast = Bio::Blast.remote('blastn','nr')
> files.each do |file|
>      Bio::FastaFormat.open(file).each_entry do |c|
>         reports = blast.query(c.seq)
>         reports.each { |report| res << report.query_seq }
>      end
> end
> -- 
> Database Programmer
> Florida Museum of Natural History
> University of Florida
> gtraub at flmnh.ufl.edu
> (352) 392-1721 ext. 514
> ----------------------------------
> Experience is what you get when
> you didn't get what you want.
> -National Vacuum sign
> _______________________________________________
> BioRuby mailing list
> BioRuby at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioruby

More information about the BioRuby mailing list