[BioRuby] test and bioruby shell questions

Davide Rambaldi davide.rambaldi at ifom-ieo-campus.it
Sun Oct 12 15:10:14 UTC 2008


Il giorno 26/set/08, alle ore 15:37, Naohisa GOTO ha scritto:

> Thank you for a patch, but it has some problems:
> For KEGG API, $?.exitstatus has no mean, and no need to check $?.
> The "AF237819" should not be hardcoded because the method is
> not only for demo, but a bioruby-shell command to fetch entry
> specified by a user. Also note that "db" => "nuccore" would
> not always be good. (If result is empty, switching to another
> database and trying again would be the best way.)


I apologize for this.... was really stupid and sorry for the late  
answer (my laptop have died... with all my bioruby test inside)

Maybe I can propose anther patch: the patch to bio.rb add an autoload  
call for Bio::NCBI::REST in bio.rb, the patch to bio/shell/plugin/ 
entry.rb don't have the entry hardcoded.

About the entry.rb patch I have two questions:

- I put the db prefix (demo is gb:AF237819) to define the rettype for  
NCBI::REST. Work for the demo. but I guess this should be changed...

- For the database I have used the general db "sequences", assuming  
that the method getent of entry.rb is only for sequences... is this  
correct?


PATCHES:

diff --git a/lib/bio.rb b/lib/bio.rb
index b2b6f4f..bddc221 100644
--- a/lib/bio.rb
+++ b/lib/bio.rb
@@ -170,6 +170,7 @@ module Bio

    class NCBI
      autoload :SOAP,       'bio/io/ncbisoap'
+    autoload :REST,       'bio/io/ncbirest'
    end


diff --git a/lib/bio/shell/plugin/entry.rb b/lib/bio/shell/plugin/ 
entry.rb
index 6d36fb5..21ef9f6 100644
--- a/lib/bio/shell/plugin/entry.rb
+++ b/lib/bio/shell/plugin/entry.rb
@@ -88,8 +88,14 @@ module Bio::Shell

        # KEGG API at http://www.genome.jp/kegg/soap/
        else
-        puts "Retrieving entry from KEGG API (#{arg})"
          entry = bget(arg)
+        if entry.length != 0 then
+          puts "Retrieving entry from KEGG API (#{arg})"
+        else
+          puts "Retrieving entry from NCBI (#{arg})"
+          fetch = Bio::NCBI::REST.efetch(entry_id,  
{"db"=>"sequences", "rettype"=>db})
+          entry = fetch.to_s
+        end
        end
      end


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