Class: Bio::Sequence::DBLink
Overview
Bio::Sequence::DBLink stores IDs with the database name. Its main purpose is to store database cross-reference information for a sequence entry.
Instance Attribute Summary collapse
-
#database ⇒ Object
readonly
Database name, or namespace identifier (String).
-
#id ⇒ Object
readonly
Primary identifier (String).
-
#secondary_ids ⇒ Object
readonly
Secondary identifiers (Array of String).
Class Method Summary collapse
-
.parse_embl_DR_line(str) ⇒ Object
Parses DR line in EMBL entry, and returns a DBLink object.
-
.parse_uniprot_DR_line(str) ⇒ Object
Parses DR line in UniProt entry, and returns a DBLink object.
Instance Method Summary collapse
-
#initialize(database, primary_id, *secondary_ids) ⇒ DBLink
constructor
creates a new DBLink object.
Constructor Details
#initialize(database, primary_id, *secondary_ids) ⇒ DBLink
creates a new DBLink object
19 20 21 22 23 |
# File 'lib/bio/sequence/dblink.rb', line 19 def initialize(database, primary_id, *secondary_ids) @database = database @id = primary_id @secondary_ids = secondary_ids end |
Instance Attribute Details
#database ⇒ Object (readonly)
Database name, or namespace identifier (String).
26 27 28 |
# File 'lib/bio/sequence/dblink.rb', line 26 def database @database end |
#id ⇒ Object (readonly)
Primary identifier (String)
29 30 31 |
# File 'lib/bio/sequence/dblink.rb', line 29 def id @id end |
#secondary_ids ⇒ Object (readonly)
Secondary identifiers (Array of String)
32 33 34 |
# File 'lib/bio/sequence/dblink.rb', line 32 def secondary_ids @secondary_ids end |
Class Method Details
.parse_embl_DR_line(str) ⇒ Object
Parses DR line in EMBL entry, and returns a DBLink object.
39 40 41 42 43 |
# File 'lib/bio/sequence/dblink.rb', line 39 def self.parse_embl_DR_line(str) str = str.sub(/\.\s*\z/, '') str.sub!(/\ADR /, '') self.new(*(str.split(/\s*\;\s*/, 3))) end |
.parse_uniprot_DR_line(str) ⇒ Object
Parses DR line in UniProt entry, and returns a DBLink object.
46 47 48 49 50 |
# File 'lib/bio/sequence/dblink.rb', line 46 def self.parse_uniprot_DR_line(str) str = str.sub(/\.\s*\z/, '') str.sub!(/\ADR /, '') self.new(*(str.split(/\s*\;\s*/))) end |