[BioRuby] test and bioruby shell questions
Toshiaki Katayama
ktym at hgc.jp
Tue Oct 14 17:35:38 UTC 2008
Hi,
I also forgot to commit my change to ncbirest.rb for TogoWS (http://togows.dbcls.jp/).
I'll attach my current version (Apr 18) and I hope some of you can take a look on it.
Regards,
Toshiaki Katayama
-------------- next part --------------
On 2008/10/14, at 1:05, Davide Rambaldi wrote:
>>
>>
>> There are getseq and getent:
>> My feeling is that both the databases and libraries are growing
>> to handles datatypes other than sequences,
>> though the sequences have been the primary interest.
>> So, I would assume getent might be used in more general purpose than getting "sequences".
>>
>> I suppose that having a database with possible db parameter string and
>> remote db and rettype combination is a extensible way to resolve the need for possible different
>> datatypes.
>> knowndbparams={"gb" => {"db" => sequences, "rettype" =>"gbwithparts"},
>> "gp" => {"db" => sequences, "rettype" => "gp"},
>> ...
>> }
>>
>> and call like
>> fetch = Bio::NCBI::REST.efetch(entry_id, knwondbparams[db])
>>
>
> I have modified to patch (see below), including a knowndbparams Hash.
>
> Now work with:
>
> bioruby> test = getobj("gb:AAF63163")
> bioruby> test = getobj("gp:AF237819")
>
>
> Actually the Hash handle genbank and genPept.
>
> How I can add more datatypes?
>
> I should take the definition in NSIDs (lib/bio/io/dbget.rb) as key for knowdbparams Hash?
>
> Here is (from NCBI website) the list of available db params for efetch:
>
> 1. EFETCH for literature
> db=[pubmed|pmc|journals|omim]
>
> 2. EFETCH for sequences
> ? gene
> ? genome
> ? nucleotide
> ? nuccore
> ? nucest
> ? nucgss
> ? protein
> ? popset
> ? snp
> ? sequences - Composite name including nucleotide, protein, popset and genome.
>
> 3. EFETCH for taxonomy
> db=taxonomy
>
>
> Best Regards
>
> Davide
>
> -------------------------------------------------------
> PATCH HERE
> ----------------------------------------------------
>
> Oni:bioruby tucano$ git diff
> 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..2408a95 100644
> --- a/lib/bio/shell/plugin/entry.rb
> +++ b/lib/bio/shell/plugin/entry.rb
> @@ -88,8 +88,19 @@ 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
> + # NCBI efecth
> + knowndbparams = {
> + "gb" => {"db" => "sequences", "rettype" =>"gbwithparts"},
> + "gp" => {"db" => "sequences", "rettype" => "gp"}
> + }
> + puts "Retrieving entry from NCBI (#{arg})"
> + fetch = Bio::NCBI::REST.efetch(entry_id, knowndbparams[db])
> + entry = fetch.to_s
> + end
> end
> end
>
>
>
> _______________________________________________
> BioRuby mailing list
> BioRuby at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioruby
More information about the BioRuby
mailing list