[BioRuby-cvs] bioruby/lib/bio/db/embl common.rb,1.4,1.5
Mitsuteru C. Nakao
nakao at pub.open-bio.org
Sun Oct 23 05:25:19 EDT 2005
Update of /home/repository/bioruby/bioruby/lib/bio/db/embl
In directory pub.open-bio.org:/tmp/cvs-serv18789/lib/bio/db/embl
Modified Files:
common.rb
Log Message:
* Chaged to rdoc format.
* Bio::EMBL::Common changed to Bio::EMBLDB::Common.
Index: common.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/embl/common.rb,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** common.rb 26 Sep 2005 13:00:06 -0000 1.4
--- common.rb 23 Oct 2005 09:25:16 -0000 1.5
***************
*** 1,6 ****
#
! # bio/db/embl.rb - Common methods for EMBL style database classes
#
! # Copyright (C) 2001-2004 Mitsuteru C. Nakao <n at bioruby.org>
#
# This library is free software; you can redistribute it and/or
--- 1,54 ----
#
! # = bio/db/embl.rb - Common methods for EMBL style database classes
! #
! # Author:: Mitsuteru C. Nakao <n at bioruby.org>
! # Copyright:: Copyright (C) 2001-2005 BioRuby Project
! # License:: LGPL
! #
! # $Id$
! #
! # == EMBL style databases class
! #
! # This module defines a common framework among EMBL, SWISS-PROT, TrEMBL.
! # For more details, see the documentations in each embl/*.rb libraries.
! #
! # EMBL style format:
! # ID - identification (begins each entry; 1 per entry)
! # AC - accession number (>=1 per entry)
! # SV - sequence version (1 per entry)
! # DT - date (2 per entry)
! # DE - description (>=1 per entry)
! # KW - keyword (>=1 per entry)
! # OS - organism species (>=1 per entry)
! # OC - organism classification (>=1 per entry)
! # OG - organelle (0 or 1 per entry)
! # RN - reference number (>=1 per entry)
! # RC - reference comment (>=0 per entry)
! # RP - reference positions (>=1 per entry)
! # RX - reference cross-reference (>=0 per entry)
! # RA - reference author(s) (>=1 per entry)
! # RG - reference group (>=0 per entry)
! # RT - reference title (>=1 per entry)
! # RL - reference location (>=1 per entry)
! # DR - database cross-reference (>=0 per entry)
! # FH - feature table header (0 or 2 per entry)
! # FT - feature table data (>=0 per entry)
! # CC - comments or notes (>=0 per entry)
! # XX - spacer line (many per entry)
! # SQ - sequence header (1 per entry)
! # bb - (blanks) sequence data (>=1 per entry)
! # // - termination line (ends each entry; 1 per entry)
#
! #
! # == Example
! #
! # require 'bio/db/embl/common'
! # module Bio
! # class NEWDB < EMBLDB
! # include Bio::EMBLDB::Common
! # end
! # end
! #
! #--
#
# This library is free software; you can redistribute it and/or
***************
*** 18,28 ****
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
! # $Id$
#
require 'bio/db'
module Bio
! class EMBL < EMBLDB
module Common
--- 66,77 ----
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
! #++
#
require 'bio/db'
+ require 'bio/reference'
module Bio
! class EMBLDB
module Common
***************
*** 34,48 ****
end
!
# AC Line
! # "AC A12345; B23456;"
! # AC [AC1;]+
#
# Accession numbers format:
! # 1 2 3 4 5 6
! # [O,P,Q] [0-9] [A-Z, 0-9] [A-Z, 0-9] [A-Z, 0-9] [0-9]
! #
! # Bio::EMBL::Common#ac -> Array
! # #accessions -> Array
def ac
unless @data['AC']
--- 83,95 ----
end
! # returns a Array of accession numbers in the AC lines.
! #
# AC Line
! # "AC A12345; B23456;"
! # AC [AC1;]+
#
# Accession numbers format:
! # 1 2 3 4 5 6
! # [O,P,Q] [0-9] [A-Z, 0-9] [A-Z, 0-9] [A-Z, 0-9] [0-9]
def ac
unless @data['AC']
***************
*** 57,61 ****
alias accessions ac
! # Bio::EMBL::Common#accession -> String
def accession
ac[0]
--- 104,109 ----
alias accessions ac
!
! # returns the first accession number in the AC lines
def accession
ac[0]
***************
*** 63,67 ****
! # DE Line:
def de
unless @data['DE']
--- 111,117 ----
! # returns a String int the DE line.
! #
! # DE Line
def de
unless @data['DE']
***************
*** 71,96 ****
end
alias description de
! # API
! alias definition de
! # OS Line; organism species (>=1)
! # "OS Trifolium repens (white clover)"
! #
! # OS Genus species (name).
! # OS Genus species (name0) (name1).
! # OS Genus species (name0) (name1).
! # OS Genus species (name0), G s0 (name0), and G s (name1).
#
! # Bio::EMBL#os -> Array w/in Hash
! # [{'name'=>'Human', 'os'=>'Homo sapiens'},
! # {'name'=>'Rat', 'os'=>'Rattus norveticus'}]
! # Bio::STPR#os[0]['name'] => "Human"
! # Bio::STPR#os[0] => {'name'=>"Human", 'os'=>'Homo sapiens'}
! # Bio::STPR#os(0) => "Homo sapiens (Human)"
#
! # Bio::SPTR#os -> Array w/in Hash
! # Bio::SPTR#os(num) -> String
def os(num = nil)
unless @data['OS']
--- 121,144 ----
end
alias description de
! alias definition de # API
! # returns contents in the OS line.
! # * Bio::EMBLDB#os -> Array of <OS Hash>
! # where <OS Hash> is:
! # [{'name'=>'Human', 'os'=>'Homo sapiens'},
! # {'name'=>'Rat', 'os'=>'Rattus norveticus'}]
! # * Bio::SPTR#os[0]['name'] => "Human"
! # * Bio::SPTR#os[0] => {'name'=>"Human", 'os'=>'Homo sapiens'}
! # * Bio::STPR#os(0) => "Homo sapiens (Human)"
#
! # OS Line; organism species (>=1)
! # "OS Trifolium repens (white clover)"
#
! # OS Genus species (name).
! # OS Genus species (name0) (name1).
! # OS Genus species (name0) (name1).
! # OS Genus species (name0), G s0 (name0), and G s (name1).
def os(num = nil)
unless @data['OS']
***************
*** 115,121 ****
! # OG Line; organella (0 or 1/entry)
#
! # Bio::EMBL::Common#og -> Array
def og
unless @data['OG']
--- 163,170 ----
! # returns contents in the OG line.
! # * Bio::EMBLDB::Common#og -> [ <ogranella String>* ]
#
! # OG Line; organella (0 or 1/entry)
def og
unless @data['OG']
***************
*** 130,140 ****
@data['OG']
end
!
# OC Line; organism classification (>=1)
! # OC Eukaryota; Alveolata; Apicomplexa; Piroplasmida; Theileriidae;
! # OC Theileria.
! #
! # Bio::EMBL::Common#oc -> Array
def oc
unless @data['OC']
--- 179,189 ----
@data['OG']
end
+
! # returns contents in the OC line.
! # * Bio::EMBLDB::Common#oc -> [ <organism class String>* ]
# OC Line; organism classification (>=1)
! # OC Eukaryota; Alveolata; Apicomplexa; Piroplasmida; Theileriidae;
! # OC Theileria.
def oc
unless @data['OC']
***************
*** 150,158 ****
end
!
# KW Line; keyword (>=1)
! # KW [Keyword;]+
! # Bio::EMBL::Common#kw -> Array
! # #keywords -> Array
def kw
unless @data['KW']
--- 199,206 ----
end
! # returns keywords in the KW line.
! # * Bio::EMBLDB::Common#kw -> [ <keyword>* ]
# KW Line; keyword (>=1)
! # KW [Keyword;]+
def kw
unless @data['KW']
***************
*** 169,175 ****
# R Lines
! # RN RC RP RX RA RT RL RG
! # Bio::EMBL::Common#ref -> Array
def ref
unless @data['R']
--- 217,228 ----
+ # returns contents in the R lines.
+ # * Bio::EMBLDB::Common#ref -> [ <refernece information Hash>* ]
+ # where <reference information Hash> is:
+ # {'RN' => '', 'RC' => '', 'RP' => '', 'RX' => '',
+ # 'RA' => '', 'RT' => '', 'RL' => '', 'RG' => ''}
+ #
# R Lines
! # * RN RC RP RX RA RT RL RG
def ref
unless @data['R']
***************
*** 199,203 ****
end
! # Bio::EMBL::Common#references -> Bio::References
def references
unless @data['references']
--- 252,257 ----
end
! # returns Bio::Reference object from Bio::EMBLDB::Common#ref.
! # * Bio::EMBLDB::Common#ref -> Bio::References
def references
unless @data['references']
***************
*** 235,244 ****
!
# DR Line; defabases cross-reference (>=0)
# a cross_ref pre one line
! # "DR database_identifier; primary_identifier; secondary_identifier."
! # Bio::EMBL::Common#dr -> Hash w/in Array
! # Bio::EMBL::Common#dr {|k,v| }
def dr
unless @data['DR']
--- 289,300 ----
! # returns contents in the DR line.
! # * Bio::EMBLDB::Common#dr -> [ <Database cross-reference Hash>* ]
! # where <Database cross-reference Hash> is:
! # * Bio::EMBLDB::Common#dr {|k,v| }
! #
# DR Line; defabases cross-reference (>=0)
# a cross_ref pre one line
! # "DR database_identifier; primary_identifier; secondary_identifier."
def dr
unless @data['DR']
***************
*** 262,342 ****
end # module Common
! end # class EMBL
end # module Bio
-
-
- # ID - identification (begins each entry; 1 per entry)
- # AC - accession number (>=1 per entry)
- # SV - sequence version (1 per entry)
- # DT - date (2 per entry)
- # DE - description (>=1 per entry)
- # KW - keyword (>=1 per entry)
- # OS - organism species (>=1 per entry)
- # OC - organism classification (>=1 per entry)
- # OG - organelle (0 or 1 per entry)
- # RN - reference number (>=1 per entry)
- # RC - reference comment (>=0 per entry)
- # RP - reference positions (>=1 per entry)
- # RX - reference cross-reference (>=0 per entry)
- # RA - reference author(s) (>=1 per entry)
- # RG - reference group (>=0 per entry)
- # RT - reference title (>=1 per entry)
- # RL - reference location (>=1 per entry)
- # DR - database cross-reference (>=0 per entry)
- # FH - feature table header (0 or 2 per entry)
- # FT - feature table data (>=0 per entry)
- # CC - comments or notes (>=0 per entry)
- # XX - spacer line (many per entry)
- # SQ - sequence header (1 per entry)
- # bb - (blanks) sequence data (>=1 per entry)
- # // - termination line (ends each entry; 1 per entry)
-
-
- =begin
-
- = Bio::EMBL::Common
-
- This module defines a common framework among EMBL, SWISS-PROT, TrEMBL.
- For more details, see the documentations in each embl/*.rb libraries.
-
-
- --- Bio::EMBL::Common::DELIMITER
- --- Bio::EMBL::Common::RS
- --- Bio::EMBL::Common::TAGSIZE
-
-
- --- Bio::EMBL::Common#ac
- #accessions
-
- --- Bio::EMBL::Common#accession
-
-
- --- Bio::EMBL::Common#de
- #description
- #definition
-
-
- --- Bio::EMBL::Common#os
-
-
- --- Bio::EMBL::Common#og
-
-
- --- Bio::EMBL::Common#oc
-
-
- --- Bio::EMBL::Common#kw
- #keywords
-
-
- --- Bio::EMBL::Common#ref
- Reterns R* lines in hsh w/in ary.
-
- --- Bio::EMBL::Common#references
- Retruns Bio::References.
-
-
- --- Bio::EMBL::Common#dr
-
- =end
--- 318,322 ----
end # module Common
! end # class EMBLDB
end # module Bio
More information about the bioruby-cvs
mailing list