class Bio::GO::GeneAssociation
Bio::GO::GeneAssociation¶ ↑
$CVSROOT/go/gene-associations/gene_association.*
Data parser for the gene_association go annotation. See also the file format www.geneontology.org/doc/GO.annotation.html#file
Example¶ ↑
mgi_data = File.open('gene_association.mgi').read mgi = Bio::GO::GeneAssociation.parser(mgi_data) Bio::GO::GeneAssociation.parser(mgi_data) do |entry| p [entry.entry_id, entry.evidence, entry.goid] end
Constants
- DELIMITER
Delimiter
- RS
Delimiter
Attributes
Returns Aspect valiable.
Returns Date variable.
Returns DB variable.
Returns Db_Object_Id variable. Alias to entry_id.
Returns Db_Object_Symbol variable.
Returns Db_Object_Type variable.
Returns Db_Reference variable.
Returns Db_Object_Id variable. Alias to entry_id.
Retruns Evidence code variable.
Returns Db_Object_Name variable.
Returns Taxon variable.
Returns the entry is associated with this value.
Public Class Methods
Parsing an entry (in a line) in the gene_association flatfile.
# File lib/bio/db/go.rb, line 261 def initialize(entry) tmp = entry.chomp.split(/\t/) @db = tmp[0] @db_object_id = tmp[1] @db_object_symbol = tmp[2] @qualifier = tmp[3] # @goid = tmp[4] @db_reference = tmp[5].split(/\|/) # @evidence = tmp[6] @with = tmp[7].split(/\|/) # @aspect = tmp[8] @db_object_name = tmp[9] # @db_object_synonym = tmp[10].split(/\|/) # @db_object_type = tmp[11] @taxon = tmp[12] # taxon:4932 @date = tmp[13] # 20010118 @assigned_by = tmp[14] end
Retruns an Array of parsed gene_association flatfile. Block is acceptable.
# File lib/bio/db/go.rb, line 199 def self.parser(str) if block_given? str.each_line(DELIMITER) {|line| next if /^!/ =~ line yield GeneAssociation.new(line) } else galist = [] str.each_line(DELIMITER) {|line| next if /^!/ =~ line galist << GeneAssociation.new(line) } return galist end end
Public Instance Methods
#to_str -> a line of gene_association file.
# File lib/bio/db/go.rb, line 295 def to_str return [@db, @db_object_id, @db_object_symbol, @qualifier, @goid, @db_reference.join("|"), @evidence, @with.join("|"), @aspect, @db_object_name, @db_object_synonym.join("|"), @db_object_type, @taxon, @date, @assigned_by].join("\t") end