Sha256: 8317e99c04999c216d5234034ecbfad0c679ca42d5e8793aab551fc8cfba2f7b

Contents?: true

Size: 1.22 KB

Versions: 33

Compression:

Stored size: 1.22 KB

Contents

#
# = bio/db/genbank/genpept.rb - GenPept database class
#
# Copyright::  Copyright (C) 2002-2004 Toshiaki Katayama <k@bioruby.org>
# License::    The Ruby License
#
# $Id: genpept.rb,v 1.12 2007/04/05 23:35:40 trevor Exp $
#

require 'bio/db/genbank/common'
require 'bio/db/genbank/genbank'

module Bio
class GenPept < NCBIDB

  include Bio::NCBIDB::Common

  # LOCUS
  class Locus
    def initialize(locus_line)
      @entry_id = locus_line[12..27].strip
      @length   = locus_line[29..39].to_i
      @circular = locus_line[55..62].strip	# always linear
      @division = locus_line[63..66].strip
      @date     = locus_line[68..78].strip
    end
    attr_accessor :entry_id, :length, :circular, :division, :date
  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


  # ORIGIN
  def seq
    unless @data['SEQUENCE']
      origin
    end
    Bio::Sequence::AA.new(@data['SEQUENCE'])
  end
  alias aaseq seq
  alias aalen length

  def seq_len
    seq.length
  end

  # DBSOURCE
  def dbsource
    get('DBSOURCE')
  end

end # GenPept
end # Bio

Version data entries

33 entries across 33 versions & 5 rubygems

Version Path
bio-2.0.5 lib/bio/db/genbank/genpept.rb
bio-2.0.4 lib/bio/db/genbank/genpept.rb
bio-2.0.3 lib/bio/db/genbank/genpept.rb
bio-2.0.2 lib/bio/db/genbank/genpept.rb
bio-2.0.1 lib/bio/db/genbank/genpept.rb
bio-2.0.0 lib/bio/db/genbank/genpept.rb
bio-1.6.0.pre.20181210 lib/bio/db/genbank/genpept.rb
bio-1.5.2 lib/bio/db/genbank/genpept.rb
bio-1.5.1 lib/bio/db/genbank/genpept.rb
bio-1.5.0 lib/bio/db/genbank/genpept.rb
bioruby-bio-1.2.9.9001 lib/bio/db/genbank/genpept.rb
bioruby-bio-1.2.9.9501 lib/bio/db/genbank/genpept.rb
bioruby-bio-1.3.0.5000 lib/bio/db/genbank/genpept.rb
bioruby-bio-1.3.0.9901 lib/bio/db/genbank/genpept.rb
bioruby-bio-1.3.0 lib/bio/db/genbank/genpept.rb
bioruby-bio-1.3.1.5000 lib/bio/db/genbank/genpept.rb
jandot-bio-1.2.1 lib/bio/db/genbank/genpept.rb
ngoto-bio-1.2.9.9001 lib/bio/db/genbank/genpept.rb
ngoto-bio-1.2.9.9501 lib/bio/db/genbank/genpept.rb
ngoto-bio-1.3.0.5000 lib/bio/db/genbank/genpept.rb