bioroebe 0.10.80 → 0.11.25

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of bioroebe might be problematic. Click here for more details.

Files changed (134) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3117 -2645
  3. data/bioroebe.gemspec +3 -3
  4. data/doc/README.gen +3116 -2644
  5. data/doc/todo/bioroebe_todo.md +418 -387
  6. data/lib/bioroebe/aminoacids/aminoacid_substitution.rb +1 -9
  7. data/lib/bioroebe/aminoacids/codon_percentage.rb +1 -9
  8. data/lib/bioroebe/aminoacids/deduce_aminoacid_sequence.rb +1 -9
  9. data/lib/bioroebe/aminoacids/display_aminoacid_table.rb +1 -0
  10. data/lib/bioroebe/aminoacids/show_hydrophobicity.rb +1 -6
  11. data/lib/bioroebe/base/colours_for_base/colours_for_base.rb +18 -8
  12. data/lib/bioroebe/base/commandline_application/commandline_arguments.rb +13 -11
  13. data/lib/bioroebe/base/commandline_application/misc.rb +18 -8
  14. data/lib/bioroebe/base/misc.rb +16 -0
  15. data/lib/bioroebe/base/prototype/misc.rb +1 -1
  16. data/lib/bioroebe/codons/show_codon_tables.rb +6 -2
  17. data/lib/bioroebe/codons/show_codon_usage.rb +2 -1
  18. data/lib/bioroebe/constants/aminoacids_and_proteins.rb +1 -0
  19. data/lib/bioroebe/constants/database_constants.rb +1 -1
  20. data/lib/bioroebe/constants/files_and_directories.rb +24 -4
  21. data/lib/bioroebe/constants/misc.rb +20 -0
  22. data/lib/bioroebe/count/count_amount_of_nucleotides.rb +3 -0
  23. data/lib/bioroebe/crystal/README.md +2 -0
  24. data/lib/bioroebe/crystal/to_rna.cr +19 -0
  25. data/lib/bioroebe/data/README.md +11 -8
  26. data/lib/bioroebe/data/electron_microscopy/pos_example.pos +396 -0
  27. data/lib/bioroebe/data/electron_microscopy/test_particles.star +36 -0
  28. data/lib/bioroebe/{shell/tk.rb → electron_microscopy/electron_microscopy_module.rb} +15 -10
  29. data/lib/bioroebe/electron_microscopy/simple_star_file_generator.rb +4 -9
  30. data/lib/bioroebe/fasta_and_fastq/show_fasta_headers.rb +27 -12
  31. data/lib/bioroebe/genome/README.md +4 -0
  32. data/lib/bioroebe/genome/genome.rb +67 -0
  33. data/lib/bioroebe/gui/gtk +1 -0
  34. data/lib/bioroebe/gui/gtk3/controller/controller.rb +45 -27
  35. data/lib/bioroebe/gui/gtk3/dna_to_aminoacid_widget/dna_to_aminoacid_widget.rb +76 -50
  36. data/lib/bioroebe/gui/gtk3/hamming_distance/hamming_distance.rb +42 -28
  37. data/lib/bioroebe/gui/gtk3/nucleotide_analyser/nucleotide_analyser.rb +119 -71
  38. data/lib/bioroebe/gui/gtk3/protein_to_DNA/protein_to_DNA.rb +18 -18
  39. data/lib/bioroebe/gui/gtk3/random_sequence/random_sequence.rb +19 -11
  40. data/lib/bioroebe/gui/shared_code/protein_to_DNA/protein_to_DNA_module.rb +14 -14
  41. data/lib/bioroebe/misc/ruler.rb +1 -0
  42. data/lib/bioroebe/parsers/genbank_parser.rb +353 -24
  43. data/lib/bioroebe/parsers/gff.rb +1 -9
  44. data/lib/bioroebe/pdb/parse_pdb_file.rb +1 -9
  45. data/lib/bioroebe/project/project.rb +1 -1
  46. data/lib/bioroebe/python/README.md +1 -0
  47. data/lib/bioroebe/python/__pycache__/mymodule.cpython-39.pyc +0 -0
  48. data/lib/bioroebe/python/gui/gtk3/all_in_one.css +4 -0
  49. data/lib/bioroebe/python/gui/gtk3/all_in_one.py +59 -0
  50. data/lib/bioroebe/python/gui/gtk3/widget1.py +20 -0
  51. data/lib/bioroebe/python/gui/tkinter/all_in_one.py +91 -0
  52. data/lib/bioroebe/python/mymodule.py +8 -0
  53. data/lib/bioroebe/python/protein_to_dna.py +33 -0
  54. data/lib/bioroebe/python/shell/shell.py +19 -0
  55. data/lib/bioroebe/python/to_rna.py +14 -0
  56. data/lib/bioroebe/python/toplevel_methods/open_in_browser.py +20 -0
  57. data/lib/bioroebe/python/toplevel_methods/palindromes.py +42 -0
  58. data/lib/bioroebe/python/toplevel_methods/rds.py +13 -0
  59. data/lib/bioroebe/python/toplevel_methods/three_delimiter.py +34 -0
  60. data/lib/bioroebe/python/toplevel_methods/time_and_date.py +43 -0
  61. data/lib/bioroebe/python/toplevel_methods/to_camelcase.py +11 -0
  62. data/lib/bioroebe/requires/require_the_bioroebe_project.rb +3 -1
  63. data/lib/bioroebe/sequence/nucleotide_module/nucleotide_module.rb +28 -25
  64. data/lib/bioroebe/sequence/protein.rb +105 -3
  65. data/lib/bioroebe/sequence/sequence.rb +61 -2
  66. data/lib/bioroebe/shell/menu.rb +3752 -3667
  67. data/lib/bioroebe/shell/misc.rb +51 -4311
  68. data/lib/bioroebe/shell/readline/readline.rb +1 -1
  69. data/lib/bioroebe/shell/shell.rb +11199 -28
  70. data/lib/bioroebe/siRNA/siRNA.rb +81 -1
  71. data/lib/bioroebe/string_matching/find_longest_substring.rb +3 -2
  72. data/lib/bioroebe/taxonomy/class_methods.rb +3 -8
  73. data/lib/bioroebe/taxonomy/constants.rb +4 -3
  74. data/lib/bioroebe/taxonomy/edit.rb +2 -1
  75. data/lib/bioroebe/taxonomy/help/help.rb +10 -10
  76. data/lib/bioroebe/taxonomy/info/check_available.rb +15 -9
  77. data/lib/bioroebe/taxonomy/info/info.rb +17 -2
  78. data/lib/bioroebe/taxonomy/info/is_dna.rb +46 -36
  79. data/lib/bioroebe/taxonomy/interactive.rb +139 -95
  80. data/lib/bioroebe/taxonomy/menu.rb +27 -18
  81. data/lib/bioroebe/taxonomy/parse_fasta.rb +3 -1
  82. data/lib/bioroebe/taxonomy/shared.rb +1 -0
  83. data/lib/bioroebe/taxonomy/taxonomy.rb +1 -0
  84. data/lib/bioroebe/toplevel_methods/aminoacids_and_proteins.rb +31 -24
  85. data/lib/bioroebe/toplevel_methods/databases.rb +1 -1
  86. data/lib/bioroebe/toplevel_methods/fasta_and_fastq.rb +101 -63
  87. data/lib/bioroebe/toplevel_methods/misc.rb +17 -16
  88. data/lib/bioroebe/toplevel_methods/nucleotides.rb +22 -5
  89. data/lib/bioroebe/toplevel_methods/open_in_browser.rb +2 -0
  90. data/lib/bioroebe/toplevel_methods/palindromes.rb +1 -2
  91. data/lib/bioroebe/toplevel_methods/taxonomy.rb +2 -2
  92. data/lib/bioroebe/toplevel_methods/to_camelcase.rb +5 -0
  93. data/lib/bioroebe/utility_scripts/align_open_reading_frames.rb +1 -9
  94. data/lib/bioroebe/utility_scripts/check_for_mismatches/check_for_mismatches.rb +1 -9
  95. data/lib/bioroebe/utility_scripts/compacter.rb +1 -9
  96. data/lib/bioroebe/utility_scripts/compseq/compseq.rb +1 -9
  97. data/lib/bioroebe/utility_scripts/create_batch_entrez_file.rb +1 -9
  98. data/lib/bioroebe/utility_scripts/dot_alignment.rb +1 -9
  99. data/lib/bioroebe/utility_scripts/move_file_to_its_correct_location.rb +1 -4
  100. data/lib/bioroebe/utility_scripts/showorf/constants.rb +0 -5
  101. data/lib/bioroebe/utility_scripts/showorf/reset.rb +1 -4
  102. data/lib/bioroebe/version/version.rb +2 -2
  103. data/lib/bioroebe/www/embeddable_interface.rb +101 -52
  104. data/lib/bioroebe/www/sinatra/sinatra.rb +186 -70
  105. data/lib/bioroebe/yaml/aminoacids/amino_acids_long_name_to_one_letter.yml +2 -2
  106. data/lib/bioroebe/yaml/configuration/browser.yml +1 -1
  107. data/lib/bioroebe/yaml/genomes/README.md +3 -4
  108. data/lib/bioroebe/yaml/restriction_enzymes/restriction_enzymes.yml +3 -3
  109. metadata +33 -35
  110. data/doc/setup.rb +0 -1655
  111. data/lib/bioroebe/genbank/genbank_parser.rb +0 -291
  112. data/lib/bioroebe/shell/add.rb +0 -108
  113. data/lib/bioroebe/shell/assign.rb +0 -360
  114. data/lib/bioroebe/shell/chop_and_cut.rb +0 -281
  115. data/lib/bioroebe/shell/constants.rb +0 -166
  116. data/lib/bioroebe/shell/download.rb +0 -335
  117. data/lib/bioroebe/shell/enable_and_disable.rb +0 -158
  118. data/lib/bioroebe/shell/enzymes.rb +0 -310
  119. data/lib/bioroebe/shell/fasta.rb +0 -345
  120. data/lib/bioroebe/shell/gtk.rb +0 -76
  121. data/lib/bioroebe/shell/history.rb +0 -132
  122. data/lib/bioroebe/shell/initialize.rb +0 -217
  123. data/lib/bioroebe/shell/loop.rb +0 -74
  124. data/lib/bioroebe/shell/prompt.rb +0 -107
  125. data/lib/bioroebe/shell/random.rb +0 -289
  126. data/lib/bioroebe/shell/reset.rb +0 -335
  127. data/lib/bioroebe/shell/scan_and_parse.rb +0 -135
  128. data/lib/bioroebe/shell/search.rb +0 -337
  129. data/lib/bioroebe/shell/sequences.rb +0 -200
  130. data/lib/bioroebe/shell/show_report_and_display.rb +0 -2901
  131. data/lib/bioroebe/shell/startup.rb +0 -127
  132. data/lib/bioroebe/shell/taxonomy.rb +0 -14
  133. data/lib/bioroebe/shell/user_input.rb +0 -88
  134. data/lib/bioroebe/shell/xorg.rb +0 -45
@@ -94,6 +94,7 @@ class Controller < ::Gtk::Box # === Bioroebe::GUI::Gtk::Controller
94
94
  # === reset (reset tag)
95
95
  # ========================================================================= #
96
96
  def reset
97
+ batch_require_all_relevant_gtk3_files
97
98
  reset_the_internal_variables
98
99
  # ======================================================================= #
99
100
  # === @configuration
@@ -105,6 +106,10 @@ class Controller < ::Gtk::Box # === Bioroebe::GUI::Gtk::Controller
105
106
  title_width_height_font(TITLE, WIDTH, HEIGHT, USE_THIS_FONT)
106
107
  do_handle_all_CSS_related_aspects
107
108
  infer_the_size_automatically
109
+ # ======================================================================= #
110
+ # === @nucleotide_analyser
111
+ # ======================================================================= #
112
+ @nucleotide_analyser = NucleotideAnalyser.new
108
113
  end
109
114
 
110
115
  # ========================================================================= #
@@ -160,7 +165,7 @@ class Controller < ::Gtk::Box # === Bioroebe::GUI::Gtk::Controller
160
165
  end
161
166
 
162
167
  # ========================================================================= #
163
- # === create_the_header_bar
168
+ # === create_the_header_bar (header tag, top tag)
164
169
  # ========================================================================= #
165
170
  def create_the_header_bar
166
171
  # ======================================================================= #
@@ -168,7 +173,8 @@ class Controller < ::Gtk::Box # === Bioroebe::GUI::Gtk::Controller
168
173
  # ======================================================================= #
169
174
  @header_bar = default_header_bar
170
175
  @header_bar.pad8px
171
- @header_bar.text(' 🐟 Controller 🐠 ')
176
+ _ = selectable_text(' 🐟 Controller 🐟 ')
177
+ @header_bar.central_element(_)
172
178
  end
173
179
 
174
180
  # ========================================================================= #
@@ -200,6 +206,7 @@ class Controller < ::Gtk::Box # === Bioroebe::GUI::Gtk::Controller
200
206
  # ========================================================================= #
201
207
  def batch_require_all_relevant_gtk3_files
202
208
  require 'bioroebe/gui/gtk3/alignment/alignment.rb'
209
+ require 'bioroebe/gui/gtk3/nucleotide_analyser/nucleotide_analyser.rb'
203
210
  require 'bioroebe/gui/gtk3/aminoacid_composition/aminoacid_composition.rb'
204
211
  require 'bioroebe/gui/gtk3/blosum_matrix_viewer/blosum_matrix_viewer.rb'
205
212
  require 'bioroebe/gui/gtk3/dna_to_aminoacid_widget/dna_to_aminoacid_widget.rb'
@@ -209,7 +216,6 @@ class Controller < ::Gtk::Box # === Bioroebe::GUI::Gtk::Controller
209
216
  require 'bioroebe/gui/gtk3/gene/gene.rb'
210
217
  require 'bioroebe/gui/gtk3/hamming_distance/hamming_distance.rb'
211
218
  require 'bioroebe/gui/gtk3/levensthein_distance/levensthein_distance.rb'
212
- require 'bioroebe/gui/gtk3/nucleotide_analyser/nucleotide_analyser.rb'
213
219
  require 'bioroebe/gui/gtk3/parse_pdb_file/parse_pdb_file.rb'
214
220
  require 'bioroebe/gui/gtk3/primer_design_widget/primer_design_widget.rb'
215
221
  require 'bioroebe/gui/gtk3/protein_to_DNA/protein_to_DNA.rb'
@@ -225,33 +231,36 @@ class Controller < ::Gtk::Box # === Bioroebe::GUI::Gtk::Controller
225
231
  # === connect_skeleton (connect tag)
226
232
  # ========================================================================= #
227
233
  def connect_skeleton
228
- batch_require_all_relevant_gtk3_files
229
234
  abort_on_exception
230
235
  # ========================================================================= #
231
236
  # === DnaToAminoacidWidget
232
237
  # ========================================================================= #
233
238
  @dna_to_aminoacid_widget = DnaToAminoacidWidget.new
234
239
  @dna_to_aminoacid_widget.set_parent_widget(self)
235
- @notebook.add_page('dna-to-aminoacid-widget', gtk_vbox(@dna_to_aminoacid_widget))
240
+ @notebook.add_page('dna-to-aminoacid-widget', vbox(@dna_to_aminoacid_widget))
241
+ # ======================================================================= #
242
+ # === nucleotide-analyser
243
+ # ======================================================================= #
244
+ @notebook.add_page('nucleotide-analyser', vbox(@nucleotide_analyser))
236
245
  # ======================================================================= #
237
246
  # === aminoacid-composition
238
247
  # ======================================================================= #
239
248
  @aminoacid_composition = AminoacidComposition.new
240
249
  @aminoacid_composition.set_parent_widget(self)
241
- @notebook.add_page('aminoacid-composition', gtk_vbox(@aminoacid_composition))
250
+ @notebook.add_page('aminoacid-composition', vbox(@aminoacid_composition))
242
251
  # ======================================================================= #
243
252
  # === protein-to-DNA
244
253
  # ======================================================================= #
245
254
  @protein_to_DNA = ProteinToDNA.new
246
- @notebook.add_page('protein-to-DNA', gtk_vbox(@protein_to_DNA))
255
+ @notebook.add_page('protein-to-DNA', vbox(@protein_to_DNA))
247
256
  # ======================================================================= #
248
257
  # === dna-to-reverse-complement
249
258
  # ======================================================================= #
250
- @notebook.add_page('dna-to-reverse-complement', gtk_vbox(DnaToReverseComplementWidget.new))
259
+ @notebook.add_page('dna-to-reverse-complement', vbox(DnaToReverseComplementWidget.new))
251
260
  # ======================================================================= #
252
261
  # === alignment
253
262
  # ======================================================================= #
254
- @notebook.add_page('alignment', gtk_vbox(Alignment.new))
263
+ @notebook.add_page('alignment', vbox(Alignment.new))
255
264
  # ======================================================================= #
256
265
  # === anti-sense-strand
257
266
  #
@@ -260,7 +269,7 @@ class Controller < ::Gtk::Box # === Bioroebe::GUI::Gtk::Controller
260
269
  # ======================================================================= #
261
270
  # === blosum-matrix-viewer
262
271
  # ======================================================================= #
263
- @notebook.add_page('blosum-matrix-viewer', gtk_vbox(BlosumMatrixViewer.new))
272
+ @notebook.add_page('blosum-matrix-viewer', vbox(BlosumMatrixViewer.new))
264
273
  # ======================================================================= #
265
274
  # === calculate_cell_numbers_of_bacteria
266
275
  #
@@ -269,59 +278,55 @@ class Controller < ::Gtk::Box # === Bioroebe::GUI::Gtk::Controller
269
278
  # ======================================================================= #
270
279
  # === fasta-table-widget
271
280
  # ======================================================================= #
272
- @notebook.add_page('fasta-table-widget', gtk_vbox(FastaTableWidget.new))
281
+ @notebook.add_page('fasta-table-widget', vbox(FastaTableWidget.new))
273
282
  # ======================================================================= #
274
283
  # === format-converter
275
284
  # ======================================================================= #
276
- @notebook.add_page('format-converter', gtk_vbox(FormatConverter.new))
285
+ @notebook.add_page('format-converter', vbox(FormatConverter.new))
277
286
  # ======================================================================= #
278
287
  # === gene
279
288
  # ======================================================================= #
280
- @notebook.add_page('gene', gtk_vbox(Gene.new))
289
+ @notebook.add_page('gene', vbox(Gene.new))
281
290
  # ======================================================================= #
282
291
  # === hamming-distance
283
292
  # ======================================================================= #
284
- @notebook.add_page('hamming-distance', gtk_vbox(HammingDistance.new))
293
+ @notebook.add_page('hamming-distance', vbox(HammingDistance.new))
285
294
  # ======================================================================= #
286
295
  # === levensthein-distance
287
296
  # ======================================================================= #
288
- @notebook.add_page('levensthein-distance', gtk_vbox(LevenstheinDistance.new))
289
- # ======================================================================= #
290
- # === nucleotide-analyser
291
- # ======================================================================= #
292
- @notebook.add_page('nucleotide-analyser', gtk_vbox(NucleotideAnalyser.new))
297
+ @notebook.add_page('levensthein-distance', vbox(LevenstheinDistance.new))
293
298
  # ======================================================================= #
294
299
  # === parse-pdb-file
295
300
  # ======================================================================= #
296
- @notebook.add_page('parse-pdb-file', gtk_vbox(ParsePdbFile.new))
301
+ @notebook.add_page('parse-pdb-file', vbox(ParsePdbFile.new))
297
302
  # ======================================================================= #
298
303
  # === primer-design-widget
299
304
  # ======================================================================= #
300
- @notebook.add_page('primer-design-widget', gtk_vbox(PrimerDesignWidget.new))
305
+ @notebook.add_page('primer-design-widget', vbox(PrimerDesignWidget.new))
301
306
  # ======================================================================= #
302
307
  # === random-sequence
303
308
  # ======================================================================= #
304
- @notebook.add_page('random-sequence', gtk_vbox(RandomSequence.new))
309
+ @notebook.add_page('random-sequence', vbox(RandomSequence.new))
305
310
  # ======================================================================= #
306
311
  # === restriction-enzymes
307
312
  # ======================================================================= #
308
- @notebook.add_page('restriction-enzymes', gtk_vbox(RestrictionEnzymes.new))
313
+ @notebook.add_page('restriction-enzymes', vbox(RestrictionEnzymes.new))
309
314
  # ======================================================================= #
310
315
  # === show-codon-table
311
316
  # ======================================================================= #
312
- @notebook.add_page('show-codon-table', gtk_vbox(ShowCodonTable.new))
317
+ @notebook.add_page('show-codon-table', vbox(ShowCodonTable.new))
313
318
  # ======================================================================= #
314
319
  # === show-codon-usage
315
320
  # ======================================================================= #
316
- @notebook.add_page('show-codon-usage', gtk_vbox(ShowCodonUsage.new))
321
+ @notebook.add_page('show-codon-usage', vbox(ShowCodonUsage.new))
317
322
  # ======================================================================= #
318
323
  # === sizeseq
319
324
  # ======================================================================= #
320
- @notebook.add_page('sizeseq', gtk_vbox(Sizeseq.new))
325
+ @notebook.add_page('sizeseq', vbox(Sizeseq.new))
321
326
  # ======================================================================= #
322
327
  # === three-to-one
323
328
  # ======================================================================= #
324
- @notebook.add_page('three-to-one', gtk_vbox(ThreeToOne.new))
329
+ @notebook.add_page('three-to-one', vbox(ThreeToOne.new))
325
330
  # ======================================================================= #
326
331
  # === www-finder
327
332
  #
@@ -388,8 +393,21 @@ class Controller < ::Gtk::Box # === Bioroebe::GUI::Gtk::Controller
388
393
  if @protein_to_DNA.respond_to? :do_determine_the_DNA_sequence
389
394
  @protein_to_DNA.do_determine_the_DNA_sequence
390
395
  end
396
+ # ======================================================================= #
397
+ # Also update the nucleotide-analyser next:
398
+ # ======================================================================= #
399
+ @nucleotide_analyser.set_dna_sequence(
400
+ main_dna_sequence?.delete(' ')
401
+ )
391
402
  end
392
403
 
404
+ # ========================================================================= #
405
+ # === main_dna_sequence?
406
+ # ========================================================================= #
407
+ def main_dna_sequence?
408
+ @dna_to_aminoacid_widget.dna_sequence?
409
+ end; alias main_DNA_sequence? main_dna_sequence? # === main_DNA_sequence?
410
+
393
411
  end; end; end
394
412
 
395
413
  # =========================================================================== #
@@ -157,10 +157,17 @@ class DnaToAminoacidWidget < ::Gtk::Box # === Bioroebe::GUI::Gtk::DnaToAminoacid
157
157
  # === sync_the_entries_back_onto_the_two_main_strings
158
158
  # ========================================================================= #
159
159
  def sync_the_entries_back_onto_the_two_main_strings
160
- @dna_sequence = left_entry?.text.to_s
160
+ @dna_sequence = return_the_main_DNA_sequence
161
161
  @aminoacid_sequence = right_entry?.text.to_s
162
162
  end
163
163
 
164
+ # ========================================================================= #
165
+ # === dna_sequence?
166
+ # ========================================================================= #
167
+ def dna_sequence?
168
+ left_entry?.text.to_s
169
+ end; alias return_the_main_DNA_sequence dna_sequence? # === return_the_main_DNA_sequence
170
+
164
171
  # ========================================================================= #
165
172
  # === create_the_entries (entries tag)
166
173
  # ========================================================================= #
@@ -228,7 +235,7 @@ class DnaToAminoacidWidget < ::Gtk::Box # === Bioroebe::GUI::Gtk::DnaToAminoacid
228
235
  # === sanitized_half_width
229
236
  # ========================================================================= #
230
237
  def sanitized_half_width
231
- (@width / 2)- 30
238
+ (@width / 2) - 30
232
239
  end
233
240
 
234
241
  # ========================================================================= #
@@ -238,6 +245,17 @@ class DnaToAminoacidWidget < ::Gtk::Box # === Bioroebe::GUI::Gtk::DnaToAminoacid
238
245
  @left_entry
239
246
  end
240
247
 
248
+ # ========================================================================= #
249
+ # === do_properly_space_the_top_left_entry
250
+ # ========================================================================= #
251
+ def do_properly_space_the_top_left_entry
252
+ old_text = @left_entry.text?.delete(' ')
253
+ _ = old_text.
254
+ gsub(/(.{3})/,' \1').
255
+ lstrip
256
+ @left_entry.set_text(_)
257
+ end
258
+
241
259
  # ========================================================================= #
242
260
  # === entry_for_the_codon_table?
243
261
  # ========================================================================= #
@@ -264,7 +282,7 @@ class DnaToAminoacidWidget < ::Gtk::Box # === Bioroebe::GUI::Gtk::DnaToAminoacid
264
282
  # ========================================================================= #
265
283
  def update_the_dna_sequence_then_do_the_conversion
266
284
  set_dna_sequence(
267
- left_entry?.text
285
+ left_entry?.text.upcase # Upcasing this is more elegant, in my opinion.
268
286
  )
269
287
  do_the_conversion
270
288
  end
@@ -289,33 +307,6 @@ class DnaToAminoacidWidget < ::Gtk::Box # === Bioroebe::GUI::Gtk::DnaToAminoacid
289
307
  # @right_entry.on_click_event { :select_text }
290
308
  end
291
309
 
292
- # ========================================================================= #
293
- # === create_button_trigger_conversion
294
- # ========================================================================= #
295
- def create_button_trigger_conversion
296
- # ======================================================================= #
297
- # === @button_trigger_conversion
298
- # ======================================================================= #
299
- @button_trigger_conversion = gtk_bold_button('_Trigger Conversion')
300
- @button_trigger_conversion.disallow_resizing
301
- @button_trigger_conversion.set_size_request(125, 40)
302
- @button_trigger_conversion.lightgreen
303
- @button_trigger_conversion.set_background_colour :whitesmoke
304
- @button_trigger_conversion.on_clicked {
305
- update_the_dna_sequence_then_do_the_conversion
306
- }
307
- @button_trigger_conversion.bblack2
308
- # ======================================================================= #
309
- # Use a tooltip as well for our button:
310
- # ======================================================================= #
311
- @button_trigger_conversion.hint =
312
- "Clicking on this button will convert from a <b>DNA</b> "\
313
- "<b>sequence</b> \n(on the left hand side) to the <b>corresponding "\
314
- "Aminoacid sequence</b>.\n\nMake sure you input the DNA sequence "\
315
- "on the left hand side. The space character, aka ' ', will "\
316
- "be ignored."
317
- end
318
-
319
310
  # ========================================================================= #
320
311
  # === connect_skeleton (connect tag)
321
312
  # ========================================================================= #
@@ -325,9 +316,9 @@ class DnaToAminoacidWidget < ::Gtk::Box # === Bioroebe::GUI::Gtk::DnaToAminoacid
325
316
  # The two top labels denote which widget is the one for the DNA
326
317
  # sequence, and which one is for the aminoacid sequence.
327
318
  # ======================================================================= #
328
- dna_sequence_label = gtk_bold_label('DNA sequence')
319
+ dna_sequence_label = bold_label('DNA sequence')
329
320
  dna_sequence_label.set_size_request(sanitized_half_width, 42)
330
- aminoacid_sequence_label = gtk_bold_label('Aminoacid sequence')
321
+ aminoacid_sequence_label = bold_label('Aminoacid sequence')
331
322
  aminoacid_sequence_label.set_size_request(sanitized_half_width, 42)
332
323
  # ======================================================================= #
333
324
  # API for .attach() is:
@@ -357,6 +348,7 @@ class DnaToAminoacidWidget < ::Gtk::Box # === Bioroebe::GUI::Gtk::DnaToAminoacid
357
348
  dropdown_box.use_this_font = SMALLER_FONT
358
349
  dropdown_box.first_element_is_active
359
350
  dropdown_box.bblack1
351
+ dropdown_box.pad5px
360
352
  dropdown_box.hint = 'When a new codon table is assigned, via the '\
361
353
  'drop-down menu, then any assigned DNA sequence will be automatically '\
362
354
  'translated to its corresponding amino acid sequence.'
@@ -370,11 +362,16 @@ class DnaToAminoacidWidget < ::Gtk::Box # === Bioroebe::GUI::Gtk::DnaToAminoacid
370
362
  hbox.minimal(dropdown_box, 3)
371
363
  add(hbox)
372
364
  vbox = gtk_vbox
373
- @label_n_DNA_nucleotides = gtk_bold_label('n DNA nucleotides: ')
365
+ # ======================================================================= #
366
+ # === @label_n_DNA_nucleotides
367
+ # ======================================================================= #
368
+ @label_n_DNA_nucleotides = bold_label('n DNA nucleotides: ')
374
369
  @label_n_DNA_nucleotides.align_left
370
+ @label_n_DNA_nucleotides.make_selectable
375
371
  vbox.add(@label_n_DNA_nucleotides)
376
- @label_n_aminoacids = gtk_bold_label('n aminoacids: ')
372
+ @label_n_aminoacids = bold_label('n aminoacids: ')
377
373
  @label_n_aminoacids.align_left
374
+ @label_n_aminoacids.make_selectable
378
375
  vbox.add(@label_n_aminoacids)
379
376
  minimal(vbox)
380
377
  end
@@ -388,7 +385,7 @@ class DnaToAminoacidWidget < ::Gtk::Box # === Bioroebe::GUI::Gtk::DnaToAminoacid
388
385
  @header_bar.bblack1
389
386
  button_open_file = icon_theme(:open_file)
390
387
  button_open_file.hint = 'Click on this button to open a '\
391
- 'local FASTA file.'
388
+ 'local FASTA file.'
392
389
  button_open_file.on_clicked {
393
390
  result = do_pick_a_local_file
394
391
  if result and File.file?(result) and result.end_with?('.fasta','.fa')
@@ -410,9 +407,9 @@ class DnaToAminoacidWidget < ::Gtk::Box # === Bioroebe::GUI::Gtk::DnaToAminoacid
410
407
  current_folder: ::Bioroebe.log_dir?,
411
408
  additional_directories: [
412
409
  ::Bioroebe.log_dir?,
413
- ENV['PC'],
414
- ENV['MY_TEMP'],
415
- ENV['RSRC']
410
+ ENV['PC'].to_s,
411
+ ENV['MY_TEMP'].to_s,
412
+ ENV['RSRC'].to_s
416
413
  ]
417
414
  }}
418
415
  _ = ::Gtk.main_file?.to_s
@@ -505,17 +502,6 @@ class DnaToAminoacidWidget < ::Gtk::Box # === Bioroebe::GUI::Gtk::DnaToAminoacid
505
502
  set_dna_sequence(i)
506
503
  end
507
504
 
508
- # ========================================================================= #
509
- # === create_skeleton (create tag)
510
- # ========================================================================= #
511
- def create_skeleton
512
- create_the_header_bar
513
- create_grid
514
- create_button_trigger_conversion
515
- create_the_entries
516
- create_the_event_box
517
- end
518
-
519
505
  # ========================================================================= #
520
506
  # === set_aminoacid_sequence
521
507
  # ========================================================================= #
@@ -573,6 +559,46 @@ class DnaToAminoacidWidget < ::Gtk::Box # === Bioroebe::GUI::Gtk::DnaToAminoacid
573
559
  alias do_trigger_the_conversion do_the_conversion # === do_trigger_the_conversion
574
560
  alias do_determine_the_aminoacid_sequence do_the_conversion # === do_determine_the_aminoacid_sequence
575
561
 
562
+ # ========================================================================= #
563
+ # === create_skeleton (create tag)
564
+ # ========================================================================= #
565
+ def create_skeleton
566
+ create_the_header_bar
567
+ create_grid
568
+ create_button_trigger_conversion
569
+ create_the_entries
570
+ create_the_event_box
571
+ end
572
+
573
+ # ========================================================================= #
574
+ # === create_button_trigger_conversion
575
+ # ========================================================================= #
576
+ def create_button_trigger_conversion
577
+ # ======================================================================= #
578
+ # === @button_trigger_conversion
579
+ # ======================================================================= #
580
+ @button_trigger_conversion = bold_button('_Trigger Conversion')
581
+ @button_trigger_conversion.clear_background
582
+ @button_trigger_conversion.disallow_resizing
583
+ @button_trigger_conversion.set_size_request(125, 40)
584
+ @button_trigger_conversion.set_background_colour :whitesmoke
585
+ @button_trigger_conversion.on_hover(:lightgreen)
586
+ @button_trigger_conversion.on_clicked {
587
+ update_the_dna_sequence_then_do_the_conversion
588
+ do_properly_space_the_top_left_entry
589
+ }
590
+ @button_trigger_conversion.bblack2
591
+ # ======================================================================= #
592
+ # Use a tooltip as well for our button:
593
+ # ======================================================================= #
594
+ @button_trigger_conversion.hint =
595
+ "Clicking on this button will convert from a <b>DNA</b> "\
596
+ "<b>sequence</b> \n(on the left hand side) to the <b>corresponding "\
597
+ "Aminoacid sequence</b>.\n\nMake sure you input the DNA sequence "\
598
+ "on the left hand side. The space character, aka ' ', will "\
599
+ "be ignored."
600
+ end
601
+
576
602
  # ========================================================================= #
577
603
  # === run (run tag)
578
604
  # ========================================================================= #
@@ -584,7 +610,7 @@ class DnaToAminoacidWidget < ::Gtk::Box # === Bioroebe::GUI::Gtk::DnaToAminoacid
584
610
  # ========================================================================= #
585
611
  # === Bioroebe::GUI::Gtk::DnaToAminoacidWidget[]
586
612
  # ========================================================================= #
587
- def self.[](i = '')
613
+ def self.[](i = ARGV)
588
614
  new(i)
589
615
  end
590
616
 
@@ -152,30 +152,6 @@ class HammingDistance < ::Gtk::Box # === Bioroebe::GUI::Gtk::HammingDistance
152
152
  @entry_on_top
153
153
  end
154
154
 
155
- # ========================================================================= #
156
- # === compare_the_two_sequences
157
- #
158
- # This is the method that will compare the two sequences.
159
- # ========================================================================= #
160
- def compare_the_two_sequences
161
- hamming_distance_object = ::Bioroebe::HammingDistance.new("#{seq1?} #{seq2?}") { :be_quiet }
162
- @entry_n_differences.set_text(
163
- hamming_distance_object.n_differences?.to_s
164
- )
165
- end; alias do_compare compare_the_two_sequences # === do_compare
166
- alias do_calculate_the_differences compare_the_two_sequences # === do_calculate_the_differences
167
-
168
- # ========================================================================= #
169
- # === consider_sanitizing_the_input
170
- # ========================================================================= #
171
- def consider_sanitizing_the_input
172
- # ======================================================================= #
173
- # The following two lines were added as of 07.05.2020.
174
- # ======================================================================= #
175
- @entry_on_top.set_text(@entry_on_top.text.delete('-'))
176
- @entry_on_bottom.set_text(@entry_on_bottom.text.delete('-'))
177
- end
178
-
179
155
  # ========================================================================= #
180
156
  # === create_entries (entries tag, entry tag)
181
157
  # ========================================================================= #
@@ -211,10 +187,10 @@ class HammingDistance < ::Gtk::Box # === Bioroebe::GUI::Gtk::HammingDistance
211
187
  # This is ok.
212
188
  when *%w( B D E F H I J K L M N O P Q R S V W X Y Z ) # Otherwise set the old input here.
213
189
  unless event.state.control_mask? # This snippet checks whether a key-combination has been used.
214
- widget.set_text(old_text)
190
+ widget.set_text(old_text.upcase)
215
191
  end
216
192
  end
217
- }
193
+ } if false # disabled as of August 2022.
218
194
  # ======================================================================= #
219
195
  # And keep things upcased here:
220
196
  # ======================================================================= #
@@ -269,10 +245,10 @@ class HammingDistance < ::Gtk::Box # === Bioroebe::GUI::Gtk::HammingDistance
269
245
  # ======================================================================= #
270
246
  # === The top box
271
247
  # ======================================================================= #
272
- @top_box = gtk_vbox
248
+ @top_box = vbox
273
249
 
274
250
  @label_on_top = bold_label(USE_THIS_TITLE)
275
- @label_on_top.fancy_tooltips =
251
+ @label_on_top.hint =
276
252
  "Only <b>valid nucleotides</b> (A, T, C, G, U) \n"\
277
253
  "can be accepted as input."
278
254
  # ======================================================================= #
@@ -334,6 +310,44 @@ class HammingDistance < ::Gtk::Box # === Bioroebe::GUI::Gtk::HammingDistance
334
310
  show_all
335
311
  end
336
312
 
313
+ # ========================================================================= #
314
+ # === compare_the_two_sequences
315
+ #
316
+ # This is the method that will compare the two sequences.
317
+ # ========================================================================= #
318
+ def compare_the_two_sequences
319
+ do_upcase_all_entries
320
+ hamming_distance_object = ::Bioroebe::HammingDistance.new("#{seq1?} #{seq2?}") { :be_quiet }
321
+ @entry_n_differences.set_text(
322
+ hamming_distance_object.n_differences?.to_s
323
+ )
324
+ end; alias do_compare compare_the_two_sequences # === do_compare
325
+ alias do_calculate_the_differences compare_the_two_sequences # === do_calculate_the_differences
326
+
327
+ # ========================================================================= #
328
+ # === do_upcase_all_entries
329
+ # ========================================================================= #
330
+ def do_upcase_all_entries
331
+ [
332
+ @entry_on_top,
333
+ @entry_on_bottom
334
+ ].each {|entry|
335
+ entry.do_upcase
336
+ }
337
+ end
338
+
339
+ # ========================================================================= #
340
+ # === consider_sanitizing_the_input
341
+ # ========================================================================= #
342
+ def consider_sanitizing_the_input
343
+ # ======================================================================= #
344
+ # The following two lines were added as of 07.05.2020.
345
+ # ======================================================================= #
346
+ @entry_on_top.set_text(@entry_on_top.text.delete('-'))
347
+ @entry_on_bottom.set_text(@entry_on_bottom.text.delete('-'))
348
+ do_upcase_all_entries
349
+ end
350
+
337
351
  # ========================================================================= #
338
352
  # === run (run tag)
339
353
  # ========================================================================= #