Method: Bio::FastaDefline#get_by_type

Defined in:
lib/bio/db/fasta/defline.rb

#get_by_type(type_str) ⇒ Object

Returns an identifier by given type.



440
441
442
443
444
445
446
447
448
449
# File 'lib/bio/db/fasta/defline.rb', line 440

def get_by_type(type_str)
  @list_ids.each do |x|
    if labels = self.class::NSIDs[x[0]] then
      if i = labels.index(type_str) then
        return x[i+1]
      end
    end
  end
  nil
end