module Bio::Alignment::OriginalPrivate

Bio::Alignment::OriginalPrivate is a set of private methods for Bio::Alignment::OriginalAlignment.

Public Class Methods

extract_key(obj) click to toggle source

Gets the name or the definition of the sequence from given object.

# File lib/bio/alignment.rb, line 1493
def extract_key(obj)
  sn = nil
  for m in [ :definition, :entry_id ]
    begin
      sn = obj.send(m)
    rescue NameError, ArgumentError
      sn = nil
    end
    break if sn
  end
  sn
end
extract_seq(obj) click to toggle source

Gets the sequence from given object.

# File lib/bio/alignment.rb, line 1478
def extract_seq(obj)
  if obj.is_a?(Bio::Sequence::NA) or obj.is_a?(Bio::Sequence::AA) then
    obj
  else
    meth = [ :seq, :naseq, :aaseq ].find {|m|
      obj.respond_to? m
    }
    meth ?
      obj.__send__(meth) :
      obj
  end
end