Class Bio::FANTOM::MaXML::Sequences
In: lib/bio/db/fantom.rb
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 186
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

[Source]

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

[Source]

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

[Source]

     # File lib/bio/db/fantom.rb, line 174
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

[Source]

     # File lib/bio/db/fantom.rb, line 201
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

[Source]

     # File lib/bio/db/fantom.rb, line 166
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

[Validate]