Class | Bio::DBGET
In: | lib/bio/io/dbget.rb
Parent: | Object

### Methods

aaseq alink bfind bget binfo blink bman bref btab btit dbget naseq seq seq2 version

### Constants

SERV | = | "dbget.genome.jp" |  | default DBGET server address SERV = "dbgetserv.genome.jp"
PORT | = | "3266" |  | default DBGET port number

### Public Class methods

aaseq(arg)

aaseq("db entry") method retrieves the amino acid sequence of the entry if any.

[Source]

         # File lib/bio/io/dbget.rb, line 142
    142:   def DBGET.aaseq(arg)
    143:     dbget("bget", "-f -n a #{arg}")
    144:   end

alink(arg)

alink("db entry") method returns relations

[Source]

         # File lib/bio/io/dbget.rb, line 100
    100:   def DBGET.alink(arg)
    101:     dbget("alink", arg)
    102:   end

bfind(arg)

bfind("db keyword") method searches entries by keyword

[Source]

         # File lib/bio/io/dbget.rb, line 105
    105:   def DBGET.bfind(arg)
    106:     dbget("bfind", arg)
    107:   end

bget(arg)

bget("db entry") method retrieves entries specified by the entry names

[Source]

         # File lib/bio/io/dbget.rb, line 110
    110:   def DBGET.bget(arg)
    111:     dbget("bget", arg)
    112:   end

binfo(arg)

binfo("db") method retrieves the database information

[Source]

         # File lib/bio/io/dbget.rb, line 147
    147:   def DBGET.binfo(arg)
    148:     dbget("binfo", arg)
    149:   end

blink(arg)

blink("db entry") method retrieves the link information

[Source]

         # File lib/bio/io/dbget.rb, line 152
    152:   def DBGET.blink(arg)
    153:     dbget("blink", arg)
    154:   end

bman(arg)

bman ("db entry") method shows the manual page

[Source]

         # File lib/bio/io/dbget.rb, line 157
    157:   def DBGET.bman(arg)
    158:     dbget("bman", arg)
    159:   end

bref(arg)

bref("db entry") method retrieves the references and authors

[Source]

         # File lib/bio/io/dbget.rb, line 162
    162:   def DBGET.bref(arg)
    163:     dbget("bref", arg)
    164:   end

btab(arg)

btab ("db entry") method retrives (and generates) the database alias table

[Source]

         # File lib/bio/io/dbget.rb, line 167
    167:   def DBGET.btab(arg)
    168:     dbget("btab", arg)
    169:   end

btit(arg)

btit("db entry ..") method retrieves the entry definition

[Source]

         # File lib/bio/io/dbget.rb, line 172
    172:   def DBGET.btit(arg)
    173:     dbget("btit", arg)
    174:   end

dbget(com, arg, serv = nil, port = nil)

Main class method to access DBGET server. Optionally, this method can be called with the alternative DBGET server address and the TCP/IP port number.

‘com’ should be one of the following DBGET commands:

- alink, bfind, bget, binfo, blink, bman, bref, btab, btit

These methods are shortcut for the dbget commands. Actually, Bio::DBGET.((|com|))(arg) internally calls Bio::DBGET.dbget(com, arg). Most of these methods accept the argument "-h" for help.

‘arg’ should be one of the following formats :

- [options] db
  - specify the database name only for binfo, bman etc.
- [options] db:entry
  - specify the database name and the entry name to retrieve.
- [options] db entry1 entry2 …
  - specify the database name and the list of entries to retrieve.

Note that options in the above example can be omitted. If ‘arg’ is empty, the help message with a list of options for ‘com’ will be shown by default. Supported database names will be found at the GenomeNet DBGET web page www.genome.jp/dbget/.

[Source]

        # File lib/bio/io/dbget.rb, line 55
    55:   def DBGET.dbget(com, arg, serv = nil, port = nil)
    56:
    57:     unless serv or port         # if both of serv and port are nil
    58:       if ENV["DBGET"] =~ /:/            # and ENV["DBGET"] exists
    59:         serv, port = ENV["DBGET"].split(':')
    60:       end
    61:     end
    62:     serv = serv ? serv : SERV
    63:     port = port ? port : PORT
    64:
    65:     if arg.empty?
    66:       arg = "-h"                        # DBGET help message
    67:     end
    68:
    69:     query = "#{com} #{arg}\n"           # DBGET query string
    70:
    71:     sock = TCPSocket.open("#{serv}", "#{port}")
    72:
    73:     sock.write(query)                   # submit query
    74:     sock.flush                  # buffer flush
    75:
    76:     sock.gets                           # skip "+Helo DBgetServ ..."
    77:     sock.gets                           # skip "#If you see this message, ..."
    78:     sock.gets                           # skip "*Request-IDent"
    79:
    80:     result = sock.read          # DBGET result
    81:
    82:     sock.close
    83:
    84:     return result
    85:   end

naseq(arg)

naseq("db entry") method retrieves the nucleic acid sequence of the entry if any.

[Source]

         # File lib/bio/io/dbget.rb, line 136
    136:   def DBGET.naseq(arg)
    137:     dbget("bget", "-f -n n #{arg}")
    138:   end

seq(arg)

seq("db entry") method retrieves the first sequence of the entry

Shortcut to retrieve the sequence of the entry in FASTA format. This method is equivalent to Bio::DBGET.bget("-f -n 1 #{arg}") and ‘arg’ should be the "db:entry" or "db entry1 entry2 …" format.

[Source]

         # File lib/bio/io/dbget.rb, line 119
    119:   def DBGET.seq(arg)
    120:     dbget("bget", "-f -n 1 #{arg}")
    121:   end

seq2(arg)

seq2("db entry") method retrieves the second sequence of the entry if any

Shortcut to retrieve the second sequence of the entry in FASTA format. This method is equivalent to Bio::DBGET.bget("-f -n 2 #{arg}"). Only useful when treating the KEGG GENES database entries which have both AASEQ and NTSEQ fields. This method is obsolete and it is recommended to use ‘naseq’ and ‘aaseq’ instead.

[Source]

         # File lib/bio/io/dbget.rb, line 130
    130:   def DBGET.seq2(arg)
    131:     dbget("bget", "-f -n 2 #{arg}")
    132:   end

version()

Show the version information of the DBGET server.

[Source]

        # File lib/bio/io/dbget.rb, line 88
    88:   def DBGET.version
    89:     dbget("bget", "-V")
    90:   end

[Validate]