From k at dev.open-bio.org Tue Sep 19 01:39:07 2006 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Tue, 19 Sep 2006 05:39:07 +0000 Subject: [BioRuby-cvs] bioruby README.DEV,1.10,1.11 Message-ID: <200609190539.k8J5d7bK031135@dev.open-bio.org> Update of /home/repository/bioruby/bioruby In directory dev.open-bio.org:/tmp/cvs-serv31131 Modified Files: README.DEV Log Message: * fix of the code template Index: README.DEV =================================================================== RCS file: /home/repository/bioruby/bioruby/README.DEV,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** README.DEV 11 May 2006 10:53:25 -0000 1.10 --- README.DEV 19 Sep 2006 05:39:05 -0000 1.11 *************** *** 1,6 **** ! $Id$ ! Copyright (C):: 2005, 2006 Toshiaki Katayama ! Copyright (C):: 2006 Jan Aerts = HOW TO CONTRIBUTE TO THE BIORUBY PROJECT? --- 1,8 ---- ! = README.DEV ! Copyright:: Copyright (C) 2005, 2006 Toshiaki Katayama ! Copyright:: Copyright (C) 2006 Jan Aerts ! ! $Id$ = HOW TO CONTRIBUTE TO THE BIORUBY PROJECT? *************** *** 71,89 **** The header should be formatted as follows: # # = bio/db/hoge.rb - Hoge database parser classes # ! # Copyright (C):: 2001, 2003-2005 Bio R. Hacker , ! # Copyright (C):: 2006 Chem R. Hacker # ! # License:: Ruby's # ! # $Id$ # ! # = Description # # This file contains classes that implement an interface to the Hoge database. # ! # = References # # * Hoge F. et al., The Hoge database, Nucleic. Acid. Res. 123:100--123 (2030) --- 73,92 ---- The header should be formatted as follows: + # # = bio/db/hoge.rb - Hoge database parser classes # ! # Copyright:: Copyright (C) 2001, 2003-2005 Bio R. Hacker , ! # Copyright:: Copyright (C) 2006 Chem R. Hacker # ! # License:: Ruby's # ! # $ I d: $ # ! # == Description # # This file contains classes that implement an interface to the Hoge database. # ! # == References # # * Hoge F. et al., The Hoge database, Nucleic. Acid. Res. 123:100--123 (2030) *************** *** 91,98 **** # ! In the above sample, the ! $Id$ ! will be automatically changed into something like $Id$ when commiting to the CVS repository for the first time. --- 94,114 ---- # ! require 'foo' ! ! module Bio ! ! autoload :Bar, 'bio/bar' ! ! class Hoge ! : ! end # Hoge ! ! end # Bio ! ! In the above sample, the '$ I d : $' (without spaces) will be automatically ! changed into something like ! $Id$ + when commiting to the CVS repository for the first time. *************** *** 102,106 **** following example (from lib/bio/sequence.rb): ! # = DESCRIPTION # Bio::Sequence objects represent annotated sequences in bioruby. # A Bio::Sequence object is a wrapper around the actual sequence, --- 118,123 ---- following example (from lib/bio/sequence.rb): ! # == Description ! # # Bio::Sequence objects represent annotated sequences in bioruby. # A Bio::Sequence object is a wrapper around the actual sequence, *************** *** 111,115 **** # these methods are not documented specifically for Bio::Sequence). # ! # = USAGE # require 'bio' # --- 128,133 ---- # these methods are not documented specifically for Bio::Sequence). # ! # == Usage ! # # require 'bio' # *************** *** 168,173 **** --- 186,194 ---- example too much, try to provide any input data directly into the usage example, instead of refering to ARGV or ARGF for input. + dna = Bio::Sequence.auto('atgcatgcATGCATGCAAAA') + Otherwise, describe the input shortly, for example: + # input should be string consisting of nucleotides dna = Bio::Sequence.auto(ARGF.read) *************** *** 178,181 **** --- 199,203 ---- be listed, as well as the type of thing that is returned by the method. The format of this information is as follows: + # --- # *Arguments*: *************** *** 189,193 **** --- 211,217 ---- Don't use + $stderr.puts "WARNING" + in your code. Instead, try to avoid printing error messages. For fatal errors, use +raise+ with an appropriate message. *************** *** 198,202 **** you meant to do with each method. The test code is useful to make maintenance easy and ensure stability. The use of ! if __FILE__ == $0 is deprecated. --- 222,228 ---- you meant to do with each method. The test code is useful to make maintenance easy and ensure stability. The use of ! ! if __FILE__ == $0 ! is deprecated. *************** *** 204,209 **** To quicken the initial load time we have replaced most of 'require' to ! 'autoload' ! since BioRuby version 0.7. During this change, we have found some tips: --- 230,234 ---- To quicken the initial load time we have replaced most of 'require' to ! 'autoload' since BioRuby version 0.7. During this change, we have found some tips: From k at dev.open-bio.org Tue Sep 19 01:41:47 2006 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Tue, 19 Sep 2006 05:41:47 +0000 Subject: [BioRuby-cvs] bioruby/lib bio.rb,1.69,1.70 Message-ID: <200609190541.k8J5fl0p031252@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib In directory dev.open-bio.org:/tmp/cvs-serv31246/lib Modified Files: bio.rb Log Message: * added ebisoap and ncbisoap Index: bio.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio.rb,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -d -r1.69 -r1.70 *** bio.rb 14 Jul 2006 14:27:10 -0000 1.69 --- bio.rb 19 Sep 2006 05:41:45 -0000 1.70 *************** *** 121,124 **** --- 121,125 ---- autoload :Fetch, 'bio/io/fetch' autoload :SQL, 'bio/io/sql' + autoload :SOAPWSDL, 'bio/io/soapwsdl' autoload :FlatFile, 'bio/io/flatfile' autoload :FlatFileIndex, 'bio/io/flatfile/index' # chage to FlatFile::Index ? *************** *** 155,159 **** end ! # autoload :ESOAP, 'bio/io/esoap' # NCBI::ESOAP ? --- 156,166 ---- end ! class EBI ! autoload :SOAP, 'bio/io/ebisoap' ! end ! ! class NCBI ! autoload :SOAP, 'bio/io/ncbisoap' ! end From k at dev.open-bio.org Tue Sep 19 01:41:47 2006 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Tue, 19 Sep 2006 05:41:47 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/io ebisoap.rb, NONE, 1.1 ncbisoap.rb, NONE, 1.1 Message-ID: <200609190541.k8J5flio031257@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/io In directory dev.open-bio.org:/tmp/cvs-serv31246/lib/bio/io Added Files: ebisoap.rb ncbisoap.rb Log Message: * added ebisoap and ncbisoap --- NEW FILE: ebisoap.rb --- # # = bio/io/emblsoap.rb - EBI SOAP server access class # # Copyright:: Copyright (C) 2006 # Toshiaki Katayama # License:: Ruby's # # $Id: ebisoap.rb,v 1.1 2006/09/19 05:41:45 k Exp $ # require 'bio/io/soapwsdl' module Bio class EBI class SOAP < Bio::SOAPWSDL BASE_URI = "http://www.ebi.ac.uk/Tools/webservices/wsdl/" def initialize(wsdl = nil) super(wsdl || self.class::SERVER_URI) end # * fetchData # * getSupportedDBs # * getSupportedFormats # * getSupportedStyles class Dbfetch < Bio::EBI::SOAP SERVER_URI = BASE_URI + "WSDbfetch.wsdl" end # * checkStatus # * doIprscan # * getResults # * poll # * polljob # * runInterProScan # * test class InterProScan < Bio::EBI::SOAP SERVER_URI = BASE_URI + "WSInterProScan.wsdl" end # * checkStatus # * getInfo # * getResults # * getTools # * poll # * run # * test class Emboss < Bio::EBI::SOAP SERVER_URI = BASE_URI + "WSEmboss.wsdl" end # * checkStatus # * getResults # * poll # * runClustalW # * test class ClustalW < Bio::EBI::SOAP SERVER_URI = BASE_URI + "WSClustalW.wsdl" end # * checkStatus # * getResults # * poll # * runTCoffee class TCoffee < Bio::EBI::SOAP SERVER_URI = BASE_URI + "WSTCoffee.wsdl" end # * checkStatus # * getResults # * poll # * runMuscle # * test class Muscle < Bio::EBI::SOAP SERVER_URI = BASE_URI + "WSMuscle.wsdl" end # * checkStatus # * doFasta # * getResults # * poll # * polljob # * runFasta class Fasta < Bio::EBI::SOAP SERVER_URI = BASE_URI + "WSFasta.wsdl" end # * checkStatus # * doWUBlast # * getIds # * getResults # * poll # * polljob # * runWUBlast # * test class WUBlast < Bio::EBI::SOAP SERVER_URI = BASE_URI + "WSWUBlast.wsdl" end # * checkStatus # * getResults # * poll # * runMPsrch # * test class MPsrch < Bio::EBI::SOAP SERVER_URI = BASE_URI + "WSMPsrch.wsdl" end # * checkStatus # * getResults # * poll # * runScanPS # * test class ScanPS < Bio::EBI::SOAP SERVER_URI = BASE_URI + "WSScanPS.wsdl" end class MSD < Bio::EBI::SOAP SERVER_URI = "http://www.ebi.ac.uk/msd-srv/docs/api/msd_soap_service.wsdl" end class Ontology < Bio::EBI::SOAP SERVER_URI = "http://www.ebi.ac.uk/ontology-lookup/OntologyQuery.wsdl" end class Citation < Bio::EBI::SOAP SERVER_URI = "http://www.ebi.ac.uk/citations/webservices/wsdl" end end # SOAP end # EBI end # Bio if __FILE__ == $0 serv = Bio::EBI::SOAP::Dbfetch.new p serv.getSupportedDBs require 'base64' serv = Bio::EBI::SOAP::Emboss.new hash = {"tool" => "water", "asequence" => "uniprot:alk1_human", "bsequence" => "uniprot:alk1_mouse", "email" => "ebisoap at example.org"} poll = serv.run(hash, []) puts poll base = serv.poll(poll, "tooloutput") puts Base64.decode64(base) end --- NEW FILE: ncbisoap.rb --- # # = bio/io/ncbisoap.rb - SOAP interface for NCBI Entrez Utilities # # Copyright:: Copyright (C) 2004, 2006 # Toshiaki Katayama # License:: Ruby's # # $Id: ncbisoap.rb,v 1.1 2006/09/19 05:41:45 k Exp $ # require 'bio/io/soapwsdl' module Bio class NCBI # == References # # * http://eutils.ncbi.nlm.nih.gov/entrez/query/static/esoap_help.html # # == Methods # # All methods accept a hash as its argument and most of the keys can be # ommited (values are string). # # Note: Methods which name ends with _MS are designed for use with # Microsoft Visual Studio and SOAP Toolkit 3.0 # # * http://www.ncbi.nlm.nih.gov/entrez/query/static/esoap_ms_help.html # # * run_eFetch(_MS) # * "db", "id", "WebEnv", "query_key", "tool", "email", "retstart", # "retmax", "rettype", "strand", "seq_start", "seq_stop", "complexity", # "report" # # * run_eGquery(_MS) # * "term", "tool", "email" # # * run_eInfo(_MS) # * "db", "tool", "email" # # * run_eSpell(_MS) # * "db", "term", "tool", "email" # # * run_eLink(_MS) # * "db", "id", "reldate", "mindate", "maxdate", "datetype", "term" # "dbfrom", "WebEnv", "query_key", "cmd", "tool", "email" # # * run_eSearch(_MS) # * "db", "term", "WebEnv", "QueryKey", "usehistory", "tool", "email", # "field", "reldate", "mindate", "maxdate", "datetype", "RetStart", # "RetMax", "rettype", "sort" # # * run_eSummary(_MS) # * "db", "id", "WebEnv", "query_key", "retstart", "retmax", "tool", "email" # # == Complex data types # # * http://www.ncbi.nlm.nih.gov/entrez/eutils/soap/egquery.xsd # * http://www.ncbi.nlm.nih.gov/entrez/eutils/soap/einfo.xsd # * http://www.ncbi.nlm.nih.gov/entrez/eutils/soap/esearch.xsd # * http://www.ncbi.nlm.nih.gov/entrez/eutils/soap/esummary.xsd # * http://www.ncbi.nlm.nih.gov/entrez/eutils/soap/elink.xsd # * http://www.ncbi.nlm.nih.gov/entrez/eutils/soap/efetch.xsd # * http://www.ncbi.nlm.nih.gov/entrez/eutils/soap/espell.xsd # class SOAP < Bio::SOAPWSDL BASE_URI = "http://www.ncbi.nlm.nih.gov/entrez/eutils/soap/" def initialize(wsdl = nil) super(wsdl || self.class::SERVER_URI) end def method_missing(*arg) sleep 3 # make sure to rest for 3 seconds per request @driver.send(*arg) end class EUtils < Bio::NCBI::SOAP SERVER_URI = BASE_URI + "eutils.wsdl" end class EUtilsLite < Bio::NCBI::SOAP SERVER_URI = BASE_URI + "eutils_lite.wsdl" end class EFetch < Bio::NCBI::SOAP SERVER_URI = BASE_URI + "efetch.wsdl" end class EFetchLite < Bio::NCBI::SOAP SERVER_URI = BASE_URI + "efetch_lit.wsdl" end end # SOAP end # NCBI end # Bio if __FILE__ == $0 puts ">>> Bio::NCBI::SOAP::EFetch" efetch = Bio::NCBI::SOAP::EFetch.new puts "### run_eFetch in EFetch" hash = {"db" => "protein", "id" => "37776955"} result = efetch.run_eFetch(hash) p result puts ">>> Bio::NCBI::SOAP::EUtils" eutils = Bio::NCBI::SOAP::EUtils.new puts "### run_eFetch in EUtils" hash = {"db" => "pubmed", "id" => "12345"} result = eutils.run_eFetch(hash) p result puts "### run_eGquery - Entrez meta search to count hits in each DB" hash = {"term" => "kinase"} result = eutils.run_eGquery(hash) # working? p result puts "### run_eInfo - listing of the databases" hash = {"db" => "protein"} result = eutils.run_eInfo(hash) p result puts "### run_eSpell" hash = {"db" => "pubmed", "term" => "kinas"} result = eutils.run_eSpell(hash) p result p result["CorrectedQuery"] puts "### run_eLink" hash = {"db" => "protein", "id" => "37776955"} result = eutils.run_eLink(hash) # working? p result puts "### run_eSearch" hash = {"db" => "pubmed", "term" => "kinase"} result = eutils.run_eSearch(hash) p result puts "### run_eSummary" hash = {"db" => "protein", "id" => "37776955"} result = eutils.run_eSummary(hash) p result end From k at dev.open-bio.org Tue Sep 19 01:43:08 2006 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Tue, 19 Sep 2006 05:43:08 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/io soapwsdl.rb,1.5,1.6 Message-ID: <200609190543.k8J5h8qD031301@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/io In directory dev.open-bio.org:/tmp/cvs-serv31297/lib/bio/io Modified Files: soapwsdl.rb Log Message: * minor change Index: soapwsdl.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/io/soapwsdl.rb,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** soapwsdl.rb 29 May 2006 15:28:18 -0000 1.5 --- soapwsdl.rb 19 Sep 2006 05:43:06 -0000 1.6 *************** *** 3,11 **** # # Copyright:: Copyright (C) 2004 ! # KATAYAMA Toshiaki # License:: Ruby's # # $Id$ # # == Examples # --- 3,18 ---- # # Copyright:: Copyright (C) 2004 ! # Toshiaki Katayama # License:: Ruby's # # $Id$ # + begin + require 'soap/wsdlDriver' + rescue LoadError + end + + module Bio + # == Examples # *************** *** 36,53 **** # % export http_proxy=http://localhost:8080 # - - begin - require 'soap/wsdlDriver' - rescue LoadError - end - - module Bio - class SOAPWSDL ! # WSDL URL attr_reader :wsdl ! # log IO attr_reader :log --- 43,52 ---- # % export http_proxy=http://localhost:8080 # class SOAPWSDL ! # Returns URL of the current WSDL file. attr_reader :wsdl ! # Returns current logging IO. attr_reader :log *************** *** 71,75 **** ! # Set a WSDL URL. def wsdl=(url) @wsdl = url --- 70,85 ---- ! # Change the URL for WSDL file ! # ! # serv = Bio::SOAPWSDL.new("http://soap.genome.jp/KEGG.wsdl") ! # ! # or ! # ! # serv = Bio::SOAPWSDL.new ! # serv.wsdl = "http://soap.genome.jp/KEGG.wsdl" ! # ! # Note that you can't read two or more different WSDL files at once. ! # In that case, create Bio::SOAPWSDL object for each. ! # def wsdl=(url) @wsdl = url *************** *** 78,82 **** ! # Set log IO def log=(io) @log = io --- 88,100 ---- ! # Change the IO for logging. The argument is passed to wiredump_dev method ! # of the SOAP4R, thus ! # ! # serv = Bio::SOAPWSDL.new ! # serv.log = STDERR ! # ! # will print all the SOAP transactions in standard error. ! # This feature is especially useful for debug. ! # def log=(io) @log = io *************** *** 96,100 **** private :method_missing ! end # SOAP end # Bio --- 114,118 ---- private :method_missing ! end # SOAPWSDL end # Bio From k at dev.open-bio.org Tue Sep 19 01:44:43 2006 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Tue, 19 Sep 2006 05:44:43 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/io ddbjxml.rb,1.11,1.12 Message-ID: <200609190544.k8J5ihmC031344@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/io In directory dev.open-bio.org:/tmp/cvs-serv31340/lib/bio/io Modified Files: ddbjxml.rb Log Message: * initialize methods are unified in the super class Index: ddbjxml.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/io/ddbjxml.rb,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** ddbjxml.rb 8 May 2006 14:29:58 -0000 1.11 --- ddbjxml.rb 19 Sep 2006 05:44:41 -0000 1.12 *************** *** 3,7 **** # # Copyright:: Copyright (C) 2003, 2004 ! # KATAYAMA Toshiaki # License:: Ruby's # --- 3,7 ---- # # Copyright:: Copyright (C) 2003, 2004 ! # Toshiaki Katayama # License:: Ruby's # *************** *** 28,31 **** --- 28,35 ---- BASE_URI = "http://xml.nig.ac.jp/wsdl/" + def initialize(wsdl = nil) + super(wsdl || self.class::SERVER_URI) + end + # === Description # *************** *** 55,63 **** # === WSDL Methods # ! # ==== searchSimple(program, database, query) # # Returns a blast report in the default format. # ! # ==== searchParam(program, database, query, param) # # Blasts with param and returns a blast report. --- 59,67 ---- # === WSDL Methods # ! # * searchSimple(program, database, query) # # Returns a blast report in the default format. # ! # * searchParam(program, database, query, param) # # Blasts with param and returns a blast report. *************** *** 69,77 **** class Blast < XML SERVER_URI = BASE_URI + "Blast.wsdl" - - # returns a Bio::DDBJ::XML::Blast object. - def initialize(wsdl = nil) - super(wsdl || SERVER_URI) - end end --- 73,76 ---- *************** *** 106,111 **** # === WSDL Methods # ! # ==== analyzeSimple(query) ! # ==== analyzeParam(query, param) # # === References --- 105,110 ---- # === WSDL Methods # ! # * analyzeSimple(query) ! # * analyzeParam(query, param) # # === References *************** *** 115,123 **** class ClustalW < XML SERVER_URI = BASE_URI + "ClustalW.wsdl" - - # returns a Bio::DDBJ::XML::ClustalW object. - def initialize(wsdl = nil) - super(wsdl || SERVER_URI) - end end --- 114,117 ---- *************** *** 141,150 **** # === WSDL Methods # ! # ==== getFFEntry(accession) ! # ==== getXMLEntry(accession) ! # ==== getFeatureInfo(accession, feature) ! # ==== getAllFeatures(accession) ! # ==== getRelatedFeatures(accession, start, stop) ! # ==== getRelatedFeaturesSeq(accession, start, stop) # # === References --- 135,144 ---- # === WSDL Methods # ! # * getFFEntry(accession) ! # * getXMLEntry(accession) ! # * getFeatureInfo(accession, feature) ! # * getAllFeatures(accession) ! # * getRelatedFeatures(accession, start, stop) ! # * getRelatedFeaturesSeq(accession, start, stop) # # === References *************** *** 154,162 **** class DDBJ < XML SERVER_URI = BASE_URI + "DDBJ.wsdl" - - # returns a Bio::DDBJ::XML::DDBJ object. - def initialize(wsdl = nil) - super(wsdl || SERVER_URI) - end end --- 148,151 ---- *************** *** 179,184 **** # === WSDL Methods # ! # ==== searchSimple(program, database, query) ! # ==== searchParam(program, database, query, param) # # === References --- 168,173 ---- # === WSDL Methods # ! # * searchSimple(program, database, query) ! # * searchParam(program, database, query, param) # # === References *************** *** 188,196 **** class Fasta < XML SERVER_URI = BASE_URI + "Fasta.wsdl" - - # returns a Bio::DDBJ::XML::Fasta object. - def initialize(wsdl = nil) - super(wsdl || SERVER_URI) - end end --- 177,180 ---- *************** *** 210,242 **** # === WSDL Methods # ! # ==== getEntry(database, var, param1, param2) ! # ==== getEntry(database, var) ! # ==== getDDBJEntry(accession) ! # ==== getDDBJCONEntry(accession) ! # ==== getDDBJVerEntry(accession) ! # ==== getLocus_DDBJEntry(locus) ! # ==== getGene_DDBJEntry(gene) ! # ==== getProd_DDBJEntry(products) ! # ==== getPID_DDBJEntry(pid) ! # ==== getClone_DDBJEntry(clone) ! # ==== getXML_DDBJEntry(accession) ! # ==== getEMBLEntry(accession) ! # ==== getSWISSEntry(accession) ! # ==== getPIREntry(accession) ! # ==== getPRFEntry(accession) ! # ==== getPDBEntry(accession) ! # ==== getQVEntry(accession) ! # ==== getDADEntry(accession) ! # ==== getPID_DADEntry(pid) ! # ==== getFASTA_DDBJEntry(accession) ! # ==== getFASTA_DDBJCONEntry(accession) ! # ==== getFASTA_DDBJVerEntry(accession) ! # ==== getFASTA_DDBJSeqEntry(accession, start, end) ! # ==== getFASTA_DADEntry(accession) ! # ==== getFASTA_PIREntry(accession) ! # ==== getFASTA_SWISSEntry(accession) ! # ==== getFASTA_PDBEntry(accession) ! # ==== getFASTA_PRFEntry(accession) ! # ==== getFASTA_CDSEntry(accession) # # === References --- 194,226 ---- # === WSDL Methods # ! # * getEntry(database, var, param1, param2) ! # * getEntry(database, var) ! # * getDDBJEntry(accession) ! # * getDDBJCONEntry(accession) ! # * getDDBJVerEntry(accession) ! # * getLocus_DDBJEntry(locus) ! # * getGene_DDBJEntry(gene) ! # * getProd_DDBJEntry(products) ! # * getPID_DDBJEntry(pid) ! # * getClone_DDBJEntry(clone) ! # * getXML_DDBJEntry(accession) ! # * getEMBLEntry(accession) ! # * getSWISSEntry(accession) ! # * getPIREntry(accession) ! # * getPRFEntry(accession) ! # * getPDBEntry(accession) ! # * getQVEntry(accession) ! # * getDADEntry(accession) ! # * getPID_DADEntry(pid) ! # * getFASTA_DDBJEntry(accession) ! # * getFASTA_DDBJCONEntry(accession) ! # * getFASTA_DDBJVerEntry(accession) ! # * getFASTA_DDBJSeqEntry(accession, start, end) ! # * getFASTA_DADEntry(accession) ! # * getFASTA_PIREntry(accession) ! # * getFASTA_SWISSEntry(accession) ! # * getFASTA_PDBEntry(accession) ! # * getFASTA_PRFEntry(accession) ! # * getFASTA_CDSEntry(accession) # # === References *************** *** 246,254 **** class GetEntry < XML SERVER_URI = BASE_URI + "GetEntry.wsdl" - - # returns a Bio::DDBJ::XML::GetEntry object. - def initialize(wsdl = nil) - super(wsdl || SERVER_URI) - end end --- 230,233 ---- *************** *** 277,291 **** # === WSDL Methods # ! # ==== getOrganismList ! # ==== getChIDList ! # ==== getOrganismNameFromChid(chid) ! # ==== getChIDFromOrganismName(orgName) ! # ==== getAccession(chid) ! # ==== getPieceNumber(chid) ! # ==== getDivision(chid) ! # ==== getType(chid) ! # ==== getFlatFile(chid) ! # ==== getFastaFile(chid, type) ! # ==== getCDS(chid) # # === References --- 256,270 ---- # === WSDL Methods # ! # * getOrganismList ! # * getChIDList ! # * getOrganismNameFromChid(chid) ! # * getChIDFromOrganismName(orgName) ! # * getAccession(chid) ! # * getPieceNumber(chid) ! # * getDivision(chid) ! # * getType(chid) ! # * getFlatFile(chid) ! # * getFastaFile(chid, type) ! # * getCDS(chid) # # === References *************** *** 295,303 **** class Gib < XML SERVER_URI = BASE_URI + "Gib.wsdl" - - # returns a Bio::DDBJ::XML::Gib object. - def initialize(wsdl = nil) - super(wsdl || SERVER_URI) - end end --- 274,277 ---- *************** *** 317,322 **** # === WSDL Methods # ! # ==== getOrganismList ! # ==== getMasterInfo(orfID, organism) # # === References --- 291,296 ---- # === WSDL Methods # ! # * getOrganismList ! # * getMasterInfo(orfID, organism) # # === References *************** *** 326,334 **** class Gtop < XML SERVER_URI = BASE_URI + "Gtop.wsdl" - - # returns a Bio::DDBJ::XML::Gtop object. - def initialize(wsdl = nil) - super(wsdl || SERVER_URI) - end end --- 300,303 ---- *************** *** 347,356 **** # === WSDL Methods # ! # ==== searchVariation(field, query, order) ! # ==== searchVariationSimple(field, query) ! # ==== searchFrequency(field, query, order) ! # ==== searchFrequencySimple(field, query) ! # ==== getVariation(variation_id) ! # ==== getFrequency(variation_id, population_id) # # === References --- 316,325 ---- # === WSDL Methods # ! # * searchVariation(field, query, order) ! # * searchVariationSimple(field, query) ! # * searchFrequency(field, query, order) ! # * searchFrequencySimple(field, query) ! # * getVariation(variation_id) ! # * getFrequency(variation_id, population_id) # # === References *************** *** 360,368 **** class PML < XML SERVER_URI = BASE_URI + "PML.wsdl" - - # returns a Bio::DDBJ::XML::PML object. - def initialize(wsdl = nil) - super(wsdl || SERVER_URI) - end end --- 329,332 ---- *************** *** 382,387 **** # === WSDL Methods # ! # ==== searchSimple(query) ! # ==== searchParam(query, param) # # === Examples --- 346,351 ---- # === WSDL Methods # ! # * searchSimple(query) ! # * searchParam(query, param) # # === Examples *************** *** 391,399 **** class SRS < XML SERVER_URI = BASE_URI + "SRS.wsdl" - - # returns a Bio::DDBJ::XML::SRS object. - def initialize(wsdl = nil) - super(wsdl || SERVER_URI) - end end --- 355,358 ---- *************** *** 419,427 **** # === WSDL Methdos # ! # ==== searchSimple(tx_Name) ! # ==== searchParam(tx_Name, tx_Clas, tx_Rank, tx_Rmax, tx_Dcls) ! # ==== getTxId(tx_Name) ! # ==== getTxName(tx_Id) ! # ==== searchLineage(query, ranks, superkingdom) # # === References --- 378,386 ---- # === WSDL Methdos # ! # * searchSimple(tx_Name) ! # * searchParam(tx_Name, tx_Clas, tx_Rank, tx_Rmax, tx_Dcls) ! # * getTxId(tx_Name) ! # * getTxName(tx_Id) ! # * searchLineage(query, ranks, superkingdom) # # === References *************** *** 431,439 **** class TxSearch < XML SERVER_URI = BASE_URI + "TxSearch.wsdl" - - # returns a Bio::DDBJ::XML::TxSearch object. - def initialize(wsdl = nil) - super(wsdl || SERVER_URI) - end end --- 390,393 ---- From k at dev.open-bio.org Tue Sep 19 01:45:50 2006 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Tue, 19 Sep 2006 05:45:50 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/io keggapi.rb,1.12,1.13 Message-ID: <200609190545.k8J5joPl031387@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/io In directory dev.open-bio.org:/tmp/cvs-serv31383/lib/bio/io Modified Files: keggapi.rb Log Message: * documentations are moved to RDoc Index: keggapi.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/io/keggapi.rb,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** keggapi.rb 14 Jul 2006 14:48:56 -0000 1.12 --- keggapi.rb 19 Sep 2006 05:45:48 -0000 1.13 *************** *** 1,22 **** # ! # bio/io/keggapi.rb - KEGG API access class ! # ! # Copyright (C) 2003, 2004 KATAYAMA Toshiaki ! # ! # This library is free software; you can redistribute it and/or ! # modify it under the terms of the GNU Lesser General Public ! # License as published by the Free Software Foundation; either ! # version 2 of the License, or (at your option) any later version. ! # ! # This library is distributed in the hope that it will be useful, ! # but WITHOUT ANY WARRANTY; without even the implied warranty of ! # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! # Lesser General Public License for more details. # ! # You should have received a copy of the GNU Lesser General Public ! # License along with this library; if not, write to the Free Software ! # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # ! # $Id$ # --- 1,9 ---- # ! # = bio/io/keggapi.rb - KEGG API access class # ! # Copyright:: Copyright (C) 2003, 2004 Toshiaki Katayama ! # License:: Ruby's # ! # $Id$ # *************** *** 29,36 **** --- 16,197 ---- class KEGG + # == Description + # + # KEGG API is a web service to use KEGG system via SOAP/WSDL. + # + # == References + # + # For more informations on KEGG API, see the following site and read the + # reference manual. + # + # * http://www.genome.jp/kegg/soap/ + # * http://www.genome.jp/kegg/soap/doc/keggapi_manual.html + # + # == List of methods + # + # As of KEGG API v5.0 + # + # * list_databases + # * list_organisms + # * list_pathways(org) + # * binfo(string) + # * bget(string) + # * bfind(string) + # * btit(string) + # * get_linkdb_by_entry(entry_id, db, start, max_results) + # * get_best_best_neighbors_by_gene(genes_id, start, max_results) + # * get_best_neighbors_by_gene(genes_id, start, max_results) + # * get_reverse_best_neighbors_by_gene(genes_id, start, max_results) + # * get_paralogs_by_gene(genes_id, start, max_results) + # * get_similarity_between_genes(genes_id1, genes_id2) + # * get_motifs_by_gene(genes_id, db) + # * get_genes_by_motifs(motif_id_list, start, max_results) + # * get_ko_by_gene(genes_id) + # * get_ko_members(ko_id) + # * get_oc_members_by_gene(genes_id, start, max_results) + # * get_pc_members_by_gene(genes_id, start, max_results) + # * mark_pathway_by_objects(pathway_id, object_id_list) + # * color_pathway_by_objects(pathway_id, object_id_list, fg_color_list, bg_color_list) + # * get_genes_by_pathway(pathway_id) + # * get_enzymes_by_pathway(pathway_id) + # * get_compounds_by_pathway(pathway_id) + # * get_reactions_by_pathway(pathway_id) + # * get_pathways_by_genes(genes_id_list) + # * get_pathways_by_enzymes(enzyme_id_list) + # * get_pathways_by_compounds(compound_id_list) + # * get_pathways_by_reactions(reaction_id_list) + # * get_linked_pathways(pathway_id) + # * get_genes_by_enzyme(enzyme_id, org) + # * get_enzymes_by_gene(genes_id) + # * get_enzymes_by_compound(compound_id) + # * get_enzymes_by_reaction(reaction_id) + # * get_compounds_by_enzyme(enzyme_id) + # * get_compounds_by_reaction(reaction_id) + # * get_reactions_by_enzyme(enzyme_id) + # * get_reactions_by_compound(compound_id) + # * get_genes_by_organism(org, start, max_results) + # * get_number_of_genes_by_organism(org) + # + # == KEGG API methods implemented only in BioRuby + # + # In BioRuby, returned values are added filter method to pick up + # values in a complex data type as an array. + # + # #!/usr/bin/env ruby + # + # require 'bio' + # + # serv = Bio::KEGG::API.new + # results = serv.get_best_neighbors_by_gene("eco:b0002", "bsu") + # + # # case 0 : without filter + # results.each do |hit| + # print hit.genes_id1, "\t", hit.genes_id2, "\t", hit.sw_score, "\n" + # end + # + # # case 1 : select gene names and SW score only + # fields = [:genes_id1, :genes_id2, :sw_score] + # results.each do |hit| + # puts hit.filter(fields).join("\t") + # end + # + # # case 2 : also uses aligned position in each amino acid sequence etc. + # fields1 = [:genes_id1, :start_position1, :end_position1, :best_flag_1to2] + # fields2 = [:genes_id2, :start_position2, :end_position2, :best_flag_2to1] + # results.each do |hit| + # print "> score: ", hit.sw_score, ", identity: ", hit.identity, "\n" + # print "1:\t", hit.filter(fields1).join("\t"), "\n" + # print "2:\t", hit.filter(fields2).join("\t"), "\n" + # end + # + # Using filter method will make it easy to change fields to select and + # keep the script clean. + # + # * Bio::KEGG::API#get_all_neighbors_by_gene(genes_id, org) + # * Bio::KEGG::API#get_all_best_best_neighbors_by_gene(genes_id) + # * Bio::KEGG::API#get_all_best_neighbors_by_gene(genes_id) + # * Bio::KEGG::API#get_all_reverse_best_neighbors_by_gene(genes_id) + # * Bio::KEGG::API#get_all_paralogs_by_gene(genes_id) + # * Bio::KEGG::API#get_all_genes_by_motifs(motif_id_list) + # * Bio::KEGG::API#get_all_oc_members_by_gene(genes_id) + # * Bio::KEGG::API#get_all_pc_members_by_gene(genes_id) + # * Bio::KEGG::API#get_all_genes_by_organism(org) + # + # These methods are wrapper for the methods without _all_ in its name + # and internally iterate to retrive all the results using start/max_results + # value pairs described above. For example, + # + # #!/usr/bin/env ruby + # + # require 'soap/wsdlDriver' + # + # wsdl = "http://soap.genome.jp/KEGG.wsdl" + # serv = SOAP::WSDLDriverFactory.new(wsdl).create_driver + # serv.generate_explicit_type = true + # + # start = 1 + # max_results = 100 + # + # loop do + # results = serv.get_best_neighbors_by_gene('eco:b0002', start, max_results) + # break unless results # when no more results returned + # results.each do |hit| + # print hit.genes_id1, "\t", hit.genes_id2, "\t", hit.sw_score, "\n" + # end + # start += max_results + # end + # + # can be witten as + # + # #!/usr/bin/env ruby + # + # require 'bio' + # + # serv = Bio::KEGG::API.new + # + # results = serv.get_all_best_neighbors_by_gene('eco:b0002') + # results.each do |hit| + # print hit.genes_id1, "\t", hit.genes_id2, "\t", hit.sw_score, "\n" + # end + # + # + # * Bio::KEGG::API#save_image(url, filename = nil) + # + # Some methods of the KEGG API will return a URL of the generated image. + # This method save an image specified by the URL. The filename can be + # specified by its second argument, otherwise basename of the URL will + # be used. + # + # #!/usr/bin/env ruby + # + # require 'bio' + # + # serv = Bio::KEGG::API.new("http://soap.genome.jp/v3.0/KEGG.wsdl") + # + # list = ["eco:b1002", "eco:b2388"] + # url = serv.mark_pathway_by_objects("path:eco00010", list) + # + # # Save with the original filename (eco00010.gif in this case) + # serv.save_image(url) + # + # # or save as "save_image.gif" + # serv.save_image(url, "save_image.gif") + # + # * Bio::KEGG::API#get_entries(entry_id_list) + # * Bio::KEGG::API#get_aaseqs(entry_id_list) + # * Bio::KEGG::API#get_naseqs(entry_id_list) + # * Bio::KEGG::API#get_definitions(entry_id_list) + # + # These methods are for the shortcut and backward compatibility + # (these methods existed in the older version of the KEGG API). + # class API < Bio::SOAPWSDL SERVER_URI = "http://soap.genome.jp/KEGG.wsdl" + # Connect to the KEGG API's SOAP server. A WSDL file will be automatically + # downloaded and parsed to generate the SOAP client driver. The default URL + # for the WSDL is http://soap.genome.jp/KEGG.wsdl but it can be changed by + # the argument or by wsdl= method. def initialize(wsdl = nil) @wsdl = wsdl || SERVER_URI *************** *** 40,44 **** create_driver end ! attr_accessor :start, :max_results def method_missing(*arg) --- 201,215 ---- create_driver end ! ! # Returns current value for the 'start' count for the methods having ! # start/max_results argument pairs or changes the default value for ! # the 'start' count. ! attr_accessor :start ! ! # Returns current value for the 'max_results' number for the methods having ! # start/max_results argument pairs or changes the default value for the ! # 'max_results' count. If your request timeouts, try smaller value for ! # the max_results. ! attr_accessor :max_results def method_missing(*arg) *************** *** 52,55 **** --- 223,227 ---- end + # def get_all_neighbors_by_gene(genes_id, org) # get_all(:get_neighbors_by_gene, genes_id, org) *************** *** 202,206 **** # serv.log = STDERR ! puts "--- parameters" puts " wsdl : #{serv.wsdl}" puts " log : #{serv.log}" --- 374,378 ---- # serv.log = STDERR ! puts "# * parameters" puts " wsdl : #{serv.wsdl}" puts " log : #{serv.log}" *************** *** 254,270 **** puts serv.btit("eco:b0002 eco:b0003") ! puts "--- get_entries(['eco:b0002', 'eco:b0003'])" puts serv.get_entries(["eco:b0002", "eco:b0003"]) ! puts "--- get_aaseqs(['eco:b0002', 'eco:b0003'])" puts serv.get_aaseqs(["eco:b0002", "eco:b0003"]) ! puts "--- get_naseqs(['eco:b0002', 'eco:b0003'])" puts serv.get_naseqs(["eco:b0002", "eco:b0003"]) ! puts "--- get_definitions(['eco:b0002', 'eco:b0003'])" puts serv.get_definitions(["eco:b0002", "eco:b0003"]) ! puts "--- get_definitions(('eco:b0001'..'eco:b0200').to_a)" puts serv.get_definitions(("eco:b0001".."eco:b0200").to_a) --- 426,442 ---- puts serv.btit("eco:b0002 eco:b0003") ! puts "# * get_entries(['eco:b0002', 'eco:b0003'])" puts serv.get_entries(["eco:b0002", "eco:b0003"]) ! puts "# * get_aaseqs(['eco:b0002', 'eco:b0003'])" puts serv.get_aaseqs(["eco:b0002", "eco:b0003"]) ! puts "# * get_naseqs(['eco:b0002', 'eco:b0003'])" puts serv.get_naseqs(["eco:b0002", "eco:b0003"]) ! puts "# * get_definitions(['eco:b0002', 'eco:b0003'])" puts serv.get_definitions(["eco:b0002", "eco:b0003"]) ! puts "# * get_definitions(('eco:b0001'..'eco:b0200').to_a)" puts serv.get_definitions(("eco:b0001".."eco:b0200").to_a) *************** *** 277,281 **** end ! puts "--- get_all_linkdb_by_entry('eco:b0002', 'pathway')" list = serv.get_all_linkdb_by_entry("eco:b0002", "pathway") list.each do |link| --- 449,453 ---- end ! puts "# * get_all_linkdb_by_entry('eco:b0002', 'pathway')" list = serv.get_all_linkdb_by_entry("eco:b0002", "pathway") list.each do |link| *************** *** 291,295 **** end ! puts "--- get_all_neighbors_by_gene('eco:b0002', 'bsu')" list = serv.get_all_neighbors_by_gene("eco:b0002", "bsu") list.each do |hit| --- 463,467 ---- end ! puts "# * get_all_neighbors_by_gene('eco:b0002', 'bsu')" list = serv.get_all_neighbors_by_gene("eco:b0002", "bsu") list.each do |hit| *************** *** 303,307 **** end ! puts "--- get_all_best_best_neighbors_by_gene('eco:b0002')" list = serv.get_all_best_best_neighbors_by_gene("eco:b0002") list.each do |hit| --- 475,479 ---- end ! puts "# * get_all_best_best_neighbors_by_gene('eco:b0002')" list = serv.get_all_best_best_neighbors_by_gene("eco:b0002") list.each do |hit| *************** *** 315,319 **** end ! puts "--- get_all_best_neighbors_by_gene('eco:b0002')" list = serv.get_all_best_neighbors_by_gene("eco:b0002") list.each do |hit| --- 487,491 ---- end ! puts "# * get_all_best_neighbors_by_gene('eco:b0002')" list = serv.get_all_best_neighbors_by_gene("eco:b0002") list.each do |hit| *************** *** 327,331 **** end ! puts "--- get_all_reverse_best_neighbors_by_gene('eco:b0002')" list = serv.get_all_reverse_best_neighbors_by_gene("eco:b0002") list.each do |hit| --- 499,503 ---- end ! puts "# * get_all_reverse_best_neighbors_by_gene('eco:b0002')" list = serv.get_all_reverse_best_neighbors_by_gene("eco:b0002") list.each do |hit| *************** *** 339,343 **** end ! puts "--- get_all_paralogs_by_gene('eco:b0002')" list = serv.get_all_paralogs_by_gene("eco:b0002") list.each do |hit| --- 511,515 ---- end ! puts "# * get_all_paralogs_by_gene('eco:b0002')" list = serv.get_all_paralogs_by_gene("eco:b0002") list.each do |hit| *************** *** 393,397 **** list = serv.get_motifs_by_gene("eco:b0002", "all") list.each do |motif| ! puts "--- motif result" puts " motif_id : #{motif.motif_id}" puts " definition : #{motif.definition}" --- 565,569 ---- list = serv.get_motifs_by_gene("eco:b0002", "all") list.each do |motif| ! puts "# * motif result" puts " motif_id : #{motif.motif_id}" puts " definition : #{motif.definition}" *************** *** 409,413 **** end ! puts "--- get_all_genes_by_motifs(['pf:ACT', 'ps:ASPARTOKINASE'])" list = serv.get_all_genes_by_motifs(["pf:ACT", "ps:ASPARTOKINASE"]) list.each do |gene| --- 581,585 ---- end ! puts "# * get_all_genes_by_motifs(['pf:ACT', 'ps:ASPARTOKINASE'])" list = serv.get_all_genes_by_motifs(["pf:ACT", "ps:ASPARTOKINASE"]) list.each do |gene| *************** *** 435,439 **** end ! puts "--- get_all_oc_members_by_gene('eco:b0002')" list = serv.get_all_oc_members_by_gene("eco:b0002") list.each do |gene| --- 607,611 ---- end ! puts "# * get_all_oc_members_by_gene('eco:b0002')" list = serv.get_all_oc_members_by_gene("eco:b0002") list.each do |gene| *************** *** 447,451 **** end ! puts "--- get_all_pc_members_by_gene('eco:b0002')" list = serv.get_all_pc_members_by_gene("eco:b0002") list.each do |gene| --- 619,623 ---- end ! puts "# * get_all_pc_members_by_gene('eco:b0002')" list = serv.get_all_pc_members_by_gene("eco:b0002") list.each do |gene| *************** *** 473,477 **** puts url ! #puts "--- save_image(#{url})" #filename = serv.save_image(url, "test.gif") #filename = serv.save_image(url) --- 645,649 ---- puts url ! #puts "# * save_image(#{url})" #filename = serv.save_image(url, "test.gif") #filename = serv.save_image(url) *************** *** 618,622 **** end ! puts "--- get_all_genes_by_organism('mge')" list = serv.get_all_genes_by_organism("mge") list.each do |gene| --- 790,794 ---- end ! puts "# * get_all_genes_by_organism('mge')" list = serv.get_all_genes_by_organism("mge") list.each do |gene| *************** *** 631,864 **** end - - =begin - - = Bio::KEGG::API - - KEGG API is a web service to use KEGG system via SOAP/WSDL. For more - informations on KEGG API, see the following site and its reference manual. - - * (()) - - --- Bio::KEGG::API.new(wsdl = nil) - - Connect to the KEGG API's SOAP server. A WSDL file will be automatically - downloaded and parsed to generate the SOAP client driver. The default URL - for the WSDL is http://soap.genome.jp/KEGG.wsdl but it can be changed by - the argument or by wsdl= method. - - --- Bio::KEGG::API#wsdl - - Returns URL of the current WSDL file. - - --- Bio::KEGG::API#wsdl=(url) - - Change the URL for WSDL file of the KEGG API if needed for some reason: - - serv = Bio::KEGG::API.new("http://133.103.100.186/KEGG.wsdl") - - or - - serv = Bio::KEGG::API.new - serv.wsdl = "http://133.103.100.186/KEGG.wsdl" - - note that both can't read two or more different WSDL files. - - --- Bio::KEGG::API#log - - Returns current logging IO. - - --- Bio::KEGG::API#log=(io) - - Change the IO for logging. The argument is passed to wiredump_dev method - of the SOAP4R, thus - - serv = Bio::KEGG::API.new - serv.log = STDERR - - will print all the SOAP transactions in standard error. - This feature is especially useful for debug. - - --- Bio::KEGG::API#start - - Returns current value for the 'start' count for the methods having - start/max_results argument pairs. - - --- Bio::KEGG::API#start=(number) - - Changes the default value for the 'start' count. - - --- Bio::KEGG::API#max_results - - Returns current value for the 'max_results' number for the methods having - start/max_results argument pairs. - - --- Bio::KEGG::API#max_results=(number) - - Changes the default value for the 'max_results' count. - If your request timeouts, try smaller value for the max_results. - - === KEGG API methods implemented only in BioRuby - - In BioRuby, returned values are added filter method to pick up - values in a complex data type as an array. - - #!/usr/bin/env ruby - - require 'bio' - - serv = Bio::KEGG::API.new - results = serv.get_best_neighbors_by_gene("eco:b0002", "bsu") - - # case 0 : without filter - results.each do |hit| - print hit.genes_id1, "\t", hit.genes_id2, "\t", hit.sw_score, "\n" - end - - # case 1 : select gene names and SW score only - fields = [:genes_id1, :genes_id2, :sw_score] - results.each do |hit| - puts hit.filter(fields).join("\t") - end - - # case 2 : also uses aligned position in each amino acid sequence etc. - fields1 = [:genes_id1, :start_position1, :end_position1, :best_flag_1to2] - fields2 = [:genes_id2, :start_position2, :end_position2, :best_flag_2to1] - results.each do |hit| - print "> score: ", hit.sw_score, ", identity: ", hit.identity, "\n" - print "1:\t", hit.filter(fields1).join("\t"), "\n" - print "2:\t", hit.filter(fields2).join("\t"), "\n" - end - - Using filter method will make it easy to change fields to select and - keep the script clean. - - - --- Bio::KEGG::API#get_all_neighbors_by_gene(genes_id, org) - --- Bio::KEGG::API#get_all_best_best_neighbors_by_gene(genes_id) - --- Bio::KEGG::API#get_all_best_neighbors_by_gene(genes_id) - --- Bio::KEGG::API#get_all_reverse_best_neighbors_by_gene(genes_id) - --- Bio::KEGG::API#get_all_paralogs_by_gene(genes_id) - --- Bio::KEGG::API#get_all_genes_by_motifs(motif_id_list) - --- Bio::KEGG::API#get_all_oc_members_by_gene(genes_id) - --- Bio::KEGG::API#get_all_pc_members_by_gene(genes_id) - --- Bio::KEGG::API#get_all_genes_by_organism(org) - - These methods are wrapper for the methods without _all_ in its name - and internally iterate to retrive all the results using start/max_results - value pairs described above. For example, - - #!/usr/bin/env ruby - - require 'soap/wsdlDriver' - - wsdl = "http://soap.genome.jp/KEGG.wsdl" - serv = SOAP::WSDLDriverFactory.new(wsdl).create_driver - serv.generate_explicit_type = true - - start = 1 - max_results = 100 - - loop do - results = serv.get_best_neighbors_by_gene('eco:b0002', start, max_results) - break unless results # when no more results returned - results.each do |hit| - print hit.genes_id1, "\t", hit.genes_id2, "\t", hit.sw_score, "\n" - end - start += max_results - end - - can be witten as - - #!/usr/bin/env ruby - - require 'bio' - - serv = Bio::KEGG::API.new - - results = serv.get_all_best_neighbors_by_gene('eco:b0002') - results.each do |hit| - print hit.genes_id1, "\t", hit.genes_id2, "\t", hit.sw_score, "\n" - end - - - --- Bio::KEGG::API#save_image(url, filename = nil) - - Some methods of the KEGG API will return a URL of the generated image. - This method save an image specified by the URL. The filename can be - specified by its second argument, otherwise basename of the URL will - be used. - - #!/usr/bin/env ruby - - require 'bio' - - serv = Bio::KEGG::API.new("http://soap.genome.jp/v3.0/KEGG.wsdl") - - list = ["eco:b1002", "eco:b2388"] - url = serv.mark_pathway_by_objects("path:eco00010", list) - - # Save with the original filename (eco00010.gif in this case) - serv.save_image(url) - - # or save as "save_image.gif" - serv.save_image(url, "save_image.gif") - - --- Bio::KEGG::API#get_entries(entry_id_list) - --- Bio::KEGG::API#get_aaseqs(entry_id_list) - --- Bio::KEGG::API#get_naseqs(entry_id_list) - --- Bio::KEGG::API#get_definitions(entry_id_list) - - For the shortcut and backward compatibility. - - - === General KEGG API methods - - For the methods listed below, consult the KEGG API manual at - - * (()) - - --- list_databases - --- list_organisms - --- list_pathways(org) - --- binfo(string) - --- bget(string) - --- bfind(string) - --- btit(string) - --- get_linkdb_by_entry(entry_id, db, start, max_results) - #--- get_neighbors_by_gene(genes_id, org, start, max_results) - --- get_best_best_neighbors_by_gene(genes_id, start, max_results) - --- get_best_neighbors_by_gene(genes_id, start, max_results) - --- get_reverse_best_neighbors_by_gene(genes_id, start, max_results) - --- get_paralogs_by_gene(genes_id, start, max_results) - --- get_similarity_between_genes(genes_id1, genes_id2) - --- get_motifs_by_gene(genes_id, db) - --- get_genes_by_motifs(motif_id_list, start, max_results) - --- get_ko_by_gene(genes_id) - --- get_ko_members(ko_id) - --- get_oc_members_by_gene(genes_id, start, max_results) - --- get_pc_members_by_gene(genes_id, start, max_results) - --- mark_pathway_by_objects(pathway_id, object_id_list) - --- color_pathway_by_objects(pathway_id, object_id_list, fg_color_list, bg_color_list) - --- get_genes_by_pathway(pathway_id) - --- get_enzymes_by_pathway(pathway_id) - --- get_compounds_by_pathway(pathway_id) - --- get_reactions_by_pathway(pathway_id) - --- get_pathways_by_genes(genes_id_list) - --- get_pathways_by_enzymes(enzyme_id_list) - --- get_pathways_by_compounds(compound_id_list) - --- get_pathways_by_reactions(reaction_id_list) - --- get_linked_pathways(pathway_id) - --- get_genes_by_enzyme(enzyme_id, org) - --- get_enzymes_by_gene(genes_id) - --- get_enzymes_by_compound(compound_id) - --- get_enzymes_by_reaction(reaction_id) - --- get_compounds_by_enzyme(enzyme_id) - --- get_compounds_by_reaction(reaction_id) - --- get_reactions_by_enzyme(enzyme_id) - --- get_reactions_by_compound(compound_id) - --- get_genes_by_organism(org, start, max_results) - --- get_number_of_genes_by_organism(org) - - =end - --- 803,804 ---- From k at dev.open-bio.org Tue Sep 19 01:46:24 2006 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Tue, 19 Sep 2006 05:46:24 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/io higet.rb,1.2,1.3 Message-ID: <200609190546.k8J5kO59031430@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/io In directory dev.open-bio.org:/tmp/cvs-serv31426/lib/bio/io Modified Files: higet.rb Log Message: * changed from LGPL to Ruby's Index: higet.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/io/higet.rb,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** higet.rb 26 Sep 2005 13:00:08 -0000 1.2 --- higet.rb 19 Sep 2006 05:46:22 -0000 1.3 *************** *** 1,22 **** # ! # bio/io/higet.rb - SOAP interface for HGC HiGet ! # ! # Copyright (C) 2005 KATAYAMA Toshiaki ! # ! # This library is free software; you can redistribute it and/or ! # modify it under the terms of the GNU Lesser General Public ! # License as published by the Free Software Foundation; either ! # version 2 of the License, or (at your option) any later version. ! # ! # This library is distributed in the hope that it will be useful, ! # but WITHOUT ANY WARRANTY; without even the implied warranty of ! # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! # Lesser General Public License for more details. # ! # You should have received a copy of the GNU Lesser General Public ! # License along with this library; if not, write to the Free Software ! # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # ! # $Id$ # --- 1,8 ---- # ! # = bio/io/higet.rb - SOAP interface for HGC HiGet # ! # Copyright:: Copyright (C) 2005 Toshiaki Katayama # ! # $Id$ # *************** *** 26,29 **** --- 12,24 ---- class HGC + # == Description + # + # Interface for the HiGet service provided by Human Genome Center (HGC), Japan. + # HiGet performs full-text search against various biological databases. + # + # == References + # + # * http://higet.hgc.jp/ + # class HiGet < Bio::SOAPWSDL *************** *** 77,92 **** end - - =begin - - = Bio::HGC::HiGet - - * (()) - - == HiGet#hifind - == HiGet#higet - == HiGet#higet_in_fasta - == HiGet#higet_in_xml - - =end - --- 72,73 ---- From k at dev.open-bio.org Tue Sep 19 01:47:54 2006 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Tue, 19 Sep 2006 05:47:54 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/io pubmed.rb,1.14,1.15 Message-ID: <200609190547.k8J5lsL4031491@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/io In directory dev.open-bio.org:/tmp/cvs-serv31487/lib/bio/io Modified Files: pubmed.rb Log Message: * changed from LGPL to Ruby's * minor change of doc format Index: pubmed.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/io/pubmed.rb,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** pubmed.rb 14 Jul 2006 14:48:56 -0000 1.14 --- pubmed.rb 19 Sep 2006 05:47:52 -0000 1.15 *************** *** 1,23 **** # ! # bio/io/pubmed.rb - NCBI Entrez/PubMed client module ! # ! # Copyright (C) 2001 KATAYAMA Toshiaki ! # 2006 Jan Aerts ! # ! # This library is free software; you can redistribute it and/or ! # modify it under the terms of the GNU Lesser General Public ! # License as published by the Free Software Foundation; either ! # version 2 of the License, or (at your option) any later version. ! # ! # This library is distributed in the hope that it will be useful, ! # but WITHOUT ANY WARRANTY; without even the implied warranty of ! # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! # Lesser General Public License for more details. # ! # You should have received a copy of the GNU Lesser General Public ! # License along with this library; if not, write to the Free Software ! # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # ! # $Id$ # --- 1,10 ---- # ! # = bio/io/pubmed.rb - NCBI Entrez/PubMed client module # ! # Copyright:: Copyright (C) 2001 Toshiaki Katayama ! # Copyright:: Copyright (C) 2006 Jan Aerts ! # License:: Ruby's # ! # $Id$ # *************** *** 28,203 **** module Bio ! # = DESCRIPTION ! # The Bio::PubMed class provides several ways to retrieve bibliographic ! # information from the PubMed database at ! # http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=PubMed. Basically, two ! # types of queries are possible: ! # * searching for PubMed IDs given a query string: ! # * Bio::PubMed#search ! # * Bio::PubMed#esearch ! # * retrieving the MEDLINE text (i.e. authors, journal, abstract, ...) given a PubMed ID ! # * Bio::PubMed#query ! # * Bio::PubMed#pmfetch ! # * Bio::PubMed#efetch ! # ! # The different methods within the same group are interchangeable and should ! # return the same result. ! # ! # Additional information about the MEDLINE format and PubMed programmable ! # APIs can be found on the following websites: ! # * Overview: http://www.ncbi.nlm.nih.gov/entrez/query/static/overview.html ! # * How to link: http://www.ncbi.nlm.nih.gov/entrez/query/static/linking.html ! # * MEDLINE format: http://www.ncbi.nlm.nih.gov/entrez/query/static/help/pmhelp.html#MEDLINEDisplayFormat ! # * Search field descriptions and tags: http://www.ncbi.nlm.nih.gov/entrez/query/static/help/pmhelp.html#SearchFieldDescriptionsandTags ! # * Entrez utilities index: http://www.ncbi.nlm.nih.gov/entrez/utils/utils_index.html ! # * PmFetch CGI help: http://www.ncbi.nlm.nih.gov/entrez/utils/pmfetch_help.html ! # * E-Utilities CGI help: http://eutils.ncbi.nlm.nih.gov/entrez/query/static/eutils_help.html ! # ! # = USAGE ! # require 'bio' ! # ! # # If you don't know the pubmed ID: ! # Bio::PubMed.search("(genome AND analysis) OR bioinformatics)").each do |x| ! # p x ! # end ! # Bio::PubMed.esearch("(genome AND analysis) OR bioinformatics)").each do |x| ! # p x ! # end ! # ! # # To retrieve the MEDLINE entry for a given PubMed ID: ! # puts Bio::PubMed.query("10592173") ! # puts Bio::PubMed.pmfetch("10592173") ! # puts Bio::PubMed.efetch("10592173", "14693808") ! # # This can be converted into a Bio::MEDLINE object: ! # manuscript = Bio::PubMed.query("10592173") ! # medline = Bio::MEDLINE(manuscript) ! # ! # = REMARK ! # This class can not be used at the moment if you're behind a proxy server. This will be solved in the near future. ! class PubMed ! # Search the PubMed database by given keywords using entrez query and returns ! # an array of PubMed IDs. ! # --- ! # *Arguments*: ! # * _id_: query string (required) ! # *Returns*:: array of PubMed IDs ! def self.search(str) ! host = "www.ncbi.nlm.nih.gov" ! path = "/entrez/query.fcgi?tool=bioruby&cmd=Search&doptcmdl=MEDLINE&db=PubMed&term=" ! http = Bio::Command.new_http(host) ! response, = http.get(path + CGI.escape(str)) ! result = response.body ! result = result.gsub("\r", "\n").squeeze("\n") ! result = result.scan(/
(.*?)<\/pre>/m).flatten
!       return result
!     end
  
!     # Search the PubMed database by given keywords using E-Utils and returns 
!     # an array of PubMed IDs.
!     # 
!     # For information on the possible arguments, see
!     # http://eutils.ncbi.nlm.nih.gov/entrez/query/static/esearch_help.html#PubMed
!     # ---
!     # *Arguments*:
!     # * _id_: query string (required)
!     # * _field_
!     # * _reldate_
!     # * _mindate_
!     # * _maxdate_
!     # * _datetype_
!     # * _retstart_
!     # * _retmax_ (default 100)
!     # * _retmode_
!     # * _rettype_
!     # *Returns*:: array of PubMed IDs
!     def self.esearch(str, hash = {})
!       hash['retmax'] = 100 unless hash['retmax']
  
!       opts = []
!       hash.each do |k, v|
!         opts << "#{k}=#{v}"
!       end
  
!       host = "eutils.ncbi.nlm.nih.gov"
!       path = "/entrez/eutils/esearch.fcgi?tool=bioruby&db=pubmed&#{opts.join('&')}&term="
  
!       http = Bio::Command.new_http(host)
!       response, = http.get(path + CGI.escape(str))
!       result = response.body
!       result = result.scan(/(.*?)<\/Id>/m).flatten
!       return result
!     end
  
!     # Retrieve PubMed entry by PMID and returns MEDLINE formatted string using
!     # entrez query.
!     # ---
!     # *Arguments*:
!     # * _id_: PubMed ID (required)
!     # *Returns*:: MEDLINE formatted String
!     def self.query(id)
!       host = "www.ncbi.nlm.nih.gov"
!       path = "/entrez/query.fcgi?tool=bioruby&cmd=Text&dopt=MEDLINE&db=PubMed&uid="
  
!       http = Bio::Command.new_http(host)
!       response, = http.get(path + id.to_s)
!       result = response.body
!       if result =~ /#{id}\s+Error/
!         raise( result )
!       else
!         result = result.gsub("\r", "\n").squeeze("\n").gsub(/<\/?pre>/, '')
!         return result
!       end
      end
  
!     # Retrieve PubMed entry by PMID and returns MEDLINE formatted string using
!     # entrez pmfetch.
!     # ---
!     # *Arguments*:
!     # * _id_: PubMed ID (required)
!     # *Returns*:: MEDLINE formatted String
!     def self.pmfetch(id)
!       host = "www.ncbi.nlm.nih.gov"
!       path = "/entrez/utils/pmfetch.fcgi?tool=bioruby&mode=text&report=medline&db=PubMed&id="
  
!       http = Bio::Command.new_http(host)
!       response, = http.get(path + id.to_s)
!       result = response.body
!       if result =~ /#{id}\s+Error/
!         raise( result )
!       else
!         result = result.gsub("\r", "\n").squeeze("\n").gsub(/<\/?pre>/, '')
!         return result
!       end
      end
  
!     # Retrieve PubMed entry by PMID and returns MEDLINE formatted string using
!     # entrez efetch. Multiple PubMed IDs can be provided:
!     #   Bio::PubMed.efetch(123)
!     #   Bio::PubMed.efetch(123,456,789)
!     #   Bio::PubMed.efetch([123,456,789])
!     # ---
!     # *Arguments*:
!     # * _ids_: list of PubMed IDs (required)
!     # *Returns*:: MEDLINE formatted String
!     def self.efetch(*ids)
!       return [] if ids.empty?
! 
!       host = "eutils.ncbi.nlm.nih.gov"
!       path = "/entrez/eutils/efetch.fcgi?tool=bioruby&db=pubmed&retmode=text&rettype=medline&id="
  
!       ids = ids.join(",")
  
!       http = Bio::Command.new_http(host)
!       response, = http.get(path + ids)
!       result = response.body
!       result = result.split(/\n\n+/)
!       return result
!     end
  
    end
  
! end
  
  
--- 15,194 ----
  module Bio
  
! # == Description
! #
! # The Bio::PubMed class provides several ways to retrieve bibliographic
! # information from the PubMed database at
! # http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=PubMed. Basically, two
! # types of queries are possible:
! #
! # * searching for PubMed IDs given a query string:
! #   * Bio::PubMed#search
! #   * Bio::PubMed#esearch
! #
! # * retrieving the MEDLINE text (i.e. authors, journal, abstract, ...)
! #   given a PubMed ID
! #   * Bio::PubMed#query
! #   * Bio::PubMed#pmfetch
! #   * Bio::PubMed#efetch
! #
! # The different methods within the same group are interchangeable and should
! # return the same result.
! # 
! # Additional information about the MEDLINE format and PubMed programmable
! # APIs can be found on the following websites:
! #
! # * Overview: http://www.ncbi.nlm.nih.gov/entrez/query/static/overview.html
! # * How to link: http://www.ncbi.nlm.nih.gov/entrez/query/static/linking.html
! # * MEDLINE format: http://www.ncbi.nlm.nih.gov/entrez/query/static/help/pmhelp.html#MEDLINEDisplayFormat
! # * Search field descriptions and tags: http://www.ncbi.nlm.nih.gov/entrez/query/static/help/pmhelp.html#SearchFieldDescriptionsandTags
! # * Entrez utilities index: http://www.ncbi.nlm.nih.gov/entrez/utils/utils_index.html
! # * PmFetch CGI help: http://www.ncbi.nlm.nih.gov/entrez/utils/pmfetch_help.html
! # * E-Utilities CGI help: http://eutils.ncbi.nlm.nih.gov/entrez/query/static/eutils_help.html
! #
! # == Usage
! #
! #   require 'bio'
! #
! #   # If you don't know the pubmed ID:
! #   Bio::PubMed.search("(genome AND analysis) OR bioinformatics)").each do |x|
! #     p x
! #   end
! #   Bio::PubMed.esearch("(genome AND analysis) OR bioinformatics)").each do |x|
! #     p x
! #   end
! #   
! #   # To retrieve the MEDLINE entry for a given PubMed ID:
! #   puts Bio::PubMed.query("10592173")
! #   puts Bio::PubMed.pmfetch("10592173")
! #   puts Bio::PubMed.efetch("10592173", "14693808")
! #   # This can be converted into a Bio::MEDLINE object:
! #   manuscript = Bio::PubMed.query("10592173")
! #   medline = Bio::MEDLINE(manuscript)
! #  
! class PubMed
  
!   # Search the PubMed database by given keywords using entrez query and returns
!   # an array of PubMed IDs.
!   # ---
!   # *Arguments*:
!   # * _id_: query string (required)
!   # *Returns*:: array of PubMed IDs
!   def self.search(str)
!     host = "www.ncbi.nlm.nih.gov"
!     path = "/entrez/query.fcgi?tool=bioruby&cmd=Search&doptcmdl=MEDLINE&db=PubMed&term="
  
!     http = Bio::Command.new_http(host)
!     response, = http.get(path + CGI.escape(str))
!     result = response.body
!     result = result.gsub("\r", "\n").squeeze("\n")
!     result = result.scan(/
(.*?)<\/pre>/m).flatten
!     return result
!   end
  
!   # Search the PubMed database by given keywords using E-Utils and returns 
!   # an array of PubMed IDs.
!   # 
!   # For information on the possible arguments, see
!   # http://eutils.ncbi.nlm.nih.gov/entrez/query/static/esearch_help.html#PubMed
!   # ---
!   # *Arguments*:
!   # * _id_: query string (required)
!   # * _field_
!   # * _reldate_
!   # * _mindate_
!   # * _maxdate_
!   # * _datetype_
!   # * _retstart_
!   # * _retmax_ (default 100)
!   # * _retmode_
!   # * _rettype_
!   # *Returns*:: array of PubMed IDs
!   def self.esearch(str, hash = {})
!     hash['retmax'] = 100 unless hash['retmax']
  
!     opts = []
!     hash.each do |k, v|
!       opts << "#{k}=#{v}"
!     end
  
!     host = "eutils.ncbi.nlm.nih.gov"
!     path = "/entrez/eutils/esearch.fcgi?tool=bioruby&db=pubmed&#{opts.join('&')}&term="
  
!     http = Bio::Command.new_http(host)
!     response, = http.get(path + CGI.escape(str))
!     result = response.body
!     result = result.scan(/(.*?)<\/Id>/m).flatten
!     return result
!   end
  
!   # Retrieve PubMed entry by PMID and returns MEDLINE formatted string using
!   # entrez query.
!   # ---
!   # *Arguments*:
!   # * _id_: PubMed ID (required)
!   # *Returns*:: MEDLINE formatted String
!   def self.query(id)
!     host = "www.ncbi.nlm.nih.gov"
!     path = "/entrez/query.fcgi?tool=bioruby&cmd=Text&dopt=MEDLINE&db=PubMed&uid="
  
!     http = Bio::Command.new_http(host)
!     response, = http.get(path + id.to_s)
!     result = response.body
!     if result =~ /#{id}\s+Error/
!       raise( result )
!     else
!       result = result.gsub("\r", "\n").squeeze("\n").gsub(/<\/?pre>/, '')
!       return result
      end
+   end
  
!   # Retrieve PubMed entry by PMID and returns MEDLINE formatted string using
!   # entrez pmfetch.
!   # ---
!   # *Arguments*:
!   # * _id_: PubMed ID (required)
!   # *Returns*:: MEDLINE formatted String
!   def self.pmfetch(id)
!     host = "www.ncbi.nlm.nih.gov"
!     path = "/entrez/utils/pmfetch.fcgi?tool=bioruby&mode=text&report=medline&db=PubMed&id="
  
!     http = Bio::Command.new_http(host)
!     response, = http.get(path + id.to_s)
!     result = response.body
!     if result =~ /#{id}\s+Error/
!       raise( result )
!     else
!       result = result.gsub("\r", "\n").squeeze("\n").gsub(/<\/?pre>/, '')
!       return result
      end
+   end
  
!   # Retrieve PubMed entry by PMID and returns MEDLINE formatted string using
!   # entrez efetch. Multiple PubMed IDs can be provided:
!   #   Bio::PubMed.efetch(123)
!   #   Bio::PubMed.efetch(123,456,789)
!   #   Bio::PubMed.efetch([123,456,789])
!   # ---
!   # *Arguments*:
!   # * _ids_: list of PubMed IDs (required)
!   # *Returns*:: MEDLINE formatted String
!   def self.efetch(*ids)
!     return [] if ids.empty?
  
!     host = "eutils.ncbi.nlm.nih.gov"
!     path = "/entrez/eutils/efetch.fcgi?tool=bioruby&db=pubmed&retmode=text&rettype=medline&id="
  
!     ids = ids.join(",")
  
+     http = Bio::Command.new_http(host)
+     response, = http.get(path + ids)
+     result = response.body
+     result = result.split(/\n\n+/)
+     return result
    end
  
! end # PubMed
! 
! end # Bio
  
  


From k at dev.open-bio.org  Tue Sep 19 01:49:22 2006
From: k at dev.open-bio.org (Katayama Toshiaki)
Date: Tue, 19 Sep 2006 05:49:22 +0000
Subject: [BioRuby-cvs] bioruby/lib/bio/io sql.rb,1.4,1.5
Message-ID: <200609190549.k8J5nMjc031590@dev.open-bio.org>

Update of /home/repository/bioruby/bioruby/lib/bio/io
In directory dev.open-bio.org:/tmp/cvs-serv31586/lib/bio/io

Modified Files:
	sql.rb 
Log Message:
* changed to RDoc
* license is changed from LGPL to Ruby's


Index: sql.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/io/sql.rb,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** sql.rb	26 Sep 2005 13:04:28 -0000	1.4
--- sql.rb	19 Sep 2006 05:49:19 -0000	1.5
***************
*** 1,22 ****
  #
! # bio/io/sql.rb - BioSQL access module
! #
! #   Copyright (C) 2002 KATAYAMA Toshiaki 
! #
! #  This library is free software; you can redistribute it and/or
! #  modify it under the terms of the GNU Lesser General Public
! #  License as published by the Free Software Foundation; either
! #  version 2 of the License, or (at your option) any later version.
! #
! #  This library is distributed in the hope that it will be useful,
! #  but WITHOUT ANY WARRANTY; without even the implied warranty of
! #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
! #  Lesser General Public License for more details.
  #
! #  You should have received a copy of the GNU Lesser General Public
! #  License along with this library; if not, write to the Free Software
! #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
  #
! #  $Id$
  #
  
--- 1,9 ----
  #
! # = bio/io/sql.rb - BioSQL access module
  #
! # Copyright::  Copyright (C) 2002 Toshiaki Katayama 
! # License::    Ruby's
  #
! # $Id$
  #
  
***************
*** 31,321 ****
  module Bio
  
!   class SQL
  
!     def initialize(db = 'dbi:Mysql:biosql', user = nil, pass = nil)
!       @dbh = DBI.connect(db, user, pass)
!     end
  
!     def close
!       @dbh.disconnect
!     end
  
!     def fetch(accession)	# or display_id for fall back
!       query = "select * from bioentry where accession = ?"
!       entry = @dbh.execute(query, accession).fetch
!       return Sequence.new(@dbh, entry) if entry
  
!       query = "select * from bioentry where display_id = ?"
!       entry = @dbh.execute(query, accession).fetch
!       return Sequence.new(@dbh, entry) if entry
!     end
!     alias get_by_id fetch
  
  
!     # for lazy fetching
  
!     class Sequence
  
!       def initialize(dbh, entry)
!         @dbh = dbh
!         @bioentry_id = entry['bioentry_id']
!         @database_id = entry['biodatabase_id']
!         @entry_id = entry['display_id']
!         @accession = entry['accession']
!         @version = entry['entry_version']
!         @division = entry['division']
!       end
!       attr_reader :accession, :division, :entry_id, :version
  
  
!       def to_fasta
!         if seq = seq
!           return seq.to_fasta(@accession)
!         end
        end
  
!       def seq
!         query = "select * from biosequence where bioentry_id = ?"
!         row = @dbh.execute(query, @bioentry_id).fetch
!         return unless row
  
!         mol = row['molecule']
!         seq = row['biosequence_str']
  
!         case mol
!         when /.na/i			# 'dna' or 'rna'
!           Bio::Sequence::NA.new(seq)
!         else				# 'protein'
!           Bio::Sequence::AA.new(seq)
!         end
        end
  
!       def subseq(from, to)
!         length = to - from + 1
!         query = "select molecule, substring(biosequence_str, ?, ?) as subseq" +
!                 " from biosequence where bioentry_id = ?"
!         row = @dbh.execute(query, from, length, @bioentry_id).fetch
!         return unless row
  
!         mol = row['molecule']
!         seq = row['subseq']
  
!         case mol
!         when /.na/i			# 'dna' or 'rna'
!           Bio::Sequence::NA.new(seq)
!         else				# 'protein'
!           Bio::Sequence::AA.new(seq)
!         end
        end
  
  
!       def features
!         array = []
!         query = "select * from seqfeature where bioentry_id = ?"
!         @dbh.execute(query, @bioentry_id).fetch_all.each do |row|
!           next unless row
  
!           f_id = row['seqfeature_id']
!           k_id = row['seqfeature_key_id']
!           s_id = row['seqfeature_source_id']
!           rank = row['seqfeature_rank'].to_i - 1
  
!           # key : type (gene, CDS, ...)
!           type = feature_key(k_id)
  
!           # source : database (EMBL/GenBank/SwissProt)
!           database = feature_source(s_id)
  
!           # location : position
!           locations = feature_locations(f_id)
  
!           # qualifier
!           qualifiers = feature_qualifiers(f_id)
!   
!           # rank
!           array[rank] = Bio::Feature.new(type, locations, qualifiers)
!         end
!         return Bio::Features.new(array)
        end
  
  
!       def references
!         array = []
!         query = <<-END
!           select * from bioentry_reference, reference
!           where bioentry_id = ? and
!           bioentry_reference.reference_id = reference.reference_id
!         END
!         @dbh.execute(query, @bioentry_id).fetch_all.each do |row|
!           next unless row
  
!           hash = {
!             'start'	=> row['reference_start'],
!             'end'	=> row['reference_end'],
!             'journal'	=> row['reference_location'],
!             'title'	=> row['reference_title'],
!             'authors'	=> row['reference_authors'],
!             'medline'	=> row['reference_medline']
!           }
!           hash.default = ''
  
!           rank = row['reference_rank'].to_i - 1
!           array[rank] = hash
!         end
!         return array
        end
  
  
!       def comment
!         query = "select * from comment where bioentry_id = ?"
!         row = @dbh.execute(query, @bioentry_id).fetch
!         row ? row['comment_text'] : ''
!       end
! 
!       def comments
!         array = []
!         query = "select * from comment where bioentry_id = ?"
!         @dbh.execute(query, @bioentry_id).fetch_all.each do |row|
!           next unless row
!           rank = row['comment_rank'].to_i - 1
!           array[rank] = row['comment_text']
!         end
!         return array
!       end
  
!       def database
!         query = "select * from biodatabase where biodatabase_id = ?"
!         row = @dbh.execute(query, @database_id).fetch
!         row ? row['name'] : ''
        end
  
!       def date
!         query = "select * from bioentry_date where bioentry_id = ?"
!         row = @dbh.execute(query, @bioentry_id).fetch
!         row ? row['date'] : ''
!       end
  
!       def dblink
!         query = "select * from bioentry_direct_links where source_bioentry_id = ?"
!         row = @dbh.execute(query, @bioentry_id).fetch
!         row ? [row['dbname'], row['accession']] : []
!       end
  
!       def definition
!         query = "select * from bioentry_description where bioentry_id = ?"
!         row = @dbh.execute(query, @bioentry_id).fetch
!         row ? row['description'] : ''
!       end
  
!       def keyword
!         query = "select * from bioentry_keywords where bioentry_id = ?"
!         row = @dbh.execute(query, @bioentry_id).fetch
!         row ? row['keywords'] : ''
!       end
  
!       def taxonomy
!         query = <<-END
!           select full_lineage, common_name, ncbi_taxa_id
!           from bioentry_taxa, taxa
!           where bioentry_id = ? and bioentry_taxa.taxa_id = taxa.taxa_id
!         END
!         row = @dbh.execute(query, @bioentry_id).fetch
!         @lineage = row ? row['full_lineage'] : ''
!         @common_name = row ? row['common_name'] : ''
!         @ncbi_taxa_id = row ? row['ncbi_taxa_id'] : ''
!         row ? [@lineage, @common_name, @ncbi_taxa_id] : []
!       end
  
!       def lineage
!         taxonomy unless @lineage
!         return @lineage
!       end
  
!       def common_name
!         taxonomy unless @common_name
!         return @common_name
!       end
  
!       def ncbi_taxa_id
!         taxonomy unless @ncbi_taxa_id
!         return @ncbi_taxa_id
!       end
  
  
-       private
  
!       def feature_key(k_id)
!         query = "select * from seqfeature_key where seqfeature_key_id = ?"
!         row = @dbh.execute(query, k_id).fetch
!         row ? row['key_name'] : ''
!       end
  
!       def feature_source(s_id)
!         query = "select * from seqfeature_source where seqfeature_source_id = ?"
!         row = @dbh.execute(query, s_id).fetch
!         row ? row['source_name'] : ''
!       end
  
!       def feature_locations(f_id)
!         locations = []
!         query = "select * from seqfeature_location where seqfeature_id = ?"
!         @dbh.execute(query, f_id).fetch_all.each do |row|
!           next unless row
  
!           location = Bio::Location.new
!           location.strand = row['seq_strand']
!           location.from = row['seq_start']
!           location.to = row['seq_end']
  
!           xref = feature_locations_remote(row['seqfeature_location_id'])
!           location.xref_id = xref.shift unless xref.empty?
  
!           # just omit fuzzy location for now...
!           #feature_locations_qv(row['seqfeature_location_id'])
  
!           rank = row['location_rank'].to_i - 1
!           locations[rank] = location
!         end
!         return Bio::Locations.new(locations)
!       end
  
!       def feature_locations_remote(l_id)
!         query = "select * from remote_seqfeature_name where seqfeature_location_id = ?"
!         row = @dbh.execute(query, l_id).fetch
!         row ? [row['accession'], row['version']] : []
        end
  
!       def feature_locations_qv(l_id)
!         query = "select * from location_qualifier_value where seqfeature_location_id = ?"
!         row = @dbh.execute(query, l_id).fetch
!         row ? [row['qualifier_value'], row['slot_value']] : []
!       end
  
!       def feature_qualifiers(f_id)
!         qualifiers = []
!         query = "select * from seqfeature_qualifier_value where seqfeature_id = ?"
!         @dbh.execute(query, f_id).fetch_all.each do |row|
!           next unless row
  
!           key = feature_qualifiers_key(row['seqfeature_qualifier_id'])
!           value = row['qualifier_value']
!           qualifier = Bio::Feature::Qualifier.new(key, value)
  
!           rank = row['seqfeature_qualifier_rank'].to_i - 1
!           qualifiers[rank] = qualifier
!         end
!         return qualifiers.compact	# .compact is nasty hack for a while
!       end
  
!       def feature_qualifiers_key(q_id)
!         query = "select * from seqfeature_qualifier where seqfeature_qualifier_id = ?"
!         row = @dbh.execute(query, q_id).fetch
!         row ? row['qualifier_name'] : ''
        end
      end
  
    end
  
! end
  
  
--- 18,316 ----
  module Bio
  
! class SQL
  
!   def initialize(db = 'dbi:Mysql:biosql', user = nil, pass = nil)
!     @dbh = DBI.connect(db, user, pass)
!   end
  
!   def close
!     @dbh.disconnect
!   end
  
!   # Returns Bio::SQL::Sequence object.
!   def fetch(accession)	# or display_id for fall back
!     query = "select * from bioentry where accession = ?"
!     entry = @dbh.execute(query, accession).fetch
!     return Sequence.new(@dbh, entry) if entry
  
!     query = "select * from bioentry where display_id = ?"
!     entry = @dbh.execute(query, accession).fetch
!     return Sequence.new(@dbh, entry) if entry
!   end
!   alias get_by_id fetch
  
  
!   # for lazy fetching
  
!   class Sequence
  
!     def initialize(dbh, entry)
!       @dbh = dbh
!       @bioentry_id = entry['bioentry_id']
!       @database_id = entry['biodatabase_id']
!       @entry_id = entry['display_id']
!       @accession = entry['accession']
!       @version = entry['entry_version']
!       @division = entry['division']
!     end
!     attr_reader :accession, :division, :entry_id, :version
  
  
!     def to_fasta
!       if seq = seq
!         return seq.to_fasta(@accession)
        end
+     end
  
!     # Returns Bio::Sequence::NA or AA object.
!     def seq
!       query = "select * from biosequence where bioentry_id = ?"
!       row = @dbh.execute(query, @bioentry_id).fetch
!       return unless row
  
!       mol = row['molecule']
!       seq = row['biosequence_str']
  
!       case mol
!       when /.na/i			# 'dna' or 'rna'
!         Bio::Sequence::NA.new(seq)
!       else				# 'protein'
!         Bio::Sequence::AA.new(seq)
        end
+     end
  
!     # Returns Bio::Sequence::NA or AA object (by lazy fetching).
!     def subseq(from, to)
!       length = to - from + 1
!       query = "select molecule, substring(biosequence_str, ?, ?) as subseq" +
!               " from biosequence where bioentry_id = ?"
!       row = @dbh.execute(query, from, length, @bioentry_id).fetch
!       return unless row
  
!       mol = row['molecule']
!       seq = row['subseq']
  
!       case mol
!       when /.na/i			# 'dna' or 'rna'
!         Bio::Sequence::NA.new(seq)
!       else				# 'protein'
!         Bio::Sequence::AA.new(seq)
        end
+     end
  
  
!     # Returns Bio::Features object.
!     def features
!       array = []
!       query = "select * from seqfeature where bioentry_id = ?"
!       @dbh.execute(query, @bioentry_id).fetch_all.each do |row|
!         next unless row
  
!         f_id = row['seqfeature_id']
!         k_id = row['seqfeature_key_id']
!         s_id = row['seqfeature_source_id']
!         rank = row['seqfeature_rank'].to_i - 1
  
!         # key : type (gene, CDS, ...)
!         type = feature_key(k_id)
  
!         # source : database (EMBL/GenBank/SwissProt)
!         database = feature_source(s_id)
  
!         # location : position
!         locations = feature_locations(f_id)
  
!         # qualifier
!         qualifiers = feature_qualifiers(f_id)
! 
!         # rank
!         array[rank] = Bio::Feature.new(type, locations, qualifiers)
        end
+       return Bio::Features.new(array)
+     end
  
  
!     # Returns reference informations in Array of Hash (not Bio::Reference).
!     def references
!       array = []
!       query = <<-END
!         select * from bioentry_reference, reference
!         where bioentry_id = ? and
!         bioentry_reference.reference_id = reference.reference_id
!       END
!       @dbh.execute(query, @bioentry_id).fetch_all.each do |row|
!         next unless row
  
!         hash = {
!           'start'	=> row['reference_start'],
!           'end'	=> row['reference_end'],
!           'journal'	=> row['reference_location'],
!           'title'	=> row['reference_title'],
!           'authors'	=> row['reference_authors'],
!           'medline'	=> row['reference_medline']
!         }
!         hash.default = ''
  
!         rank = row['reference_rank'].to_i - 1
!         array[rank] = hash
        end
+       return array
+     end
  
  
!     # Returns the first comment.  For complete comments, use comments method.
!     def comment
!       query = "select * from comment where bioentry_id = ?"
!       row = @dbh.execute(query, @bioentry_id).fetch
!       row ? row['comment_text'] : ''
!     end
  
!     # Returns comments in an Array of Strings.
!     def comments
!       array = []
!       query = "select * from comment where bioentry_id = ?"
!       @dbh.execute(query, @bioentry_id).fetch_all.each do |row|
!         next unless row
!         rank = row['comment_rank'].to_i - 1
!         array[rank] = row['comment_text']
        end
+       return array
+     end
  
!     def database
!       query = "select * from biodatabase where biodatabase_id = ?"
!       row = @dbh.execute(query, @database_id).fetch
!       row ? row['name'] : ''
!     end
  
!     def date
!       query = "select * from bioentry_date where bioentry_id = ?"
!       row = @dbh.execute(query, @bioentry_id).fetch
!       row ? row['date'] : ''
!     end
  
!     def dblink
!       query = "select * from bioentry_direct_links where source_bioentry_id = ?"
!       row = @dbh.execute(query, @bioentry_id).fetch
!       row ? [row['dbname'], row['accession']] : []
!     end
  
!     def definition
!       query = "select * from bioentry_description where bioentry_id = ?"
!       row = @dbh.execute(query, @bioentry_id).fetch
!       row ? row['description'] : ''
!     end
  
!     def keyword
!       query = "select * from bioentry_keywords where bioentry_id = ?"
!       row = @dbh.execute(query, @bioentry_id).fetch
!       row ? row['keywords'] : ''
!     end
  
!     # Use lineage, common_name, ncbi_taxa_id methods to extract in detail.
!     def taxonomy
!       query = <<-END
!         select full_lineage, common_name, ncbi_taxa_id
!         from bioentry_taxa, taxa
!         where bioentry_id = ? and bioentry_taxa.taxa_id = taxa.taxa_id
!       END
!       row = @dbh.execute(query, @bioentry_id).fetch
!       @lineage = row ? row['full_lineage'] : ''
!       @common_name = row ? row['common_name'] : ''
!       @ncbi_taxa_id = row ? row['ncbi_taxa_id'] : ''
!       row ? [@lineage, @common_name, @ncbi_taxa_id] : []
!     end
  
!     def lineage
!       taxonomy unless @lineage
!       return @lineage
!     end
  
!     def common_name
!       taxonomy unless @common_name
!       return @common_name
!     end
  
+     def ncbi_taxa_id
+       taxonomy unless @ncbi_taxa_id
+       return @ncbi_taxa_id
+     end
  
  
!     private
  
!     def feature_key(k_id)
!       query = "select * from seqfeature_key where seqfeature_key_id = ?"
!       row = @dbh.execute(query, k_id).fetch
!       row ? row['key_name'] : ''
!     end
  
!     def feature_source(s_id)
!       query = "select * from seqfeature_source where seqfeature_source_id = ?"
!       row = @dbh.execute(query, s_id).fetch
!       row ? row['source_name'] : ''
!     end
  
!     def feature_locations(f_id)
!       locations = []
!       query = "select * from seqfeature_location where seqfeature_id = ?"
!       @dbh.execute(query, f_id).fetch_all.each do |row|
!         next unless row
  
!         location = Bio::Location.new
!         location.strand = row['seq_strand']
!         location.from = row['seq_start']
!         location.to = row['seq_end']
  
!         xref = feature_locations_remote(row['seqfeature_location_id'])
!         location.xref_id = xref.shift unless xref.empty?
  
!         # just omit fuzzy location for now...
!         #feature_locations_qv(row['seqfeature_location_id'])
  
!         rank = row['location_rank'].to_i - 1
!         locations[rank] = location
        end
+       return Bio::Locations.new(locations)
+     end
  
!     def feature_locations_remote(l_id)
!       query = "select * from remote_seqfeature_name where seqfeature_location_id = ?"
!       row = @dbh.execute(query, l_id).fetch
!       row ? [row['accession'], row['version']] : []
!     end
  
!     def feature_locations_qv(l_id)
!       query = "select * from location_qualifier_value where seqfeature_location_id = ?"
!       row = @dbh.execute(query, l_id).fetch
!       row ? [row['qualifier_value'], row['slot_value']] : []
!     end
  
!     def feature_qualifiers(f_id)
!       qualifiers = []
!       query = "select * from seqfeature_qualifier_value where seqfeature_id = ?"
!       @dbh.execute(query, f_id).fetch_all.each do |row|
!         next unless row
  
!         key = feature_qualifiers_key(row['seqfeature_qualifier_id'])
!         value = row['qualifier_value']
!         qualifier = Bio::Feature::Qualifier.new(key, value)
  
!         rank = row['seqfeature_qualifier_rank'].to_i - 1
!         qualifiers[rank] = qualifier
        end
+       return qualifiers.compact	# .compact is nasty hack for a while
      end
  
+     def feature_qualifiers_key(q_id)
+       query = "select * from seqfeature_qualifier where seqfeature_qualifier_id = ?"
+       row = @dbh.execute(query, q_id).fetch
+       row ? row['qualifier_name'] : ''
+     end
    end
  
! end # SQL
! 
! end # Bio
  
  
***************
*** 365,428 ****
  end
  
- 
- =begin
- 
- = Bio::SQL
- 
- --- Bio::SQL.new(db = 'dbi:Mysql:biosql', user = nil, pass = nil)
- 
- --- Bio::SQL.close
- 
- --- Bio::SQL#fetch(accession)
- 
-       Returns Bio::SQL::Sequence object.
- 
- == Bio::SQL::Sequence
- 
- --- Bio::SQL::Sequence.new(dbh, entry)
- 
- --- Bio::SQL::Sequence#accession -> String
- --- Bio::SQL::Sequence#comment -> String
- 
-       Returns the first comment.  For complete comments, use comments method.
- 
- --- Bio::SQL::Sequence#comments -> Array
- 
-       Returns comments in an Array of Strings.
- 
- --- Bio::SQL::Sequence#common_name -> String
- --- Bio::SQL::Sequence#database -> String
- --- Bio::SQL::Sequence#date -> String
- --- Bio::SQL::Sequence#dblink -> Array
- --- Bio::SQL::Sequence#definition -> String
- --- Bio::SQL::Sequence#division -> String
- --- Bio::SQL::Sequence#entry_id -> String
- 
- --- Bio::SQL::Sequence#features
- 
-       Returns Bio::Features object.
- 
- --- Bio::SQL::Sequence#keyword -> String
- --- Bio::SQL::Sequence#lineage -> String
- --- Bio::SQL::Sequence#ncbi_taxa_id -> String
- 
- --- Bio::SQL::Sequence#references -> Array
- 
-       Returns reference informations in Array of Hash (not Bio::Reference).
- 
- --- Bio::SQL::Sequence#seq
- 
-       Returns Bio::Sequence::NA or AA object.
- 
- --- Bio::SQL::Sequence#subseq(from, to)
- 
-       Returns Bio::Sequence::NA or AA object (by lazy fetching).
- 
- --- Bio::SQL::Sequence#taxonomy -> DBI::Row
- 
-       Use lineage, common_name, ncbi_taxa_id methods to extract in detail.
- 
- --- Bio::SQL::Sequence#version -> String
- 
- =end
- 
--- 360,361 ----


From k at dev.open-bio.org  Tue Sep 19 01:50:47 2006
From: k at dev.open-bio.org (Katayama Toshiaki)
Date: Tue, 19 Sep 2006 05:50:47 +0000
Subject: [BioRuby-cvs] bioruby/lib/bio/db/kegg brite.rb,0.6,0.7
Message-ID: <200609190550.k8J5ol6R031669@dev.open-bio.org>

Update of /home/repository/bioruby/bioruby/lib/bio/db/kegg
In directory dev.open-bio.org:/tmp/cvs-serv31665/lib/bio/db/kegg

Modified Files:
	brite.rb 
Log Message:
* license is changed from LGPL to Ruby's


Index: brite.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/kegg/brite.rb,v
retrieving revision 0.6
retrieving revision 0.7
diff -C2 -d -r0.6 -r0.7
*** brite.rb	8 Sep 2005 01:22:11 -0000	0.6
--- brite.rb	19 Sep 2006 05:50:45 -0000	0.7
***************
*** 1,22 ****
  #
! # bio/db/kegg/brite.rb - KEGG/BRITE database class
! #
! #   Copyright (C) 2001 KATAYAMA Toshiaki 
! #
! #  This library is free software; you can redistribute it and/or
! #  modify it under the terms of the GNU Lesser General Public
! #  License as published by the Free Software Foundation; either
! #  version 2 of the License, or (at your option) any later version.
! #
! #  This library is distributed in the hope that it will be useful,
! #  but WITHOUT ANY WARRANTY; without even the implied warranty of
! #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
! #  Lesser General Public License for more details.
  #
! #  You should have received a copy of the GNU Lesser General Public
! #  License along with this library; if not, write to the Free Software
! #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
  #
! #  $Id$
  #
  
--- 1,9 ----
  #
! # = bio/db/kegg/brite.rb - KEGG/BRITE database class
  #
! # Copyright::  Copyright (C) 2001 Toshiaki Katayama 
! # License::    Ruby's
  #
! # $Id$
  #
  
***************
*** 24,51 ****
  
  module Bio
  
!   class KEGG
! 
!     class BRITE < KEGGDB
! 
!       DELIMITER	= RS = "\n///\n"
!       TAGSIZE	= 12
  
!       def initialize(entry)
!         super(entry, TAGSIZE)
!       end
  
!       # ENTRY
!       # DEFINITION
!       # RELATION
!       # FACTORS
!       # INTERACTION
!       # SOURCE
!       # REFERENCE
  
!     end
  
!   end
  
! end
  
--- 11,41 ----
  
  module Bio
+ class KEGG
  
! # == Note
! #
! # This class is not completely implemented, but obsolete as the original
! # database BRITE has changed it's meaning.
! #
! class BRITE < KEGGDB
  
!   DELIMITER	= RS = "\n///\n"
!   TAGSIZE	= 12
  
!   def initialize(entry)
!     super(entry, TAGSIZE)
!   end
  
!   # ENTRY
!   # DEFINITION
!   # RELATION
!   # FACTORS
!   # INTERACTION
!   # SOURCE
!   # REFERENCE
  
! end # BRITE
  
! end # KEGG
! end # Bio
  


From k at dev.open-bio.org  Tue Sep 19 01:51:31 2006
From: k at dev.open-bio.org (Katayama Toshiaki)
Date: Tue, 19 Sep 2006 05:51:31 +0000
Subject: [BioRuby-cvs] bioruby/lib/bio/db/kegg compound.rb,0.11,0.12
Message-ID: <200609190551.k8J5pVOi031729@dev.open-bio.org>

Update of /home/repository/bioruby/bioruby/lib/bio/db/kegg
In directory dev.open-bio.org:/tmp/cvs-serv31725/lib/bio/db/kegg

Modified Files:
	compound.rb 
Log Message:
* license is changed from LGPL to Ruby's


Index: compound.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/kegg/compound.rb,v
retrieving revision 0.11
retrieving revision 0.12
diff -C2 -d -r0.11 -r0.12
*** compound.rb	8 Sep 2005 01:22:11 -0000	0.11
--- compound.rb	19 Sep 2006 05:51:29 -0000	0.12
***************
*** 1,22 ****
  #
! # bio/db/kegg/compound.rb - KEGG COMPOUND database class
! #
! #   Copyright (C) 2001, 2002, 2004 KATAYAMA Toshiaki 
! #
! #  This library is free software; you can redistribute it and/or
! #  modify it under the terms of the GNU Lesser General Public
! #  License as published by the Free Software Foundation; either
! #  version 2 of the License, or (at your option) any later version.
! #
! #  This library is distributed in the hope that it will be useful,
! #  but WITHOUT ANY WARRANTY; without even the implied warranty of
! #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
! #  Lesser General Public License for more details.
  #
! #  You should have received a copy of the GNU Lesser General Public
! #  License along with this library; if not, write to the Free Software
! #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
  #
! #  $Id$
  #
  
--- 1,9 ----
  #
! # = bio/db/kegg/compound.rb - KEGG COMPOUND database class
  #
! # Copyright::  Copyright (C) 2001, 2002, 2004 Toshiaki Katayama 
! # License::    Ruby's
  #
! # $Id$
  #
  
***************
*** 24,114 ****
  
  module Bio
  
!   class KEGG
! 
!     class COMPOUND < KEGGDB
! 
!       DELIMITER	= RS = "\n///\n"
!       TAGSIZE	= 12
! 
!       def initialize(entry)
!         super(entry, TAGSIZE)
!       end
  
!       # ENTRY
!       def entry_id
!         unless @data['ENTRY']
!           @data['ENTRY'] = fetch('ENTRY').split(/\s+/).first
!         end
!         @data['ENTRY']
!       end
  
!       # NAME
!       def names
!         lines_fetch('NAME') 
!       end
!       def name
!         names[0]
!       end
  
!       # FORMULA
!       def formula
!         field_fetch('FORMULA')
!       end
  
!       # MASS
!       def mass
!         field_fetch('MASS').to_f
!       end
  
!       # REACTION
!       def reactions
!         unless @data['REACTION']
!           @data['REACTION'] = fetch('REACTION').split(/\s+/)
!         end
!         @data['REACTION']
!       end
  
!       # RPAIR
!       def rpairs
!         unless @data['RPAIR']
!           @data['RPAIR'] = fetch('RPAIR').split(/\s+/)
!         end
!         @data['RPAIR']
!       end
  
!       # PATHWAY
!       def pathways
!         lines_fetch('PATHWAY') 
!       end
  
!       # ENZYME
!       def enzymes
!         unless @data['ENZYME']
!           field = fetch('ENZYME')
!           if /\(/.match(field)	# old version
!             @data['ENZYME'] = field.scan(/\S+ \(\S+\)/)
!           else
!             @data['ENZYME'] = field.scan(/\S+/)
!           end
!         end
!         @data['ENZYME']
!       end
  
!       # DBLINKS
!       def dblinks
!         lines_fetch('DBLINKS')
!       end
  
!       # ATOM, BOND
!       def kcf
!         return "#{get('ATOM')}#{get('BOND')}"
        end
- 
      end
  
    end
  
! end
  
  
--- 11,99 ----
  
  module Bio
+ class KEGG
  
! class COMPOUND < KEGGDB
  
!   DELIMITER	= RS = "\n///\n"
!   TAGSIZE	= 12
  
!   def initialize(entry)
!     super(entry, TAGSIZE)
!   end
  
!   # ENTRY
!   def entry_id
!     unless @data['ENTRY']
!       @data['ENTRY'] = fetch('ENTRY').split(/\s+/).first
!     end
!     @data['ENTRY']
!   end
  
!   # NAME
!   def names
!     lines_fetch('NAME') 
!   end
!   def name
!     names[0]
!   end
  
!   # FORMULA
!   def formula
!     field_fetch('FORMULA')
!   end
  
!   # MASS
!   def mass
!     field_fetch('MASS').to_f
!   end
  
!   # REACTION
!   def reactions
!     unless @data['REACTION']
!       @data['REACTION'] = fetch('REACTION').split(/\s+/)
!     end
!     @data['REACTION']
!   end
  
!   # RPAIR
!   def rpairs
!     unless @data['RPAIR']
!       @data['RPAIR'] = fetch('RPAIR').split(/\s+/)
!     end
!     @data['RPAIR']
!   end
  
!   # PATHWAY
!   def pathways
!     lines_fetch('PATHWAY') 
!   end
  
!   # ENZYME
!   def enzymes
!     unless @data['ENZYME']
!       field = fetch('ENZYME')
!       if /\(/.match(field)	# old version
!         @data['ENZYME'] = field.scan(/\S+ \(\S+\)/)
!       else
!         @data['ENZYME'] = field.scan(/\S+/)
        end
      end
+     @data['ENZYME']
+   end
+ 
+   # DBLINKS
+   def dblinks
+     lines_fetch('DBLINKS')
+   end
  
+   # ATOM, BOND
+   def kcf
+     return "#{get('ATOM')}#{get('BOND')}"
    end
  
! end # COMPOUND
! 
! end # KEGG
! end # Bio
  
  


From k at dev.open-bio.org  Tue Sep 19 01:52:07 2006
From: k at dev.open-bio.org (Katayama Toshiaki)
Date: Tue, 19 Sep 2006 05:52:07 +0000
Subject: [BioRuby-cvs] bioruby/lib/bio/db/kegg enzyme.rb,0.8,0.9
Message-ID: <200609190552.k8J5q73d031772@dev.open-bio.org>

Update of /home/repository/bioruby/bioruby/lib/bio/db/kegg
In directory dev.open-bio.org:/tmp/cvs-serv31768/lib/bio/db/kegg

Modified Files:
	enzyme.rb 
Log Message:
* license is changed from LGPL to Ruby's


Index: enzyme.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/kegg/enzyme.rb,v
retrieving revision 0.8
retrieving revision 0.9
diff -C2 -d -r0.8 -r0.9
*** enzyme.rb	8 Sep 2005 01:22:11 -0000	0.8
--- enzyme.rb	19 Sep 2006 05:52:05 -0000	0.9
***************
*** 1,22 ****
  #
! # bio/db/kegg/enzyme.rb - KEGG/ENZYME database class
! #
! #   Copyright (C) 2001, 2002 KATAYAMA Toshiaki 
! #
! #  This library is free software; you can redistribute it and/or
! #  modify it under the terms of the GNU Lesser General Public
! #  License as published by the Free Software Foundation; either
! #  version 2 of the License, or (at your option) any later version.
! #
! #  This library is distributed in the hope that it will be useful,
! #  but WITHOUT ANY WARRANTY; without even the implied warranty of
! #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
! #  Lesser General Public License for more details.
  #
! #  You should have received a copy of the GNU Lesser General Public
! #  License along with this library; if not, write to the Free Software
! #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
  #
! #  $Id$
  #
  
--- 1,9 ----
  #
! # = bio/db/kegg/enzyme.rb - KEGG/ENZYME database class
  #
! # Copyright::  Copyright (C) 2001, 2002 Toshiaki Katayama 
! # License::    Ruby's
  #
! # $Id$
  #
  
***************
*** 24,125 ****
  
  module Bio
  
!   class KEGG
! 
!     class ENZYME < KEGGDB
! 
!       DELIMITER	= RS = "\n///\n"
!       TAGSIZE	= 12
! 
!       def initialize(entry)
!         super(entry, TAGSIZE)
!       end
  
!       # ENTRY
!       def entry_id
!         field_fetch('ENTRY')
!       end
  
!       # NAME
!       def names
!         lines_fetch('NAME')
!       end
!       def name
!         names[0]
!       end
  
!       # CLASS
!       def classes
!         lines_fetch('CLASS')
!       end
  
!       # SYSNAME
!       def sysname
!         field_fetch('SYSNAME')
!       end
  
!       # REACTION ';'
!       def reaction
!         field_fetch('REACTION')
!       end
!       
!       # SUBSTRATE
!       def substrates
!         lines_fetch('SUBSTRATE')
!       end
  
!       # PRODUCT
!       def products
!         lines_fetch('PRODUCT')
!       end
  
!       # COFACTOR
!       def cofactors
!         lines_fetch('COFACTOR')
!       end
  
!       # COMMENT
!       def comment
!         field_fetch('COMMENT')
!       end
  
!       # PATHWAY
!       def pathways
!         lines_fetch('PATHWAY')
!       end
  
!       # GENES
!       def genes
!         lines_fetch('GENES')
!       end
  
!       # DISEASE
!       def diseases
!         lines_fetch('DISEASE')
!       end
  
!       # MOTIF
!       def motifs
!         lines_fetch('MOTIF')
!       end
  
!       # STRUCTURES
!       def structures
!         unless @data['STRUCTURES']
!           @data['STRUCTURES'] =
!             fetch('STRUCTURES').sub(/(PDB: )*/,'').split(/\s+/)
!         end
!         @data['STRUCTURES']
!       end
  
!       # DBLINKS
!       def dblinks
!         lines_fetch('DBLINKS')
!       end
  
      end
  
    end
  
! end
  
--- 11,110 ----
  
  module Bio
+ class KEGG
  
! class ENZYME < KEGGDB
  
!   DELIMITER	= RS = "\n///\n"
!   TAGSIZE	= 12
  
!   def initialize(entry)
!     super(entry, TAGSIZE)
!   end
  
!   # ENTRY
!   def entry_id
!     field_fetch('ENTRY')
!   end
  
!   # NAME
!   def names
!     lines_fetch('NAME')
!   end
!   def name
!     names[0]
!   end
  
!   # CLASS
!   def classes
!     lines_fetch('CLASS')
!   end
  
!   # SYSNAME
!   def sysname
!     field_fetch('SYSNAME')
!   end
  
!   # REACTION ';'
!   def reaction
!     field_fetch('REACTION')
!   end
!   
!   # SUBSTRATE
!   def substrates
!     lines_fetch('SUBSTRATE')
!   end
  
!   # PRODUCT
!   def products
!     lines_fetch('PRODUCT')
!   end
  
!   # COFACTOR
!   def cofactors
!     lines_fetch('COFACTOR')
!   end
  
!   # COMMENT
!   def comment
!     field_fetch('COMMENT')
!   end
  
!   # PATHWAY
!   def pathways
!     lines_fetch('PATHWAY')
!   end
  
!   # GENES
!   def genes
!     lines_fetch('GENES')
!   end
  
!   # DISEASE
!   def diseases
!     lines_fetch('DISEASE')
!   end
  
!   # MOTIF
!   def motifs
!     lines_fetch('MOTIF')
!   end
  
+   # STRUCTURES
+   def structures
+     unless @data['STRUCTURES']
+       @data['STRUCTURES'] =
+         fetch('STRUCTURES').sub(/(PDB: )*/,'').split(/\s+/)
      end
+     @data['STRUCTURES']
+   end
  
+   # DBLINKS
+   def dblinks
+     lines_fetch('DBLINKS')
    end
  
! end # ENZYME
! 
! end # KEGG
! end # Bio
  


From k at dev.open-bio.org  Tue Sep 19 01:52:47 2006
From: k at dev.open-bio.org (Katayama Toshiaki)
Date: Tue, 19 Sep 2006 05:52:47 +0000
Subject: [BioRuby-cvs] bioruby/lib/bio/db/kegg genome.rb,0.14,0.15
Message-ID: <200609190552.k8J5qlIc031815@dev.open-bio.org>

Update of /home/repository/bioruby/bioruby/lib/bio/db/kegg
In directory dev.open-bio.org:/tmp/cvs-serv31811/lib/bio/db/kegg

Modified Files:
	genome.rb 
Log Message:
* license is changed from LGPL to Ruby's
* document is changed to RDoc


Index: genome.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/kegg/genome.rb,v
retrieving revision 0.14
retrieving revision 0.15
diff -C2 -d -r0.14 -r0.15
*** genome.rb	8 Sep 2005 01:22:11 -0000	0.14
--- genome.rb	19 Sep 2006 05:52:45 -0000	0.15
***************
*** 1,22 ****
  #
! # bio/db/kegg/genome.rb - KEGG/GENOME database class
! #
! #   Copyright (C) 2001, 2002 KATAYAMA Toshiaki 
! #
! #  This library is free software; you can redistribute it and/or
! #  modify it under the terms of the GNU Lesser General Public
! #  License as published by the Free Software Foundation; either
! #  version 2 of the License, or (at your option) any later version.
! #
! #  This library is distributed in the hope that it will be useful,
! #  but WITHOUT ANY WARRANTY; without even the implied warranty of
! #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
! #  Lesser General Public License for more details.
  #
! #  You should have received a copy of the GNU Lesser General Public
! #  License along with this library; if not, write to the Free Software
! #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
  #
! #  $Id$
  #
  
--- 1,9 ----
  #
! # = bio/db/kegg/genome.rb - KEGG/GENOME database class
  #
! # Copyright::  Copyright (C) 2001, 2002 Toshiaki Katayama 
! # License::    Ruby's
  #
! # $Id$
  #
  
***************
*** 24,213 ****
  
  module Bio
  
!   class KEGG
! 
!     class GENOME < KEGGDB
  
!       DELIMITER	= RS = "\n///\n"
!       TAGSIZE	= 12
  
!       def initialize(entry)
!         super(entry, TAGSIZE)
!       end
  
  
!       # ENTRY
!       def entry_id
!         field_fetch('ENTRY')
!       end
!       
!       # NAME
!       def name
!         field_fetch('NAME')
!       end
  
!       # DEFINITION
!       def definition
!         field_fetch('DEFINITION')
!       end
!       alias organism definition
  
!       # TAXONOMY
!       def taxonomy
!         unless @data['TAXONOMY']
!           taxid, lineage = subtag2array(get('TAXONOMY'))
!           taxid   = taxid   ? truncate(tag_cut(taxid))   : ''
!           lineage = lineage ? truncate(tag_cut(lineage)) : ''
!           @data['TAXONOMY'] = {
!             'taxid'	=> taxid,
!             'lineage'	=> lineage,
!           }
!           @data['TAXONOMY'].default = ''
!         end
!         @data['TAXONOMY']
!       end
  
!       def taxid
!         taxonomy['taxid']
!       end
  
!       def lineage
!         taxonomy['lineage']
!       end
  
!       # COMMENT
!       def comment
!         field_fetch('COMMENT')
!       end
!       
!       # REFERENCE
!       def references
!         unless @data['REFERENCE']
!           ary = []
!           toptag2array(get('REFERENCE')).each do |ref|
!             hash = Hash.new('')
!             subtag2array(ref).each do |field|
!               case tag_get(field)
!               when /AUTHORS/
!                 authors = truncate(tag_cut(field))
!                 authors = authors.split(', ')
!                 authors[-1] = authors[-1].split(/\s+and\s+/)
!                 authors = authors.flatten.map { |a| a.sub(',', ', ') }
!                 hash['authors']	= authors
!               when /TITLE/
!                 hash['title']	= truncate(tag_cut(field))
!               when /JOURNAL/
!                 journal = truncate(tag_cut(field))
!                 if journal =~ /(.*) (\d+):(\d+)-(\d+) \((\d+)\) \[UI:(\d+)\]$/
!                   hash['journal']	= $1
!                   hash['volume']	= $2
!                   hash['pages']		= $3
!                   hash['year']		= $5
!                   hash['medline']	= $6
!                 else
!                   hash['journal'] = journal
!                 end
!               end
              end
-             ary.push(Reference.new(hash))
            end
-           @data['REFERENCE'] = References.new(ary)
          end
!         @data['REFERENCE']
        end
  
!       # CHROMOSOME
!       def chromosomes
!         unless @data['CHROMOSOME']
!           @data['CHROMOSOME'] = []
!           toptag2array(get('CHROMOSOME')).each do |chr|
!             hash = Hash.new('')
!             subtag2array(chr).each do |field|
!               hash[tag_get(field)] = truncate(tag_cut(field))
!             end
!             @data['CHROMOSOME'].push(hash)
!           end
          end
!         @data['CHROMOSOME']
        end
  
!       # PLASMID
!       def plasmids
!         unless @data['PLASMID']
!           @data['PLASMID'] = []
!           toptag2array(get('PLASMID')).each do |chr|
!             hash = Hash.new('')
!             subtag2array(chr).each do |field|
!               hash[tag_get(field)] = truncate(tag_cut(field))
!             end
!             @data['PLASMID'].push(hash)
!           end
          end
!         @data['PLASMID']
        end
  
!       # SCAFFOLD
!       def scaffolds
!         unless @data['SCAFFOLD']
!           @data['SCAFFOLD'] = []
!           toptag2array(get('SCAFFOLD')).each do |chr|
!             hash = Hash.new('')
!             subtag2array(chr).each do |field|
!               hash[tag_get(field)] = truncate(tag_cut(field))
!             end
!             @data['SCAFFOLD'].push(hash)
!           end
          end
!         @data['SCAFFOLD']
        end
  
!       # STATISTICS
!       def statistics
!         unless @data['STATISTICS']
!           hash = Hash.new(0.0)
!           get('STATISTICS').each_line do |line|
!             case line
!             when /nucleotides:\s+(\d+)/
!               hash['nalen'] = $1.to_i
!             when /protein genes:\s+(\d+)/
!               hash['num_gene'] = $1.to_i
!             when /RNA genes:\s+(\d+)/
!               hash['num_rna'] = $1.to_i
!             when /G\+C content:\s+(\d+.\d+)/
!               hash['gc'] = $1.to_f
!             end
!           end
!           @data['STATISTICS'] = hash
          end
-         @data['STATISTICS']
-       end
- 
-       def nalen
-         statistics['nalen']
        end
!       alias length nalen
  
!       def num_gene
!         statistics['num_gene']
!       end
  
!       def num_rna
!         statistics['num_rna']
!       end
  
!       def gc
!         statistics['gc']
!       end
  
!       # GENOMEMAP
!       def genomemap
!         field_fetch('GENOMEMAP')
!       end
  
!     end
!     
    end
  
! end
  
  
--- 11,214 ----
  
  module Bio
+ class KEGG
  
! # == Description
! #
! # Parser for the KEGG GENOME database
! #
! # == References
! #
! # * ftp://ftp.genome.jp/pub/kegg/genomes/genome
! #
! class GENOME < KEGGDB
  
!   DELIMITER	= RS = "\n///\n"
!   TAGSIZE	= 12
  
!   def initialize(entry)
!     super(entry, TAGSIZE)
!   end
  
  
!   # ENTRY -- Returns contents of the ENTRY record as a String.
!   def entry_id
!     field_fetch('ENTRY')
!   end
!   
!   # NAME -- Returns contents of the NAME record as a String.
!   def name
!     field_fetch('NAME')
!   end
  
!   # DEFINITION -- Returns contents of the DEFINITION record as a String.
!   def definition
!     field_fetch('DEFINITION')
!   end
!   alias organism definition
  
!   # TAXONOMY -- Returns contents of the TAXONOMY record as a Hash.
!   def taxonomy
!     unless @data['TAXONOMY']
!       taxid, lineage = subtag2array(get('TAXONOMY'))
!       taxid   = taxid   ? truncate(tag_cut(taxid))   : ''
!       lineage = lineage ? truncate(tag_cut(lineage)) : ''
!       @data['TAXONOMY'] = {
!         'taxid'	=> taxid,
!         'lineage'	=> lineage,
!       }
!       @data['TAXONOMY'].default = ''
!     end
!     @data['TAXONOMY']
!   end
  
!   # Returns NCBI taxonomy ID from the TAXONOMY record as a String.
!   def taxid
!     taxonomy['taxid']
!   end
  
!   # Returns contents of the TAXONOMY/LINEAGE record as a String.
!   def lineage
!     taxonomy['lineage']
!   end
  
!   # COMMENT -- Returns contents of the COMMENT record as a String.
!   def comment
!     field_fetch('COMMENT')
!   end
!   
!   # REFERENCE -- Returns contents of the REFERENCE records as an Array of
!   # Bio::Reference objects.
!   def references
!     unless @data['REFERENCE']
!       ary = []
!       toptag2array(get('REFERENCE')).each do |ref|
!         hash = Hash.new('')
!         subtag2array(ref).each do |field|
!           case tag_get(field)
!           when /AUTHORS/
!             authors = truncate(tag_cut(field))
!             authors = authors.split(', ')
!             authors[-1] = authors[-1].split(/\s+and\s+/)
!             authors = authors.flatten.map { |a| a.sub(',', ', ') }
!             hash['authors']	= authors
!           when /TITLE/
!             hash['title']	= truncate(tag_cut(field))
!           when /JOURNAL/
!             journal = truncate(tag_cut(field))
!             if journal =~ /(.*) (\d+):(\d+)-(\d+) \((\d+)\) \[UI:(\d+)\]$/
!               hash['journal']	= $1
!               hash['volume']	= $2
!               hash['pages']		= $3
!               hash['year']		= $5
!               hash['medline']	= $6
!             else
!               hash['journal'] = journal
              end
            end
          end
!         ary.push(Reference.new(hash))
        end
+       @data['REFERENCE'] = References.new(ary)
+     end
+     @data['REFERENCE']
+   end
  
!   # CHROMOSOME -- Returns contents of the CHROMOSOME records as an Array
!   # of Hash.
!   def chromosomes
!     unless @data['CHROMOSOME']
!       @data['CHROMOSOME'] = []
!       toptag2array(get('CHROMOSOME')).each do |chr|
!         hash = Hash.new('')
!         subtag2array(chr).each do |field|
!           hash[tag_get(field)] = truncate(tag_cut(field))
          end
!         @data['CHROMOSOME'].push(hash)
        end
+     end
+     @data['CHROMOSOME']
+   end
  
!   # PLASMID -- Returns contents of the PLASMID records as an Array of Hash.
!   def plasmids
!     unless @data['PLASMID']
!       @data['PLASMID'] = []
!       toptag2array(get('PLASMID')).each do |chr|
!         hash = Hash.new('')
!         subtag2array(chr).each do |field|
!           hash[tag_get(field)] = truncate(tag_cut(field))
          end
!         @data['PLASMID'].push(hash)
        end
+     end
+     @data['PLASMID']
+   end
  
!   # SCAFFOLD -- Returns contents of the SCAFFOLD records as an Array of Hash.
!   def scaffolds
!     unless @data['SCAFFOLD']
!       @data['SCAFFOLD'] = []
!       toptag2array(get('SCAFFOLD')).each do |chr|
!         hash = Hash.new('')
!         subtag2array(chr).each do |field|
!           hash[tag_get(field)] = truncate(tag_cut(field))
          end
!         @data['SCAFFOLD'].push(hash)
        end
+     end
+     @data['SCAFFOLD']
+   end
  
!   # STATISTICS -- Returns contents of the STATISTICS record as a Hash.
!   def statistics
!     unless @data['STATISTICS']
!       hash = Hash.new(0.0)
!       get('STATISTICS').each_line do |line|
!         case line
!         when /nucleotides:\s+(\d+)/
!           hash['nalen'] = $1.to_i
!         when /protein genes:\s+(\d+)/
!           hash['num_gene'] = $1.to_i
!         when /RNA genes:\s+(\d+)/
!           hash['num_rna'] = $1.to_i
!         when /G\+C content:\s+(\d+.\d+)/
!           hash['gc'] = $1.to_f
          end
        end
!       @data['STATISTICS'] = hash
!     end
!     @data['STATISTICS']
!   end
  
!   # Returns number of nucleotides from the STATISTICS record as a Fixnum.
!   def nalen
!     statistics['nalen']
!   end
!   alias length nalen
  
!   # Returns number of protein genes from the STATISTICS record as a Fixnum.
!   def num_gene
!     statistics['num_gene']
!   end
  
!   # Returns number of rna from the STATISTICS record as a Fixnum.
!   def num_rna
!     statistics['num_rna']
!   end
  
!   # Returns G+C content from the STATISTICS record as a Float.
!   def gc
!     statistics['gc']
!   end
  
!   # GENOMEMAP -- Returns contents of the GENOMEMAP record as a String.
!   def genomemap
!     field_fetch('GENOMEMAP')
    end
  
! end # GENOME
!     
! end # KEGG
! end # Bio
  
  
***************
*** 253,362 ****
  
  
- =begin
- 
- = Bio::KEGG::GENOME
- 
- === Initialize
- 
- --- Bio::KEGG::GENOME.new(entry)
- 
- === ENTRY
- 
- --- Bio::KEGG::GENOME#entry_id -> String
- 
-       Returns contents of the ENTRY record as a String.
- 
- === NAME
- 
- --- Bio::KEGG::GENOME#name -> String
- 
-       Returns contents of the NAME record as a String.
- 
- === DEFINITION
- 
- --- Bio::KEGG::GENOME#definition -> String
- 
-       Returns contents of the DEFINITION record as a String.
- 
- --- Bio::KEGG::GENOME#organism -> String
- 
-       Alias for the 'definition' method.
- 
- === TAXONOMY
- 
- --- Bio::KEGG::GENOME#taxonomy -> Hash
- 
-       Returns contents of the TAXONOMY record as a Hash.
- 
- --- Bio::KEGG::GENOME#taxid -> String
- 
-       Returns NCBI taxonomy ID from the TAXONOMY record as a String.
- 
- --- Bio::KEGG::GENOME#lineage -> String
- 
-       Returns contents of the TAXONOMY/LINEAGE record as a String.
- 
- === COMMENT
- 
- --- Bio::KEGG::GENOME#comment -> String
- 
-       Returns contents of the COMMENT record as a String.
- 
- === REFERENCE
- 
- --- Bio::GenBank#references -> Array
- 
-       Returns contents of the REFERENCE records as an Array of Bio::Reference
-       objects.
- 
- === CHROMOSOME
- 
- --- Bio::KEGG::GENOME#chromosomes -> Array
- 
-       Returns contents of the CHROMOSOME records as an Array of Hash.
- 
- === PLASMID
- 
- --- Bio::KEGG::GENOME#plasmids -> Array
- 
-       Returns contents of the PLASMID records as an Array of Hash.
- 
- === SCAFFOLD
- 
- --- Bio::KEGG::GENOME#scaffolds -> Array
- 
-       Returns contents of the SCAFFOLD records as an Array of Hash.
- 
- === STATISTICS
- 
- --- Bio::KEGG::GENOME#statistics -> Hash
- 
-       Returns contents of the STATISTICS record as a Hash.
- 
- --- Bio::KEGG::GENOME#nalen -> Fixnum
- 
-       Returns number of nucleotides from the STATISTICS record as a Fixnum.
- 
- --- Bio::KEGG::GENOME#num_gene -> Fixnum
- 
-       Returns number of protein genes from the STATISTICS record as a Fixnum.
- 
- --- Bio::KEGG::GENOME#num_rna -> Fixnum
- 
-       Returns number of rna from the STATISTICS record as a Fixnum.
- 
- --- Bio::KEGG::GENOME#gc -> Float
- 
-       Returns G+C content from the STATISTICS record as a Float.
- 
- === GENOMEMAP
- 
- --- Bio::KEGG::GENOME#genomemap -> String
- 
-       Returns contents of the GENOMEMAP record as a String.
- 
- == SEE ALSO
- 
-   ftp://ftp.genome.jp/pub/kegg/genomes/genome
- 
- =end
--- 254,255 ----


From k at dev.open-bio.org  Tue Sep 19 01:53:15 2006
From: k at dev.open-bio.org (Katayama Toshiaki)
Date: Tue, 19 Sep 2006 05:53:15 +0000
Subject: [BioRuby-cvs] bioruby/lib/bio/db/kegg glycan.rb,1.2,1.3
Message-ID: <200609190553.k8J5rF4d031858@dev.open-bio.org>

Update of /home/repository/bioruby/bioruby/lib/bio/db/kegg
In directory dev.open-bio.org:/tmp/cvs-serv31854/lib/bio/db/kegg

Modified Files:
	glycan.rb 
Log Message:
* license is changed from LGPL to Ruby's


Index: glycan.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/kegg/glycan.rb,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** glycan.rb	8 Sep 2005 01:22:11 -0000	1.2
--- glycan.rb	19 Sep 2006 05:53:13 -0000	1.3
***************
*** 1,22 ****
  #
! # bio/db/kegg/glycan.rb - KEGG GLYCAN database class
! #
! #   Copyright (C) 2004 KATAYAMA Toshiaki 
! #
! #  This library is free software; you can redistribute it and/or
! #  modify it under the terms of the GNU Lesser General Public
! #  License as published by the Free Software Foundation; either
! #  version 2 of the License, or (at your option) any later version.
! #
! #  This library is distributed in the hope that it will be useful,
! #  but WITHOUT ANY WARRANTY; without even the implied warranty of
! #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
! #  Lesser General Public License for more details.
  #
! #  You should have received a copy of the GNU Lesser General Public
! #  License along with this library; if not, write to the Free Software
! #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
  #
! #  $Id$
  #
  
--- 1,9 ----
  #
! # = bio/db/kegg/glycan.rb - KEGG GLYCAN database class
  #
! # Copyright::  Copyright (C) 2004 Toshiaki Katayama 
! # License::    Ruby's
  #
! # $Id$
  #
  
***************
*** 24,193 ****
  
  module Bio
  
!   class KEGG
! 
!     class GLYCAN < KEGGDB
  
!       DELIMITER	= RS = "\n///\n"
!       TAGSIZE	= 12
  
!       def initialize(entry)
!         super(entry, TAGSIZE)
!       end
  
!       # ENTRY
!       def entry_id
!         unless @data['ENTRY']
!           @data['ENTRY'] = fetch('ENTRY').split(/\s+/).first
!         end
!         @data['ENTRY']
!       end
  
!       # NAME
!       def name
!         field_fetch('NAME') 
!       end
  
!       # COMPOSITION
!       def composition
!         unless @data['COMPOSITION']
!           hash = Hash.new(0)
!           fetch('COMPOSITION').scan(/\((\S+)\)(\d+)/).each do |key, val|
!             hash[key] = val.to_i
!           end
!           @data['COMPOSITION'] = hash
!         end
!         @data['COMPOSITION']
        end
  
!       # MASS
!       def mass
!         unless @data['MASS']
!           hash = Hash.new
!           fetch('MASS').scan(/(\S+)\s+\((\S+)\)/).each do |val, key|
!             hash[key] = val.to_f
!           end
!           @data['MASS'] = hash
!         end
!         @data['MASS']
        end
  
!       # CLASS
!       def keggclass
!         field_fetch('CLASS') 
!       end
  
!       # BINDING
!       def bindings
!         unless @data['BINDING']
!           ary = Array.new
!           lines = lines_fetch('BINDING')
!           lines.each do |line|
!             if /^\S/.match(line)
!               ary << line
!             else
!               ary.last << " #{line.strip}"
!             end
!           end
!           @data['BINDING'] = ary
          end
-         @data['BINDING']
        end
  
!       # COMPOUND
!       def compounds
!         unless @data['COMPOUND']
!           @data['COMPOUND'] = fetch('COMPOUND').split(/\s+/)
!         end
!         @data['COMPOUND']
!       end
  
!       # REACTION
!       def reactions
!         unless @data['REACTION']
!           @data['REACTION'] = fetch('REACTION').split(/\s+/)
!         end
!         @data['REACTION']
!       end
  
!       # PATHWAY
!       def pathways
!         lines_fetch('PATHWAY') 
!       end
  
!       # ENZYME
!       def enzymes
!         unless @data['ENZYME']
!           field = fetch('ENZYME')
!           if /\(/.match(field)	# old version
!             @data['ENZYME'] = field.scan(/\S+ \(\S+\)/)
!           else
!             @data['ENZYME'] = field.scan(/\S+/)
!           end
!         end
!         @data['ENZYME']
        end
  
!       # ORTHOLOG
!       def orthologs
!         unless @data['ORTHOLOG']
!           ary = Array.new
!           lines = lines_fetch('ORTHOLOG')
!           lines.each do |line|
!             if /^\S/.match(line)
!               ary << line
!             else
!               ary.last << " #{line.strip}"
!             end
!           end
!           @data['ORTHOLOG'] = ary
          end
-         @data['ORTHOLOG']
        end
  
!       # REFERENCE
!       def references
!         unless @data['REFERENCE']
!           ary = Array.new
!           lines = lines_fetch('REFERENCE')
!           lines.each do |line|
!             if /^\d+\s+\[PMID/.match(line)
!               ary << line
!             else
!               ary.last << " #{line.strip}"
!             end
!           end
!           @data['REFERENCE'] = ary
          end
-         @data['REFERENCE']
        end
  
!       # DBLINKS
!       def dblinks
!         unless @data['DBLINKS']
!           ary = Array.new
!           lines = lines_fetch('DBLINKS')
!           lines.each do |line|
!             if /^\S/.match(line)
!               ary << line
!             else
!               ary.last << " #{line.strip}"
!             end
!           end
!           @data['DBLINKS'] = ary
          end
-         @data['DBLINKS']
        end
! 
!       # ATOM, BOND
!       def kcf
!         return "#{get('NODE')}#{get('EDGE')}"
!       end
! 
      end
  
    end
  
! end
  
  
--- 11,178 ----
  
  module Bio
+ class KEGG
  
! class GLYCAN < KEGGDB
  
!   DELIMITER	= RS = "\n///\n"
!   TAGSIZE	= 12
  
!   def initialize(entry)
!     super(entry, TAGSIZE)
!   end
  
!   # ENTRY
!   def entry_id
!     unless @data['ENTRY']
!       @data['ENTRY'] = fetch('ENTRY').split(/\s+/).first
!     end
!     @data['ENTRY']
!   end
  
!   # NAME
!   def name
!     field_fetch('NAME') 
!   end
  
!   # COMPOSITION
!   def composition
!     unless @data['COMPOSITION']
!       hash = Hash.new(0)
!       fetch('COMPOSITION').scan(/\((\S+)\)(\d+)/).each do |key, val|
!         hash[key] = val.to_i
        end
+       @data['COMPOSITION'] = hash
+     end
+     @data['COMPOSITION']
+   end
  
!   # MASS
!   def mass
!     unless @data['MASS']
!       hash = Hash.new
!       fetch('MASS').scan(/(\S+)\s+\((\S+)\)/).each do |val, key|
!         hash[key] = val.to_f
        end
+       @data['MASS'] = hash
+     end
+     @data['MASS']
+   end
  
!   # CLASS
!   def keggclass
!     field_fetch('CLASS') 
!   end
  
!   # BINDING
!   def bindings
!     unless @data['BINDING']
!       ary = Array.new
!       lines = lines_fetch('BINDING')
!       lines.each do |line|
!         if /^\S/.match(line)
!           ary << line
!         else
!           ary.last << " #{line.strip}"
          end
        end
+       @data['BINDING'] = ary
+     end
+     @data['BINDING']
+   end
  
!   # COMPOUND
!   def compounds
!     unless @data['COMPOUND']
!       @data['COMPOUND'] = fetch('COMPOUND').split(/\s+/)
!     end
!     @data['COMPOUND']
!   end
  
!   # REACTION
!   def reactions
!     unless @data['REACTION']
!       @data['REACTION'] = fetch('REACTION').split(/\s+/)
!     end
!     @data['REACTION']
!   end
  
!   # PATHWAY
!   def pathways
!     lines_fetch('PATHWAY') 
!   end
  
!   # ENZYME
!   def enzymes
!     unless @data['ENZYME']
!       field = fetch('ENZYME')
!       if /\(/.match(field)	# old version
!         @data['ENZYME'] = field.scan(/\S+ \(\S+\)/)
!       else
!         @data['ENZYME'] = field.scan(/\S+/)
        end
+     end
+     @data['ENZYME']
+   end
  
!   # ORTHOLOG
!   def orthologs
!     unless @data['ORTHOLOG']
!       ary = Array.new
!       lines = lines_fetch('ORTHOLOG')
!       lines.each do |line|
!         if /^\S/.match(line)
!           ary << line
!         else
!           ary.last << " #{line.strip}"
          end
        end
+       @data['ORTHOLOG'] = ary
+     end
+     @data['ORTHOLOG']
+   end
  
!   # REFERENCE
!   def references
!     unless @data['REFERENCE']
!       ary = Array.new
!       lines = lines_fetch('REFERENCE')
!       lines.each do |line|
!         if /^\d+\s+\[PMID/.match(line)
!           ary << line
!         else
!           ary.last << " #{line.strip}"
          end
        end
+       @data['REFERENCE'] = ary
+     end
+     @data['REFERENCE']
+   end
  
!   # DBLINKS
!   def dblinks
!     unless @data['DBLINKS']
!       ary = Array.new
!       lines = lines_fetch('DBLINKS')
!       lines.each do |line|
!         if /^\S/.match(line)
!           ary << line
!         else
!           ary.last << " #{line.strip}"
          end
        end
!       @data['DBLINKS'] = ary
      end
+     @data['DBLINKS']
+   end
  
+   # ATOM, BOND
+   def kcf
+     return "#{get('NODE')}#{get('EDGE')}"
    end
  
! end # GLYCAN
! 
! end # KEGG
! end # Bio
  
  


From k at dev.open-bio.org  Tue Sep 19 01:54:32 2006
From: k at dev.open-bio.org (Katayama Toshiaki)
Date: Tue, 19 Sep 2006 05:54:32 +0000
Subject: [BioRuby-cvs] bioruby/lib/bio/db/kegg keggtab.rb,1.8,1.9
Message-ID: <200609190554.k8J5sWw4031901@dev.open-bio.org>

Update of /home/repository/bioruby/bioruby/lib/bio/db/kegg
In directory dev.open-bio.org:/tmp/cvs-serv31897/lib/bio/db/kegg

Modified Files:
	keggtab.rb 
Log Message:
* document is changed to RDoc


Index: keggtab.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/kegg/keggtab.rb,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** keggtab.rb	8 May 2006 14:26:35 -0000	1.8
--- keggtab.rb	19 Sep 2006 05:54:29 -0000	1.9
***************
*** 2,8 ****
  # = bio/db/kegg/keggtab.rb - KEGG keggtab class
  #
! # Copyright::	Copyright (C) 2001 Mitsuteru C. Nakao 
! # 		Copyright (C) 2003, 2006 KATAYAMA Toshiaki 
! # License::	Ruby's
  #
  #  $Id$
--- 2,8 ----
  # = bio/db/kegg/keggtab.rb - KEGG keggtab class
  #
! # Copyright::  Copyright (C) 2001 Mitsuteru C. Nakao 
! #              Copyright (C) 2003, 2006 Toshiaki Katayama 
! # License::    Ruby's
  #
  #  $Id$
***************
*** 12,23 ****
  class KEGG
  
  # Parse 'keggtab' KEGG database definition file which also includes
! # Taxonomic category of the KEGG organisms.  The 'keggtab' file can
! # be found in
  #
! # * (())
  #
  class Keggtab
  
    def initialize(file_path, bioroot = nil)
      @bioroot = ENV['BIOROOT'] || bioroot
--- 12,55 ----
  class KEGG
  
+ # == Description
+ #
  # Parse 'keggtab' KEGG database definition file which also includes
! # Taxonomic category of the KEGG organisms.
  #
! # == References
! #
! # The 'keggtab' file is included in
! #
! # * ftp://ftp.genome.jp/pub/kegg/tarfiles/genes.tar.gz
! # * ftp://ftp.genome.jp/pub/kegg/tarfiles/genes.weekly.last.tar.Z
! #
! # == Format
! #
! # File format is something like
! # 
! #   # KEGGTAB
! #   #
! #   # name            type            directory                    abbreviation
! #   #
! #   enzyme            enzyme          $BIOROOT/db/ideas/ligand     ec
! #   ec                alias           enzyme
! #   (snip)
! #   # Human
! #   h.sapiens         genes           $BIOROOT/db/kegg/genes       hsa
! #   H.sapiens         alias           h.sapiens
! #   hsa               alias           h.sapiens
! #   (snip)
! #   #
! #   # Taxonomy
! #   #
! #   (snip)
! #   animals           alias           hsa+mmu+rno+dre+dme+cel
! #   eukaryotes        alias           animals+plants+protists+fungi
! #   genes             alias           eubacteria+archaea+eukaryotes
  #
  class Keggtab
  
+   # Path for keggtab file and optionally set bioroot top directory.
+   # Environmental variable BIOROOT overrides bioroot.
    def initialize(file_path, bioroot = nil)
      @bioroot = ENV['BIOROOT'] || bioroot
***************
*** 29,33 ****
      end
    end
!   attr_reader :bioroot, :db_names
  
  
--- 61,68 ----
      end
    end
! 
!   # Returns a string of the BIOROOT path prefix.
!   attr_reader :bioroot
!   attr_reader :db_names
  
  
***************
*** 35,38 ****
--- 70,74 ----
  
    class DB
+     # Create a container object for database definitions.
      def initialize(db_name, db_type, db_path, db_abbrev)
        @name = db_name
***************
*** 42,46 ****
        @aliases = Array.new
      end
!     attr_reader :name, :type, :path, :abbrev, :aliases
      alias korg abbrev
      alias keggorg abbrev
--- 78,94 ----
        @aliases = Array.new
      end
!     # Database name. (e.g. 'enzyme', 'h.sapies', 'e.coli', ...)
!     attr_reader :name
!     # Definition type. (e.g. 'enzyme', 'alias', 'genes', ...)
!     attr_reader :type
!     # Database flat file path. (e.g. '$BIOROOT/db/kegg/genes', ...)
!     attr_reader :path
!     # Short name for the database. (e.g. 'ec', 'hsa', 'eco', ...)
!     # korg and keggorg are alias for abbrev method.
!     attr_reader :abbrev
!     # Array containing all alias names for the database.
!     # (e.g. ["H.sapiens", "hsa"], ["E.coli", "eco"], ...)
!     attr_reader :aliases
! 
      alias korg abbrev
      alias keggorg abbrev
***************
*** 50,53 ****
--- 98,103 ----
    # DB section
  
+   # Returns a hash containing DB definition section of the keggtab file.
+   # If database name is given as an argument, returns a Keggtab::DB object.
    def database(db_abbrev = nil)
      if db_abbrev
***************
*** 58,61 ****
--- 108,113 ----
    end
  
+   # Returns an Array containing all alias names for the database.
+   # (e.g. 'hsa' -> ["H.sapiens", "hsa"], 'hpj' -> ["H.pylori_J99", "hpj"])
    def aliases(db_abbrev)
      if @database[db_abbrev]
***************
*** 64,67 ****
--- 116,121 ----
    end
  
+   # Returns a canonical database name for the abbreviation.
+   # (e.g. 'ec' -> 'enzyme',  'hsa' -> 'h.sapies', ...)
    def name(db_abbrev)
      if @database[db_abbrev]
***************
*** 70,73 ****
--- 124,129 ----
    end
  
+   # Returns an absolute path for the flat file database.
+   # (e.g. '/bio/db/kegg/genes', ...)
    def path(db_abbrev)
      if @database[db_abbrev]
***************
*** 82,85 ****
--- 138,142 ----
  
  
+   # deprecated
    def alias_list(db_name)
      if @db_names[db_name]
***************
*** 88,91 ****
--- 145,149 ----
    end
  
+   # deprecated
    def db_path(db_name)
      if @bioroot
***************
*** 96,99 ****
--- 154,158 ----
    end
  
+   # deprecated
    def db_by_abbrev(db_abbrev)
      @db_names.each do |k, db|
***************
*** 103,110 ****
--- 162,171 ----
    end
  
+   # deprecated
    def name_by_abbrev(db_abbrev)
      db_by_abbrev(db_abbrev).name
    end
  
+   # deprecated
    def db_path_by_abbrev(db_abbrev)
      db_name = name_by_abbrev(db_abbrev)
***************
*** 115,118 ****
--- 176,183 ----
    # Taxonomy section
  
+   # Returns a hash containing Taxonomy section of the keggtab file.
+   # If argument is given, returns a List of all child nodes belongs
+   # to the label node.
+   # (e.g. "eukaryotes" -> ["animals", "plants", "protists", "fungi"], ...)
    def taxonomy(node = nil)
      if node
***************
*** 123,126 ****
--- 188,193 ----
    end
  
+   # List of all node labels from Taxonomy section.
+   # (e.g. ["actinobacteria", "animals", "archaea", "bacillales", ...)
    def taxa_list
      @taxonomy.keys.sort
***************
*** 131,134 ****
--- 198,204 ----
    end
  
+   # Returns an array of organism names included in the specified taxon
+   # label. (e.g. 'proteobeta' -> ["nme", "nma", "rso"])
+   # This method has taxo2keggorgs, taxon2korgs, and taxon2keggorgs aliases.
    def taxo2korgs(node = 'genes')
      if node.length == 3
***************
*** 150,153 ****
--- 220,226 ----
    alias taxon2keggorgs taxo2korgs
  
+   # Returns an array of taxonomy names the organism belongs.
+   # (e.g. 'eco' -> ['proteogamma','proteobacteria','eubacteria','genes'])
+   # This method has aliases as keggorg2taxo, korg2taxonomy, keggorg2taxonomy.
    def korg2taxo(keggorg)
      tmp = Array.new
***************
*** 283,413 ****
  
  
- 
- =begin
- 
- The keggtab file is included in
- 
-   * ((URL:ftp://ftp.genome.jp/pub/kegg/tarfiles/genes.weekly.last.tar.Z>))
- 
- File format is something like
- 
-   # KEGGTAB
-   #
-   # name            type            directory                     abbreviation
-   #
-   enzyme            enzyme          $BIOROOT/db/ideas/ligand      ec
-   ec                alias           enzyme
-   (snip)
-   # Human
-   h.sapiens         genes           $BIOROOT/db/kegg/genes        hsa
-   H.sapiens         alias           h.sapiens
-   hsa               alias           h.sapiens
-   (snip)
-   #
-   # Taxonomy
-   #
-   (snip)
-   animals           alias           hsa+mmu+rno+dre+dme+cel
-   eukaryotes        alias           animals+plants+protists+fungi
-   genes             alias           eubacteria+archaea+eukaryotes
- 
- = Bio::KEGG::Keggtab
- 
- --- Bio::KEGG::Keggtab.new(file_path, bioroot = nil)
- 
-       Path for keggtab file and optionally set bioroot top directory.
-       Environmental variable BIOROOT overrides bioroot.
- 
- --- Bio::KEGG::Keggtab#database -> Hash
- 
-       Returns a hash containing DB definition section of the keggtab file.
- 
- --- Bio::KEGG::Keggtab#database(db_abbrev) -> Keggtab::DB
- 
-       Returns a Keggtab::DB object.
- 
- --- Bio::KEGG::Keggtab#taxonomy -> Hash
- 
-       Returns a hash containing Taxonomy section of the keggtab file.
- 
- --- Bio::KEGG::Keggtab#taxonomy(node) -> Array
- 
-       Returns a List of all child nodes belongs to the label node.
-       (e.g. "eukaryotes" -> ["animals", "plants", "protists", "fungi"], ...)
- 
- --- Bio::KEGG::Keggtab#bioroot -> String
- 
-       Returns a string of the BIOROOT path prefix.
- 
- --- Bio::KEGG::Keggtab#name(db_abbrev) -> String
- 
-       Returns a canonical database name for the abbreviation.
-       (e.g. 'ec' -> 'enzyme',  'hsa' -> 'h.sapies', ...)
- 
- --- Bio::KEGG::Keggtab#aliases(db_abbrev) -> Array
- 
-       Returns an Array containing all alias names for the database.
-       (e.g. 'hsa' -> ["H.sapiens", "hsa"], 'hpj' -> ["H.pylori_J99", "hpj"])
- 
- --- Bio::KEGG::Keggtab#path(db_abbrev) -> String
- 
-       Returns an absolute path for the flat file database.
-       (e.g. '/bio/db/kegg/genes', ...)
- 
- --- Bio::KEGG::Keggtab#taxa_list -> Array
- 
-       List of all node labels from Taxonomy section.
-       (e.g. ["actinobacteria", "animals", "archaea", "bacillales", ...)
- 
- --- Bio::KEGG::Keggtab#taxo2korgs(taxon) -> Array
- 
-       Returns an array of organism names included in the specified taxon
-       label. (e.g. 'proteobeta' -> ["nme", "nma", "rso"])
-       This method has taxo2keggorgs, taxon2korgs, and taxon2keggorgs aliases.
- 
- --- Bio::KEGG::Keggtab#korg2taxo(keggorg) -> Array
- 
-       Returns an array of taxonomy names the organism belongs.
-       (e.g. 'eco' -> ['proteogamma','proteobacteria','eubacteria','genes'])
-       This method has aliases as keggorg2taxo, korg2taxonomy, keggorg2taxonomy.
- 
- * following methods are deprecated
- 
- --- Bio::KEGG::Keggtab#db_names[db_name] -> Keggtab::DB
- --- Bio::KEGG::Keggtab#db_by_abbrev(db_abbrev) -> Keggtab::DB
- --- Bio::KEGG::Keggtab#alias_list(db_name) -> Array
- --- Bio::KEGG::Keggtab#name_by_abbrev(db_abbrev) -> String
- --- Bio::KEGG::Keggtab#db_path(db_name) -> String
- --- Bio::KEGG::Keggtab#db_path_by_abbrev(keggorg) -> String
- 
- 
- == Bio::KEGG::Keggtab::DB
- 
- --- Bio::KEGG::Keggtab::DB.new(db_name, db_type, db_path, db_abbrev)
- 
-       Create a container object for database definitions.
- 
- --- Bio::KEGG::Keggtab::DB#name -> String
- 
-       Database name. (e.g. 'enzyme', 'h.sapies', 'e.coli', ...)
- 
- --- Bio::KEGG::Keggtab::DB#type -> String
- 
-       Definition type. (e.g. 'enzyme', 'alias', 'genes', ...)
- 
- --- Bio::KEGG::Keggtab::DB#path -> String
- 
-       Database flat file path. (e.g. '$BIOROOT/db/kegg/genes', ...)
- 
- --- Bio::KEGG::Keggtab::DB#abbrev -> String
- 
-       Short name for the database. (e.g. 'ec', 'hsa', 'eco', ...)
-       korg and keggorg are alias for abbrev method.
- 
- --- Bio::KEGG::Keggtab::DB#aliases -> Array
- 
-       Array containing all alias names for the database.
-       (e.g. ["H.sapiens", "hsa"], ["E.coli", "eco"], ...)
- 
- =end
- 
--- 356,357 ----


From k at dev.open-bio.org  Tue Sep 19 01:55:40 2006
From: k at dev.open-bio.org (Katayama Toshiaki)
Date: Tue, 19 Sep 2006 05:55:40 +0000
Subject: [BioRuby-cvs] bioruby/lib/bio/db/kegg kgml.rb,1.4,1.5
Message-ID: <200609190555.k8J5teA8031944@dev.open-bio.org>

Update of /home/repository/bioruby/bioruby/lib/bio/db/kegg
In directory dev.open-bio.org:/tmp/cvs-serv31940/lib/bio/db/kegg

Modified Files:
	kgml.rb 
Log Message:
* accessor for component attribute is added


Index: kgml.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/kegg/kgml.rb,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** kgml.rb	25 Jul 2006 19:17:39 -0000	1.4
--- kgml.rb	19 Sep 2006 05:55:38 -0000	1.5
***************
*** 8,11 ****
--- 8,17 ----
  # $Id$
  #
+ 
+ autoload :REXML, 'rexml/document'
+ 
+ module Bio
+ class KEGG
+ 
  # == KGML (KEGG XML) parser
  #
***************
*** 61,64 ****
--- 67,72 ----
  #    puts entry.fgcolor
  #    puts entry.bgcolor
+ #    #  attributes
+ #    puts entry.components
  #    # methood
  #    puts entry.names
***************
*** 101,110 ****
  #  end
  #
- 
- autoload :REXML, 'rexml/document'
- 
- module Bio
- class KEGG
- 
  class KGML
  
--- 109,112 ----
***************
*** 122,125 ****
--- 124,128 ----
      attr_accessor :entry_id, :name, :entry_type, :link, :reaction, :map
      attr_accessor :label, :shape, :x, :y, :width, :height, :fgcolor, :bgcolor
+     attr_accessor :components
      def names
        @name.split(/\s+/)
***************
*** 178,181 ****
--- 181,191 ----
          entry.bgcolor  = attr["bgcolor"]
        }
+ 
+       node.elements.each("component") { |component|
+         attr = component.attributes
+         entry.components ||= []
+         entry.components << attr["id"].to_i
+       }
+ 
        @entries << entry
      }


From k at dev.open-bio.org  Tue Sep 19 01:56:16 2006
From: k at dev.open-bio.org (Katayama Toshiaki)
Date: Tue, 19 Sep 2006 05:56:16 +0000
Subject: [BioRuby-cvs] bioruby/lib/bio/db/kegg ko.rb,1.5,1.6
Message-ID: <200609190556.k8J5uGhA031987@dev.open-bio.org>

Update of /home/repository/bioruby/bioruby/lib/bio/db/kegg
In directory dev.open-bio.org:/tmp/cvs-serv31983/lib/bio/db/kegg

Modified Files:
	ko.rb 
Log Message:
* license is changed from LGPL to Ruby's
* document is changed to RDoc


Index: ko.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/kegg/ko.rb,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** ko.rb	8 Sep 2005 01:22:11 -0000	1.5
--- ko.rb	19 Sep 2006 05:56:14 -0000	1.6
***************
*** 1,106 ****
  #
! # bio/db/kegg/ko.rb - KO (KEGG Orthology) database class
  #
! #   Copyright (C) 2003 KATAYAMA Toshiaki 
! #   Copyright (C) 2003 Masumi Itoh 
  #
! #  This library is free software; you can redistribute it and/or
! #  modify it under the terms of the GNU Lesser General Public
! #  License as published by the Free Software Foundation; either
! #  version 2 of the License, or (at your option) any later version.
  #
! #  This library is distributed in the hope that it will be useful,
! #  but WITHOUT ANY WARRANTY; without even the implied warranty of
! #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
! #  Lesser General Public License for more details.
  #
! #  You should have received a copy of the GNU Lesser General Public
! #  License along with this library; if not, write to the Free Software
! #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
  #
! #  $Id$
  #
  
! require 'bio/db'
  
! module Bio
  
!   class KEGG
!     
!     class KO < KEGGDB
!       
!       DELIMITER	= RS = "\n///\n"
!       TAGSIZE	= 12
  
!       def initialize(entry)
!         super(entry, TAGSIZE)
!       end
!       
!       
!       def entry_id
!         field_fetch('ENTRY')[/\S+/]
!       end
!       
!       def name
!         field_fetch('NAME')
!       end
!       
!       def names
!         name.split(', ')
!       end
!       
!       def definition
!         field_fetch('DEFINITION')
!       end
!       
!       def keggclass
!         field_fetch('CLASS')
!       end
  
!       def keggclasses
!         keggclass.gsub(/ \[[^\]]+/, '').split(/\] ?/)
!       end
!       
!       def pathways
!         keggclass.scan(/\[PATH:(.*?)\]/).flatten
        end
!       
!       def dblinks
!         unless @data['DBLINKS']
!           hash = {}
!           get('DBLINKS').scan(/(\S+):\s*(.*)\n/).each do |k, v|
!             hash[k] = v.split(/\s+/)
!           end
!           @data['DBLINKS'] = hash
          end
!         @data['DBLINKS']		# Hash of DB:ID in DBLINKS
!       end
!       
!       def genes
!         unless @data['GENES']
!           hash = {}
!           k = ''
!           get('GENES').each_line do |line|
!             line.chomp!
!             line[0, @tagsize] = '' 
!             if line =~ /(\S+):/
!               k = $1
!               hash[k] = []
!             end
!             line[0, 5] = ''
!             line.gsub(/\(\S+/, '').each(' ') do |u|
!               hash[k] << u.strip
!             end
!           end
!           @data['GENES'] = hash
          end
-         @data['GENES']		# Hash of DB:ID in DBLINKS
        end
!       
      end
!     
    end
    
! end
  
  
--- 1,108 ----
  #
! # = bio/db/kegg/ko.rb - KO (KEGG Orthology) database class
  #
! # Copyright::  Copyright (C) 2003 Toshiaki Katayama 
! # Copyright::  Copyright (C) 2003 Masumi Itoh 
  #
! # $Id$
  #
! 
! require 'bio/db'
! 
! module Bio
! class KEGG
! 
! # == Description
  #
! # KO (KEGG Orthology) entry parser.
  #
! # == References
  #
+ # * http://www.genome.jp/dbget-bin/get_htext?KO
+ # * ftp://ftp.genome.jp/pub/kegg/tarfiles/ko
+ #
+ class KO < KEGGDB
+   
+   DELIMITER	= RS = "\n///\n"
+   TAGSIZE	= 12
  
!   # Reads a flat file format entry of the KO database.
!   def initialize(entry)
!     super(entry, TAGSIZE)
!   end
!   
!   # Returns ID of the entry.
!   def entry_id
!     field_fetch('ENTRY')[/\S+/]
!   end
  
!   # Returns NAME field of the entry.
!   def name
!     field_fetch('NAME')
!   end
  
!   # Returns an Array of names in NAME field.
!   def names
!     name.split(', ')
!   end
  
!   # Returns DEFINITION field of the entry.
!   def definition
!     field_fetch('DEFINITION')
!   end
  
!   # Returns CLASS field of the entry.
!   def keggclass
!     field_fetch('CLASS')
!   end
! 
!   # Returns an Array of biological classes in CLASS field.
!   def keggclasses
!     keggclass.gsub(/ \[[^\]]+/, '').split(/\] ?/)
!   end
! 
!   # Returns an Array of KEGG/PATHWAY ID in CLASS field.
!   def pathways
!     keggclass.scan(/\[PATH:(.*?)\]/).flatten
!   end
!   
!   # Returns a Hash of Array of a database name and entry IDs in DBLINKS field.
!   def dblinks
!     unless @data['DBLINKS']
!       hash = {}
!       get('DBLINKS').scan(/(\S+):\s*(.*)\n/).each do |k, v|
!         hash[k] = v.split(/\s+/)
        end
!       @data['DBLINKS'] = hash
!     end
!     @data['DBLINKS']		# Hash of DB:ID in DBLINKS
!   end
! 
!   # Returns a Hash of Array of the organism ID and entry IDs in GENES field.
!   def genes
!     unless @data['GENES']
!       hash = {}
!       k = ''
!       get('GENES').each_line do |line|
!         line.chomp!
!         line[0, @tagsize] = '' 
!         if line =~ /(\S+):/
!           k = $1
!           hash[k] = []
          end
!         line[0, 5] = ''
!         line.gsub(/\(\S+/, '').each(' ') do |u|
!           hash[k] << u.strip
          end
        end
!       @data['GENES'] = hash
      end
!     @data['GENES']		# Hash of DB:ID in DBLINKS
    end
    
! end # KO
!     
! end # KEGG
! end # Bio
  
  
***************
*** 126,178 ****
  
  
- =begin
- 
- = Bio::KEGG::KO
- 
- KO (KEGG Orthology) entry parser.
- 
- * (())
- * (())
- 
- --- Bio::KEGG::KO.new(entry)
- 
- Reads a flat file format entry of the KO database.
- 
- --- Bio::KEGG::KO#entry_id -> String
- 
- Returns ID of the entry.
- 
- --- Bio::KEGG::KO#name -> String
- 
- Returns NAME field of the entry.
- 
- --- Bio::KEGG::KO#names -> Array
- 
- Returns an Array of names in NAME field.
- 
- --- Bio::KEGG::KO#definition -> String
- 
- Returns DEFINITION field of the entry.
- 
- --- Bio::KEGG::KO#keggclass
- 
- Returns CLASS field of the entry.
- 
- --- Bio::KEGG::KO#keggclasses
- 
- Returns an Array of biological classes in CLASS field.
- 
- --- Bio::KEGG::KO#pathways
- 
- Returns an Array of KEGG/PATHWAY ID in CLASS field.
- 
- --- Bio::KEGG::KO#dblinks
- 
- Returns a Hash of Array of the database name and entry IDs in DBLINKS field.
- 
- --- Bio::KEGG::KO#genes
- 
- Returns a Hash of Array of the organism ID and entry IDs in GENES field.
- 
- =end
- 
--- 128,129 ----


From k at dev.open-bio.org  Tue Sep 19 01:56:40 2006
From: k at dev.open-bio.org (Katayama Toshiaki)
Date: Tue, 19 Sep 2006 05:56:40 +0000
Subject: [BioRuby-cvs] bioruby/lib/bio/db/kegg reaction.rb,1.3,1.4
Message-ID: <200609190556.k8J5uebo032030@dev.open-bio.org>

Update of /home/repository/bioruby/bioruby/lib/bio/db/kegg
In directory dev.open-bio.org:/tmp/cvs-serv32026/lib/bio/db/kegg

Modified Files:
	reaction.rb 
Log Message:
* license is changed from LGPL to Ruby's


Index: reaction.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/kegg/reaction.rb,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** reaction.rb	8 Sep 2005 01:22:11 -0000	1.3
--- reaction.rb	19 Sep 2006 05:56:38 -0000	1.4
***************
*** 1,22 ****
  #
! # bio/db/kegg/reaction.rb - KEGG REACTION database class
! #
! #   Copyright (C) 2004 KATAYAMA Toshiaki 
! #
! #  This library is free software; you can redistribute it and/or
! #  modify it under the terms of the GNU Lesser General Public
! #  License as published by the Free Software Foundation; either
! #  version 2 of the License, or (at your option) any later version.
! #
! #  This library is distributed in the hope that it will be useful,
! #  but WITHOUT ANY WARRANTY; without even the implied warranty of
! #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
! #  Lesser General Public License for more details.
  #
! #  You should have received a copy of the GNU Lesser General Public
! #  License along with this library; if not, write to the Free Software
! #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
  #
! #  $Id$
  #
  
--- 1,9 ----
  #
! # = bio/db/kegg/reaction.rb - KEGG REACTION database class
  #
! # Copyright::  Copyright (C) 2004 Toshiaki Katayama 
! # License::    Ruby's
  #
! # $Id$
  #
  
***************
*** 24,85 ****
  
  module Bio
  
!   class KEGG
! 
!     class REACTION < KEGGDB
! 
!       DELIMITER	= RS = "\n///\n"
!       TAGSIZE	= 12
  
!       def initialize(entry)
!         super(entry, TAGSIZE)
!       end
  
!       # ENTRY
!       def entry_id
!         field_fetch('ENTRY')
!       end
  
!       # NAME
!       def name
!         field_fetch('NAME') 
!       end
  
!       # DEFINITION
!       def definition
!         field_fetch('DEFINITION')
!       end
  
!       # EQUATION
!       def equation
!         field_fetch('EQUATION')
!       end
  
!       # RPAIR
!       def rpairs
!         unless @data['RPAIR']
!           @data['RPAIR'] = fetch('RPAIR').split(/\s+/)
!         end
!         @data['RPAIR']
!       end
  
!       # PATHWAY
!       def pathways
!         lines_fetch('PATHWAY') 
!       end
  
!       # ENZYME
!       def enzymes
!         unless @data['ENZYME']
!           @data['ENZYME'] = fetch('ENZYME').scan(/\S+/)
!         end
!         @data['ENZYME']
!       end
  
      end
! 
    end
  
! end
  
  
--- 11,70 ----
  
  module Bio
+ class KEGG
  
! class REACTION < KEGGDB
  
!   DELIMITER	= RS = "\n///\n"
!   TAGSIZE	= 12
  
!   def initialize(entry)
!     super(entry, TAGSIZE)
!   end
  
!   # ENTRY
!   def entry_id
!     field_fetch('ENTRY')
!   end
  
!   # NAME
!   def name
!     field_fetch('NAME') 
!   end
  
!   # DEFINITION
!   def definition
!     field_fetch('DEFINITION')
!   end
  
!   # EQUATION
!   def equation
!     field_fetch('EQUATION')
!   end
  
!   # RPAIR
!   def rpairs
!     unless @data['RPAIR']
!       @data['RPAIR'] = fetch('RPAIR').split(/\s+/)
!     end
!     @data['RPAIR']
!   end
  
!   # PATHWAY
!   def pathways
!     lines_fetch('PATHWAY') 
!   end
  
+   # ENZYME
+   def enzymes
+     unless @data['ENZYME']
+       @data['ENZYME'] = fetch('ENZYME').scan(/\S+/)
      end
!     @data['ENZYME']
    end
  
! end # REACTION
! 
! end # KEGG
! end # Bio
  
  


From k at dev.open-bio.org  Tue Sep 19 01:57:22 2006
From: k at dev.open-bio.org (Katayama Toshiaki)
Date: Tue, 19 Sep 2006 05:57:22 +0000
Subject: [BioRuby-cvs] bioruby/lib/bio/db/genbank common.rb,1.9,1.10
Message-ID: <200609190557.k8J5vMmt032073@dev.open-bio.org>

Update of /home/repository/bioruby/bioruby/lib/bio/db/genbank
In directory dev.open-bio.org:/tmp/cvs-serv32069/lib/bio/db/genbank

Modified Files:
	common.rb 
Log Message:
* license is changed from LGPL to Ruby's
* document is changed to RDoc


Index: common.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/genbank/common.rb,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** common.rb	7 Dec 2005 11:23:51 -0000	1.9
--- common.rb	19 Sep 2006 05:57:20 -0000	1.10
***************
*** 1,22 ****
  #
! # bio/db/genbank/common.rb - Common methods for GenBank style database classes
! #
! #   Copyright (C) 2004 KATAYAMA Toshiaki 
! #
! #  This library is free software; you can redistribute it and/or
! #  modify it under the terms of the GNU Lesser General Public
! #  License as published by the Free Software Foundation; either
! #  version 2 of the License, or (at your option) any later version.
! #
! #  This library is distributed in the hope that it will be useful,
! #  but WITHOUT ANY WARRANTY; without even the implied warranty of
! #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
! #  Lesser General Public License for more details.
  #
! #  You should have received a copy of the GNU Lesser General Public
! #  License along with this library; if not, write to the Free Software
! #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
  #
! #  $Id$
  #
  
--- 1,9 ----
  #
! # = bio/db/genbank/common.rb - Common methods for GenBank style database classes
  #
! # Copyright::  Copyright (C) 2004 Toshiaki Katayama 
! # License::    Ruby's
  #
! # $Id$
  #
  
***************
*** 25,28 ****
--- 12,26 ----
  module Bio
  class NCBIDB
+ 
+ # == Description
+ # 
+ # This module defines a common framework among GenBank, GenPept, RefSeq, and
+ # DDBJ.  For more details, see the documentations in each genbank/*.rb files.
+ # 
+ # == References
+ # 
+ # * ftp://ftp.ncbi.nih.gov/genbank/gbrel.txt
+ # * http://www.ncbi.nlm.nih.gov/collab/FT/index.html
+ #
  module Common
  
***************
*** 34,40 ****
    end
  
!   # LOCUS  -- Locus class must be defined in child classes
  
!   # DEFINITION
    def definition
      field_fetch('DEFINITION')
--- 32,41 ----
    end
  
!   # LOCUS -- Locus class must be defined in child classes.
!   def locus
!     # must be overrided in each subclass
!   end
  
!   # DEFINITION -- Returns contents of the DEFINITION record as a String.
    def definition
      field_fetch('DEFINITION')
***************
*** 42,46 ****
  
  
!   # ACCESSION
    def accessions
      accession.split(/\s+/)
--- 43,47 ----
  
  
!   # ACCESSION -- Returns contents of the ACCESSION record as an Array.
    def accessions
      accession.split(/\s+/)
***************
*** 48,68 ****
  
  
!   # VERSION
    def versions
      @data['VERSION'] ||= fetch('VERSION').split(/\s+/)
    end
  
    def acc_version
      versions.first.to_s
    end
  
    def accession
      acc_version.split(/\./).first.to_s
    end
  
    def version
      acc_version.split(/\./).last.to_i
    end
  
    def gi
      versions.last
--- 49,73 ----
  
  
!   # VERSION -- Returns contents of the VERSION record as an Array of Strings.
    def versions
      @data['VERSION'] ||= fetch('VERSION').split(/\s+/)
    end
  
+   # Returns the first part of the VERSION record as "ACCESSION.VERSION" String.
    def acc_version
      versions.first.to_s
    end
  
+   # Returns the ACCESSION part of the acc_version.
    def accession
      acc_version.split(/\./).first.to_s
    end
  
+   # Returns the VERSION part of the acc_version as a Fixnum
    def version
      acc_version.split(/\./).last.to_i
    end
  
+   # Returns the second part of the VERSION record as a "GI:#######" String.
    def gi
      versions.last
***************
*** 70,74 ****
  
  
!   # NID
    def nid
      field_fetch('NID')
--- 75,79 ----
  
  
!   # NID -- Returns contents of the NID record as a String.
    def nid
      field_fetch('NID')
***************
*** 76,80 ****
  
  
!   # KEYWORDS
    def keywords
      @data['KEYWORDS'] ||= fetch('KEYWORDS').chomp('.').split(/; /)
--- 81,85 ----
  
  
!   # KEYWORDS -- Returns contents of the KEYWORDS record as an Array of Strings.
    def keywords
      @data['KEYWORDS'] ||= fetch('KEYWORDS').chomp('.').split(/; /)
***************
*** 82,86 ****
  
  
!   # SEGMENT
    def segment
      @data['SEGMENT'] ||= fetch('SEGMENT').scan(/\d+/).join("/")
--- 87,91 ----
  
  
!   # SEGMENT -- Returns contents of the SEGMENT record as a "m/n" form String.
    def segment
      @data['SEGMENT'] ||= fetch('SEGMENT').scan(/\d+/).join("/")
***************
*** 88,92 ****
  
  
!   # SOURCE
    def source
      unless @data['SOURCE']
--- 93,97 ----
  
  
!   # SOURCE -- Returns contents of the SOURCE record as a Hash.
    def source
      unless @data['SOURCE']
***************
*** 127,131 ****
  
  
!   # REFERENCE
    def references
      unless @data['REFERENCE']
--- 132,137 ----
  
  
!   # REFERENCE -- Returns contents of the REFERENCE records as an Array of
!   # Bio::Reference objects.
    def references
      unless @data['REFERENCE']
***************
*** 174,178 ****
  
  
!   # COMMENT
    def comment
      field_fetch('COMMENT')
--- 180,184 ----
  
  
!   # COMMENT -- Returns contents of the COMMENT record as a String.
    def comment
      field_fetch('COMMENT')
***************
*** 180,184 ****
  
  
!   # FEATURES
    def features
      unless @data['FEATURES']
--- 186,191 ----
  
  
!   # FEATURES -- Returns contents of the FEATURES record as a Bio::Features
!   # object.
    def features
      unless @data['FEATURES']
***************
*** 234,238 ****
  
  
!   # ORIGIN
    def origin
      unless @data['ORIGIN']
--- 241,245 ----
  
  
!   # ORIGIN -- Returns contents of the ORIGIN record as a String.
    def origin
      unless @data['ORIGIN']
***************
*** 277,299 ****
  
  end # Common 
  end # GenBank
  end # Bio
  
  
- =begin
- 
- = Bio::GenBank::Common
- 
- This module defines a common framework among GenBank, GenPept, RefSeq, and
- DDBJ.  For more details, see the documentations in each genbank/*.rb files.
- 
- 
- == SEE ALSO
- 
- * (())
- * (())
- 
- =end
- 
- 
- 
--- 284,290 ----
  
  end # Common 
+ 
  end # GenBank
  end # Bio
  
  


From k at dev.open-bio.org  Tue Sep 19 01:57:56 2006
From: k at dev.open-bio.org (Katayama Toshiaki)
Date: Tue, 19 Sep 2006 05:57:56 +0000
Subject: [BioRuby-cvs] bioruby/lib/bio/db/genbank ddbj.rb,1.7,1.8
Message-ID: <200609190557.k8J5vueI032116@dev.open-bio.org>

Update of /home/repository/bioruby/bioruby/lib/bio/db/genbank
In directory dev.open-bio.org:/tmp/cvs-serv32112/lib/bio/db/genbank

Modified Files:
	ddbj.rb 
Log Message:
* license is changed from LGPL to Ruby's


Index: ddbj.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/genbank/ddbj.rb,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** ddbj.rb	9 Sep 2005 16:02:04 -0000	1.7
--- ddbj.rb	19 Sep 2006 05:57:54 -0000	1.8
***************
*** 1,22 ****
  #
! # bio/db/genbank/ddbj.rb - DDBJ database class
! #
! #   Copyright (C) 2000-2004 KATAYAMA Toshiaki 
! #
! #  This library is free software; you can redistribute it and/or
! #  modify it under the terms of the GNU Lesser General Public
! #  License as published by the Free Software Foundation; either
! #  version 2 of the License, or (at your option) any later version.
! #
! #  This library is distributed in the hope that it will be useful,
! #  but WITHOUT ANY WARRANTY; without even the implied warranty of
! #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
! #  Lesser General Public License for more details.
  #
! #  You should have received a copy of the GNU Lesser General Public
! #  License along with this library; if not, write to the Free Software
! #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
  #
! #  $Id$
  #
  
--- 1,9 ----
  #
! # = bio/db/genbank/ddbj.rb - DDBJ database class
  #
! # Copyright::  Copyright (C) 2000-2004 Toshiaki Katayama 
! # License::    Ruby's
  #
! # $Id$
  #
  
***************
*** 30,34 ****
  
    # Nothing to do (DDBJ database format is completely same as GenBank)
! end
  
  end # Bio
--- 17,22 ----
  
    # Nothing to do (DDBJ database format is completely same as GenBank)
! 
! end # DDBJ
  
  end # Bio


From k at dev.open-bio.org  Tue Sep 19 01:59:09 2006
From: k at dev.open-bio.org (Katayama Toshiaki)
Date: Tue, 19 Sep 2006 05:59:09 +0000
Subject: [BioRuby-cvs] bioruby/lib/bio/db/genbank genbank.rb,0.38,0.39
Message-ID: <200609190559.k8J5x9Jd032159@dev.open-bio.org>

Update of /home/repository/bioruby/bioruby/lib/bio/db/genbank
In directory dev.open-bio.org:/tmp/cvs-serv32155/lib/bio/db/genbank

Modified Files:
	genbank.rb 
Log Message:
* license is changed from LGPL to Ruby's
* document is changed to RDoc


Index: genbank.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/genbank/genbank.rb,v
retrieving revision 0.38
retrieving revision 0.39
diff -C2 -d -r0.38 -r0.39
*** genbank.rb	7 Dec 2005 11:23:51 -0000	0.38
--- genbank.rb	19 Sep 2006 05:59:07 -0000	0.39
***************
*** 1,22 ****
  #
! # bio/db/genbank/genbank.rb - GenBank database class
! #
! #   Copyright (C) 2000-2005 KATAYAMA Toshiaki 
! #
! #  This library is free software; you can redistribute it and/or
! #  modify it under the terms of the GNU Lesser General Public
! #  License as published by the Free Software Foundation; either
! #  version 2 of the License, or (at your option) any later version.
! #
! #  This library is distributed in the hope that it will be useful,
! #  but WITHOUT ANY WARRANTY; without even the implied warranty of
! #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
! #  Lesser General Public License for more details.
  #
! #  You should have received a copy of the GNU Lesser General Public
! #  License along with this library; if not, write to the Free Software
! #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
  #
! #  $Id$
  #
  
--- 1,9 ----
  #
! # = bio/db/genbank/genbank.rb - GenBank database class
  #
! # Copyright::  Copyright (C) 2000-2005 Toshiaki Katayama 
! # License::    Ruby's
  #
! # $Id$
  #
  
***************
*** 25,33 ****
  
  module Bio
  class GenBank < NCBIDB
  
    include Bio::NCBIDB::Common
  
!   # LOCUS
    class Locus
      def initialize(locus_line)
--- 12,32 ----
  
  module Bio
+ 
+ # == Description
+ #
+ # Parses a GenBank formatted database entry
+ #
+ # == Example
+ #
+ #   # entry is a string containing only one entry contents
+ #   gb = Bio::GenBank.new(entry)
+ #
  class GenBank < NCBIDB
  
    include Bio::NCBIDB::Common
  
!   # Parses the LOCUS line and returns contents of the LOCUS record
!   # as a Bio::GenBank::Locus object.  Locus object is created automatically
!   # when Bio::GenBank#locus, entry_id etc. methods are called.
    class Locus
      def initialize(locus_line)
***************
*** 56,88 ****
    end
  
    def locus
      @data['LOCUS'] ||= Locus.new(get('LOCUS'))
    end
-   def entry_id;		locus.entry_id;		end
-   def length;		locus.length;		end
-   def circular;		locus.circular;		end
-   def division;		locus.division;		end
-   def date;		locus.date;		end
- 
-   def strand;		locus.strand;		end
-   def natype;		locus.natype;		end
  
  
!   # ORIGIN
!   def seq
!     unless @data['SEQUENCE']
!       origin
!     end
!     Bio::Sequence::NA.new(@data['SEQUENCE'])
!   end
!   alias naseq seq
!   alias nalen length
! 
!   def seq_len
!     seq.length
!   end
  
  
!   # FEATURES
    def each_cds
      features.each do |feature|
--- 55,75 ----
    end
  
+   # Accessor methods for the contents of the LOCUS record.
+ 
    def locus
      @data['LOCUS'] ||= Locus.new(get('LOCUS'))
    end
  
+   def entry_id;  locus.entry_id;  end
+   def length;    locus.length;    end
+   def circular;  locus.circular;  end
+   def division;  locus.division;  end
+   def date;      locus.date;      end
  
!   def strand;    locus.strand;    end
!   def natype;    locus.natype;    end
  
  
!   # FEATURES -- Iterate only for the 'CDS' portion of the Bio::Features.
    def each_cds
      features.each do |feature|
***************
*** 93,96 ****
--- 80,84 ----
    end
  
+   # FEATURES -- Iterate only for the 'gene' portion of the Bio::Features.
    def each_gene
      features.each do |feature|
***************
*** 102,106 ****
  
  
!   # BASE COUNT : obsoleted after GenBank release 138.0
    def basecount(base = nil)
      unless @data['BASE COUNT']
--- 90,97 ----
  
  
!   # BASE COUNT (this field is obsoleted after GenBank release 138.0) --
!   # Returns the BASE COUNT as a Hash.  When the base is specified, returns
!   # count of the base as a Fixnum.  The base can be one of 'a', 't', 'g',
!   # 'c', and 'o' (others).
    def basecount(base = nil)
      unless @data['BASE COUNT']
***************
*** 120,123 ****
--- 111,129 ----
    end
  
+   # ORIGIN -- Returns DNA sequence in the ORIGIN record as a
+   # Bio::Sequence::NA object.
+   def seq
+     unless @data['SEQUENCE']
+       origin
+     end
+     Bio::Sequence::NA.new(@data['SEQUENCE'])
+   end
+   alias naseq seq
+   alias nalen length
+ 
+   def seq_len
+     seq.length
+   end
+ 
  end # GenBank
  end # Bio
***************
*** 207,354 ****
  
  
- =begin
- 
- = Bio::GenBank
- 
- === Initialize
- 
- --- Bio::GenBank.new(entry)
- 
- === LOCUS
- 
- --- Bio::GenBank#locus -> Bio::Locus
- 
- Returns contents of the LOCUS record as a Bio::GenBank::Locus object.
- 
- --- Bio::GenBank#entry_id -> String
- --- Bio::GenBank#nalen -> Fixnum
- --- Bio::GenBank#strand -> String
- --- Bio::GenBank#natype -> String
- --- Bio::GenBank#circular -> String
- --- Bio::GenBank#division -> String
- --- Bio::GenBank#date -> String
- 
- Access methods for the contents of the LOCUS record.
- 
- === DEFINITION
- 
- --- Bio::GenBank#definition -> String
- 
- Returns contents of the DEFINITION record as a String.
- 
- === ACCESSION
- 
- --- Bio::GenBank#accessions -> Array
- 
- Returns contents of the ACCESSION record as an Array.
- 
- === VERSION
- 
- --- Bio::GenBank#versions -> Array
- 
- Returns contents of the VERSION record as an Array of Strings.
- 
- --- Bio::GenBank#acc_version -> String
- --- Bio::GenBank#accession -> String
- --- Bio::GenBank#version -> Fixnum
- --- Bio::GenBank#gi -> String
- 
- Access methods for the contents of the VERSION record.
- 
- The 'acc_version' method returns the first part of the VERSION record
- as a "ACCESSION.VERSION" String, 'accession' method returns the ACCESSION
- part of the acc_version, 'version' method returns the VERSION part of the
- acc_version as a Fixnum, and the 'gi' method returns the second part of
- the VERSION record as a "GI:#######" String.
- 
- === NID
- 
- --- Bio::GenBank#nid -> String
- 
- Returns contents of the NID record as a String.
- 
- === KEYWORDS
- 
- --- Bio::GenBank#keywords -> Array
- 
- Returns contents of the KEYWORDS record as an Array of Strings.
- 
- === SEGMENT
- 
- --- Bio::GenBank#segment -> String
- 
- Returns contents of the SEGMENT record as a "m/n" form String.
- 
- === SOURCE
- 
- --- Bio::GenBank#source -> Hash
- 
- Returns contents of the SOURCE record as a Hash.
- 
- --- Bio::GenBank#common_name -> String
- --- Bio::GenBank#vernacular_name -> String
- --- Bio::GenBank#organism -> String
- --- Bio::GenBank#taxonomy -> String
- 
- Access methods for the contents of the SOURCE record.
- 
- The 'common_name' method is same as source['common_name'].
- The 'vernacular_name' method is an alias for the 'common_name'.
- The 'organism' method is same as source['organism'].
- The 'taxonomy' method is same as source['taxonomy'].
- 
- === REFERENCE
- 
- --- Bio::GenBank#references -> Array
- 
- Returns contents of the REFERENCE records as an Array of Bio::Reference
- objects.
- 
- === COMMENT
- 
- --- Bio::GenBank#comment -> String
- 
- Returns contents of the COMMENT record as a String.
- 
- === FEATURES
- 
- --- Bio::GenBank#features -> Bio::Features
- 
- Returns contents of the FEATURES record as a Bio::Features object.
- 
- --- Bio::GenBank#each_cds -> Array
- 
- Iterate only for the 'CDS' portion of the Bio::Features.
- 
- --- Bio::GenBank#each_gene -> Array
- 
- Iterate only for the 'gene' portion of the Bio::Features.
- 
- === BASE COUNT
- 
- --- Bio::GenBank#basecount(base = nil) -> Hash or Fixnum
- 
- Returns the BASE COUNT as a Hash.  When the base is specified, returns
- count of the base as a Fixnum.  The base can be one of 'a', 't', 'g',
- 'c', and 'o' (others).
- 
- === ORIGIN
- 
- --- Bio::GenBank#origin -> String
- 
- Returns contents of the ORIGIN record as a String.
- 
- --- Bio::GenBank#naseq -> Bio::Sequence::NA
- --- Bio::GenBank#seq -> Bio::Sequence::NA
- 
- Returns DNA sequence in the ORIGIN record as a Bio::Sequence::NA object.
- 
- == SEE ALSO
- 
- * (())
- * (())
- 
- =end
- 
- 
  
--- 213,215 ----


From k at dev.open-bio.org  Tue Sep 19 01:59:37 2006
From: k at dev.open-bio.org (Katayama Toshiaki)
Date: Tue, 19 Sep 2006 05:59:37 +0000
Subject: [BioRuby-cvs] bioruby/lib/bio/db/genbank genpept.rb,1.10,1.11
Message-ID: <200609190559.k8J5xbHf032202@dev.open-bio.org>

Update of /home/repository/bioruby/bioruby/lib/bio/db/genbank
In directory dev.open-bio.org:/tmp/cvs-serv32198/lib/bio/db/genbank

Modified Files:
	genpept.rb 
Log Message:
* license is changed from LGPL to Ruby's


Index: genpept.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/genbank/genpept.rb,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** genpept.rb	23 Oct 2005 07:20:37 -0000	1.10
--- genpept.rb	19 Sep 2006 05:59:34 -0000	1.11
***************
*** 1,22 ****
  #
! # bio/db/genbank/genpept.rb - GenPept database class
! #
! #   Copyright (C) 2002-2004 KATAYAMA Toshiaki 
! #
! #  This library is free software; you can redistribute it and/or
! #  modify it under the terms of the GNU Lesser General Public
! #  License as published by the Free Software Foundation; either
! #  version 2 of the License, or (at your option) any later version.
! #
! #  This library is distributed in the hope that it will be useful,
! #  but WITHOUT ANY WARRANTY; without even the implied warranty of
! #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
! #  Lesser General Public License for more details.
  #
! #  You should have received a copy of the GNU Lesser General Public
! #  License along with this library; if not, write to the Free Software
! #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
  #
! #  $Id$
  #
  
--- 1,9 ----
  #
! # = bio/db/genbank/genpept.rb - GenPept database class
  #
! # Copyright::  Copyright (C) 2002-2004 Toshiaki Katayama 
! # License::    Ruby's
  #
! # $Id$
  #
  


From k at dev.open-bio.org  Tue Sep 19 02:00:08 2006
From: k at dev.open-bio.org (Katayama Toshiaki)
Date: Tue, 19 Sep 2006 06:00:08 +0000
Subject: [BioRuby-cvs] bioruby/lib/bio/db/genbank refseq.rb,1.6,1.7
Message-ID: <200609190600.k8J608m5032245@dev.open-bio.org>

Update of /home/repository/bioruby/bioruby/lib/bio/db/genbank
In directory dev.open-bio.org:/tmp/cvs-serv32241/lib/bio/db/genbank

Modified Files:
	refseq.rb 
Log Message:
* license is changed from LGPL to Ruby's


Index: refseq.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/genbank/refseq.rb,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** refseq.rb	23 Aug 2004 23:40:35 -0000	1.6
--- refseq.rb	19 Sep 2006 06:00:06 -0000	1.7
***************
*** 1,22 ****
  #
! # bio/db/genbank/refseq.rb - RefSeq database class
! #
! #   Copyright (C) 2000-2004 KATAYAMA Toshiaki 
! #
! #  This library is free software; you can redistribute it and/or
! #  modify it under the terms of the GNU Lesser General Public
! #  License as published by the Free Software Foundation; either
! #  version 2 of the License, or (at your option) any later version.
! #
! #  This library is distributed in the hope that it will be useful,
! #  but WITHOUT ANY WARRANTY; without even the implied warranty of
! #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
! #  Lesser General Public License for more details.
  #
! #  You should have received a copy of the GNU Lesser General Public
! #  License along with this library; if not, write to the Free Software
! #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
  #
! #  $Id$
  #
  
--- 1,9 ----
  #
! # = bio/db/genbank/refseq.rb - RefSeq database class
  #
! # Copyright::  Copyright (C) 2000-2004 Toshiaki Katayama 
! # License::    Ruby's
  #
! # $Id$
  #
  


From k at dev.open-bio.org  Tue Sep 19 02:01:50 2006
From: k at dev.open-bio.org (Katayama Toshiaki)
Date: Tue, 19 Sep 2006 06:01:50 +0000
Subject: [BioRuby-cvs] bioruby/lib/bio/db/embl uniprot.rb, 1.3,
	1.4 swissprot.rb, 1.5, 1.6 trembl.rb, 1.5, 1.6
Message-ID: <200609190601.k8J61oDD032326@dev.open-bio.org>

Update of /home/repository/bioruby/bioruby/lib/bio/db/embl
In directory dev.open-bio.org:/tmp/cvs-serv32322/lib/bio/db/embl

Modified Files:
	uniprot.rb swissprot.rb trembl.rb 
Log Message:
* minor doc fix


Index: swissprot.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/embl/swissprot.rb,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** swissprot.rb	8 May 2006 14:23:51 -0000	1.5
--- swissprot.rb	19 Sep 2006 06:01:48 -0000	1.6
***************
*** 2,13 ****
  # = bio/db/embl/swissprot.rb - SwissProt database class
  # 
! # Copyright::   Copyright (C) 2001, 2002 KATAYAMA Toshiaki 
  # License::     Ruby's
  #
  #  $Id$
  #
  # == Description
  # 
! # Name space for SwissProt specific methods.
  #
  # SwissProt (before UniProtKB/SwissProt) specific methods are defined in 
--- 2,19 ----
  # = bio/db/embl/swissprot.rb - SwissProt database class
  # 
! # Copyright::   Copyright (C) 2001, 2002 Toshiaki Katayama 
  # License::     Ruby's
  #
  #  $Id$
  #
+ 
+ require 'bio/db/embl/sptr'
+ 
+ module Bio
+ 
  # == Description
  # 
! # Parser class for SwissProt database entry. See also Bio::SPTR class.
! # This class holds name space for SwissProt specific methods.
  #
  # SwissProt (before UniProtKB/SwissProt) specific methods are defined in 
***************
*** 29,39 ****
  #   http://au.expasy.org/sprot/userman.html
  # 
- 
- require 'bio/db/embl/sptr'
- 
- module Bio
- 
- # Parser class for SwissProt database entry.
- # See also Bio::SPTR class.
  class SwissProt < SPTR
    # Nothing to do (SwissProt format is abstracted in SPTR)
--- 35,38 ----

Index: trembl.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/embl/trembl.rb,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** trembl.rb	8 May 2006 14:24:27 -0000	1.5
--- trembl.rb	19 Sep 2006 06:01:48 -0000	1.6
***************
*** 2,13 ****
  # = bio/db/embl/trembl.rb - TrEMBL database class
  # 
! # Copyright::   Copyright (C) 2001, 2002 KATAYAMA Toshiaki 
! # License::     Ruby's
  #
! #  $Id$
  #
  # == Description
  #
! # Name space for TrEMBL specific methods.
  #
  # UniProtKB/SwissProt specific methods are defined in this class. 
--- 2,19 ----
  # = bio/db/embl/trembl.rb - TrEMBL database class
  # 
! # Copyright::  Copyright (C) 2001, 2002 Toshiaki Katayama 
! # License::    Ruby's
  #
! # $Id$
  #
+ 
+ require 'bio/db/embl/sptr'
+ 
+ module Bio
+ 
  # == Description
  #
! # Parser class for TrEMBL database entry. See also Bio::SPTR class.
! # This class holds name space for TrEMBL specific methods.
  #
  # UniProtKB/SwissProt specific methods are defined in this class. 
***************
*** 29,39 ****
  #   http://au.expasy.org/sprot/userman.html
  # 
- 
- require 'bio/db/embl/sptr'
- 
- module Bio
- 
- # Parser class for TrEMBL database entry.
- # See also Bio::SPTR class.
  class TrEMBL < SPTR
    # Nothing to do (TrEMBL format is abstracted in SPTR)
--- 35,38 ----

Index: uniprot.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/embl/uniprot.rb,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** uniprot.rb	8 May 2006 14:24:27 -0000	1.3
--- uniprot.rb	19 Sep 2006 06:01:48 -0000	1.4
***************
*** 2,13 ****
  # = bio/db/embl/uniprot.rb - UniProt database class
  # 
! # Copyright::   Copyright (C) 2005 KATAYAMA Toshiaki 
! # License::     Ruby's
  #
  #  $Id$
  #
  # == Description
  # 
! # Name space for UniProtKB/SwissProt specific methods.
  #
  # UniProtKB/SwissProt specific methods are defined in this class. 
--- 2,19 ----
  # = bio/db/embl/uniprot.rb - UniProt database class
  # 
! # Copyright::  Copyright (C) 2005 Toshiaki Katayama 
! # License::    Ruby's
  #
  #  $Id$
  #
+ 
+ require 'bio/db/embl/sptr'
+ 
+ module Bio
+ 
  # == Description
  # 
! # Parser class for SwissProt database entry.# See also Bio::SPTR class.
! # This class holds name space for UniProtKB/SwissProt specific methods.
  #
  # UniProtKB/SwissProt specific methods are defined in this class. 
***************
*** 28,39 ****
  # * The UniProtKB/SwissProt/TrEMBL User Manual
  #   http://www.expasy.org/sprot/userman.html
! 
! 
! require 'bio/db/embl/sptr'
! 
! module Bio
! 
! # Parser class for SwissProt database entry.
! # See also Bio::SPTR class.
  class UniProt < SPTR
    # Nothing to do (UniProt format is abstracted in SPTR)
--- 34,38 ----
  # * The UniProtKB/SwissProt/TrEMBL User Manual
  #   http://www.expasy.org/sprot/userman.html
! #
  class UniProt < SPTR
    # Nothing to do (UniProt format is abstracted in SPTR)


From k at dev.open-bio.org  Tue Sep 19 02:03:53 2006
From: k at dev.open-bio.org (Katayama Toshiaki)
Date: Tue, 19 Sep 2006 06:03:53 +0000
Subject: [BioRuby-cvs] bioruby/lib/bio/db prosite.rb, 0.15, 0.16 nbrf.rb, 1.8,
	1.9 medline.rb, 1.14, 1.15 litdb.rb, 0.8, 0.9 fasta.rb, 1.25, 1.26
Message-ID: <200609190603.k8J63rT3032479@dev.open-bio.org>

Update of /home/repository/bioruby/bioruby/lib/bio/db
In directory dev.open-bio.org:/tmp/cvs-serv32475/lib/bio/db

Modified Files:
	prosite.rb nbrf.rb medline.rb litdb.rb fasta.rb 
Log Message:
* minor doc fix


Index: prosite.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/prosite.rb,v
retrieving revision 0.15
retrieving revision 0.16
diff -C2 -d -r0.15 -r0.16
*** prosite.rb	25 Jul 2006 18:53:56 -0000	0.15
--- prosite.rb	19 Sep 2006 06:03:51 -0000	0.16
***************
*** 2,9 ****
  # = bio/db/prosite.rb - PROSITE database class
  #
! # Copyright::  Copyright (C) 2001 KATAYAMA Toshiaki 
  # Licence::    Ruby's
  #
! #  $Id$
  #
  
--- 2,9 ----
  # = bio/db/prosite.rb - PROSITE database class
[...978 lines suppressed...]
  
+   def re
+     self.class.pa2re(self.pa)
+   end
  
  
+   ### prosite profile to regular expression
+   #
+   # prosite/profile.txt:
+   #
+   # Returns
+   def ma2re(matrix)
+     raise NotImplementedError
    end
  
! end # PROSITE
! 
! end # Bio
  
  

Index: litdb.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/litdb.rb,v
retrieving revision 0.8
retrieving revision 0.9
diff -C2 -d -r0.8 -r0.9
*** litdb.rb	8 May 2006 14:22:12 -0000	0.8
--- litdb.rb	19 Sep 2006 06:03:51 -0000	0.9
***************
*** 2,9 ****
  # = bio/db/litdb.rb - LITDB database class
  #
! # Copyright::  Copyright (C) 2001 KATAYAMA Toshiaki 
  # License::    Ruby's
  #
! #  $Id$
  #
  
--- 2,9 ----
  # = bio/db/litdb.rb - LITDB database class
  #
! # Copyright::  Copyright (C) 2001 Toshiaki Katayama 
  # License::    Ruby's
  #
! # $Id$
  #
  

Index: fasta.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/fasta.rb,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** fasta.rb	22 Feb 2006 08:44:46 -0000	1.25
--- fasta.rb	19 Sep 2006 06:03:51 -0000	1.26
***************
*** 4,8 ****
  # Copyright::  Copyright (C) 2001, 2002
  #              GOTO Naohisa ,
! #              KATAYAMA Toshiaki 
  # Lisence::    Ruby's
  #
--- 4,8 ----
  # Copyright::  Copyright (C) 2001, 2002
  #              GOTO Naohisa ,
! #              Toshiaki Katayama 
  # Lisence::    Ruby's
  #

Index: medline.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/medline.rb,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** medline.rb	8 May 2006 14:22:41 -0000	1.14
--- medline.rb	19 Sep 2006 06:03:51 -0000	1.15
***************
*** 3,9 ****
  #
  # Copyright::  Copyright (C) 2001, 2005
! #              KATAYAMA Toshiaki 
  # License::    Ruby's
  #
  # == Description
  #
--- 3,16 ----
  #
  # Copyright::  Copyright (C) 2001, 2005
! #              Toshiaki Katayama 
  # License::    Ruby's
  #
+ # $Id$
+ #
+ 
+ require 'bio/db'
+ 
+ module Bio
+ 
  # == Description
  #
***************
*** 17,317 ****
  #   medilne.mesh
  #
! # $Id$
! #
! 
! require 'bio/db'
! 
! module Bio
! 
!   # NCBI PubMed/MEDLINE database class.
!   class MEDLINE < NCBIDB
  
!     # 
!     def initialize(entry)
!       @pubmed = Hash.new('')
  
!       tag = ''
!       entry.each_line do |line|
!         if line =~ /^\w/
!           tag = line[0,4].strip
!         end
!         @pubmed[tag] += line[6..-1] if line.length > 6
        end
      end
  
  
!     # returns a Reference object.
!     def reference
!       hash = Hash.new('')
  
!       hash['authors']	= authors
!       hash['title']	= title
!       hash['journal']	= journal
!       hash['volume']	= volume
!       hash['issue']	= issue
!       hash['pages']	= pages
!       hash['year']	= year
!       hash['pubmed']	= pmid
!       hash['medline']  	= ui
!       hash['abstract']	= abstract
!       hash['mesh']	= mesh
!       hash['affiliations'] = affiliations
  
!       hash.delete_if { |k, v| v.nil? or v.empty? }
  
!       return Reference.new(hash)
!     end
  
  
!     ### Common MEDLINE tags
  
!     # PMID - PubMed Unique Identifier
!     #   Unique number assigned to each PubMed citation.
!     def pmid
!       @pubmed['PMID'].strip
!     end
!     alias entry_id pmid
  
!     # UI   - MEDLINE Unique Identifier
!     #   Unique number assigned to each MEDLINE citation.
!     def ui
!       @pubmed['UI'].strip
!     end
  
!     # TA   - Journal Title Abbreviation
!     #   Standard journal title abbreviation.
!     def ta
!       @pubmed['TA'].gsub(/\s+/, ' ').strip
!     end
!     alias journal ta
  
!     # VI   - Volume
!     #   Journal volume.
!     def vi
!       @pubmed['VI'].strip
!     end
!     alias volume vi
  
!     # IP   - Issue
!     #   The number of the issue, part, or supplement of the journal in which
!     #   the article was published.
!     def ip
!       @pubmed['IP'].strip
!     end
!     alias issue ip
  
!     # PG   - Page Number
!     #   The full pagination of the article.
!     def pg
!       @pubmed['PG'].strip
!     end
  
!     def pages
!       pages = pg
!       if pages =~ /-/
!         from, to = pages.split('-')
!         if (len = from.length - to.length) > 0
!           to = from[0,len] + to
!         end
!         pages = "#{from}-#{to}"
        end
!       return pages
      end
  
!     # DP   - Publication Date
!     #   The date the article was published.
!     def dp
!       @pubmed['DP'].strip
!     end
!     alias date dp
  
!     def year
!       dp[0,4]
!     end
  
!     # TI   - Title Words
!     #   The title of the article.
!     def ti
!       @pubmed['TI'].gsub(/\s+/, ' ').strip
!     end
!     alias title ti
  
!     # AB   - Abstract
!     #   Abstract.
!     def ab
!       @pubmed['AB'].gsub(/\s+/, ' ').strip
!     end
!     alias abstract ab
  
!     # AU   - Author Name
!     #   Authors' names.
!     def au
!       @pubmed['AU'].strip
!     end
  
!     def authors
!       authors = []
!       au.split(/\n/).each do |author|
!         if author =~ / /
!           name = author.split(/\s+/)
!           suffix = name[-2] =~ /^[A-Z]+$/ ? name.pop : nil	# Jr etc.
!           initial = name.pop.split(//).join('. ')
!           author = "#{name.join(' ')}, #{initial}."
!         end
!         if suffix
!           author << " " + suffix
!         end
!         authors.push(author)
        end
!       return authors
      end
  
!     # SO   - Source
!     #   Composite field containing bibliographic information.
!     def so
!       @pubmed['SO'].strip
!     end
!     alias source so
  
!     # MH   - MeSH Terms
!     #   NLM's controlled vocabulary.
!     def mh
!       @pubmed['MH'].strip.split(/\n/)
!     end
!     alias mesh mh
  
!     # AD   - Affiliation
!     #   Institutional affiliation and address of the first author, and grant
!     #   numbers.
!     def ad
!       @pubmed['AD'].strip.split(/\n/)
!     end
!     alias affiliations ad
  
  
!     ### Other MEDLINE tags
  
!     # AID  - Article Identifier
!     #   Article ID values may include the pii (controlled publisher identifier)
!     #   or doi (Digital Object Identifier).
  
!     # CI   - Copyright Information
!     #   Copyright statement.
  
!     # CIN  - Comment In
!     #   Reference containing a comment about the article.
  
!     # CN   - Collective Name
!     #   Corporate author or group names with authorship responsibility.
  
!     # CON  - Comment On
!     #   Reference upon which the article comments.
  
!     # CY   - Country
!     #   The place of publication of the journal.
  
!     # DA   - Date Created
!     #   Used for internal processing at NLM.
  
!     # DCOM - Date Completed
!     #   Used for internal processing at NLM.
  
!     # DEP  - Date of Electronic Publication
!     #   Electronic publication date.
  
!     # EDAT - Entrez Date
!     #   The date the citation was added to PubMed.
  
!     # EIN  - Erratum In
!     #   Reference containing a published erratum to the article.
  
!     # GS   - Gene Symbol
!     #   Abbreviated gene names (used 1991 through 1996).
  
!     # ID   - Identification Number 
!     #   Research grant numbers, contract numbers, or both that designate
!     #   financial support by any agency of the US PHS (Public Health Service).
  
!     # IS   - ISSN
!     #   International Standard Serial Number of the journal.
  
!     # JC   - Journal Title Code
!     #   MEDLINE unique three-character code for the journal.
  
!     # JID  - NLM Unique ID
!     #   Unique journal ID in NLM's catalog of books, journals, and audiovisuals.
  
!     # LA   - Language
!     #   The language in which the article was published.
  
!     # LR   - Last Revision Date
!     #   The date a change was made to the record during a maintenance procedure.
  
!     # MHDA - MeSH Date
!     #   The date MeSH terms were added to the citation. The MeSH date is the
!     #   same as the Entrez date until MeSH are added.
  
!     # PHST - Publication History Status Date
!     #   History status date.
  
!     # PS   - Personal Name as Subject
!     #   Individual is the subject of the article.
  
!     # PST  - Publication Status
!     #   Publication status.
  
!     # PT   - Publication Type
!     #   The type of material the article represents.
!     def pt
!       @pubmed['PT'].strip.split(/\n/)   
!     end
!     alias publication_type pt
  
!     # RF   - Number of References
!     #   Number of bibliographic references for Review articles.
  
!     # RIN  - Retraction In
!     #   Retraction of the article
  
!     # RN   - EC/RN Number
!     #   Number assigned by the Enzyme Commission to designate a particular
!     #   enzyme or by the Chemical Abstracts Service for Registry Numbers.
  
!     # ROF  - Retraction Of
!     #   Article being retracted.
  
!     # RPF  - Republished From
!     #   Original article.
  
!     # SB   - Journal Subset
!     #   Code for a specific set of journals.
  
!     # SI   - Secondary Source Identifier
!     #   Identifies a secondary source that supplies information, e.g., other
!     #   data sources, databanks and accession numbers of molecular sequences
!     #   discussed in articles.
  
!     # TT   - Transliterated / Vernacular Title 
!     #   Non-Roman alphabet language titles are transliterated.
  
!     # UIN  - Update In
!     #   Update to the article.
  
!     # UOF  - Update Of
!     #   The article being updated.
  
!     # URLF - URL Full-Text
!     #   Link to the full-text of article at provider's website. Links are
!     #   incomplete. Use PmLink for the complete set of available links.
!     #   [PmLink] http://www.ncbi.nlm.nih.gov/entrez/utils/pmlink_help.html
  
!     # URLS - URL Summary
!     #   Link to the article summary at provider's website. Links are
!     #   incomplete. Use PmLink for the complete set of available links.
!     #   [PmLink] http://www.ncbi.nlm.nih.gov/entrez/utils/pmlink_help.html
  
!   end
  
! end
  
  
--- 24,316 ----
  #   medilne.mesh
  #
! class MEDLINE < NCBIDB
  
!   # 
!   def initialize(entry)
!     @pubmed = Hash.new('')
  
!     tag = ''
!     entry.each_line do |line|
!       if line =~ /^\w/
!         tag = line[0,4].strip
        end
+       @pubmed[tag] += line[6..-1] if line.length > 6
      end
+   end
  
  
!   # returns a Reference object.
!   def reference
!     hash = Hash.new('')
  
!     hash['authors']	= authors
!     hash['title']	= title
!     hash['journal']	= journal
!     hash['volume']	= volume
!     hash['issue']	= issue
!     hash['pages']	= pages
!     hash['year']	= year
!     hash['pubmed']	= pmid
!     hash['medline']  	= ui
!     hash['abstract']	= abstract
!     hash['mesh']	= mesh
!     hash['affiliations'] = affiliations
  
!     hash.delete_if { |k, v| v.nil? or v.empty? }
  
!     return Reference.new(hash)
!   end
  
  
!   ### Common MEDLINE tags
  
!   # PMID - PubMed Unique Identifier
!   #   Unique number assigned to each PubMed citation.
!   def pmid
!     @pubmed['PMID'].strip
!   end
!   alias entry_id pmid
  
!   # UI   - MEDLINE Unique Identifier
!   #   Unique number assigned to each MEDLINE citation.
!   def ui
!     @pubmed['UI'].strip
!   end
  
!   # TA   - Journal Title Abbreviation
!   #   Standard journal title abbreviation.
!   def ta
!     @pubmed['TA'].gsub(/\s+/, ' ').strip
!   end
!   alias journal ta
  
!   # VI   - Volume
!   #   Journal volume.
!   def vi
!     @pubmed['VI'].strip
!   end
!   alias volume vi
  
!   # IP   - Issue
!   #   The number of the issue, part, or supplement of the journal in which
!   #   the article was published.
!   def ip
!     @pubmed['IP'].strip
!   end
!   alias issue ip
  
!   # PG   - Page Number
!   #   The full pagination of the article.
!   def pg
!     @pubmed['PG'].strip
!   end
  
!   def pages
!     pages = pg
!     if pages =~ /-/
!       from, to = pages.split('-')
!       if (len = from.length - to.length) > 0
!         to = from[0,len] + to
        end
!       pages = "#{from}-#{to}"
      end
+     return pages
+   end
  
!   # DP   - Publication Date
!   #   The date the article was published.
!   def dp
!     @pubmed['DP'].strip
!   end
!   alias date dp
  
!   def year
!     dp[0,4]
!   end
  
!   # TI   - Title Words
!   #   The title of the article.
!   def ti
!     @pubmed['TI'].gsub(/\s+/, ' ').strip
!   end
!   alias title ti
  
!   # AB   - Abstract
!   #   Abstract.
!   def ab
!     @pubmed['AB'].gsub(/\s+/, ' ').strip
!   end
!   alias abstract ab
  
!   # AU   - Author Name
!   #   Authors' names.
!   def au
!     @pubmed['AU'].strip
!   end
  
!   def authors
!     authors = []
!     au.split(/\n/).each do |author|
!       if author =~ / /
!         name = author.split(/\s+/)
!         suffix = name[-2] =~ /^[A-Z]+$/ ? name.pop : nil	# Jr etc.
!         initial = name.pop.split(//).join('. ')
!         author = "#{name.join(' ')}, #{initial}."
        end
!       if suffix
!         author << " " + suffix
!       end
!       authors.push(author)
      end
+     return authors
+   end
  
!   # SO   - Source
!   #   Composite field containing bibliographic information.
!   def so
!     @pubmed['SO'].strip
!   end
!   alias source so
  
!   # MH   - MeSH Terms
!   #   NLM's controlled vocabulary.
!   def mh
!     @pubmed['MH'].strip.split(/\n/)
!   end
!   alias mesh mh
  
!   # AD   - Affiliation
!   #   Institutional affiliation and address of the first author, and grant
!   #   numbers.
!   def ad
!     @pubmed['AD'].strip.split(/\n/)
!   end
!   alias affiliations ad
  
  
!   ### Other MEDLINE tags
  
!   # AID  - Article Identifier
!   #   Article ID values may include the pii (controlled publisher identifier)
!   #   or doi (Digital Object Identifier).
  
!   # CI   - Copyright Information
!   #   Copyright statement.
  
!   # CIN  - Comment In
!   #   Reference containing a comment about the article.
  
!   # CN   - Collective Name
!   #   Corporate author or group names with authorship responsibility.
  
!   # CON  - Comment On
!   #   Reference upon which the article comments.
  
!   # CY   - Country
!   #   The place of publication of the journal.
  
!   # DA   - Date Created
!   #   Used for internal processing at NLM.
  
!   # DCOM - Date Completed
!   #   Used for internal processing at NLM.
  
!   # DEP  - Date of Electronic Publication
!   #   Electronic publication date.
  
!   # EDAT - Entrez Date
!   #   The date the citation was added to PubMed.
  
!   # EIN  - Erratum In
!   #   Reference containing a published erratum to the article.
  
!   # GS   - Gene Symbol
!   #   Abbreviated gene names (used 1991 through 1996).
  
!   # ID   - Identification Number 
!   #   Research grant numbers, contract numbers, or both that designate
!   #   financial support by any agency of the US PHS (Public Health Service).
  
!   # IS   - ISSN
!   #   International Standard Serial Number of the journal.
  
!   # JC   - Journal Title Code
!   #   MEDLINE unique three-character code for the journal.
  
!   # JID  - NLM Unique ID
!   #   Unique journal ID in NLM's catalog of books, journals, and audiovisuals.
  
!   # LA   - Language
!   #   The language in which the article was published.
  
!   # LR   - Last Revision Date
!   #   The date a change was made to the record during a maintenance procedure.
  
!   # MHDA - MeSH Date
!   #   The date MeSH terms were added to the citation. The MeSH date is the
!   #   same as the Entrez date until MeSH are added.
  
!   # PHST - Publication History Status Date
!   #   History status date.
  
!   # PS   - Personal Name as Subject
!   #   Individual is the subject of the article.
  
!   # PST  - Publication Status
!   #   Publication status.
  
!   # PT   - Publication Type
!   #   The type of material the article represents.
!   def pt
!     @pubmed['PT'].strip.split(/\n/)   
!   end
!   alias publication_type pt
  
!   # RF   - Number of References
!   #   Number of bibliographic references for Review articles.
  
!   # RIN  - Retraction In
!   #   Retraction of the article
  
!   # RN   - EC/RN Number
!   #   Number assigned by the Enzyme Commission to designate a particular
!   #   enzyme or by the Chemical Abstracts Service for Registry Numbers.
  
!   # ROF  - Retraction Of
!   #   Article being retracted.
  
!   # RPF  - Republished From
!   #   Original article.
  
!   # SB   - Journal Subset
!   #   Code for a specific set of journals.
  
!   # SI   - Secondary Source Identifier
!   #   Identifies a secondary source that supplies information, e.g., other
!   #   data sources, databanks and accession numbers of molecular sequences
!   #   discussed in articles.
  
!   # TT   - Transliterated / Vernacular Title 
!   #   Non-Roman alphabet language titles are transliterated.
  
!   # UIN  - Update In
!   #   Update to the article.
  
!   # UOF  - Update Of
!   #   The article being updated.
  
!   # URLF - URL Full-Text
!   #   Link to the full-text of article at provider's website. Links are
!   #   incomplete. Use PmLink for the complete set of available links.
!   #   [PmLink] http://www.ncbi.nlm.nih.gov/entrez/utils/pmlink_help.html
  
!   # URLS - URL Summary
!   #   Link to the article summary at provider's website. Links are
!   #   incomplete. Use PmLink for the complete set of available links.
!   #   [PmLink] http://www.ncbi.nlm.nih.gov/entrez/utils/pmlink_help.html
  
! end # MEDLINE
  
! end # Bio
  
  

Index: nbrf.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/nbrf.rb,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** nbrf.rb	22 Feb 2006 08:43:15 -0000	1.8
--- nbrf.rb	19 Sep 2006 06:03:51 -0000	1.9
***************
*** 3,7 ****
  #
  # Copyright:: Copyright (C) 2001-2003,2006 Naohisa Goto 
! #             Copyright (C) 2001-2002 KATAYAMA Toshiaki 
  # License::   Ruby's
  #
--- 3,7 ----
  #
  # Copyright:: Copyright (C) 2001-2003,2006 Naohisa Goto 
! #             Copyright (C) 2001-2002 Toshiaki Katayama 
  # License::   Ruby's
  #


From k at dev.open-bio.org  Tue Sep 19 02:08:28 2006
From: k at dev.open-bio.org (Katayama Toshiaki)
Date: Tue, 19 Sep 2006 06:08:28 +0000
Subject: [BioRuby-cvs] bioruby/lib/bio/appl/blast format8.rb,1.5,1.6
Message-ID: <200609190608.k8J68S7d032598@dev.open-bio.org>

Update of /home/repository/bioruby/bioruby/lib/bio/appl/blast
In directory dev.open-bio.org:/tmp/cvs-serv32594/lib/bio/appl/blast

Modified Files:
	format8.rb 
Log Message:
* license is changed from LGPL to Ruby's


Index: format8.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/appl/blast/format8.rb,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** format8.rb	8 Sep 2005 01:22:08 -0000	1.5
--- format8.rb	19 Sep 2006 06:08:26 -0000	1.6
***************
*** 1,22 ****
  #
! # bio/appl/blast/format8.rb - BLAST tab-delimited output (-m 8) parser
  # 
! #   Copyright (C) 2002,2003 KATAYAMA Toshiaki 
! #
! #  This library is free software; you can redistribute it and/or
! #  modify it under the terms of the GNU Lesser General Public
! #  License as published by the Free Software Foundation; either
! #  version 2 of the License, or (at your option) any later version.
  #
! #  This library is distributed in the hope that it will be useful,
! #  but WITHOUT ANY WARRANTY; without even the implied warranty of
! #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
! #  Lesser General Public License for more details.
  #
! #  You should have received a copy of the GNU Lesser General Public
! #  License along with this library; if not, write to the Free Software
! #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
  #
! #  $Id$
  #
  
--- 1,13 ----
  #
! # = bio/appl/blast/format8.rb - BLAST tab-delimited output (-m 8) parser
  # 
! # Copyright::  Copyright (C) 2002, 2003 Toshiaki Katayama 
! # License::    Ruby's
  #
! # $Id$
  #
! # == Note
  #
! # This file is automatically loaded by bio/appl/blast/report.rb
  #
  
***************
*** 89,95 ****
  
  
- =begin
- 
- This file is automatically loaded by bio/appl/blast/report.rb
- 
- =end
--- 80,81 ----


From k at dev.open-bio.org  Tue Sep 19 02:09:22 2006
From: k at dev.open-bio.org (Katayama Toshiaki)
Date: Tue, 19 Sep 2006 06:09:22 +0000
Subject: [BioRuby-cvs] bioruby/lib/bio/appl/blast report.rb,1.9,1.10
Message-ID: <200609190609.k8J69MFb032641@dev.open-bio.org>

Update of /home/repository/bioruby/bioruby/lib/bio/appl/blast
In directory dev.open-bio.org:/tmp/cvs-serv32637/lib/bio/appl/blast

Modified Files:
	report.rb 
Log Message:
* license is changed from LGPL to Ruby's
* document is changed to RDoc


Index: report.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/appl/blast/report.rb,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** report.rb	26 Sep 2005 13:00:04 -0000	1.9
--- report.rb	19 Sep 2006 06:09:20 -0000	1.10
***************
*** 1,22 ****
  #
! # bio/appl/blast/report.rb - BLAST Report class
  # 
! #   Copyright (C) 2003 KATAYAMA Toshiaki 
! #
! #  This library is free software; you can redistribute it and/or
! #  modify it under the terms of the GNU Lesser General Public
! #  License as published by the Free Software Foundation; either
! #  version 2 of the License, or (at your option) any later version.
! #
! #  This library is distributed in the hope that it will be useful,
! #  but WITHOUT ANY WARRANTY; without even the implied warranty of
! #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
! #  Lesser General Public License for more details.
! #
! #  You should have received a copy of the GNU Lesser General Public
! #  License along with this library; if not, write to the Free Software
! #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
  #
! #  $Id$
  #
  
--- 1,9 ----
  #
! # = bio/appl/blast/report.rb - BLAST Report class
  # 
! # Copyright::  Copyright (C) 2003 Toshiaki Katayama 
! # License::    Ruby's
  #
! # $Id$
  #
  
***************
*** 27,206 ****
  
  module Bio
!   class Blast
! 
!     class Report
  
!       # for Bio::FlatFile support (only for XML data)
!       DELIMITER = RS = "\n"
  
!       def self.xmlparser(data)
!         self.new(data, :xmlparser)
!       end
!       def self.rexml(data)
!         self.new(data, :rexml)
!       end
!       def self.tab(data)
!         self.new(data, :tab)
!       end
  
!       def auto_parse(data)
!         if /
!       def each_iteration
!         @iterations.each do |x|
!           yield x
!         end
        end
  
!       #  shortcut for the last iteration's hits
!       def each_hit
!         @iterations.last.each do |x|
!           yield x
!         end
!       end
!       alias each each_hit
  
!       # shortcut for the last iteration's hits
!       def hits
!         @iterations.last.hits
!       end
  
!       # shortcut for the last iteration's statistics
!       def statistics
!         @iterations.last.statistics
!       end
!       def db_num;	statistics['db-num'];			end
!       def db_len;	statistics['db-len'];			end
!       def hsp_len;	statistics['hsp-len'];			end
!       def eff_space;	statistics['eff-space'];		end
!       def kappa;	statistics['kappa'];			end
!       def lambda;	statistics['lambda'];			end
!       def entropy;	statistics['entropy'];			end
  
!       # shortcut for the last iteration's message (for checking 'CONVERGED')
!       def message
!         @iterations.last.message
!       end
  
  
!       # Bio::Blast::Report::Iteration
!       class Iteration
!         def initialize
!           @message = nil
!           @statistics = {}
!           @num = 1
!           @hits = []
!         end
!         attr_reader :hits, :statistics
!         attr_accessor :num, :message
  
!         def each
!           @hits.each do |x|
!             yield x
!           end
!         end
!       end
  
  
!       # Bio::Blast::Report::Hit
!       class Hit
!         def initialize
!           @hsps = []
!         end
!         attr_reader :hsps
!         attr_accessor :query_id, :query_def, :query_len,
!           :num, :hit_id, :len, :definition, :accession
  
!         def each
!           @hsps.each do |x|
!             yield x
!           end
!         end
  
!         # Compatible with Bio::Fasta::Report::Hit
  
-         alias target_id accession
-         alias target_def definition
-         alias target_len len
  
!         # Shortcut methods for the best Hsp
  
!         def evalue;		@hsps.first.evalue;		end
!         def bit_score;		@hsps.first.bit_score;		end
!         def identity;		@hsps.first.identity;		end
!         def percent_identity;	@hsps.first.percent_identity;	end
!         def overlap;		@hsps.first.align_len;		end
  
!         def query_seq;		@hsps.first.qseq;		end
!         def target_seq;		@hsps.first.hseq;		end
!         def midline;		@hsps.first.midline;		end
  
!         def query_start;	@hsps.first.query_from;		end
!         def query_end;		@hsps.first.query_to;		end
!         def target_start;	@hsps.first.hit_from;		end
!         def target_end;		@hsps.first.hit_to;		end
!         def lap_at
!           [ query_start, query_end, target_start, target_end ]
!         end
        end
  
  
!       # Bio::Blast::Report::Hsp
!       class Hsp
!         def initialize
!           @hsp = {}
!         end
!         attr_reader :hsp
!         attr_accessor :num, :bit_score, :score, :evalue,
!           :query_from, :query_to, :hit_from, :hit_to,
!           :pattern_from, :pattern_to, :query_frame, :hit_frame,
!           :identity, :positive, :gaps, :align_len, :density,
!           :qseq, :hseq, :midline,
!           :percent_identity, :mismatch_count	 # only for '-m 8'
        end
  
      end
    end
! end
  
  
--- 14,331 ----
  
  module Bio
! class Blast
  
! # = Bio::Blast::Report
! # 
! # Parsed results of the blast execution for Tab-delimited and XML output
! # format.  Tab-delimited reports are consists of
! # 
! #   Query id,
! #   Subject id,
! #   percent of identity,
! #   alignment length,
! #   number of mismatches (not including gaps),
! #   number of gap openings,
! #   start of alignment in query,
! #   end of alignment in query,
! #   start of alignment in subject,
! #   end of alignment in subject,
! #   expected value,
! #   bit score.
! # 
! # according to the MEGABLAST document (README.mbl).  As for XML output,
! # see the following DTDs.
! # 
! #   * http://www.ncbi.nlm.nih.gov/dtd/NCBI_BlastOutput.dtd
! #   * http://www.ncbi.nlm.nih.gov/dtd/NCBI_BlastOutput.mod
! #   * http://www.ncbi.nlm.nih.gov/dtd/NCBI_Entity.mod
! # 
! class Report
  
!   # for Bio::FlatFile support (only for XML data)
!   DELIMITER = RS = "\n"
  
!   # Specify to use XMLParser to parse XML (-m 7) output.
!   def self.xmlparser(data)
!     self.new(data, :xmlparser)
!   end
  
!   # Specify to use REXML to parse XML (-m 7) output.
!   def self.rexml(data)
!     self.new(data, :rexml)
!   end
  
!   # Specify to use tab delimited output parser.
!   def self.tab(data)
!     self.new(data, :tab)
!   end
  
!   def auto_parse(data)
!     if /

Update of /home/repository/bioruby/bioruby/lib/bio/appl/blast
In directory dev.open-bio.org:/tmp/cvs-serv32680/lib/bio/appl/blast

Modified Files:
	rexml.rb 
Log Message:
* license is changed from LGPL to Ruby's


Index: rexml.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/appl/blast/rexml.rb,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** rexml.rb	8 Sep 2005 01:22:08 -0000	1.10
--- rexml.rb	19 Sep 2006 06:10:19 -0000	1.11
***************
*** 1,23 ****
  #
! # bio/appl/blast/rexml.rb - BLAST XML output (-m 7) parser by REXML
  # 
! #   Copyright (C) 2002,2003 KATAYAMA Toshiaki 
! #
! #  This library is free software; you can redistribute it and/or
! #  modify it under the terms of the GNU Lesser General Public
! #  License as published by the Free Software Foundation; either
! #  version 2 of the License, or (at your option) any later version.
! #
! #  This library is distributed in the hope that it will be useful,
! #  but WITHOUT ANY WARRANTY; without even the implied warranty of
! #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
! #  Lesser General Public License for more details.
! #
! #  You should have received a copy of the GNU Lesser General Public
! #  License along with this library; if not, write to the Free Software
! #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
  #
! #  $Id$
  #
  
  begin
--- 1,14 ----
  #
! # = bio/appl/blast/rexml.rb - BLAST XML output (-m 7) parser by REXML
  # 
! # Copyright::  Copyright (C) 2002, 2003 Toshiaki Katayama 
! # License::    Ruby's
  #
! # $Id$
  #
+ # == Note
+ # 
+ # This file is automatically loaded by bio/appl/blast/report.rb
+ # 
  
  begin
***************
*** 145,151 ****
  
  
- =begin
- 
- This file is automatically loaded by bio/appl/blast/report.rb
- 
- =end
--- 136,137 ----


From k at dev.open-bio.org  Tue Sep 19 02:12:39 2006
From: k at dev.open-bio.org (Katayama Toshiaki)
Date: Tue, 19 Sep 2006 06:12:39 +0000
Subject: [BioRuby-cvs] bioruby/lib/bio/appl/blast xmlparser.rb, 1.14,
	1.15 wublast.rb, 1.7, 1.8 format0.rb, 1.18, 1.19
Message-ID: <200609190612.k8J6CdnS032763@dev.open-bio.org>

Update of /home/repository/bioruby/bioruby/lib/bio/appl/blast
In directory dev.open-bio.org:/tmp/cvs-serv32759/lib/bio/appl/blast

Modified Files:
	xmlparser.rb wublast.rb format0.rb 
Log Message:
* minor doc fix


Index: xmlparser.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/appl/blast/xmlparser.rb,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** xmlparser.rb	30 Apr 2006 07:11:28 -0000	1.14
--- xmlparser.rb	19 Sep 2006 06:12:37 -0000	1.15
***************
*** 2,10 ****
  # = bio/appl/blast/xmlparser.rb - BLAST XML output (-m 7) parser by XMLParser
  # 
! # Copyright::    Copyright (C) 2001 
! #                Mitsuteru C. Nakao 
! # Copyright::    Copyright (C) 2003 
! #                KATAYAMA Toshiaki 
! # Lisence::      Ruby's
  #
  # $Id$
--- 2,10 ----
  # = bio/appl/blast/xmlparser.rb - BLAST XML output (-m 7) parser by XMLParser
  # 
! # Copyright::  Copyright (C) 2001 
! #              Mitsuteru C. Nakao 
! # Copyright::  Copyright (C) 2003 
! #              Toshiaki Katayama 
! # Lisence::    Ruby's
  #
  # $Id$
***************
*** 19,32 ****
  # (format 7) based on the XMLParser and the REXML.
  #
- # == Examples
- #
- # == References
- #
- # * Blast
- #   http://
- #
- # * XMLParser
- #   http://
- #
  
  begin
--- 19,22 ----

Index: wublast.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/appl/blast/wublast.rb,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** wublast.rb	30 Apr 2006 05:47:25 -0000	1.7
--- wublast.rb	19 Sep 2006 06:12:37 -0000	1.8
***************
*** 2,18 ****
  # = bio/appl/blast/wublast.rb - WU-BLAST default output parser
  # 
! # Copyright:: Copyright (C) 2003 GOTO Naohisa 
! # License:: Ruby's
  #
! #  $Id$
  #
! #  WU-BLAST default output parser.
  #
! #  The parser is still incomplete and may contain many bugs,
! #  because I didn't have WU-BLAST license.
! #  It was tested under web-based WU-BLAST results and
! #  obsolete version downloaded from http://blast.wustl.edu/ .
  #
- # = References
  # * http://blast.wustl.edu/
  # * http://www.ebi.ac.uk/blast2/
--- 2,21 ----
  # = bio/appl/blast/wublast.rb - WU-BLAST default output parser
  # 
! # Copyright::  Copyright (C) 2003 GOTO Naohisa 
! # License::    Ruby's
  #
! # $Id$
  #
! # == Description
  #
! # WU-BLAST default output parser.
! #
! # The parser is still incomplete and may contain many bugs,
! # because I didn't have WU-BLAST license.
! # It was tested under web-based WU-BLAST results and
! # obsolete version downloaded from http://blast.wustl.edu/ .
! #
! # == References
  #
  # * http://blast.wustl.edu/
  # * http://www.ebi.ac.uk/blast2/

Index: format0.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/appl/blast/format0.rb,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** format0.rb	30 Apr 2006 05:47:59 -0000	1.18
--- format0.rb	19 Sep 2006 06:12:37 -0000	1.19
***************
*** 2,10 ****
  # = bio/appl/blast/format0.rb - BLAST default output (-m 0) parser
  # 
! # Author:: Naohisa GOTO
! # Copyright:: Copyright (C) 2003-2006 GOTO Naohisa 
! # License:: Ruby's
  #
! #  $Id$
  #
  # NCBI BLAST default (-m 0 option) output parser.
--- 2,11 ----
  # = bio/appl/blast/format0.rb - BLAST default output (-m 0) parser
  # 
! # Copyright::  Copyright (C) 2003-2006 GOTO Naohisa 
! # License::    Ruby's
  #
! # $Id$
! #
! # == Description
  #
  # NCBI BLAST default (-m 0 option) output parser.


From k at dev.open-bio.org  Tue Sep 19 02:13:56 2006
From: k at dev.open-bio.org (Katayama Toshiaki)
Date: Tue, 19 Sep 2006 06:13:56 +0000
Subject: [BioRuby-cvs] bioruby/lib/bio location.rb,0.25,0.26
Message-ID: <200609190613.k8J6DumA000360@dev.open-bio.org>

Update of /home/repository/bioruby/bioruby/lib/bio
In directory dev.open-bio.org:/tmp/cvs-serv356/lib/bio

Modified Files:
	location.rb 
Log Message:
* license is changed from LGPL to Ruby's
* minor doc fix


Index: location.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/location.rb,v
retrieving revision 0.25
retrieving revision 0.26
diff -C2 -d -r0.25 -r0.26
*** location.rb	4 May 2006 18:40:26 -0000	0.25
--- location.rb	19 Sep 2006 06:13:54 -0000	0.26
***************
*** 2,39 ****
  # = bio/location.rb - Locations/Location class (GenBank location format)
  #
! # Copyright::	Copyright (C) 2001, 2005 KATAYAMA Toshiaki 
  #                             2006 Jan Aerts 
! # License::	LGPL
  #
  # $Id$
  #
- # 
- #--
- #
- #  This library is free software; you can redistribute it and/or
- #  modify it under the terms of the GNU Lesser General Public
- #  License as published by the Free Software Foundation; either
- #  version 2 of the License, or (at your option) any later version.
- #
- #  This library is distributed in the hope that it will be useful,
- #  but WITHOUT ANY WARRANTY; without even the implied warranty of
- #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- #  Lesser General Public License for more details.
- #
- #  You should have received a copy of the GNU Lesser General Public
- #  License along with this library; if not, write to the Free Software
- #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- #
- #++
- #
  
  module Bio
  
! # = DESCRIPTION
  # The Bio::Location class describes the position of a genomic locus. Typically,
  # Bio::Location objects are created automatically when the user creates a
  # Bio::Locations object, instead of initialized directly.
  #
! # = USAGE
  #   location = Bio::Location.new('500..550')
  #   puts "start=" + location.from.to_s + ";end=" + location.to.to_s
--- 2,22 ----
  # = bio/location.rb - Locations/Location class (GenBank location format)
  #
! # Copyright::	Copyright (C) 2001, 2005 Toshiaki Katayama 
  #                             2006 Jan Aerts 
! # License::	Ruby's
  #
  # $Id$
  #
  
  module Bio
  
! # == Description
! #
  # The Bio::Location class describes the position of a genomic locus. Typically,
  # Bio::Location objects are created automatically when the user creates a
  # Bio::Locations object, instead of initialized directly.
  #
! # == Usage
! #
  #   location = Bio::Location.new('500..550')
  #   puts "start=" + location.from.to_s + ";end=" + location.to.to_s
***************
*** 44,47 ****
--- 27,31 ----
  #     puts "start=" + location.from.to_s + ";end=" + location.to.to_s
  #   end
+ #
  class Location
    include Comparable
***************
*** 165,174 ****
  end # class location
  
! # = DESCRIPTION
! # The Bio::Locations class is a container for Bio::Location objects: creating a 
! # Bio::Locations object (based on a GenBank style position string) will
! # spawn an array of Bio::Location objects.
  #
- # = USAGE
  #   locations = Bio::Locations.new('join(complement(500..550), 600..625)')
  #   locations.each do |location|
--- 149,160 ----
  end # class location
  
! # == Description
! #
! # The Bio::Locations class is a container for Bio::Location objects:
! # creating a Bio::Locations object (based on a GenBank style position string)
! # will spawn an array of Bio::Location objects.
! #
! # == Usage
  #
  #   locations = Bio::Locations.new('join(complement(500..550), 600..625)')
  #   locations.each do |location|
***************
*** 192,201 ****
  #  end
  #
! # = GENBANK LOCATION DESCRIPTOR CLASSIFICATION
  # 
  # === Definition of the position notation of the GenBank location format
  # 
! # According to the GenBank manual 'gbrel.txt', position notations were classified
! # into 10 patterns - (A) to (J).
  # 
  #       3.4.12.2 Feature Location
--- 178,187 ----
  #  end
  #
! # == GenBank location descriptor classification
  # 
  # === Definition of the position notation of the GenBank location format
  # 
! # According to the GenBank manual 'gbrel.txt', position notations were
! # classified into 10 patterns - (A) to (J).
  # 
  #       3.4.12.2 Feature Location
***************
*** 409,412 ****
--- 395,399 ----
  # * [ADR40FIB]	replace(510..520,	<= replace(510..520, "taatcctaccg")
  # * [RATDYIIAAB]	replace(1306..1443,"aagaacatccacggagtcagaactgggctcttcacgccggatttggcgttcgaggccattgtgaaaaagcaggcaatgcaccagcaagctcagttcctacccctgcgtggacctggttatccaggagctaatcagtacagttaggtggtcaagctgaaagagccctgtctgaaa")
+ #
  class Locations
    include Enumerable
***************
*** 486,491 ****
    # 
    # This method can for example be used to relate positions in a DNA-sequence
!   # with those in RNA. In this use, the optional ':aa'-flag returns the position
!   # of the associated amino-acid rather than the nucleotide.
    #   loc = Bio::Locations.new('complement(12838..13533)')
    #   puts loc.relative(13524)        # => 10
--- 473,479 ----
    # 
    # This method can for example be used to relate positions in a DNA-sequence
!   # with those in RNA. In this use, the optional ':aa'-flag returns the
!   # position of the associated amino-acid rather than the nucleotide.
!   #
    #   loc = Bio::Locations.new('complement(12838..13533)')
    #   puts loc.relative(13524)        # => 10
***************
*** 515,520 ****
    # 
    # This method can for example be used to relate positions in a DNA-sequence
!   # with those in RNA. In this use, the optional ':aa'-flag returns the position
!   # of the associated amino-acid rather than the nucleotide.
    #   loc = Bio::Locations.new('complement(12838..13533)')
    #   puts loc.absolute(10)          # => 13524
--- 503,509 ----
    # 
    # This method can for example be used to relate positions in a DNA-sequence
!   # with those in RNA. In this use, the optional ':aa'-flag returns the
!   # position of the associated amino-acid rather than the nucleotide.
!   #
    #   loc = Bio::Locations.new('complement(12838..13533)')
    #   puts loc.absolute(10)          # => 13524
***************
*** 613,617 ****
        end
  
!     when /^complement\((.*)\)$/			# (J) complement()
        position =       $1
        gbl_pos2loc(position).reverse_each do |location|
--- 602,606 ----
        end
  
!     when /^complement\((.*)\)$/				# (J) complement()
        position =       $1
        gbl_pos2loc(position).reverse_each do |location|
***************
*** 678,682 ****
        end
      end
!     return nil				# out of range
    end
  
--- 667,671 ----
        end
      end
!     return nil					# out of range
    end
  


From k at dev.open-bio.org  Tue Sep 19 02:14:20 2006
From: k at dev.open-bio.org (Katayama Toshiaki)
Date: Tue, 19 Sep 2006 06:14:20 +0000
Subject: [BioRuby-cvs] bioruby/lib/bio db.rb,0.34,0.35
Message-ID: <200609190614.k8J6EKwu000403@dev.open-bio.org>

Update of /home/repository/bioruby/bioruby/lib/bio
In directory dev.open-bio.org:/tmp/cvs-serv399/lib/bio

Modified Files:
	db.rb 
Log Message:
* minor doc fix


Index: db.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db.rb,v
retrieving revision 0.34
retrieving revision 0.35
diff -C2 -d -r0.34 -r0.35
*** db.rb	27 Feb 2006 09:13:08 -0000	0.34
--- db.rb	19 Sep 2006 06:14:18 -0000	0.35
***************
*** 2,8 ****
  # = bio/db.rb - common API for database parsers
  #
! # Copyright::	Copyright (C) 2001, 2002, 2005
! #		KATAYAMA Toshiaki 
! # License::	Ruby's
  #
  # $Id$
--- 2,8 ----
  # = bio/db.rb - common API for database parsers
  #
! # Copyright::  Copyright (C) 2001, 2002, 2005
! #              Toshiaki Katayama 
! # License::    Ruby's
  #
  # $Id$


From k at dev.open-bio.org  Tue Sep 19 02:17:21 2006
From: k at dev.open-bio.org (Katayama Toshiaki)
Date: Tue, 19 Sep 2006 06:17:21 +0000
Subject: [BioRuby-cvs] bioruby/lib/bio/shell/plugin codon.rb,1.13,1.14
Message-ID: <200609190617.k8J6HLCe000502@dev.open-bio.org>

Update of /home/repository/bioruby/bioruby/lib/bio/shell/plugin
In directory dev.open-bio.org:/tmp/cvs-serv496/lib/bio/shell/plugin

Modified Files:
	codon.rb 
Log Message:
* Pyrrolysine and Selenocysteine are supported in the color mode


Index: codon.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/shell/plugin/codon.rb,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** codon.rb	9 Feb 2006 20:48:53 -0000	1.13
--- codon.rb	19 Sep 2006 06:17:19 -0000	1.14
***************
*** 53,57 ****
        @table.each do |codon, aa|
          if aa == '*'
!           code = "STOP"
            aa = '' unless @cuhash
          else
--- 53,57 ----
        @table.each do |codon, aa|
          if aa == '*'
!           code = 'STOP'
            aa = '' unless @cuhash
          else
***************
*** 79,87 ****
  
          if aa == '*'
-           color_code = "#{@colors[:stop]}STOP"
            if @cuhash
              color_aa = "#{@colors[:stop]}#{aa}"
            else
!             color_aa = ''
            end
          else
--- 79,95 ----
  
          if aa == '*'
            if @cuhash
+             color_code = "#{@colors[:stop]}STOP"
              color_aa = "#{@colors[:stop]}#{aa}"
            else
!             color_code = "#{@colors[:stop]}STP"
!             case codon
!             when 'tga'
!               color_aa = "#{@colors[:text]}U"
!             when 'tag'
!               color_aa = "#{@colors[:text]}O"
!             else
!               color_aa = "#{@colors[:text]}*"
!             end
            end
          else


From k at dev.open-bio.org  Tue Sep 19 02:20:40 2006
From: k at dev.open-bio.org (Katayama Toshiaki)
Date: Tue, 19 Sep 2006 06:20:40 +0000
Subject: [BioRuby-cvs] bioruby/lib/bio/shell/plugin seq.rb,1.17,1.18
Message-ID: <200609190620.k8J6Ken1000619@dev.open-bio.org>

Update of /home/repository/bioruby/bioruby/lib/bio/shell/plugin
In directory dev.open-bio.org:/tmp/cvs-serv615/lib/bio/shell/plugin

Modified Files:
	seq.rb 
Log Message:
* sixtrans, skip, step methods are added


Index: seq.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/shell/plugin/seq.rb,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** seq.rb	9 Feb 2006 20:48:53 -0000	1.17
--- seq.rb	19 Sep 2006 06:20:38 -0000	1.18
***************
*** 42,45 ****
--- 42,54 ----
  
  
+   def sixtrans(str)
+     seq = seq(str)
+     [ 1, 2, 3, -1, -2, -3 ].each do |frame|
+       title = "Translation #{frame.to_s.rjust(2)}"
+       puts seq.translate(frame).to_fasta(title, 60)
+     end
+   end
+ 
+ 
    # Displays some basic properties of the sequence.
    def seqstat(str)
***************
*** 152,155 ****
--- 161,182 ----
  class String
  
+   def step(window_size)
+     i = 0
+     0.step(self.length - window_size, window_size) do |i|
+       yield self[i, window_size]
+     end
+     yield self[i + window_size .. -1] if i + window_size < self.length
+   end
+ 
+   def skip(window_size, step_size = 1)
+     i = 0
+     0.step(self.length - window_size, step_size) do |i|
+       yield [self[i, window_size], i + 1, i + window_size]
+     end
+     from = i + step_size
+     to  = [self.length, i + step_size + window_size].min
+     yield [self[from, window_size], from + 1, to] if from + 1 <= to
+   end
+ 
    def to_naseq
      Bio::Sequence::NA.new(self)


From k at dev.open-bio.org  Tue Sep 19 02:28:58 2006
From: k at dev.open-bio.org (Katayama Toshiaki)
Date: Tue, 19 Sep 2006 06:28:58 +0000
Subject: [BioRuby-cvs] bioruby/lib/bio/appl fasta.rb,1.22,1.23
Message-ID: <200609190628.k8J6Swhl000734@dev.open-bio.org>

Update of /home/repository/bioruby/bioruby/lib/bio/appl
In directory dev.open-bio.org:/tmp/cvs-serv730/lib/bio/appl

Modified Files:
	fasta.rb 
Log Message:
* license is changed from LGPL to Ruby's
* document is changed to RDoc


Index: fasta.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/appl/fasta.rb,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** fasta.rb	25 Jul 2006 18:48:41 -0000	1.22
--- fasta.rb	19 Sep 2006 06:28:56 -0000	1.23
***************
*** 1,22 ****
  #
! # bio/appl/fasta.rb - FASTA wrapper
! #
! #   Copyright (C) 2001,2002 KATAYAMA Toshiaki 
! #
! #  This library is free software; you can redistribute it and/or
! #  modify it under the terms of the GNU Lesser General Public
! #  License as published by the Free Software Foundation; either
! #  version 2 of the License, or (at your option) any later version.
! #
! #  This library is distributed in the hope that it will be useful,
! #  but WITHOUT ANY WARRANTY; without even the implied warranty of
! #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
! #  Lesser General Public License for more details.
  #
! #  You should have received a copy of the GNU Lesser General Public
! #  License along with this library; if not, write to the Free Software
! #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
  #
! #  $Id$
  #
  
--- 1,9 ----
  #
! # = bio/appl/fasta.rb - FASTA wrapper
  #
! # Copyright::  Copyright (C) 2001, 2002 Toshiaki Katayama 
! # License::    Ruby's
  #
! # $Id$
  #
  
***************
*** 28,177 ****
  module Bio
  
!   class Fasta
! 
!     autoload :Report, 'bio/appl/fasta/format10'
!     #autoload :?????,  'bio/appl/fasta/format6'
  
!     def initialize(program, db, opt = [], server = 'local')
!       @format	= 10
  
!       @program	= program
!       @db	= db
!       @server	= server
  
!       @ktup	= nil
!       @matrix	= nil
  
!       @output	= ''
  
!       begin
!         a = opt.to_ary
!       rescue NameError #NoMethodError
!         # backward compatibility
!         a = Shellwords.shellwords(opt)
!       end
!       @options	= [ '-Q', '-H', '-m', @format.to_s, *a ] # need -a ?
!     end
!     attr_accessor :program, :db, :options, :server, :ktup, :matrix
!     attr_reader :output
  
!     def option
        # backward compatibility
!       Bio::Command.make_command_line(@options)
      end
  
!     def option=(str)
!       # backward compatibility
!       @options = Shellwords.shellwords(str)
!     end
  
!     def format=(num)
!       @format = num.to_i
!       if i = @options.index('-m') then
!         @options[i+1, 1] = @format.to_s
!       else
!         @options << '-m' << @format.to_s
!       end
!     end
!     attr_reader :format
  
!     def self.parser(parser)
!       require "bio/appl/fasta/#{parser}"
!     end
  
!     def self.local(program, db, option = '')
!       self.new(program, db, option, 'local')
      end
  
!     def self.remote(program, db, option = '', server = 'genomenet')
!       self.new(program, db, option, server)
!     end
  
!     def query(query)
!       return self.send("exec_#{@server}", query.to_s)
!     end
  
  
!     private
  
  
!     def parse_result(data)
!       case @format
!       when 6
!         require 'bio/appl/fasta/format6'
!       when 10
!         require 'bio/appl/fasta/format10'
!       end
!       Report.new(data)
      end
  
  
!     def exec_local(query)
!       cmd = [ @program, *@options ]
!       cmd.concat([ '@', @db, @ktup ])
  
!       report = nil
  
!       @output = Bio::Command.query_command(cmd, query)
!       report = parse_result(@output)
  
!       return report
!     end
  
  
!     def exec_genomenet(query)
!       host = "fasta.genome.jp"
!       #path = "/sit-bin/nph-fasta"
!       path = "/sit-bin/fasta" #2005.08.12
  
!       form = {
!         'style'		=> 'raw',
!         'prog'		=> @program,
!         'dbname'	=> @db,
!         'sequence'	=> CGI.escape(query),
!         'other_param'	=> CGI.escape(Bio::Command.make_command_line_unix(@options)),
!         'ktup_value'	=> @ktup,
!         'matrix'	=> @matrix,
!       }
  
!       data = []
  
!       form.each do |k, v|
!         data.push("#{k}=#{v}") if v
!       end
  
!       report = nil
  
!       begin
!         http = Bio::Command.new_http(host)
!         http.open_timeout = 300
!         http.read_timeout = 600
!         result, = http.post(path, data.join('&'))
!         @output = result.body
!         # workaround 2005.08.12 - realized that this is bloken again (by new batch queuing system) 2006.06.08 
!         if /\Show all result\<\/A\>/i =~ @output.to_s then
!           result, = http.get($2)
!           @output = result.body
!           txt = @output.to_s.split(/\/)[1]
!           raise 'cannot understand response' unless txt
!           txt.sub!(/\<\/pre\>.*\z/m, '')
!           txt.sub!(/.*^((T?FASTA|SSEARCH) (searches|compares))/m, '\1')
!           txt.sub!(/^\
.*\n/, '') ! txt.gsub!(/\]+value\=\"[^\"]*\"[^\>]*\>/i, '') ! txt.gsub!(/\<(a|form|select|input|option|img)\s+[^\>]+\>/i, '') ! txt.gsub!(/\<\/(a|form|select|input|option|img)\>/i, '') ! @output = txt.gsub(/\<\;/, '<') ! report = parse_result(@output.dup) ! else ! raise 'cannot understand response' end end ! ! return report end end ! end --- 15,219 ---- module Bio ! class Fasta ! #autoload :Report, 'bio/appl/fasta/format10' ! #autoload :?????, 'bio/appl/fasta/format6' ! # Returns a FASTA factory object (Bio::Fasta). ! def initialize(program, db, opt = [], server = 'local') ! @format = 10 ! @program = program ! @db = db ! @server = server ! @ktup = nil ! @matrix = nil ! @output = '' ! begin ! a = opt.to_ary ! rescue NameError #NoMethodError # backward compatibility ! a = Shellwords.shellwords(opt) end + @options = [ '-Q', '-H', '-m', @format.to_s, *a ] # need -a ? + end + attr_accessor :program, :db, :options, :server, :ktup, :matrix ! # Returns a String containing fasta execution output in as is format. ! attr_reader :output ! def option ! # backward compatibility ! Bio::Command.make_command_line(@options) ! end ! def option=(str) ! # backward compatibility ! @options = Shellwords.shellwords(str) ! end ! # Accessors for the -m option. ! def format=(num) ! @format = num.to_i ! if i = @options.index('-m') then ! @options[i+1, 1] = @format.to_s ! else ! @options << '-m' << @format.to_s end + end + attr_reader :format ! # Select parser to use ('format6' and 'format10' is acceptable for now) ! # ! # This method will import Bio::Fasta::Report class by requiring specified ! # parser and will be useful when you already have fasta output files and ! # want to use appropriate Report class for parsing. ! # ! def self.parser(parser) ! require "bio/appl/fasta/#{parser}" ! end ! # Returns a FASTA factory object (Bio::Fasta) to run FASTA search on ! # local computer. ! def self.local(program, db, option = '') ! self.new(program, db, option, 'local') ! end + # Returns a FASTA factory object (Bio::Fasta) to execute FASTA search on + # remote server. + # + # For the develpper, you can add server 'hoge' by adding + # exec_hoge(query) method. + # + def self.remote(program, db, option = '', server = 'genomenet') + self.new(program, db, option, server) + end ! # Execute FASTA search and returns Report object (Bio::Fasta::Report). ! def query(query) ! return self.send("exec_#{@server}", query.to_s) ! end ! private ! ! ! def parse_result(data) ! case @format ! when 6 ! require 'bio/appl/fasta/format6' ! when 10 ! require 'bio/appl/fasta/format10' end + Report.new(data) + end ! def exec_local(query) ! cmd = [ @program, *@options ] ! cmd.concat([ '@', @db, @ktup ]) ! report = nil ! @output = Bio::Command.query_command(cmd, query) ! report = parse_result(@output) ! return report ! end ! # == Available databases for Fasta.remote(@program, @db, option, 'genomenet') ! # ! # See http://fasta.genome.jp/ideas/ideas.html#fasta for more details. ! # ! # ----------+-------+--------------------------------------------------- ! # @program | query | @db (supported in GenomeNet) ! # ----------+-------+--------------------------------------------------- ! # fasta | AA | nr-aa, genes, vgenes.pep, swissprot, swissprot-upd, ! # | | pir, prf, pdbstr ! # +-------+--------------------------------------------------- ! # | NA | nr-nt, genbank-nonst, gbnonst-upd, dbest, dbgss, ! # | | htgs, dbsts, embl-nonst, embnonst-upd, epd, ! # | | genes-nt, genome, vgenes.nuc ! # ----------+-------+--------------------------------------------------- ! # tfasta | AA | nr-nt, genbank-nonst, gbnonst-upd, dbest, dbgss, ! # | | htgs, dbsts, embl-nonst, embnonst-upd, ! # | | genes-nt, genome, vgenes.nuc ! # ----------+-------+--------------------------------------------------- ! # ! def exec_genomenet(query) ! host = "fasta.genome.jp" ! #path = "/sit-bin/nph-fasta" ! path = "/sit-bin/fasta" # 2005.08.12 ! form = { ! 'style' => 'raw', ! 'prog' => @program, ! 'dbname' => @db, ! 'sequence' => CGI.escape(query), ! 'other_param' => CGI.escape(Bio::Command.make_command_line_unix(@options)), ! 'ktup_value' => @ktup, ! 'matrix' => @matrix, ! } ! data = [] ! form.each do |k, v| ! data.push("#{k}=#{v}") if v ! end ! report = nil ! begin ! http = Bio::Command.new_http(host) ! http.open_timeout = 3000 ! http.read_timeout = 6000 ! result, = http.post(path, data.join('&')) ! # workaround 2006.8.1 - fixed for new batch queuing system ! case result.code ! when "302" ! result_location = result.header['location'] ! result_uri = URI.parse(result_location) ! result_path = result_uri.path ! done = false ! until done ! result = http.get(result_path) ! if result.body[/Your job ID is/] ! sleep 15 ! else ! done = true ! end end end ! @output = result.body.to_s ! # workaround 2005.08.12 ! re = %r{Show all result} # " ! if path = @output[re, 1] ! result, = http.get(path) ! @output = result.body ! txt = @output.to_s.split(/\/)[1] ! raise 'cannot understand response' unless txt ! txt.sub!(/\<\/pre\>.*\z/m, '') ! txt.sub!(/.*^((T?FASTA|SSEARCH) (searches|compares))/m, '\1') ! txt.sub!(/^\.*\n/, '') ! txt.gsub!(/\]+value\=\"[^\"]*\"[^\>]*\>/i, '') ! txt.gsub!(/\<(a|form|select|input|option|img)\s+[^\>]+\>/i, '') ! txt.gsub!(/\<\/(a|form|select|input|option|img)\>/i, '') ! @output = txt.gsub(/\<\;/, '<') ! report = parse_result(@output.dup) ! else ! raise 'cannot understand response' ! end end + return report end ! end # Fasta ! ! end # Bio *************** *** 186,189 **** --- 228,233 ---- # serv = Bio::Fasta.local('fasta34', 'hoge.pep') # serv = Bio::Fasta.local('ssearch34', 'hoge.pep') + + # This may take 3 minutes or so. serv = Bio::Fasta.remote('fasta', 'genes') p serv.query(ARGF.read) *************** *** 191,260 **** - =begin - - = Bio::Fasta - - --- Bio::Fasta.new(program, db, option = '', server = 'local') - --- Bio::Fasta.local(program, db, option = '') - --- Bio::Fasta.remote(program, db, option = '', server = 'genomenet') - - Returns a fasta factory object (Bio::Fasta). - - For the develpper, you can add server 'hoge' by adding - exec_hoge(query) method. - - --- Bio::Fasta#query(query) - - Execute fasta search and returns Report object (Bio::Fasta::Report). - - --- Bio::Fasta#output - - Returns a String containing fasta execution output in as is format. - - --- Bio::Fasta#program - --- Bio::Fasta#db - --- Bio::Fasta#options - --- Bio::Fasta#server - --- Bio::Fasta#ktup - - Accessors for the factory parameters. - - --- Bio::Fasta#option - --- Bio::Fasta#option=(str) - - Get/set options by string. - - --- Bio::Fasta#format - --- Bio::Fasta#format=(number) - - Accessors for the -m option. - - --- Bio::Fasta.parser(parser) - - Import Bio::Fasta::Report class by requiring specified parser. - - This class method will be useful when you already have fasta - output files and want to use appropriate Report class for parsing. - - - == Available databases for Fasta.remote(@program, @db, option, 'genomenet') - - # ----------+-------+--------------------------------------------------- - # @program | query | @db (supported in GenomeNet) - # ----------+-------+--------------------------------------------------- - # fasta | AA | nr-aa, genes, vgenes.pep, swissprot, swissprot-upd, - # | | pir, prf, pdbstr - # +-------+--------------------------------------------------- - # | NA | nr-nt, genbank-nonst, gbnonst-upd, dbest, dbgss, - # | | htgs, dbsts, embl-nonst, embnonst-upd, epd, - # | | genes-nt, genome, vgenes.nuc - # ----------+-------+--------------------------------------------------- - # tfasta | AA | nr-nt, genbank-nonst, gbnonst-upd, dbest, dbgss, - # | | htgs, dbsts, embl-nonst, embnonst-upd, - # | | genes-nt, genome, vgenes.nuc - # ----------+-------+--------------------------------------------------- - - See http://fasta.genome.jp/ideas/ideas.html#fasta for more details. - - =end - --- 235,236 ---- From k at dev.open-bio.org Tue Sep 19 02:29:39 2006 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Tue, 19 Sep 2006 06:29:39 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/appl hmmer.rb,1.6,1.7 Message-ID: <200609190629.k8J6Td4s000777@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/appl In directory dev.open-bio.org:/tmp/cvs-serv773/lib/bio/appl Modified Files: hmmer.rb Log Message: * license is changed from LGPL to Ruby's Index: hmmer.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/appl/hmmer.rb,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** hmmer.rb 14 Jul 2006 14:26:39 -0000 1.6 --- hmmer.rb 19 Sep 2006 06:29:37 -0000 1.7 *************** *** 3,48 **** # # Copyright:: Copyright (C) 2002 ! # KATAYAMA Toshiaki ! # Lisence:: LGPL # # $Id$ # - # == Description - # - # A wrapper for the HMMER programs (hmmsearch or hmmpfam). - # - # == Examples - # - # require 'bio' - # program = 'hmmsearch' # or 'hmmpfam' - # hmmfile = 'test.hmm' - # seqfile = 'test.faa' - # - # factory = Bio::HMMER.new(program, hmmfile, seqfile) - # p factory.query - # - # == References - # - # * HMMER - # http://hmmer.wustl.edu/ - # - #-- - # - # This library is free software; you can redistribute it and/or - # modify it under the terms of the GNU Lesser General Public - # License as published by the Free Software Foundation; either - # version 2 of the License, or (at your option) any later version. - # - # This library is distributed in the hope that it will be useful, - # but WITHOUT ANY WARRANTY; without even the implied warranty of - # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - # Lesser General Public License for more details. - # - # You should have received a copy of the GNU Lesser General Public - # License along with this library; if not, write to the Free Software - # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - # - #++ - # require 'bio/command' --- 3,11 ---- # # Copyright:: Copyright (C) 2002 ! # Toshiaki Katayama ! # Lisence:: Ruby's # # $Id$ # require 'bio/command' *************** *** 51,54 **** --- 14,19 ---- module Bio + # == Description + # # A wapper for HMMER programs (hmmsearch or hmmpfam). # *************** *** 62,66 **** # factory = Bio::HMMER.new(program, hmmfile, seqfile) # report = factory.query ! # report.class #=> Bio::HMMER::Report # # === References --- 27,31 ---- # factory = Bio::HMMER.new(program, hmmfile, seqfile) # report = factory.query ! # report.class # => Bio::HMMER::Report # # === References From k at dev.open-bio.org Tue Sep 19 02:30:44 2006 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Tue, 19 Sep 2006 06:30:44 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/appl psort.rb,1.11,1.12 Message-ID: <200609190630.k8J6UibD000820@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/appl In directory dev.open-bio.org:/tmp/cvs-serv816/lib/bio/appl Modified Files: psort.rb Log Message: * added require 'uri' Index: psort.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/appl/psort.rb,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** psort.rb 25 Jul 2006 18:41:23 -0000 1.11 --- psort.rb 19 Sep 2006 06:30:42 -0000 1.12 *************** *** 10,30 **** # $Id$ # - # == A client for PSORT WWW Server - # - # A client for PSORT WWW Server for predicting protein subcellular - # localization. - # - # PSORT family members, - # 1. PSORT - # 2. PSORT II - # 3. iPSORT - # 4. PSORT-B http://psort.org - # 5. WoLF-PSORT - # - # See http://psort.ims.u-tokyo.ac.jp. - # - # === Example - # - # require 'bio/appl/psort/report' --- 10,13 ---- *************** *** 32,37 **** autoload :Command, 'bio/command' require 'cgi' ! # class PSORT --- 15,35 ---- autoload :Command, 'bio/command' require 'cgi' + require 'uri' ! # == A client for PSORT WWW Server ! # ! # A client for PSORT WWW Server for predicting protein subcellular ! # localization. ! # ! # PSORT family members, ! # 1. PSORT ! # 2. PSORT II ! # 3. iPSORT ! # 4. PSORT-B http://psort.org ! # 5. WoLF-PSORT ! # ! # == References ! # ! # * http://psort.hgc.jp/ # class PSORT From k at dev.open-bio.org Tue Sep 19 02:31:10 2006 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Tue, 19 Sep 2006 06:31:10 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/appl blast.rb, 1.31, 1.32 emboss.rb, 1.6, 1.7 Message-ID: <200609190631.k8J6VA9Y000845@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/appl In directory dev.open-bio.org:/tmp/cvs-serv841/lib/bio/appl Modified Files: blast.rb emboss.rb Log Message: * minor doc fix Index: emboss.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/appl/emboss.rb,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** emboss.rb 14 Jul 2006 14:28:44 -0000 1.6 --- emboss.rb 19 Sep 2006 06:31:08 -0000 1.7 *************** *** 2,25 **** # = bio/appl/emboss.rb - EMBOSS wrapper # ! # Copyright (C):: 2002, 2005 KATAYAMA Toshiaki ! # Copyright (C):: 2006 Aerts Jan ! # ! # License:: Ruby's # # $Id$ # ! # = DESCRIPTION ! # ! # This file holds classes pertaining to the EMBOSS software suite. ! # ! # = REFERENCES ! # ! # * http://emboss.sourceforge.net ! # * Rice P, Longden I and Bleasby A. \ ! # EMBOSS: the European Molecular Biology Open Software Suite. \ ! # Trends Genet. 2000 Jun ; 16(6): 276-7 module Bio ! # = DESCRIPTION # # This class provides a wrapper for the applications of the EMBOSS suite, which --- 2,17 ---- # = bio/appl/emboss.rb - EMBOSS wrapper # ! # Copyright:: Copyright (C) 2002, 2005 Toshiaki Katayama ! # Copyright:: Copyright (C) 2006 Jan Aerts ! # License:: Ruby's # # $Id$ # ! module Bio ! # == Description ! # ! # This file holds classes pertaining to the EMBOSS software suite. # # This class provides a wrapper for the applications of the EMBOSS suite, which *************** *** 38,42 **** # # ! # = USAGE # # require 'bio' --- 30,34 ---- # # ! # == Usage # # require 'bio' *************** *** 61,70 **** # puts Bio::EMBOSS.entret('embl:xlrhodop') # ! # = PREREQUISITES # # You must have the EMBOSS suite installed locally. You can download from the # project website (see References below). # ! # = REFERENCES # # * http://emboss.sourceforge.net --- 53,62 ---- # puts Bio::EMBOSS.entret('embl:xlrhodop') # ! # == Pre-requisites # # You must have the EMBOSS suite installed locally. You can download from the # project website (see References below). # ! # = Rereferences # # * http://emboss.sourceforge.net *************** *** 72,75 **** --- 64,68 ---- # EMBOSS: the European Molecular Biology Open Software Suite. \ # Trends Genet. 2000 Jun ; 16(6): 276-7 + # class EMBOSS Index: blast.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/appl/blast.rb,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** blast.rb 25 Jul 2006 18:47:13 -0000 1.31 --- blast.rb 19 Sep 2006 06:31:08 -0000 1.32 *************** *** 2,22 **** # = bio/appl/blast.rb - BLAST wrapper # ! # Copyright (C):: 2001 Mitsuteru C. Nakao ! # Copyright (C):: 2002,2003 KATAYAMA Toshiaki ! # Copyright (C):: 2006 Jan Aerts ! # # License:: Ruby's # # $Id$ # - # = DESCRIPTION - # - # This file holds the Bio::Blast class, which creates BLAST factories. - # - # = References - # - # * http://www.ncbi.nlm.nih.gov/blast/ - # * http://blast.genome.jp/ideas/ideas.html#blast - # require 'net/http' --- 2,12 ---- # = bio/appl/blast.rb - BLAST wrapper # ! # Copyright:: Copyright (C) 2001 Mitsuteru C. Nakao ! # Copyright:: Copyright (C) 2002,2003 Toshiaki Katayama ! # Copyright:: Copyright (C) 2006 Jan Aerts # License:: Ruby's # # $Id$ # require 'net/http' *************** *** 27,31 **** module Bio ! # = DESCRIPTION # # The Bio::Blast class contains methods for running local or remote BLAST --- 17,21 ---- module Bio ! # == Description # # The Bio::Blast class contains methods for running local or remote BLAST *************** *** 34,38 **** # program, see http://www.ncbi.nlm.nih.gov/Education/BLASTinfo/similarity.html. # ! # = USAGE # # require 'bio' --- 24,28 ---- # program, see http://www.ncbi.nlm.nih.gov/Education/BLASTinfo/similarity.html. # ! # == Usage # # require 'bio' *************** *** 50,54 **** # # Then, to parse the report, see Bio::Blast::Report # ! # == Available databases for Bio::Blast.remote # # ----------+-------+--------------------------------------------------- --- 40,44 ---- # # Then, to parse the report, see Bio::Blast::Report # ! # === Available databases for Bio::Blast.remote # # ----------+-------+--------------------------------------------------- *************** *** 64,68 **** # ----------+-------+--------------------------------------------------- # ! # = SEE ALSO # # * Bio::Blast::Report --- 54,58 ---- # ----------+-------+--------------------------------------------------- # ! # == See also # # * Bio::Blast::Report *************** *** 70,75 **** # * Bio::Blast::Report::Hsp # ! # = REFERENCE # # * http://www.ncbi.nlm.nih.gov/Education/BLASTinfo/similarity.html # * http://blast.genome.jp/ideas/ideas.html#blast --- 60,66 ---- # * Bio::Blast::Report::Hsp # ! # == References # + # * http://www.ncbi.nlm.nih.gov/blast/ # * http://www.ncbi.nlm.nih.gov/Education/BLASTinfo/similarity.html # * http://blast.genome.jp/ideas/ideas.html#blast From ngoto at dev.open-bio.org Mon Sep 25 04:09:24 2006 From: ngoto at dev.open-bio.org (Naohisa Goto) Date: Mon, 25 Sep 2006 08:09:24 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/appl mafft.rb,1.10,1.11 Message-ID: <200609250809.k8P89OGD017000@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/appl In directory dev.open-bio.org:/tmp/cvs-serv16959/appl Modified Files: mafft.rb Log Message: added "require 'tempfile'" Index: mafft.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/appl/mafft.rb,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** mafft.rb 30 Apr 2006 05:50:19 -0000 1.10 --- mafft.rb 25 Sep 2006 08:09:22 -0000 1.11 *************** *** 31,34 **** --- 31,35 ---- #++ require 'open3' + require 'tempfile' module Bio From k at dev.open-bio.org Tue Sep 19 05:39:07 2006 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Tue, 19 Sep 2006 05:39:07 +0000 Subject: [BioRuby-cvs] bioruby README.DEV,1.10,1.11 Message-ID: <200609190539.k8J5d7bK031135@dev.open-bio.org> Update of /home/repository/bioruby/bioruby In directory dev.open-bio.org:/tmp/cvs-serv31131 Modified Files: README.DEV Log Message: * fix of the code template Index: README.DEV =================================================================== RCS file: /home/repository/bioruby/bioruby/README.DEV,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** README.DEV 11 May 2006 10:53:25 -0000 1.10 --- README.DEV 19 Sep 2006 05:39:05 -0000 1.11 *************** *** 1,6 **** ! $Id$ ! Copyright (C):: 2005, 2006 Toshiaki Katayama ! Copyright (C):: 2006 Jan Aerts = HOW TO CONTRIBUTE TO THE BIORUBY PROJECT? --- 1,8 ---- ! = README.DEV ! Copyright:: Copyright (C) 2005, 2006 Toshiaki Katayama ! Copyright:: Copyright (C) 2006 Jan Aerts ! ! $Id$ = HOW TO CONTRIBUTE TO THE BIORUBY PROJECT? *************** *** 71,89 **** The header should be formatted as follows: # # = bio/db/hoge.rb - Hoge database parser classes # ! # Copyright (C):: 2001, 2003-2005 Bio R. Hacker , ! # Copyright (C):: 2006 Chem R. Hacker # ! # License:: Ruby's # ! # $Id$ # ! # = Description # # This file contains classes that implement an interface to the Hoge database. # ! # = References # # * Hoge F. et al., The Hoge database, Nucleic. Acid. Res. 123:100--123 (2030) --- 73,92 ---- The header should be formatted as follows: + # # = bio/db/hoge.rb - Hoge database parser classes # ! # Copyright:: Copyright (C) 2001, 2003-2005 Bio R. Hacker , ! # Copyright:: Copyright (C) 2006 Chem R. Hacker # ! # License:: Ruby's # ! # $ I d: $ # ! # == Description # # This file contains classes that implement an interface to the Hoge database. # ! # == References # # * Hoge F. et al., The Hoge database, Nucleic. Acid. Res. 123:100--123 (2030) *************** *** 91,98 **** # ! In the above sample, the ! $Id$ ! will be automatically changed into something like $Id$ when commiting to the CVS repository for the first time. --- 94,114 ---- # ! require 'foo' ! ! module Bio ! ! autoload :Bar, 'bio/bar' ! ! class Hoge ! : ! end # Hoge ! ! end # Bio ! ! In the above sample, the '$ I d : $' (without spaces) will be automatically ! changed into something like ! $Id$ + when commiting to the CVS repository for the first time. *************** *** 102,106 **** following example (from lib/bio/sequence.rb): ! # = DESCRIPTION # Bio::Sequence objects represent annotated sequences in bioruby. # A Bio::Sequence object is a wrapper around the actual sequence, --- 118,123 ---- following example (from lib/bio/sequence.rb): ! # == Description ! # # Bio::Sequence objects represent annotated sequences in bioruby. # A Bio::Sequence object is a wrapper around the actual sequence, *************** *** 111,115 **** # these methods are not documented specifically for Bio::Sequence). # ! # = USAGE # require 'bio' # --- 128,133 ---- # these methods are not documented specifically for Bio::Sequence). # ! # == Usage ! # # require 'bio' # *************** *** 168,173 **** --- 186,194 ---- example too much, try to provide any input data directly into the usage example, instead of refering to ARGV or ARGF for input. + dna = Bio::Sequence.auto('atgcatgcATGCATGCAAAA') + Otherwise, describe the input shortly, for example: + # input should be string consisting of nucleotides dna = Bio::Sequence.auto(ARGF.read) *************** *** 178,181 **** --- 199,203 ---- be listed, as well as the type of thing that is returned by the method. The format of this information is as follows: + # --- # *Arguments*: *************** *** 189,193 **** --- 211,217 ---- Don't use + $stderr.puts "WARNING" + in your code. Instead, try to avoid printing error messages. For fatal errors, use +raise+ with an appropriate message. *************** *** 198,202 **** you meant to do with each method. The test code is useful to make maintenance easy and ensure stability. The use of ! if __FILE__ == $0 is deprecated. --- 222,228 ---- you meant to do with each method. The test code is useful to make maintenance easy and ensure stability. The use of ! ! if __FILE__ == $0 ! is deprecated. *************** *** 204,209 **** To quicken the initial load time we have replaced most of 'require' to ! 'autoload' ! since BioRuby version 0.7. During this change, we have found some tips: --- 230,234 ---- To quicken the initial load time we have replaced most of 'require' to ! 'autoload' since BioRuby version 0.7. During this change, we have found some tips: From k at dev.open-bio.org Tue Sep 19 05:41:47 2006 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Tue, 19 Sep 2006 05:41:47 +0000 Subject: [BioRuby-cvs] bioruby/lib bio.rb,1.69,1.70 Message-ID: <200609190541.k8J5fl0p031252@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib In directory dev.open-bio.org:/tmp/cvs-serv31246/lib Modified Files: bio.rb Log Message: * added ebisoap and ncbisoap Index: bio.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio.rb,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -d -r1.69 -r1.70 *** bio.rb 14 Jul 2006 14:27:10 -0000 1.69 --- bio.rb 19 Sep 2006 05:41:45 -0000 1.70 *************** *** 121,124 **** --- 121,125 ---- autoload :Fetch, 'bio/io/fetch' autoload :SQL, 'bio/io/sql' + autoload :SOAPWSDL, 'bio/io/soapwsdl' autoload :FlatFile, 'bio/io/flatfile' autoload :FlatFileIndex, 'bio/io/flatfile/index' # chage to FlatFile::Index ? *************** *** 155,159 **** end ! # autoload :ESOAP, 'bio/io/esoap' # NCBI::ESOAP ? --- 156,166 ---- end ! class EBI ! autoload :SOAP, 'bio/io/ebisoap' ! end ! ! class NCBI ! autoload :SOAP, 'bio/io/ncbisoap' ! end From k at dev.open-bio.org Tue Sep 19 05:41:47 2006 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Tue, 19 Sep 2006 05:41:47 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/io ebisoap.rb, NONE, 1.1 ncbisoap.rb, NONE, 1.1 Message-ID: <200609190541.k8J5flio031257@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/io In directory dev.open-bio.org:/tmp/cvs-serv31246/lib/bio/io Added Files: ebisoap.rb ncbisoap.rb Log Message: * added ebisoap and ncbisoap --- NEW FILE: ebisoap.rb --- # # = bio/io/emblsoap.rb - EBI SOAP server access class # # Copyright:: Copyright (C) 2006 # Toshiaki Katayama # License:: Ruby's # # $Id: ebisoap.rb,v 1.1 2006/09/19 05:41:45 k Exp $ # require 'bio/io/soapwsdl' module Bio class EBI class SOAP < Bio::SOAPWSDL BASE_URI = "http://www.ebi.ac.uk/Tools/webservices/wsdl/" def initialize(wsdl = nil) super(wsdl || self.class::SERVER_URI) end # * fetchData # * getSupportedDBs # * getSupportedFormats # * getSupportedStyles class Dbfetch < Bio::EBI::SOAP SERVER_URI = BASE_URI + "WSDbfetch.wsdl" end # * checkStatus # * doIprscan # * getResults # * poll # * polljob # * runInterProScan # * test class InterProScan < Bio::EBI::SOAP SERVER_URI = BASE_URI + "WSInterProScan.wsdl" end # * checkStatus # * getInfo # * getResults # * getTools # * poll # * run # * test class Emboss < Bio::EBI::SOAP SERVER_URI = BASE_URI + "WSEmboss.wsdl" end # * checkStatus # * getResults # * poll # * runClustalW # * test class ClustalW < Bio::EBI::SOAP SERVER_URI = BASE_URI + "WSClustalW.wsdl" end # * checkStatus # * getResults # * poll # * runTCoffee class TCoffee < Bio::EBI::SOAP SERVER_URI = BASE_URI + "WSTCoffee.wsdl" end # * checkStatus # * getResults # * poll # * runMuscle # * test class Muscle < Bio::EBI::SOAP SERVER_URI = BASE_URI + "WSMuscle.wsdl" end # * checkStatus # * doFasta # * getResults # * poll # * polljob # * runFasta class Fasta < Bio::EBI::SOAP SERVER_URI = BASE_URI + "WSFasta.wsdl" end # * checkStatus # * doWUBlast # * getIds # * getResults # * poll # * polljob # * runWUBlast # * test class WUBlast < Bio::EBI::SOAP SERVER_URI = BASE_URI + "WSWUBlast.wsdl" end # * checkStatus # * getResults # * poll # * runMPsrch # * test class MPsrch < Bio::EBI::SOAP SERVER_URI = BASE_URI + "WSMPsrch.wsdl" end # * checkStatus # * getResults # * poll # * runScanPS # * test class ScanPS < Bio::EBI::SOAP SERVER_URI = BASE_URI + "WSScanPS.wsdl" end class MSD < Bio::EBI::SOAP SERVER_URI = "http://www.ebi.ac.uk/msd-srv/docs/api/msd_soap_service.wsdl" end class Ontology < Bio::EBI::SOAP SERVER_URI = "http://www.ebi.ac.uk/ontology-lookup/OntologyQuery.wsdl" end class Citation < Bio::EBI::SOAP SERVER_URI = "http://www.ebi.ac.uk/citations/webservices/wsdl" end end # SOAP end # EBI end # Bio if __FILE__ == $0 serv = Bio::EBI::SOAP::Dbfetch.new p serv.getSupportedDBs require 'base64' serv = Bio::EBI::SOAP::Emboss.new hash = {"tool" => "water", "asequence" => "uniprot:alk1_human", "bsequence" => "uniprot:alk1_mouse", "email" => "ebisoap at example.org"} poll = serv.run(hash, []) puts poll base = serv.poll(poll, "tooloutput") puts Base64.decode64(base) end --- NEW FILE: ncbisoap.rb --- # # = bio/io/ncbisoap.rb - SOAP interface for NCBI Entrez Utilities # # Copyright:: Copyright (C) 2004, 2006 # Toshiaki Katayama # License:: Ruby's # # $Id: ncbisoap.rb,v 1.1 2006/09/19 05:41:45 k Exp $ # require 'bio/io/soapwsdl' module Bio class NCBI # == References # # * http://eutils.ncbi.nlm.nih.gov/entrez/query/static/esoap_help.html # # == Methods # # All methods accept a hash as its argument and most of the keys can be # ommited (values are string). # # Note: Methods which name ends with _MS are designed for use with # Microsoft Visual Studio and SOAP Toolkit 3.0 # # * http://www.ncbi.nlm.nih.gov/entrez/query/static/esoap_ms_help.html # # * run_eFetch(_MS) # * "db", "id", "WebEnv", "query_key", "tool", "email", "retstart", # "retmax", "rettype", "strand", "seq_start", "seq_stop", "complexity", # "report" # # * run_eGquery(_MS) # * "term", "tool", "email" # # * run_eInfo(_MS) # * "db", "tool", "email" # # * run_eSpell(_MS) # * "db", "term", "tool", "email" # # * run_eLink(_MS) # * "db", "id", "reldate", "mindate", "maxdate", "datetype", "term" # "dbfrom", "WebEnv", "query_key", "cmd", "tool", "email" # # * run_eSearch(_MS) # * "db", "term", "WebEnv", "QueryKey", "usehistory", "tool", "email", # "field", "reldate", "mindate", "maxdate", "datetype", "RetStart", # "RetMax", "rettype", "sort" # # * run_eSummary(_MS) # * "db", "id", "WebEnv", "query_key", "retstart", "retmax", "tool", "email" # # == Complex data types # # * http://www.ncbi.nlm.nih.gov/entrez/eutils/soap/egquery.xsd # * http://www.ncbi.nlm.nih.gov/entrez/eutils/soap/einfo.xsd # * http://www.ncbi.nlm.nih.gov/entrez/eutils/soap/esearch.xsd # * http://www.ncbi.nlm.nih.gov/entrez/eutils/soap/esummary.xsd # * http://www.ncbi.nlm.nih.gov/entrez/eutils/soap/elink.xsd # * http://www.ncbi.nlm.nih.gov/entrez/eutils/soap/efetch.xsd # * http://www.ncbi.nlm.nih.gov/entrez/eutils/soap/espell.xsd # class SOAP < Bio::SOAPWSDL BASE_URI = "http://www.ncbi.nlm.nih.gov/entrez/eutils/soap/" def initialize(wsdl = nil) super(wsdl || self.class::SERVER_URI) end def method_missing(*arg) sleep 3 # make sure to rest for 3 seconds per request @driver.send(*arg) end class EUtils < Bio::NCBI::SOAP SERVER_URI = BASE_URI + "eutils.wsdl" end class EUtilsLite < Bio::NCBI::SOAP SERVER_URI = BASE_URI + "eutils_lite.wsdl" end class EFetch < Bio::NCBI::SOAP SERVER_URI = BASE_URI + "efetch.wsdl" end class EFetchLite < Bio::NCBI::SOAP SERVER_URI = BASE_URI + "efetch_lit.wsdl" end end # SOAP end # NCBI end # Bio if __FILE__ == $0 puts ">>> Bio::NCBI::SOAP::EFetch" efetch = Bio::NCBI::SOAP::EFetch.new puts "### run_eFetch in EFetch" hash = {"db" => "protein", "id" => "37776955"} result = efetch.run_eFetch(hash) p result puts ">>> Bio::NCBI::SOAP::EUtils" eutils = Bio::NCBI::SOAP::EUtils.new puts "### run_eFetch in EUtils" hash = {"db" => "pubmed", "id" => "12345"} result = eutils.run_eFetch(hash) p result puts "### run_eGquery - Entrez meta search to count hits in each DB" hash = {"term" => "kinase"} result = eutils.run_eGquery(hash) # working? p result puts "### run_eInfo - listing of the databases" hash = {"db" => "protein"} result = eutils.run_eInfo(hash) p result puts "### run_eSpell" hash = {"db" => "pubmed", "term" => "kinas"} result = eutils.run_eSpell(hash) p result p result["CorrectedQuery"] puts "### run_eLink" hash = {"db" => "protein", "id" => "37776955"} result = eutils.run_eLink(hash) # working? p result puts "### run_eSearch" hash = {"db" => "pubmed", "term" => "kinase"} result = eutils.run_eSearch(hash) p result puts "### run_eSummary" hash = {"db" => "protein", "id" => "37776955"} result = eutils.run_eSummary(hash) p result end From k at dev.open-bio.org Tue Sep 19 05:43:08 2006 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Tue, 19 Sep 2006 05:43:08 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/io soapwsdl.rb,1.5,1.6 Message-ID: <200609190543.k8J5h8qD031301@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/io In directory dev.open-bio.org:/tmp/cvs-serv31297/lib/bio/io Modified Files: soapwsdl.rb Log Message: * minor change Index: soapwsdl.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/io/soapwsdl.rb,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** soapwsdl.rb 29 May 2006 15:28:18 -0000 1.5 --- soapwsdl.rb 19 Sep 2006 05:43:06 -0000 1.6 *************** *** 3,11 **** # # Copyright:: Copyright (C) 2004 ! # KATAYAMA Toshiaki # License:: Ruby's # # $Id$ # # == Examples # --- 3,18 ---- # # Copyright:: Copyright (C) 2004 ! # Toshiaki Katayama # License:: Ruby's # # $Id$ # + begin + require 'soap/wsdlDriver' + rescue LoadError + end + + module Bio + # == Examples # *************** *** 36,53 **** # % export http_proxy=http://localhost:8080 # - - begin - require 'soap/wsdlDriver' - rescue LoadError - end - - module Bio - class SOAPWSDL ! # WSDL URL attr_reader :wsdl ! # log IO attr_reader :log --- 43,52 ---- # % export http_proxy=http://localhost:8080 # class SOAPWSDL ! # Returns URL of the current WSDL file. attr_reader :wsdl ! # Returns current logging IO. attr_reader :log *************** *** 71,75 **** ! # Set a WSDL URL. def wsdl=(url) @wsdl = url --- 70,85 ---- ! # Change the URL for WSDL file ! # ! # serv = Bio::SOAPWSDL.new("http://soap.genome.jp/KEGG.wsdl") ! # ! # or ! # ! # serv = Bio::SOAPWSDL.new ! # serv.wsdl = "http://soap.genome.jp/KEGG.wsdl" ! # ! # Note that you can't read two or more different WSDL files at once. ! # In that case, create Bio::SOAPWSDL object for each. ! # def wsdl=(url) @wsdl = url *************** *** 78,82 **** ! # Set log IO def log=(io) @log = io --- 88,100 ---- ! # Change the IO for logging. The argument is passed to wiredump_dev method ! # of the SOAP4R, thus ! # ! # serv = Bio::SOAPWSDL.new ! # serv.log = STDERR ! # ! # will print all the SOAP transactions in standard error. ! # This feature is especially useful for debug. ! # def log=(io) @log = io *************** *** 96,100 **** private :method_missing ! end # SOAP end # Bio --- 114,118 ---- private :method_missing ! end # SOAPWSDL end # Bio From k at dev.open-bio.org Tue Sep 19 05:44:43 2006 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Tue, 19 Sep 2006 05:44:43 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/io ddbjxml.rb,1.11,1.12 Message-ID: <200609190544.k8J5ihmC031344@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/io In directory dev.open-bio.org:/tmp/cvs-serv31340/lib/bio/io Modified Files: ddbjxml.rb Log Message: * initialize methods are unified in the super class Index: ddbjxml.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/io/ddbjxml.rb,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** ddbjxml.rb 8 May 2006 14:29:58 -0000 1.11 --- ddbjxml.rb 19 Sep 2006 05:44:41 -0000 1.12 *************** *** 3,7 **** # # Copyright:: Copyright (C) 2003, 2004 ! # KATAYAMA Toshiaki # License:: Ruby's # --- 3,7 ---- # # Copyright:: Copyright (C) 2003, 2004 ! # Toshiaki Katayama # License:: Ruby's # *************** *** 28,31 **** --- 28,35 ---- BASE_URI = "http://xml.nig.ac.jp/wsdl/" + def initialize(wsdl = nil) + super(wsdl || self.class::SERVER_URI) + end + # === Description # *************** *** 55,63 **** # === WSDL Methods # ! # ==== searchSimple(program, database, query) # # Returns a blast report in the default format. # ! # ==== searchParam(program, database, query, param) # # Blasts with param and returns a blast report. --- 59,67 ---- # === WSDL Methods # ! # * searchSimple(program, database, query) # # Returns a blast report in the default format. # ! # * searchParam(program, database, query, param) # # Blasts with param and returns a blast report. *************** *** 69,77 **** class Blast < XML SERVER_URI = BASE_URI + "Blast.wsdl" - - # returns a Bio::DDBJ::XML::Blast object. - def initialize(wsdl = nil) - super(wsdl || SERVER_URI) - end end --- 73,76 ---- *************** *** 106,111 **** # === WSDL Methods # ! # ==== analyzeSimple(query) ! # ==== analyzeParam(query, param) # # === References --- 105,110 ---- # === WSDL Methods # ! # * analyzeSimple(query) ! # * analyzeParam(query, param) # # === References *************** *** 115,123 **** class ClustalW < XML SERVER_URI = BASE_URI + "ClustalW.wsdl" - - # returns a Bio::DDBJ::XML::ClustalW object. - def initialize(wsdl = nil) - super(wsdl || SERVER_URI) - end end --- 114,117 ---- *************** *** 141,150 **** # === WSDL Methods # ! # ==== getFFEntry(accession) ! # ==== getXMLEntry(accession) ! # ==== getFeatureInfo(accession, feature) ! # ==== getAllFeatures(accession) ! # ==== getRelatedFeatures(accession, start, stop) ! # ==== getRelatedFeaturesSeq(accession, start, stop) # # === References --- 135,144 ---- # === WSDL Methods # ! # * getFFEntry(accession) ! # * getXMLEntry(accession) ! # * getFeatureInfo(accession, feature) ! # * getAllFeatures(accession) ! # * getRelatedFeatures(accession, start, stop) ! # * getRelatedFeaturesSeq(accession, start, stop) # # === References *************** *** 154,162 **** class DDBJ < XML SERVER_URI = BASE_URI + "DDBJ.wsdl" - - # returns a Bio::DDBJ::XML::DDBJ object. - def initialize(wsdl = nil) - super(wsdl || SERVER_URI) - end end --- 148,151 ---- *************** *** 179,184 **** # === WSDL Methods # ! # ==== searchSimple(program, database, query) ! # ==== searchParam(program, database, query, param) # # === References --- 168,173 ---- # === WSDL Methods # ! # * searchSimple(program, database, query) ! # * searchParam(program, database, query, param) # # === References *************** *** 188,196 **** class Fasta < XML SERVER_URI = BASE_URI + "Fasta.wsdl" - - # returns a Bio::DDBJ::XML::Fasta object. - def initialize(wsdl = nil) - super(wsdl || SERVER_URI) - end end --- 177,180 ---- *************** *** 210,242 **** # === WSDL Methods # ! # ==== getEntry(database, var, param1, param2) ! # ==== getEntry(database, var) ! # ==== getDDBJEntry(accession) ! # ==== getDDBJCONEntry(accession) ! # ==== getDDBJVerEntry(accession) ! # ==== getLocus_DDBJEntry(locus) ! # ==== getGene_DDBJEntry(gene) ! # ==== getProd_DDBJEntry(products) ! # ==== getPID_DDBJEntry(pid) ! # ==== getClone_DDBJEntry(clone) ! # ==== getXML_DDBJEntry(accession) ! # ==== getEMBLEntry(accession) ! # ==== getSWISSEntry(accession) ! # ==== getPIREntry(accession) ! # ==== getPRFEntry(accession) ! # ==== getPDBEntry(accession) ! # ==== getQVEntry(accession) ! # ==== getDADEntry(accession) ! # ==== getPID_DADEntry(pid) ! # ==== getFASTA_DDBJEntry(accession) ! # ==== getFASTA_DDBJCONEntry(accession) ! # ==== getFASTA_DDBJVerEntry(accession) ! # ==== getFASTA_DDBJSeqEntry(accession, start, end) ! # ==== getFASTA_DADEntry(accession) ! # ==== getFASTA_PIREntry(accession) ! # ==== getFASTA_SWISSEntry(accession) ! # ==== getFASTA_PDBEntry(accession) ! # ==== getFASTA_PRFEntry(accession) ! # ==== getFASTA_CDSEntry(accession) # # === References --- 194,226 ---- # === WSDL Methods # ! # * getEntry(database, var, param1, param2) ! # * getEntry(database, var) ! # * getDDBJEntry(accession) ! # * getDDBJCONEntry(accession) ! # * getDDBJVerEntry(accession) ! # * getLocus_DDBJEntry(locus) ! # * getGene_DDBJEntry(gene) ! # * getProd_DDBJEntry(products) ! # * getPID_DDBJEntry(pid) ! # * getClone_DDBJEntry(clone) ! # * getXML_DDBJEntry(accession) ! # * getEMBLEntry(accession) ! # * getSWISSEntry(accession) ! # * getPIREntry(accession) ! # * getPRFEntry(accession) ! # * getPDBEntry(accession) ! # * getQVEntry(accession) ! # * getDADEntry(accession) ! # * getPID_DADEntry(pid) ! # * getFASTA_DDBJEntry(accession) ! # * getFASTA_DDBJCONEntry(accession) ! # * getFASTA_DDBJVerEntry(accession) ! # * getFASTA_DDBJSeqEntry(accession, start, end) ! # * getFASTA_DADEntry(accession) ! # * getFASTA_PIREntry(accession) ! # * getFASTA_SWISSEntry(accession) ! # * getFASTA_PDBEntry(accession) ! # * getFASTA_PRFEntry(accession) ! # * getFASTA_CDSEntry(accession) # # === References *************** *** 246,254 **** class GetEntry < XML SERVER_URI = BASE_URI + "GetEntry.wsdl" - - # returns a Bio::DDBJ::XML::GetEntry object. - def initialize(wsdl = nil) - super(wsdl || SERVER_URI) - end end --- 230,233 ---- *************** *** 277,291 **** # === WSDL Methods # ! # ==== getOrganismList ! # ==== getChIDList ! # ==== getOrganismNameFromChid(chid) ! # ==== getChIDFromOrganismName(orgName) ! # ==== getAccession(chid) ! # ==== getPieceNumber(chid) ! # ==== getDivision(chid) ! # ==== getType(chid) ! # ==== getFlatFile(chid) ! # ==== getFastaFile(chid, type) ! # ==== getCDS(chid) # # === References --- 256,270 ---- # === WSDL Methods # ! # * getOrganismList ! # * getChIDList ! # * getOrganismNameFromChid(chid) ! # * getChIDFromOrganismName(orgName) ! # * getAccession(chid) ! # * getPieceNumber(chid) ! # * getDivision(chid) ! # * getType(chid) ! # * getFlatFile(chid) ! # * getFastaFile(chid, type) ! # * getCDS(chid) # # === References *************** *** 295,303 **** class Gib < XML SERVER_URI = BASE_URI + "Gib.wsdl" - - # returns a Bio::DDBJ::XML::Gib object. - def initialize(wsdl = nil) - super(wsdl || SERVER_URI) - end end --- 274,277 ---- *************** *** 317,322 **** # === WSDL Methods # ! # ==== getOrganismList ! # ==== getMasterInfo(orfID, organism) # # === References --- 291,296 ---- # === WSDL Methods # ! # * getOrganismList ! # * getMasterInfo(orfID, organism) # # === References *************** *** 326,334 **** class Gtop < XML SERVER_URI = BASE_URI + "Gtop.wsdl" - - # returns a Bio::DDBJ::XML::Gtop object. - def initialize(wsdl = nil) - super(wsdl || SERVER_URI) - end end --- 300,303 ---- *************** *** 347,356 **** # === WSDL Methods # ! # ==== searchVariation(field, query, order) ! # ==== searchVariationSimple(field, query) ! # ==== searchFrequency(field, query, order) ! # ==== searchFrequencySimple(field, query) ! # ==== getVariation(variation_id) ! # ==== getFrequency(variation_id, population_id) # # === References --- 316,325 ---- # === WSDL Methods # ! # * searchVariation(field, query, order) ! # * searchVariationSimple(field, query) ! # * searchFrequency(field, query, order) ! # * searchFrequencySimple(field, query) ! # * getVariation(variation_id) ! # * getFrequency(variation_id, population_id) # # === References *************** *** 360,368 **** class PML < XML SERVER_URI = BASE_URI + "PML.wsdl" - - # returns a Bio::DDBJ::XML::PML object. - def initialize(wsdl = nil) - super(wsdl || SERVER_URI) - end end --- 329,332 ---- *************** *** 382,387 **** # === WSDL Methods # ! # ==== searchSimple(query) ! # ==== searchParam(query, param) # # === Examples --- 346,351 ---- # === WSDL Methods # ! # * searchSimple(query) ! # * searchParam(query, param) # # === Examples *************** *** 391,399 **** class SRS < XML SERVER_URI = BASE_URI + "SRS.wsdl" - - # returns a Bio::DDBJ::XML::SRS object. - def initialize(wsdl = nil) - super(wsdl || SERVER_URI) - end end --- 355,358 ---- *************** *** 419,427 **** # === WSDL Methdos # ! # ==== searchSimple(tx_Name) ! # ==== searchParam(tx_Name, tx_Clas, tx_Rank, tx_Rmax, tx_Dcls) ! # ==== getTxId(tx_Name) ! # ==== getTxName(tx_Id) ! # ==== searchLineage(query, ranks, superkingdom) # # === References --- 378,386 ---- # === WSDL Methdos # ! # * searchSimple(tx_Name) ! # * searchParam(tx_Name, tx_Clas, tx_Rank, tx_Rmax, tx_Dcls) ! # * getTxId(tx_Name) ! # * getTxName(tx_Id) ! # * searchLineage(query, ranks, superkingdom) # # === References *************** *** 431,439 **** class TxSearch < XML SERVER_URI = BASE_URI + "TxSearch.wsdl" - - # returns a Bio::DDBJ::XML::TxSearch object. - def initialize(wsdl = nil) - super(wsdl || SERVER_URI) - end end --- 390,393 ---- From k at dev.open-bio.org Tue Sep 19 05:45:50 2006 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Tue, 19 Sep 2006 05:45:50 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/io keggapi.rb,1.12,1.13 Message-ID: <200609190545.k8J5joPl031387@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/io In directory dev.open-bio.org:/tmp/cvs-serv31383/lib/bio/io Modified Files: keggapi.rb Log Message: * documentations are moved to RDoc Index: keggapi.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/io/keggapi.rb,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** keggapi.rb 14 Jul 2006 14:48:56 -0000 1.12 --- keggapi.rb 19 Sep 2006 05:45:48 -0000 1.13 *************** *** 1,22 **** # ! # bio/io/keggapi.rb - KEGG API access class ! # ! # Copyright (C) 2003, 2004 KATAYAMA Toshiaki ! # ! # This library is free software; you can redistribute it and/or ! # modify it under the terms of the GNU Lesser General Public ! # License as published by the Free Software Foundation; either ! # version 2 of the License, or (at your option) any later version. ! # ! # This library is distributed in the hope that it will be useful, ! # but WITHOUT ANY WARRANTY; without even the implied warranty of ! # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! # Lesser General Public License for more details. # ! # You should have received a copy of the GNU Lesser General Public ! # License along with this library; if not, write to the Free Software ! # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # ! # $Id$ # --- 1,9 ---- # ! # = bio/io/keggapi.rb - KEGG API access class # ! # Copyright:: Copyright (C) 2003, 2004 Toshiaki Katayama ! # License:: Ruby's # ! # $Id$ # *************** *** 29,36 **** --- 16,197 ---- class KEGG + # == Description + # + # KEGG API is a web service to use KEGG system via SOAP/WSDL. + # + # == References + # + # For more informations on KEGG API, see the following site and read the + # reference manual. + # + # * http://www.genome.jp/kegg/soap/ + # * http://www.genome.jp/kegg/soap/doc/keggapi_manual.html + # + # == List of methods + # + # As of KEGG API v5.0 + # + # * list_databases + # * list_organisms + # * list_pathways(org) + # * binfo(string) + # * bget(string) + # * bfind(string) + # * btit(string) + # * get_linkdb_by_entry(entry_id, db, start, max_results) + # * get_best_best_neighbors_by_gene(genes_id, start, max_results) + # * get_best_neighbors_by_gene(genes_id, start, max_results) + # * get_reverse_best_neighbors_by_gene(genes_id, start, max_results) + # * get_paralogs_by_gene(genes_id, start, max_results) + # * get_similarity_between_genes(genes_id1, genes_id2) + # * get_motifs_by_gene(genes_id, db) + # * get_genes_by_motifs(motif_id_list, start, max_results) + # * get_ko_by_gene(genes_id) + # * get_ko_members(ko_id) + # * get_oc_members_by_gene(genes_id, start, max_results) + # * get_pc_members_by_gene(genes_id, start, max_results) + # * mark_pathway_by_objects(pathway_id, object_id_list) + # * color_pathway_by_objects(pathway_id, object_id_list, fg_color_list, bg_color_list) + # * get_genes_by_pathway(pathway_id) + # * get_enzymes_by_pathway(pathway_id) + # * get_compounds_by_pathway(pathway_id) + # * get_reactions_by_pathway(pathway_id) + # * get_pathways_by_genes(genes_id_list) + # * get_pathways_by_enzymes(enzyme_id_list) + # * get_pathways_by_compounds(compound_id_list) + # * get_pathways_by_reactions(reaction_id_list) + # * get_linked_pathways(pathway_id) + # * get_genes_by_enzyme(enzyme_id, org) + # * get_enzymes_by_gene(genes_id) + # * get_enzymes_by_compound(compound_id) + # * get_enzymes_by_reaction(reaction_id) + # * get_compounds_by_enzyme(enzyme_id) + # * get_compounds_by_reaction(reaction_id) + # * get_reactions_by_enzyme(enzyme_id) + # * get_reactions_by_compound(compound_id) + # * get_genes_by_organism(org, start, max_results) + # * get_number_of_genes_by_organism(org) + # + # == KEGG API methods implemented only in BioRuby + # + # In BioRuby, returned values are added filter method to pick up + # values in a complex data type as an array. + # + # #!/usr/bin/env ruby + # + # require 'bio' + # + # serv = Bio::KEGG::API.new + # results = serv.get_best_neighbors_by_gene("eco:b0002", "bsu") + # + # # case 0 : without filter + # results.each do |hit| + # print hit.genes_id1, "\t", hit.genes_id2, "\t", hit.sw_score, "\n" + # end + # + # # case 1 : select gene names and SW score only + # fields = [:genes_id1, :genes_id2, :sw_score] + # results.each do |hit| + # puts hit.filter(fields).join("\t") + # end + # + # # case 2 : also uses aligned position in each amino acid sequence etc. + # fields1 = [:genes_id1, :start_position1, :end_position1, :best_flag_1to2] + # fields2 = [:genes_id2, :start_position2, :end_position2, :best_flag_2to1] + # results.each do |hit| + # print "> score: ", hit.sw_score, ", identity: ", hit.identity, "\n" + # print "1:\t", hit.filter(fields1).join("\t"), "\n" + # print "2:\t", hit.filter(fields2).join("\t"), "\n" + # end + # + # Using filter method will make it easy to change fields to select and + # keep the script clean. + # + # * Bio::KEGG::API#get_all_neighbors_by_gene(genes_id, org) + # * Bio::KEGG::API#get_all_best_best_neighbors_by_gene(genes_id) + # * Bio::KEGG::API#get_all_best_neighbors_by_gene(genes_id) + # * Bio::KEGG::API#get_all_reverse_best_neighbors_by_gene(genes_id) + # * Bio::KEGG::API#get_all_paralogs_by_gene(genes_id) + # * Bio::KEGG::API#get_all_genes_by_motifs(motif_id_list) + # * Bio::KEGG::API#get_all_oc_members_by_gene(genes_id) + # * Bio::KEGG::API#get_all_pc_members_by_gene(genes_id) + # * Bio::KEGG::API#get_all_genes_by_organism(org) + # + # These methods are wrapper for the methods without _all_ in its name + # and internally iterate to retrive all the results using start/max_results + # value pairs described above. For example, + # + # #!/usr/bin/env ruby + # + # require 'soap/wsdlDriver' + # + # wsdl = "http://soap.genome.jp/KEGG.wsdl" + # serv = SOAP::WSDLDriverFactory.new(wsdl).create_driver + # serv.generate_explicit_type = true + # + # start = 1 + # max_results = 100 + # + # loop do + # results = serv.get_best_neighbors_by_gene('eco:b0002', start, max_results) + # break unless results # when no more results returned + # results.each do |hit| + # print hit.genes_id1, "\t", hit.genes_id2, "\t", hit.sw_score, "\n" + # end + # start += max_results + # end + # + # can be witten as + # + # #!/usr/bin/env ruby + # + # require 'bio' + # + # serv = Bio::KEGG::API.new + # + # results = serv.get_all_best_neighbors_by_gene('eco:b0002') + # results.each do |hit| + # print hit.genes_id1, "\t", hit.genes_id2, "\t", hit.sw_score, "\n" + # end + # + # + # * Bio::KEGG::API#save_image(url, filename = nil) + # + # Some methods of the KEGG API will return a URL of the generated image. + # This method save an image specified by the URL. The filename can be + # specified by its second argument, otherwise basename of the URL will + # be used. + # + # #!/usr/bin/env ruby + # + # require 'bio' + # + # serv = Bio::KEGG::API.new("http://soap.genome.jp/v3.0/KEGG.wsdl") + # + # list = ["eco:b1002", "eco:b2388"] + # url = serv.mark_pathway_by_objects("path:eco00010", list) + # + # # Save with the original filename (eco00010.gif in this case) + # serv.save_image(url) + # + # # or save as "save_image.gif" + # serv.save_image(url, "save_image.gif") + # + # * Bio::KEGG::API#get_entries(entry_id_list) + # * Bio::KEGG::API#get_aaseqs(entry_id_list) + # * Bio::KEGG::API#get_naseqs(entry_id_list) + # * Bio::KEGG::API#get_definitions(entry_id_list) + # + # These methods are for the shortcut and backward compatibility + # (these methods existed in the older version of the KEGG API). + # class API < Bio::SOAPWSDL SERVER_URI = "http://soap.genome.jp/KEGG.wsdl" + # Connect to the KEGG API's SOAP server. A WSDL file will be automatically + # downloaded and parsed to generate the SOAP client driver. The default URL + # for the WSDL is http://soap.genome.jp/KEGG.wsdl but it can be changed by + # the argument or by wsdl= method. def initialize(wsdl = nil) @wsdl = wsdl || SERVER_URI *************** *** 40,44 **** create_driver end ! attr_accessor :start, :max_results def method_missing(*arg) --- 201,215 ---- create_driver end ! ! # Returns current value for the 'start' count for the methods having ! # start/max_results argument pairs or changes the default value for ! # the 'start' count. ! attr_accessor :start ! ! # Returns current value for the 'max_results' number for the methods having ! # start/max_results argument pairs or changes the default value for the ! # 'max_results' count. If your request timeouts, try smaller value for ! # the max_results. ! attr_accessor :max_results def method_missing(*arg) *************** *** 52,55 **** --- 223,227 ---- end + # def get_all_neighbors_by_gene(genes_id, org) # get_all(:get_neighbors_by_gene, genes_id, org) *************** *** 202,206 **** # serv.log = STDERR ! puts "--- parameters" puts " wsdl : #{serv.wsdl}" puts " log : #{serv.log}" --- 374,378 ---- # serv.log = STDERR ! puts "# * parameters" puts " wsdl : #{serv.wsdl}" puts " log : #{serv.log}" *************** *** 254,270 **** puts serv.btit("eco:b0002 eco:b0003") ! puts "--- get_entries(['eco:b0002', 'eco:b0003'])" puts serv.get_entries(["eco:b0002", "eco:b0003"]) ! puts "--- get_aaseqs(['eco:b0002', 'eco:b0003'])" puts serv.get_aaseqs(["eco:b0002", "eco:b0003"]) ! puts "--- get_naseqs(['eco:b0002', 'eco:b0003'])" puts serv.get_naseqs(["eco:b0002", "eco:b0003"]) ! puts "--- get_definitions(['eco:b0002', 'eco:b0003'])" puts serv.get_definitions(["eco:b0002", "eco:b0003"]) ! puts "--- get_definitions(('eco:b0001'..'eco:b0200').to_a)" puts serv.get_definitions(("eco:b0001".."eco:b0200").to_a) --- 426,442 ---- puts serv.btit("eco:b0002 eco:b0003") ! puts "# * get_entries(['eco:b0002', 'eco:b0003'])" puts serv.get_entries(["eco:b0002", "eco:b0003"]) ! puts "# * get_aaseqs(['eco:b0002', 'eco:b0003'])" puts serv.get_aaseqs(["eco:b0002", "eco:b0003"]) ! puts "# * get_naseqs(['eco:b0002', 'eco:b0003'])" puts serv.get_naseqs(["eco:b0002", "eco:b0003"]) ! puts "# * get_definitions(['eco:b0002', 'eco:b0003'])" puts serv.get_definitions(["eco:b0002", "eco:b0003"]) ! puts "# * get_definitions(('eco:b0001'..'eco:b0200').to_a)" puts serv.get_definitions(("eco:b0001".."eco:b0200").to_a) *************** *** 277,281 **** end ! puts "--- get_all_linkdb_by_entry('eco:b0002', 'pathway')" list = serv.get_all_linkdb_by_entry("eco:b0002", "pathway") list.each do |link| --- 449,453 ---- end ! puts "# * get_all_linkdb_by_entry('eco:b0002', 'pathway')" list = serv.get_all_linkdb_by_entry("eco:b0002", "pathway") list.each do |link| *************** *** 291,295 **** end ! puts "--- get_all_neighbors_by_gene('eco:b0002', 'bsu')" list = serv.get_all_neighbors_by_gene("eco:b0002", "bsu") list.each do |hit| --- 463,467 ---- end ! puts "# * get_all_neighbors_by_gene('eco:b0002', 'bsu')" list = serv.get_all_neighbors_by_gene("eco:b0002", "bsu") list.each do |hit| *************** *** 303,307 **** end ! puts "--- get_all_best_best_neighbors_by_gene('eco:b0002')" list = serv.get_all_best_best_neighbors_by_gene("eco:b0002") list.each do |hit| --- 475,479 ---- end ! puts "# * get_all_best_best_neighbors_by_gene('eco:b0002')" list = serv.get_all_best_best_neighbors_by_gene("eco:b0002") list.each do |hit| *************** *** 315,319 **** end ! puts "--- get_all_best_neighbors_by_gene('eco:b0002')" list = serv.get_all_best_neighbors_by_gene("eco:b0002") list.each do |hit| --- 487,491 ---- end ! puts "# * get_all_best_neighbors_by_gene('eco:b0002')" list = serv.get_all_best_neighbors_by_gene("eco:b0002") list.each do |hit| *************** *** 327,331 **** end ! puts "--- get_all_reverse_best_neighbors_by_gene('eco:b0002')" list = serv.get_all_reverse_best_neighbors_by_gene("eco:b0002") list.each do |hit| --- 499,503 ---- end ! puts "# * get_all_reverse_best_neighbors_by_gene('eco:b0002')" list = serv.get_all_reverse_best_neighbors_by_gene("eco:b0002") list.each do |hit| *************** *** 339,343 **** end ! puts "--- get_all_paralogs_by_gene('eco:b0002')" list = serv.get_all_paralogs_by_gene("eco:b0002") list.each do |hit| --- 511,515 ---- end ! puts "# * get_all_paralogs_by_gene('eco:b0002')" list = serv.get_all_paralogs_by_gene("eco:b0002") list.each do |hit| *************** *** 393,397 **** list = serv.get_motifs_by_gene("eco:b0002", "all") list.each do |motif| ! puts "--- motif result" puts " motif_id : #{motif.motif_id}" puts " definition : #{motif.definition}" --- 565,569 ---- list = serv.get_motifs_by_gene("eco:b0002", "all") list.each do |motif| ! puts "# * motif result" puts " motif_id : #{motif.motif_id}" puts " definition : #{motif.definition}" *************** *** 409,413 **** end ! puts "--- get_all_genes_by_motifs(['pf:ACT', 'ps:ASPARTOKINASE'])" list = serv.get_all_genes_by_motifs(["pf:ACT", "ps:ASPARTOKINASE"]) list.each do |gene| --- 581,585 ---- end ! puts "# * get_all_genes_by_motifs(['pf:ACT', 'ps:ASPARTOKINASE'])" list = serv.get_all_genes_by_motifs(["pf:ACT", "ps:ASPARTOKINASE"]) list.each do |gene| *************** *** 435,439 **** end ! puts "--- get_all_oc_members_by_gene('eco:b0002')" list = serv.get_all_oc_members_by_gene("eco:b0002") list.each do |gene| --- 607,611 ---- end ! puts "# * get_all_oc_members_by_gene('eco:b0002')" list = serv.get_all_oc_members_by_gene("eco:b0002") list.each do |gene| *************** *** 447,451 **** end ! puts "--- get_all_pc_members_by_gene('eco:b0002')" list = serv.get_all_pc_members_by_gene("eco:b0002") list.each do |gene| --- 619,623 ---- end ! puts "# * get_all_pc_members_by_gene('eco:b0002')" list = serv.get_all_pc_members_by_gene("eco:b0002") list.each do |gene| *************** *** 473,477 **** puts url ! #puts "--- save_image(#{url})" #filename = serv.save_image(url, "test.gif") #filename = serv.save_image(url) --- 645,649 ---- puts url ! #puts "# * save_image(#{url})" #filename = serv.save_image(url, "test.gif") #filename = serv.save_image(url) *************** *** 618,622 **** end ! puts "--- get_all_genes_by_organism('mge')" list = serv.get_all_genes_by_organism("mge") list.each do |gene| --- 790,794 ---- end ! puts "# * get_all_genes_by_organism('mge')" list = serv.get_all_genes_by_organism("mge") list.each do |gene| *************** *** 631,864 **** end - - =begin - - = Bio::KEGG::API - - KEGG API is a web service to use KEGG system via SOAP/WSDL. For more - informations on KEGG API, see the following site and its reference manual. - - * (()) - - --- Bio::KEGG::API.new(wsdl = nil) - - Connect to the KEGG API's SOAP server. A WSDL file will be automatically - downloaded and parsed to generate the SOAP client driver. The default URL - for the WSDL is http://soap.genome.jp/KEGG.wsdl but it can be changed by - the argument or by wsdl= method. - - --- Bio::KEGG::API#wsdl - - Returns URL of the current WSDL file. - - --- Bio::KEGG::API#wsdl=(url) - - Change the URL for WSDL file of the KEGG API if needed for some reason: - - serv = Bio::KEGG::API.new("http://133.103.100.186/KEGG.wsdl") - - or - - serv = Bio::KEGG::API.new - serv.wsdl = "http://133.103.100.186/KEGG.wsdl" - - note that both can't read two or more different WSDL files. - - --- Bio::KEGG::API#log - - Returns current logging IO. - - --- Bio::KEGG::API#log=(io) - - Change the IO for logging. The argument is passed to wiredump_dev method - of the SOAP4R, thus - - serv = Bio::KEGG::API.new - serv.log = STDERR - - will print all the SOAP transactions in standard error. - This feature is especially useful for debug. - - --- Bio::KEGG::API#start - - Returns current value for the 'start' count for the methods having - start/max_results argument pairs. - - --- Bio::KEGG::API#start=(number) - - Changes the default value for the 'start' count. - - --- Bio::KEGG::API#max_results - - Returns current value for the 'max_results' number for the methods having - start/max_results argument pairs. - - --- Bio::KEGG::API#max_results=(number) - - Changes the default value for the 'max_results' count. - If your request timeouts, try smaller value for the max_results. - - === KEGG API methods implemented only in BioRuby - - In BioRuby, returned values are added filter method to pick up - values in a complex data type as an array. - - #!/usr/bin/env ruby - - require 'bio' - - serv = Bio::KEGG::API.new - results = serv.get_best_neighbors_by_gene("eco:b0002", "bsu") - - # case 0 : without filter - results.each do |hit| - print hit.genes_id1, "\t", hit.genes_id2, "\t", hit.sw_score, "\n" - end - - # case 1 : select gene names and SW score only - fields = [:genes_id1, :genes_id2, :sw_score] - results.each do |hit| - puts hit.filter(fields).join("\t") - end - - # case 2 : also uses aligned position in each amino acid sequence etc. - fields1 = [:genes_id1, :start_position1, :end_position1, :best_flag_1to2] - fields2 = [:genes_id2, :start_position2, :end_position2, :best_flag_2to1] - results.each do |hit| - print "> score: ", hit.sw_score, ", identity: ", hit.identity, "\n" - print "1:\t", hit.filter(fields1).join("\t"), "\n" - print "2:\t", hit.filter(fields2).join("\t"), "\n" - end - - Using filter method will make it easy to change fields to select and - keep the script clean. - - - --- Bio::KEGG::API#get_all_neighbors_by_gene(genes_id, org) - --- Bio::KEGG::API#get_all_best_best_neighbors_by_gene(genes_id) - --- Bio::KEGG::API#get_all_best_neighbors_by_gene(genes_id) - --- Bio::KEGG::API#get_all_reverse_best_neighbors_by_gene(genes_id) - --- Bio::KEGG::API#get_all_paralogs_by_gene(genes_id) - --- Bio::KEGG::API#get_all_genes_by_motifs(motif_id_list) - --- Bio::KEGG::API#get_all_oc_members_by_gene(genes_id) - --- Bio::KEGG::API#get_all_pc_members_by_gene(genes_id) - --- Bio::KEGG::API#get_all_genes_by_organism(org) - - These methods are wrapper for the methods without _all_ in its name - and internally iterate to retrive all the results using start/max_results - value pairs described above. For example, - - #!/usr/bin/env ruby - - require 'soap/wsdlDriver' - - wsdl = "http://soap.genome.jp/KEGG.wsdl" - serv = SOAP::WSDLDriverFactory.new(wsdl).create_driver - serv.generate_explicit_type = true - - start = 1 - max_results = 100 - - loop do - results = serv.get_best_neighbors_by_gene('eco:b0002', start, max_results) - break unless results # when no more results returned - results.each do |hit| - print hit.genes_id1, "\t", hit.genes_id2, "\t", hit.sw_score, "\n" - end - start += max_results - end - - can be witten as - - #!/usr/bin/env ruby - - require 'bio' - - serv = Bio::KEGG::API.new - - results = serv.get_all_best_neighbors_by_gene('eco:b0002') - results.each do |hit| - print hit.genes_id1, "\t", hit.genes_id2, "\t", hit.sw_score, "\n" - end - - - --- Bio::KEGG::API#save_image(url, filename = nil) - - Some methods of the KEGG API will return a URL of the generated image. - This method save an image specified by the URL. The filename can be - specified by its second argument, otherwise basename of the URL will - be used. - - #!/usr/bin/env ruby - - require 'bio' - - serv = Bio::KEGG::API.new("http://soap.genome.jp/v3.0/KEGG.wsdl") - - list = ["eco:b1002", "eco:b2388"] - url = serv.mark_pathway_by_objects("path:eco00010", list) - - # Save with the original filename (eco00010.gif in this case) - serv.save_image(url) - - # or save as "save_image.gif" - serv.save_image(url, "save_image.gif") - - --- Bio::KEGG::API#get_entries(entry_id_list) - --- Bio::KEGG::API#get_aaseqs(entry_id_list) - --- Bio::KEGG::API#get_naseqs(entry_id_list) - --- Bio::KEGG::API#get_definitions(entry_id_list) - - For the shortcut and backward compatibility. - - - === General KEGG API methods - - For the methods listed below, consult the KEGG API manual at - - * (()) - - --- list_databases - --- list_organisms - --- list_pathways(org) - --- binfo(string) - --- bget(string) - --- bfind(string) - --- btit(string) - --- get_linkdb_by_entry(entry_id, db, start, max_results) - #--- get_neighbors_by_gene(genes_id, org, start, max_results) - --- get_best_best_neighbors_by_gene(genes_id, start, max_results) - --- get_best_neighbors_by_gene(genes_id, start, max_results) - --- get_reverse_best_neighbors_by_gene(genes_id, start, max_results) - --- get_paralogs_by_gene(genes_id, start, max_results) - --- get_similarity_between_genes(genes_id1, genes_id2) - --- get_motifs_by_gene(genes_id, db) - --- get_genes_by_motifs(motif_id_list, start, max_results) - --- get_ko_by_gene(genes_id) - --- get_ko_members(ko_id) - --- get_oc_members_by_gene(genes_id, start, max_results) - --- get_pc_members_by_gene(genes_id, start, max_results) - --- mark_pathway_by_objects(pathway_id, object_id_list) - --- color_pathway_by_objects(pathway_id, object_id_list, fg_color_list, bg_color_list) - --- get_genes_by_pathway(pathway_id) - --- get_enzymes_by_pathway(pathway_id) - --- get_compounds_by_pathway(pathway_id) - --- get_reactions_by_pathway(pathway_id) - --- get_pathways_by_genes(genes_id_list) - --- get_pathways_by_enzymes(enzyme_id_list) - --- get_pathways_by_compounds(compound_id_list) - --- get_pathways_by_reactions(reaction_id_list) - --- get_linked_pathways(pathway_id) - --- get_genes_by_enzyme(enzyme_id, org) - --- get_enzymes_by_gene(genes_id) - --- get_enzymes_by_compound(compound_id) - --- get_enzymes_by_reaction(reaction_id) - --- get_compounds_by_enzyme(enzyme_id) - --- get_compounds_by_reaction(reaction_id) - --- get_reactions_by_enzyme(enzyme_id) - --- get_reactions_by_compound(compound_id) - --- get_genes_by_organism(org, start, max_results) - --- get_number_of_genes_by_organism(org) - - =end - --- 803,804 ---- From k at dev.open-bio.org Tue Sep 19 05:46:24 2006 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Tue, 19 Sep 2006 05:46:24 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/io higet.rb,1.2,1.3 Message-ID: <200609190546.k8J5kO59031430@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/io In directory dev.open-bio.org:/tmp/cvs-serv31426/lib/bio/io Modified Files: higet.rb Log Message: * changed from LGPL to Ruby's Index: higet.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/io/higet.rb,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** higet.rb 26 Sep 2005 13:00:08 -0000 1.2 --- higet.rb 19 Sep 2006 05:46:22 -0000 1.3 *************** *** 1,22 **** # ! # bio/io/higet.rb - SOAP interface for HGC HiGet ! # ! # Copyright (C) 2005 KATAYAMA Toshiaki ! # ! # This library is free software; you can redistribute it and/or ! # modify it under the terms of the GNU Lesser General Public ! # License as published by the Free Software Foundation; either ! # version 2 of the License, or (at your option) any later version. ! # ! # This library is distributed in the hope that it will be useful, ! # but WITHOUT ANY WARRANTY; without even the implied warranty of ! # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! # Lesser General Public License for more details. # ! # You should have received a copy of the GNU Lesser General Public ! # License along with this library; if not, write to the Free Software ! # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # ! # $Id$ # --- 1,8 ---- # ! # = bio/io/higet.rb - SOAP interface for HGC HiGet # ! # Copyright:: Copyright (C) 2005 Toshiaki Katayama # ! # $Id$ # *************** *** 26,29 **** --- 12,24 ---- class HGC + # == Description + # + # Interface for the HiGet service provided by Human Genome Center (HGC), Japan. + # HiGet performs full-text search against various biological databases. + # + # == References + # + # * http://higet.hgc.jp/ + # class HiGet < Bio::SOAPWSDL *************** *** 77,92 **** end - - =begin - - = Bio::HGC::HiGet - - * (()) - - == HiGet#hifind - == HiGet#higet - == HiGet#higet_in_fasta - == HiGet#higet_in_xml - - =end - --- 72,73 ---- From k at dev.open-bio.org Tue Sep 19 05:47:54 2006 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Tue, 19 Sep 2006 05:47:54 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/io pubmed.rb,1.14,1.15 Message-ID: <200609190547.k8J5lsL4031491@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/io In directory dev.open-bio.org:/tmp/cvs-serv31487/lib/bio/io Modified Files: pubmed.rb Log Message: * changed from LGPL to Ruby's * minor change of doc format Index: pubmed.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/io/pubmed.rb,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** pubmed.rb 14 Jul 2006 14:48:56 -0000 1.14 --- pubmed.rb 19 Sep 2006 05:47:52 -0000 1.15 *************** *** 1,23 **** # ! # bio/io/pubmed.rb - NCBI Entrez/PubMed client module ! # ! # Copyright (C) 2001 KATAYAMA Toshiaki ! # 2006 Jan Aerts ! # ! # This library is free software; you can redistribute it and/or ! # modify it under the terms of the GNU Lesser General Public ! # License as published by the Free Software Foundation; either ! # version 2 of the License, or (at your option) any later version. ! # ! # This library is distributed in the hope that it will be useful, ! # but WITHOUT ANY WARRANTY; without even the implied warranty of ! # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! # Lesser General Public License for more details. # ! # You should have received a copy of the GNU Lesser General Public ! # License along with this library; if not, write to the Free Software ! # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # ! # $Id$ # --- 1,10 ---- # ! # = bio/io/pubmed.rb - NCBI Entrez/PubMed client module # ! # Copyright:: Copyright (C) 2001 Toshiaki Katayama ! # Copyright:: Copyright (C) 2006 Jan Aerts ! # License:: Ruby's # ! # $Id$ # *************** *** 28,203 **** module Bio ! # = DESCRIPTION ! # The Bio::PubMed class provides several ways to retrieve bibliographic ! # information from the PubMed database at ! # http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=PubMed. Basically, two ! # types of queries are possible: ! # * searching for PubMed IDs given a query string: ! # * Bio::PubMed#search ! # * Bio::PubMed#esearch ! # * retrieving the MEDLINE text (i.e. authors, journal, abstract, ...) given a PubMed ID ! # * Bio::PubMed#query ! # * Bio::PubMed#pmfetch ! # * Bio::PubMed#efetch ! # ! # The different methods within the same group are interchangeable and should ! # return the same result. ! # ! # Additional information about the MEDLINE format and PubMed programmable ! # APIs can be found on the following websites: ! # * Overview: http://www.ncbi.nlm.nih.gov/entrez/query/static/overview.html ! # * How to link: http://www.ncbi.nlm.nih.gov/entrez/query/static/linking.html ! # * MEDLINE format: http://www.ncbi.nlm.nih.gov/entrez/query/static/help/pmhelp.html#MEDLINEDisplayFormat ! # * Search field descriptions and tags: http://www.ncbi.nlm.nih.gov/entrez/query/static/help/pmhelp.html#SearchFieldDescriptionsandTags ! # * Entrez utilities index: http://www.ncbi.nlm.nih.gov/entrez/utils/utils_index.html ! # * PmFetch CGI help: http://www.ncbi.nlm.nih.gov/entrez/utils/pmfetch_help.html ! # * E-Utilities CGI help: http://eutils.ncbi.nlm.nih.gov/entrez/query/static/eutils_help.html ! # ! # = USAGE ! # require 'bio' ! # ! # # If you don't know the pubmed ID: ! # Bio::PubMed.search("(genome AND analysis) OR bioinformatics)").each do |x| ! # p x ! # end ! # Bio::PubMed.esearch("(genome AND analysis) OR bioinformatics)").each do |x| ! # p x ! # end ! # ! # # To retrieve the MEDLINE entry for a given PubMed ID: ! # puts Bio::PubMed.query("10592173") ! # puts Bio::PubMed.pmfetch("10592173") ! # puts Bio::PubMed.efetch("10592173", "14693808") ! # # This can be converted into a Bio::MEDLINE object: ! # manuscript = Bio::PubMed.query("10592173") ! # medline = Bio::MEDLINE(manuscript) ! # ! # = REMARK ! # This class can not be used at the moment if you're behind a proxy server. This will be solved in the near future. ! class PubMed ! # Search the PubMed database by given keywords using entrez query and returns ! # an array of PubMed IDs. ! # --- ! # *Arguments*: ! # * _id_: query string (required) ! # *Returns*:: array of PubMed IDs ! def self.search(str) ! host = "www.ncbi.nlm.nih.gov" ! path = "/entrez/query.fcgi?tool=bioruby&cmd=Search&doptcmdl=MEDLINE&db=PubMed&term=" ! http = Bio::Command.new_http(host) ! response, = http.get(path + CGI.escape(str)) ! result = response.body ! result = result.gsub("\r", "\n").squeeze("\n") ! result = result.scan(/
(.*?)<\/pre>/m).flatten
!       return result
!     end
  
!     # Search the PubMed database by given keywords using E-Utils and returns 
!     # an array of PubMed IDs.
!     # 
!     # For information on the possible arguments, see
!     # http://eutils.ncbi.nlm.nih.gov/entrez/query/static/esearch_help.html#PubMed
!     # ---
!     # *Arguments*:
!     # * _id_: query string (required)
!     # * _field_
!     # * _reldate_
!     # * _mindate_
!     # * _maxdate_
!     # * _datetype_
!     # * _retstart_
!     # * _retmax_ (default 100)
!     # * _retmode_
!     # * _rettype_
!     # *Returns*:: array of PubMed IDs
!     def self.esearch(str, hash = {})
!       hash['retmax'] = 100 unless hash['retmax']
  
!       opts = []
!       hash.each do |k, v|
!         opts << "#{k}=#{v}"
!       end
  
!       host = "eutils.ncbi.nlm.nih.gov"
!       path = "/entrez/eutils/esearch.fcgi?tool=bioruby&db=pubmed&#{opts.join('&')}&term="
  
!       http = Bio::Command.new_http(host)
!       response, = http.get(path + CGI.escape(str))
!       result = response.body
!       result = result.scan(/(.*?)<\/Id>/m).flatten
!       return result
!     end
  
!     # Retrieve PubMed entry by PMID and returns MEDLINE formatted string using
!     # entrez query.
!     # ---
!     # *Arguments*:
!     # * _id_: PubMed ID (required)
!     # *Returns*:: MEDLINE formatted String
!     def self.query(id)
!       host = "www.ncbi.nlm.nih.gov"
!       path = "/entrez/query.fcgi?tool=bioruby&cmd=Text&dopt=MEDLINE&db=PubMed&uid="
  
!       http = Bio::Command.new_http(host)
!       response, = http.get(path + id.to_s)
!       result = response.body
!       if result =~ /#{id}\s+Error/
!         raise( result )
!       else
!         result = result.gsub("\r", "\n").squeeze("\n").gsub(/<\/?pre>/, '')
!         return result
!       end
      end
  
!     # Retrieve PubMed entry by PMID and returns MEDLINE formatted string using
!     # entrez pmfetch.
!     # ---
!     # *Arguments*:
!     # * _id_: PubMed ID (required)
!     # *Returns*:: MEDLINE formatted String
!     def self.pmfetch(id)
!       host = "www.ncbi.nlm.nih.gov"
!       path = "/entrez/utils/pmfetch.fcgi?tool=bioruby&mode=text&report=medline&db=PubMed&id="
  
!       http = Bio::Command.new_http(host)
!       response, = http.get(path + id.to_s)
!       result = response.body
!       if result =~ /#{id}\s+Error/
!         raise( result )
!       else
!         result = result.gsub("\r", "\n").squeeze("\n").gsub(/<\/?pre>/, '')
!         return result
!       end
      end
  
!     # Retrieve PubMed entry by PMID and returns MEDLINE formatted string using
!     # entrez efetch. Multiple PubMed IDs can be provided:
!     #   Bio::PubMed.efetch(123)
!     #   Bio::PubMed.efetch(123,456,789)
!     #   Bio::PubMed.efetch([123,456,789])
!     # ---
!     # *Arguments*:
!     # * _ids_: list of PubMed IDs (required)
!     # *Returns*:: MEDLINE formatted String
!     def self.efetch(*ids)
!       return [] if ids.empty?
! 
!       host = "eutils.ncbi.nlm.nih.gov"
!       path = "/entrez/eutils/efetch.fcgi?tool=bioruby&db=pubmed&retmode=text&rettype=medline&id="
  
!       ids = ids.join(",")
  
!       http = Bio::Command.new_http(host)
!       response, = http.get(path + ids)
!       result = response.body
!       result = result.split(/\n\n+/)
!       return result
!     end
  
    end
  
! end
  
  
--- 15,194 ----
  module Bio
  
! # == Description
! #
! # The Bio::PubMed class provides several ways to retrieve bibliographic
! # information from the PubMed database at
! # http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=PubMed. Basically, two
! # types of queries are possible:
! #
! # * searching for PubMed IDs given a query string:
! #   * Bio::PubMed#search
! #   * Bio::PubMed#esearch
! #
! # * retrieving the MEDLINE text (i.e. authors, journal, abstract, ...)
! #   given a PubMed ID
! #   * Bio::PubMed#query
! #   * Bio::PubMed#pmfetch
! #   * Bio::PubMed#efetch
! #
! # The different methods within the same group are interchangeable and should
! # return the same result.
! # 
! # Additional information about the MEDLINE format and PubMed programmable
! # APIs can be found on the following websites:
! #
! # * Overview: http://www.ncbi.nlm.nih.gov/entrez/query/static/overview.html
! # * How to link: http://www.ncbi.nlm.nih.gov/entrez/query/static/linking.html
! # * MEDLINE format: http://www.ncbi.nlm.nih.gov/entrez/query/static/help/pmhelp.html#MEDLINEDisplayFormat
! # * Search field descriptions and tags: http://www.ncbi.nlm.nih.gov/entrez/query/static/help/pmhelp.html#SearchFieldDescriptionsandTags
! # * Entrez utilities index: http://www.ncbi.nlm.nih.gov/entrez/utils/utils_index.html
! # * PmFetch CGI help: http://www.ncbi.nlm.nih.gov/entrez/utils/pmfetch_help.html
! # * E-Utilities CGI help: http://eutils.ncbi.nlm.nih.gov/entrez/query/static/eutils_help.html
! #
! # == Usage
! #
! #   require 'bio'
! #
! #   # If you don't know the pubmed ID:
! #   Bio::PubMed.search("(genome AND analysis) OR bioinformatics)").each do |x|
! #     p x
! #   end
! #   Bio::PubMed.esearch("(genome AND analysis) OR bioinformatics)").each do |x|
! #     p x
! #   end
! #   
! #   # To retrieve the MEDLINE entry for a given PubMed ID:
! #   puts Bio::PubMed.query("10592173")
! #   puts Bio::PubMed.pmfetch("10592173")
! #   puts Bio::PubMed.efetch("10592173", "14693808")
! #   # This can be converted into a Bio::MEDLINE object:
! #   manuscript = Bio::PubMed.query("10592173")
! #   medline = Bio::MEDLINE(manuscript)
! #  
! class PubMed
  
!   # Search the PubMed database by given keywords using entrez query and returns
!   # an array of PubMed IDs.
!   # ---
!   # *Arguments*:
!   # * _id_: query string (required)
!   # *Returns*:: array of PubMed IDs
!   def self.search(str)
!     host = "www.ncbi.nlm.nih.gov"
!     path = "/entrez/query.fcgi?tool=bioruby&cmd=Search&doptcmdl=MEDLINE&db=PubMed&term="
  
!     http = Bio::Command.new_http(host)
!     response, = http.get(path + CGI.escape(str))
!     result = response.body
!     result = result.gsub("\r", "\n").squeeze("\n")
!     result = result.scan(/
(.*?)<\/pre>/m).flatten
!     return result
!   end
  
!   # Search the PubMed database by given keywords using E-Utils and returns 
!   # an array of PubMed IDs.
!   # 
!   # For information on the possible arguments, see
!   # http://eutils.ncbi.nlm.nih.gov/entrez/query/static/esearch_help.html#PubMed
!   # ---
!   # *Arguments*:
!   # * _id_: query string (required)
!   # * _field_
!   # * _reldate_
!   # * _mindate_
!   # * _maxdate_
!   # * _datetype_
!   # * _retstart_
!   # * _retmax_ (default 100)
!   # * _retmode_
!   # * _rettype_
!   # *Returns*:: array of PubMed IDs
!   def self.esearch(str, hash = {})
!     hash['retmax'] = 100 unless hash['retmax']
  
!     opts = []
!     hash.each do |k, v|
!       opts << "#{k}=#{v}"
!     end
  
!     host = "eutils.ncbi.nlm.nih.gov"
!     path = "/entrez/eutils/esearch.fcgi?tool=bioruby&db=pubmed&#{opts.join('&')}&term="
  
!     http = Bio::Command.new_http(host)
!     response, = http.get(path + CGI.escape(str))
!     result = response.body
!     result = result.scan(/(.*?)<\/Id>/m).flatten
!     return result
!   end
  
!   # Retrieve PubMed entry by PMID and returns MEDLINE formatted string using
!   # entrez query.
!   # ---
!   # *Arguments*:
!   # * _id_: PubMed ID (required)
!   # *Returns*:: MEDLINE formatted String
!   def self.query(id)
!     host = "www.ncbi.nlm.nih.gov"
!     path = "/entrez/query.fcgi?tool=bioruby&cmd=Text&dopt=MEDLINE&db=PubMed&uid="
  
!     http = Bio::Command.new_http(host)
!     response, = http.get(path + id.to_s)
!     result = response.body
!     if result =~ /#{id}\s+Error/
!       raise( result )
!     else
!       result = result.gsub("\r", "\n").squeeze("\n").gsub(/<\/?pre>/, '')
!       return result
      end
+   end
  
!   # Retrieve PubMed entry by PMID and returns MEDLINE formatted string using
!   # entrez pmfetch.
!   # ---
!   # *Arguments*:
!   # * _id_: PubMed ID (required)
!   # *Returns*:: MEDLINE formatted String
!   def self.pmfetch(id)
!     host = "www.ncbi.nlm.nih.gov"
!     path = "/entrez/utils/pmfetch.fcgi?tool=bioruby&mode=text&report=medline&db=PubMed&id="
  
!     http = Bio::Command.new_http(host)
!     response, = http.get(path + id.to_s)
!     result = response.body
!     if result =~ /#{id}\s+Error/
!       raise( result )
!     else
!       result = result.gsub("\r", "\n").squeeze("\n").gsub(/<\/?pre>/, '')
!       return result
      end
+   end
  
!   # Retrieve PubMed entry by PMID and returns MEDLINE formatted string using
!   # entrez efetch. Multiple PubMed IDs can be provided:
!   #   Bio::PubMed.efetch(123)
!   #   Bio::PubMed.efetch(123,456,789)
!   #   Bio::PubMed.efetch([123,456,789])
!   # ---
!   # *Arguments*:
!   # * _ids_: list of PubMed IDs (required)
!   # *Returns*:: MEDLINE formatted String
!   def self.efetch(*ids)
!     return [] if ids.empty?
  
!     host = "eutils.ncbi.nlm.nih.gov"
!     path = "/entrez/eutils/efetch.fcgi?tool=bioruby&db=pubmed&retmode=text&rettype=medline&id="
  
!     ids = ids.join(",")
  
+     http = Bio::Command.new_http(host)
+     response, = http.get(path + ids)
+     result = response.body
+     result = result.split(/\n\n+/)
+     return result
    end
  
! end # PubMed
! 
! end # Bio
  
  



From k at dev.open-bio.org  Tue Sep 19 05:49:22 2006
From: k at dev.open-bio.org (Katayama Toshiaki)
Date: Tue, 19 Sep 2006 05:49:22 +0000
Subject: [BioRuby-cvs] bioruby/lib/bio/io sql.rb,1.4,1.5
Message-ID: <200609190549.k8J5nMjc031590@dev.open-bio.org>

Update of /home/repository/bioruby/bioruby/lib/bio/io
In directory dev.open-bio.org:/tmp/cvs-serv31586/lib/bio/io

Modified Files:
	sql.rb 
Log Message:
* changed to RDoc
* license is changed from LGPL to Ruby's


Index: sql.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/io/sql.rb,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** sql.rb	26 Sep 2005 13:04:28 -0000	1.4
--- sql.rb	19 Sep 2006 05:49:19 -0000	1.5
***************
*** 1,22 ****
  #
! # bio/io/sql.rb - BioSQL access module
! #
! #   Copyright (C) 2002 KATAYAMA Toshiaki 
! #
! #  This library is free software; you can redistribute it and/or
! #  modify it under the terms of the GNU Lesser General Public
! #  License as published by the Free Software Foundation; either
! #  version 2 of the License, or (at your option) any later version.
! #
! #  This library is distributed in the hope that it will be useful,
! #  but WITHOUT ANY WARRANTY; without even the implied warranty of
! #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
! #  Lesser General Public License for more details.
  #
! #  You should have received a copy of the GNU Lesser General Public
! #  License along with this library; if not, write to the Free Software
! #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
  #
! #  $Id$
  #
  
--- 1,9 ----
  #
! # = bio/io/sql.rb - BioSQL access module
  #
! # Copyright::  Copyright (C) 2002 Toshiaki Katayama 
! # License::    Ruby's
  #
! # $Id$
  #
  
***************
*** 31,321 ****
  module Bio
  
!   class SQL
  
!     def initialize(db = 'dbi:Mysql:biosql', user = nil, pass = nil)
!       @dbh = DBI.connect(db, user, pass)
!     end
  
!     def close
!       @dbh.disconnect
!     end
  
!     def fetch(accession)	# or display_id for fall back
!       query = "select * from bioentry where accession = ?"
!       entry = @dbh.execute(query, accession).fetch
!       return Sequence.new(@dbh, entry) if entry
  
!       query = "select * from bioentry where display_id = ?"
!       entry = @dbh.execute(query, accession).fetch
!       return Sequence.new(@dbh, entry) if entry
!     end
!     alias get_by_id fetch
  
  
!     # for lazy fetching
  
!     class Sequence
  
!       def initialize(dbh, entry)
!         @dbh = dbh
!         @bioentry_id = entry['bioentry_id']
!         @database_id = entry['biodatabase_id']
!         @entry_id = entry['display_id']
!         @accession = entry['accession']
!         @version = entry['entry_version']
!         @division = entry['division']
!       end
!       attr_reader :accession, :division, :entry_id, :version
  
  
!       def to_fasta
!         if seq = seq
!           return seq.to_fasta(@accession)
!         end
        end
  
!       def seq
!         query = "select * from biosequence where bioentry_id = ?"
!         row = @dbh.execute(query, @bioentry_id).fetch
!         return unless row
  
!         mol = row['molecule']
!         seq = row['biosequence_str']
  
!         case mol
!         when /.na/i			# 'dna' or 'rna'
!           Bio::Sequence::NA.new(seq)
!         else				# 'protein'
!           Bio::Sequence::AA.new(seq)
!         end
        end
  
!       def subseq(from, to)
!         length = to - from + 1
!         query = "select molecule, substring(biosequence_str, ?, ?) as subseq" +
!                 " from biosequence where bioentry_id = ?"
!         row = @dbh.execute(query, from, length, @bioentry_id).fetch
!         return unless row
  
!         mol = row['molecule']
!         seq = row['subseq']
  
!         case mol
!         when /.na/i			# 'dna' or 'rna'
!           Bio::Sequence::NA.new(seq)
!         else				# 'protein'
!           Bio::Sequence::AA.new(seq)
!         end
        end
  
  
!       def features
!         array = []
!         query = "select * from seqfeature where bioentry_id = ?"
!         @dbh.execute(query, @bioentry_id).fetch_all.each do |row|
!           next unless row
  
!           f_id = row['seqfeature_id']
!           k_id = row['seqfeature_key_id']
!           s_id = row['seqfeature_source_id']
!           rank = row['seqfeature_rank'].to_i - 1
  
!           # key : type (gene, CDS, ...)
!           type = feature_key(k_id)
  
!           # source : database (EMBL/GenBank/SwissProt)
!           database = feature_source(s_id)
  
!           # location : position
!           locations = feature_locations(f_id)
  
!           # qualifier
!           qualifiers = feature_qualifiers(f_id)
!   
!           # rank
!           array[rank] = Bio::Feature.new(type, locations, qualifiers)
!         end
!         return Bio::Features.new(array)
        end
  
  
!       def references
!         array = []
!         query = <<-END
!           select * from bioentry_reference, reference
!           where bioentry_id = ? and
!           bioentry_reference.reference_id = reference.reference_id
!         END
!         @dbh.execute(query, @bioentry_id).fetch_all.each do |row|
!           next unless row
  
!           hash = {
!             'start'	=> row['reference_start'],
!             'end'	=> row['reference_end'],
!             'journal'	=> row['reference_location'],
!             'title'	=> row['reference_title'],
!             'authors'	=> row['reference_authors'],
!             'medline'	=> row['reference_medline']
!           }
!           hash.default = ''
  
!           rank = row['reference_rank'].to_i - 1
!           array[rank] = hash
!         end
!         return array
        end
  
  
!       def comment
!         query = "select * from comment where bioentry_id = ?"
!         row = @dbh.execute(query, @bioentry_id).fetch
!         row ? row['comment_text'] : ''
!       end
! 
!       def comments
!         array = []
!         query = "select * from comment where bioentry_id = ?"
!         @dbh.execute(query, @bioentry_id).fetch_all.each do |row|
!           next unless row
!           rank = row['comment_rank'].to_i - 1
!           array[rank] = row['comment_text']
!         end
!         return array
!       end
  
!       def database
!         query = "select * from biodatabase where biodatabase_id = ?"
!         row = @dbh.execute(query, @database_id).fetch
!         row ? row['name'] : ''
        end
  
!       def date
!         query = "select * from bioentry_date where bioentry_id = ?"
!         row = @dbh.execute(query, @bioentry_id).fetch
!         row ? row['date'] : ''
!       end
  
!       def dblink
!         query = "select * from bioentry_direct_links where source_bioentry_id = ?"
!         row = @dbh.execute(query, @bioentry_id).fetch
!         row ? [row['dbname'], row['accession']] : []
!       end
  
!       def definition
!         query = "select * from bioentry_description where bioentry_id = ?"
!         row = @dbh.execute(query, @bioentry_id).fetch
!         row ? row['description'] : ''
!       end
  
!       def keyword
!         query = "select * from bioentry_keywords where bioentry_id = ?"
!         row = @dbh.execute(query, @bioentry_id).fetch
!         row ? row['keywords'] : ''
!       end
  
!       def taxonomy
!         query = <<-END
!           select full_lineage, common_name, ncbi_taxa_id
!           from bioentry_taxa, taxa
!           where bioentry_id = ? and bioentry_taxa.taxa_id = taxa.taxa_id
!         END
!         row = @dbh.execute(query, @bioentry_id).fetch
!         @lineage = row ? row['full_lineage'] : ''
!         @common_name = row ? row['common_name'] : ''
!         @ncbi_taxa_id = row ? row['ncbi_taxa_id'] : ''
!         row ? [@lineage, @common_name, @ncbi_taxa_id] : []
!       end
  
!       def lineage
!         taxonomy unless @lineage
!         return @lineage
!       end
  
!       def common_name
!         taxonomy unless @common_name
!         return @common_name
!       end
  
!       def ncbi_taxa_id
!         taxonomy unless @ncbi_taxa_id
!         return @ncbi_taxa_id
!       end
  
  
-       private
  
!       def feature_key(k_id)
!         query = "select * from seqfeature_key where seqfeature_key_id = ?"
!         row = @dbh.execute(query, k_id).fetch
!         row ? row['key_name'] : ''
!       end
  
!       def feature_source(s_id)
!         query = "select * from seqfeature_source where seqfeature_source_id = ?"
!         row = @dbh.execute(query, s_id).fetch
!         row ? row['source_name'] : ''
!       end
  
!       def feature_locations(f_id)
!         locations = []
!         query = "select * from seqfeature_location where seqfeature_id = ?"
!         @dbh.execute(query, f_id).fetch_all.each do |row|
!           next unless row
  
!           location = Bio::Location.new
!           location.strand = row['seq_strand']
!           location.from = row['seq_start']
!           location.to = row['seq_end']
  
!           xref = feature_locations_remote(row['seqfeature_location_id'])
!           location.xref_id = xref.shift unless xref.empty?
  
!           # just omit fuzzy location for now...
!           #feature_locations_qv(row['seqfeature_location_id'])
  
!           rank = row['location_rank'].to_i - 1
!           locations[rank] = location
!         end
!         return Bio::Locations.new(locations)
!       end
  
!       def feature_locations_remote(l_id)
!         query = "select * from remote_seqfeature_name where seqfeature_location_id = ?"
!         row = @dbh.execute(query, l_id).fetch
!         row ? [row['accession'], row['version']] : []
        end
  
!       def feature_locations_qv(l_id)
!         query = "select * from location_qualifier_value where seqfeature_location_id = ?"
!         row = @dbh.execute(query, l_id).fetch
!         row ? [row['qualifier_value'], row['slot_value']] : []
!       end
  
!       def feature_qualifiers(f_id)
!         qualifiers = []
!         query = "select * from seqfeature_qualifier_value where seqfeature_id = ?"
!         @dbh.execute(query, f_id).fetch_all.each do |row|
!           next unless row
  
!           key = feature_qualifiers_key(row['seqfeature_qualifier_id'])
!           value = row['qualifier_value']
!           qualifier = Bio::Feature::Qualifier.new(key, value)
  
!           rank = row['seqfeature_qualifier_rank'].to_i - 1
!           qualifiers[rank] = qualifier
!         end
!         return qualifiers.compact	# .compact is nasty hack for a while
!       end
  
!       def feature_qualifiers_key(q_id)
!         query = "select * from seqfeature_qualifier where seqfeature_qualifier_id = ?"
!         row = @dbh.execute(query, q_id).fetch
!         row ? row['qualifier_name'] : ''
        end
      end
  
    end
  
! end
  
  
--- 18,316 ----
  module Bio
  
! class SQL
  
!   def initialize(db = 'dbi:Mysql:biosql', user = nil, pass = nil)
!     @dbh = DBI.connect(db, user, pass)
!   end
  
!   def close
!     @dbh.disconnect
!   end
  
!   # Returns Bio::SQL::Sequence object.
!   def fetch(accession)	# or display_id for fall back
!     query = "select * from bioentry where accession = ?"
!     entry = @dbh.execute(query, accession).fetch
!     return Sequence.new(@dbh, entry) if entry
  
!     query = "select * from bioentry where display_id = ?"
!     entry = @dbh.execute(query, accession).fetch
!     return Sequence.new(@dbh, entry) if entry
!   end
!   alias get_by_id fetch
  
  
!   # for lazy fetching
  
!   class Sequence
  
!     def initialize(dbh, entry)
!       @dbh = dbh
!       @bioentry_id = entry['bioentry_id']
!       @database_id = entry['biodatabase_id']
!       @entry_id = entry['display_id']
!       @accession = entry['accession']
!       @version = entry['entry_version']
!       @division = entry['division']
!     end
!     attr_reader :accession, :division, :entry_id, :version
  
  
!     def to_fasta
!       if seq = seq
!         return seq.to_fasta(@accession)
        end
+     end
  
!     # Returns Bio::Sequence::NA or AA object.
!     def seq
!       query = "select * from biosequence where bioentry_id = ?"
!       row = @dbh.execute(query, @bioentry_id).fetch
!       return unless row
  
!       mol = row['molecule']
!       seq = row['biosequence_str']
  
!       case mol
!       when /.na/i			# 'dna' or 'rna'
!         Bio::Sequence::NA.new(seq)
!       else				# 'protein'
!         Bio::Sequence::AA.new(seq)
        end
+     end
  
!     # Returns Bio::Sequence::NA or AA object (by lazy fetching).
!     def subseq(from, to)
!       length = to - from + 1
!       query = "select molecule, substring(biosequence_str, ?, ?) as subseq" +
!               " from biosequence where bioentry_id = ?"
!       row = @dbh.execute(query, from, length, @bioentry_id).fetch
!       return unless row
  
!       mol = row['molecule']
!       seq = row['subseq']
  
!       case mol
!       when /.na/i			# 'dna' or 'rna'
!         Bio::Sequence::NA.new(seq)
!       else				# 'protein'
!         Bio::Sequence::AA.new(seq)
        end
+     end
  
  
!     # Returns Bio::Features object.
!     def features
!       array = []
!       query = "select * from seqfeature where bioentry_id = ?"
!       @dbh.execute(query, @bioentry_id).fetch_all.each do |row|
!         next unless row
  
!         f_id = row['seqfeature_id']
!         k_id = row['seqfeature_key_id']
!         s_id = row['seqfeature_source_id']
!         rank = row['seqfeature_rank'].to_i - 1
  
!         # key : type (gene, CDS, ...)
!         type = feature_key(k_id)
  
!         # source : database (EMBL/GenBank/SwissProt)
!         database = feature_source(s_id)
  
!         # location : position
!         locations = feature_locations(f_id)
  
!         # qualifier
!         qualifiers = feature_qualifiers(f_id)
! 
!         # rank
!         array[rank] = Bio::Feature.new(type, locations, qualifiers)
        end
+       return Bio::Features.new(array)
+     end
  
  
!     # Returns reference informations in Array of Hash (not Bio::Reference).
!     def references
!       array = []
!       query = <<-END
!         select * from bioentry_reference, reference
!         where bioentry_id = ? and
!         bioentry_reference.reference_id = reference.reference_id
!       END
!       @dbh.execute(query, @bioentry_id).fetch_all.each do |row|
!         next unless row
  
!         hash = {
!           'start'	=> row['reference_start'],
!           'end'	=> row['reference_end'],
!           'journal'	=> row['reference_location'],
!           'title'	=> row['reference_title'],
!           'authors'	=> row['reference_authors'],
!           'medline'	=> row['reference_medline']
!         }
!         hash.default = ''
  
!         rank = row['reference_rank'].to_i - 1
!         array[rank] = hash
        end
+       return array
+     end
  
  
!     # Returns the first comment.  For complete comments, use comments method.
!     def comment
!       query = "select * from comment where bioentry_id = ?"
!       row = @dbh.execute(query, @bioentry_id).fetch
!       row ? row['comment_text'] : ''
!     end
  
!     # Returns comments in an Array of Strings.
!     def comments
!       array = []
!       query = "select * from comment where bioentry_id = ?"
!       @dbh.execute(query, @bioentry_id).fetch_all.each do |row|
!         next unless row
!         rank = row['comment_rank'].to_i - 1
!         array[rank] = row['comment_text']
        end
+       return array
+     end
  
!     def database
!       query = "select * from biodatabase where biodatabase_id = ?"
!       row = @dbh.execute(query, @database_id).fetch
!       row ? row['name'] : ''
!     end
  
!     def date
!       query = "select * from bioentry_date where bioentry_id = ?"
!       row = @dbh.execute(query, @bioentry_id).fetch
!       row ? row['date'] : ''
!     end
  
!     def dblink
!       query = "select * from bioentry_direct_links where source_bioentry_id = ?"
!       row = @dbh.execute(query, @bioentry_id).fetch
!       row ? [row['dbname'], row['accession']] : []
!     end
  
!     def definition
!       query = "select * from bioentry_description where bioentry_id = ?"
!       row = @dbh.execute(query, @bioentry_id).fetch
!       row ? row['description'] : ''
!     end
  
!     def keyword
!       query = "select * from bioentry_keywords where bioentry_id = ?"
!       row = @dbh.execute(query, @bioentry_id).fetch
!       row ? row['keywords'] : ''
!     end
  
!     # Use lineage, common_name, ncbi_taxa_id methods to extract in detail.
!     def taxonomy
!       query = <<-END
!         select full_lineage, common_name, ncbi_taxa_id
!         from bioentry_taxa, taxa
!         where bioentry_id = ? and bioentry_taxa.taxa_id = taxa.taxa_id
!       END
!       row = @dbh.execute(query, @bioentry_id).fetch
!       @lineage = row ? row['full_lineage'] : ''
!       @common_name = row ? row['common_name'] : ''
!       @ncbi_taxa_id = row ? row['ncbi_taxa_id'] : ''
!       row ? [@lineage, @common_name, @ncbi_taxa_id] : []
!     end
  
!     def lineage
!       taxonomy unless @lineage
!       return @lineage
!     end
  
!     def common_name
!       taxonomy unless @common_name
!       return @common_name
!     end
  
+     def ncbi_taxa_id
+       taxonomy unless @ncbi_taxa_id
+       return @ncbi_taxa_id
+     end
  
  
!     private
  
!     def feature_key(k_id)
!       query = "select * from seqfeature_key where seqfeature_key_id = ?"
!       row = @dbh.execute(query, k_id).fetch
!       row ? row['key_name'] : ''
!     end
  
!     def feature_source(s_id)
!       query = "select * from seqfeature_source where seqfeature_source_id = ?"
!       row = @dbh.execute(query, s_id).fetch
!       row ? row['source_name'] : ''
!     end
  
!     def feature_locations(f_id)
!       locations = []
!       query = "select * from seqfeature_location where seqfeature_id = ?"
!       @dbh.execute(query, f_id).fetch_all.each do |row|
!         next unless row
  
!         location = Bio::Location.new
!         location.strand = row['seq_strand']
!         location.from = row['seq_start']
!         location.to = row['seq_end']
  
!         xref = feature_locations_remote(row['seqfeature_location_id'])
!         location.xref_id = xref.shift unless xref.empty?
  
!         # just omit fuzzy location for now...
!         #feature_locations_qv(row['seqfeature_location_id'])
  
!         rank = row['location_rank'].to_i - 1
!         locations[rank] = location
        end
+       return Bio::Locations.new(locations)
+     end
  
!     def feature_locations_remote(l_id)
!       query = "select * from remote_seqfeature_name where seqfeature_location_id = ?"
!       row = @dbh.execute(query, l_id).fetch
!       row ? [row['accession'], row['version']] : []
!     end
  
!     def feature_locations_qv(l_id)
!       query = "select * from location_qualifier_value where seqfeature_location_id = ?"
!       row = @dbh.execute(query, l_id).fetch
!       row ? [row['qualifier_value'], row['slot_value']] : []
!     end
  
!     def feature_qualifiers(f_id)
!       qualifiers = []
!       query = "select * from seqfeature_qualifier_value where seqfeature_id = ?"
!       @dbh.execute(query, f_id).fetch_all.each do |row|
!         next unless row
  
!         key = feature_qualifiers_key(row['seqfeature_qualifier_id'])
!         value = row['qualifier_value']
!         qualifier = Bio::Feature::Qualifier.new(key, value)
  
!         rank = row['seqfeature_qualifier_rank'].to_i - 1
!         qualifiers[rank] = qualifier
        end
+       return qualifiers.compact	# .compact is nasty hack for a while
      end
  
+     def feature_qualifiers_key(q_id)
+       query = "select * from seqfeature_qualifier where seqfeature_qualifier_id = ?"
+       row = @dbh.execute(query, q_id).fetch
+       row ? row['qualifier_name'] : ''
+     end
    end
  
! end # SQL
! 
! end # Bio
  
  
***************
*** 365,428 ****
  end
  
- 
- =begin
- 
- = Bio::SQL
- 
- --- Bio::SQL.new(db = 'dbi:Mysql:biosql', user = nil, pass = nil)
- 
- --- Bio::SQL.close
- 
- --- Bio::SQL#fetch(accession)
- 
-       Returns Bio::SQL::Sequence object.
- 
- == Bio::SQL::Sequence
- 
- --- Bio::SQL::Sequence.new(dbh, entry)
- 
- --- Bio::SQL::Sequence#accession -> String
- --- Bio::SQL::Sequence#comment -> String
- 
-       Returns the first comment.  For complete comments, use comments method.
- 
- --- Bio::SQL::Sequence#comments -> Array
- 
-       Returns comments in an Array of Strings.
- 
- --- Bio::SQL::Sequence#common_name -> String
- --- Bio::SQL::Sequence#database -> String
- --- Bio::SQL::Sequence#date -> String
- --- Bio::SQL::Sequence#dblink -> Array
- --- Bio::SQL::Sequence#definition -> String
- --- Bio::SQL::Sequence#division -> String
- --- Bio::SQL::Sequence#entry_id -> String
- 
- --- Bio::SQL::Sequence#features
- 
-       Returns Bio::Features object.
- 
- --- Bio::SQL::Sequence#keyword -> String
- --- Bio::SQL::Sequence#lineage -> String
- --- Bio::SQL::Sequence#ncbi_taxa_id -> String
- 
- --- Bio::SQL::Sequence#references -> Array
- 
-       Returns reference informations in Array of Hash (not Bio::Reference).
- 
- --- Bio::SQL::Sequence#seq
- 
-       Returns Bio::Sequence::NA or AA object.
- 
- --- Bio::SQL::Sequence#subseq(from, to)
- 
-       Returns Bio::Sequence::NA or AA object (by lazy fetching).
- 
- --- Bio::SQL::Sequence#taxonomy -> DBI::Row
- 
-       Use lineage, common_name, ncbi_taxa_id methods to extract in detail.
- 
- --- Bio::SQL::Sequence#version -> String
- 
- =end
- 
--- 360,361 ----



From k at dev.open-bio.org  Tue Sep 19 05:50:47 2006
From: k at dev.open-bio.org (Katayama Toshiaki)
Date: Tue, 19 Sep 2006 05:50:47 +0000
Subject: [BioRuby-cvs] bioruby/lib/bio/db/kegg brite.rb,0.6,0.7
Message-ID: <200609190550.k8J5ol6R031669@dev.open-bio.org>

Update of /home/repository/bioruby/bioruby/lib/bio/db/kegg
In directory dev.open-bio.org:/tmp/cvs-serv31665/lib/bio/db/kegg

Modified Files:
	brite.rb 
Log Message:
* license is changed from LGPL to Ruby's


Index: brite.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/kegg/brite.rb,v
retrieving revision 0.6
retrieving revision 0.7
diff -C2 -d -r0.6 -r0.7
*** brite.rb	8 Sep 2005 01:22:11 -0000	0.6
--- brite.rb	19 Sep 2006 05:50:45 -0000	0.7
***************
*** 1,22 ****
  #
! # bio/db/kegg/brite.rb - KEGG/BRITE database class
! #
! #   Copyright (C) 2001 KATAYAMA Toshiaki 
! #
! #  This library is free software; you can redistribute it and/or
! #  modify it under the terms of the GNU Lesser General Public
! #  License as published by the Free Software Foundation; either
! #  version 2 of the License, or (at your option) any later version.
! #
! #  This library is distributed in the hope that it will be useful,
! #  but WITHOUT ANY WARRANTY; without even the implied warranty of
! #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
! #  Lesser General Public License for more details.
  #
! #  You should have received a copy of the GNU Lesser General Public
! #  License along with this library; if not, write to the Free Software
! #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
  #
! #  $Id$
  #
  
--- 1,9 ----
  #
! # = bio/db/kegg/brite.rb - KEGG/BRITE database class
  #
! # Copyright::  Copyright (C) 2001 Toshiaki Katayama 
! # License::    Ruby's
  #
! # $Id$
  #
  
***************
*** 24,51 ****
  
  module Bio
  
!   class KEGG
! 
!     class BRITE < KEGGDB
! 
!       DELIMITER	= RS = "\n///\n"
!       TAGSIZE	= 12
  
!       def initialize(entry)
!         super(entry, TAGSIZE)
!       end
  
!       # ENTRY
!       # DEFINITION
!       # RELATION
!       # FACTORS
!       # INTERACTION
!       # SOURCE
!       # REFERENCE
  
!     end
  
!   end
  
! end
  
--- 11,41 ----
  
  module Bio
+ class KEGG
  
! # == Note
! #
! # This class is not completely implemented, but obsolete as the original
! # database BRITE has changed it's meaning.
! #
! class BRITE < KEGGDB
  
!   DELIMITER	= RS = "\n///\n"
!   TAGSIZE	= 12
  
!   def initialize(entry)
!     super(entry, TAGSIZE)
!   end
  
!   # ENTRY
!   # DEFINITION
!   # RELATION
!   # FACTORS
!   # INTERACTION
!   # SOURCE
!   # REFERENCE
  
! end # BRITE
  
! end # KEGG
! end # Bio
  



From k at dev.open-bio.org  Tue Sep 19 05:51:31 2006
From: k at dev.open-bio.org (Katayama Toshiaki)
Date: Tue, 19 Sep 2006 05:51:31 +0000
Subject: [BioRuby-cvs] bioruby/lib/bio/db/kegg compound.rb,0.11,0.12
Message-ID: <200609190551.k8J5pVOi031729@dev.open-bio.org>

Update of /home/repository/bioruby/bioruby/lib/bio/db/kegg
In directory dev.open-bio.org:/tmp/cvs-serv31725/lib/bio/db/kegg

Modified Files:
	compound.rb 
Log Message:
* license is changed from LGPL to Ruby's


Index: compound.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/kegg/compound.rb,v
retrieving revision 0.11
retrieving revision 0.12
diff -C2 -d -r0.11 -r0.12
*** compound.rb	8 Sep 2005 01:22:11 -0000	0.11
--- compound.rb	19 Sep 2006 05:51:29 -0000	0.12
***************
*** 1,22 ****
  #
! # bio/db/kegg/compound.rb - KEGG COMPOUND database class
! #
! #   Copyright (C) 2001, 2002, 2004 KATAYAMA Toshiaki 
! #
! #  This library is free software; you can redistribute it and/or
! #  modify it under the terms of the GNU Lesser General Public
! #  License as published by the Free Software Foundation; either
! #  version 2 of the License, or (at your option) any later version.
! #
! #  This library is distributed in the hope that it will be useful,
! #  but WITHOUT ANY WARRANTY; without even the implied warranty of
! #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
! #  Lesser General Public License for more details.
  #
! #  You should have received a copy of the GNU Lesser General Public
! #  License along with this library; if not, write to the Free Software
! #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
  #
! #  $Id$
  #
  
--- 1,9 ----
  #
! # = bio/db/kegg/compound.rb - KEGG COMPOUND database class
  #
! # Copyright::  Copyright (C) 2001, 2002, 2004 Toshiaki Katayama 
! # License::    Ruby's
  #
! # $Id$
  #
  
***************
*** 24,114 ****
  
  module Bio
  
!   class KEGG
! 
!     class COMPOUND < KEGGDB
! 
!       DELIMITER	= RS = "\n///\n"
!       TAGSIZE	= 12
! 
!       def initialize(entry)
!         super(entry, TAGSIZE)
!       end
  
!       # ENTRY
!       def entry_id
!         unless @data['ENTRY']
!           @data['ENTRY'] = fetch('ENTRY').split(/\s+/).first
!         end
!         @data['ENTRY']
!       end
  
!       # NAME
!       def names
!         lines_fetch('NAME') 
!       end
!       def name
!         names[0]
!       end
  
!       # FORMULA
!       def formula
!         field_fetch('FORMULA')
!       end
  
!       # MASS
!       def mass
!         field_fetch('MASS').to_f
!       end
  
!       # REACTION
!       def reactions
!         unless @data['REACTION']
!           @data['REACTION'] = fetch('REACTION').split(/\s+/)
!         end
!         @data['REACTION']
!       end
  
!       # RPAIR
!       def rpairs
!         unless @data['RPAIR']
!           @data['RPAIR'] = fetch('RPAIR').split(/\s+/)
!         end
!         @data['RPAIR']
!       end
  
!       # PATHWAY
!       def pathways
!         lines_fetch('PATHWAY') 
!       end
  
!       # ENZYME
!       def enzymes
!         unless @data['ENZYME']
!           field = fetch('ENZYME')
!           if /\(/.match(field)	# old version
!             @data['ENZYME'] = field.scan(/\S+ \(\S+\)/)
!           else
!             @data['ENZYME'] = field.scan(/\S+/)
!           end
!         end
!         @data['ENZYME']
!       end
  
!       # DBLINKS
!       def dblinks
!         lines_fetch('DBLINKS')
!       end
  
!       # ATOM, BOND
!       def kcf
!         return "#{get('ATOM')}#{get('BOND')}"
        end
- 
      end
  
    end
  
! end
  
  
--- 11,99 ----
  
  module Bio
+ class KEGG
  
! class COMPOUND < KEGGDB
  
!   DELIMITER	= RS = "\n///\n"
!   TAGSIZE	= 12
  
!   def initialize(entry)
!     super(entry, TAGSIZE)
!   end
  
!   # ENTRY
!   def entry_id
!     unless @data['ENTRY']
!       @data['ENTRY'] = fetch('ENTRY').split(/\s+/).first
!     end
!     @data['ENTRY']
!   end
  
!   # NAME
!   def names
!     lines_fetch('NAME') 
!   end
!   def name
!     names[0]
!   end
  
!   # FORMULA
!   def formula
!     field_fetch('FORMULA')
!   end
  
!   # MASS
!   def mass
!     field_fetch('MASS').to_f
!   end
  
!   # REACTION
!   def reactions
!     unless @data['REACTION']
!       @data['REACTION'] = fetch('REACTION').split(/\s+/)
!     end
!     @data['REACTION']
!   end
  
!   # RPAIR
!   def rpairs
!     unless @data['RPAIR']
!       @data['RPAIR'] = fetch('RPAIR').split(/\s+/)
!     end
!     @data['RPAIR']
!   end
  
!   # PATHWAY
!   def pathways
!     lines_fetch('PATHWAY') 
!   end
  
!   # ENZYME
!   def enzymes
!     unless @data['ENZYME']
!       field = fetch('ENZYME')
!       if /\(/.match(field)	# old version
!         @data['ENZYME'] = field.scan(/\S+ \(\S+\)/)
!       else
!         @data['ENZYME'] = field.scan(/\S+/)
        end
      end
+     @data['ENZYME']
+   end
+ 
+   # DBLINKS
+   def dblinks
+     lines_fetch('DBLINKS')
+   end
  
+   # ATOM, BOND
+   def kcf
+     return "#{get('ATOM')}#{get('BOND')}"
    end
  
! end # COMPOUND
! 
! end # KEGG
! end # Bio
  
  



From k at dev.open-bio.org  Tue Sep 19 05:52:07 2006
From: k at dev.open-bio.org (Katayama Toshiaki)
Date: Tue, 19 Sep 2006 05:52:07 +0000
Subject: [BioRuby-cvs] bioruby/lib/bio/db/kegg enzyme.rb,0.8,0.9
Message-ID: <200609190552.k8J5q73d031772@dev.open-bio.org>

Update of /home/repository/bioruby/bioruby/lib/bio/db/kegg
In directory dev.open-bio.org:/tmp/cvs-serv31768/lib/bio/db/kegg

Modified Files:
	enzyme.rb 
Log Message:
* license is changed from LGPL to Ruby's


Index: enzyme.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/kegg/enzyme.rb,v
retrieving revision 0.8
retrieving revision 0.9
diff -C2 -d -r0.8 -r0.9
*** enzyme.rb	8 Sep 2005 01:22:11 -0000	0.8
--- enzyme.rb	19 Sep 2006 05:52:05 -0000	0.9
***************
*** 1,22 ****
  #
! # bio/db/kegg/enzyme.rb - KEGG/ENZYME database class
! #
! #   Copyright (C) 2001, 2002 KATAYAMA Toshiaki 
! #
! #  This library is free software; you can redistribute it and/or
! #  modify it under the terms of the GNU Lesser General Public
! #  License as published by the Free Software Foundation; either
! #  version 2 of the License, or (at your option) any later version.
! #
! #  This library is distributed in the hope that it will be useful,
! #  but WITHOUT ANY WARRANTY; without even the implied warranty of
! #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
! #  Lesser General Public License for more details.
  #
! #  You should have received a copy of the GNU Lesser General Public
! #  License along with this library; if not, write to the Free Software
! #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
  #
! #  $Id$
  #
  
--- 1,9 ----
  #
! # = bio/db/kegg/enzyme.rb - KEGG/ENZYME database class
  #
! # Copyright::  Copyright (C) 2001, 2002 Toshiaki Katayama 
! # License::    Ruby's
  #
! # $Id$
  #
  
***************
*** 24,125 ****
  
  module Bio
  
!   class KEGG
! 
!     class ENZYME < KEGGDB
! 
!       DELIMITER	= RS = "\n///\n"
!       TAGSIZE	= 12
! 
!       def initialize(entry)
!         super(entry, TAGSIZE)
!       end
  
!       # ENTRY
!       def entry_id
!         field_fetch('ENTRY')
!       end
  
!       # NAME
!       def names
!         lines_fetch('NAME')
!       end
!       def name
!         names[0]
!       end
  
!       # CLASS
!       def classes
!         lines_fetch('CLASS')
!       end
  
!       # SYSNAME
!       def sysname
!         field_fetch('SYSNAME')
!       end
  
!       # REACTION ';'
!       def reaction
!         field_fetch('REACTION')
!       end
!       
!       # SUBSTRATE
!       def substrates
!         lines_fetch('SUBSTRATE')
!       end
  
!       # PRODUCT
!       def products
!         lines_fetch('PRODUCT')
!       end
  
!       # COFACTOR
!       def cofactors
!         lines_fetch('COFACTOR')
!       end
  
!       # COMMENT
!       def comment
!         field_fetch('COMMENT')
!       end
  
!       # PATHWAY
!       def pathways
!         lines_fetch('PATHWAY')
!       end
  
!       # GENES
!       def genes
!         lines_fetch('GENES')
!       end
  
!       # DISEASE
!       def diseases
!         lines_fetch('DISEASE')
!       end
  
!       # MOTIF
!       def motifs
!         lines_fetch('MOTIF')
!       end
  
!       # STRUCTURES
!       def structures
!         unless @data['STRUCTURES']
!           @data['STRUCTURES'] =
!             fetch('STRUCTURES').sub(/(PDB: )*/,'').split(/\s+/)
!         end
!         @data['STRUCTURES']
!       end
  
!       # DBLINKS
!       def dblinks
!         lines_fetch('DBLINKS')
!       end
  
      end
  
    end
  
! end
  
--- 11,110 ----
  
  module Bio
+ class KEGG
  
! class ENZYME < KEGGDB
  
!   DELIMITER	= RS = "\n///\n"
!   TAGSIZE	= 12
  
!   def initialize(entry)
!     super(entry, TAGSIZE)
!   end
  
!   # ENTRY
!   def entry_id
!     field_fetch('ENTRY')
!   end
  
!   # NAME
!   def names
!     lines_fetch('NAME')
!   end
!   def name
!     names[0]
!   end
  
!   # CLASS
!   def classes
!     lines_fetch('CLASS')
!   end
  
!   # SYSNAME
!   def sysname
!     field_fetch('SYSNAME')
!   end
  
!   # REACTION ';'
!   def reaction
!     field_fetch('REACTION')
!   end
!   
!   # SUBSTRATE
!   def substrates
!     lines_fetch('SUBSTRATE')
!   end
  
!   # PRODUCT
!   def products
!     lines_fetch('PRODUCT')
!   end
  
!   # COFACTOR
!   def cofactors
!     lines_fetch('COFACTOR')
!   end
  
!   # COMMENT
!   def comment
!     field_fetch('COMMENT')
!   end
  
!   # PATHWAY
!   def pathways
!     lines_fetch('PATHWAY')
!   end
  
!   # GENES
!   def genes
!     lines_fetch('GENES')
!   end
  
!   # DISEASE
!   def diseases
!     lines_fetch('DISEASE')
!   end
  
!   # MOTIF
!   def motifs
!     lines_fetch('MOTIF')
!   end
  
+   # STRUCTURES
+   def structures
+     unless @data['STRUCTURES']
+       @data['STRUCTURES'] =
+         fetch('STRUCTURES').sub(/(PDB: )*/,'').split(/\s+/)
      end
+     @data['STRUCTURES']
+   end
  
+   # DBLINKS
+   def dblinks
+     lines_fetch('DBLINKS')
    end
  
! end # ENZYME
! 
! end # KEGG
! end # Bio
  



From k at dev.open-bio.org  Tue Sep 19 05:52:47 2006
From: k at dev.open-bio.org (Katayama Toshiaki)
Date: Tue, 19 Sep 2006 05:52:47 +0000
Subject: [BioRuby-cvs] bioruby/lib/bio/db/kegg genome.rb,0.14,0.15
Message-ID: <200609190552.k8J5qlIc031815@dev.open-bio.org>

Update of /home/repository/bioruby/bioruby/lib/bio/db/kegg
In directory dev.open-bio.org:/tmp/cvs-serv31811/lib/bio/db/kegg

Modified Files:
	genome.rb 
Log Message:
* license is changed from LGPL to Ruby's
* document is changed to RDoc


Index: genome.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/kegg/genome.rb,v
retrieving revision 0.14
retrieving revision 0.15
diff -C2 -d -r0.14 -r0.15
*** genome.rb	8 Sep 2005 01:22:11 -0000	0.14
--- genome.rb	19 Sep 2006 05:52:45 -0000	0.15
***************
*** 1,22 ****
  #
! # bio/db/kegg/genome.rb - KEGG/GENOME database class
! #
! #   Copyright (C) 2001, 2002 KATAYAMA Toshiaki 
! #
! #  This library is free software; you can redistribute it and/or
! #  modify it under the terms of the GNU Lesser General Public
! #  License as published by the Free Software Foundation; either
! #  version 2 of the License, or (at your option) any later version.
! #
! #  This library is distributed in the hope that it will be useful,
! #  but WITHOUT ANY WARRANTY; without even the implied warranty of
! #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
! #  Lesser General Public License for more details.
  #
! #  You should have received a copy of the GNU Lesser General Public
! #  License along with this library; if not, write to the Free Software
! #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
  #
! #  $Id$
  #
  
--- 1,9 ----
  #
! # = bio/db/kegg/genome.rb - KEGG/GENOME database class
  #
! # Copyright::  Copyright (C) 2001, 2002 Toshiaki Katayama 
! # License::    Ruby's
  #
! # $Id$
  #
  
***************
*** 24,213 ****
  
  module Bio
  
!   class KEGG
! 
!     class GENOME < KEGGDB
  
!       DELIMITER	= RS = "\n///\n"
!       TAGSIZE	= 12
  
!       def initialize(entry)
!         super(entry, TAGSIZE)
!       end
  
  
!       # ENTRY
!       def entry_id
!         field_fetch('ENTRY')
!       end
!       
!       # NAME
!       def name
!         field_fetch('NAME')
!       end
  
!       # DEFINITION
!       def definition
!         field_fetch('DEFINITION')
!       end
!       alias organism definition
  
!       # TAXONOMY
!       def taxonomy
!         unless @data['TAXONOMY']
!           taxid, lineage = subtag2array(get('TAXONOMY'))
!           taxid   = taxid   ? truncate(tag_cut(taxid))   : ''
!           lineage = lineage ? truncate(tag_cut(lineage)) : ''
!           @data['TAXONOMY'] = {
!             'taxid'	=> taxid,
!             'lineage'	=> lineage,
!           }
!           @data['TAXONOMY'].default = ''
!         end
!         @data['TAXONOMY']
!       end
  
!       def taxid
!         taxonomy['taxid']
!       end
  
!       def lineage
!         taxonomy['lineage']
!       end
  
!       # COMMENT
!       def comment
!         field_fetch('COMMENT')
!       end
!       
!       # REFERENCE
!       def references
!         unless @data['REFERENCE']
!           ary = []
!           toptag2array(get('REFERENCE')).each do |ref|
!             hash = Hash.new('')
!             subtag2array(ref).each do |field|
!               case tag_get(field)
!               when /AUTHORS/
!                 authors = truncate(tag_cut(field))
!                 authors = authors.split(', ')
!                 authors[-1] = authors[-1].split(/\s+and\s+/)
!                 authors = authors.flatten.map { |a| a.sub(',', ', ') }
!                 hash['authors']	= authors
!               when /TITLE/
!                 hash['title']	= truncate(tag_cut(field))
!               when /JOURNAL/
!                 journal = truncate(tag_cut(field))
!                 if journal =~ /(.*) (\d+):(\d+)-(\d+) \((\d+)\) \[UI:(\d+)\]$/
!                   hash['journal']	= $1
!                   hash['volume']	= $2
!                   hash['pages']		= $3
!                   hash['year']		= $5
!                   hash['medline']	= $6
!                 else
!                   hash['journal'] = journal
!                 end
!               end
              end
-             ary.push(Reference.new(hash))
            end
-           @data['REFERENCE'] = References.new(ary)
          end
!         @data['REFERENCE']
        end
  
!       # CHROMOSOME
!       def chromosomes
!         unless @data['CHROMOSOME']
!           @data['CHROMOSOME'] = []
!           toptag2array(get('CHROMOSOME')).each do |chr|
!             hash = Hash.new('')
!             subtag2array(chr).each do |field|
!               hash[tag_get(field)] = truncate(tag_cut(field))
!             end
!             @data['CHROMOSOME'].push(hash)
!           end
          end
!         @data['CHROMOSOME']
        end
  
!       # PLASMID
!       def plasmids
!         unless @data['PLASMID']
!           @data['PLASMID'] = []
!           toptag2array(get('PLASMID')).each do |chr|
!             hash = Hash.new('')
!             subtag2array(chr).each do |field|
!               hash[tag_get(field)] = truncate(tag_cut(field))
!             end
!             @data['PLASMID'].push(hash)
!           end
          end
!         @data['PLASMID']
        end
  
!       # SCAFFOLD
!       def scaffolds
!         unless @data['SCAFFOLD']
!           @data['SCAFFOLD'] = []
!           toptag2array(get('SCAFFOLD')).each do |chr|
!             hash = Hash.new('')
!             subtag2array(chr).each do |field|
!               hash[tag_get(field)] = truncate(tag_cut(field))
!             end
!             @data['SCAFFOLD'].push(hash)
!           end
          end
!         @data['SCAFFOLD']
        end
  
!       # STATISTICS
!       def statistics
!         unless @data['STATISTICS']
!           hash = Hash.new(0.0)
!           get('STATISTICS').each_line do |line|
!             case line
!             when /nucleotides:\s+(\d+)/
!               hash['nalen'] = $1.to_i
!             when /protein genes:\s+(\d+)/
!               hash['num_gene'] = $1.to_i
!             when /RNA genes:\s+(\d+)/
!               hash['num_rna'] = $1.to_i
!             when /G\+C content:\s+(\d+.\d+)/
!               hash['gc'] = $1.to_f
!             end
!           end
!           @data['STATISTICS'] = hash
          end
-         @data['STATISTICS']
-       end
- 
-       def nalen
-         statistics['nalen']
        end
!       alias length nalen
  
!       def num_gene
!         statistics['num_gene']
!       end
  
!       def num_rna
!         statistics['num_rna']
!       end
  
!       def gc
!         statistics['gc']
!       end
  
!       # GENOMEMAP
!       def genomemap
!         field_fetch('GENOMEMAP')
!       end
  
!     end
!     
    end
  
! end
  
  
--- 11,214 ----
  
  module Bio
+ class KEGG
  
! # == Description
! #
! # Parser for the KEGG GENOME database
! #
! # == References
! #
! # * ftp://ftp.genome.jp/pub/kegg/genomes/genome
! #
! class GENOME < KEGGDB
  
!   DELIMITER	= RS = "\n///\n"
!   TAGSIZE	= 12
  
!   def initialize(entry)
!     super(entry, TAGSIZE)
!   end
  
  
!   # ENTRY -- Returns contents of the ENTRY record as a String.
!   def entry_id
!     field_fetch('ENTRY')
!   end
!   
!   # NAME -- Returns contents of the NAME record as a String.
!   def name
!     field_fetch('NAME')
!   end
  
!   # DEFINITION -- Returns contents of the DEFINITION record as a String.
!   def definition
!     field_fetch('DEFINITION')
!   end
!   alias organism definition
  
!   # TAXONOMY -- Returns contents of the TAXONOMY record as a Hash.
!   def taxonomy
!     unless @data['TAXONOMY']
!       taxid, lineage = subtag2array(get('TAXONOMY'))
!       taxid   = taxid   ? truncate(tag_cut(taxid))   : ''
!       lineage = lineage ? truncate(tag_cut(lineage)) : ''
!       @data['TAXONOMY'] = {
!         'taxid'	=> taxid,
!         'lineage'	=> lineage,
!       }
!       @data['TAXONOMY'].default = ''
!     end
!     @data['TAXONOMY']
!   end
  
!   # Returns NCBI taxonomy ID from the TAXONOMY record as a String.
!   def taxid
!     taxonomy['taxid']
!   end
  
!   # Returns contents of the TAXONOMY/LINEAGE record as a String.
!   def lineage
!     taxonomy['lineage']
!   end
  
!   # COMMENT -- Returns contents of the COMMENT record as a String.
!   def comment
!     field_fetch('COMMENT')
!   end
!   
!   # REFERENCE -- Returns contents of the REFERENCE records as an Array of
!   # Bio::Reference objects.
!   def references
!     unless @data['REFERENCE']
!       ary = []
!       toptag2array(get('REFERENCE')).each do |ref|
!         hash = Hash.new('')
!         subtag2array(ref).each do |field|
!           case tag_get(field)
!           when /AUTHORS/
!             authors = truncate(tag_cut(field))
!             authors = authors.split(', ')
!             authors[-1] = authors[-1].split(/\s+and\s+/)
!             authors = authors.flatten.map { |a| a.sub(',', ', ') }
!             hash['authors']	= authors
!           when /TITLE/
!             hash['title']	= truncate(tag_cut(field))
!           when /JOURNAL/
!             journal = truncate(tag_cut(field))
!             if journal =~ /(.*) (\d+):(\d+)-(\d+) \((\d+)\) \[UI:(\d+)\]$/
!               hash['journal']	= $1
!               hash['volume']	= $2
!               hash['pages']		= $3
!               hash['year']		= $5
!               hash['medline']	= $6
!             else
!               hash['journal'] = journal
              end
            end
          end
!         ary.push(Reference.new(hash))
        end
+       @data['REFERENCE'] = References.new(ary)
+     end
+     @data['REFERENCE']
+   end
  
!   # CHROMOSOME -- Returns contents of the CHROMOSOME records as an Array
!   # of Hash.
!   def chromosomes
!     unless @data['CHROMOSOME']
!       @data['CHROMOSOME'] = []
!       toptag2array(get('CHROMOSOME')).each do |chr|
!         hash = Hash.new('')
!         subtag2array(chr).each do |field|
!           hash[tag_get(field)] = truncate(tag_cut(field))
          end
!         @data['CHROMOSOME'].push(hash)
        end
+     end
+     @data['CHROMOSOME']
+   end
  
!   # PLASMID -- Returns contents of the PLASMID records as an Array of Hash.
!   def plasmids
!     unless @data['PLASMID']
!       @data['PLASMID'] = []
!       toptag2array(get('PLASMID')).each do |chr|
!         hash = Hash.new('')
!         subtag2array(chr).each do |field|
!           hash[tag_get(field)] = truncate(tag_cut(field))
          end
!         @data['PLASMID'].push(hash)
        end
+     end
+     @data['PLASMID']
+   end
  
!   # SCAFFOLD -- Returns contents of the SCAFFOLD records as an Array of Hash.
!   def scaffolds
!     unless @data['SCAFFOLD']
!       @data['SCAFFOLD'] = []
!       toptag2array(get('SCAFFOLD')).each do |chr|
!         hash = Hash.new('')
!         subtag2array(chr).each do |field|
!           hash[tag_get(field)] = truncate(tag_cut(field))
          end
!         @data['SCAFFOLD'].push(hash)
        end
+     end
+     @data['SCAFFOLD']
+   end
  
!   # STATISTICS -- Returns contents of the STATISTICS record as a Hash.
!   def statistics
!     unless @data['STATISTICS']
!       hash = Hash.new(0.0)
!       get('STATISTICS').each_line do |line|
!         case line
!         when /nucleotides:\s+(\d+)/
!           hash['nalen'] = $1.to_i
!         when /protein genes:\s+(\d+)/
!           hash['num_gene'] = $1.to_i
!         when /RNA genes:\s+(\d+)/
!           hash['num_rna'] = $1.to_i
!         when /G\+C content:\s+(\d+.\d+)/
!           hash['gc'] = $1.to_f
          end
        end
!       @data['STATISTICS'] = hash
!     end
!     @data['STATISTICS']
!   end
  
!   # Returns number of nucleotides from the STATISTICS record as a Fixnum.
!   def nalen
!     statistics['nalen']
!   end
!   alias length nalen
  
!   # Returns number of protein genes from the STATISTICS record as a Fixnum.
!   def num_gene
!     statistics['num_gene']
!   end
  
!   # Returns number of rna from the STATISTICS record as a Fixnum.
!   def num_rna
!     statistics['num_rna']
!   end
  
!   # Returns G+C content from the STATISTICS record as a Float.
!   def gc
!     statistics['gc']
!   end
  
!   # GENOMEMAP -- Returns contents of the GENOMEMAP record as a String.
!   def genomemap
!     field_fetch('GENOMEMAP')
    end
  
! end # GENOME
!     
! end # KEGG
! end # Bio
  
  
***************
*** 253,362 ****
  
  
- =begin
- 
- = Bio::KEGG::GENOME
- 
- === Initialize
- 
- --- Bio::KEGG::GENOME.new(entry)
- 
- === ENTRY
- 
- --- Bio::KEGG::GENOME#entry_id -> String
- 
-       Returns contents of the ENTRY record as a String.
- 
- === NAME
- 
- --- Bio::KEGG::GENOME#name -> String
- 
-       Returns contents of the NAME record as a String.
- 
- === DEFINITION
- 
- --- Bio::KEGG::GENOME#definition -> String
- 
-       Returns contents of the DEFINITION record as a String.
- 
- --- Bio::KEGG::GENOME#organism -> String
- 
-       Alias for the 'definition' method.
- 
- === TAXONOMY
- 
- --- Bio::KEGG::GENOME#taxonomy -> Hash
- 
-       Returns contents of the TAXONOMY record as a Hash.
- 
- --- Bio::KEGG::GENOME#taxid -> String
- 
-       Returns NCBI taxonomy ID from the TAXONOMY record as a String.
- 
- --- Bio::KEGG::GENOME#lineage -> String
- 
-       Returns contents of the TAXONOMY/LINEAGE record as a String.
- 
- === COMMENT
- 
- --- Bio::KEGG::GENOME#comment -> String
- 
-       Returns contents of the COMMENT record as a String.
- 
- === REFERENCE
- 
- --- Bio::GenBank#references -> Array
- 
-       Returns contents of the REFERENCE records as an Array of Bio::Reference
-       objects.
- 
- === CHROMOSOME
- 
- --- Bio::KEGG::GENOME#chromosomes -> Array
- 
-       Returns contents of the CHROMOSOME records as an Array of Hash.
- 
- === PLASMID
- 
- --- Bio::KEGG::GENOME#plasmids -> Array
- 
-       Returns contents of the PLASMID records as an Array of Hash.
- 
- === SCAFFOLD
- 
- --- Bio::KEGG::GENOME#scaffolds -> Array
- 
-       Returns contents of the SCAFFOLD records as an Array of Hash.
- 
- === STATISTICS
- 
- --- Bio::KEGG::GENOME#statistics -> Hash
- 
-       Returns contents of the STATISTICS record as a Hash.
- 
- --- Bio::KEGG::GENOME#nalen -> Fixnum
- 
-       Returns number of nucleotides from the STATISTICS record as a Fixnum.
- 
- --- Bio::KEGG::GENOME#num_gene -> Fixnum
- 
-       Returns number of protein genes from the STATISTICS record as a Fixnum.
- 
- --- Bio::KEGG::GENOME#num_rna -> Fixnum
- 
-       Returns number of rna from the STATISTICS record as a Fixnum.
- 
- --- Bio::KEGG::GENOME#gc -> Float
- 
-       Returns G+C content from the STATISTICS record as a Float.
- 
- === GENOMEMAP
- 
- --- Bio::KEGG::GENOME#genomemap -> String
- 
-       Returns contents of the GENOMEMAP record as a String.
- 
- == SEE ALSO
- 
-   ftp://ftp.genome.jp/pub/kegg/genomes/genome
- 
- =end
--- 254,255 ----



From k at dev.open-bio.org  Tue Sep 19 05:53:15 2006
From: k at dev.open-bio.org (Katayama Toshiaki)
Date: Tue, 19 Sep 2006 05:53:15 +0000
Subject: [BioRuby-cvs] bioruby/lib/bio/db/kegg glycan.rb,1.2,1.3
Message-ID: <200609190553.k8J5rF4d031858@dev.open-bio.org>

Update of /home/repository/bioruby/bioruby/lib/bio/db/kegg
In directory dev.open-bio.org:/tmp/cvs-serv31854/lib/bio/db/kegg

Modified Files:
	glycan.rb 
Log Message:
* license is changed from LGPL to Ruby's


Index: glycan.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/kegg/glycan.rb,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** glycan.rb	8 Sep 2005 01:22:11 -0000	1.2
--- glycan.rb	19 Sep 2006 05:53:13 -0000	1.3
***************
*** 1,22 ****
  #
! # bio/db/kegg/glycan.rb - KEGG GLYCAN database class
! #
! #   Copyright (C) 2004 KATAYAMA Toshiaki 
! #
! #  This library is free software; you can redistribute it and/or
! #  modify it under the terms of the GNU Lesser General Public
! #  License as published by the Free Software Foundation; either
! #  version 2 of the License, or (at your option) any later version.
! #
! #  This library is distributed in the hope that it will be useful,
! #  but WITHOUT ANY WARRANTY; without even the implied warranty of
! #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
! #  Lesser General Public License for more details.
  #
! #  You should have received a copy of the GNU Lesser General Public
! #  License along with this library; if not, write to the Free Software
! #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
  #
! #  $Id$
  #
  
--- 1,9 ----
  #
! # = bio/db/kegg/glycan.rb - KEGG GLYCAN database class
  #
! # Copyright::  Copyright (C) 2004 Toshiaki Katayama 
! # License::    Ruby's
  #
! # $Id$
  #
  
***************
*** 24,193 ****
  
  module Bio
  
!   class KEGG
! 
!     class GLYCAN < KEGGDB
  
!       DELIMITER	= RS = "\n///\n"
!       TAGSIZE	= 12
  
!       def initialize(entry)
!         super(entry, TAGSIZE)
!       end
  
!       # ENTRY
!       def entry_id
!         unless @data['ENTRY']
!           @data['ENTRY'] = fetch('ENTRY').split(/\s+/).first
!         end
!         @data['ENTRY']
!       end
  
!       # NAME
!       def name
!         field_fetch('NAME') 
!       end
  
!       # COMPOSITION
!       def composition
!         unless @data['COMPOSITION']
!           hash = Hash.new(0)
!           fetch('COMPOSITION').scan(/\((\S+)\)(\d+)/).each do |key, val|
!             hash[key] = val.to_i
!           end
!           @data['COMPOSITION'] = hash
!         end
!         @data['COMPOSITION']
        end
  
!       # MASS
!       def mass
!         unless @data['MASS']
!           hash = Hash.new
!           fetch('MASS').scan(/(\S+)\s+\((\S+)\)/).each do |val, key|
!             hash[key] = val.to_f
!           end
!           @data['MASS'] = hash
!         end
!         @data['MASS']
        end
  
!       # CLASS
!       def keggclass
!         field_fetch('CLASS') 
!       end
  
!       # BINDING
!       def bindings
!         unless @data['BINDING']
!           ary = Array.new
!           lines = lines_fetch('BINDING')
!           lines.each do |line|
!             if /^\S/.match(line)
!               ary << line
!             else
!               ary.last << " #{line.strip}"
!             end
!           end
!           @data['BINDING'] = ary
          end
-         @data['BINDING']
        end
  
!       # COMPOUND
!       def compounds
!         unless @data['COMPOUND']
!           @data['COMPOUND'] = fetch('COMPOUND').split(/\s+/)
!         end
!         @data['COMPOUND']
!       end
  
!       # REACTION
!       def reactions
!         unless @data['REACTION']
!           @data['REACTION'] = fetch('REACTION').split(/\s+/)
!         end
!         @data['REACTION']
!       end
  
!       # PATHWAY
!       def pathways
!         lines_fetch('PATHWAY') 
!       end
  
!       # ENZYME
!       def enzymes
!         unless @data['ENZYME']
!           field = fetch('ENZYME')
!           if /\(/.match(field)	# old version
!             @data['ENZYME'] = field.scan(/\S+ \(\S+\)/)
!           else
!             @data['ENZYME'] = field.scan(/\S+/)
!           end
!         end
!         @data['ENZYME']
        end
  
!       # ORTHOLOG
!       def orthologs
!         unless @data['ORTHOLOG']
!           ary = Array.new
!           lines = lines_fetch('ORTHOLOG')
!           lines.each do |line|
!             if /^\S/.match(line)
!               ary << line
!             else
!               ary.last << " #{line.strip}"
!             end
!           end
!           @data['ORTHOLOG'] = ary
          end
-         @data['ORTHOLOG']
        end
  
!       # REFERENCE
!       def references
!         unless @data['REFERENCE']
!           ary = Array.new
!           lines = lines_fetch('REFERENCE')
!           lines.each do |line|
!             if /^\d+\s+\[PMID/.match(line)
!               ary << line
!             else
!               ary.last << " #{line.strip}"
!             end
!           end
!           @data['REFERENCE'] = ary
          end
-         @data['REFERENCE']
        end
  
!       # DBLINKS
!       def dblinks
!         unless @data['DBLINKS']
!           ary = Array.new
!           lines = lines_fetch('DBLINKS')
!           lines.each do |line|
!             if /^\S/.match(line)
!               ary << line
!             else
!               ary.last << " #{line.strip}"
!             end
!           end
!           @data['DBLINKS'] = ary
          end
-         @data['DBLINKS']
        end
! 
!       # ATOM, BOND
!       def kcf
!         return "#{get('NODE')}#{get('EDGE')}"
!       end
! 
      end
  
    end
  
! end
  
  
--- 11,178 ----
  
  module Bio
+ class KEGG
  
! class GLYCAN < KEGGDB
  
!   DELIMITER	= RS = "\n///\n"
!   TAGSIZE	= 12
  
!   def initialize(entry)
!     super(entry, TAGSIZE)
!   end
  
!   # ENTRY
!   def entry_id
!     unless @data['ENTRY']
!       @data['ENTRY'] = fetch('ENTRY').split(/\s+/).first
!     end
!     @data['ENTRY']
!   end
  
!   # NAME
!   def name
!     field_fetch('NAME') 
!   end
  
!   # COMPOSITION
!   def composition
!     unless @data['COMPOSITION']
!       hash = Hash.new(0)
!       fetch('COMPOSITION').scan(/\((\S+)\)(\d+)/).each do |key, val|
!         hash[key] = val.to_i
        end
+       @data['COMPOSITION'] = hash
+     end
+     @data['COMPOSITION']
+   end
  
!   # MASS
!   def mass
!     unless @data['MASS']
!       hash = Hash.new
!       fetch('MASS').scan(/(\S+)\s+\((\S+)\)/).each do |val, key|
!         hash[key] = val.to_f
        end
+       @data['MASS'] = hash
+     end
+     @data['MASS']
+   end
  
!   # CLASS
!   def keggclass
!     field_fetch('CLASS') 
!   end
  
!   # BINDING
!   def bindings
!     unless @data['BINDING']
!       ary = Array.new
!       lines = lines_fetch('BINDING')
!       lines.each do |line|
!         if /^\S/.match(line)
!           ary << line
!         else
!           ary.last << " #{line.strip}"
          end
        end
+       @data['BINDING'] = ary
+     end
+     @data['BINDING']
+   end
  
!   # COMPOUND
!   def compounds
!     unless @data['COMPOUND']
!       @data['COMPOUND'] = fetch('COMPOUND').split(/\s+/)
!     end
!     @data['COMPOUND']
!   end
  
!   # REACTION
!   def reactions
!     unless @data['REACTION']
!       @data['REACTION'] = fetch('REACTION').split(/\s+/)
!     end
!     @data['REACTION']
!   end
  
!   # PATHWAY
!   def pathways
!     lines_fetch('PATHWAY') 
!   end
  
!   # ENZYME
!   def enzymes
!     unless @data['ENZYME']
!       field = fetch('ENZYME')
!       if /\(/.match(field)	# old version
!         @data['ENZYME'] = field.scan(/\S+ \(\S+\)/)
!       else
!         @data['ENZYME'] = field.scan(/\S+/)
        end
+     end
+     @data['ENZYME']
+   end
  
!   # ORTHOLOG
!   def orthologs
!     unless @data['ORTHOLOG']
!       ary = Array.new
!       lines = lines_fetch('ORTHOLOG')
!       lines.each do |line|
!         if /^\S/.match(line)
!           ary << line
!         else
!           ary.last << " #{line.strip}"
          end
        end
+       @data['ORTHOLOG'] = ary
+     end
+     @data['ORTHOLOG']
+   end
  
!   # REFERENCE
!   def references
!     unless @data['REFERENCE']
!       ary = Array.new
!       lines = lines_fetch('REFERENCE')
!       lines.each do |line|
!         if /^\d+\s+\[PMID/.match(line)
!           ary << line
!         else
!           ary.last << " #{line.strip}"
          end
        end
+       @data['REFERENCE'] = ary
+     end
+     @data['REFERENCE']
+   end
  
!   # DBLINKS
!   def dblinks
!     unless @data['DBLINKS']
!       ary = Array.new
!       lines = lines_fetch('DBLINKS')
!       lines.each do |line|
!         if /^\S/.match(line)
!           ary << line
!         else
!           ary.last << " #{line.strip}"
          end
        end
!       @data['DBLINKS'] = ary
      end
+     @data['DBLINKS']
+   end
  
+   # ATOM, BOND
+   def kcf
+     return "#{get('NODE')}#{get('EDGE')}"
    end
  
! end # GLYCAN
! 
! end # KEGG
! end # Bio
  
  



From k at dev.open-bio.org  Tue Sep 19 05:54:32 2006
From: k at dev.open-bio.org (Katayama Toshiaki)
Date: Tue, 19 Sep 2006 05:54:32 +0000
Subject: [BioRuby-cvs] bioruby/lib/bio/db/kegg keggtab.rb,1.8,1.9
Message-ID: <200609190554.k8J5sWw4031901@dev.open-bio.org>

Update of /home/repository/bioruby/bioruby/lib/bio/db/kegg
In directory dev.open-bio.org:/tmp/cvs-serv31897/lib/bio/db/kegg

Modified Files:
	keggtab.rb 
Log Message:
* document is changed to RDoc


Index: keggtab.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/kegg/keggtab.rb,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** keggtab.rb	8 May 2006 14:26:35 -0000	1.8
--- keggtab.rb	19 Sep 2006 05:54:29 -0000	1.9
***************
*** 2,8 ****
  # = bio/db/kegg/keggtab.rb - KEGG keggtab class
  #
! # Copyright::	Copyright (C) 2001 Mitsuteru C. Nakao 
! # 		Copyright (C) 2003, 2006 KATAYAMA Toshiaki 
! # License::	Ruby's
  #
  #  $Id$
--- 2,8 ----
  # = bio/db/kegg/keggtab.rb - KEGG keggtab class
  #
! # Copyright::  Copyright (C) 2001 Mitsuteru C. Nakao 
! #              Copyright (C) 2003, 2006 Toshiaki Katayama 
! # License::    Ruby's
  #
  #  $Id$
***************
*** 12,23 ****
  class KEGG
  
  # Parse 'keggtab' KEGG database definition file which also includes
! # Taxonomic category of the KEGG organisms.  The 'keggtab' file can
! # be found in
  #
! # * (())
  #
  class Keggtab
  
    def initialize(file_path, bioroot = nil)
      @bioroot = ENV['BIOROOT'] || bioroot
--- 12,55 ----
  class KEGG
  
+ # == Description
+ #
  # Parse 'keggtab' KEGG database definition file which also includes
! # Taxonomic category of the KEGG organisms.
  #
! # == References
! #
! # The 'keggtab' file is included in
! #
! # * ftp://ftp.genome.jp/pub/kegg/tarfiles/genes.tar.gz
! # * ftp://ftp.genome.jp/pub/kegg/tarfiles/genes.weekly.last.tar.Z
! #
! # == Format
! #
! # File format is something like
! # 
! #   # KEGGTAB
! #   #
! #   # name            type            directory                    abbreviation
! #   #
! #   enzyme            enzyme          $BIOROOT/db/ideas/ligand     ec
! #   ec                alias           enzyme
! #   (snip)
! #   # Human
! #   h.sapiens         genes           $BIOROOT/db/kegg/genes       hsa
! #   H.sapiens         alias           h.sapiens
! #   hsa               alias           h.sapiens
! #   (snip)
! #   #
! #   # Taxonomy
! #   #
! #   (snip)
! #   animals           alias           hsa+mmu+rno+dre+dme+cel
! #   eukaryotes        alias           animals+plants+protists+fungi
! #   genes             alias           eubacteria+archaea+eukaryotes
  #
  class Keggtab
  
+   # Path for keggtab file and optionally set bioroot top directory.
+   # Environmental variable BIOROOT overrides bioroot.
    def initialize(file_path, bioroot = nil)
      @bioroot = ENV['BIOROOT'] || bioroot
***************
*** 29,33 ****
      end
    end
!   attr_reader :bioroot, :db_names
  
  
--- 61,68 ----
      end
    end
! 
!   # Returns a string of the BIOROOT path prefix.
!   attr_reader :bioroot
!   attr_reader :db_names
  
  
***************
*** 35,38 ****
--- 70,74 ----
  
    class DB
+     # Create a container object for database definitions.
      def initialize(db_name, db_type, db_path, db_abbrev)
        @name = db_name
***************
*** 42,46 ****
        @aliases = Array.new
      end
!     attr_reader :name, :type, :path, :abbrev, :aliases
      alias korg abbrev
      alias keggorg abbrev
--- 78,94 ----
        @aliases = Array.new
      end
!     # Database name. (e.g. 'enzyme', 'h.sapies', 'e.coli', ...)
!     attr_reader :name
!     # Definition type. (e.g. 'enzyme', 'alias', 'genes', ...)
!     attr_reader :type
!     # Database flat file path. (e.g. '$BIOROOT/db/kegg/genes', ...)
!     attr_reader :path
!     # Short name for the database. (e.g. 'ec', 'hsa', 'eco', ...)
!     # korg and keggorg are alias for abbrev method.
!     attr_reader :abbrev
!     # Array containing all alias names for the database.
!     # (e.g. ["H.sapiens", "hsa"], ["E.coli", "eco"], ...)
!     attr_reader :aliases
! 
      alias korg abbrev
      alias keggorg abbrev
***************
*** 50,53 ****
--- 98,103 ----
    # DB section
  
+   # Returns a hash containing DB definition section of the keggtab file.
+   # If database name is given as an argument, returns a Keggtab::DB object.
    def database(db_abbrev = nil)
      if db_abbrev
***************
*** 58,61 ****
--- 108,113 ----
    end
  
+   # Returns an Array containing all alias names for the database.
+   # (e.g. 'hsa' -> ["H.sapiens", "hsa"], 'hpj' -> ["H.pylori_J99", "hpj"])
    def aliases(db_abbrev)
      if @database[db_abbrev]
***************
*** 64,67 ****
--- 116,121 ----
    end
  
+   # Returns a canonical database name for the abbreviation.
+   # (e.g. 'ec' -> 'enzyme',  'hsa' -> 'h.sapies', ...)
    def name(db_abbrev)
      if @database[db_abbrev]
***************
*** 70,73 ****
--- 124,129 ----
    end
  
+   # Returns an absolute path for the flat file database.
+   # (e.g. '/bio/db/kegg/genes', ...)
    def path(db_abbrev)
      if @database[db_abbrev]
***************
*** 82,85 ****
--- 138,142 ----
  
  
+   # deprecated
    def alias_list(db_name)
      if @db_names[db_name]
***************
*** 88,91 ****
--- 145,149 ----
    end
  
+   # deprecated
    def db_path(db_name)
      if @bioroot
***************
*** 96,99 ****
--- 154,158 ----
    end
  
+   # deprecated
    def db_by_abbrev(db_abbrev)
      @db_names.each do |k, db|
***************
*** 103,110 ****
--- 162,171 ----
    end
  
+   # deprecated
    def name_by_abbrev(db_abbrev)
      db_by_abbrev(db_abbrev).name
    end
  
+   # deprecated
    def db_path_by_abbrev(db_abbrev)
      db_name = name_by_abbrev(db_abbrev)
***************
*** 115,118 ****
--- 176,183 ----
    # Taxonomy section
  
+   # Returns a hash containing Taxonomy section of the keggtab file.
+   # If argument is given, returns a List of all child nodes belongs
+   # to the label node.
+   # (e.g. "eukaryotes" -> ["animals", "plants", "protists", "fungi"], ...)
    def taxonomy(node = nil)
      if node
***************
*** 123,126 ****
--- 188,193 ----
    end
  
+   # List of all node labels from Taxonomy section.
+   # (e.g. ["actinobacteria", "animals", "archaea", "bacillales", ...)
    def taxa_list
      @taxonomy.keys.sort
***************
*** 131,134 ****
--- 198,204 ----
    end
  
+   # Returns an array of organism names included in the specified taxon
+   # label. (e.g. 'proteobeta' -> ["nme", "nma", "rso"])
+   # This method has taxo2keggorgs, taxon2korgs, and taxon2keggorgs aliases.
    def taxo2korgs(node = 'genes')
      if node.length == 3
***************
*** 150,153 ****
--- 220,226 ----
    alias taxon2keggorgs taxo2korgs
  
+   # Returns an array of taxonomy names the organism belongs.
+   # (e.g. 'eco' -> ['proteogamma','proteobacteria','eubacteria','genes'])
+   # This method has aliases as keggorg2taxo, korg2taxonomy, keggorg2taxonomy.
    def korg2taxo(keggorg)
      tmp = Array.new
***************
*** 283,413 ****
  
  
- 
- =begin
- 
- The keggtab file is included in
- 
-   * ((URL:ftp://ftp.genome.jp/pub/kegg/tarfiles/genes.weekly.last.tar.Z>))
- 
- File format is something like
- 
-   # KEGGTAB
-   #
-   # name            type            directory                     abbreviation
-   #
-   enzyme            enzyme          $BIOROOT/db/ideas/ligand      ec
-   ec                alias           enzyme
-   (snip)
-   # Human
-   h.sapiens         genes           $BIOROOT/db/kegg/genes        hsa
-   H.sapiens         alias           h.sapiens
-   hsa               alias           h.sapiens
-   (snip)
-   #
-   # Taxonomy
-   #
-   (snip)
-   animals           alias           hsa+mmu+rno+dre+dme+cel
-   eukaryotes        alias           animals+plants+protists+fungi
-   genes             alias           eubacteria+archaea+eukaryotes
- 
- = Bio::KEGG::Keggtab
- 
- --- Bio::KEGG::Keggtab.new(file_path, bioroot = nil)
- 
-       Path for keggtab file and optionally set bioroot top directory.
-       Environmental variable BIOROOT overrides bioroot.
- 
- --- Bio::KEGG::Keggtab#database -> Hash
- 
-       Returns a hash containing DB definition section of the keggtab file.
- 
- --- Bio::KEGG::Keggtab#database(db_abbrev) -> Keggtab::DB
- 
-       Returns a Keggtab::DB object.
- 
- --- Bio::KEGG::Keggtab#taxonomy -> Hash
- 
-       Returns a hash containing Taxonomy section of the keggtab file.
- 
- --- Bio::KEGG::Keggtab#taxonomy(node) -> Array
- 
-       Returns a List of all child nodes belongs to the label node.
-       (e.g. "eukaryotes" -> ["animals", "plants", "protists", "fungi"], ...)
- 
- --- Bio::KEGG::Keggtab#bioroot -> String
- 
-       Returns a string of the BIOROOT path prefix.
- 
- --- Bio::KEGG::Keggtab#name(db_abbrev) -> String
- 
-       Returns a canonical database name for the abbreviation.
-       (e.g. 'ec' -> 'enzyme',  'hsa' -> 'h.sapies', ...)
- 
- --- Bio::KEGG::Keggtab#aliases(db_abbrev) -> Array
- 
-       Returns an Array containing all alias names for the database.
-       (e.g. 'hsa' -> ["H.sapiens", "hsa"], 'hpj' -> ["H.pylori_J99", "hpj"])
- 
- --- Bio::KEGG::Keggtab#path(db_abbrev) -> String
- 
-       Returns an absolute path for the flat file database.
-       (e.g. '/bio/db/kegg/genes', ...)
- 
- --- Bio::KEGG::Keggtab#taxa_list -> Array
- 
-       List of all node labels from Taxonomy section.
-       (e.g. ["actinobacteria", "animals", "archaea", "bacillales", ...)
- 
- --- Bio::KEGG::Keggtab#taxo2korgs(taxon) -> Array
- 
-       Returns an array of organism names included in the specified taxon
-       label. (e.g. 'proteobeta' -> ["nme", "nma", "rso"])
-       This method has taxo2keggorgs, taxon2korgs, and taxon2keggorgs aliases.
- 
- --- Bio::KEGG::Keggtab#korg2taxo(keggorg) -> Array
- 
-       Returns an array of taxonomy names the organism belongs.
-       (e.g. 'eco' -> ['proteogamma','proteobacteria','eubacteria','genes'])
-       This method has aliases as keggorg2taxo, korg2taxonomy, keggorg2taxonomy.
- 
- * following methods are deprecated
- 
- --- Bio::KEGG::Keggtab#db_names[db_name] -> Keggtab::DB
- --- Bio::KEGG::Keggtab#db_by_abbrev(db_abbrev) -> Keggtab::DB
- --- Bio::KEGG::Keggtab#alias_list(db_name) -> Array
- --- Bio::KEGG::Keggtab#name_by_abbrev(db_abbrev) -> String
- --- Bio::KEGG::Keggtab#db_path(db_name) -> String
- --- Bio::KEGG::Keggtab#db_path_by_abbrev(keggorg) -> String
- 
- 
- == Bio::KEGG::Keggtab::DB
- 
- --- Bio::KEGG::Keggtab::DB.new(db_name, db_type, db_path, db_abbrev)
- 
-       Create a container object for database definitions.
- 
- --- Bio::KEGG::Keggtab::DB#name -> String
- 
-       Database name. (e.g. 'enzyme', 'h.sapies', 'e.coli', ...)
- 
- --- Bio::KEGG::Keggtab::DB#type -> String
- 
-       Definition type. (e.g. 'enzyme', 'alias', 'genes', ...)
- 
- --- Bio::KEGG::Keggtab::DB#path -> String
- 
-       Database flat file path. (e.g. '$BIOROOT/db/kegg/genes', ...)
- 
- --- Bio::KEGG::Keggtab::DB#abbrev -> String
- 
-       Short name for the database. (e.g. 'ec', 'hsa', 'eco', ...)
-       korg and keggorg are alias for abbrev method.
- 
- --- Bio::KEGG::Keggtab::DB#aliases -> Array
- 
-       Array containing all alias names for the database.
-       (e.g. ["H.sapiens", "hsa"], ["E.coli", "eco"], ...)
- 
- =end
- 
--- 356,357 ----



From k at dev.open-bio.org  Tue Sep 19 05:55:40 2006
From: k at dev.open-bio.org (Katayama Toshiaki)
Date: Tue, 19 Sep 2006 05:55:40 +0000
Subject: [BioRuby-cvs] bioruby/lib/bio/db/kegg kgml.rb,1.4,1.5
Message-ID: <200609190555.k8J5teA8031944@dev.open-bio.org>

Update of /home/repository/bioruby/bioruby/lib/bio/db/kegg
In directory dev.open-bio.org:/tmp/cvs-serv31940/lib/bio/db/kegg

Modified Files:
	kgml.rb 
Log Message:
* accessor for component attribute is added


Index: kgml.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/kegg/kgml.rb,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** kgml.rb	25 Jul 2006 19:17:39 -0000	1.4
--- kgml.rb	19 Sep 2006 05:55:38 -0000	1.5
***************
*** 8,11 ****
--- 8,17 ----
  # $Id$
  #
+ 
+ autoload :REXML, 'rexml/document'
+ 
+ module Bio
+ class KEGG
+ 
  # == KGML (KEGG XML) parser
  #
***************
*** 61,64 ****
--- 67,72 ----
  #    puts entry.fgcolor
  #    puts entry.bgcolor
+ #    #  attributes
+ #    puts entry.components
  #    # methood
  #    puts entry.names
***************
*** 101,110 ****
  #  end
  #
- 
- autoload :REXML, 'rexml/document'
- 
- module Bio
- class KEGG
- 
  class KGML
  
--- 109,112 ----
***************
*** 122,125 ****
--- 124,128 ----
      attr_accessor :entry_id, :name, :entry_type, :link, :reaction, :map
      attr_accessor :label, :shape, :x, :y, :width, :height, :fgcolor, :bgcolor
+     attr_accessor :components
      def names
        @name.split(/\s+/)
***************
*** 178,181 ****
--- 181,191 ----
          entry.bgcolor  = attr["bgcolor"]
        }
+ 
+       node.elements.each("component") { |component|
+         attr = component.attributes
+         entry.components ||= []
+         entry.components << attr["id"].to_i
+       }
+ 
        @entries << entry
      }



From k at dev.open-bio.org  Tue Sep 19 05:56:16 2006
From: k at dev.open-bio.org (Katayama Toshiaki)
Date: Tue, 19 Sep 2006 05:56:16 +0000
Subject: [BioRuby-cvs] bioruby/lib/bio/db/kegg ko.rb,1.5,1.6
Message-ID: <200609190556.k8J5uGhA031987@dev.open-bio.org>

Update of /home/repository/bioruby/bioruby/lib/bio/db/kegg
In directory dev.open-bio.org:/tmp/cvs-serv31983/lib/bio/db/kegg

Modified Files:
	ko.rb 
Log Message:
* license is changed from LGPL to Ruby's
* document is changed to RDoc


Index: ko.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/kegg/ko.rb,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** ko.rb	8 Sep 2005 01:22:11 -0000	1.5
--- ko.rb	19 Sep 2006 05:56:14 -0000	1.6
***************
*** 1,106 ****
  #
! # bio/db/kegg/ko.rb - KO (KEGG Orthology) database class
  #
! #   Copyright (C) 2003 KATAYAMA Toshiaki 
! #   Copyright (C) 2003 Masumi Itoh 
  #
! #  This library is free software; you can redistribute it and/or
! #  modify it under the terms of the GNU Lesser General Public
! #  License as published by the Free Software Foundation; either
! #  version 2 of the License, or (at your option) any later version.
  #
! #  This library is distributed in the hope that it will be useful,
! #  but WITHOUT ANY WARRANTY; without even the implied warranty of
! #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
! #  Lesser General Public License for more details.
  #
! #  You should have received a copy of the GNU Lesser General Public
! #  License along with this library; if not, write to the Free Software
! #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
  #
! #  $Id$
  #
  
! require 'bio/db'
  
! module Bio
  
!   class KEGG
!     
!     class KO < KEGGDB
!       
!       DELIMITER	= RS = "\n///\n"
!       TAGSIZE	= 12
  
!       def initialize(entry)
!         super(entry, TAGSIZE)
!       end
!       
!       
!       def entry_id
!         field_fetch('ENTRY')[/\S+/]
!       end
!       
!       def name
!         field_fetch('NAME')
!       end
!       
!       def names
!         name.split(', ')
!       end
!       
!       def definition
!         field_fetch('DEFINITION')
!       end
!       
!       def keggclass
!         field_fetch('CLASS')
!       end
  
!       def keggclasses
!         keggclass.gsub(/ \[[^\]]+/, '').split(/\] ?/)
!       end
!       
!       def pathways
!         keggclass.scan(/\[PATH:(.*?)\]/).flatten
        end
!       
!       def dblinks
!         unless @data['DBLINKS']
!           hash = {}
!           get('DBLINKS').scan(/(\S+):\s*(.*)\n/).each do |k, v|
!             hash[k] = v.split(/\s+/)
!           end
!           @data['DBLINKS'] = hash
          end
!         @data['DBLINKS']		# Hash of DB:ID in DBLINKS
!       end
!       
!       def genes
!         unless @data['GENES']
!           hash = {}
!           k = ''
!           get('GENES').each_line do |line|
!             line.chomp!
!             line[0, @tagsize] = '' 
!             if line =~ /(\S+):/
!               k = $1
!               hash[k] = []
!             end
!             line[0, 5] = ''
!             line.gsub(/\(\S+/, '').each(' ') do |u|
!               hash[k] << u.strip
!             end
!           end
!           @data['GENES'] = hash
          end
-         @data['GENES']		# Hash of DB:ID in DBLINKS
        end
!       
      end
!     
    end
    
! end
  
  
--- 1,108 ----
  #
! # = bio/db/kegg/ko.rb - KO (KEGG Orthology) database class
  #
! # Copyright::  Copyright (C) 2003 Toshiaki Katayama 
! # Copyright::  Copyright (C) 2003 Masumi Itoh 
  #
! # $Id$
  #
! 
! require 'bio/db'
! 
! module Bio
! class KEGG
! 
! # == Description
  #
! # KO (KEGG Orthology) entry parser.
  #
! # == References
  #
+ # * http://www.genome.jp/dbget-bin/get_htext?KO
+ # * ftp://ftp.genome.jp/pub/kegg/tarfiles/ko
+ #
+ class KO < KEGGDB
+   
+   DELIMITER	= RS = "\n///\n"
+   TAGSIZE	= 12
  
!   # Reads a flat file format entry of the KO database.
!   def initialize(entry)
!     super(entry, TAGSIZE)
!   end
!   
!   # Returns ID of the entry.
!   def entry_id
!     field_fetch('ENTRY')[/\S+/]
!   end
  
!   # Returns NAME field of the entry.
!   def name
!     field_fetch('NAME')
!   end
  
!   # Returns an Array of names in NAME field.
!   def names
!     name.split(', ')
!   end
  
!   # Returns DEFINITION field of the entry.
!   def definition
!     field_fetch('DEFINITION')
!   end
  
!   # Returns CLASS field of the entry.
!   def keggclass
!     field_fetch('CLASS')
!   end
! 
!   # Returns an Array of biological classes in CLASS field.
!   def keggclasses
!     keggclass.gsub(/ \[[^\]]+/, '').split(/\] ?/)
!   end
! 
!   # Returns an Array of KEGG/PATHWAY ID in CLASS field.
!   def pathways
!     keggclass.scan(/\[PATH:(.*?)\]/).flatten
!   end
!   
!   # Returns a Hash of Array of a database name and entry IDs in DBLINKS field.
!   def dblinks
!     unless @data['DBLINKS']
!       hash = {}
!       get('DBLINKS').scan(/(\S+):\s*(.*)\n/).each do |k, v|
!         hash[k] = v.split(/\s+/)
        end
!       @data['DBLINKS'] = hash
!     end
!     @data['DBLINKS']		# Hash of DB:ID in DBLINKS
!   end
! 
!   # Returns a Hash of Array of the organism ID and entry IDs in GENES field.
!   def genes
!     unless @data['GENES']
!       hash = {}
!       k = ''
!       get('GENES').each_line do |line|
!         line.chomp!
!         line[0, @tagsize] = '' 
!         if line =~ /(\S+):/
!           k = $1
!           hash[k] = []
          end
!         line[0, 5] = ''
!         line.gsub(/\(\S+/, '').each(' ') do |u|
!           hash[k] << u.strip
          end
        end
!       @data['GENES'] = hash
      end
!     @data['GENES']		# Hash of DB:ID in DBLINKS
    end
    
! end # KO
!     
! end # KEGG
! end # Bio
  
  
***************
*** 126,178 ****
  
  
- =begin
- 
- = Bio::KEGG::KO
- 
- KO (KEGG Orthology) entry parser.
- 
- * (())
- * (())
- 
- --- Bio::KEGG::KO.new(entry)
- 
- Reads a flat file format entry of the KO database.
- 
- --- Bio::KEGG::KO#entry_id -> String
- 
- Returns ID of the entry.
- 
- --- Bio::KEGG::KO#name -> String
- 
- Returns NAME field of the entry.
- 
- --- Bio::KEGG::KO#names -> Array
- 
- Returns an Array of names in NAME field.
- 
- --- Bio::KEGG::KO#definition -> String
- 
- Returns DEFINITION field of the entry.
- 
- --- Bio::KEGG::KO#keggclass
- 
- Returns CLASS field of the entry.
- 
- --- Bio::KEGG::KO#keggclasses
- 
- Returns an Array of biological classes in CLASS field.
- 
- --- Bio::KEGG::KO#pathways
- 
- Returns an Array of KEGG/PATHWAY ID in CLASS field.
- 
- --- Bio::KEGG::KO#dblinks
- 
- Returns a Hash of Array of the database name and entry IDs in DBLINKS field.
- 
- --- Bio::KEGG::KO#genes
- 
- Returns a Hash of Array of the organism ID and entry IDs in GENES field.
- 
- =end
- 
--- 128,129 ----



From k at dev.open-bio.org  Tue Sep 19 05:56:40 2006
From: k at dev.open-bio.org (Katayama Toshiaki)
Date: Tue, 19 Sep 2006 05:56:40 +0000
Subject: [BioRuby-cvs] bioruby/lib/bio/db/kegg reaction.rb,1.3,1.4
Message-ID: <200609190556.k8J5uebo032030@dev.open-bio.org>

Update of /home/repository/bioruby/bioruby/lib/bio/db/kegg
In directory dev.open-bio.org:/tmp/cvs-serv32026/lib/bio/db/kegg

Modified Files:
	reaction.rb 
Log Message:
* license is changed from LGPL to Ruby's


Index: reaction.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/kegg/reaction.rb,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** reaction.rb	8 Sep 2005 01:22:11 -0000	1.3
--- reaction.rb	19 Sep 2006 05:56:38 -0000	1.4
***************
*** 1,22 ****
  #
! # bio/db/kegg/reaction.rb - KEGG REACTION database class
! #
! #   Copyright (C) 2004 KATAYAMA Toshiaki 
! #
! #  This library is free software; you can redistribute it and/or
! #  modify it under the terms of the GNU Lesser General Public
! #  License as published by the Free Software Foundation; either
! #  version 2 of the License, or (at your option) any later version.
! #
! #  This library is distributed in the hope that it will be useful,
! #  but WITHOUT ANY WARRANTY; without even the implied warranty of
! #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
! #  Lesser General Public License for more details.
  #
! #  You should have received a copy of the GNU Lesser General Public
! #  License along with this library; if not, write to the Free Software
! #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
  #
! #  $Id$
  #
  
--- 1,9 ----
  #
! # = bio/db/kegg/reaction.rb - KEGG REACTION database class
  #
! # Copyright::  Copyright (C) 2004 Toshiaki Katayama 
! # License::    Ruby's
  #
! # $Id$
  #
  
***************
*** 24,85 ****
  
  module Bio
  
!   class KEGG
! 
!     class REACTION < KEGGDB
! 
!       DELIMITER	= RS = "\n///\n"
!       TAGSIZE	= 12
  
!       def initialize(entry)
!         super(entry, TAGSIZE)
!       end
  
!       # ENTRY
!       def entry_id
!         field_fetch('ENTRY')
!       end
  
!       # NAME
!       def name
!         field_fetch('NAME') 
!       end
  
!       # DEFINITION
!       def definition
!         field_fetch('DEFINITION')
!       end
  
!       # EQUATION
!       def equation
!         field_fetch('EQUATION')
!       end
  
!       # RPAIR
!       def rpairs
!         unless @data['RPAIR']
!           @data['RPAIR'] = fetch('RPAIR').split(/\s+/)
!         end
!         @data['RPAIR']
!       end
  
!       # PATHWAY
!       def pathways
!         lines_fetch('PATHWAY') 
!       end
  
!       # ENZYME
!       def enzymes
!         unless @data['ENZYME']
!           @data['ENZYME'] = fetch('ENZYME').scan(/\S+/)
!         end
!         @data['ENZYME']
!       end
  
      end
! 
    end
  
! end
  
  
--- 11,70 ----
  
  module Bio
+ class KEGG
  
! class REACTION < KEGGDB
  
!   DELIMITER	= RS = "\n///\n"
!   TAGSIZE	= 12
  
!   def initialize(entry)
!     super(entry, TAGSIZE)
!   end
  
!   # ENTRY
!   def entry_id
!     field_fetch('ENTRY')
!   end
  
!   # NAME
!   def name
!     field_fetch('NAME') 
!   end
  
!   # DEFINITION
!   def definition
!     field_fetch('DEFINITION')
!   end
  
!   # EQUATION
!   def equation
!     field_fetch('EQUATION')
!   end
  
!   # RPAIR
!   def rpairs
!     unless @data['RPAIR']
!       @data['RPAIR'] = fetch('RPAIR').split(/\s+/)
!     end
!     @data['RPAIR']
!   end
  
!   # PATHWAY
!   def pathways
!     lines_fetch('PATHWAY') 
!   end
  
+   # ENZYME
+   def enzymes
+     unless @data['ENZYME']
+       @data['ENZYME'] = fetch('ENZYME').scan(/\S+/)
      end
!     @data['ENZYME']
    end
  
! end # REACTION
! 
! end # KEGG
! end # Bio
  
  



From k at dev.open-bio.org  Tue Sep 19 05:57:22 2006
From: k at dev.open-bio.org (Katayama Toshiaki)
Date: Tue, 19 Sep 2006 05:57:22 +0000
Subject: [BioRuby-cvs] bioruby/lib/bio/db/genbank common.rb,1.9,1.10
Message-ID: <200609190557.k8J5vMmt032073@dev.open-bio.org>

Update of /home/repository/bioruby/bioruby/lib/bio/db/genbank
In directory dev.open-bio.org:/tmp/cvs-serv32069/lib/bio/db/genbank

Modified Files:
	common.rb 
Log Message:
* license is changed from LGPL to Ruby's
* document is changed to RDoc


Index: common.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/genbank/common.rb,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** common.rb	7 Dec 2005 11:23:51 -0000	1.9
--- common.rb	19 Sep 2006 05:57:20 -0000	1.10
***************
*** 1,22 ****
  #
! # bio/db/genbank/common.rb - Common methods for GenBank style database classes
! #
! #   Copyright (C) 2004 KATAYAMA Toshiaki 
! #
! #  This library is free software; you can redistribute it and/or
! #  modify it under the terms of the GNU Lesser General Public
! #  License as published by the Free Software Foundation; either
! #  version 2 of the License, or (at your option) any later version.
! #
! #  This library is distributed in the hope that it will be useful,
! #  but WITHOUT ANY WARRANTY; without even the implied warranty of
! #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
! #  Lesser General Public License for more details.
  #
! #  You should have received a copy of the GNU Lesser General Public
! #  License along with this library; if not, write to the Free Software
! #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
  #
! #  $Id$
  #
  
--- 1,9 ----
  #
! # = bio/db/genbank/common.rb - Common methods for GenBank style database classes
  #
! # Copyright::  Copyright (C) 2004 Toshiaki Katayama 
! # License::    Ruby's
  #
! # $Id$
  #
  
***************
*** 25,28 ****
--- 12,26 ----
  module Bio
  class NCBIDB
+ 
+ # == Description
+ # 
+ # This module defines a common framework among GenBank, GenPept, RefSeq, and
+ # DDBJ.  For more details, see the documentations in each genbank/*.rb files.
+ # 
+ # == References
+ # 
+ # * ftp://ftp.ncbi.nih.gov/genbank/gbrel.txt
+ # * http://www.ncbi.nlm.nih.gov/collab/FT/index.html
+ #
  module Common
  
***************
*** 34,40 ****
    end
  
!   # LOCUS  -- Locus class must be defined in child classes
  
!   # DEFINITION
    def definition
      field_fetch('DEFINITION')
--- 32,41 ----
    end
  
!   # LOCUS -- Locus class must be defined in child classes.
!   def locus
!     # must be overrided in each subclass
!   end
  
!   # DEFINITION -- Returns contents of the DEFINITION record as a String.
    def definition
      field_fetch('DEFINITION')
***************
*** 42,46 ****
  
  
!   # ACCESSION
    def accessions
      accession.split(/\s+/)
--- 43,47 ----
  
  
!   # ACCESSION -- Returns contents of the ACCESSION record as an Array.
    def accessions
      accession.split(/\s+/)
***************
*** 48,68 ****
  
  
!   # VERSION
    def versions
      @data['VERSION'] ||= fetch('VERSION').split(/\s+/)
    end
  
    def acc_version
      versions.first.to_s
    end
  
    def accession
      acc_version.split(/\./).first.to_s
    end
  
    def version
      acc_version.split(/\./).last.to_i
    end
  
    def gi
      versions.last
--- 49,73 ----
  
  
!   # VERSION -- Returns contents of the VERSION record as an Array of Strings.
    def versions
      @data['VERSION'] ||= fetch('VERSION').split(/\s+/)
    end
  
+   # Returns the first part of the VERSION record as "ACCESSION.VERSION" String.
    def acc_version
      versions.first.to_s
    end
  
+   # Returns the ACCESSION part of the acc_version.
    def accession
      acc_version.split(/\./).first.to_s
    end
  
+   # Returns the VERSION part of the acc_version as a Fixnum
    def version
      acc_version.split(/\./).last.to_i
    end
  
+   # Returns the second part of the VERSION record as a "GI:#######" String.
    def gi
      versions.last
***************
*** 70,74 ****
  
  
!   # NID
    def nid
      field_fetch('NID')
--- 75,79 ----
  
  
!   # NID -- Returns contents of the NID record as a String.
    def nid
      field_fetch('NID')
***************
*** 76,80 ****
  
  
!   # KEYWORDS
    def keywords
      @data['KEYWORDS'] ||= fetch('KEYWORDS').chomp('.').split(/; /)
--- 81,85 ----
  
  
!   # KEYWORDS -- Returns contents of the KEYWORDS record as an Array of Strings.
    def keywords
      @data['KEYWORDS'] ||= fetch('KEYWORDS').chomp('.').split(/; /)
***************
*** 82,86 ****
  
  
!   # SEGMENT
    def segment
      @data['SEGMENT'] ||= fetch('SEGMENT').scan(/\d+/).join("/")
--- 87,91 ----
  
  
!   # SEGMENT -- Returns contents of the SEGMENT record as a "m/n" form String.
    def segment
      @data['SEGMENT'] ||= fetch('SEGMENT').scan(/\d+/).join("/")
***************
*** 88,92 ****
  
  
!   # SOURCE
    def source
      unless @data['SOURCE']
--- 93,97 ----
  
  
!   # SOURCE -- Returns contents of the SOURCE record as a Hash.
    def source
      unless @data['SOURCE']
***************
*** 127,131 ****
  
  
!   # REFERENCE
    def references
      unless @data['REFERENCE']
--- 132,137 ----
  
  
!   # REFERENCE -- Returns contents of the REFERENCE records as an Array of
!   # Bio::Reference objects.
    def references
      unless @data['REFERENCE']
***************
*** 174,178 ****
  
  
!   # COMMENT
    def comment
      field_fetch('COMMENT')
--- 180,184 ----
  
  
!   # COMMENT -- Returns contents of the COMMENT record as a String.
    def comment
      field_fetch('COMMENT')
***************
*** 180,184 ****
  
  
!   # FEATURES
    def features
      unless @data['FEATURES']
--- 186,191 ----
  
  
!   # FEATURES -- Returns contents of the FEATURES record as a Bio::Features
!   # object.
    def features
      unless @data['FEATURES']
***************
*** 234,238 ****
  
  
!   # ORIGIN
    def origin
      unless @data['ORIGIN']
--- 241,245 ----
  
  
!   # ORIGIN -- Returns contents of the ORIGIN record as a String.
    def origin
      unless @data['ORIGIN']
***************
*** 277,299 ****
  
  end # Common 
  end # GenBank
  end # Bio
  
  
- =begin
- 
- = Bio::GenBank::Common
- 
- This module defines a common framework among GenBank, GenPept, RefSeq, and
- DDBJ.  For more details, see the documentations in each genbank/*.rb files.
- 
- 
- == SEE ALSO
- 
- * (())
- * (())
- 
- =end
- 
- 
- 
--- 284,290 ----
  
  end # Common 
+ 
  end # GenBank
  end # Bio
  
  



From k at dev.open-bio.org  Tue Sep 19 05:57:56 2006
From: k at dev.open-bio.org (Katayama Toshiaki)
Date: Tue, 19 Sep 2006 05:57:56 +0000
Subject: [BioRuby-cvs] bioruby/lib/bio/db/genbank ddbj.rb,1.7,1.8
Message-ID: <200609190557.k8J5vueI032116@dev.open-bio.org>

Update of /home/repository/bioruby/bioruby/lib/bio/db/genbank
In directory dev.open-bio.org:/tmp/cvs-serv32112/lib/bio/db/genbank

Modified Files:
	ddbj.rb 
Log Message:
* license is changed from LGPL to Ruby's


Index: ddbj.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/genbank/ddbj.rb,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** ddbj.rb	9 Sep 2005 16:02:04 -0000	1.7
--- ddbj.rb	19 Sep 2006 05:57:54 -0000	1.8
***************
*** 1,22 ****
  #
! # bio/db/genbank/ddbj.rb - DDBJ database class
! #
! #   Copyright (C) 2000-2004 KATAYAMA Toshiaki 
! #
! #  This library is free software; you can redistribute it and/or
! #  modify it under the terms of the GNU Lesser General Public
! #  License as published by the Free Software Foundation; either
! #  version 2 of the License, or (at your option) any later version.
! #
! #  This library is distributed in the hope that it will be useful,
! #  but WITHOUT ANY WARRANTY; without even the implied warranty of
! #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
! #  Lesser General Public License for more details.
  #
! #  You should have received a copy of the GNU Lesser General Public
! #  License along with this library; if not, write to the Free Software
! #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
  #
! #  $Id$
  #
  
--- 1,9 ----
  #
! # = bio/db/genbank/ddbj.rb - DDBJ database class
  #
! # Copyright::  Copyright (C) 2000-2004 Toshiaki Katayama 
! # License::    Ruby's
  #
! # $Id$
  #
  
***************
*** 30,34 ****
  
    # Nothing to do (DDBJ database format is completely same as GenBank)
! end
  
  end # Bio
--- 17,22 ----
  
    # Nothing to do (DDBJ database format is completely same as GenBank)
! 
! end # DDBJ
  
  end # Bio



From k at dev.open-bio.org  Tue Sep 19 05:59:09 2006
From: k at dev.open-bio.org (Katayama Toshiaki)
Date: Tue, 19 Sep 2006 05:59:09 +0000
Subject: [BioRuby-cvs] bioruby/lib/bio/db/genbank genbank.rb,0.38,0.39
Message-ID: <200609190559.k8J5x9Jd032159@dev.open-bio.org>

Update of /home/repository/bioruby/bioruby/lib/bio/db/genbank
In directory dev.open-bio.org:/tmp/cvs-serv32155/lib/bio/db/genbank

Modified Files:
	genbank.rb 
Log Message:
* license is changed from LGPL to Ruby's
* document is changed to RDoc


Index: genbank.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/genbank/genbank.rb,v
retrieving revision 0.38
retrieving revision 0.39
diff -C2 -d -r0.38 -r0.39
*** genbank.rb	7 Dec 2005 11:23:51 -0000	0.38
--- genbank.rb	19 Sep 2006 05:59:07 -0000	0.39
***************
*** 1,22 ****
  #
! # bio/db/genbank/genbank.rb - GenBank database class
! #
! #   Copyright (C) 2000-2005 KATAYAMA Toshiaki 
! #
! #  This library is free software; you can redistribute it and/or
! #  modify it under the terms of the GNU Lesser General Public
! #  License as published by the Free Software Foundation; either
! #  version 2 of the License, or (at your option) any later version.
! #
! #  This library is distributed in the hope that it will be useful,
! #  but WITHOUT ANY WARRANTY; without even the implied warranty of
! #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
! #  Lesser General Public License for more details.
  #
! #  You should have received a copy of the GNU Lesser General Public
! #  License along with this library; if not, write to the Free Software
! #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
  #
! #  $Id$
  #
  
--- 1,9 ----
  #
! # = bio/db/genbank/genbank.rb - GenBank database class
  #
! # Copyright::  Copyright (C) 2000-2005 Toshiaki Katayama 
! # License::    Ruby's
  #
! # $Id$
  #
  
***************
*** 25,33 ****
  
  module Bio
  class GenBank < NCBIDB
  
    include Bio::NCBIDB::Common
  
!   # LOCUS
    class Locus
      def initialize(locus_line)
--- 12,32 ----
  
  module Bio
+ 
+ # == Description
+ #
+ # Parses a GenBank formatted database entry
+ #
+ # == Example
+ #
+ #   # entry is a string containing only one entry contents
+ #   gb = Bio::GenBank.new(entry)
+ #
  class GenBank < NCBIDB
  
    include Bio::NCBIDB::Common
  
!   # Parses the LOCUS line and returns contents of the LOCUS record
!   # as a Bio::GenBank::Locus object.  Locus object is created automatically
!   # when Bio::GenBank#locus, entry_id etc. methods are called.
    class Locus
      def initialize(locus_line)
***************
*** 56,88 ****
    end
  
    def locus
      @data['LOCUS'] ||= Locus.new(get('LOCUS'))
    end
-   def entry_id;		locus.entry_id;		end
-   def length;		locus.length;		end
-   def circular;		locus.circular;		end
-   def division;		locus.division;		end
-   def date;		locus.date;		end
- 
-   def strand;		locus.strand;		end
-   def natype;		locus.natype;		end
  
  
!   # ORIGIN
!   def seq
!     unless @data['SEQUENCE']
!       origin
!     end
!     Bio::Sequence::NA.new(@data['SEQUENCE'])
!   end
!   alias naseq seq
!   alias nalen length
! 
!   def seq_len
!     seq.length
!   end
  
  
!   # FEATURES
    def each_cds
      features.each do |feature|
--- 55,75 ----
    end
  
+   # Accessor methods for the contents of the LOCUS record.
+ 
    def locus
      @data['LOCUS'] ||= Locus.new(get('LOCUS'))
    end
  
+   def entry_id;  locus.entry_id;  end
+   def length;    locus.length;    end
+   def circular;  locus.circular;  end
+   def division;  locus.division;  end
+   def date;      locus.date;      end
  
!   def strand;    locus.strand;    end
!   def natype;    locus.natype;    end
  
  
!   # FEATURES -- Iterate only for the 'CDS' portion of the Bio::Features.
    def each_cds
      features.each do |feature|
***************
*** 93,96 ****
--- 80,84 ----
    end
  
+   # FEATURES -- Iterate only for the 'gene' portion of the Bio::Features.
    def each_gene
      features.each do |feature|
***************
*** 102,106 ****
  
  
!   # BASE COUNT : obsoleted after GenBank release 138.0
    def basecount(base = nil)
      unless @data['BASE COUNT']
--- 90,97 ----
  
  
!   # BASE COUNT (this field is obsoleted after GenBank release 138.0) --
!   # Returns the BASE COUNT as a Hash.  When the base is specified, returns
!   # count of the base as a Fixnum.  The base can be one of 'a', 't', 'g',
!   # 'c', and 'o' (others).
    def basecount(base = nil)
      unless @data['BASE COUNT']
***************
*** 120,123 ****
--- 111,129 ----
    end
  
+   # ORIGIN -- Returns DNA sequence in the ORIGIN record as a
+   # Bio::Sequence::NA object.
+   def seq
+     unless @data['SEQUENCE']
+       origin
+     end
+     Bio::Sequence::NA.new(@data['SEQUENCE'])
+   end
+   alias naseq seq
+   alias nalen length
+ 
+   def seq_len
+     seq.length
+   end
+ 
  end # GenBank
  end # Bio
***************
*** 207,354 ****
  
  
- =begin
- 
- = Bio::GenBank
- 
- === Initialize
- 
- --- Bio::GenBank.new(entry)
- 
- === LOCUS
- 
- --- Bio::GenBank#locus -> Bio::Locus
- 
- Returns contents of the LOCUS record as a Bio::GenBank::Locus object.
- 
- --- Bio::GenBank#entry_id -> String
- --- Bio::GenBank#nalen -> Fixnum
- --- Bio::GenBank#strand -> String
- --- Bio::GenBank#natype -> String
- --- Bio::GenBank#circular -> String
- --- Bio::GenBank#division -> String
- --- Bio::GenBank#date -> String
- 
- Access methods for the contents of the LOCUS record.
- 
- === DEFINITION
- 
- --- Bio::GenBank#definition -> String
- 
- Returns contents of the DEFINITION record as a String.
- 
- === ACCESSION
- 
- --- Bio::GenBank#accessions -> Array
- 
- Returns contents of the ACCESSION record as an Array.
- 
- === VERSION
- 
- --- Bio::GenBank#versions -> Array
- 
- Returns contents of the VERSION record as an Array of Strings.
- 
- --- Bio::GenBank#acc_version -> String
- --- Bio::GenBank#accession -> String
- --- Bio::GenBank#version -> Fixnum
- --- Bio::GenBank#gi -> String
- 
- Access methods for the contents of the VERSION record.
- 
- The 'acc_version' method returns the first part of the VERSION record
- as a "ACCESSION.VERSION" String, 'accession' method returns the ACCESSION
- part of the acc_version, 'version' method returns the VERSION part of the
- acc_version as a Fixnum, and the 'gi' method returns the second part of
- the VERSION record as a "GI:#######" String.
- 
- === NID
- 
- --- Bio::GenBank#nid -> String
- 
- Returns contents of the NID record as a String.
- 
- === KEYWORDS
- 
- --- Bio::GenBank#keywords -> Array
- 
- Returns contents of the KEYWORDS record as an Array of Strings.
- 
- === SEGMENT
- 
- --- Bio::GenBank#segment -> String
- 
- Returns contents of the SEGMENT record as a "m/n" form String.
- 
- === SOURCE
- 
- --- Bio::GenBank#source -> Hash
- 
- Returns contents of the SOURCE record as a Hash.
- 
- --- Bio::GenBank#common_name -> String
- --- Bio::GenBank#vernacular_name -> String
- --- Bio::GenBank#organism -> String
- --- Bio::GenBank#taxonomy -> String
- 
- Access methods for the contents of the SOURCE record.
- 
- The 'common_name' method is same as source['common_name'].
- The 'vernacular_name' method is an alias for the 'common_name'.
- The 'organism' method is same as source['organism'].
- The 'taxonomy' method is same as source['taxonomy'].
- 
- === REFERENCE
- 
- --- Bio::GenBank#references -> Array
- 
- Returns contents of the REFERENCE records as an Array of Bio::Reference
- objects.
- 
- === COMMENT
- 
- --- Bio::GenBank#comment -> String
- 
- Returns contents of the COMMENT record as a String.
- 
- === FEATURES
- 
- --- Bio::GenBank#features -> Bio::Features
- 
- Returns contents of the FEATURES record as a Bio::Features object.
- 
- --- Bio::GenBank#each_cds -> Array
- 
- Iterate only for the 'CDS' portion of the Bio::Features.
- 
- --- Bio::GenBank#each_gene -> Array
- 
- Iterate only for the 'gene' portion of the Bio::Features.
- 
- === BASE COUNT
- 
- --- Bio::GenBank#basecount(base = nil) -> Hash or Fixnum
- 
- Returns the BASE COUNT as a Hash.  When the base is specified, returns
- count of the base as a Fixnum.  The base can be one of 'a', 't', 'g',
- 'c', and 'o' (others).
- 
- === ORIGIN
- 
- --- Bio::GenBank#origin -> String
- 
- Returns contents of the ORIGIN record as a String.
- 
- --- Bio::GenBank#naseq -> Bio::Sequence::NA
- --- Bio::GenBank#seq -> Bio::Sequence::NA
- 
- Returns DNA sequence in the ORIGIN record as a Bio::Sequence::NA object.
- 
- == SEE ALSO
- 
- * (())
- * (())
- 
- =end
- 
- 
  
--- 213,215 ----



From k at dev.open-bio.org  Tue Sep 19 05:59:37 2006
From: k at dev.open-bio.org (Katayama Toshiaki)
Date: Tue, 19 Sep 2006 05:59:37 +0000
Subject: [BioRuby-cvs] bioruby/lib/bio/db/genbank genpept.rb,1.10,1.11
Message-ID: <200609190559.k8J5xbHf032202@dev.open-bio.org>

Update of /home/repository/bioruby/bioruby/lib/bio/db/genbank
In directory dev.open-bio.org:/tmp/cvs-serv32198/lib/bio/db/genbank

Modified Files:
	genpept.rb 
Log Message:
* license is changed from LGPL to Ruby's


Index: genpept.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/genbank/genpept.rb,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** genpept.rb	23 Oct 2005 07:20:37 -0000	1.10
--- genpept.rb	19 Sep 2006 05:59:34 -0000	1.11
***************
*** 1,22 ****
  #
! # bio/db/genbank/genpept.rb - GenPept database class
! #
! #   Copyright (C) 2002-2004 KATAYAMA Toshiaki 
! #
! #  This library is free software; you can redistribute it and/or
! #  modify it under the terms of the GNU Lesser General Public
! #  License as published by the Free Software Foundation; either
! #  version 2 of the License, or (at your option) any later version.
! #
! #  This library is distributed in the hope that it will be useful,
! #  but WITHOUT ANY WARRANTY; without even the implied warranty of
! #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
! #  Lesser General Public License for more details.
  #
! #  You should have received a copy of the GNU Lesser General Public
! #  License along with this library; if not, write to the Free Software
! #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
  #
! #  $Id$
  #
  
--- 1,9 ----
  #
! # = bio/db/genbank/genpept.rb - GenPept database class
  #
! # Copyright::  Copyright (C) 2002-2004 Toshiaki Katayama 
! # License::    Ruby's
  #
! # $Id$
  #
  



From k at dev.open-bio.org  Tue Sep 19 06:00:08 2006
From: k at dev.open-bio.org (Katayama Toshiaki)
Date: Tue, 19 Sep 2006 06:00:08 +0000
Subject: [BioRuby-cvs] bioruby/lib/bio/db/genbank refseq.rb,1.6,1.7
Message-ID: <200609190600.k8J608m5032245@dev.open-bio.org>

Update of /home/repository/bioruby/bioruby/lib/bio/db/genbank
In directory dev.open-bio.org:/tmp/cvs-serv32241/lib/bio/db/genbank

Modified Files:
	refseq.rb 
Log Message:
* license is changed from LGPL to Ruby's


Index: refseq.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/genbank/refseq.rb,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** refseq.rb	23 Aug 2004 23:40:35 -0000	1.6
--- refseq.rb	19 Sep 2006 06:00:06 -0000	1.7
***************
*** 1,22 ****
  #
! # bio/db/genbank/refseq.rb - RefSeq database class
! #
! #   Copyright (C) 2000-2004 KATAYAMA Toshiaki 
! #
! #  This library is free software; you can redistribute it and/or
! #  modify it under the terms of the GNU Lesser General Public
! #  License as published by the Free Software Foundation; either
! #  version 2 of the License, or (at your option) any later version.
! #
! #  This library is distributed in the hope that it will be useful,
! #  but WITHOUT ANY WARRANTY; without even the implied warranty of
! #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
! #  Lesser General Public License for more details.
  #
! #  You should have received a copy of the GNU Lesser General Public
! #  License along with this library; if not, write to the Free Software
! #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
  #
! #  $Id$
  #
  
--- 1,9 ----
  #
! # = bio/db/genbank/refseq.rb - RefSeq database class
  #
! # Copyright::  Copyright (C) 2000-2004 Toshiaki Katayama 
! # License::    Ruby's
  #
! # $Id$
  #
  



From k at dev.open-bio.org  Tue Sep 19 06:01:50 2006
From: k at dev.open-bio.org (Katayama Toshiaki)
Date: Tue, 19 Sep 2006 06:01:50 +0000
Subject: [BioRuby-cvs] bioruby/lib/bio/db/embl uniprot.rb, 1.3,
	1.4 swissprot.rb, 1.5, 1.6 trembl.rb, 1.5, 1.6
Message-ID: <200609190601.k8J61oDD032326@dev.open-bio.org>

Update of /home/repository/bioruby/bioruby/lib/bio/db/embl
In directory dev.open-bio.org:/tmp/cvs-serv32322/lib/bio/db/embl

Modified Files:
	uniprot.rb swissprot.rb trembl.rb 
Log Message:
* minor doc fix


Index: swissprot.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/embl/swissprot.rb,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** swissprot.rb	8 May 2006 14:23:51 -0000	1.5
--- swissprot.rb	19 Sep 2006 06:01:48 -0000	1.6
***************
*** 2,13 ****
  # = bio/db/embl/swissprot.rb - SwissProt database class
  # 
! # Copyright::   Copyright (C) 2001, 2002 KATAYAMA Toshiaki 
  # License::     Ruby's
  #
  #  $Id$
  #
  # == Description
  # 
! # Name space for SwissProt specific methods.
  #
  # SwissProt (before UniProtKB/SwissProt) specific methods are defined in 
--- 2,19 ----
  # = bio/db/embl/swissprot.rb - SwissProt database class
  # 
! # Copyright::   Copyright (C) 2001, 2002 Toshiaki Katayama 
  # License::     Ruby's
  #
  #  $Id$
  #
+ 
+ require 'bio/db/embl/sptr'
+ 
+ module Bio
+ 
  # == Description
  # 
! # Parser class for SwissProt database entry. See also Bio::SPTR class.
! # This class holds name space for SwissProt specific methods.
  #
  # SwissProt (before UniProtKB/SwissProt) specific methods are defined in 
***************
*** 29,39 ****
  #   http://au.expasy.org/sprot/userman.html
  # 
- 
- require 'bio/db/embl/sptr'
- 
- module Bio
- 
- # Parser class for SwissProt database entry.
- # See also Bio::SPTR class.
  class SwissProt < SPTR
    # Nothing to do (SwissProt format is abstracted in SPTR)
--- 35,38 ----

Index: trembl.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/embl/trembl.rb,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** trembl.rb	8 May 2006 14:24:27 -0000	1.5
--- trembl.rb	19 Sep 2006 06:01:48 -0000	1.6
***************
*** 2,13 ****
  # = bio/db/embl/trembl.rb - TrEMBL database class
  # 
! # Copyright::   Copyright (C) 2001, 2002 KATAYAMA Toshiaki 
! # License::     Ruby's
  #
! #  $Id$
  #
  # == Description
  #
! # Name space for TrEMBL specific methods.
  #
  # UniProtKB/SwissProt specific methods are defined in this class. 
--- 2,19 ----
  # = bio/db/embl/trembl.rb - TrEMBL database class
  # 
! # Copyright::  Copyright (C) 2001, 2002 Toshiaki Katayama 
! # License::    Ruby's
  #
! # $Id$
  #
+ 
+ require 'bio/db/embl/sptr'
+ 
+ module Bio
+ 
  # == Description
  #
! # Parser class for TrEMBL database entry. See also Bio::SPTR class.
! # This class holds name space for TrEMBL specific methods.
  #
  # UniProtKB/SwissProt specific methods are defined in this class. 
***************
*** 29,39 ****
  #   http://au.expasy.org/sprot/userman.html
  # 
- 
- require 'bio/db/embl/sptr'
- 
- module Bio
- 
- # Parser class for TrEMBL database entry.
- # See also Bio::SPTR class.
  class TrEMBL < SPTR
    # Nothing to do (TrEMBL format is abstracted in SPTR)
--- 35,38 ----

Index: uniprot.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/embl/uniprot.rb,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** uniprot.rb	8 May 2006 14:24:27 -0000	1.3
--- uniprot.rb	19 Sep 2006 06:01:48 -0000	1.4
***************
*** 2,13 ****
  # = bio/db/embl/uniprot.rb - UniProt database class
  # 
! # Copyright::   Copyright (C) 2005 KATAYAMA Toshiaki 
! # License::     Ruby's
  #
  #  $Id$
  #
  # == Description
  # 
! # Name space for UniProtKB/SwissProt specific methods.
  #
  # UniProtKB/SwissProt specific methods are defined in this class. 
--- 2,19 ----
  # = bio/db/embl/uniprot.rb - UniProt database class
  # 
! # Copyright::  Copyright (C) 2005 Toshiaki Katayama 
! # License::    Ruby's
  #
  #  $Id$
  #
+ 
+ require 'bio/db/embl/sptr'
+ 
+ module Bio
+ 
  # == Description
  # 
! # Parser class for SwissProt database entry.# See also Bio::SPTR class.
! # This class holds name space for UniProtKB/SwissProt specific methods.
  #
  # UniProtKB/SwissProt specific methods are defined in this class. 
***************
*** 28,39 ****
  # * The UniProtKB/SwissProt/TrEMBL User Manual
  #   http://www.expasy.org/sprot/userman.html
! 
! 
! require 'bio/db/embl/sptr'
! 
! module Bio
! 
! # Parser class for SwissProt database entry.
! # See also Bio::SPTR class.
  class UniProt < SPTR
    # Nothing to do (UniProt format is abstracted in SPTR)
--- 34,38 ----
  # * The UniProtKB/SwissProt/TrEMBL User Manual
  #   http://www.expasy.org/sprot/userman.html
! #
  class UniProt < SPTR
    # Nothing to do (UniProt format is abstracted in SPTR)



From k at dev.open-bio.org  Tue Sep 19 06:03:53 2006
From: k at dev.open-bio.org (Katayama Toshiaki)
Date: Tue, 19 Sep 2006 06:03:53 +0000
Subject: [BioRuby-cvs] bioruby/lib/bio/db prosite.rb, 0.15, 0.16 nbrf.rb, 1.8,
	1.9 medline.rb, 1.14, 1.15 litdb.rb, 0.8, 0.9 fasta.rb, 1.25, 1.26
Message-ID: <200609190603.k8J63rT3032479@dev.open-bio.org>

Update of /home/repository/bioruby/bioruby/lib/bio/db
In directory dev.open-bio.org:/tmp/cvs-serv32475/lib/bio/db

Modified Files:
	prosite.rb nbrf.rb medline.rb litdb.rb fasta.rb 
Log Message:
* minor doc fix


Index: prosite.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/prosite.rb,v
retrieving revision 0.15
retrieving revision 0.16
diff -C2 -d -r0.15 -r0.16
*** prosite.rb	25 Jul 2006 18:53:56 -0000	0.15
--- prosite.rb	19 Sep 2006 06:03:51 -0000	0.16
***************
*** 2,9 ****
  # = bio/db/prosite.rb - PROSITE database class
  #
! # Copyright::  Copyright (C) 2001 KATAYAMA Toshiaki 
  # Licence::    Ruby's
  #
! #  $Id$
  #
  
--- 2,9 ----
  # = bio/db/prosite.rb - PROSITE database class
[...978 lines suppressed...]
  
+   def re
+     self.class.pa2re(self.pa)
+   end
  
  
+   ### prosite profile to regular expression
+   #
+   # prosite/profile.txt:
+   #
+   # Returns
+   def ma2re(matrix)
+     raise NotImplementedError
    end
  
! end # PROSITE
! 
! end # Bio
  
  

Index: litdb.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/litdb.rb,v
retrieving revision 0.8
retrieving revision 0.9
diff -C2 -d -r0.8 -r0.9
*** litdb.rb	8 May 2006 14:22:12 -0000	0.8
--- litdb.rb	19 Sep 2006 06:03:51 -0000	0.9
***************
*** 2,9 ****
  # = bio/db/litdb.rb - LITDB database class
  #
! # Copyright::  Copyright (C) 2001 KATAYAMA Toshiaki 
  # License::    Ruby's
  #
! #  $Id$
  #
  
--- 2,9 ----
  # = bio/db/litdb.rb - LITDB database class
  #
! # Copyright::  Copyright (C) 2001 Toshiaki Katayama 
  # License::    Ruby's
  #
! # $Id$
  #
  

Index: fasta.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/fasta.rb,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** fasta.rb	22 Feb 2006 08:44:46 -0000	1.25
--- fasta.rb	19 Sep 2006 06:03:51 -0000	1.26
***************
*** 4,8 ****
  # Copyright::  Copyright (C) 2001, 2002
  #              GOTO Naohisa ,
! #              KATAYAMA Toshiaki 
  # Lisence::    Ruby's
  #
--- 4,8 ----
  # Copyright::  Copyright (C) 2001, 2002
  #              GOTO Naohisa ,
! #              Toshiaki Katayama 
  # Lisence::    Ruby's
  #

Index: medline.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/medline.rb,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** medline.rb	8 May 2006 14:22:41 -0000	1.14
--- medline.rb	19 Sep 2006 06:03:51 -0000	1.15
***************
*** 3,9 ****
  #
  # Copyright::  Copyright (C) 2001, 2005
! #              KATAYAMA Toshiaki 
  # License::    Ruby's
  #
  # == Description
  #
--- 3,16 ----
  #
  # Copyright::  Copyright (C) 2001, 2005
! #              Toshiaki Katayama 
  # License::    Ruby's
  #
+ # $Id$
+ #
+ 
+ require 'bio/db'
+ 
+ module Bio
+ 
  # == Description
  #
***************
*** 17,317 ****
  #   medilne.mesh
  #
! # $Id$
! #
! 
! require 'bio/db'
! 
! module Bio
! 
!   # NCBI PubMed/MEDLINE database class.
!   class MEDLINE < NCBIDB
  
!     # 
!     def initialize(entry)
!       @pubmed = Hash.new('')
  
!       tag = ''
!       entry.each_line do |line|
!         if line =~ /^\w/
!           tag = line[0,4].strip
!         end
!         @pubmed[tag] += line[6..-1] if line.length > 6
        end
      end
  
  
!     # returns a Reference object.
!     def reference
!       hash = Hash.new('')
  
!       hash['authors']	= authors
!       hash['title']	= title
!       hash['journal']	= journal
!       hash['volume']	= volume
!       hash['issue']	= issue
!       hash['pages']	= pages
!       hash['year']	= year
!       hash['pubmed']	= pmid
!       hash['medline']  	= ui
!       hash['abstract']	= abstract
!       hash['mesh']	= mesh
!       hash['affiliations'] = affiliations
  
!       hash.delete_if { |k, v| v.nil? or v.empty? }
  
!       return Reference.new(hash)
!     end
  
  
!     ### Common MEDLINE tags
  
!     # PMID - PubMed Unique Identifier
!     #   Unique number assigned to each PubMed citation.
!     def pmid
!       @pubmed['PMID'].strip
!     end
!     alias entry_id pmid
  
!     # UI   - MEDLINE Unique Identifier
!     #   Unique number assigned to each MEDLINE citation.
!     def ui
!       @pubmed['UI'].strip
!     end
  
!     # TA   - Journal Title Abbreviation
!     #   Standard journal title abbreviation.
!     def ta
!       @pubmed['TA'].gsub(/\s+/, ' ').strip
!     end
!     alias journal ta
  
!     # VI   - Volume
!     #   Journal volume.
!     def vi
!       @pubmed['VI'].strip
!     end
!     alias volume vi
  
!     # IP   - Issue
!     #   The number of the issue, part, or supplement of the journal in which
!     #   the article was published.
!     def ip
!       @pubmed['IP'].strip
!     end
!     alias issue ip
  
!     # PG   - Page Number
!     #   The full pagination of the article.
!     def pg
!       @pubmed['PG'].strip
!     end
  
!     def pages
!       pages = pg
!       if pages =~ /-/
!         from, to = pages.split('-')
!         if (len = from.length - to.length) > 0
!           to = from[0,len] + to
!         end
!         pages = "#{from}-#{to}"
        end
!       return pages
      end
  
!     # DP   - Publication Date
!     #   The date the article was published.
!     def dp
!       @pubmed['DP'].strip
!     end
!     alias date dp
  
!     def year
!       dp[0,4]
!     end
  
!     # TI   - Title Words
!     #   The title of the article.
!     def ti
!       @pubmed['TI'].gsub(/\s+/, ' ').strip
!     end
!     alias title ti
  
!     # AB   - Abstract
!     #   Abstract.
!     def ab
!       @pubmed['AB'].gsub(/\s+/, ' ').strip
!     end
!     alias abstract ab
  
!     # AU   - Author Name
!     #   Authors' names.
!     def au
!       @pubmed['AU'].strip
!     end
  
!     def authors
!       authors = []
!       au.split(/\n/).each do |author|
!         if author =~ / /
!           name = author.split(/\s+/)
!           suffix = name[-2] =~ /^[A-Z]+$/ ? name.pop : nil	# Jr etc.
!           initial = name.pop.split(//).join('. ')
!           author = "#{name.join(' ')}, #{initial}."
!         end
!         if suffix
!           author << " " + suffix
!         end
!         authors.push(author)
        end
!       return authors
      end
  
!     # SO   - Source
!     #   Composite field containing bibliographic information.
!     def so
!       @pubmed['SO'].strip
!     end
!     alias source so
  
!     # MH   - MeSH Terms
!     #   NLM's controlled vocabulary.
!     def mh
!       @pubmed['MH'].strip.split(/\n/)
!     end
!     alias mesh mh
  
!     # AD   - Affiliation
!     #   Institutional affiliation and address of the first author, and grant
!     #   numbers.
!     def ad
!       @pubmed['AD'].strip.split(/\n/)
!     end
!     alias affiliations ad
  
  
!     ### Other MEDLINE tags
  
!     # AID  - Article Identifier
!     #   Article ID values may include the pii (controlled publisher identifier)
!     #   or doi (Digital Object Identifier).
  
!     # CI   - Copyright Information
!     #   Copyright statement.
  
!     # CIN  - Comment In
!     #   Reference containing a comment about the article.
  
!     # CN   - Collective Name
!     #   Corporate author or group names with authorship responsibility.
  
!     # CON  - Comment On
!     #   Reference upon which the article comments.
  
!     # CY   - Country
!     #   The place of publication of the journal.
  
!     # DA   - Date Created
!     #   Used for internal processing at NLM.
  
!     # DCOM - Date Completed
!     #   Used for internal processing at NLM.
  
!     # DEP  - Date of Electronic Publication
!     #   Electronic publication date.
  
!     # EDAT - Entrez Date
!     #   The date the citation was added to PubMed.
  
!     # EIN  - Erratum In
!     #   Reference containing a published erratum to the article.
  
!     # GS   - Gene Symbol
!     #   Abbreviated gene names (used 1991 through 1996).
  
!     # ID   - Identification Number 
!     #   Research grant numbers, contract numbers, or both that designate
!     #   financial support by any agency of the US PHS (Public Health Service).
  
!     # IS   - ISSN
!     #   International Standard Serial Number of the journal.
  
!     # JC   - Journal Title Code
!     #   MEDLINE unique three-character code for the journal.
  
!     # JID  - NLM Unique ID
!     #   Unique journal ID in NLM's catalog of books, journals, and audiovisuals.
  
!     # LA   - Language
!     #   The language in which the article was published.
  
!     # LR   - Last Revision Date
!     #   The date a change was made to the record during a maintenance procedure.
  
!     # MHDA - MeSH Date
!     #   The date MeSH terms were added to the citation. The MeSH date is the
!     #   same as the Entrez date until MeSH are added.
  
!     # PHST - Publication History Status Date
!     #   History status date.
  
!     # PS   - Personal Name as Subject
!     #   Individual is the subject of the article.
  
!     # PST  - Publication Status
!     #   Publication status.
  
!     # PT   - Publication Type
!     #   The type of material the article represents.
!     def pt
!       @pubmed['PT'].strip.split(/\n/)   
!     end
!     alias publication_type pt
  
!     # RF   - Number of References
!     #   Number of bibliographic references for Review articles.
  
!     # RIN  - Retraction In
!     #   Retraction of the article
  
!     # RN   - EC/RN Number
!     #   Number assigned by the Enzyme Commission to designate a particular
!     #   enzyme or by the Chemical Abstracts Service for Registry Numbers.
  
!     # ROF  - Retraction Of
!     #   Article being retracted.
  
!     # RPF  - Republished From
!     #   Original article.
  
!     # SB   - Journal Subset
!     #   Code for a specific set of journals.
  
!     # SI   - Secondary Source Identifier
!     #   Identifies a secondary source that supplies information, e.g., other
!     #   data sources, databanks and accession numbers of molecular sequences
!     #   discussed in articles.
  
!     # TT   - Transliterated / Vernacular Title 
!     #   Non-Roman alphabet language titles are transliterated.
  
!     # UIN  - Update In
!     #   Update to the article.
  
!     # UOF  - Update Of
!     #   The article being updated.
  
!     # URLF - URL Full-Text
!     #   Link to the full-text of article at provider's website. Links are
!     #   incomplete. Use PmLink for the complete set of available links.
!     #   [PmLink] http://www.ncbi.nlm.nih.gov/entrez/utils/pmlink_help.html
  
!     # URLS - URL Summary
!     #   Link to the article summary at provider's website. Links are
!     #   incomplete. Use PmLink for the complete set of available links.
!     #   [PmLink] http://www.ncbi.nlm.nih.gov/entrez/utils/pmlink_help.html
  
!   end
  
! end
  
  
--- 24,316 ----
  #   medilne.mesh
  #
! class MEDLINE < NCBIDB
  
!   # 
!   def initialize(entry)
!     @pubmed = Hash.new('')
  
!     tag = ''
!     entry.each_line do |line|
!       if line =~ /^\w/
!         tag = line[0,4].strip
        end
+       @pubmed[tag] += line[6..-1] if line.length > 6
      end
+   end
  
  
!   # returns a Reference object.
!   def reference
!     hash = Hash.new('')
  
!     hash['authors']	= authors
!     hash['title']	= title
!     hash['journal']	= journal
!     hash['volume']	= volume
!     hash['issue']	= issue
!     hash['pages']	= pages
!     hash['year']	= year
!     hash['pubmed']	= pmid
!     hash['medline']  	= ui
!     hash['abstract']	= abstract
!     hash['mesh']	= mesh
!     hash['affiliations'] = affiliations
  
!     hash.delete_if { |k, v| v.nil? or v.empty? }
  
!     return Reference.new(hash)
!   end
  
  
!   ### Common MEDLINE tags
  
!   # PMID - PubMed Unique Identifier
!   #   Unique number assigned to each PubMed citation.
!   def pmid
!     @pubmed['PMID'].strip
!   end
!   alias entry_id pmid
  
!   # UI   - MEDLINE Unique Identifier
!   #   Unique number assigned to each MEDLINE citation.
!   def ui
!     @pubmed['UI'].strip
!   end
  
!   # TA   - Journal Title Abbreviation
!   #   Standard journal title abbreviation.
!   def ta
!     @pubmed['TA'].gsub(/\s+/, ' ').strip
!   end
!   alias journal ta
  
!   # VI   - Volume
!   #   Journal volume.
!   def vi
!     @pubmed['VI'].strip
!   end
!   alias volume vi
  
!   # IP   - Issue
!   #   The number of the issue, part, or supplement of the journal in which
!   #   the article was published.
!   def ip
!     @pubmed['IP'].strip
!   end
!   alias issue ip
  
!   # PG   - Page Number
!   #   The full pagination of the article.
!   def pg
!     @pubmed['PG'].strip
!   end
  
!   def pages
!     pages = pg
!     if pages =~ /-/
!       from, to = pages.split('-')
!       if (len = from.length - to.length) > 0
!         to = from[0,len] + to
        end
!       pages = "#{from}-#{to}"
      end
+     return pages
+   end
  
!   # DP   - Publication Date
!   #   The date the article was published.
!   def dp
!     @pubmed['DP'].strip
!   end
!   alias date dp
  
!   def year
!     dp[0,4]
!   end
  
!   # TI   - Title Words
!   #   The title of the article.
!   def ti
!     @pubmed['TI'].gsub(/\s+/, ' ').strip
!   end
!   alias title ti
  
!   # AB   - Abstract
!   #   Abstract.
!   def ab
!     @pubmed['AB'].gsub(/\s+/, ' ').strip
!   end
!   alias abstract ab
  
!   # AU   - Author Name
!   #   Authors' names.
!   def au
!     @pubmed['AU'].strip
!   end
  
!   def authors
!     authors = []
!     au.split(/\n/).each do |author|
!       if author =~ / /
!         name = author.split(/\s+/)
!         suffix = name[-2] =~ /^[A-Z]+$/ ? name.pop : nil	# Jr etc.
!         initial = name.pop.split(//).join('. ')
!         author = "#{name.join(' ')}, #{initial}."
        end
!       if suffix
!         author << " " + suffix
!       end
!       authors.push(author)
      end
+     return authors
+   end
  
!   # SO   - Source
!   #   Composite field containing bibliographic information.
!   def so
!     @pubmed['SO'].strip
!   end
!   alias source so
  
!   # MH   - MeSH Terms
!   #   NLM's controlled vocabulary.
!   def mh
!     @pubmed['MH'].strip.split(/\n/)
!   end
!   alias mesh mh
  
!   # AD   - Affiliation
!   #   Institutional affiliation and address of the first author, and grant
!   #   numbers.
!   def ad
!     @pubmed['AD'].strip.split(/\n/)
!   end
!   alias affiliations ad
  
  
!   ### Other MEDLINE tags
  
!   # AID  - Article Identifier
!   #   Article ID values may include the pii (controlled publisher identifier)
!   #   or doi (Digital Object Identifier).
  
!   # CI   - Copyright Information
!   #   Copyright statement.
  
!   # CIN  - Comment In
!   #   Reference containing a comment about the article.
  
!   # CN   - Collective Name
!   #   Corporate author or group names with authorship responsibility.
  
!   # CON  - Comment On
!   #   Reference upon which the article comments.
  
!   # CY   - Country
!   #   The place of publication of the journal.
  
!   # DA   - Date Created
!   #   Used for internal processing at NLM.
  
!   # DCOM - Date Completed
!   #   Used for internal processing at NLM.
  
!   # DEP  - Date of Electronic Publication
!   #   Electronic publication date.
  
!   # EDAT - Entrez Date
!   #   The date the citation was added to PubMed.
  
!   # EIN  - Erratum In
!   #   Reference containing a published erratum to the article.
  
!   # GS   - Gene Symbol
!   #   Abbreviated gene names (used 1991 through 1996).
  
!   # ID   - Identification Number 
!   #   Research grant numbers, contract numbers, or both that designate
!   #   financial support by any agency of the US PHS (Public Health Service).
  
!   # IS   - ISSN
!   #   International Standard Serial Number of the journal.
  
!   # JC   - Journal Title Code
!   #   MEDLINE unique three-character code for the journal.
  
!   # JID  - NLM Unique ID
!   #   Unique journal ID in NLM's catalog of books, journals, and audiovisuals.
  
!   # LA   - Language
!   #   The language in which the article was published.
  
!   # LR   - Last Revision Date
!   #   The date a change was made to the record during a maintenance procedure.
  
!   # MHDA - MeSH Date
!   #   The date MeSH terms were added to the citation. The MeSH date is the
!   #   same as the Entrez date until MeSH are added.
  
!   # PHST - Publication History Status Date
!   #   History status date.
  
!   # PS   - Personal Name as Subject
!   #   Individual is the subject of the article.
  
!   # PST  - Publication Status
!   #   Publication status.
  
!   # PT   - Publication Type
!   #   The type of material the article represents.
!   def pt
!     @pubmed['PT'].strip.split(/\n/)   
!   end
!   alias publication_type pt
  
!   # RF   - Number of References
!   #   Number of bibliographic references for Review articles.
  
!   # RIN  - Retraction In
!   #   Retraction of the article
  
!   # RN   - EC/RN Number
!   #   Number assigned by the Enzyme Commission to designate a particular
!   #   enzyme or by the Chemical Abstracts Service for Registry Numbers.
  
!   # ROF  - Retraction Of
!   #   Article being retracted.
  
!   # RPF  - Republished From
!   #   Original article.
  
!   # SB   - Journal Subset
!   #   Code for a specific set of journals.
  
!   # SI   - Secondary Source Identifier
!   #   Identifies a secondary source that supplies information, e.g., other
!   #   data sources, databanks and accession numbers of molecular sequences
!   #   discussed in articles.
  
!   # TT   - Transliterated / Vernacular Title 
!   #   Non-Roman alphabet language titles are transliterated.
  
!   # UIN  - Update In
!   #   Update to the article.
  
!   # UOF  - Update Of
!   #   The article being updated.
  
!   # URLF - URL Full-Text
!   #   Link to the full-text of article at provider's website. Links are
!   #   incomplete. Use PmLink for the complete set of available links.
!   #   [PmLink] http://www.ncbi.nlm.nih.gov/entrez/utils/pmlink_help.html
  
!   # URLS - URL Summary
!   #   Link to the article summary at provider's website. Links are
!   #   incomplete. Use PmLink for the complete set of available links.
!   #   [PmLink] http://www.ncbi.nlm.nih.gov/entrez/utils/pmlink_help.html
  
! end # MEDLINE
  
! end # Bio
  
  

Index: nbrf.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/nbrf.rb,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** nbrf.rb	22 Feb 2006 08:43:15 -0000	1.8
--- nbrf.rb	19 Sep 2006 06:03:51 -0000	1.9
***************
*** 3,7 ****
  #
  # Copyright:: Copyright (C) 2001-2003,2006 Naohisa Goto 
! #             Copyright (C) 2001-2002 KATAYAMA Toshiaki 
  # License::   Ruby's
  #
--- 3,7 ----
  #
  # Copyright:: Copyright (C) 2001-2003,2006 Naohisa Goto 
! #             Copyright (C) 2001-2002 Toshiaki Katayama 
  # License::   Ruby's
  #



From k at dev.open-bio.org  Tue Sep 19 06:08:28 2006
From: k at dev.open-bio.org (Katayama Toshiaki)
Date: Tue, 19 Sep 2006 06:08:28 +0000
Subject: [BioRuby-cvs] bioruby/lib/bio/appl/blast format8.rb,1.5,1.6
Message-ID: <200609190608.k8J68S7d032598@dev.open-bio.org>

Update of /home/repository/bioruby/bioruby/lib/bio/appl/blast
In directory dev.open-bio.org:/tmp/cvs-serv32594/lib/bio/appl/blast

Modified Files:
	format8.rb 
Log Message:
* license is changed from LGPL to Ruby's


Index: format8.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/appl/blast/format8.rb,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** format8.rb	8 Sep 2005 01:22:08 -0000	1.5
--- format8.rb	19 Sep 2006 06:08:26 -0000	1.6
***************
*** 1,22 ****
  #
! # bio/appl/blast/format8.rb - BLAST tab-delimited output (-m 8) parser
  # 
! #   Copyright (C) 2002,2003 KATAYAMA Toshiaki 
! #
! #  This library is free software; you can redistribute it and/or
! #  modify it under the terms of the GNU Lesser General Public
! #  License as published by the Free Software Foundation; either
! #  version 2 of the License, or (at your option) any later version.
  #
! #  This library is distributed in the hope that it will be useful,
! #  but WITHOUT ANY WARRANTY; without even the implied warranty of
! #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
! #  Lesser General Public License for more details.
  #
! #  You should have received a copy of the GNU Lesser General Public
! #  License along with this library; if not, write to the Free Software
! #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
  #
! #  $Id$
  #
  
--- 1,13 ----
  #
! # = bio/appl/blast/format8.rb - BLAST tab-delimited output (-m 8) parser
  # 
! # Copyright::  Copyright (C) 2002, 2003 Toshiaki Katayama 
! # License::    Ruby's
  #
! # $Id$
  #
! # == Note
  #
! # This file is automatically loaded by bio/appl/blast/report.rb
  #
  
***************
*** 89,95 ****
  
  
- =begin
- 
- This file is automatically loaded by bio/appl/blast/report.rb
- 
- =end
--- 80,81 ----



From k at dev.open-bio.org  Tue Sep 19 06:09:22 2006
From: k at dev.open-bio.org (Katayama Toshiaki)
Date: Tue, 19 Sep 2006 06:09:22 +0000
Subject: [BioRuby-cvs] bioruby/lib/bio/appl/blast report.rb,1.9,1.10
Message-ID: <200609190609.k8J69MFb032641@dev.open-bio.org>

Update of /home/repository/bioruby/bioruby/lib/bio/appl/blast
In directory dev.open-bio.org:/tmp/cvs-serv32637/lib/bio/appl/blast

Modified Files:
	report.rb 
Log Message:
* license is changed from LGPL to Ruby's
* document is changed to RDoc


Index: report.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/appl/blast/report.rb,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** report.rb	26 Sep 2005 13:00:04 -0000	1.9
--- report.rb	19 Sep 2006 06:09:20 -0000	1.10
***************
*** 1,22 ****
  #
! # bio/appl/blast/report.rb - BLAST Report class
  # 
! #   Copyright (C) 2003 KATAYAMA Toshiaki 
! #
! #  This library is free software; you can redistribute it and/or
! #  modify it under the terms of the GNU Lesser General Public
! #  License as published by the Free Software Foundation; either
! #  version 2 of the License, or (at your option) any later version.
! #
! #  This library is distributed in the hope that it will be useful,
! #  but WITHOUT ANY WARRANTY; without even the implied warranty of
! #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
! #  Lesser General Public License for more details.
! #
! #  You should have received a copy of the GNU Lesser General Public
! #  License along with this library; if not, write to the Free Software
! #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
  #
! #  $Id$
  #
  
--- 1,9 ----
  #
! # = bio/appl/blast/report.rb - BLAST Report class
  # 
! # Copyright::  Copyright (C) 2003 Toshiaki Katayama 
! # License::    Ruby's
  #
! # $Id$
  #
  
***************
*** 27,206 ****
  
  module Bio
!   class Blast
! 
!     class Report
  
!       # for Bio::FlatFile support (only for XML data)
!       DELIMITER = RS = "\n"
  
!       def self.xmlparser(data)
!         self.new(data, :xmlparser)
!       end
!       def self.rexml(data)
!         self.new(data, :rexml)
!       end
!       def self.tab(data)
!         self.new(data, :tab)
!       end
  
!       def auto_parse(data)
!         if /
!       def each_iteration
!         @iterations.each do |x|
!           yield x
!         end
        end
  
!       #  shortcut for the last iteration's hits
!       def each_hit
!         @iterations.last.each do |x|
!           yield x
!         end
!       end
!       alias each each_hit
  
!       # shortcut for the last iteration's hits
!       def hits
!         @iterations.last.hits
!       end
  
!       # shortcut for the last iteration's statistics
!       def statistics
!         @iterations.last.statistics
!       end
!       def db_num;	statistics['db-num'];			end
!       def db_len;	statistics['db-len'];			end
!       def hsp_len;	statistics['hsp-len'];			end
!       def eff_space;	statistics['eff-space'];		end
!       def kappa;	statistics['kappa'];			end
!       def lambda;	statistics['lambda'];			end
!       def entropy;	statistics['entropy'];			end
  
!       # shortcut for the last iteration's message (for checking 'CONVERGED')
!       def message
!         @iterations.last.message
!       end
  
  
!       # Bio::Blast::Report::Iteration
!       class Iteration
!         def initialize
!           @message = nil
!           @statistics = {}
!           @num = 1
!           @hits = []
!         end
!         attr_reader :hits, :statistics
!         attr_accessor :num, :message
  
!         def each
!           @hits.each do |x|
!             yield x
!           end
!         end
!       end
  
  
!       # Bio::Blast::Report::Hit
!       class Hit
!         def initialize
!           @hsps = []
!         end
!         attr_reader :hsps
!         attr_accessor :query_id, :query_def, :query_len,
!           :num, :hit_id, :len, :definition, :accession
  
!         def each
!           @hsps.each do |x|
!             yield x
!           end
!         end
  
!         # Compatible with Bio::Fasta::Report::Hit
  
-         alias target_id accession
-         alias target_def definition
-         alias target_len len
  
!         # Shortcut methods for the best Hsp
  
!         def evalue;		@hsps.first.evalue;		end
!         def bit_score;		@hsps.first.bit_score;		end
!         def identity;		@hsps.first.identity;		end
!         def percent_identity;	@hsps.first.percent_identity;	end
!         def overlap;		@hsps.first.align_len;		end
  
!         def query_seq;		@hsps.first.qseq;		end
!         def target_seq;		@hsps.first.hseq;		end
!         def midline;		@hsps.first.midline;		end
  
!         def query_start;	@hsps.first.query_from;		end
!         def query_end;		@hsps.first.query_to;		end
!         def target_start;	@hsps.first.hit_from;		end
!         def target_end;		@hsps.first.hit_to;		end
!         def lap_at
!           [ query_start, query_end, target_start, target_end ]
!         end
        end
  
  
!       # Bio::Blast::Report::Hsp
!       class Hsp
!         def initialize
!           @hsp = {}
!         end
!         attr_reader :hsp
!         attr_accessor :num, :bit_score, :score, :evalue,
!           :query_from, :query_to, :hit_from, :hit_to,
!           :pattern_from, :pattern_to, :query_frame, :hit_frame,
!           :identity, :positive, :gaps, :align_len, :density,
!           :qseq, :hseq, :midline,
!           :percent_identity, :mismatch_count	 # only for '-m 8'
        end
  
      end
    end
! end
  
  
--- 14,331 ----
  
  module Bio
! class Blast
  
! # = Bio::Blast::Report
! # 
! # Parsed results of the blast execution for Tab-delimited and XML output
! # format.  Tab-delimited reports are consists of
! # 
! #   Query id,
! #   Subject id,
! #   percent of identity,
! #   alignment length,
! #   number of mismatches (not including gaps),
! #   number of gap openings,
! #   start of alignment in query,
! #   end of alignment in query,
! #   start of alignment in subject,
! #   end of alignment in subject,
! #   expected value,
! #   bit score.
! # 
! # according to the MEGABLAST document (README.mbl).  As for XML output,
! # see the following DTDs.
! # 
! #   * http://www.ncbi.nlm.nih.gov/dtd/NCBI_BlastOutput.dtd
! #   * http://www.ncbi.nlm.nih.gov/dtd/NCBI_BlastOutput.mod
! #   * http://www.ncbi.nlm.nih.gov/dtd/NCBI_Entity.mod
! # 
! class Report
  
!   # for Bio::FlatFile support (only for XML data)
!   DELIMITER = RS = "\n"
  
!   # Specify to use XMLParser to parse XML (-m 7) output.
!   def self.xmlparser(data)
!     self.new(data, :xmlparser)
!   end
  
!   # Specify to use REXML to parse XML (-m 7) output.
!   def self.rexml(data)
!     self.new(data, :rexml)
!   end
  
!   # Specify to use tab delimited output parser.
!   def self.tab(data)
!     self.new(data, :tab)
!   end
  
!   def auto_parse(data)
!     if /

Update of /home/repository/bioruby/bioruby/lib/bio/appl/blast
In directory dev.open-bio.org:/tmp/cvs-serv32680/lib/bio/appl/blast

Modified Files:
	rexml.rb 
Log Message:
* license is changed from LGPL to Ruby's


Index: rexml.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/appl/blast/rexml.rb,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** rexml.rb	8 Sep 2005 01:22:08 -0000	1.10
--- rexml.rb	19 Sep 2006 06:10:19 -0000	1.11
***************
*** 1,23 ****
  #
! # bio/appl/blast/rexml.rb - BLAST XML output (-m 7) parser by REXML
  # 
! #   Copyright (C) 2002,2003 KATAYAMA Toshiaki 
! #
! #  This library is free software; you can redistribute it and/or
! #  modify it under the terms of the GNU Lesser General Public
! #  License as published by the Free Software Foundation; either
! #  version 2 of the License, or (at your option) any later version.
! #
! #  This library is distributed in the hope that it will be useful,
! #  but WITHOUT ANY WARRANTY; without even the implied warranty of
! #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
! #  Lesser General Public License for more details.
! #
! #  You should have received a copy of the GNU Lesser General Public
! #  License along with this library; if not, write to the Free Software
! #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
  #
! #  $Id$
  #
  
  begin
--- 1,14 ----
  #
! # = bio/appl/blast/rexml.rb - BLAST XML output (-m 7) parser by REXML
  # 
! # Copyright::  Copyright (C) 2002, 2003 Toshiaki Katayama 
! # License::    Ruby's
  #
! # $Id$
  #
+ # == Note
+ # 
+ # This file is automatically loaded by bio/appl/blast/report.rb
+ # 
  
  begin
***************
*** 145,151 ****
  
  
- =begin
- 
- This file is automatically loaded by bio/appl/blast/report.rb
- 
- =end
--- 136,137 ----



From k at dev.open-bio.org  Tue Sep 19 06:12:39 2006
From: k at dev.open-bio.org (Katayama Toshiaki)
Date: Tue, 19 Sep 2006 06:12:39 +0000
Subject: [BioRuby-cvs] bioruby/lib/bio/appl/blast xmlparser.rb, 1.14,
	1.15 wublast.rb, 1.7, 1.8 format0.rb, 1.18, 1.19
Message-ID: <200609190612.k8J6CdnS032763@dev.open-bio.org>

Update of /home/repository/bioruby/bioruby/lib/bio/appl/blast
In directory dev.open-bio.org:/tmp/cvs-serv32759/lib/bio/appl/blast

Modified Files:
	xmlparser.rb wublast.rb format0.rb 
Log Message:
* minor doc fix


Index: xmlparser.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/appl/blast/xmlparser.rb,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** xmlparser.rb	30 Apr 2006 07:11:28 -0000	1.14
--- xmlparser.rb	19 Sep 2006 06:12:37 -0000	1.15
***************
*** 2,10 ****
  # = bio/appl/blast/xmlparser.rb - BLAST XML output (-m 7) parser by XMLParser
  # 
! # Copyright::    Copyright (C) 2001 
! #                Mitsuteru C. Nakao 
! # Copyright::    Copyright (C) 2003 
! #                KATAYAMA Toshiaki 
! # Lisence::      Ruby's
  #
  # $Id$
--- 2,10 ----
  # = bio/appl/blast/xmlparser.rb - BLAST XML output (-m 7) parser by XMLParser
  # 
! # Copyright::  Copyright (C) 2001 
! #              Mitsuteru C. Nakao 
! # Copyright::  Copyright (C) 2003 
! #              Toshiaki Katayama 
! # Lisence::    Ruby's
  #
  # $Id$
***************
*** 19,32 ****
  # (format 7) based on the XMLParser and the REXML.
  #
- # == Examples
- #
- # == References
- #
- # * Blast
- #   http://
- #
- # * XMLParser
- #   http://
- #
  
  begin
--- 19,22 ----

Index: wublast.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/appl/blast/wublast.rb,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** wublast.rb	30 Apr 2006 05:47:25 -0000	1.7
--- wublast.rb	19 Sep 2006 06:12:37 -0000	1.8
***************
*** 2,18 ****
  # = bio/appl/blast/wublast.rb - WU-BLAST default output parser
  # 
! # Copyright:: Copyright (C) 2003 GOTO Naohisa 
! # License:: Ruby's
  #
! #  $Id$
  #
! #  WU-BLAST default output parser.
  #
! #  The parser is still incomplete and may contain many bugs,
! #  because I didn't have WU-BLAST license.
! #  It was tested under web-based WU-BLAST results and
! #  obsolete version downloaded from http://blast.wustl.edu/ .
  #
- # = References
  # * http://blast.wustl.edu/
  # * http://www.ebi.ac.uk/blast2/
--- 2,21 ----
  # = bio/appl/blast/wublast.rb - WU-BLAST default output parser
  # 
! # Copyright::  Copyright (C) 2003 GOTO Naohisa 
! # License::    Ruby's
  #
! # $Id$
  #
! # == Description
  #
! # WU-BLAST default output parser.
! #
! # The parser is still incomplete and may contain many bugs,
! # because I didn't have WU-BLAST license.
! # It was tested under web-based WU-BLAST results and
! # obsolete version downloaded from http://blast.wustl.edu/ .
! #
! # == References
  #
  # * http://blast.wustl.edu/
  # * http://www.ebi.ac.uk/blast2/

Index: format0.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/appl/blast/format0.rb,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** format0.rb	30 Apr 2006 05:47:59 -0000	1.18
--- format0.rb	19 Sep 2006 06:12:37 -0000	1.19
***************
*** 2,10 ****
  # = bio/appl/blast/format0.rb - BLAST default output (-m 0) parser
  # 
! # Author:: Naohisa GOTO
! # Copyright:: Copyright (C) 2003-2006 GOTO Naohisa 
! # License:: Ruby's
  #
! #  $Id$
  #
  # NCBI BLAST default (-m 0 option) output parser.
--- 2,11 ----
  # = bio/appl/blast/format0.rb - BLAST default output (-m 0) parser
  # 
! # Copyright::  Copyright (C) 2003-2006 GOTO Naohisa 
! # License::    Ruby's
  #
! # $Id$
! #
! # == Description
  #
  # NCBI BLAST default (-m 0 option) output parser.



From k at dev.open-bio.org  Tue Sep 19 06:13:56 2006
From: k at dev.open-bio.org (Katayama Toshiaki)
Date: Tue, 19 Sep 2006 06:13:56 +0000
Subject: [BioRuby-cvs] bioruby/lib/bio location.rb,0.25,0.26
Message-ID: <200609190613.k8J6DumA000360@dev.open-bio.org>

Update of /home/repository/bioruby/bioruby/lib/bio
In directory dev.open-bio.org:/tmp/cvs-serv356/lib/bio

Modified Files:
	location.rb 
Log Message:
* license is changed from LGPL to Ruby's
* minor doc fix


Index: location.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/location.rb,v
retrieving revision 0.25
retrieving revision 0.26
diff -C2 -d -r0.25 -r0.26
*** location.rb	4 May 2006 18:40:26 -0000	0.25
--- location.rb	19 Sep 2006 06:13:54 -0000	0.26
***************
*** 2,39 ****
  # = bio/location.rb - Locations/Location class (GenBank location format)
  #
! # Copyright::	Copyright (C) 2001, 2005 KATAYAMA Toshiaki 
  #                             2006 Jan Aerts 
! # License::	LGPL
  #
  # $Id$
  #
- # 
- #--
- #
- #  This library is free software; you can redistribute it and/or
- #  modify it under the terms of the GNU Lesser General Public
- #  License as published by the Free Software Foundation; either
- #  version 2 of the License, or (at your option) any later version.
- #
- #  This library is distributed in the hope that it will be useful,
- #  but WITHOUT ANY WARRANTY; without even the implied warranty of
- #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- #  Lesser General Public License for more details.
- #
- #  You should have received a copy of the GNU Lesser General Public
- #  License along with this library; if not, write to the Free Software
- #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- #
- #++
- #
  
  module Bio
  
! # = DESCRIPTION
  # The Bio::Location class describes the position of a genomic locus. Typically,
  # Bio::Location objects are created automatically when the user creates a
  # Bio::Locations object, instead of initialized directly.
  #
! # = USAGE
  #   location = Bio::Location.new('500..550')
  #   puts "start=" + location.from.to_s + ";end=" + location.to.to_s
--- 2,22 ----
  # = bio/location.rb - Locations/Location class (GenBank location format)
  #
! # Copyright::	Copyright (C) 2001, 2005 Toshiaki Katayama 
  #                             2006 Jan Aerts 
! # License::	Ruby's
  #
  # $Id$
  #
  
  module Bio
  
! # == Description
! #
  # The Bio::Location class describes the position of a genomic locus. Typically,
  # Bio::Location objects are created automatically when the user creates a
  # Bio::Locations object, instead of initialized directly.
  #
! # == Usage
! #
  #   location = Bio::Location.new('500..550')
  #   puts "start=" + location.from.to_s + ";end=" + location.to.to_s
***************
*** 44,47 ****
--- 27,31 ----
  #     puts "start=" + location.from.to_s + ";end=" + location.to.to_s
  #   end
+ #
  class Location
    include Comparable
***************
*** 165,174 ****
  end # class location
  
! # = DESCRIPTION
! # The Bio::Locations class is a container for Bio::Location objects: creating a 
! # Bio::Locations object (based on a GenBank style position string) will
! # spawn an array of Bio::Location objects.
  #
- # = USAGE
  #   locations = Bio::Locations.new('join(complement(500..550), 600..625)')
  #   locations.each do |location|
--- 149,160 ----
  end # class location
  
! # == Description
! #
! # The Bio::Locations class is a container for Bio::Location objects:
! # creating a Bio::Locations object (based on a GenBank style position string)
! # will spawn an array of Bio::Location objects.
! #
! # == Usage
  #
  #   locations = Bio::Locations.new('join(complement(500..550), 600..625)')
  #   locations.each do |location|
***************
*** 192,201 ****
  #  end
  #
! # = GENBANK LOCATION DESCRIPTOR CLASSIFICATION
  # 
  # === Definition of the position notation of the GenBank location format
  # 
! # According to the GenBank manual 'gbrel.txt', position notations were classified
! # into 10 patterns - (A) to (J).
  # 
  #       3.4.12.2 Feature Location
--- 178,187 ----
  #  end
  #
! # == GenBank location descriptor classification
  # 
  # === Definition of the position notation of the GenBank location format
  # 
! # According to the GenBank manual 'gbrel.txt', position notations were
! # classified into 10 patterns - (A) to (J).
  # 
  #       3.4.12.2 Feature Location
***************
*** 409,412 ****
--- 395,399 ----
  # * [ADR40FIB]	replace(510..520,	<= replace(510..520, "taatcctaccg")
  # * [RATDYIIAAB]	replace(1306..1443,"aagaacatccacggagtcagaactgggctcttcacgccggatttggcgttcgaggccattgtgaaaaagcaggcaatgcaccagcaagctcagttcctacccctgcgtggacctggttatccaggagctaatcagtacagttaggtggtcaagctgaaagagccctgtctgaaa")
+ #
  class Locations
    include Enumerable
***************
*** 486,491 ****
    # 
    # This method can for example be used to relate positions in a DNA-sequence
!   # with those in RNA. In this use, the optional ':aa'-flag returns the position
!   # of the associated amino-acid rather than the nucleotide.
    #   loc = Bio::Locations.new('complement(12838..13533)')
    #   puts loc.relative(13524)        # => 10
--- 473,479 ----
    # 
    # This method can for example be used to relate positions in a DNA-sequence
!   # with those in RNA. In this use, the optional ':aa'-flag returns the
!   # position of the associated amino-acid rather than the nucleotide.
!   #
    #   loc = Bio::Locations.new('complement(12838..13533)')
    #   puts loc.relative(13524)        # => 10
***************
*** 515,520 ****
    # 
    # This method can for example be used to relate positions in a DNA-sequence
!   # with those in RNA. In this use, the optional ':aa'-flag returns the position
!   # of the associated amino-acid rather than the nucleotide.
    #   loc = Bio::Locations.new('complement(12838..13533)')
    #   puts loc.absolute(10)          # => 13524
--- 503,509 ----
    # 
    # This method can for example be used to relate positions in a DNA-sequence
!   # with those in RNA. In this use, the optional ':aa'-flag returns the
!   # position of the associated amino-acid rather than the nucleotide.
!   #
    #   loc = Bio::Locations.new('complement(12838..13533)')
    #   puts loc.absolute(10)          # => 13524
***************
*** 613,617 ****
        end
  
!     when /^complement\((.*)\)$/			# (J) complement()
        position =       $1
        gbl_pos2loc(position).reverse_each do |location|
--- 602,606 ----
        end
  
!     when /^complement\((.*)\)$/				# (J) complement()
        position =       $1
        gbl_pos2loc(position).reverse_each do |location|
***************
*** 678,682 ****
        end
      end
!     return nil				# out of range
    end
  
--- 667,671 ----
        end
      end
!     return nil					# out of range
    end
  



From k at dev.open-bio.org  Tue Sep 19 06:14:20 2006
From: k at dev.open-bio.org (Katayama Toshiaki)
Date: Tue, 19 Sep 2006 06:14:20 +0000
Subject: [BioRuby-cvs] bioruby/lib/bio db.rb,0.34,0.35
Message-ID: <200609190614.k8J6EKwu000403@dev.open-bio.org>

Update of /home/repository/bioruby/bioruby/lib/bio
In directory dev.open-bio.org:/tmp/cvs-serv399/lib/bio

Modified Files:
	db.rb 
Log Message:
* minor doc fix


Index: db.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db.rb,v
retrieving revision 0.34
retrieving revision 0.35
diff -C2 -d -r0.34 -r0.35
*** db.rb	27 Feb 2006 09:13:08 -0000	0.34
--- db.rb	19 Sep 2006 06:14:18 -0000	0.35
***************
*** 2,8 ****
  # = bio/db.rb - common API for database parsers
  #
! # Copyright::	Copyright (C) 2001, 2002, 2005
! #		KATAYAMA Toshiaki 
! # License::	Ruby's
  #
  # $Id$
--- 2,8 ----
  # = bio/db.rb - common API for database parsers
  #
! # Copyright::  Copyright (C) 2001, 2002, 2005
! #              Toshiaki Katayama 
! # License::    Ruby's
  #
  # $Id$



From k at dev.open-bio.org  Tue Sep 19 06:17:21 2006
From: k at dev.open-bio.org (Katayama Toshiaki)
Date: Tue, 19 Sep 2006 06:17:21 +0000
Subject: [BioRuby-cvs] bioruby/lib/bio/shell/plugin codon.rb,1.13,1.14
Message-ID: <200609190617.k8J6HLCe000502@dev.open-bio.org>

Update of /home/repository/bioruby/bioruby/lib/bio/shell/plugin
In directory dev.open-bio.org:/tmp/cvs-serv496/lib/bio/shell/plugin

Modified Files:
	codon.rb 
Log Message:
* Pyrrolysine and Selenocysteine are supported in the color mode


Index: codon.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/shell/plugin/codon.rb,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** codon.rb	9 Feb 2006 20:48:53 -0000	1.13
--- codon.rb	19 Sep 2006 06:17:19 -0000	1.14
***************
*** 53,57 ****
        @table.each do |codon, aa|
          if aa == '*'
!           code = "STOP"
            aa = '' unless @cuhash
          else
--- 53,57 ----
        @table.each do |codon, aa|
          if aa == '*'
!           code = 'STOP'
            aa = '' unless @cuhash
          else
***************
*** 79,87 ****
  
          if aa == '*'
-           color_code = "#{@colors[:stop]}STOP"
            if @cuhash
              color_aa = "#{@colors[:stop]}#{aa}"
            else
!             color_aa = ''
            end
          else
--- 79,95 ----
  
          if aa == '*'
            if @cuhash
+             color_code = "#{@colors[:stop]}STOP"
              color_aa = "#{@colors[:stop]}#{aa}"
            else
!             color_code = "#{@colors[:stop]}STP"
!             case codon
!             when 'tga'
!               color_aa = "#{@colors[:text]}U"
!             when 'tag'
!               color_aa = "#{@colors[:text]}O"
!             else
!               color_aa = "#{@colors[:text]}*"
!             end
            end
          else



From k at dev.open-bio.org  Tue Sep 19 06:20:40 2006
From: k at dev.open-bio.org (Katayama Toshiaki)
Date: Tue, 19 Sep 2006 06:20:40 +0000
Subject: [BioRuby-cvs] bioruby/lib/bio/shell/plugin seq.rb,1.17,1.18
Message-ID: <200609190620.k8J6Ken1000619@dev.open-bio.org>

Update of /home/repository/bioruby/bioruby/lib/bio/shell/plugin
In directory dev.open-bio.org:/tmp/cvs-serv615/lib/bio/shell/plugin

Modified Files:
	seq.rb 
Log Message:
* sixtrans, skip, step methods are added


Index: seq.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/shell/plugin/seq.rb,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** seq.rb	9 Feb 2006 20:48:53 -0000	1.17
--- seq.rb	19 Sep 2006 06:20:38 -0000	1.18
***************
*** 42,45 ****
--- 42,54 ----
  
  
+   def sixtrans(str)
+     seq = seq(str)
+     [ 1, 2, 3, -1, -2, -3 ].each do |frame|
+       title = "Translation #{frame.to_s.rjust(2)}"
+       puts seq.translate(frame).to_fasta(title, 60)
+     end
+   end
+ 
+ 
    # Displays some basic properties of the sequence.
    def seqstat(str)
***************
*** 152,155 ****
--- 161,182 ----
  class String
  
+   def step(window_size)
+     i = 0
+     0.step(self.length - window_size, window_size) do |i|
+       yield self[i, window_size]
+     end
+     yield self[i + window_size .. -1] if i + window_size < self.length
+   end
+ 
+   def skip(window_size, step_size = 1)
+     i = 0
+     0.step(self.length - window_size, step_size) do |i|
+       yield [self[i, window_size], i + 1, i + window_size]
+     end
+     from = i + step_size
+     to  = [self.length, i + step_size + window_size].min
+     yield [self[from, window_size], from + 1, to] if from + 1 <= to
+   end
+ 
    def to_naseq
      Bio::Sequence::NA.new(self)



From k at dev.open-bio.org  Tue Sep 19 06:28:58 2006
From: k at dev.open-bio.org (Katayama Toshiaki)
Date: Tue, 19 Sep 2006 06:28:58 +0000
Subject: [BioRuby-cvs] bioruby/lib/bio/appl fasta.rb,1.22,1.23
Message-ID: <200609190628.k8J6Swhl000734@dev.open-bio.org>

Update of /home/repository/bioruby/bioruby/lib/bio/appl
In directory dev.open-bio.org:/tmp/cvs-serv730/lib/bio/appl

Modified Files:
	fasta.rb 
Log Message:
* license is changed from LGPL to Ruby's
* document is changed to RDoc


Index: fasta.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/appl/fasta.rb,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** fasta.rb	25 Jul 2006 18:48:41 -0000	1.22
--- fasta.rb	19 Sep 2006 06:28:56 -0000	1.23
***************
*** 1,22 ****
  #
! # bio/appl/fasta.rb - FASTA wrapper
! #
! #   Copyright (C) 2001,2002 KATAYAMA Toshiaki 
! #
! #  This library is free software; you can redistribute it and/or
! #  modify it under the terms of the GNU Lesser General Public
! #  License as published by the Free Software Foundation; either
! #  version 2 of the License, or (at your option) any later version.
! #
! #  This library is distributed in the hope that it will be useful,
! #  but WITHOUT ANY WARRANTY; without even the implied warranty of
! #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
! #  Lesser General Public License for more details.
  #
! #  You should have received a copy of the GNU Lesser General Public
! #  License along with this library; if not, write to the Free Software
! #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
  #
! #  $Id$
  #
  
--- 1,9 ----
  #
! # = bio/appl/fasta.rb - FASTA wrapper
  #
! # Copyright::  Copyright (C) 2001, 2002 Toshiaki Katayama 
! # License::    Ruby's
  #
! # $Id$
  #
  
***************
*** 28,177 ****
  module Bio
  
!   class Fasta
! 
!     autoload :Report, 'bio/appl/fasta/format10'
!     #autoload :?????,  'bio/appl/fasta/format6'
  
!     def initialize(program, db, opt = [], server = 'local')
!       @format	= 10
  
!       @program	= program
!       @db	= db
!       @server	= server
  
!       @ktup	= nil
!       @matrix	= nil
  
!       @output	= ''
  
!       begin
!         a = opt.to_ary
!       rescue NameError #NoMethodError
!         # backward compatibility
!         a = Shellwords.shellwords(opt)
!       end
!       @options	= [ '-Q', '-H', '-m', @format.to_s, *a ] # need -a ?
!     end
!     attr_accessor :program, :db, :options, :server, :ktup, :matrix
!     attr_reader :output
  
!     def option
        # backward compatibility
!       Bio::Command.make_command_line(@options)
      end
  
!     def option=(str)
!       # backward compatibility
!       @options = Shellwords.shellwords(str)
!     end
  
!     def format=(num)
!       @format = num.to_i
!       if i = @options.index('-m') then
!         @options[i+1, 1] = @format.to_s
!       else
!         @options << '-m' << @format.to_s
!       end
!     end
!     attr_reader :format
  
!     def self.parser(parser)
!       require "bio/appl/fasta/#{parser}"
!     end
  
!     def self.local(program, db, option = '')
!       self.new(program, db, option, 'local')
      end
  
!     def self.remote(program, db, option = '', server = 'genomenet')
!       self.new(program, db, option, server)
!     end
  
!     def query(query)
!       return self.send("exec_#{@server}", query.to_s)
!     end
  
  
!     private
  
  
!     def parse_result(data)
!       case @format
!       when 6
!         require 'bio/appl/fasta/format6'
!       when 10
!         require 'bio/appl/fasta/format10'
!       end
!       Report.new(data)
      end
  
  
!     def exec_local(query)
!       cmd = [ @program, *@options ]
!       cmd.concat([ '@', @db, @ktup ])
  
!       report = nil
  
!       @output = Bio::Command.query_command(cmd, query)
!       report = parse_result(@output)
  
!       return report
!     end
  
  
!     def exec_genomenet(query)
!       host = "fasta.genome.jp"
!       #path = "/sit-bin/nph-fasta"
!       path = "/sit-bin/fasta" #2005.08.12
  
!       form = {
!         'style'		=> 'raw',
!         'prog'		=> @program,
!         'dbname'	=> @db,
!         'sequence'	=> CGI.escape(query),
!         'other_param'	=> CGI.escape(Bio::Command.make_command_line_unix(@options)),
!         'ktup_value'	=> @ktup,
!         'matrix'	=> @matrix,
!       }
  
!       data = []
  
!       form.each do |k, v|
!         data.push("#{k}=#{v}") if v
!       end
  
!       report = nil
  
!       begin
!         http = Bio::Command.new_http(host)
!         http.open_timeout = 300
!         http.read_timeout = 600
!         result, = http.post(path, data.join('&'))
!         @output = result.body
!         # workaround 2005.08.12 - realized that this is bloken again (by new batch queuing system) 2006.06.08 
!         if /\Show all result\<\/A\>/i =~ @output.to_s then
!           result, = http.get($2)
!           @output = result.body
!           txt = @output.to_s.split(/\/)[1]
!           raise 'cannot understand response' unless txt
!           txt.sub!(/\<\/pre\>.*\z/m, '')
!           txt.sub!(/.*^((T?FASTA|SSEARCH) (searches|compares))/m, '\1')
!           txt.sub!(/^\.*\n/, '')
!           txt.gsub!(/\]+value\=\"[^\"]*\"[^\>]*\>/i, '')
!           txt.gsub!(/\<(a|form|select|input|option|img)\s+[^\>]+\>/i, '')
!           txt.gsub!(/\<\/(a|form|select|input|option|img)\>/i, '')
!           @output = txt.gsub(/\<\;/, '<')
!           report = parse_result(@output.dup)
!         else
!           raise 'cannot understand response'
          end
        end
! 
!       return report
      end
  
    end
  
! end
  
  
--- 15,219 ----
  module Bio
  
! class Fasta
  
!   #autoload :Report, 'bio/appl/fasta/format10'
!   #autoload :?????,  'bio/appl/fasta/format6'
  
!   # Returns a FASTA factory object (Bio::Fasta).
!   def initialize(program, db, opt = [], server = 'local')
!     @format	= 10
  
!     @program	= program
!     @db	= db
!     @server	= server
  
!     @ktup	= nil
!     @matrix	= nil
  
!     @output	= ''
  
!     begin
!       a = opt.to_ary
!     rescue NameError #NoMethodError
        # backward compatibility
!       a = Shellwords.shellwords(opt)
      end
+     @options	= [ '-Q', '-H', '-m', @format.to_s, *a ] # need -a ?
+   end
+   attr_accessor :program, :db, :options, :server, :ktup, :matrix
  
!   # Returns a String containing fasta execution output in as is format.
!   attr_reader :output
  
!   def option
!     # backward compatibility
!     Bio::Command.make_command_line(@options)
!   end
  
!   def option=(str)
!     # backward compatibility
!     @options = Shellwords.shellwords(str)
!   end
  
!   # Accessors for the -m option.
!   def format=(num)
!     @format = num.to_i
!     if i = @options.index('-m') then
!       @options[i+1, 1] = @format.to_s
!     else
!       @options << '-m' << @format.to_s
      end
+   end
+   attr_reader :format
  
!   # Select parser to use ('format6' and 'format10' is acceptable for now)
!   #
!   # This method will import Bio::Fasta::Report class by requiring specified
!   # parser and will be useful when you already have fasta output files and
!   # want to use appropriate Report class for parsing.
!   #
!   def self.parser(parser)
!     require "bio/appl/fasta/#{parser}"
!   end
  
!   # Returns a FASTA factory object (Bio::Fasta) to run FASTA search on
!   # local computer.
!   def self.local(program, db, option = '')
!     self.new(program, db, option, 'local')
!   end
  
+   # Returns a FASTA factory object (Bio::Fasta) to execute FASTA search on
+   # remote server.
+   #
+   # For the develpper, you can add server 'hoge' by adding
+   # exec_hoge(query) method.
+   #
+   def self.remote(program, db, option = '', server = 'genomenet')
+     self.new(program, db, option, server)
+   end
  
!   # Execute FASTA search and returns Report object (Bio::Fasta::Report).
!   def query(query)
!     return self.send("exec_#{@server}", query.to_s)
!   end
  
  
!   private
! 
! 
!   def parse_result(data)
!     case @format
!     when 6
!       require 'bio/appl/fasta/format6'
!     when 10
!       require 'bio/appl/fasta/format10'
      end
+     Report.new(data)
+   end
  
  
!   def exec_local(query)
!     cmd = [ @program, *@options ]
!     cmd.concat([ '@', @db, @ktup ])
  
!     report = nil
  
!     @output = Bio::Command.query_command(cmd, query)
!     report = parse_result(@output)
  
!     return report
!   end
  
  
!   # == Available databases for Fasta.remote(@program, @db, option, 'genomenet')
!   #
!   # See http://fasta.genome.jp/ideas/ideas.html#fasta for more details.
!   #
!   #   ----------+-------+---------------------------------------------------
!   #    @program | query | @db (supported in GenomeNet)
!   #   ----------+-------+---------------------------------------------------
!   #    fasta    | AA    | nr-aa, genes, vgenes.pep, swissprot, swissprot-upd,
!   #             |       | pir, prf, pdbstr
!   #             +-------+---------------------------------------------------
!   #             | NA    | nr-nt, genbank-nonst, gbnonst-upd, dbest, dbgss,
!   #             |       | htgs, dbsts, embl-nonst, embnonst-upd, epd,
!   #             |       | genes-nt, genome, vgenes.nuc
!   #   ----------+-------+---------------------------------------------------
!   #    tfasta   | AA    | nr-nt, genbank-nonst, gbnonst-upd, dbest, dbgss,
!   #             |       | htgs, dbsts, embl-nonst, embnonst-upd,
!   #             |       | genes-nt, genome, vgenes.nuc
!   #   ----------+-------+---------------------------------------------------
!   #
!   def exec_genomenet(query)
!     host = "fasta.genome.jp"
!     #path = "/sit-bin/nph-fasta"
!     path = "/sit-bin/fasta"  # 2005.08.12
  
!     form = {
!       'style'        => 'raw',
!       'prog'         => @program,
!       'dbname'       => @db,
!       'sequence'     => CGI.escape(query),
!       'other_param'  => CGI.escape(Bio::Command.make_command_line_unix(@options)),
!       'ktup_value'   => @ktup,
!       'matrix'       => @matrix,
!     }
  
!     data = []
  
!     form.each do |k, v|
!       data.push("#{k}=#{v}") if v
!     end
  
!     report = nil
  
!     begin
!       http = Bio::Command.new_http(host)
!       http.open_timeout = 3000
!       http.read_timeout = 6000
!       result, = http.post(path, data.join('&'))
!       # workaround 2006.8.1 - fixed for new batch queuing system
!       case result.code
!       when "302"
!         result_location = result.header['location']
!         result_uri = URI.parse(result_location)
!         result_path = result_uri.path
!         done = false
!         until done
!           result = http.get(result_path)
!           if result.body[/Your job ID is/]
!             sleep 15
!           else
!             done = true
!           end
          end
        end
!       @output = result.body.to_s
!       # workaround 2005.08.12
!       re = %r{Show all result} # "
!       if path = @output[re, 1]
!         result, = http.get(path)
!         @output = result.body
!         txt = @output.to_s.split(/\/)[1]
!         raise 'cannot understand response' unless txt
!         txt.sub!(/\<\/pre\>.*\z/m, '')
!         txt.sub!(/.*^((T?FASTA|SSEARCH) (searches|compares))/m, '\1')
!         txt.sub!(/^\.*\n/, '')
!         txt.gsub!(/\]+value\=\"[^\"]*\"[^\>]*\>/i, '')
!         txt.gsub!(/\<(a|form|select|input|option|img)\s+[^\>]+\>/i, '')
!         txt.gsub!(/\<\/(a|form|select|input|option|img)\>/i, '')
!         @output = txt.gsub(/\<\;/, '<')
!         report = parse_result(@output.dup)
!       else
!         raise 'cannot understand response'
!       end
      end
  
+     return report
    end
  
! end # Fasta
! 
! end # Bio
  
  
***************
*** 186,189 ****
--- 228,233 ----
  # serv = Bio::Fasta.local('fasta34', 'hoge.pep')
  # serv = Bio::Fasta.local('ssearch34', 'hoge.pep')
+ 
+   # This may take 3 minutes or so.
    serv = Bio::Fasta.remote('fasta', 'genes')
    p serv.query(ARGF.read)
***************
*** 191,260 ****
  
  
- =begin
- 
- = Bio::Fasta
- 
- --- Bio::Fasta.new(program, db, option = '', server = 'local')
- --- Bio::Fasta.local(program, db, option = '')
- --- Bio::Fasta.remote(program, db, option = '', server = 'genomenet')
- 
-       Returns a fasta factory object (Bio::Fasta).
- 
-       For the develpper, you can add server 'hoge' by adding
-       exec_hoge(query) method.
- 
- --- Bio::Fasta#query(query)
- 
-       Execute fasta search and returns Report object (Bio::Fasta::Report).
- 
- --- Bio::Fasta#output
- 
-       Returns a String containing fasta execution output in as is format.
- 
- --- Bio::Fasta#program
- --- Bio::Fasta#db
- --- Bio::Fasta#options
- --- Bio::Fasta#server
- --- Bio::Fasta#ktup
- 
-       Accessors for the factory parameters.
- 
- --- Bio::Fasta#option
- --- Bio::Fasta#option=(str)
- 
-       Get/set options by string.
- 
- --- Bio::Fasta#format
- --- Bio::Fasta#format=(number)
- 
-       Accessors for the -m option.
- 
- --- Bio::Fasta.parser(parser)
- 
-       Import Bio::Fasta::Report class by requiring specified parser.
- 
-       This class method will be useful when you already have fasta
-       output files and want to use appropriate Report class for parsing.
- 
- 
- == Available databases for Fasta.remote(@program, @db, option, 'genomenet')
- 
-   # ----------+-------+---------------------------------------------------
-   #  @program | query | @db (supported in GenomeNet)
-   # ----------+-------+---------------------------------------------------
-   #  fasta    | AA    | nr-aa, genes, vgenes.pep, swissprot, swissprot-upd,
-   #           |       | pir, prf, pdbstr
-   #           +-------+---------------------------------------------------
-   #           | NA    | nr-nt, genbank-nonst, gbnonst-upd, dbest, dbgss,
-   #           |       | htgs, dbsts, embl-nonst, embnonst-upd, epd,
-   #           |       | genes-nt, genome, vgenes.nuc
-   # ----------+-------+---------------------------------------------------
-   #  tfasta   | AA    | nr-nt, genbank-nonst, gbnonst-upd, dbest, dbgss,
-   #           |       | htgs, dbsts, embl-nonst, embnonst-upd,
-   #           |       | genes-nt, genome, vgenes.nuc
-   # ----------+-------+---------------------------------------------------
- 
- See http://fasta.genome.jp/ideas/ideas.html#fasta for more details.
- 
- =end
- 
--- 235,236 ----



From k at dev.open-bio.org  Tue Sep 19 06:29:39 2006
From: k at dev.open-bio.org (Katayama Toshiaki)
Date: Tue, 19 Sep 2006 06:29:39 +0000
Subject: [BioRuby-cvs] bioruby/lib/bio/appl hmmer.rb,1.6,1.7
Message-ID: <200609190629.k8J6Td4s000777@dev.open-bio.org>

Update of /home/repository/bioruby/bioruby/lib/bio/appl
In directory dev.open-bio.org:/tmp/cvs-serv773/lib/bio/appl

Modified Files:
	hmmer.rb 
Log Message:
* license is changed from LGPL to Ruby's


Index: hmmer.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/appl/hmmer.rb,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** hmmer.rb	14 Jul 2006 14:26:39 -0000	1.6
--- hmmer.rb	19 Sep 2006 06:29:37 -0000	1.7
***************
*** 3,48 ****
  # 
  # Copyright::   Copyright (C) 2002 
! #               KATAYAMA Toshiaki 
! # Lisence::     LGPL
  #
  # $Id$
  #
- # == Description
- #
- # A wrapper for the HMMER programs (hmmsearch or hmmpfam).
- #
- # == Examples
- #
- #   require 'bio'
- #   program = 'hmmsearch' # or 'hmmpfam'
- #   hmmfile = 'test.hmm'
- #   seqfile = 'test.faa'
- #   
- #   factory = Bio::HMMER.new(program, hmmfile, seqfile)
- #   p factory.query
- #
- # == References
- #
- # * HMMER
- #   http://hmmer.wustl.edu/
- #
- #--
- #
- #  This library is free software; you can redistribute it and/or
- #  modify it under the terms of the GNU Lesser General Public
- #  License as published by the Free Software Foundation; either
- #  version 2 of the License, or (at your option) any later version.
- #
- #  This library is distributed in the hope that it will be useful,
- #  but WITHOUT ANY WARRANTY; without even the implied warranty of
- #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- #  Lesser General Public License for more details.
- #
- #  You should have received a copy of the GNU Lesser General Public
- #  License along with this library; if not, write to the Free Software
- #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- #
- #++
- #
  
  require 'bio/command'
--- 3,11 ----
  # 
  # Copyright::   Copyright (C) 2002 
! #               Toshiaki Katayama 
! # Lisence::     Ruby's
  #
  # $Id$
  #
  
  require 'bio/command'
***************
*** 51,54 ****
--- 14,19 ----
  module Bio
  
+ # == Description
+ # 
  # A wapper for HMMER programs (hmmsearch or hmmpfam).
  #
***************
*** 62,66 ****
  #   factory = Bio::HMMER.new(program, hmmfile, seqfile)
  #   report = factory.query
! #   report.class #=> Bio::HMMER::Report
  #
  # === References
--- 27,31 ----
  #   factory = Bio::HMMER.new(program, hmmfile, seqfile)
  #   report = factory.query
! #   report.class # => Bio::HMMER::Report
  #
  # === References



From k at dev.open-bio.org  Tue Sep 19 06:30:44 2006
From: k at dev.open-bio.org (Katayama Toshiaki)
Date: Tue, 19 Sep 2006 06:30:44 +0000
Subject: [BioRuby-cvs] bioruby/lib/bio/appl psort.rb,1.11,1.12
Message-ID: <200609190630.k8J6UibD000820@dev.open-bio.org>

Update of /home/repository/bioruby/bioruby/lib/bio/appl
In directory dev.open-bio.org:/tmp/cvs-serv816/lib/bio/appl

Modified Files:
	psort.rb 
Log Message:
* added require 'uri'


Index: psort.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/appl/psort.rb,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** psort.rb	25 Jul 2006 18:41:23 -0000	1.11
--- psort.rb	19 Sep 2006 06:30:42 -0000	1.12
***************
*** 10,30 ****
  # $Id$
  #
- # == A client for PSORT WWW Server 
- #
- # A client for PSORT WWW Server for predicting protein subcellular 
- # localization.
- #
- # PSORT family members,
- # 1. PSORT
- # 2. PSORT II
- # 3. iPSORT
- # 4. PSORT-B  http://psort.org
- # 5. WoLF-PSORT
- #
- # See http://psort.ims.u-tokyo.ac.jp.
- #
- # === Example
- #
- #
  
  require 'bio/appl/psort/report'
--- 10,13 ----
***************
*** 32,37 ****
  autoload :Command, 'bio/command'
  require 'cgi'
  
! 
    #
    class PSORT
--- 15,35 ----
  autoload :Command, 'bio/command'
  require 'cgi'
+ require 'uri'
  
!   # == A client for PSORT WWW Server 
!   #
!   # A client for PSORT WWW Server for predicting protein subcellular 
!   # localization.
!   #
!   # PSORT family members,
!   # 1. PSORT
!   # 2. PSORT II
!   # 3. iPSORT
!   # 4. PSORT-B  http://psort.org
!   # 5. WoLF-PSORT
!   #
!   # == References
!   #
!   # * http://psort.hgc.jp/
    #
    class PSORT



From k at dev.open-bio.org  Tue Sep 19 06:31:10 2006
From: k at dev.open-bio.org (Katayama Toshiaki)
Date: Tue, 19 Sep 2006 06:31:10 +0000
Subject: [BioRuby-cvs] bioruby/lib/bio/appl blast.rb, 1.31, 1.32 emboss.rb,
	1.6, 1.7
Message-ID: <200609190631.k8J6VA9Y000845@dev.open-bio.org>

Update of /home/repository/bioruby/bioruby/lib/bio/appl
In directory dev.open-bio.org:/tmp/cvs-serv841/lib/bio/appl

Modified Files:
	blast.rb emboss.rb 
Log Message:
* minor doc fix


Index: emboss.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/appl/emboss.rb,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** emboss.rb	14 Jul 2006 14:28:44 -0000	1.6
--- emboss.rb	19 Sep 2006 06:31:08 -0000	1.7
***************
*** 2,25 ****
  # = bio/appl/emboss.rb - EMBOSS wrapper
  # 
! # Copyright (C):: 2002, 2005  KATAYAMA Toshiaki 
! # Copyright (C):: 2006        Aerts Jan 
! #
! # License::	Ruby's
  #
  # $Id$
  #
! # = DESCRIPTION
! #
! # This file holds classes pertaining to the EMBOSS software suite.
! #
! # = REFERENCES
! #
! # * http://emboss.sourceforge.net
! # * Rice P, Longden I and Bleasby A. \
! #    EMBOSS: the European Molecular Biology Open Software Suite. \
! #    Trends Genet. 2000 Jun ; 16(6): 276-7 
  module Bio
  
! # = DESCRIPTION
  #
  # This class provides a wrapper for the applications of the EMBOSS suite, which 
--- 2,17 ----
  # = bio/appl/emboss.rb - EMBOSS wrapper
  # 
! # Copyright::  Copyright (C) 2002, 2005 Toshiaki Katayama
! # Copyright::  Copyright (C) 2006       Jan Aerts 
! # License::    Ruby's
  #
  # $Id$
  #
! 
  module Bio
  
! # == Description
! #
! # This file holds classes pertaining to the EMBOSS software suite.
  #
  # This class provides a wrapper for the applications of the EMBOSS suite, which 
***************
*** 38,42 ****
  #
  #
! # = USAGE
  #
  #  require 'bio'
--- 30,34 ----
  #
  #
! # == Usage
  #
  #  require 'bio'
***************
*** 61,70 ****
  #  puts Bio::EMBOSS.entret('embl:xlrhodop')
  #
! # = PREREQUISITES
  #
  # You must have the EMBOSS suite installed locally. You can download from the
  # project website (see References below).
  #
! # = REFERENCES
  #
  # * http://emboss.sourceforge.net
--- 53,62 ----
  #  puts Bio::EMBOSS.entret('embl:xlrhodop')
  #
! # == Pre-requisites
  #
  # You must have the EMBOSS suite installed locally. You can download from the
  # project website (see References below).
  #
! # = Rereferences
  #
  # * http://emboss.sourceforge.net
***************
*** 72,75 ****
--- 64,68 ----
  #    EMBOSS: the European Molecular Biology Open Software Suite. \
  #    Trends Genet. 2000 Jun ; 16(6): 276-7 
+ #
  class EMBOSS
  

Index: blast.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/appl/blast.rb,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -d -r1.31 -r1.32
*** blast.rb	25 Jul 2006 18:47:13 -0000	1.31
--- blast.rb	19 Sep 2006 06:31:08 -0000	1.32
***************
*** 2,22 ****
  # = bio/appl/blast.rb - BLAST wrapper
  # 
! # Copyright (C)::  2001       Mitsuteru C. Nakao 
! # Copyright (C)::  2002,2003  KATAYAMA Toshiaki 
! # Copyright (C)::  2006       Jan Aerts 
! #
  # License::    Ruby's
  #
  # $Id$
  #
- # = DESCRIPTION
- #
- # This file holds the Bio::Blast class, which creates BLAST factories.
- #
- # = References
- #
- # * http://www.ncbi.nlm.nih.gov/blast/
- # * http://blast.genome.jp/ideas/ideas.html#blast
- #
  
  require 'net/http'
--- 2,12 ----
  # = bio/appl/blast.rb - BLAST wrapper
  # 
! # Copyright::  Copyright (C) 2001       Mitsuteru C. Nakao 
! # Copyright::  Copyright (C) 2002,2003  Toshiaki Katayama 
! # Copyright::  Copyright (C) 2006       Jan Aerts 
  # License::    Ruby's
  #
  # $Id$
  #
  
  require 'net/http'
***************
*** 27,31 ****
  module Bio
  
!   # = DESCRIPTION
    # 
    # The Bio::Blast class contains methods for running local or remote BLAST
--- 17,21 ----
  module Bio
  
!   # == Description
    # 
    # The Bio::Blast class contains methods for running local or remote BLAST
***************
*** 34,38 ****
    # program, see http://www.ncbi.nlm.nih.gov/Education/BLASTinfo/similarity.html.
    #
!   # = USAGE
    #
    #   require 'bio'
--- 24,28 ----
    # program, see http://www.ncbi.nlm.nih.gov/Education/BLASTinfo/similarity.html.
    #
!   # == Usage
    #
    #   require 'bio'
***************
*** 50,54 ****
    #   # Then, to parse the report, see Bio::Blast::Report
    #
!   # == Available databases for Bio::Blast.remote
    #
    #  ----------+-------+---------------------------------------------------
--- 40,44 ----
    #   # Then, to parse the report, see Bio::Blast::Report
    #
!   # === Available databases for Bio::Blast.remote
    #
    #  ----------+-------+---------------------------------------------------
***************
*** 64,68 ****
    #  ----------+-------+---------------------------------------------------
    #
!   # = SEE ALSO
    #
    # * Bio::Blast::Report
--- 54,58 ----
    #  ----------+-------+---------------------------------------------------
    #
!   # == See also
    #
    # * Bio::Blast::Report
***************
*** 70,75 ****
    # * Bio::Blast::Report::Hsp
    #
!   # = REFERENCE
    # 
    # * http://www.ncbi.nlm.nih.gov/Education/BLASTinfo/similarity.html
    # * http://blast.genome.jp/ideas/ideas.html#blast
--- 60,66 ----
    # * Bio::Blast::Report::Hsp
    #
!   # == References
    # 
+   # * http://www.ncbi.nlm.nih.gov/blast/
    # * http://www.ncbi.nlm.nih.gov/Education/BLASTinfo/similarity.html
    # * http://blast.genome.jp/ideas/ideas.html#blast



From ngoto at dev.open-bio.org  Mon Sep 25 08:09:24 2006
From: ngoto at dev.open-bio.org (Naohisa Goto)
Date: Mon, 25 Sep 2006 08:09:24 +0000
Subject: [BioRuby-cvs] bioruby/lib/bio/appl mafft.rb,1.10,1.11
Message-ID: <200609250809.k8P89OGD017000@dev.open-bio.org>

Update of /home/repository/bioruby/bioruby/lib/bio/appl
In directory dev.open-bio.org:/tmp/cvs-serv16959/appl

Modified Files:
	mafft.rb 
Log Message:
added "require 'tempfile'"


Index: mafft.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/appl/mafft.rb,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** mafft.rb	30 Apr 2006 05:50:19 -0000	1.10
--- mafft.rb	25 Sep 2006 08:09:22 -0000	1.11
***************
*** 31,34 ****
--- 31,35 ----
  #++
  require 'open3'
+ require 'tempfile'
  
  module Bio