[BioRuby] test and bioruby shell questions
Davide Rambaldi
davide.rambaldi at ifom-ieo-campus.it
Thu Sep 25 07:35:54 UTC 2008
On Aug 30, 2008, at 2:16 PM, Toshiaki Katayama wrote:
> The demo above was designed to utilize the KEGG API, which is a
> SOAP based web service,
> so we need to change the default data source to obtain this entry.
> We can fix this by switching to use NCBI's efetch method instead.
I manage to write a fix for this... is really horrible actually (but
it works)
I have inserted my code in the nested if/else that retrieve the
entry, so after the KEGG API try, the shell try NCBI::REST.efetch
Oni:~/src/bioruby tucano$ git diff lib/bio/shell/plugin/entry.rb
diff --git a/lib/bio/shell/plugin/entry.rb b/lib/bio/shell/plugin/
entry.rb
index 6d36fb5..0a45ecd 100644
--- a/lib/bio/shell/plugin/entry.rb
+++ b/lib/bio/shell/plugin/entry.rb
@@ -88,8 +88,16 @@ module Bio::Shell
# KEGG API at http://www.genome.jp/kegg/soap/
else
- puts "Retrieving entry from KEGG API (#{arg})"
entry = bget(arg)
+ if $?.exitstatus == 0 and str.length != 0
+ puts "Retrieving entry from KEGG API (#{arg})"
+ else
+ # efetch from NCBI
+ puts "Retrieving entry from NCBI (#{arg})"
+ require 'bio/io/ncbirest.rb'
+ fetch = Bio::NCBI::REST.efetch("AF237819",
{"db"=>"nuccore", "rettype"=>"gb"})
+ entry = fetch.to_s
+ end
end
end
So the questions/comments:
1. I have added the require 'bio/io/ncbirest.rb' beacuse in bio.rb
ncbirest.rb is not loaded (only SOAP). Is a bug or a feature?
2. the standard demo command now is able to retrieve the genbank
entry, but generate an error in the MIDI file generation:
bioruby> midifile("data/AF237819.mid", kuma.naseq)
Saving MIDI file (data/AF237819.mid) ... Error: Failed to save (data/
AF237819.mid) : No such file or directory - data/AF237819.mid
any clue for this FAil?
by the way: wow a module to translate a sequence in music? I really
wont to test it also! I have made a software that do something similar:
http://recipient.cc/playgene/
Is made with a perl (?!) script to efetch sequence from NCBI, and a
flash application for the interface and to load the music library... :-)
Best Regards
Davide Rambaldi,
Bioinformatics PhD student.
-----------------------------------------------------
Bioinformatic Group IFOM-IEO Campus
Via Adamello 16, Milano
I-20139 Italy
[t] +39 02574303 066
[e] davide.rambaldi at ifom-ieo-campus.it
[i] http://ciccarelli.group.ifom-ieo-campus.it/fcwiki/DavideRambaldi
(homepage)
[i] http://www.semm.it (PhD school)
[i] http://www.btbs.unimib.it/ (Master)
-----------------------------------------------------
More information about the BioRuby
mailing list