Class: Bioroebe::AminoacidsMassTable
- Inherits:
-
Base
- Object
- Base
- Bioroebe::AminoacidsMassTable
show all
- Defined in:
- lib/bioroebe/aminoacids/aminoacids_mass_table.rb
Overview
Bioroebe::AminoacidsMassTable
Constant Summary
collapse
- PADDING_TO_USE =
' '
Constants inherited
from Base
Base::NAMESPACE
ColoursForBase::ARRAY_HTML_COLOURS_IN_USE
Class Method Summary
collapse
Instance Method Summary
collapse
-
#initialize ⇒ AminoacidsMassTable
constructor
# === initialize ========================================================================= #.
-
#reset ⇒ Object
# === reset ========================================================================= #.
Methods inherited from Base
#append_what_into, #can_base_pair?, #convert_global_env, #delete_file, #directory_to_the_codon_tables?, #file_readlines, #infer_the_namespace, #is_on_roebe?, #is_palindrome?, #main_encoding?, #mkdir, #move_file, #mv, #namespace?, #no_file_exists_at, #no_newlines, #project_yaml_directory?, #rds, #register_sigint, #return_pwd, #return_the_first_line_of_this_file, #word_wrap, #write_what_into
#colourize_this_aminoacid_sequence_for_the_commandline, #colourize_this_nucleotide_sequence, #disable_colours, #ecomment, #efancy, #egold, #enable_colours, #eorange, #eparse, #erev, #red, #remove_trailing_escape_part, #return_colour_for_nucleotides, #rev, #sdir, #set_use_colours, #sfancy, #sfile, #simp, #swarn, #use_colours?, #use_colours_within_the_bioroebe_namespace?
Class Method Details
.e(i = '') ⇒ Object
#
AminoacidsMassTable.e
#
47
48
49
|
# File 'lib/bioroebe/aminoacids/aminoacids_mass_table.rb', line 47
def self.e(i = '')
puts i
end
|
.erev(i) ⇒ Object
#
AminoacidsMassTable.erev
#
40
41
42
|
# File 'lib/bioroebe/aminoacids/aminoacids_mass_table.rb', line 40
def self.erev(i)
::Bioroebe.erev(i)
end
|
.report_which_file_is_used ⇒ Object
#
AminoacidsMassTable.report_which_file_is_used
The purpose of this method is to simply report which file we use to read in the mass table.
#
99
100
101
102
103
|
# File 'lib/bioroebe/aminoacids/aminoacids_mass_table.rb', line 99
def self.report_which_file_is_used
erev 'We will read from the file `'+
Colours.sfile(FILE_AMINO_ACIDS_MASS_TABLE)+
Colours.rev+'`.'
end
|
.show(optional_padding = PADDING_TO_USE) ⇒ Object
#
Bioroebe::AminoacidsMassTable.show
#
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
|
# File 'lib/bioroebe/aminoacids/aminoacids_mass_table.rb', line 54
def self.show(
optional_padding = PADDING_TO_USE
)
sum = 0
erev 'Aminoacids Mass Table - Molecular Weight of '\
'Amino Acids:'; e AMINO_ACIDS_MASS_TABLE.each {|key, value|
long_amino_acid = AMINO_ACIDS[key].select {|inner_key, _|
inner_key.size == 3
}.values.first
left = optional_padding+
key.to_s+
' ('+long_amino_acid+')'+': '
sum += value value = value.to_s.rjust(10)
left = left.ljust(22)
if left.include? '('
splitted = left.split('(')
splitted[0] = ::Bioroebe.springgreen(splitted[0])+::Bioroebe.rev
left = splitted.join('(')
end
erev left+
Colours.sfancy(value)
}
e
erev 'Average weight of an amino acid: '+
Colours.simp(
(sum.to_f / AMINO_ACIDS_MASS_TABLE.keys.size).round(2).to_s
)
e end
|
Instance Method Details
#reset ⇒ Object
33
34
35
|
# File 'lib/bioroebe/aminoacids/aminoacids_mass_table.rb', line 33
def reset
super()
end
|