Method: Bio::Sequence::AA#initialize

Defined in:
lib/bio/sequence/aa.rb

#initialize(str) ⇒ AA

Generate an amino acid sequence object from a string.

s = Bio::Sequence::AA.new("RRLEHTFVFLRNFSLMLLRY")

or maybe (if you have an amino acid sequence in a file)

s = Bio::Sequence:AA.new(File.open('aa.txt').read)

Amino Acid sequences are always all uppercase in bioruby

s = Bio::Sequence::AA.new("rrLeHtfV")
puts s                                  #=> "RRLEHTFVF"

Whitespace is stripped from the sequence

s = Bio::Sequence::AA.new("RRL\nELA\tRG\r  RL")
puts s                                  #=> "RRLELARGRL"

Arguments:

  • (required) str: String

Returns

Bio::Sequence::AA object



58
59
60
61
62
# File 'lib/bio/sequence/aa.rb', line 58

def initialize(str)
  super
  self.upcase!
  self.tr!(" \t\n\r",'')
end