Sha256: 772cf05b299a463368c70cb9775acd334b3223844869252d610958a4e243f423

Contents?: true

Size: 1.28 KB

Versions: 17

Compression:

Stored size: 1.28 KB

Contents

#
# = bio/sequence/dblink.rb - sequence ID with database name
#
# Copyright::  Copyright (C) 2008
#              Naohisa Goto <ng@bioruby.org>
# License::    The Ruby License
#
# $Id: dblink.rb,v 1.1.2.1 2008/06/17 15:44:22 ngoto Exp $
#

require 'bio/sequence'

# Bio::Sequence::DBLink stores IDs with the database name.
# Its main purpose is to store database cross-reference information
# for a sequence entry.
class Bio::Sequence::DBLink

  # creates a new DBLink object
  def initialize(database, primary_id, *secondary_ids)
    @database = database
    @id = primary_id
    @secondary_ids = secondary_ids
  end

  # Database name, or namespace identifier (String).
  attr_reader :database

  # Primary identifier (String)
  attr_reader :id

  # Secondary identifiers (Array of String)
  attr_reader :secondary_ids

  #--
  # class methods
  #++

  # Parses DR line in EMBL entry, and returns a DBLink object.
  def self.parse_embl_DR_line(str)
    str = str.sub(/\.\s*\z/, '')
    str.sub!(/\ADR   /, '')
    self.new(*(str.split(/\s*\;\s*/, 3)))
  end

  # Parses DR line in UniProt entry, and returns a DBLink object.
  def self.parse_uniprot_DR_line(str)
    str = str.sub(/\.\s*\z/, '')
    str.sub!(/\ADR   /, '')
    self.new(*(str.split(/\s*\;\s*/)))
  end

end #class Bio::Sequence::DBLink


Version data entries

17 entries across 17 versions & 4 rubygems

Version Path
bioruby-bio-1.2.9.9001 lib/bio/sequence/dblink.rb
bioruby-bio-1.2.9.9501 lib/bio/sequence/dblink.rb
bioruby-bio-1.3.0.5000 lib/bio/sequence/dblink.rb
bioruby-bio-1.3.0.9901 lib/bio/sequence/dblink.rb
bioruby-bio-1.3.0 lib/bio/sequence/dblink.rb
bioruby-bio-1.3.1.5000 lib/bio/sequence/dblink.rb
ngoto-bio-1.2.9.9001 lib/bio/sequence/dblink.rb
ngoto-bio-1.2.9.9501 lib/bio/sequence/dblink.rb
ngoto-bio-1.3.0.5000 lib/bio/sequence/dblink.rb
ngoto-bio-1.3.0 lib/bio/sequence/dblink.rb
ngoto-bio-1.3.1.5000 lib/bio/sequence/dblink.rb
wwood-bioruby-1.2.11 lib/bio/sequence/dblink.rb
bio-1.4.2 lib/bio/sequence/dblink.rb
bio-1.4.1 lib/bio/sequence/dblink.rb
bio-1.4.0 lib/bio/sequence/dblink.rb
bio-1.3.1 lib/bio/sequence/dblink.rb
bio-1.3.0 lib/bio/sequence/dblink.rb