Method: Bio::Sequence#aa

Defined in:
lib/bio/sequence.rb

#aaObject

Transform the sequence wrapped in the current Bio::Sequence object into a Bio::Sequence::NA object. This method will change the current object. This method does not validate your choice, so be careful!

s = Bio::Sequence.new('atgc')
puts s.seq.class                        #=> String
s.aa
puts s.seq.class                        #=> Bio::Sequence::AA !!!

However, if you know your sequence type, this method may be constructively used after initialization,

s = Bio::Sequence.new('RRLE')
s.aa

Returns

Bio::Sequence::AA



332
333
334
335
# File 'lib/bio/sequence.rb', line 332

def aa
  @seq = AA.new(@seq)
  @moltype = AA
end