class Bio::FANTOM::MaXML::Sequences

Constants

Data_XPath

Public Instance Methods

[](*arg) click to toggle source
    # File lib/bio/db/fantom.rb
186 def [](*arg)
187   if arg[0].is_a?(String) and arg.size == 1 then
188     get(arg[0])
189   else
190     to_a[*arg]
191   end
192 end
cloneids() click to toggle source
    # File lib/bio/db/fantom.rb
194 def cloneids
195   unless defined?(@cloneids)
196     @cloneids = to_a.collect { |x| x.cloneid }
197   end
198   @cloneids
199 end
each() { |x| ... } click to toggle source
    # File lib/bio/db/fantom.rb
162 def each
163   to_a.each { |x| yield x }
164 end
get(idstr) click to toggle source
    # File lib/bio/db/fantom.rb
174 def get(idstr)
175   unless defined?(@hash)
176     @hash = {}
177   end
178   unless @hash.member?(idstr) then
179     @hash[idstr] = self.find do |x|
180       x.altid.values.index(idstr)
181     end
182   end
183   @hash[idstr]
184 end
id_strings() click to toggle source
    # File lib/bio/db/fantom.rb
201 def id_strings
202   unless defined?(@id_strings)
203     @id_strings = to_a.collect { |x| x.id_strings }
204     @id_strings.flatten!
205     @id_strings.sort!
206     @id_strings.uniq!
207   end
208   @id_strings
209 end
to_a() click to toggle source
    # File lib/bio/db/fantom.rb
166 def to_a
167   unless defined?(@sequences)
168     @sequences = @elem.get_elements('sequence')
169     @sequences.collect! { |e| MaXML::Sequence.new(e) }
170   end
171   @sequences
172 end