Class: Bio::OldBioFetchEmulator::Client

Inherits:
Fetch
  • Object
show all
Defined in:
lib/bio-old-biofetch-emulator/emulator.rb

Constant Summary collapse

Databases =

web.archive.org/web/20070306215757/http://bioruby.org/cgi-bin/biofetch.rb?info=dbs aa aax bl cpd dgenes dr ec eg emb embu epd est exp gb gbu genes gl gn gp gpu gss htgs ko ld lit mim nt og path pd pdb pdoc pf pir pmd pr prf ps rn rp rs rsaa rsnt sp str sts tr vg

{
  # fetching via Bio::PubMed (NCBI E-Utilities)
  "pubmed"  => [ :PubMed, true ],

  # fetching via TogoWS REST API
  "genbank"    => [ :TogoWS, "ncbi-nucleotide" ],
  "gb"         => "genbank",

  "genpept"    => [ :TogoWS, "ncbi-protein" ],
  "gp"         => "genpept",

  "refseq"     => [ :TogoWS, "ncbi-nucleotide", "ncbi-protein" ],
  "rs"         => "refseq",
  "refnuc"     => [ :TogoWS, "ncbi-nucleotide" ], 
  "rsnt"       => "refnuc",
  "refpep"     => [ :TogoWS, "ncbi-protein" ],
  "rsaa"       => "refpep",

  "embl"       => [ :TogoWS, "ebi-ena" ],
  "emb"        => "embl",

  "uniprot"    => [ :TogoWS, true ],
  "up"         => "uniprot",
  "swissprot"  => "uniprot",
  "sp"         => "uniprot",
  "trembl"     => "uniprot",
  "tr"         => "uniprot",

  "pdb"        => [ :TogoWS, true ],

  #"genes"      => [ :TogoWS, "kegg-genes" ],

  # fetching via KEGG REST API
  "pathway"    => [ :KEGG, true ],
  "path"       => "pathway",
  "brite"      => [ :KEGG, true ],
  "br"         => "brite",
  "module"     => [ :KEGG, true ],
  "md"         => "module",
  "orthology"  => [ :KEGG, true ],
  "ko"         => "orthology",
  "genome"     => [ :KEGG, true ],
  "genomes"    => [ :KEGG, true ],
  "gn"         => "genomes",
  "genes"      => [ :KEGG, true ],
  "ligand"     => [ :KEGG, true ],
  "compound"   => [ :KEGG, true ],
  "cpd"        => "compound",
  "glycan"     => [ :KEGG, true ],
  "gl"         => "glycan",
  "reaction"   => [ :KEGG, true ],
  "rn"         => "reaction",
  "rpair"      => [ :KEGG, true ],
  "rp"         => "rpair",
  "rclass"     => [ :KEGG, true ],
  "rc"         => "rclass",
  "enzyme"     => [ :KEGG, true ],
  "ec"         => "enzyme",
  "disease"    => [ :KEGG, true ],
  "ds"         => "disease",
  "drug"       => [ :KEGG, true ],
  "dr"         => "drug",
  "dgroup"     => [ :KEGG, true ],
  "dg"         => "dgroup",
  "environ"    => [ :KEGG, true ],
  "ev"         => "environ",

  "expression" => [ nil ], #[ :KEGG, true ],
  "ex"         => "expression",
  "exp"        => "expression",

  "dgenes"     => [ :KEGG, true ],
  "egenes"     => [ :KEGG, true ],
  "eg"         => "egenes",
  "mgenes"     => [ nil ], #[ :KEGG, true ],
  "mgenome"    => [ nil ], #[ :KEGG, true ],
  "mgnm"       => "mgenome",

  "vgenome"    => [ :KEGG, true ],
  "vgnm"       => "vgenome",
  "vgenes"     => [ :KEGG, true ],
  "vg"         => "vgenes",

  # fetching from GenemeNet
  "aaindex"  => [ :DBGET, true ],
  "aax"      => "aaindex",
  "aaindex1" => [ :DBGET, true ],
  "aax1"     => "aaindex1",
  "aaindex2" => [ :DBGET, true ],
  "aax2"     => "aaindex2",
  "aaindex3" => [ :DBGET, true ],
  "aax3"     => "aaindex3",

  # formerly can be get from GenomeNet but not available now
  "prf"        => [ nil ], #[ :DBGET, true ],
  "litdb"      => [ nil ], #[ :DBGET, true ],
  "lit"        => [ nil ], #"litdb",

  "pdbstr"  => [ nil ], # Protein sequence generated from PDB (GenomeNet)

  "aa"      => [ nil ], # nr-aa ???
  #"aax" # AAindex (KEGG)
  "bl"      => [ nil ], # Blocks (http://blocks.fhcrc.org/)
  #"cpd" # KEGG Compound
  #"dgenes" # KEGG DGenes
  #"dr" # KEGG Drug
  #"ec" # KEGG Enzyme
  #"eg" # KEGG EGenes
  #"emb" # EMBL
  "embu"    => [ nil ], # EMBL UniGene ???
  "epd"     => [ nil ], # The Eukaryotic Promoter Database
  "est"     => [ nil ], # NCBI EST ???
  #"gb" # GenBank
  "gbu"     => [ nil ], # NCBI UniGene ???
  #"genes" # KEGG Genes
  #"gl" # KEGG Glycan
  #"gn" # KEGG Genomes
  #"gp" # GenPept ???
  "gpu"     => [ nil ], # ???
  "gss"     => [ nil ], # NCBI GSS ???
  "htgs"    => [ nil ], # NCBI HTGS ???
  #"ko" # KEGG Orthology
  "ld"      => [ nil ], # ???
  #"lit" # PRF LitDB
  "mim"     => [ nil ], # ???
  "nt"      => [ nil ], # nr-nt ???
  "og"      => [ nil ], # ???
  #"path" # KEGG Pathway
  "pd"      => [ nil ], # prodom
  #"pdb" # PDB
  "pdoc"    => [ nil ], # Prosite literature (GenomeNet)
  "pf"      => [ nil ], # Pfam
  "pir"     => [ nil ], # pir
  "pmd"     => [ nil ], # Protein mutants (DDBJ) (GenomeNet)
  "pr"      => [ nil ], # prints
  #"prf" # PRF (Protein Research Foundation)
  "ps"      => [ nil ], # prosite
  #"rn" # KEGG Reaction
  #"rp" # KEGG RPair
  #"rs" # NCBI RefSeq
  #"rsaa" # NCBI RefSeq Amino Acide
  #"rsnt" # NCBI RefSeq NucleoTide
  #"sp" # SwissProt
  "str"     => [ nil ], # ???
  "sts"     => [ nil ], # NCBI STS ???
  #"tr" # TrEMBL
  #"vg" # KEGG VGenes
}

Instance Method Summary collapse

Constructor Details

#initialize(url = URL) ⇒ Client

Returns a new instance of Client.



173
174
175
# File 'lib/bio-old-biofetch-emulator/emulator.rb', line 173

def initialize(url = URL)
  super
end

Instance Method Details

#databasesObject



181
182
183
184
185
186
187
188
189
190
191
192
# File 'lib/bio-old-biofetch-emulator/emulator.rb', line 181

def databases
  Databases.collect do |key, val|
    while val && val.is_a?(String)
      val = Databases[val]
    end
    if val && val.is_a?(Array) && val[0] then
      key
    else
      nil
    end
  end.compact
end

#fetch(db, id, style = 'raw', format = nil) ⇒ Object



177
178
179
# File 'lib/bio-old-biofetch-emulator/emulator.rb', line 177

def fetch(db, id, style = 'raw', format = nil)
  _fetch(:fetch, db, id, style, format)
end

#formats(database = @database) ⇒ Object



194
195
196
197
198
# File 'lib/bio-old-biofetch-emulator/emulator.rb', line 194

def formats(database = @database)
  if database
    [ "default" ]
  end
end

#maxidsObject



200
201
202
# File 'lib/bio-old-biofetch-emulator/emulator.rb', line 200

def maxids
  MAX_ID_NUM
end