[BioRuby-cvs] bioruby/lib/bio/db/kegg genome.rb,0.15,0.16
Katayama Toshiaki
k at dev.open-bio.org
Mon Jan 15 04:37:31 UTC 2007
Update of /home/repository/bioruby/bioruby/lib/bio/db/kegg
In directory dev.open-bio.org:/tmp/cvs-serv28666/lib/bio/db/kegg
Modified Files:
genome.rb
Log Message:
* disease, data_source, original_db methods are added
* scaffolds, gc, genomemap methods are obsoleted
Index: genome.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/kegg/genome.rb,v
retrieving revision 0.15
retrieving revision 0.16
diff -C2 -d -r0.15 -r0.16
*** genome.rb 19 Sep 2006 05:52:45 -0000 0.15
--- genome.rb 15 Jan 2007 04:37:29 -0000 0.16
***************
*** 2,6 ****
# = bio/db/kegg/genome.rb - KEGG/GENOME database class
#
! # Copyright:: Copyright (C) 2001, 2002 Toshiaki Katayama <k at bioruby.org>
# License:: Ruby's
#
--- 2,6 ----
# = bio/db/kegg/genome.rb - KEGG/GENOME database class
#
! # Copyright:: Copyright (C) 2001, 2002, 2007 Toshiaki Katayama <k at bioruby.org>
# License:: Ruby's
#
***************
*** 72,75 ****
--- 72,90 ----
end
+ # DATA_SOURCE -- Returns contents of the DATA_SOURCE record as a String.
+ def data_source
+ field_fetch('DATA_SOURCE')
+ end
+
+ # ORIGINAL_DB -- Returns contents of the ORIGINAL_DB record as a String.
+ def original_db
+ field_fetch('ORIGINAL_DB')
+ end
+
+ # DISEASE -- Returns contents of the COMMENT record as a String.
+ def disease
+ field_fetch('DISEASE')
+ end
+
# COMMENT -- Returns contents of the COMMENT record as a String.
def comment
***************
*** 99,104 ****
hash['journal'] = $1
hash['volume'] = $2
! hash['pages'] = $3
! hash['year'] = $5
hash['medline'] = $6
else
--- 114,119 ----
hash['journal'] = $1
hash['volume'] = $2
! hash['pages'] = $3
! hash['year'] = $5
hash['medline'] = $6
else
***************
*** 145,163 ****
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
--- 160,163 ----
***************
*** 167,177 ****
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
--- 167,175 ----
case line
when /nucleotides:\s+(\d+)/
! hash['num_nuc'] = $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
end
end
***************
*** 183,187 ****
# Returns number of nucleotides from the STATISTICS record as a Fixnum.
def nalen
! statistics['nalen']
end
alias length nalen
--- 181,185 ----
# Returns number of nucleotides from the STATISTICS record as a Fixnum.
def nalen
! statistics['num_nuc']
end
alias length nalen
***************
*** 197,210 ****
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
--- 195,198 ----
***************
*** 239,245 ****
%w( CHROMOSOME chromosomes ),
%w( PLASMID plasmids ),
! %w( SCAFFOLD plasmids ),
! %w( STATISTICS statistics nalen num_gene num_rna gc ),
! %w( GENOMEMAP genomemap ),
].each do |x|
puts "### " + x.shift
--- 227,231 ----
%w( CHROMOSOME chromosomes ),
%w( PLASMID plasmids ),
! %w( STATISTICS statistics nalen num_gene num_rna ),
].each do |x|
puts "### " + x.shift
More information about the bioruby-cvs
mailing list