Class Bio::FANTOM::MaXML::Sequences
In: lib/bio/db/fantom.rb  (CVS)
Parent: MaXML

Methods

[]   cloneids   each   get   id_strings   to_a  

Included Modules

Enumerable

Constants

Data_XPath = 'maxml-sequences'

Public Instance methods

[Source]

# File lib/bio/db/fantom.rb, line 188
        def [](*arg)
          if arg[0].is_a?(String) and arg.size == 1 then
            get(arg[0])
          else
            to_a[*arg]
          end
        end

[Source]

# File lib/bio/db/fantom.rb, line 196
        def cloneids
          unless defined?(@cloneids)
            @cloneids = to_a.collect { |x| x.cloneid }
          end
          @cloneids
        end

[Source]

# File lib/bio/db/fantom.rb, line 164
        def each
          to_a.each { |x| yield x }
        end

[Source]

# File lib/bio/db/fantom.rb, line 176
        def get(idstr)
          unless defined?(@hash)
            @hash = {}
          end
          unless @hash.member?(idstr) then
            @hash[idstr] = self.find do |x|
              x.altid.values.index(idstr)
            end
          end
          @hash[idstr]
        end

[Source]

# File lib/bio/db/fantom.rb, line 203
        def id_strings
          unless defined?(@id_strings)
            @id_strings = to_a.collect { |x| x.id_strings }
            @id_strings.flatten!
            @id_strings.sort!
            @id_strings.uniq!
          end
          @id_strings
        end

[Source]

# File lib/bio/db/fantom.rb, line 168
        def to_a
          unless defined?(@sequences)
            @sequences = @elem.get_elements('sequence')
            @sequences.collect! { |e| MaXML::Sequence.new(e) }
          end
          @sequences
        end

[Validate]