Class Bio::FANTOM::MaXML
In: lib/bio/db/fantom.rb
Parent: DB

Methods

entry_id   gsub_entities   new   to_s  

Classes and Modules

Class Bio::FANTOM::MaXML::Annotation
Class Bio::FANTOM::MaXML::Annotations
Class Bio::FANTOM::MaXML::Cluster
Class Bio::FANTOM::MaXML::Sequence
Class Bio::FANTOM::MaXML::Sequences

Constants

DELIMITER = RS = "\n--EOF--\n"   DTD of MaXML(Mouse annotation XML) fantom.gsc.riken.go.jp/maxml/maxml.dtd
Data_XPath = ''   This class is for {allseq|repseq|allclust}.sep.xml, not for {allseq|repseq|allclust}.xml.

Attributes

elem  [R] 

Public Class methods

[Source]

    # File lib/bio/db/fantom.rb, line 62
62:       def initialize(x)
63:         if x.is_a?(REXML::Element) then
64:           @elem = x
65:         else
66:           if x.is_a?(String) then
67:             x = x.sub(/#{Regexp.escape(DELIMITER)}\z/om, "\n")
68:           end
69:           doc = REXML::Document.new(x)
70:           @elem = doc.elements[self.class::Data_XPath]
71:           #raise 'element is null' unless @elem
72:           @elem = REXML::Document.new('') unless @elem
73:         end
74:       end

Public Instance methods

[Source]

    # File lib/bio/db/fantom.rb, line 90
90:       def entry_id
91:         unless defined?(@entry_id)
92:           @entry_id = @elem.attributes['id']
93:         end
94:         @entry_id
95:       end

[Source]

    # File lib/bio/db/fantom.rb, line 81
81:       def gsub_entities(str)
82:         # workaround for bug?
83:         if str then
84:           str.gsub(/\&\#(\d{1,3})\;/) { sprintf("%c", $1.to_i) }
85:         else
86:           str
87:         end
88:       end

[Source]

    # File lib/bio/db/fantom.rb, line 77
77:       def to_s
78:         @elem.to_s
79:       end

[Validate]