Module: Bioroebe::Blosum
- Defined in:
- lib/bioroebe/blosum/blosum.rb
Overview
Bioroebe::Blosum
Class Method Summary collapse
-
.available_blosum_files? ⇒ Boolean
# === Bioroebe::Blosum.available_blosum_files?.
-
.show_as_2D_table(of_this_file = :blosum45) ⇒ Object
# === Bioroebe::Blosum.show_as_2D_table.
-
.show_matrix(of_this_file = :blosum45) ⇒ Object
# === Bioroebe::Blosum.show_matrix.
Class Method Details
.available_blosum_files? ⇒ Boolean
#
Bioroebe::Blosum.available_blosum_files?
This method will return an Array, containing all .yml files that represent a BLOSUM matrix.
#
49 50 51 52 53 |
# File 'lib/bioroebe/blosum/blosum.rb', line 49 def self.available_blosum_files? Dir[ ::Bioroebe.blosum_directory?+'*.yml' ] end |
.show_as_2D_table(of_this_file = :blosum45) ⇒ Object
#
Bioroebe::Blosum.show_as_2D_table
This variant will show a 2D table of the dataset at hand.
#
60 61 62 63 64 |
# File 'lib/bioroebe/blosum/blosum.rb', line 60 def self.show_as_2D_table( of_this_file = :blosum45 ) ::Bioroebe::BlosumParser.show_as_2D_table(of_this_file) end |
.show_matrix(of_this_file = :blosum45) ⇒ Object
#
Bioroebe::Blosum.show_matrix
This method can be used to show a specific BLOSUM matrix.
#
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/bioroebe/blosum/blosum.rb', line 26 def self.show_matrix( of_this_file = :blosum45 ) unless Bioroebe.const_defined? :BlosumParser require 'bioroebe/parsers/blosum_parser.rb' end if of_this_file.is_a? Array of_this_file = of_this_file.first end file = ::Bioroebe.blosum_directory?+of_this_file.to_s.dup file << '.yml' unless file.end_with? '.yml' hash = ::Bioroebe::BlosumParser.new(file) { :be_quiet }.hash? hash.each_pair {|key, value| puts "#{key}: #{value}" } end |