bioroebe 0.10.80 → 0.11.32

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 (210) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3209 -2618
  3. data/bin/bioroebe +7 -1
  4. data/bioroebe.gemspec +3 -3
  5. data/doc/README.gen +3208 -2617
  6. data/doc/quality_control/commandline_applications.md +3 -3
  7. data/doc/todo/bioroebe_todo.md +2040 -2615
  8. data/lib/bioroebe/aminoacids/aminoacid_substitution.rb +1 -9
  9. data/lib/bioroebe/aminoacids/codon_percentage.rb +1 -9
  10. data/lib/bioroebe/aminoacids/deduce_aminoacid_sequence.rb +1 -9
  11. data/lib/bioroebe/aminoacids/display_aminoacid_table.rb +1 -0
  12. data/lib/bioroebe/aminoacids/show_hydrophobicity.rb +1 -6
  13. data/lib/bioroebe/base/colours_for_base/colours_for_base.rb +18 -8
  14. data/lib/bioroebe/base/commandline_application/commandline_arguments.rb +13 -11
  15. data/lib/bioroebe/base/commandline_application/misc.rb +26 -9
  16. data/lib/bioroebe/base/commandline_application/opn.rb +8 -8
  17. data/lib/bioroebe/base/commandline_application/reset.rb +3 -2
  18. data/lib/bioroebe/base/misc.rb +35 -0
  19. data/lib/bioroebe/base/prototype/misc.rb +11 -1
  20. data/lib/bioroebe/codon_tables/frequencies/parse_frequency_table.rb +2 -10
  21. data/lib/bioroebe/codons/possible_codons_for_this_aminoacid.rb +1 -9
  22. data/lib/bioroebe/codons/show_codon_tables.rb +6 -2
  23. data/lib/bioroebe/codons/show_codon_usage.rb +2 -1
  24. data/lib/bioroebe/constants/aminoacids_and_proteins.rb +1 -0
  25. data/lib/bioroebe/constants/database_constants.rb +1 -1
  26. data/lib/bioroebe/constants/files_and_directories.rb +31 -4
  27. data/lib/bioroebe/constants/misc.rb +20 -0
  28. data/lib/bioroebe/count/count_amount_of_nucleotides.rb +3 -0
  29. data/lib/bioroebe/crystal/README.md +2 -0
  30. data/lib/bioroebe/crystal/to_rna.cr +19 -0
  31. data/lib/bioroebe/data/README.md +11 -8
  32. data/lib/bioroebe/data/electron_microscopy/pos_example.pos +396 -0
  33. data/lib/bioroebe/data/electron_microscopy/test_particles.star +36 -0
  34. data/lib/bioroebe/electron_microscopy/coordinate_analyzer.rb +15 -18
  35. data/lib/bioroebe/{fasta_and_fastq/parse_fasta/run.rb → electron_microscopy/electron_microscopy_module.rb} +16 -8
  36. data/lib/bioroebe/electron_microscopy/fix_pos_file.rb +1 -9
  37. data/lib/bioroebe/electron_microscopy/flipy.rb +83 -0
  38. data/lib/bioroebe/electron_microscopy/parse_coordinates.rb +2 -10
  39. data/lib/bioroebe/electron_microscopy/read_file_xmd.rb +1 -9
  40. data/lib/bioroebe/electron_microscopy/simple_star_file_generator.rb +4 -9
  41. data/lib/bioroebe/fasta_and_fastq/autocorrect_the_name_of_this_fasta_file.rb +1 -9
  42. data/lib/bioroebe/fasta_and_fastq/compact_fasta_file/compact_fasta_file.rb +7 -9
  43. data/lib/bioroebe/fasta_and_fastq/fasta_defline/fasta_defline.rb +1 -5
  44. data/lib/bioroebe/fasta_and_fastq/fasta_to_yaml/fasta_to_yaml.rb +81 -0
  45. data/lib/bioroebe/fasta_and_fastq/parse_fasta/parse_fasta.rb +1460 -7
  46. data/lib/bioroebe/fasta_and_fastq/return_fasta_subsection_of_this_file.rb +11 -2
  47. data/lib/bioroebe/fasta_and_fastq/show_fasta_headers.rb +27 -12
  48. data/lib/bioroebe/fasta_and_fastq/simplify_fasta_header/simplify_fasta_header.rb +1 -5
  49. data/lib/bioroebe/fasta_and_fastq/split_this_fasta_file_into_chromosomes/constants.rb +0 -5
  50. data/lib/bioroebe/genome/README.md +4 -0
  51. data/lib/bioroebe/genome/genome.rb +67 -0
  52. data/lib/bioroebe/genomes/genome_pattern.rb +3 -9
  53. data/lib/bioroebe/gui/gtk +1 -0
  54. data/lib/bioroebe/gui/gtk3/controller/controller.rb +45 -27
  55. data/lib/bioroebe/gui/gtk3/dna_to_aminoacid_widget/dna_to_aminoacid_widget.rb +76 -50
  56. data/lib/bioroebe/gui/gtk3/fasta_table_widget/fasta_table_widget.rb +99 -21
  57. data/lib/bioroebe/gui/gtk3/hamming_distance/hamming_distance.rb +42 -28
  58. data/lib/bioroebe/gui/gtk3/nucleotide_analyser/nucleotide_analyser.rb +119 -71
  59. data/lib/bioroebe/gui/gtk3/protein_to_DNA/protein_to_DNA.rb +18 -18
  60. data/lib/bioroebe/gui/gtk3/random_sequence/random_sequence.rb +19 -11
  61. data/lib/bioroebe/gui/libui/three_to_one/three_to_one.rb +8 -6
  62. data/lib/bioroebe/gui/shared_code/protein_to_DNA/protein_to_DNA_module.rb +14 -14
  63. data/lib/bioroebe/gui/swing/three_to_one/ThreeToOne$1.class +0 -0
  64. data/lib/bioroebe/gui/swing/three_to_one/ThreeToOne$CloseListener.class +0 -0
  65. data/lib/bioroebe/gui/swing/three_to_one/ThreeToOne.class +0 -0
  66. data/lib/bioroebe/gui/swing/three_to_one/ThreeToOne.java +141 -0
  67. data/lib/bioroebe/java/README.md +4 -0
  68. data/lib/bioroebe/java/bioroebe/Sequence.java +25 -1
  69. data/lib/bioroebe/java/bioroebe/src/main/java/bioroebe/Base.class +0 -0
  70. data/lib/bioroebe/java/bioroebe/{Base.java → src/main/java/bioroebe/Base.java} +15 -2
  71. data/lib/bioroebe/java/bioroebe/{BisulfiteTreatment.class → src/main/java/bioroebe/BisulfiteTreatment.class} +0 -0
  72. data/lib/bioroebe/java/bioroebe/{BisulfiteTreatment.java → src/main/java/bioroebe/BisulfiteTreatment.java} +0 -0
  73. data/lib/bioroebe/java/bioroebe/{Codons.class → src/main/java/bioroebe/Codons.class} +0 -0
  74. data/lib/bioroebe/java/bioroebe/src/main/java/bioroebe/Codons.java +34 -0
  75. data/lib/bioroebe/java/bioroebe/src/main/java/bioroebe/Commandline.class +0 -0
  76. data/lib/bioroebe/java/bioroebe/src/main/java/bioroebe/Commandline.java +95 -0
  77. data/lib/bioroebe/java/bioroebe/{Esystem.class → src/main/java/bioroebe/Esystem.class} +0 -0
  78. data/lib/bioroebe/java/bioroebe/{Esystem.java → src/main/java/bioroebe/Esystem.java} +0 -0
  79. data/lib/bioroebe/java/bioroebe/{GenerateRandomDnaSequence.class → src/main/java/bioroebe/GenerateRandomDnaSequence.class} +0 -0
  80. data/lib/bioroebe/java/bioroebe/{GenerateRandomDnaSequence.java → src/main/java/bioroebe/GenerateRandomDnaSequence.java} +8 -2
  81. data/lib/bioroebe/java/bioroebe/{IsPalindrome.class → src/main/java/bioroebe/IsPalindrome.class} +0 -0
  82. data/lib/bioroebe/java/bioroebe/{IsPalindrome.java → src/main/java/bioroebe/IsPalindrome.java} +5 -1
  83. data/lib/bioroebe/java/bioroebe/src/main/java/bioroebe/PartnerNucleotide.class +0 -0
  84. data/lib/bioroebe/java/bioroebe/src/main/java/bioroebe/PartnerNucleotide.java +56 -0
  85. data/lib/bioroebe/java/bioroebe/{RemoveFile.class → src/main/java/bioroebe/RemoveFile.class} +0 -0
  86. data/lib/bioroebe/java/bioroebe/{RemoveFile.java → src/main/java/bioroebe/RemoveFile.java} +10 -4
  87. data/lib/bioroebe/java/bioroebe/{RemoveNumbers.class → src/main/java/bioroebe/RemoveNumbers.class} +0 -0
  88. data/lib/bioroebe/java/bioroebe/{RemoveNumbers.java → src/main/java/bioroebe/RemoveNumbers.java} +1 -0
  89. data/lib/bioroebe/java/bioroebe/{ToCamelcase.class → src/main/java/bioroebe/ToCamelcase.class} +0 -0
  90. data/lib/bioroebe/java/bioroebe/{ToCamelcase.java → src/main/java/bioroebe/ToCamelcase.java} +3 -3
  91. data/lib/bioroebe/java/bioroebe/src/main/java/bioroebe/ToRNA.class +0 -0
  92. data/lib/bioroebe/java/bioroebe/src/main/java/bioroebe/ToRNA.java +42 -0
  93. data/lib/bioroebe/java/bioroebe/toplevel_methods/BaseComposition.class +0 -0
  94. data/lib/bioroebe/java/bioroebe/toplevel_methods/BaseComposition.java +73 -0
  95. data/lib/bioroebe/misc/ruler.rb +1 -0
  96. data/lib/bioroebe/nucleotides/most_likely_nucleotide_sequence_for_this_aminoacid_sequence.rb +1 -9
  97. data/lib/bioroebe/nucleotides/show_nucleotide_sequence.rb +7 -7
  98. data/lib/bioroebe/parsers/genbank_parser.rb +347 -26
  99. data/lib/bioroebe/parsers/gff.rb +1 -9
  100. data/lib/bioroebe/patterns/scan_for_repeat.rb +1 -5
  101. data/lib/bioroebe/pdb/fetch_fasta_sequence_from_pdb.rb +1 -9
  102. data/lib/bioroebe/pdb/parse_mmCIF_file.rb +1 -9
  103. data/lib/bioroebe/pdb/parse_pdb_file.rb +1 -9
  104. data/lib/bioroebe/project/project.rb +1 -1
  105. data/lib/bioroebe/python/README.md +1 -0
  106. data/lib/bioroebe/python/__pycache__/mymodule.cpython-39.pyc +0 -0
  107. data/lib/bioroebe/python/gui/gtk3/all_in_one.css +4 -0
  108. data/lib/bioroebe/python/gui/gtk3/all_in_one.py +59 -0
  109. data/lib/bioroebe/python/gui/gtk3/widget1.py +20 -0
  110. data/lib/bioroebe/python/gui/tkinter/all_in_one.py +91 -0
  111. data/lib/bioroebe/python/mymodule.py +8 -0
  112. data/lib/bioroebe/python/protein_to_dna.py +33 -0
  113. data/lib/bioroebe/python/shell/shell.py +19 -0
  114. data/lib/bioroebe/python/to_rna.py +14 -0
  115. data/lib/bioroebe/python/toplevel_methods/esystem.py +12 -0
  116. data/lib/bioroebe/python/toplevel_methods/open_in_browser.py +20 -0
  117. data/lib/bioroebe/python/toplevel_methods/palindromes.py +42 -0
  118. data/lib/bioroebe/python/toplevel_methods/rds.py +13 -0
  119. data/lib/bioroebe/python/toplevel_methods/shuffleseq.py +23 -0
  120. data/lib/bioroebe/python/toplevel_methods/three_delimiter.py +37 -0
  121. data/lib/bioroebe/python/toplevel_methods/time_and_date.py +43 -0
  122. data/lib/bioroebe/python/toplevel_methods/to_camelcase.py +21 -0
  123. data/lib/bioroebe/requires/require_the_bioroebe_project.rb +3 -1
  124. data/lib/bioroebe/sequence/nucleotide_module/nucleotide_module.rb +28 -25
  125. data/lib/bioroebe/sequence/protein.rb +105 -3
  126. data/lib/bioroebe/sequence/sequence.rb +61 -2
  127. data/lib/bioroebe/shell/menu.rb +3819 -3713
  128. data/lib/bioroebe/shell/misc.rb +51 -4311
  129. data/lib/bioroebe/shell/readline/readline.rb +1 -1
  130. data/lib/bioroebe/shell/shell.rb +11250 -28
  131. data/lib/bioroebe/siRNA/siRNA.rb +81 -1
  132. data/lib/bioroebe/string_matching/find_longest_substring.rb +3 -2
  133. data/lib/bioroebe/string_matching/hamming_distance.rb +1 -9
  134. data/lib/bioroebe/taxonomy/class_methods.rb +3 -8
  135. data/lib/bioroebe/taxonomy/constants.rb +4 -3
  136. data/lib/bioroebe/taxonomy/edit.rb +2 -1
  137. data/lib/bioroebe/taxonomy/help/help.rb +10 -10
  138. data/lib/bioroebe/taxonomy/info/check_available.rb +15 -9
  139. data/lib/bioroebe/taxonomy/info/info.rb +18 -11
  140. data/lib/bioroebe/taxonomy/info/is_dna.rb +46 -36
  141. data/lib/bioroebe/taxonomy/interactive.rb +140 -104
  142. data/lib/bioroebe/taxonomy/menu.rb +27 -18
  143. data/lib/bioroebe/taxonomy/parse_fasta.rb +3 -1
  144. data/lib/bioroebe/taxonomy/shared.rb +1 -0
  145. data/lib/bioroebe/taxonomy/taxonomy.rb +1 -0
  146. data/lib/bioroebe/toplevel_methods/aminoacids_and_proteins.rb +31 -24
  147. data/lib/bioroebe/toplevel_methods/colourize_related_methods.rb +164 -0
  148. data/lib/bioroebe/toplevel_methods/databases.rb +1 -1
  149. data/lib/bioroebe/toplevel_methods/fasta_and_fastq.rb +107 -63
  150. data/lib/bioroebe/toplevel_methods/file_and_directory_related_actions.rb +14 -2
  151. data/lib/bioroebe/toplevel_methods/misc.rb +118 -11
  152. data/lib/bioroebe/toplevel_methods/nucleotides.rb +22 -5
  153. data/lib/bioroebe/toplevel_methods/open_in_browser.rb +2 -0
  154. data/lib/bioroebe/toplevel_methods/palindromes.rb +1 -2
  155. data/lib/bioroebe/toplevel_methods/taxonomy.rb +2 -2
  156. data/lib/bioroebe/toplevel_methods/to_camelcase.rb +5 -0
  157. data/lib/bioroebe/utility_scripts/align_open_reading_frames.rb +1 -9
  158. data/lib/bioroebe/utility_scripts/check_for_mismatches/check_for_mismatches.rb +1 -9
  159. data/lib/bioroebe/utility_scripts/compacter.rb +1 -9
  160. data/lib/bioroebe/utility_scripts/compseq/compseq.rb +1 -9
  161. data/lib/bioroebe/utility_scripts/create_batch_entrez_file.rb +1 -9
  162. data/lib/bioroebe/utility_scripts/dot_alignment.rb +1 -9
  163. data/lib/bioroebe/utility_scripts/move_file_to_its_correct_location.rb +1 -4
  164. data/lib/bioroebe/utility_scripts/showorf/constants.rb +0 -5
  165. data/lib/bioroebe/utility_scripts/showorf/reset.rb +1 -4
  166. data/lib/bioroebe/version/version.rb +2 -2
  167. data/lib/bioroebe/www/embeddable_interface.rb +101 -52
  168. data/lib/bioroebe/www/sinatra/sinatra.rb +186 -70
  169. data/lib/bioroebe/yaml/aminoacids/amino_acids_long_name_to_one_letter.yml +2 -2
  170. data/lib/bioroebe/yaml/configuration/browser.yml +1 -1
  171. data/lib/bioroebe/yaml/genomes/README.md +3 -4
  172. data/lib/bioroebe/yaml/restriction_enzymes/restriction_enzymes.yml +3 -3
  173. metadata +69 -64
  174. data/doc/setup.rb +0 -1655
  175. data/lib/bioroebe/fasta_and_fastq/parse_fasta/constants.rb +0 -50
  176. data/lib/bioroebe/fasta_and_fastq/parse_fasta/initialize.rb +0 -86
  177. data/lib/bioroebe/fasta_and_fastq/parse_fasta/menu.rb +0 -117
  178. data/lib/bioroebe/fasta_and_fastq/parse_fasta/misc.rb +0 -981
  179. data/lib/bioroebe/fasta_and_fastq/parse_fasta/report.rb +0 -156
  180. data/lib/bioroebe/fasta_and_fastq/parse_fasta/reset.rb +0 -128
  181. data/lib/bioroebe/genbank/genbank_parser.rb +0 -291
  182. data/lib/bioroebe/java/bioroebe/Base.class +0 -0
  183. data/lib/bioroebe/java/bioroebe/Codons.java +0 -22
  184. data/lib/bioroebe/java/bioroebe/PartnerNucleotide.class +0 -0
  185. data/lib/bioroebe/java/bioroebe/PartnerNucleotide.java +0 -19
  186. data/lib/bioroebe/java/bioroebe.jar +0 -0
  187. data/lib/bioroebe/shell/add.rb +0 -108
  188. data/lib/bioroebe/shell/assign.rb +0 -360
  189. data/lib/bioroebe/shell/chop_and_cut.rb +0 -281
  190. data/lib/bioroebe/shell/constants.rb +0 -166
  191. data/lib/bioroebe/shell/download.rb +0 -335
  192. data/lib/bioroebe/shell/enable_and_disable.rb +0 -158
  193. data/lib/bioroebe/shell/enzymes.rb +0 -310
  194. data/lib/bioroebe/shell/fasta.rb +0 -345
  195. data/lib/bioroebe/shell/gtk.rb +0 -76
  196. data/lib/bioroebe/shell/history.rb +0 -132
  197. data/lib/bioroebe/shell/initialize.rb +0 -217
  198. data/lib/bioroebe/shell/loop.rb +0 -74
  199. data/lib/bioroebe/shell/prompt.rb +0 -107
  200. data/lib/bioroebe/shell/random.rb +0 -289
  201. data/lib/bioroebe/shell/reset.rb +0 -335
  202. data/lib/bioroebe/shell/scan_and_parse.rb +0 -135
  203. data/lib/bioroebe/shell/search.rb +0 -337
  204. data/lib/bioroebe/shell/sequences.rb +0 -200
  205. data/lib/bioroebe/shell/show_report_and_display.rb +0 -2901
  206. data/lib/bioroebe/shell/startup.rb +0 -127
  207. data/lib/bioroebe/shell/taxonomy.rb +0 -14
  208. data/lib/bioroebe/shell/tk.rb +0 -23
  209. data/lib/bioroebe/shell/user_input.rb +0 -88
  210. data/lib/bioroebe/shell/xorg.rb +0 -45
@@ -52,13 +52,11 @@ class Interactive < ::Bioroebe::CommandlineApplication # === Bioroebe::Taxonomy:
52
52
  Roebe::SqlParadise::Commands.set_temp_dir ::Bioroebe.log_dir?
53
53
  rescue LoadError; end
54
54
 
55
- # ========================================================================= #
56
- # === NAMESPACE
57
- # ========================================================================= #
58
- NAMESPACE = inspect
59
-
60
55
  # ========================================================================= #
61
56
  # === FASTA_SQL
57
+ #
58
+ # This constant will point towards a location such as
59
+ # "/home/Temp/bioroebe/autogenerated_sql_files/fasta.sql".
62
60
  # ========================================================================= #
63
61
  FASTA_SQL = AUTOGENERATED_SQL_FILES_DIR+'fasta.sql'
64
62
 
@@ -102,10 +100,7 @@ class Interactive < ::Bioroebe::CommandlineApplication # === Bioroebe::Taxonomy:
102
100
  # ========================================================================= #
103
101
  def reset
104
102
  super()
105
- # ======================================================================= #
106
- # === @namespace
107
- # ======================================================================= #
108
- @namespace = NAMESPACE
103
+ infer_the_namespace
109
104
  # ======================================================================= #
110
105
  # === @be_verbose
111
106
  # ======================================================================= #
@@ -124,6 +119,69 @@ class Interactive < ::Bioroebe::CommandlineApplication # === Bioroebe::Taxonomy:
124
119
  @run_standalone = true
125
120
  end
126
121
 
122
+ # ========================================================================= #
123
+ # === create_fasta_table
124
+ #
125
+ # This method generates the fasta table into either postgresql or
126
+ # whatever else you stored things into.
127
+ # ========================================================================= #
128
+ def create_fasta_table
129
+ remove(FASTA_SQL)
130
+ # e 'Now storing into fasta.sql (Fasta-Format).'
131
+ create_and_save_table(:default_fasta, true) # true for verbose
132
+ cat FASTA_SQL # Also display it, after creation.
133
+ # Next, drop the old Fasta table. But we must set the password before.
134
+ e 'Trying to drop the fasta table next.'
135
+ drop_table :fasta
136
+ # And now, read in the new one.
137
+ read_sql :fasta
138
+ end
139
+
140
+ # ========================================================================= #
141
+ # === create_and_save_table
142
+ # ========================================================================= #
143
+ def create_and_save_table(
144
+ i, be_verbose = false
145
+ )
146
+ case i
147
+ # ======================================================================= #
148
+ # === :default_fasta
149
+ # ======================================================================= #
150
+ when :default_fasta
151
+ i = FASTA_SQL
152
+ end
153
+ require 'roebe/sql_paradise/commands.rb'
154
+ Roebe::SqlParadise::Commands.create_and_save_table(i, be_verbose)
155
+ end
156
+
157
+ # ========================================================================= #
158
+ # === update_local_localomes
159
+ #
160
+ # Update the local collection. This will overwrite the old dataset
161
+ # completely, so be careful when using this.
162
+ #
163
+ # To invoke this method via the interactive menu, do:
164
+ #
165
+ # update databases
166
+ #
167
+ # ========================================================================= #
168
+ def update_local_localomes
169
+ show_current_time
170
+ create_fasta_table # Get in a new, fresh table.
171
+ _ = get_all_info_entries_with_tax_id
172
+ show_current_time
173
+ _.each {|entry|
174
+ e "Next working on `#{sfile(entry)}`."
175
+ create_sql_file_from_local_fasta_entry(entry)
176
+ }
177
+ report_how_many_info_files_exist_and_how_many_lack_taxonomy_id
178
+ old_time = @time
179
+ show_time_now # Show the end time.
180
+ new_time = @time
181
+ difference = Time.parse(new_time) - Time.parse(old_time)
182
+ report_how_long_it_took_us(difference, 'localome table')
183
+ end
184
+
127
185
  # ========================================================================= #
128
186
  # === get (get tag)
129
187
  #
@@ -204,34 +262,13 @@ class Interactive < ::Bioroebe::CommandlineApplication # === Bioroebe::Taxonomy:
204
262
  end
205
263
  end
206
264
 
207
- # ========================================================================= #
208
- # === update_local_localomes
209
- #
210
- # Update the local collection. This will overwrite the old dataset
211
- # completely, so be careful when using this.
212
- # ========================================================================= #
213
- def update_local_localomes
214
- show_current_time
215
- create_fasta_table # Get in a new, fresh table.
216
- _ = get_all_info_entries_with_tax_id
217
- show_current_time
218
- _.each {|entry|
219
- e 'Next working on '+sfile(entry)
220
- create_sql_file_from_local_fasta_entry(entry)
221
- }
222
- report_how_many_info_files_exist_and_how_many_lack_taxonomy_id
223
- old_time = @time
224
- show_time_now # Show the end time.
225
- new_time = @time
226
- difference = Time.parse(new_time) - Time.parse(old_time)
227
- report_how_long_it_took_us(difference, 'localome table')
228
- end
229
-
230
265
  # ========================================================================= #
231
266
  # === try_to_display_the_status
232
267
  # ========================================================================= #
233
- def try_to_display_the_status(i = nil)
234
- if i # if an argument was provided
268
+ def try_to_display_the_status(
269
+ i = nil
270
+ )
271
+ if i and !i.empty? # if an argument was provided
235
272
  StatFile.new(i) if Object.const_defined?(:StatFile)
236
273
  else
237
274
  Taxonomy.status?
@@ -333,6 +370,42 @@ class Interactive < ::Bioroebe::CommandlineApplication # === Bioroebe::Taxonomy:
333
370
  end
334
371
  end
335
372
 
373
+ # ========================================================================= #
374
+ # === download
375
+ #
376
+ # This method can be used to download the ncbi database.
377
+ # ========================================================================= #
378
+ def download(i = f?)
379
+ i = i.to_s
380
+ case i # case tag
381
+ # ======================================================================= #
382
+ # === --help
383
+ # ======================================================================= #
384
+ when 'HELP','?','--help'
385
+ e 'Currently we can download only the NCBI database.'
386
+ e
387
+ e 'To do so, do:'
388
+ e ' download ncbi'
389
+ # ======================================================================= #
390
+ # === download --ncbi
391
+ # ======================================================================= #
392
+ when /^-?-?ncbi/i,
393
+ 'database','1','' # '' is also a default here.
394
+ download_ncbi_database
395
+ if be_verbose?
396
+ e
397
+ e 'If all went well then you could now try to update the '+
398
+ 'database, by issuing:'
399
+ e
400
+ efancy ' update databases'
401
+ e
402
+ end
403
+ else
404
+ e 'In the method download(), we do not know the given '+
405
+ 'input `'+simp(i.to_s)+'`.'
406
+ end
407
+ end
408
+
336
409
  # ========================================================================= #
337
410
  # === report_lineage_ids_and_lineage_scientific_name
338
411
  # ========================================================================= #
@@ -378,24 +451,34 @@ class Interactive < ::Bioroebe::CommandlineApplication # === Bioroebe::Taxonomy:
378
451
  # the localomes entry.
379
452
  # ========================================================================= #
380
453
  def lupdate(i = :ncbi)
381
- i = i.to_s
454
+ i = i.to_s # Use a String past this point.
382
455
  case i
383
- when 'all','everything','both'
384
- update_ncbi_database
385
- update_local_localomes
386
- update_lineage
456
+ # ======================================================================= #
457
+ # === localomes
458
+ # ======================================================================= #
459
+ when 'localomes',
460
+ 'local','loc','localome','2',
461
+ 'fasta',
462
+ 'database',
463
+ 'databases'
464
+ update_local_localomes # This will overwrite the old dataset completely, be careful.
387
465
  # ======================================================================= #
388
466
  # === ncbi_database
389
467
  # ======================================================================= #
390
- when /^ncbi(-|_| )?database$/, 'ncbi','1',
468
+ when /^ncbi(-|_| )?database$/,
469
+ 'ncbi',
470
+ '1',
391
471
  'update_ncbi'
392
472
  update_ncbi_database
393
473
  # ======================================================================= #
394
- # === localomes
474
+ # === lupdate all
395
475
  # ======================================================================= #
396
- when 'localomes','local','loc','localome','2',
397
- 'fasta','database','databases'
398
- update_local_localomes # This will overwrite the old dataset completely, be careful.
476
+ when 'all',
477
+ 'everything',
478
+ 'both'
479
+ update_ncbi_database
480
+ update_local_localomes
481
+ update_lineage
399
482
  # ======================================================================= #
400
483
  # === lineage
401
484
  # ======================================================================= #
@@ -478,8 +561,9 @@ class Interactive < ::Bioroebe::CommandlineApplication # === Bioroebe::Taxonomy:
478
561
  # ========================================================================= #
479
562
  # === update_ncbi_database
480
563
  #
481
- # We will update the NCBI Taxonomy database with this method. This
482
- # includes a download, extracting it, generating the .sql files,
564
+ # This method can be used to update the NCBI Taxonomy database.
565
+ #
566
+ # This includes a download, extracting it, generating the .sql files,
483
567
  # and then populating the postgresql database.
484
568
  # ========================================================================= #
485
569
  def update_ncbi_database
@@ -673,7 +757,9 @@ class Interactive < ::Bioroebe::CommandlineApplication # === Bioroebe::Taxonomy:
673
757
  def show_login_information
674
758
  e 'The login information is stored in the file '
675
759
  e
676
- e ' '+sfile(PROJECT_BASE_DIR2+'databases/postgresql_login_command.rb')
760
+ e ' '+sfile(
761
+ Bioroebe::Taxonomy.project_base_dir?+'databases/postgresql_login_command.rb'
762
+ )
677
763
  e
678
764
  show_port # Show the port as well here.
679
765
  end
@@ -682,7 +768,7 @@ class Interactive < ::Bioroebe::CommandlineApplication # === Bioroebe::Taxonomy:
682
768
  # === return_shared_code
683
769
  # ========================================================================= #
684
770
  def return_shared_code
685
- return PROJECT_BASE_DIR2+'shared/shared'
771
+ return Bioroebe::Taxonomy.project_base_dir?+'shared/shared'
686
772
  end
687
773
 
688
774
  # ========================================================================= #
@@ -698,7 +784,7 @@ class Interactive < ::Bioroebe::CommandlineApplication # === Bioroebe::Taxonomy:
698
784
  # === return_login_file
699
785
  # ========================================================================= #
700
786
  def return_login_file
701
- return PROJECT_BASE_DIR2+'postgresql_login_command.rb'
787
+ return Bioroebe::Taxonomy.project_base_dir?+'postgresql_login_command.rb'
702
788
  end
703
789
 
704
790
  # ========================================================================= #
@@ -974,18 +1060,21 @@ class Interactive < ::Bioroebe::CommandlineApplication # === Bioroebe::Taxonomy:
974
1060
  return result
975
1061
  end; alias get_lineage_ids_and_lineage_scientific_name obtain_full_lineage_for
976
1062
 
1063
+ require 'bioroebe/constants/database_constants.rb'
977
1064
  # ========================================================================= #
978
1065
  # === drop_table (drop tag)
979
1066
  #
980
1067
  # Use this method when you wish to drop a table.
981
1068
  # ========================================================================= #
982
- def drop_table(i = DROP_FASTA_TABLE)
1069
+ def drop_table(
1070
+ i = Bioroebe::Postgresql::DROP_FASTA_TABLE
1071
+ )
983
1072
  case i.to_s
984
1073
  when 'nodes'
985
1074
  when 'fasta',
986
1075
  'localomes',
987
1076
  'localome'
988
- i = DROP_FASTA_TABLE
1077
+ i = Bioroebe::Postgresql::DROP_FASTA_TABLE
989
1078
  end
990
1079
  ::Bioroebe.run_sql_query(i)
991
1080
  end
@@ -1645,24 +1734,6 @@ class Interactive < ::Bioroebe::CommandlineApplication # === Bioroebe::Taxonomy:
1645
1734
  end
1646
1735
  end
1647
1736
 
1648
- # ========================================================================= #
1649
- # === create_fasta_table
1650
- #
1651
- # This method generates the fasta table into either postgresql or
1652
- # whatever else you stored things into.
1653
- # ========================================================================= #
1654
- def create_fasta_table
1655
- remove(FASTA_SQL)
1656
- # e 'Now storing into fasta.sql (Fasta-Format).'
1657
- create_and_save_table('fasta', true) # true for verbose
1658
- cat FASTA_SQL # Also display it, after creation.
1659
- # Next, drop the old Fasta table. But we must set the password before.
1660
- e 'Trying to drop the fasta table next.'
1661
- drop_table :fasta
1662
- # And now, read in the new one.
1663
- read_sql :fasta
1664
- end
1665
-
1666
1737
  # ========================================================================= #
1667
1738
  # === set_commandline_arguments
1668
1739
  # ========================================================================= #
@@ -1846,41 +1917,6 @@ class Interactive < ::Bioroebe::CommandlineApplication # === Bioroebe::Taxonomy:
1846
1917
  end
1847
1918
  end
1848
1919
 
1849
- # ========================================================================= #
1850
- # === download
1851
- #
1852
- # This method can be used to download the ncbi database.
1853
- # ========================================================================= #
1854
- def download(i = f?)
1855
- i = i.to_s
1856
- case i # case tag
1857
- # ======================================================================= #
1858
- # === --help
1859
- # ======================================================================= #
1860
- when 'HELP','?','--help'
1861
- e 'Currently we can download only the NCBI database.'
1862
- e
1863
- e 'To do so, do:'
1864
- e ' download ncbi'
1865
- # ======================================================================= #
1866
- # === --ncbi
1867
- # ======================================================================= #
1868
- when 'ncbi','--ncbi','database','1','' # '' is also a default here.
1869
- download_ncbi_database
1870
- if be_verbose?
1871
- e
1872
- e 'If all went well then you could now try to update the '+
1873
- 'database, by issuing:'
1874
- e
1875
- efancy ' update databases'
1876
- e
1877
- end
1878
- else
1879
- e 'In the method download(), we do not know the given '+
1880
- 'input `'+simp(i.to_s)+'`.'
1881
- end
1882
- end
1883
-
1884
1920
  # ========================================================================= #
1885
1921
  # === download_ncbi_database
1886
1922
  # ========================================================================= #
@@ -44,6 +44,28 @@ class Interactive < ::Bioroebe::CommandlineApplication
44
44
  record_last_command(i, first_argument?) # Record the last command.
45
45
  case i # (case tag)
46
46
  # ======================================================================= #
47
+ # === update
48
+ # ======================================================================= #
49
+ when 'update',
50
+ 'lupdate',
51
+ 'upd'
52
+ lupdate(f)
53
+ # ======================================================================= #
54
+ # === download
55
+ # ======================================================================= #
56
+ when 'download'
57
+ download(f)
58
+ # ======================================================================= #
59
+ # === status?
60
+ # ======================================================================= #
61
+ when 'status?',
62
+ 'status',
63
+ 'stat',
64
+ 'stats',
65
+ 'data?',
66
+ 'try_to_display_the_status'
67
+ try_to_display_the_status(f)
68
+ # ======================================================================= #
47
69
  # === disable_colours
48
70
  # ======================================================================= #
49
71
  when 'disable_colours',
@@ -65,11 +87,6 @@ class Interactive < ::Bioroebe::CommandlineApplication
65
87
  when /^download(_|-)?database$/i,'ncbi_down'
66
88
  download_ncbi_database
67
89
  # ======================================================================= #
68
- # === download
69
- # ======================================================================= #
70
- when 'download'
71
- download(f)
72
- # ======================================================================= #
73
90
  # === exit
74
91
  # ======================================================================= #
75
92
  when *VALID_WAYS_TO_EXIT
@@ -448,11 +465,6 @@ class Interactive < ::Bioroebe::CommandlineApplication
448
465
  # ======================================================================= #
449
466
  # ===
450
467
  # ======================================================================= #
451
- when 'update','lupdate','upd'
452
- lupdate(f)
453
- # ======================================================================= #
454
- # ===
455
- # ======================================================================= #
456
468
  when 'be'
457
469
  be(f)
458
470
  # ======================================================================= #
@@ -589,12 +601,6 @@ class Interactive < ::Bioroebe::CommandlineApplication
589
601
  # ======================================================================= #
590
602
  # ===
591
603
  # ======================================================================= #
592
- when 'status?','status','stat','stats','data?',
593
- 'try_to_display_the_status'
594
- try_to_display_the_status(f)
595
- # ======================================================================= #
596
- # ===
597
- # ======================================================================= #
598
604
  when 'remove','remove_taxid_from_localome_table',
599
605
  'remove_id'
600
606
  remove_taxid_from_localome_table(f)
@@ -647,7 +653,9 @@ class Interactive < ::Bioroebe::CommandlineApplication
647
653
  # ======================================================================= #
648
654
  when 'lafo','loadup_localomes','loaduplocalomes','goloc',
649
655
  'localomes_go','localomesgo','golocal','goloco',
650
- 'localgo','update_local_localomes','update2',
656
+ 'localgo',
657
+ 'update_local_localomes',
658
+ 'update2',
651
659
  'default'
652
660
  update_local_localomes
653
661
  # ======================================================================= #
@@ -796,7 +804,8 @@ class Interactive < ::Bioroebe::CommandlineApplication
796
804
  # === update_database
797
805
  # ======================================================================= #
798
806
  when 'update_database','ud','updatedatabases','update_databases',
799
- 'update_ncbi_database','updatencbidatabase','update_ncbi',
807
+ 'update_ncbi_database',
808
+ 'updatencbidatabase','update_ncbi',
800
809
  'main' # This is the main action (main tag).
801
810
  update_ncbi_database
802
811
  # ======================================================================= #
@@ -111,7 +111,9 @@ class ParseFasta < ::Bioroebe::CommandlineApplication # === Bioroebe::Taxonomy::
111
111
  # ========================================================================= #
112
112
  # === try_to_locate_info_file
113
113
  # ========================================================================= #
114
- def try_to_locate_info_file(i = @location)
114
+ def try_to_locate_info_file(
115
+ i = @location
116
+ )
115
117
  i = File.basename(i)
116
118
  # chop away the extname.
117
119
  i.gsub!(/#{File.extname(i)}/, '')
@@ -16,6 +16,7 @@
16
16
  # include this module here.
17
17
  # =========================================================================== #
18
18
  # require 'bioroebe/taxonomy/shared/shared.rb'
19
+ # =========================================================================== #
19
20
  require 'bioroebe/base/commandline_application/commandline_application.rb'
20
21
 
21
22
  module Bioroebe # === Bioroebe::Taxonomy::Shared
@@ -16,6 +16,7 @@ module Taxonomy
16
16
  require 'bioroebe/taxonomy/class_methods.rb'
17
17
  require 'bioroebe/taxonomy/chart.rb'
18
18
  require 'bioroebe/taxonomy/node.rb'
19
+ require 'bioroebe/constants/misc.rb'
19
20
 
20
21
  require 'bioroebe/toplevel_methods/databases.rb'
21
22
  require 'bioroebe/toplevel_methods/file_and_directory_related_actions.rb'
@@ -129,29 +129,6 @@ module Bioroebe
129
129
  return _
130
130
  end
131
131
 
132
- # ========================================================================= #
133
- # === Bioroebe.remove_invalid_aminoacids
134
- #
135
- # This method will filter away invalid aminoacids such as "U".
136
- # "U" is not a valid aminoacid.
137
- #
138
- # Usage example:
139
- #
140
- # Bioroebe.remove_invalid_aminoacids('LKLSUSURZZZ')
141
- #
142
- # ========================================================================= #
143
- def self.remove_invalid_aminoacids(from_this_string)
144
- if from_this_string.is_a? Array
145
- from_this_string = from_this_string.first
146
- end
147
- all_valid_aminoacids = YAML.load_file(Bioroebe.file_amino_acids).keys
148
- new_result = ''.dup
149
- from_this_string.chars.each {|entry|
150
- new_result << entry if all_valid_aminoacids.include?(entry)
151
- }
152
- return new_result
153
- end
154
-
155
132
  # ========================================================================= #
156
133
  # === Bioroebe.colourize_aa
157
134
  #
@@ -664,6 +641,36 @@ module Bioroebe
664
641
  end
665
642
  end
666
643
 
644
+ # ========================================================================= #
645
+ # === Bioroebe.remove_invalid_aminoacids
646
+ #
647
+ # This method will filter away invalid aminoacids such as "U".
648
+ # "U" is not a valid aminoacid. It requires the data stored
649
+ # in the yaml file at:
650
+ #
651
+ # "/home/Programs/Ruby/3.1.2/lib/ruby/site_ruby/3.1.0/bioroebe/yaml/aminoacids/amino_acids.yml"
652
+ #
653
+ # Note that U is a valid aminoacid - it is selenocysteine.
654
+ #
655
+ # Usage example:
656
+ #
657
+ # Bioroebe.remove_invalid_aminoacids('LKLSUSURZZZ')
658
+ #
659
+ # ========================================================================= #
660
+ def self.remove_invalid_aminoacids(
661
+ from_this_string
662
+ )
663
+ if from_this_string.is_a? Array
664
+ from_this_string = from_this_string.first
665
+ end
666
+ all_valid_aminoacids = YAML.load_file(Bioroebe.file_amino_acids).keys
667
+ new_result = ''.dup
668
+ from_this_string.chars.each {|entry|
669
+ new_result << entry if all_valid_aminoacids.include?(entry)
670
+ }
671
+ return new_result
672
+ end
673
+
667
674
  end
668
675
 
669
676
  if __FILE__ == $PROGRAM_NAME
@@ -682,7 +689,7 @@ if __FILE__ == $PROGRAM_NAME
682
689
  input = ARGV.join(' ').strip
683
690
  end
684
691
 
685
- puts 'From '+input+' to: '+Bioroebe.three_to_one(input) # => "TRH"
692
+ e 'From '+input+' to: '+Bioroebe.three_to_one(input) # => "TRH"
686
693
  # And more tests:
687
694
  # p Bioroebe.is_aminoacid? 'Tryptophan' # => true
688
695
  # p Bioroebe.is_aminoacid? 'Glycine' # => true