Module: Bioroebe::GUI::ProteinToDNAModule
Overview
Bioroebe::GUI::ProteinToDNAModule
Constant Summary
collapse
- WIDTH =
'70% or minimum 1020px'
- HEIGHT =
600
- TITLE =
' Protein-to-DNA conversion '
- USE_THIS_TITLE_FOR_THE_MAIN_BUTTON =
#
USE_THIS_TITLE_FOR_THE_MAIN_BUTTON
#
'_Determine the DNA sequence'
- USE_THIS_FONT =
:dejavu_condensed_20
ARRAY_ALL_GTK_WIDGETS, FONT_SIZE, OLD_VERBOSE_VALUE, USE_THIS_FONT_FAMILY_FOR_GUI_APPLICATIONS
Instance Method Summary
collapse
#disable_warnings, #enable_warnings, #log_dir?
Instance Method Details
#aminoacid_sequence? ⇒ Boolean
163
164
165
|
# File 'lib/bioroebe/gui/shared_code/protein_to_DNA/protein_to_DNA_module.rb', line 163
def aminoacid_sequence?
left_buffer?.to_s
end
|
#border_size? ⇒ Boolean
70
71
72
|
# File 'lib/bioroebe/gui/shared_code/protein_to_DNA/protein_to_DNA_module.rb', line 70
def border_size?
0
end
|
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
|
# File 'lib/bioroebe/gui/shared_code/protein_to_DNA/protein_to_DNA_module.rb', line 104
def create_buttons
backtrack_button = bold_button(
USE_THIS_TITLE_FOR_THE_MAIN_BUTTON
)
backtrack_button.set_name('button1')
backtrack_button.do_use_underline
backtrack_button.hint =
"On the <b>left hand side</b>, you should input the "\
"Aminoacid sequence.\n\n"\
"On the <b>right hand side</b>, a possible DNA "\
"sequence for this Aminoacid Sequence will "\
"be displayed.\n\n"\
"Invalid amino acids, such as 'U', will be filtered "\
"out, if given.\n\n"\
"Note that this will not necessarily "\
"generate the same sequence, due to several different codons "\
"encoding for the same aminoacid."
backtrack_button.on_clicked {
do_determine_the_backtrack_sequence
}
backtrack_button.lightblue
@dataset[:backtrack_button] = backtrack_button
a_quit_button = quit_button
a_quit_button.set_name('button1')
a_quit_button.make_bold
@dataset[:quit_button] = a_quit_button
end
|
#create_skeleton ⇒ Object
#
create_skeleton (skeleton tag)
#
92
93
94
95
96
97
98
99
|
# File 'lib/bioroebe/gui/shared_code/protein_to_DNA/protein_to_DNA_module.rb', line 92
def create_skeleton
@main_vbox = vbox
create_buttons
create_left_buffer create_right_buffer create_top_hbox
create_middle_bar_containing_the_arrow_pointing_to_the_right_side
end
|
#do_determine_the_backtrack_sequence ⇒ Object
Also known as:
do_determine_the_DNA_sequence
#
do_determine_the_backtrack_sequence (click tag)
This will do what is necessary to find the backtrack sequence.
#
179
180
181
182
183
184
185
186
187
188
189
190
|
# File 'lib/bioroebe/gui/shared_code/protein_to_DNA/protein_to_DNA_module.rb', line 179
def do_determine_the_backtrack_sequence
filter_away_invalid_aminoacids_from_the_left_buffer
_ = left_buffer?.text?.to_s
_.upcase!
_ = ::Bioroebe.remove_invalid_aminoacids(_)
left_buffer?.set_text(_)
text_for_right_hand_side = ::Bioroebe::ProteinToDNA.new(_, :be_quiet).dna_sequence?
right_buffer?.set_text(text_for_right_hand_side)
end
|
#filter_away_invalid_aminoacids_from_the_left_buffer ⇒ Object
#
filter_away_invalid_aminoacids_from_the_left_buffer
This method is used to “sanitize” the input - invalid aminoacids are flat out removed.
#
138
139
140
141
142
143
144
|
# File 'lib/bioroebe/gui/shared_code/protein_to_DNA/protein_to_DNA_module.rb', line 138
def filter_away_invalid_aminoacids_from_the_left_buffer
_ = left_buffer?.text?.to_s
possible_new_text = Bioroebe.strict_filter_away_invalid_aminoacids(_)
unless _ == possible_new_text
left_buffer?.set_text(possible_new_text)
end
end
|
#left_buffer? ⇒ Boolean
Also known as:
left?
170
171
172
|
# File 'lib/bioroebe/gui/shared_code/protein_to_DNA/protein_to_DNA_module.rb', line 170
def left_buffer?
@dataset[:left_buffer]
end
|
77
78
79
80
81
82
83
84
85
86
87
|
# File 'lib/bioroebe/gui/shared_code/protein_to_DNA/protein_to_DNA_module.rb', line 77
def (i = nil)
if i
if i.is_a? Array
i.each {|entry| (entry) }
else
case i when ''
end
end
end
end
|
#padding? ⇒ Boolean
63
64
65
|
# File 'lib/bioroebe/gui/shared_code/protein_to_DNA/protein_to_DNA_module.rb', line 63
def padding?
2
end
|
#right_buffer? ⇒ Boolean
Also known as:
right?
149
150
151
|
# File 'lib/bioroebe/gui/shared_code/protein_to_DNA/protein_to_DNA_module.rb', line 149
def right_buffer?
@dataset[:right_buffer]
end
|
#set_aminoacid_sequence(i) ⇒ Object
#
set_aminoacid_sequence
#
156
157
158
|
# File 'lib/bioroebe/gui/shared_code/protein_to_DNA/protein_to_DNA_module.rb', line 156
def set_aminoacid_sequence(i)
@dataset[:left_buffer].set_text(i.to_s)
end
|
#shared_reset ⇒ Object
52
53
54
55
56
57
58
|
# File 'lib/bioroebe/gui/shared_code/protein_to_DNA/protein_to_DNA_module.rb', line 52
def shared_reset
title_width_height(TITLE, WIDTH, HEIGHT)
@dataset = {}
end
|