bioroebe 0.10.80 → 0.12.12

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 (242) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3612 -2781
  3. data/bin/bioroebe +7 -1
  4. data/bin/bioroebe_hash +7 -0
  5. data/bin/codon_to_aminoacid +1 -0
  6. data/bioroebe.gemspec +3 -3
  7. data/doc/README.gen +3612 -2742
  8. data/doc/quality_control/commandline_applications.md +3 -3
  9. data/doc/todo/bioroebe_java_todo.md +22 -0
  10. data/doc/todo/bioroebe_todo.md +2059 -2615
  11. data/lib/bioroebe/aminoacids/aminoacid_substitution.rb +1 -9
  12. data/lib/bioroebe/aminoacids/codon_percentage.rb +1 -9
  13. data/lib/bioroebe/aminoacids/deduce_aminoacid_sequence.rb +1 -9
  14. data/lib/bioroebe/aminoacids/display_aminoacid_table.rb +1 -0
  15. data/lib/bioroebe/aminoacids/show_hydrophobicity.rb +1 -6
  16. data/lib/bioroebe/base/colours_for_base/colours_for_base.rb +18 -8
  17. data/lib/bioroebe/base/commandline_application/commandline_arguments.rb +15 -11
  18. data/lib/bioroebe/base/commandline_application/misc.rb +66 -49
  19. data/lib/bioroebe/base/commandline_application/opn.rb +8 -8
  20. data/lib/bioroebe/base/commandline_application/reset.rb +3 -2
  21. data/lib/bioroebe/base/misc.rb +35 -0
  22. data/lib/bioroebe/base/prototype/misc.rb +11 -1
  23. data/lib/bioroebe/codon_tables/frequencies/parse_frequency_table.rb +2 -10
  24. data/lib/bioroebe/codons/codons.rb +1 -1
  25. data/lib/bioroebe/codons/convert_this_codon_to_that_aminoacid.rb +192 -58
  26. data/lib/bioroebe/codons/possible_codons_for_this_aminoacid.rb +1 -9
  27. data/lib/bioroebe/codons/show_codon_tables.rb +6 -2
  28. data/lib/bioroebe/codons/show_codon_usage.rb +15 -4
  29. data/lib/bioroebe/colours/rev.rb +4 -1
  30. data/lib/bioroebe/constants/aminoacids_and_proteins.rb +1 -0
  31. data/lib/bioroebe/constants/database_constants.rb +1 -1
  32. data/lib/bioroebe/constants/files_and_directories.rb +31 -4
  33. data/lib/bioroebe/constants/misc.rb +20 -0
  34. data/lib/bioroebe/conversions/dna_to_aminoacid_sequence.rb +58 -24
  35. data/lib/bioroebe/count/count_amount_of_aminoacids.rb +3 -2
  36. data/lib/bioroebe/count/count_amount_of_nucleotides.rb +3 -0
  37. data/lib/bioroebe/crystal/README.md +2 -0
  38. data/lib/bioroebe/crystal/to_rna.cr +19 -0
  39. data/lib/bioroebe/data/README.md +11 -8
  40. data/lib/bioroebe/data/electron_microscopy/pos_example.pos +396 -0
  41. data/lib/bioroebe/data/electron_microscopy/test_particles.star +36 -0
  42. data/lib/bioroebe/data/fasta/human/Homo_sapiens_hemoglobin_subunit_alpha_HBB_mRNA.fasta +9 -0
  43. data/lib/bioroebe/data/fasta/human/Homo_sapiens_hemoglobin_subunit_beta_HBB_mRNA.fasta +8 -0
  44. data/lib/bioroebe/data/fasta/human/README.md +2 -0
  45. data/lib/bioroebe/electron_microscopy/coordinate_analyzer.rb +15 -18
  46. data/lib/bioroebe/{fasta_and_fastq/parse_fasta/run.rb → electron_microscopy/electron_microscopy_module.rb} +16 -8
  47. data/lib/bioroebe/electron_microscopy/fix_pos_file.rb +1 -9
  48. data/lib/bioroebe/electron_microscopy/flipy.rb +83 -0
  49. data/lib/bioroebe/electron_microscopy/parse_coordinates.rb +2 -10
  50. data/lib/bioroebe/electron_microscopy/read_file_xmd.rb +1 -9
  51. data/lib/bioroebe/electron_microscopy/simple_star_file_generator.rb +4 -9
  52. data/lib/bioroebe/enzymes/has_this_restriction_enzyme.rb +10 -3
  53. data/lib/bioroebe/enzymes/restriction_enzyme.rb +23 -1
  54. data/lib/bioroebe/enzymes/restriction_enzymes/statistics.rb +65 -0
  55. data/lib/bioroebe/fasta_and_fastq/autocorrect_the_name_of_this_fasta_file.rb +1 -9
  56. data/lib/bioroebe/fasta_and_fastq/compact_fasta_file/compact_fasta_file.rb +7 -9
  57. data/lib/bioroebe/fasta_and_fastq/fasta_defline/fasta_defline.rb +1 -5
  58. data/lib/bioroebe/fasta_and_fastq/fasta_to_yaml/fasta_to_yaml.rb +81 -0
  59. data/lib/bioroebe/fasta_and_fastq/parse_fasta/parse_fasta.rb +1465 -7
  60. data/lib/bioroebe/fasta_and_fastq/return_fasta_subsection_of_this_file.rb +11 -2
  61. data/lib/bioroebe/fasta_and_fastq/show_fasta_headers.rb +27 -12
  62. data/lib/bioroebe/fasta_and_fastq/simplify_fasta_header/simplify_fasta_header.rb +1 -5
  63. data/lib/bioroebe/fasta_and_fastq/split_this_fasta_file_into_chromosomes/constants.rb +0 -5
  64. data/lib/bioroebe/genome/README.md +4 -0
  65. data/lib/bioroebe/genome/genome.rb +67 -0
  66. data/lib/bioroebe/genomes/genome_pattern.rb +3 -9
  67. data/lib/bioroebe/gui/gtk +1 -0
  68. data/lib/bioroebe/gui/gtk3/alignment/alignment.rb +73 -128
  69. data/lib/bioroebe/gui/gtk3/controller/controller.rb +45 -27
  70. data/lib/bioroebe/gui/gtk3/dna_to_aminoacid_widget/dna_to_aminoacid_widget.rb +76 -50
  71. data/lib/bioroebe/gui/gtk3/fasta_table_widget/fasta_table_widget.rb +99 -21
  72. data/lib/bioroebe/gui/gtk3/hamming_distance/hamming_distance.rb +42 -28
  73. data/lib/bioroebe/gui/gtk3/nucleotide_analyser/nucleotide_analyser.rb +119 -71
  74. data/lib/bioroebe/gui/gtk3/protein_to_DNA/protein_to_DNA.rb +18 -18
  75. data/lib/bioroebe/gui/gtk3/random_sequence/random_sequence.rb +19 -11
  76. data/lib/bioroebe/gui/jruby/alignment/alignment.rb +165 -0
  77. data/lib/bioroebe/gui/libui/alignment/alignment.rb +3 -1
  78. data/lib/bioroebe/gui/libui/controller/controller.rb +116 -0
  79. data/lib/bioroebe/gui/libui/random_sequence/random_sequence.rb +18 -2
  80. data/lib/bioroebe/gui/libui/show_codon_table/show_codon_table.rb +2 -0
  81. data/lib/bioroebe/gui/libui/three_to_one/three_to_one.rb +8 -6
  82. data/lib/bioroebe/gui/shared_code/alignment/alignment_module.rb +102 -0
  83. data/lib/bioroebe/gui/shared_code/levensthein_distance/levensthein_distance_module.rb +18 -16
  84. data/lib/bioroebe/gui/shared_code/protein_to_DNA/protein_to_DNA_module.rb +14 -14
  85. data/lib/bioroebe/gui/swing/three_to_one/ThreeToOne$1.class +0 -0
  86. data/lib/bioroebe/gui/swing/three_to_one/ThreeToOne$CloseListener.class +0 -0
  87. data/lib/bioroebe/gui/swing/three_to_one/ThreeToOne.class +0 -0
  88. data/lib/bioroebe/gui/swing/three_to_one/ThreeToOne.java +141 -0
  89. data/lib/bioroebe/images/FORWARD_PRIMER.png +0 -0
  90. data/lib/bioroebe/images/REVERSE_PRIMER.png +0 -0
  91. data/lib/bioroebe/java/README.md +4 -0
  92. data/lib/bioroebe/java/bioroebe/Sequence.java +25 -1
  93. data/lib/bioroebe/java/bioroebe/src/main/java/bioroebe/Base.class +0 -0
  94. data/lib/bioroebe/java/bioroebe/{Base.java → src/main/java/bioroebe/Base.java} +15 -2
  95. data/lib/bioroebe/java/bioroebe/{BisulfiteTreatment.class → src/main/java/bioroebe/BisulfiteTreatment.class} +0 -0
  96. data/lib/bioroebe/java/bioroebe/{Codons.class → src/main/java/bioroebe/Codons.class} +0 -0
  97. data/lib/bioroebe/java/bioroebe/src/main/java/bioroebe/Codons.java +34 -0
  98. data/lib/bioroebe/java/bioroebe/src/main/java/bioroebe/Commandline.class +0 -0
  99. data/lib/bioroebe/java/bioroebe/src/main/java/bioroebe/Commandline.java +101 -0
  100. data/lib/bioroebe/java/bioroebe/{GenerateRandomDnaSequence.class → src/main/java/bioroebe/GenerateRandomDnaSequence.class} +0 -0
  101. data/lib/bioroebe/java/bioroebe/{GenerateRandomDnaSequence.java → src/main/java/bioroebe/GenerateRandomDnaSequence.java} +8 -2
  102. data/lib/bioroebe/java/bioroebe/{IsPalindrome.class → src/main/java/bioroebe/IsPalindrome.class} +0 -0
  103. data/lib/bioroebe/java/bioroebe/{IsPalindrome.java → src/main/java/bioroebe/IsPalindrome.java} +5 -1
  104. data/lib/bioroebe/java/bioroebe/src/main/java/bioroebe/PartnerNucleotide.class +0 -0
  105. data/lib/bioroebe/java/bioroebe/src/main/java/bioroebe/PartnerNucleotide.java +56 -0
  106. data/lib/bioroebe/java/bioroebe/{RemoveFile.java → src/main/java/bioroebe/RemoveFile.java} +10 -4
  107. data/lib/bioroebe/java/bioroebe/{RemoveNumbers.class → src/main/java/bioroebe/RemoveNumbers.class} +0 -0
  108. data/lib/bioroebe/java/bioroebe/{RemoveNumbers.java → src/main/java/bioroebe/RemoveNumbers.java} +1 -0
  109. data/lib/bioroebe/java/bioroebe/{ToCamelcase.class → src/main/java/bioroebe/ToCamelcase.class} +0 -0
  110. data/lib/bioroebe/java/bioroebe/{ToCamelcase.java → src/main/java/bioroebe/ToCamelcase.java} +3 -3
  111. data/lib/bioroebe/java/bioroebe/src/main/java/bioroebe/ToRNA.class +0 -0
  112. data/lib/bioroebe/java/bioroebe/src/main/java/bioroebe/ToRNA.java +42 -0
  113. data/lib/bioroebe/java/bioroebe/src/main/java/bioroebe/toplevel_methods/BaseComposition.class +0 -0
  114. data/lib/bioroebe/java/bioroebe/src/main/java/bioroebe/toplevel_methods/BaseComposition.java +75 -0
  115. data/lib/bioroebe/misc/ruler.rb +11 -2
  116. data/lib/bioroebe/nucleotides/most_likely_nucleotide_sequence_for_this_aminoacid_sequence.rb +1 -9
  117. data/lib/bioroebe/nucleotides/show_nucleotide_sequence.rb +7 -7
  118. data/lib/bioroebe/parsers/genbank_parser.rb +347 -26
  119. data/lib/bioroebe/parsers/gff.rb +1 -9
  120. data/lib/bioroebe/patterns/scan_for_repeat.rb +1 -5
  121. data/lib/bioroebe/pdb/fetch_fasta_sequence_from_pdb.rb +1 -9
  122. data/lib/bioroebe/pdb/parse_mmCIF_file.rb +1 -9
  123. data/lib/bioroebe/pdb/parse_pdb_file.rb +4 -10
  124. data/lib/bioroebe/project/project.rb +1 -1
  125. data/lib/bioroebe/python/README.md +1 -0
  126. data/lib/bioroebe/python/__pycache__/mymodule.cpython-39.pyc +0 -0
  127. data/lib/bioroebe/python/gui/gtk3/all_in_one.css +4 -0
  128. data/lib/bioroebe/python/gui/gtk3/all_in_one.py +59 -0
  129. data/lib/bioroebe/python/gui/gtk3/widget1.py +20 -0
  130. data/lib/bioroebe/python/gui/tkinter/all_in_one.py +91 -0
  131. data/lib/bioroebe/python/mymodule.py +8 -0
  132. data/lib/bioroebe/python/protein_to_dna.py +33 -0
  133. data/lib/bioroebe/python/shell/shell.py +19 -0
  134. data/lib/bioroebe/python/to_rna.py +14 -0
  135. data/lib/bioroebe/python/toplevel_methods/esystem.py +12 -0
  136. data/lib/bioroebe/python/toplevel_methods/open_in_browser.py +20 -0
  137. data/lib/bioroebe/python/toplevel_methods/palindromes.py +42 -0
  138. data/lib/bioroebe/python/toplevel_methods/rds.py +13 -0
  139. data/lib/bioroebe/python/toplevel_methods/shuffleseq.py +23 -0
  140. data/lib/bioroebe/python/toplevel_methods/three_delimiter.py +37 -0
  141. data/lib/bioroebe/python/toplevel_methods/time_and_date.py +43 -0
  142. data/lib/bioroebe/python/toplevel_methods/to_camelcase.py +21 -0
  143. data/lib/bioroebe/requires/require_the_bioroebe_project.rb +3 -1
  144. data/lib/bioroebe/sequence/alignment.rb +14 -4
  145. data/lib/bioroebe/sequence/dna.rb +1 -0
  146. data/lib/bioroebe/sequence/nucleotide_module/nucleotide_module.rb +28 -25
  147. data/lib/bioroebe/sequence/protein.rb +105 -3
  148. data/lib/bioroebe/sequence/sequence.rb +87 -21
  149. data/lib/bioroebe/shell/menu.rb +3829 -3714
  150. data/lib/bioroebe/shell/misc.rb +59 -4307
  151. data/lib/bioroebe/shell/readline/readline.rb +1 -1
  152. data/lib/bioroebe/shell/shell.rb +11255 -28
  153. data/lib/bioroebe/siRNA/siRNA.rb +81 -1
  154. data/lib/bioroebe/string_matching/find_longest_substring.rb +3 -2
  155. data/lib/bioroebe/string_matching/hamming_distance.rb +1 -9
  156. data/lib/bioroebe/taxonomy/class_methods.rb +3 -8
  157. data/lib/bioroebe/taxonomy/constants.rb +4 -3
  158. data/lib/bioroebe/taxonomy/edit.rb +2 -1
  159. data/lib/bioroebe/taxonomy/help/help.rb +10 -10
  160. data/lib/bioroebe/taxonomy/help/helpline.rb +2 -2
  161. data/lib/bioroebe/taxonomy/info/check_available.rb +15 -9
  162. data/lib/bioroebe/taxonomy/info/info.rb +18 -11
  163. data/lib/bioroebe/taxonomy/info/is_dna.rb +46 -36
  164. data/lib/bioroebe/taxonomy/interactive.rb +140 -104
  165. data/lib/bioroebe/taxonomy/menu.rb +27 -18
  166. data/lib/bioroebe/taxonomy/parse_fasta.rb +3 -1
  167. data/lib/bioroebe/taxonomy/shared.rb +1 -0
  168. data/lib/bioroebe/taxonomy/taxonomy.rb +1 -0
  169. data/lib/bioroebe/toplevel_methods/aminoacids_and_proteins.rb +31 -24
  170. data/lib/bioroebe/toplevel_methods/colourize_related_methods.rb +164 -0
  171. data/lib/bioroebe/toplevel_methods/databases.rb +1 -1
  172. data/lib/bioroebe/toplevel_methods/digest.rb +18 -8
  173. data/lib/bioroebe/toplevel_methods/fasta_and_fastq.rb +107 -63
  174. data/lib/bioroebe/toplevel_methods/file_and_directory_related_actions.rb +14 -2
  175. data/lib/bioroebe/toplevel_methods/frequencies.rb +8 -1
  176. data/lib/bioroebe/toplevel_methods/misc.rb +142 -12
  177. data/lib/bioroebe/toplevel_methods/nucleotides.rb +118 -46
  178. data/lib/bioroebe/toplevel_methods/open_in_browser.rb +2 -0
  179. data/lib/bioroebe/toplevel_methods/palindromes.rb +1 -2
  180. data/lib/bioroebe/toplevel_methods/taxonomy.rb +2 -2
  181. data/lib/bioroebe/toplevel_methods/to_camelcase.rb +5 -0
  182. data/lib/bioroebe/utility_scripts/align_open_reading_frames.rb +1 -9
  183. data/lib/bioroebe/utility_scripts/check_for_mismatches/check_for_mismatches.rb +1 -9
  184. data/lib/bioroebe/utility_scripts/compacter.rb +1 -9
  185. data/lib/bioroebe/utility_scripts/compseq/compseq.rb +1 -9
  186. data/lib/bioroebe/utility_scripts/consensus_sequence.rb +6 -6
  187. data/lib/bioroebe/utility_scripts/create_batch_entrez_file.rb +1 -9
  188. data/lib/bioroebe/utility_scripts/dot_alignment.rb +1 -9
  189. data/lib/bioroebe/utility_scripts/move_file_to_its_correct_location.rb +1 -4
  190. data/lib/bioroebe/utility_scripts/parse_taxonomy.rb +2 -2
  191. data/lib/bioroebe/utility_scripts/showorf/constants.rb +0 -5
  192. data/lib/bioroebe/utility_scripts/showorf/reset.rb +1 -4
  193. data/lib/bioroebe/version/version.rb +2 -2
  194. data/lib/bioroebe/www/embeddable_interface.rb +103 -54
  195. data/lib/bioroebe/www/sinatra/sinatra.rb +186 -70
  196. data/lib/bioroebe/yaml/aminoacids/amino_acids_long_name_to_one_letter.yml +2 -2
  197. data/lib/bioroebe/yaml/configuration/browser.yml +1 -1
  198. data/lib/bioroebe/yaml/configuration/temp_dir.yml +1 -1
  199. data/lib/bioroebe/yaml/genomes/README.md +3 -4
  200. data/lib/bioroebe/yaml/restriction_enzymes/restriction_enzymes.yml +27 -27
  201. metadata +81 -64
  202. data/doc/setup.rb +0 -1655
  203. data/lib/bioroebe/fasta_and_fastq/parse_fasta/constants.rb +0 -50
  204. data/lib/bioroebe/fasta_and_fastq/parse_fasta/initialize.rb +0 -86
  205. data/lib/bioroebe/fasta_and_fastq/parse_fasta/menu.rb +0 -117
  206. data/lib/bioroebe/fasta_and_fastq/parse_fasta/misc.rb +0 -981
  207. data/lib/bioroebe/fasta_and_fastq/parse_fasta/report.rb +0 -156
  208. data/lib/bioroebe/fasta_and_fastq/parse_fasta/reset.rb +0 -128
  209. data/lib/bioroebe/genbank/genbank_parser.rb +0 -291
  210. data/lib/bioroebe/java/bioroebe/Base.class +0 -0
  211. data/lib/bioroebe/java/bioroebe/Codons.java +0 -22
  212. data/lib/bioroebe/java/bioroebe/PartnerNucleotide.class +0 -0
  213. data/lib/bioroebe/java/bioroebe/PartnerNucleotide.java +0 -19
  214. data/lib/bioroebe/java/bioroebe.jar +0 -0
  215. data/lib/bioroebe/shell/add.rb +0 -108
  216. data/lib/bioroebe/shell/assign.rb +0 -360
  217. data/lib/bioroebe/shell/chop_and_cut.rb +0 -281
  218. data/lib/bioroebe/shell/constants.rb +0 -166
  219. data/lib/bioroebe/shell/download.rb +0 -335
  220. data/lib/bioroebe/shell/enable_and_disable.rb +0 -158
  221. data/lib/bioroebe/shell/enzymes.rb +0 -310
  222. data/lib/bioroebe/shell/fasta.rb +0 -345
  223. data/lib/bioroebe/shell/gtk.rb +0 -76
  224. data/lib/bioroebe/shell/history.rb +0 -132
  225. data/lib/bioroebe/shell/initialize.rb +0 -217
  226. data/lib/bioroebe/shell/loop.rb +0 -74
  227. data/lib/bioroebe/shell/prompt.rb +0 -107
  228. data/lib/bioroebe/shell/random.rb +0 -289
  229. data/lib/bioroebe/shell/reset.rb +0 -335
  230. data/lib/bioroebe/shell/scan_and_parse.rb +0 -135
  231. data/lib/bioroebe/shell/search.rb +0 -337
  232. data/lib/bioroebe/shell/sequences.rb +0 -200
  233. data/lib/bioroebe/shell/show_report_and_display.rb +0 -2901
  234. data/lib/bioroebe/shell/startup.rb +0 -127
  235. data/lib/bioroebe/shell/taxonomy.rb +0 -14
  236. data/lib/bioroebe/shell/tk.rb +0 -23
  237. data/lib/bioroebe/shell/user_input.rb +0 -88
  238. data/lib/bioroebe/shell/xorg.rb +0 -45
  239. /data/lib/bioroebe/java/bioroebe/{BisulfiteTreatment.java → src/main/java/bioroebe/BisulfiteTreatment.java} +0 -0
  240. /data/lib/bioroebe/java/bioroebe/{Esystem.class → src/main/java/bioroebe/Esystem.class} +0 -0
  241. /data/lib/bioroebe/java/bioroebe/{Esystem.java → src/main/java/bioroebe/Esystem.java} +0 -0
  242. /data/lib/bioroebe/java/bioroebe/{RemoveFile.class → src/main/java/bioroebe/RemoveFile.class} +0 -0
@@ -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
 
@@ -8,6 +8,8 @@
8
8
  #
9
9
  # https://raw.githubusercontent.com/labsquare/fastQt/master/screenshot.gif
10
10
  #
11
+ # The widget supports loading .fasta files from the commandline - simply
12
+ # pass the file location (local path) to the widget as argument.
11
13
  # =========================================================================== #
12
14
  # require 'bioroebe/gui/gtk3/fasta_table_widget/fasta_table_widget.rb'
13
15
  # Bioroebe::GUI::Gtk::FastaTableWidget.run
@@ -27,11 +29,6 @@ class FastaTableWidget < ::Gtk::Frame # === Bioroebe::GUI::Gtk::FastaTableWidget
27
29
  require 'gtk_paradise/requires/require_the_base_module.rb'
28
30
  include ::Gtk::BaseModule
29
31
 
30
- # ========================================================================= #
31
- # === NAMESPACE
32
- # ========================================================================= #
33
- NAMESPACE = inspect
34
-
35
32
  # ========================================================================= #
36
33
  # === TITLE
37
34
  # ========================================================================= #
@@ -81,16 +78,21 @@ class FastaTableWidget < ::Gtk::Frame # === Bioroebe::GUI::Gtk::FastaTableWidget
81
78
  # === reset (reset tag)
82
79
  # ========================================================================= #
83
80
  def reset
81
+ infer_the_namespace
84
82
  reset_the_internal_variables
85
83
  # ======================================================================= #
86
84
  # === @configuration
87
85
  # ======================================================================= #
88
- @configuration = [true, __dir__, NAMESPACE]
86
+ @configuration = [true, __dir__, namespace?]
89
87
  title_width_height_font(TITLE, WIDTH, HEIGHT, main_font?)
90
88
  # ======================================================================= #
91
89
  # === @use_this_directory
92
90
  # ======================================================================= #
93
91
  @use_this_directory = ::Bioroebe.log_directory?+'fasta/'
92
+ # ======================================================================= #
93
+ # === @all_fasta_files
94
+ # ======================================================================= #
95
+ @all_fasta_files = Dir[@use_this_directory+'*.fasta']
94
96
  handle_CSS_rules
95
97
  infer_the_size_automatically
96
98
  end
@@ -109,6 +111,13 @@ class FastaTableWidget < ::Gtk::Frame # === Bioroebe::GUI::Gtk::FastaTableWidget
109
111
  0
110
112
  end
111
113
 
114
+ # ========================================================================= #
115
+ # === list_store?
116
+ # ========================================================================= #
117
+ def list_store?
118
+ @list_store
119
+ end; alias liststore? list_store? # === liststore?
120
+
112
121
  # ========================================================================= #
113
122
  # === create_view
114
123
  # ========================================================================= #
@@ -122,6 +131,7 @@ class FastaTableWidget < ::Gtk::Frame # === Bioroebe::GUI::Gtk::FastaTableWidget
122
131
  @view.make_sortable
123
132
  @view.the_headers_can_be_moved
124
133
  @view.enable_search
134
+ @view.deselect_on_right_click_event
125
135
  deselect_the_main_treeview
126
136
  end
127
137
 
@@ -154,7 +164,7 @@ class FastaTableWidget < ::Gtk::Frame # === Bioroebe::GUI::Gtk::FastaTableWidget
154
164
  end
155
165
 
156
166
  # ========================================================================= #
157
- # === handle_CSS_rules
167
+ # === handle_CSS_rules (CSS tag)
158
168
  # ========================================================================= #
159
169
  def handle_CSS_rules
160
170
  use_gtk_paradise_project_css_file
@@ -170,21 +180,10 @@ treeview.view header button {
170
180
  end
171
181
 
172
182
  # ========================================================================= #
173
- # === connect_skeleton (connect tag)
183
+ # === populate_the_list_store_with_the_default_dataset
174
184
  # ========================================================================= #
175
- def connect_skeleton
176
- abort_on_exception
177
- set_border_width(15)
178
- _ = label_widget
179
- _.set_text('FASTA files')
180
- _.left_align
181
- _.fonty(main_font?)
182
- _.make_bold
183
- _.css_class('darkblue')
184
- _.pad4px
185
- all_fasta_files = Dir[@use_this_directory+'*.fasta']
186
-
187
- array = all_fasta_files.map {|path|
185
+ def populate_the_list_store_with_the_default_dataset
186
+ array = @all_fasta_files.map {|path|
188
187
  parse_fasta_object = ::Bioroebe.parse_fasta(path) { :be_quiet }
189
188
  n_nucleotides = parse_fasta_object.n_nucleotides?
190
189
  gc_content = parse_fasta_object.gc_content # Bioroebe.gc_content
@@ -210,20 +209,98 @@ treeview.view header button {
210
209
  }
211
210
 
212
211
  populate_this_list_store_with_that_array4(@list_store, array)
212
+ end
213
+
214
+ # ========================================================================= #
215
+ # === connect_skeleton (connect tag)
216
+ # ========================================================================= #
217
+ def connect_skeleton
218
+ abort_on_exception
219
+ set_border_width(15)
220
+ populate_the_list_store_with_the_default_dataset
213
221
  scrolled_window = gtk_scrolled_window(@view) { :always }
214
222
  scrolled_window.width_height(540, 500)
215
223
  vbox = gtk_vbox
216
224
  vbox.minimal(scrolled_window, 14)
217
225
  add(vbox)
226
+ style_the_label_widget
218
227
  end
219
228
 
220
229
  # ========================================================================= #
221
230
  # === run (run tag)
222
231
  # ========================================================================= #
223
232
  def run
233
+ menu # Must come before the super() call.
224
234
  super()
225
235
  end
226
236
 
237
+ # ========================================================================= #
238
+ # === menu (menu tag)
239
+ # ========================================================================= #
240
+ def menu(
241
+ i = commandline_arguments?
242
+ )
243
+ if i.is_a? Array
244
+ i.each {|entry| menu(entry) }
245
+ else
246
+ # ===================================================================== #
247
+ # Load existing files:
248
+ # ===================================================================== #
249
+ if i and File.exist?(i)
250
+ clear_the_old_dataset
251
+ append_this_fasta_file(i)
252
+ end
253
+ end
254
+ end
255
+
256
+ # ========================================================================= #
257
+ # === append_this_fasta_file
258
+ # ========================================================================= #
259
+ def append_this_fasta_file(i)
260
+ unless @all_fasta_files.include?(i)
261
+ if i.end_with?('.fa','.fasta','.txt','.md')
262
+ @all_fasta_files << i
263
+ end
264
+ end
265
+ end; alias append_this_file append_this_fasta_file # === append_this_file
266
+
267
+ # ========================================================================= #
268
+ # === clear_the_old_dataset
269
+ # ========================================================================= #
270
+ def clear_the_old_dataset
271
+ @all_fasta_files.clear
272
+ end
273
+
274
+ # ========================================================================= #
275
+ # === style_the_label_widget
276
+ # ========================================================================= #
277
+ def style_the_label_widget
278
+ _ = hbox
279
+ label = text('FASTA files')
280
+ label.left_align
281
+ label.fonty(main_font?)
282
+ label.make_bold
283
+ label.css_class('darkblue')
284
+ label.pad4px
285
+ _.minimal label, 10
286
+ event_box = event_box(image_document_open)
287
+ event_box.on_clicked {
288
+ filename = ::Gtk.select_file(@parent_widget) {{ # @parent_widget should be of Gtk::Window class or subclass.
289
+ current_folder: return_pwd,
290
+ show_hidden: true,
291
+ add_these_shortcut_folders: Bioroebe.fasta_dir?
292
+ }}
293
+ if filename and File.exist?(filename)
294
+ append_this_file(filename)
295
+ # @view.clear
296
+ liststore?.clear
297
+ populate_the_list_store_with_the_default_dataset
298
+ end
299
+ }
300
+ _.minimal event_box, 10
301
+ self.label_widget = _
302
+ end
303
+
227
304
  # ========================================================================= #
228
305
  # === Bioroebe::GUI::Gtk::FastaTableWidget.run
229
306
  # ========================================================================= #
@@ -233,6 +310,7 @@ treeview.view header button {
233
310
  require 'gtk_paradise/run'
234
311
  _ = ::Bioroebe::GUI::Gtk::FastaTableWidget.new(i)
235
312
  r = ::Gtk.run
313
+ _.set_parent_widget(_)
236
314
  r << _
237
315
  r.automatic_size_then_automatic_title
238
316
  r.top_left_then_run