Method: BioDSL::Seq#composition
- Defined in:
- lib/BioDSL/seq.rb
#composition ⇒ Object
Method that returns the residue compositions of a sequence in a hash where the key is the residue and the value is the residue count.
443 444 445 446 447 448 449 450 451 |
# File 'lib/BioDSL/seq.rb', line 443 def composition comp = Hash.new(0); @seq.upcase.each_char do |char| comp[char] += 1 end comp end |