bioroebe 0.10.80 → 0.12.24

Sign up to get free protection for your applications and to get access to all the features.
Files changed (301) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3946 -2817
  3. data/bin/bioroebe +13 -2
  4. data/bin/bioroebe_hash +7 -0
  5. data/bin/codon_to_aminoacid +6 -4
  6. data/bin/compacter +7 -0
  7. data/bin/plain_palindrome +7 -0
  8. data/bioroebe.gemspec +3 -3
  9. data/doc/README.gen +3918 -2793
  10. data/doc/quality_control/commandline_applications.md +3 -3
  11. data/doc/statistics/statistics.md +7 -7
  12. data/doc/todo/bioroebe_GUI_todo.md +19 -14
  13. data/doc/todo/bioroebe_java_todo.md +22 -0
  14. data/doc/todo/bioroebe_todo.md +2075 -2620
  15. data/lib/bioroebe/C++/DNA.cpp +69 -0
  16. data/lib/bioroebe/C++/RNA.cpp +58 -0
  17. data/lib/bioroebe/C++/sequence.cpp +35 -0
  18. data/lib/bioroebe/abstract/README.md +1 -0
  19. data/lib/bioroebe/abstract/features.rb +29 -0
  20. data/lib/bioroebe/aminoacids/aminoacid_substitution.rb +1 -9
  21. data/lib/bioroebe/aminoacids/codon_percentage.rb +1 -9
  22. data/lib/bioroebe/aminoacids/deduce_aminoacid_sequence.rb +1 -9
  23. data/lib/bioroebe/aminoacids/display_aminoacid_table.rb +1 -0
  24. data/lib/bioroebe/aminoacids/show_hydrophobicity.rb +1 -6
  25. data/lib/bioroebe/base/base_module/base_module.rb +36 -0
  26. data/lib/bioroebe/base/colours_for_base/colours_for_base.rb +18 -8
  27. data/lib/bioroebe/base/commandline_application/commandline_application.rb +13 -9
  28. data/lib/bioroebe/base/commandline_application/commandline_arguments.rb +24 -19
  29. data/lib/bioroebe/base/commandline_application/misc.rb +66 -49
  30. data/lib/bioroebe/base/commandline_application/opn.rb +8 -8
  31. data/lib/bioroebe/base/commandline_application/reset.rb +5 -3
  32. data/lib/bioroebe/base/internal_hash_module/internal_hash_module.rb +42 -0
  33. data/lib/bioroebe/base/misc.rb +35 -0
  34. data/lib/bioroebe/base/prototype/misc.rb +15 -9
  35. data/lib/bioroebe/base/prototype/reset.rb +10 -0
  36. data/lib/bioroebe/cleave_and_digest/digestion.rb +10 -2
  37. data/lib/bioroebe/cleave_and_digest/trypsin.rb +104 -50
  38. data/lib/bioroebe/codon_tables/frequencies/parse_frequency_table.rb +2 -10
  39. data/lib/bioroebe/codons/codons.rb +1 -1
  40. data/lib/bioroebe/codons/convert_this_codon_to_that_aminoacid.rb +208 -59
  41. data/lib/bioroebe/codons/possible_codons_for_this_aminoacid.rb +1 -9
  42. data/lib/bioroebe/codons/show_codon_tables.rb +8 -3
  43. data/lib/bioroebe/codons/show_codon_usage.rb +15 -4
  44. data/lib/bioroebe/colours/rev.rb +4 -1
  45. data/lib/bioroebe/constants/aminoacids_and_proteins.rb +1 -0
  46. data/lib/bioroebe/constants/database_constants.rb +1 -1
  47. data/lib/bioroebe/constants/files_and_directories.rb +31 -4
  48. data/lib/bioroebe/constants/misc.rb +20 -0
  49. data/lib/bioroebe/constants/nucleotides.rb +7 -0
  50. data/lib/bioroebe/conversions/dna_to_aminoacid_sequence.rb +109 -39
  51. data/lib/bioroebe/count/count_amount_of_aminoacids.rb +3 -2
  52. data/lib/bioroebe/count/count_amount_of_nucleotides.rb +3 -0
  53. data/lib/bioroebe/cpp +1 -0
  54. data/lib/bioroebe/crystal/README.md +2 -0
  55. data/lib/bioroebe/crystal/to_rna.cr +19 -0
  56. data/lib/bioroebe/data/README.md +11 -8
  57. data/lib/bioroebe/data/electron_microscopy/pos_example.pos +396 -0
  58. data/lib/bioroebe/data/electron_microscopy/test_particles.star +36 -0
  59. data/lib/bioroebe/data/fasta/human/Homo_sapiens_hemoglobin_subunit_alpha_HBB_mRNA.fasta +9 -0
  60. data/lib/bioroebe/data/fasta/human/Homo_sapiens_hemoglobin_subunit_beta_HBB_mRNA.fasta +8 -0
  61. data/lib/bioroebe/data/fasta/human/README.md +2 -0
  62. data/lib/bioroebe/dotplots/advanced_dotplot.rb +1 -1
  63. data/lib/bioroebe/electron_microscopy/coordinate_analyzer.rb +15 -18
  64. data/lib/bioroebe/{fasta_and_fastq/parse_fasta/run.rb → electron_microscopy/electron_microscopy_module.rb} +16 -8
  65. data/lib/bioroebe/electron_microscopy/fix_pos_file.rb +1 -9
  66. data/lib/bioroebe/electron_microscopy/flipy.rb +83 -0
  67. data/lib/bioroebe/electron_microscopy/parse_coordinates.rb +2 -10
  68. data/lib/bioroebe/electron_microscopy/read_file_xmd.rb +1 -9
  69. data/lib/bioroebe/electron_microscopy/simple_star_file_generator.rb +4 -9
  70. data/lib/bioroebe/enzymes/has_this_restriction_enzyme.rb +10 -3
  71. data/lib/bioroebe/enzymes/restriction_enzyme.rb +23 -1
  72. data/lib/bioroebe/enzymes/restriction_enzymes/statistics.rb +65 -0
  73. data/lib/bioroebe/fasta_and_fastq/autocorrect_the_name_of_this_fasta_file.rb +1 -9
  74. data/lib/bioroebe/fasta_and_fastq/compact_fasta_file/compact_fasta_file.rb +7 -9
  75. data/lib/bioroebe/fasta_and_fastq/fasta_defline/fasta_defline.rb +1 -5
  76. data/lib/bioroebe/fasta_and_fastq/fasta_to_yaml/fasta_to_yaml.rb +81 -0
  77. data/lib/bioroebe/fasta_and_fastq/parse_fasta/parse_fasta.rb +1518 -7
  78. data/lib/bioroebe/fasta_and_fastq/return_fasta_subsection_of_this_file.rb +11 -2
  79. data/lib/bioroebe/fasta_and_fastq/show_fasta_headers.rb +27 -12
  80. data/lib/bioroebe/fasta_and_fastq/simplify_fasta_header/simplify_fasta_header.rb +1 -5
  81. data/lib/bioroebe/fasta_and_fastq/split_this_fasta_file_into_chromosomes/constants.rb +0 -5
  82. data/lib/bioroebe/genome/README.md +4 -0
  83. data/lib/bioroebe/genome/genome.rb +130 -0
  84. data/lib/bioroebe/genomes/genome_pattern.rb +3 -9
  85. data/lib/bioroebe/gui/gtk +1 -0
  86. data/lib/bioroebe/gui/gtk3/alignment/alignment.rb +106 -137
  87. data/lib/bioroebe/gui/gtk3/aminoacid_composition/aminoacid_composition.rb +27 -61
  88. data/lib/bioroebe/gui/gtk3/aminoacid_composition/customized_dialog.rb +1 -1
  89. data/lib/bioroebe/gui/gtk3/blosum_matrix_viewer/blosum_matrix_viewer.rb +1 -2
  90. data/lib/bioroebe/gui/gtk3/calculate_cell_numbers_of_bacteria/calculate_cell_numbers_of_bacteria.rb +1 -2
  91. data/lib/bioroebe/gui/gtk3/controller/controller.rb +46 -29
  92. data/lib/bioroebe/gui/gtk3/dna_to_aminoacid_widget/dna_to_aminoacid_widget.rb +77 -52
  93. data/lib/bioroebe/gui/gtk3/dna_to_reverse_complement_widget/dna_to_reverse_complement_widget.rb +1 -2
  94. data/lib/bioroebe/gui/gtk3/fasta_table_widget/fasta_table_widget.rb +100 -23
  95. data/lib/bioroebe/gui/gtk3/format_converter/format_converter.rb +1 -2
  96. data/lib/bioroebe/gui/gtk3/gene/gene.rb +1 -2
  97. data/lib/bioroebe/gui/gtk3/hamming_distance/hamming_distance.rb +43 -30
  98. data/lib/bioroebe/gui/gtk3/levensthein_distance/levensthein_distance.rb +1 -2
  99. data/lib/bioroebe/gui/gtk3/nucleotide_analyser/nucleotide_analyser.rb +120 -73
  100. data/lib/bioroebe/gui/gtk3/primer_design_widget/primer_design_widget.rb +1 -2
  101. data/lib/bioroebe/gui/gtk3/protein_to_DNA/protein_to_DNA.rb +19 -20
  102. data/lib/bioroebe/gui/gtk3/random_sequence/random_sequence.rb +20 -13
  103. data/lib/bioroebe/gui/gtk3/restriction_enzymes/restriction_enzymes.rb +1 -2
  104. data/lib/bioroebe/gui/gtk3/show_codon_table/misc.rb +97 -22
  105. data/lib/bioroebe/gui/gtk3/show_codon_table/show_codon_table.rb +3 -73
  106. data/lib/bioroebe/gui/gtk3/show_codon_usage/show_codon_usage.rb +1 -2
  107. data/lib/bioroebe/gui/gtk3/sizeseq/sizeseq.rb +1 -2
  108. data/lib/bioroebe/gui/gtk3/three_to_one/three_to_one.rb +1 -2
  109. data/lib/bioroebe/gui/gtk3/www_finder/www_finder.rb +1 -2
  110. data/lib/bioroebe/gui/javafx/bioroebe/Bioroebe.class +0 -0
  111. data/lib/bioroebe/gui/javafx/bioroebe/Bioroebe.java +104 -0
  112. data/lib/bioroebe/gui/javafx/bioroebe.jar +0 -0
  113. data/lib/bioroebe/gui/javafx/bioroebe.mf +1 -0
  114. data/lib/bioroebe/gui/javafx/module-info.class +0 -0
  115. data/lib/bioroebe/gui/javafx/module-info.java +5 -0
  116. data/lib/bioroebe/gui/jruby/alignment/alignment.rb +165 -0
  117. data/lib/bioroebe/gui/jruby/aminoacid_composition/aminoacid_composition.rb +166 -0
  118. data/lib/bioroebe/gui/libui/alignment/alignment.rb +3 -1
  119. data/lib/bioroebe/gui/libui/controller/controller.rb +116 -0
  120. data/lib/bioroebe/gui/libui/random_sequence/random_sequence.rb +18 -2
  121. data/lib/bioroebe/gui/libui/show_codon_table/show_codon_table.rb +2 -0
  122. data/lib/bioroebe/gui/libui/three_to_one/three_to_one.rb +8 -6
  123. data/lib/bioroebe/gui/shared_code/alignment/alignment_module.rb +102 -0
  124. data/lib/bioroebe/gui/shared_code/aminoacid_composition/aminoacid_composition_module.rb +94 -0
  125. data/lib/bioroebe/gui/shared_code/levensthein_distance/levensthein_distance_module.rb +18 -16
  126. data/lib/bioroebe/gui/shared_code/protein_to_DNA/protein_to_DNA_module.rb +14 -14
  127. data/lib/bioroebe/gui/swing/three_to_one/ThreeToOne$1.class +0 -0
  128. data/lib/bioroebe/gui/swing/three_to_one/ThreeToOne$CloseListener.class +0 -0
  129. data/lib/bioroebe/gui/swing/three_to_one/ThreeToOne.class +0 -0
  130. data/lib/bioroebe/gui/swing/three_to_one/ThreeToOne.java +141 -0
  131. data/lib/bioroebe/images/FORWARD_PRIMER.png +0 -0
  132. data/lib/bioroebe/images/REVERSE_PRIMER.png +0 -0
  133. data/lib/bioroebe/images/images.html +29845 -0
  134. data/lib/bioroebe/java/README.md +5 -0
  135. data/lib/bioroebe/java/bioroebe/AllInOne.java +1 -0
  136. data/lib/bioroebe/java/bioroebe/Base.class +0 -0
  137. data/lib/bioroebe/java/bioroebe/Base.java +39 -5
  138. data/lib/bioroebe/java/bioroebe/IsPalindrome.java +23 -5
  139. data/lib/bioroebe/java/bioroebe/SanitizeNucleotideSequence.java +0 -0
  140. data/lib/bioroebe/java/bioroebe/Sequence.java +28 -3
  141. data/lib/bioroebe/java/bioroebe/ToCamelcase.class +0 -0
  142. data/lib/bioroebe/java/bioroebe/ToCamelcase.java +16 -4
  143. data/lib/bioroebe/java/bioroebe/ToRNA.java +43 -0
  144. data/lib/bioroebe/java/bioroebe/ToplevelMethods.java +6 -0
  145. data/lib/bioroebe/java/bioroebe/{BisulfiteTreatment.class → src/BisulfiteTreatment.class} +0 -0
  146. data/lib/bioroebe/java/bioroebe/{Codons.class → src/Codons.class} +0 -0
  147. data/lib/bioroebe/java/bioroebe/src/Codons.java +35 -0
  148. data/lib/bioroebe/java/bioroebe/src/Commandline.class +0 -0
  149. data/lib/bioroebe/java/bioroebe/src/Commandline.java +101 -0
  150. data/lib/bioroebe/java/bioroebe/{Esystem.class → src/Esystem.class} +0 -0
  151. data/lib/bioroebe/java/bioroebe/{Esystem.java → src/Esystem.java} +6 -1
  152. data/lib/bioroebe/java/bioroebe/{GenerateRandomDnaSequence.class → src/GenerateRandomDnaSequence.class} +0 -0
  153. data/lib/bioroebe/java/bioroebe/{GenerateRandomDnaSequence.java → src/GenerateRandomDnaSequence.java} +8 -2
  154. data/lib/bioroebe/java/bioroebe/src/PartnerNucleotide.class +0 -0
  155. data/lib/bioroebe/java/bioroebe/src/PartnerNucleotide.java +56 -0
  156. data/lib/bioroebe/java/bioroebe/{RemoveFile.java → src/RemoveFile.java} +10 -4
  157. data/lib/bioroebe/java/bioroebe/{RemoveNumbers.class → src/RemoveNumbers.class} +0 -0
  158. data/lib/bioroebe/java/bioroebe/{RemoveNumbers.java → src/RemoveNumbers.java} +1 -0
  159. data/lib/bioroebe/java/bioroebe/src/toplevel_methods/BaseComposition.class +0 -0
  160. data/lib/bioroebe/java/bioroebe/src/toplevel_methods/BaseComposition.java +75 -0
  161. data/lib/bioroebe/misc/ruler.rb +11 -2
  162. data/lib/bioroebe/nucleotides/most_likely_nucleotide_sequence_for_this_aminoacid_sequence.rb +1 -9
  163. data/lib/bioroebe/nucleotides/sanitize_nucleotide_sequence.rb +59 -18
  164. data/lib/bioroebe/nucleotides/show_nucleotide_sequence.rb +7 -7
  165. data/lib/bioroebe/parsers/genbank_parser.rb +347 -26
  166. data/lib/bioroebe/parsers/gff.rb +1 -9
  167. data/lib/bioroebe/patterns/scan_for_repeat.rb +1 -5
  168. data/lib/bioroebe/pdb/fetch_fasta_sequence_from_pdb.rb +1 -9
  169. data/lib/bioroebe/pdb/parse_mmCIF_file.rb +1 -9
  170. data/lib/bioroebe/pdb/parse_pdb_file.rb +4 -10
  171. data/lib/bioroebe/project/project.rb +1 -1
  172. data/lib/bioroebe/python/README.md +1 -0
  173. data/lib/bioroebe/python/__pycache__/mymodule.cpython-39.pyc +0 -0
  174. data/lib/bioroebe/python/gui/gtk3/all_in_one.css +4 -0
  175. data/lib/bioroebe/python/gui/gtk3/all_in_one.py +59 -0
  176. data/lib/bioroebe/python/gui/gtk3/widget1.py +20 -0
  177. data/lib/bioroebe/python/gui/tkinter/all_in_one.py +91 -0
  178. data/lib/bioroebe/python/mymodule.py +8 -0
  179. data/lib/bioroebe/python/protein_to_dna.py +33 -0
  180. data/lib/bioroebe/python/shell/shell.py +19 -0
  181. data/lib/bioroebe/python/to_rna.py +14 -0
  182. data/lib/bioroebe/python/toplevel_methods/convert_dna_to_aminoacid_sequence.py +137 -0
  183. data/lib/bioroebe/python/toplevel_methods/esystem.py +12 -0
  184. data/lib/bioroebe/python/toplevel_methods/open_in_browser.py +20 -0
  185. data/lib/bioroebe/python/toplevel_methods/palindromes.py +52 -0
  186. data/lib/bioroebe/python/toplevel_methods/rds.py +13 -0
  187. data/lib/bioroebe/python/toplevel_methods/shuffleseq.py +23 -0
  188. data/lib/bioroebe/python/toplevel_methods/three_delimiter.py +37 -0
  189. data/lib/bioroebe/python/toplevel_methods/time_and_date.py +43 -0
  190. data/lib/bioroebe/python/toplevel_methods/to_camelcase.py +21 -0
  191. data/lib/bioroebe/requires/require_cleave_and_digest.rb +3 -1
  192. data/lib/bioroebe/requires/require_the_bioroebe_project.rb +3 -1
  193. data/lib/bioroebe/sequence/alignment.rb +14 -4
  194. data/lib/bioroebe/sequence/dna.rb +1 -0
  195. data/lib/bioroebe/sequence/nucleotide_module/nucleotide_module.rb +28 -25
  196. data/lib/bioroebe/sequence/protein.rb +105 -3
  197. data/lib/bioroebe/sequence/rna.rb +220 -0
  198. data/lib/bioroebe/sequence/sequence.rb +128 -40
  199. data/lib/bioroebe/shell/menu.rb +3815 -3696
  200. data/lib/bioroebe/shell/misc.rb +9019 -3133
  201. data/lib/bioroebe/shell/readline/readline.rb +1 -1
  202. data/lib/bioroebe/shell/shell.rb +1137 -28
  203. data/lib/bioroebe/siRNA/siRNA.rb +81 -1
  204. data/lib/bioroebe/string_matching/find_longest_substring.rb +3 -2
  205. data/lib/bioroebe/string_matching/hamming_distance.rb +1 -9
  206. data/lib/bioroebe/taxonomy/class_methods.rb +3 -8
  207. data/lib/bioroebe/taxonomy/constants.rb +4 -3
  208. data/lib/bioroebe/taxonomy/edit.rb +2 -1
  209. data/lib/bioroebe/taxonomy/help/help.rb +10 -10
  210. data/lib/bioroebe/taxonomy/help/helpline.rb +2 -2
  211. data/lib/bioroebe/taxonomy/info/check_available.rb +15 -9
  212. data/lib/bioroebe/taxonomy/info/info.rb +18 -11
  213. data/lib/bioroebe/taxonomy/info/is_dna.rb +46 -36
  214. data/lib/bioroebe/taxonomy/interactive.rb +140 -104
  215. data/lib/bioroebe/taxonomy/menu.rb +27 -18
  216. data/lib/bioroebe/taxonomy/parse_fasta.rb +3 -1
  217. data/lib/bioroebe/taxonomy/shared.rb +1 -0
  218. data/lib/bioroebe/taxonomy/taxonomy.rb +1 -0
  219. data/lib/bioroebe/toplevel_methods/aminoacids_and_proteins.rb +31 -24
  220. data/lib/bioroebe/toplevel_methods/colourize_related_methods.rb +164 -0
  221. data/lib/bioroebe/toplevel_methods/databases.rb +1 -1
  222. data/lib/bioroebe/toplevel_methods/digest.rb +18 -8
  223. data/lib/bioroebe/toplevel_methods/fasta_and_fastq.rb +107 -63
  224. data/lib/bioroebe/toplevel_methods/file_and_directory_related_actions.rb +14 -2
  225. data/lib/bioroebe/toplevel_methods/frequencies.rb +8 -1
  226. data/lib/bioroebe/toplevel_methods/misc.rb +175 -11
  227. data/lib/bioroebe/toplevel_methods/nucleotides.rb +118 -46
  228. data/lib/bioroebe/toplevel_methods/open_in_browser.rb +2 -0
  229. data/lib/bioroebe/toplevel_methods/palindromes.rb +75 -47
  230. data/lib/bioroebe/toplevel_methods/taxonomy.rb +3 -3
  231. data/lib/bioroebe/toplevel_methods/to_camelcase.rb +5 -0
  232. data/lib/bioroebe/utility_scripts/align_open_reading_frames.rb +1 -9
  233. data/lib/bioroebe/utility_scripts/check_for_mismatches/check_for_mismatches.rb +1 -9
  234. data/lib/bioroebe/utility_scripts/compacter/compacter.rb +251 -0
  235. data/lib/bioroebe/utility_scripts/compseq/compseq.rb +1 -9
  236. data/lib/bioroebe/utility_scripts/consensus_sequence.rb +6 -6
  237. data/lib/bioroebe/utility_scripts/create_batch_entrez_file.rb +1 -9
  238. data/lib/bioroebe/utility_scripts/dot_alignment.rb +1 -9
  239. data/lib/bioroebe/utility_scripts/move_file_to_its_correct_location.rb +1 -4
  240. data/lib/bioroebe/utility_scripts/parse_taxonomy.rb +2 -2
  241. data/lib/bioroebe/utility_scripts/permutations.rb +36 -9
  242. data/lib/bioroebe/utility_scripts/showorf/constants.rb +0 -5
  243. data/lib/bioroebe/utility_scripts/showorf/reset.rb +1 -4
  244. data/lib/bioroebe/version/version.rb +2 -2
  245. data/lib/bioroebe/www/embeddable_interface.rb +121 -58
  246. data/lib/bioroebe/www/sinatra/sinatra.rb +186 -71
  247. data/lib/bioroebe/yaml/aminoacids/amino_acids_long_name_to_one_letter.yml +2 -2
  248. data/lib/bioroebe/yaml/aminoacids/weight_of_common_proteins.yml +17 -17
  249. data/lib/bioroebe/yaml/configuration/browser.yml +1 -1
  250. data/lib/bioroebe/yaml/configuration/temp_dir.yml +1 -1
  251. data/lib/bioroebe/yaml/consensus_sequences/consensus_sequences.yml +1 -0
  252. data/lib/bioroebe/yaml/genomes/README.md +3 -4
  253. data/lib/bioroebe/yaml/nucleotides/nucleotides.yml +5 -0
  254. data/lib/bioroebe/yaml/restriction_enzymes/restriction_enzymes.yml +57 -57
  255. data/spec/README.md +6 -0
  256. data/spec/project_wide_specification/classes.md +5 -0
  257. metadata +107 -70
  258. data/doc/setup.rb +0 -1655
  259. data/lib/bioroebe/fasta_and_fastq/parse_fasta/constants.rb +0 -50
  260. data/lib/bioroebe/fasta_and_fastq/parse_fasta/initialize.rb +0 -86
  261. data/lib/bioroebe/fasta_and_fastq/parse_fasta/menu.rb +0 -117
  262. data/lib/bioroebe/fasta_and_fastq/parse_fasta/misc.rb +0 -981
  263. data/lib/bioroebe/fasta_and_fastq/parse_fasta/report.rb +0 -156
  264. data/lib/bioroebe/fasta_and_fastq/parse_fasta/reset.rb +0 -128
  265. data/lib/bioroebe/genbank/genbank_parser.rb +0 -291
  266. data/lib/bioroebe/java/bioroebe/AllInOne.class +0 -0
  267. data/lib/bioroebe/java/bioroebe/Cat.class +0 -0
  268. data/lib/bioroebe/java/bioroebe/Codons.java +0 -22
  269. data/lib/bioroebe/java/bioroebe/IsPalindrome.class +0 -0
  270. data/lib/bioroebe/java/bioroebe/PartnerNucleotide.class +0 -0
  271. data/lib/bioroebe/java/bioroebe/PartnerNucleotide.java +0 -19
  272. data/lib/bioroebe/java/bioroebe/SanitizeNucleotideSequence.class +0 -0
  273. data/lib/bioroebe/java/bioroebe/ToplevelMethods.class +0 -0
  274. data/lib/bioroebe/java/bioroebe.jar +0 -0
  275. data/lib/bioroebe/shell/add.rb +0 -108
  276. data/lib/bioroebe/shell/assign.rb +0 -360
  277. data/lib/bioroebe/shell/chop_and_cut.rb +0 -281
  278. data/lib/bioroebe/shell/constants.rb +0 -166
  279. data/lib/bioroebe/shell/download.rb +0 -335
  280. data/lib/bioroebe/shell/enable_and_disable.rb +0 -158
  281. data/lib/bioroebe/shell/enzymes.rb +0 -310
  282. data/lib/bioroebe/shell/fasta.rb +0 -345
  283. data/lib/bioroebe/shell/gtk.rb +0 -76
  284. data/lib/bioroebe/shell/history.rb +0 -132
  285. data/lib/bioroebe/shell/initialize.rb +0 -217
  286. data/lib/bioroebe/shell/loop.rb +0 -74
  287. data/lib/bioroebe/shell/prompt.rb +0 -107
  288. data/lib/bioroebe/shell/random.rb +0 -289
  289. data/lib/bioroebe/shell/reset.rb +0 -335
  290. data/lib/bioroebe/shell/scan_and_parse.rb +0 -135
  291. data/lib/bioroebe/shell/search.rb +0 -337
  292. data/lib/bioroebe/shell/sequences.rb +0 -200
  293. data/lib/bioroebe/shell/show_report_and_display.rb +0 -2901
  294. data/lib/bioroebe/shell/startup.rb +0 -127
  295. data/lib/bioroebe/shell/taxonomy.rb +0 -14
  296. data/lib/bioroebe/shell/tk.rb +0 -23
  297. data/lib/bioroebe/shell/user_input.rb +0 -88
  298. data/lib/bioroebe/shell/xorg.rb +0 -45
  299. data/lib/bioroebe/utility_scripts/compacter.rb +0 -131
  300. /data/lib/bioroebe/java/bioroebe/{BisulfiteTreatment.java → src/BisulfiteTreatment.java} +0 -0
  301. /data/lib/bioroebe/java/bioroebe/{RemoveFile.class → src/RemoveFile.class} +0 -0
@@ -0,0 +1,37 @@
1
+ #!/usr/bin/python3
2
+ # =========================================================================== #
3
+ import sys
4
+ import re
5
+
6
+ class Bioroebe(object):
7
+
8
+ # ========================================================================= #
9
+ # === Bioroebe.three_delimiter
10
+ #
11
+ # This method will, applied onto a String, add the '|' token
12
+ # after 3 positions.
13
+ #
14
+ # Example:
15
+ #
16
+ # Bioroebe.three_delimiter('ATGGGGATGTAGGTA') # => "ATG|GGG|ATG|TAG|GTA"
17
+ #
18
+ # ========================================================================= #
19
+ def three_delimiter(i):
20
+
21
+ if isinstance(i, list):
22
+ i = ' '.join(str(e) for e in i)
23
+
24
+ i = re.sub(r'(...)', r'\1-', i)
25
+
26
+ if i[-1] == '-': # Chop of the last character if it is a '-' token.
27
+ i = i[:-1]
28
+
29
+ return i
30
+
31
+ if __name__ == '__main__':
32
+ if len(sys.argv) > 1:
33
+ i = sys.argv[1]
34
+ print(Bioroebe.three_delimiter(i))
35
+ else:
36
+ print("Please provide an argument to this method.")
37
+ # py three_delimiter.py ATGGGGATGTAGGTA
@@ -0,0 +1,43 @@
1
+ #!/usr/bin/python3
2
+ import sys
3
+ from datetime import datetime
4
+
5
+ class Bioroebe(object):
6
+
7
+ # ========================================================================= #
8
+ # === Bioroebe.return_current_day_month_year()
9
+ #
10
+ # This method will return a String such as "09.07.2022".
11
+ # ========================================================================= #
12
+ def return_current_day_month_year():
13
+ day = str(datetime.now().day).rjust(2, '0')
14
+ month = str(datetime.now().month).rjust(2, '0')
15
+ year = str(datetime.now().year)
16
+ return day+'.'+month+'.'+year
17
+
18
+ # ========================================================================= #
19
+ # === Bioroebe.return_current_hours_minutes_seconds()
20
+ #
21
+ # This method will return a String such as "20:44:20".
22
+ # ========================================================================= #
23
+ def return_current_hours_minutes_seconds():
24
+ hours = str(datetime.now().hour).rjust(2, '0')
25
+ minutes = str(datetime.now().minute).rjust(2, '0')
26
+ seconds = str(datetime.now().second).rjust(2, '0')
27
+ return hours+':'+minutes+':'+seconds
28
+
29
+ # ========================================================================= #
30
+ # === Bioroebe.show_time_now
31
+ #
32
+ # This method will show the current time. It will do so only if the
33
+ # verbosity-variable has been set to true.
34
+ # ========================================================================= #
35
+ def show_time_now(be_verbose = True):
36
+ time = Bioroebe.return_current_hours_minutes_seconds()
37
+ if be_verbose:
38
+ print("Showing the current time: "+time)
39
+
40
+ if __name__ == '__main__':
41
+ print(Bioroebe.return_current_day_month_year())
42
+ print(Bioroebe.return_current_hours_minutes_seconds())
43
+ Bioroebe.show_time_now()
@@ -0,0 +1,21 @@
1
+ from re import sub
2
+ import sys
3
+
4
+ # =========================================================================== #
5
+ # === camel_case
6
+ # =========================================================================== #
7
+ def camel_case(i):
8
+ i = sub(r"(_|-)+", " ", i).title().replace(" ", "")
9
+ return ''.join(
10
+ [
11
+ i[0].upper(),
12
+ i[1:]
13
+ ]
14
+ )
15
+
16
+ if __name__ == "__main__":
17
+ print(
18
+ camel_case(
19
+ sys.argv[1]
20
+ )
21
+ ) # py to_camelcase.py abcDef
@@ -11,7 +11,9 @@ module Bioroebe
11
11
  # ========================================================================= #
12
12
  # === Bioroebe.require_all_cleave_and_digest_files
13
13
  # ========================================================================= #
14
- def self.require_all_cleave_and_digest_files(i = CLEAVE_AND_DIGEST_DIRECTORY)
14
+ def self.require_all_cleave_and_digest_files(
15
+ i = CLEAVE_AND_DIGEST_DIRECTORY
16
+ )
15
17
  _ = Dir["#{i}*.rb"]
16
18
  _.each {|file|
17
19
  file = "bioroebe/cleave_and_digest/#{File.basename(file)}"
@@ -159,4 +159,6 @@ require 'bioroebe/requires/require_all_codon_files.rb'
159
159
  # And the sinatra-interface:
160
160
  # =========================================================================== #
161
161
  # require 'bioroebe/requires/require_the_bioroebe_sinatra_components.rb'
162
- require 'bioroebe/www/sinatra/sinatra.rb'
162
+ require 'bioroebe/www/sinatra/sinatra.rb'
163
+
164
+ require 'bioroebe/sequence/protein.rb'
@@ -28,6 +28,8 @@ module Bioroebe
28
28
 
29
29
  class Alignment < ::Bioroebe::CommandlineApplication # === Bioroebe::Alignment
30
30
 
31
+ require 'bioroebe/misc/ruler.rb'
32
+
31
33
  # ========================================================================= #
32
34
  # === initialize
33
35
  # ========================================================================= #
@@ -122,9 +124,12 @@ class Alignment < ::Bioroebe::CommandlineApplication # === Bioroebe::Alignment
122
124
  # ========================================================================= #
123
125
  def print_consensus_sequence
124
126
  e
125
- erev 'The consensus sequence, derived from the above matrix, is:'
127
+ n_nucleotides = @array_G.size
128
+ erev 'The consensus sequence ('+steelblue(n_nucleotides.to_s)+
129
+ rev+' nucleotides), '\
130
+ 'derived from the above matrix, is:'
126
131
  e
127
- print ' '
132
+ sequence_that_will_be_displayed = ''.dup
128
133
  @array_G.size.times {|index|
129
134
  hash = {}
130
135
  hash['A'] = @array_A[index]
@@ -132,8 +137,12 @@ class Alignment < ::Bioroebe::CommandlineApplication # === Bioroebe::Alignment
132
137
  hash['C'] = @array_C[index]
133
138
  hash['G'] = @array_G[index]
134
139
  _ = hash.max_by {|key, value| value }
135
- print mediumslateblue(_[0])+rev # Print each individual character here.
140
+ sequence = _[0]
141
+ sequence_that_will_be_displayed << sequence
136
142
  }
143
+ ruler_result = Bioroebe.return_ruler(sequence_that_will_be_displayed)
144
+ e ' '+ruler_result+rev
145
+ print ' '+mediumslateblue(sequence_that_will_be_displayed)+rev # Print each individual character here.
137
146
  e Colours.rev
138
147
  e
139
148
  end
@@ -159,7 +168,8 @@ class Alignment < ::Bioroebe::CommandlineApplication # === Bioroebe::Alignment
159
168
  # === print_row_for
160
169
  # ========================================================================= #
161
170
  def print_row_for(
162
- i = 'A', array = @array_A
171
+ i = 'A',
172
+ array = @array_A
163
173
  )
164
174
  print "#{rev} #{i}: " # First output the identifier, e. g. "A" or "T" and so forth.
165
175
  array.each {|entry| # entry is a Float.
@@ -83,6 +83,7 @@ class DNA < ::Bioroebe::Sequence # === Bioroebe::DNA
83
83
  end; alias to_RNA to_rna # === to_RNA
84
84
  alias to_T to_rna # === to_T
85
85
 
86
+ require 'bioroebe/codons/convert_this_codon_to_that_aminoacid.rb'
86
87
  # ========================================================================= #
87
88
  # === to_aminoacids
88
89
  #
@@ -72,13 +72,6 @@ module NucleotideModule # === Bioroebe::NucleotideModule
72
72
  i.tr('U','T')
73
73
  end
74
74
 
75
- # ========================================================================= #
76
- # === to_dna
77
- # ========================================================================= #
78
- def to_dna
79
- seq?.tr('U','T')
80
- end; alias dna to_dna # === dna
81
-
82
75
  # ========================================================================= #
83
76
  # === n_random_dna
84
77
  #
@@ -258,24 +251,6 @@ module NucleotideModule # === Bioroebe::NucleotideModule
258
251
  ::Bioroebe.codon_to_aminoacid(codon)
259
252
  end; alias translate_aminoacid_into_dna codon_to_aminoacid # === translate_aminoacid_into_dna
260
253
 
261
- # ========================================================================= #
262
- # === to_dna
263
- #
264
- # This method will convert a RNA sequence into a DNA sequence.
265
- #
266
- # It will return the translation.
267
- #
268
- # bio; puts Bioroebe.new.to_dna('actgggcgagagklklklklk')
269
- # ========================================================================= #
270
- def to_dna(
271
- i = sequence?, upcase_me = true
272
- )
273
- if is_RNA?
274
- i = sequence? if i.nil?
275
- ::Bioroebe.to_dna(i, upcase_me)
276
- end
277
- end; alias dna to_dna # === dna
278
-
279
254
  # ========================================================================= #
280
255
  # === random
281
256
  #
@@ -397,6 +372,34 @@ module NucleotideModule # === Bioroebe::NucleotideModule
397
372
  end
398
373
  end; alias gc_percent gc_percentage # === gc_percent
399
374
 
375
+ # ========================================================================= #
376
+ # === to_dna
377
+ #
378
+ # This method will convert a RNA sequence into a DNA sequence.
379
+ #
380
+ # It will return the translation.
381
+ #
382
+ # Usage example:
383
+ #
384
+ # require 'bioroebe'; puts Bioroebe::DNA.new('actgggcgagaguuuuUUUUUU').to_dna
385
+ #
386
+ # ========================================================================= #
387
+ def to_dna(
388
+ i = sequence?,
389
+ upcase_me = true
390
+ )
391
+ i = sequence? if i.nil?
392
+ i = ::Bioroebe.to_dna(i, upcase_me)
393
+ return i
394
+ end; alias dna to_dna # === dna
395
+
396
+ # ========================================================================= #
397
+ # === to_dna
398
+ # ========================================================================= #
399
+ # def to_dna
400
+ # seq?.tr('U','T')
401
+ # end; alias dna to_dna # === dna
402
+
400
403
  end; end
401
404
 
402
405
  if __FILE__ == $PROGRAM_NAME
@@ -4,7 +4,12 @@
4
4
  # =========================================================================== #
5
5
  # === Bioroebe::Protein
6
6
  #
7
- # This is a typical sequence of aminoacids.
7
+ # This is a typical sequence of aminoacids. It is not 100% certain whether
8
+ # this class will be retained, but for the time being it will be. Note
9
+ # that peptides should also use this class - while the name may not be
10
+ # 100% accurate (smaller proteins are typically called peptides or
11
+ # oligopeptides) I feel that this is a distinction that does not really
12
+ # make a whole lot of sense.
8
13
  # =========================================================================== #
9
14
  # require 'bioroebe/sequence/protein.rb'
10
15
  # =========================================================================== #
@@ -94,6 +99,9 @@ class Protein < ::Bioroebe::Sequence # === Bioroebe::Protein
94
99
  # This method will return true if there are at the least two
95
100
  # cysteines in the aminoacid sequence of this protein.
96
101
  #
102
+ # If anyone knows of a better algorithm to determine whether
103
+ # a protein can REALLY create a disulfide bond let me know.
104
+ #
97
105
  # Usage example:
98
106
  #
99
107
  # Bioroebe::Protein.new('MLKLKNASCCEEE').can_form_disulfide_bonds? # => true
@@ -146,7 +154,7 @@ class Protein < ::Bioroebe::Sequence # === Bioroebe::Protein
146
154
  chars.each {|this_aminoacid|
147
155
  sum += weight_of(this_aminoacid)
148
156
  }
149
- sum
157
+ return sum
150
158
  end; alias molecular_weight? weight? # === molecular_weight?
151
159
 
152
160
  # ========================================================================= #
@@ -230,10 +238,99 @@ class Protein < ::Bioroebe::Sequence # === Bioroebe::Protein
230
238
  return result
231
239
  end
232
240
 
241
+ # ========================================================================= #
242
+ # === can_be_stained_via_coomassie?
243
+ #
244
+ # Determine whether a protein can be stained in a coomassie
245
+ # staining. This is just a simple, fairly dumb check and
246
+ # NOT guaranteed to be correct. If anyone has a better
247
+ # way to check for this let me know.
248
+ # ========================================================================= #
249
+ def can_be_stained_via_coomassie?
250
+ disallowed_aminoacids = %w( K H R W F Y)
251
+ sequence = sequence?
252
+ return sequence.chars.uniq.any? {|this_aminoacid|
253
+ disallowed_aminoacids.include? this_aminoacid
254
+ }
255
+ end
256
+
257
+ # ========================================================================= #
258
+ # === aliphatic_index
259
+ #
260
+ # This method will calculate the aliphatic acid of an aminoacid,
261
+ # aka a Protein.
262
+ #
263
+ # Usage example:
264
+ #
265
+ # require 'bioroebe'; Bioroebe::Protein.new('MVKSYDRYEYEDCLGIVNSKSSNCVFLNNA').aliphatic_index # => 71.33333
266
+ #
267
+ # ========================================================================= #
268
+ def aliphatic_index(
269
+ a = 2.9,
270
+ b = 3.9
271
+ )
272
+ composition = {}
273
+ composition.default = 0
274
+ chars = sequence?.chars
275
+ chars.each { |entry| composition[entry] += 1}
276
+ (
277
+ composition['A'] +
278
+ a * composition['V'].to_f +
279
+ b * (composition['I'] + composition['L'])
280
+ ).to_f / length.to_f * 100
281
+ end
282
+
283
+ # ========================================================================= #
284
+ # === Bioroebe::Protein.one_to_three
285
+ #
286
+ # Usage example:
287
+ #
288
+ # Bioroebe::Protein.one_to_three('A') # => "Ala"
289
+ #
290
+ # ========================================================================= #
291
+ def self.one_to_three(this_aminoacid = 'A')
292
+ if this_aminoacid.is_a? Array
293
+ this_aminoacid = this_aminoacid.join(' ').strip
294
+ end
295
+ return ::Bioroebe.one_to_three(this_aminoacid)
296
+ end
297
+
298
+ # ========================================================================= #
299
+ # === Bioroebe::Protein.name
300
+ #
301
+ # Usage example:
302
+ #
303
+ # Bioroebe::Protein.name('A') # => "alanine"
304
+ #
305
+ # ========================================================================= #
306
+ def self.name(this_aminoacid = 'A')
307
+ Bioroebe.return_long_name_of_this_aminoacid(this_aminoacid).downcase
308
+ end
309
+
310
+ # ========================================================================= #
311
+ # === Bioroebe::Protein.to_1
312
+ #
313
+ # This will convert from the long name of an aminoacid, such as 'alanine',
314
+ # to the short one-letter abbreviation.
315
+ #
316
+ # Usage example:
317
+ #
318
+ # Bioroebe::Protein.to_1('alanine') # => "A"
319
+ #
320
+ # ========================================================================= #
321
+ def self.to_1(this_aminoacid = 'alanine')
322
+ if this_aminoacid.is_a? Array
323
+ this_aminoacid = this_aminoacid.join(' ').strip
324
+ end
325
+ this_aminoacid.downcase!
326
+ dataset = YAML.load_file(Bioroebe.file_amino_acids_long_name_to_one_letter)
327
+ return dataset[this_aminoacid]
328
+ end
329
+
233
330
  end
234
331
 
235
332
  # =========================================================================== #
236
- # This "alias" was added in May 2022.
333
+ # The following "alias" was added in May 2022.
237
334
  # =========================================================================== #
238
335
  Aminoacids = Protein
239
336
 
@@ -267,6 +364,7 @@ end
267
364
 
268
365
  if __FILE__ == $PROGRAM_NAME
269
366
  require 'colours/autoinclude'
367
+ require 'bioroebe/toplevel_methods/verbose.rb'
270
368
  protein = Bioroebe::Protein.new(ARGV)
271
369
  e protein.weight?
272
370
  e Colours.rev+'For the aminoacid sequence:'
@@ -277,5 +375,9 @@ if __FILE__ == $PROGRAM_NAME
277
375
  e
278
376
  e " #{Colours.royalblue(protein.to_rna)}"
279
377
  e
378
+ e 'Can this protein be stained via coomassie brilliant blue?:'
379
+ e
380
+ e " #{lightblue(Bioroebe::VerboseTruth[protein.can_be_stained_via_coomassie?])}"
381
+ e
280
382
  end # protein MAC
281
383
  # protein MACCCCAAAAAKKKKLLLLL
@@ -0,0 +1,220 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ # === Bioroebe::RNA
6
+ #
7
+ # This is a typical "segment of" RNA, a sequence object.
8
+ # =========================================================================== #
9
+ # require 'bioroebe/sequence/rna.rb'
10
+ # =========================================================================== #
11
+ require 'bioroebe/requires/require_sequence.rb'
12
+
13
+ module Bioroebe
14
+
15
+ class RNA < ::Bioroebe::Sequence # === Bioroebe::RNA
16
+
17
+ require 'bioroebe/sequence/nucleotide_module/nucleotide_module.rb'
18
+ include Bioroebe::NucleotideModule
19
+
20
+ require 'bioroebe/base/internal_hash_module/internal_hash_module.rb'
21
+ include Bioroebe::InternalHashModule
22
+
23
+ require 'bioroebe/codons/codons.rb'
24
+
25
+ # ========================================================================= #
26
+ # === initialize
27
+ # ========================================================================= #
28
+ def initialize(
29
+ this_sequence = 'ATCG'
30
+ )
31
+ reset
32
+ super(
33
+ this_sequence
34
+ )
35
+ set_dna_type # Make sure we have a DNA only.
36
+ end
37
+
38
+ # ========================================================================= #
39
+ # === reset
40
+ # ========================================================================= #
41
+ def reset
42
+ super()
43
+ reset_the_internal_hash # This should come early on here.
44
+ # ======================================================================= #
45
+ # === :is_a_ribozyme
46
+ #
47
+ # By default RNAs that are created via RNA.new are NOT considered to
48
+ # be a ribozyme.
49
+ # ======================================================================= #
50
+ @internal_hash[:is_a_ribozyme] = false
51
+ # ======================================================================= #
52
+ # === @name_of_the_gene
53
+ # ======================================================================= #
54
+ @name_of_the_gene = nil # No name is assigned by default.
55
+ end
56
+
57
+ # ========================================================================= #
58
+ # === set_name_of_the_gene
59
+ #
60
+ # Use this method if you want to give the gene a specific name.
61
+ # ========================================================================= #
62
+ def set_name_of_the_gene(i)
63
+ @name_of_the_gene = i
64
+ end; alias name= set_name_of_the_gene # === name=
65
+ alias set_name set_name_of_the_gene # === set_name
66
+ alias name_of_gene= set_name_of_the_gene # === name_of_gene=
67
+ alias set_gene_name set_name_of_the_gene # === set_gene_name
68
+
69
+ # ========================================================================= #
70
+ # === name_of_gene?
71
+ # ========================================================================= #
72
+ def name_of_gene?
73
+ @name_of_the_gene
74
+ end; alias name_of_gene name_of_gene? # === name_of_gene
75
+ alias name? name_of_gene? # === name?
76
+
77
+ # ========================================================================= #
78
+ # === to_rna
79
+ #
80
+ # Convert the main sequence to RNA and return that result.
81
+ # ========================================================================= #
82
+ def to_rna
83
+ string?.tr('T','U')
84
+ end; alias to_RNA to_rna # === to_RNA
85
+ alias to_T to_rna # === to_T
86
+
87
+ require 'bioroebe/codons/convert_this_codon_to_that_aminoacid.rb'
88
+ # ========================================================================= #
89
+ # === to_aminoacids
90
+ #
91
+ # This will convert the given DNA input into the corresponding
92
+ # aminoacid "output" - aka a translational output, following
93
+ # the regular conversion of DNA→mRNA→protein.
94
+ #
95
+ # If the second argument to this method is true, then we will filter
96
+ # away all "STOP" elements.
97
+ # ========================================================================= #
98
+ def to_aminoacids(
99
+ i = string?,
100
+ ignore_stop_codons = true
101
+ )
102
+ i = [i].flatten
103
+ # ======================================================================= #
104
+ # === Handle blocks next
105
+ # ======================================================================= #
106
+ if block_given?
107
+ yielded = yield
108
+ # ===================================================================== #
109
+ # We don't have to handle :frame1 since this is the default anyway.
110
+ # ===================================================================== #
111
+ case yielded
112
+ when :frame2
113
+ i.map! {|entry| entry[1..-1] }
114
+ when :frame3
115
+ i.map! {|entry| entry[2..-1] }
116
+ end
117
+ end
118
+ i.map {|entry|
119
+ if entry and (entry.size > 2) # Must check for at the least 3 nucleotides there.
120
+ # =================================================================== #
121
+ # Get a chunk of 3 nucleotides next. This will yield an array of
122
+ # codons such as this one here:
123
+ #
124
+ # ["GCC", "CAC", "AGG", "CAC", "AAC"]
125
+ #
126
+ # =================================================================== #
127
+ codons = entry.scan(/.../)
128
+ # =================================================================== #
129
+ # Next, find the corresponding aminoacid for this codon.
130
+ # =================================================================== #
131
+ aminoacids = codons.map {|codon|
132
+ result = ::Bioroebe.codon_to_aminoacid(codon)
133
+ result
134
+ }
135
+ if ignore_stop_codons
136
+ aminoacids.reject! {|inner_entry|
137
+ inner_entry == 'STOP'
138
+ }
139
+ end
140
+ result = aminoacids.join
141
+ result # Return the result here.
142
+ else
143
+ entry
144
+ end
145
+ }
146
+ end; alias to_aa to_aminoacids # === to_aa
147
+ alias to_protein to_aminoacids # === to_protein
148
+
149
+ # ========================================================================= #
150
+ # === is_a_ribozyme?
151
+ # ========================================================================= #
152
+ def is_a_ribozyme?
153
+ @internal_hash[:is_a_ribozyme]
154
+ end
155
+
156
+ # ========================================================================= #
157
+ # === gc_percentage?
158
+ #
159
+ # Usage example:
160
+ #
161
+ # x = Bioroebe::DNA.new('TTATTAAGTATTACG'); x.gc_percentage? # => "20.000"
162
+ #
163
+ # ========================================================================= #
164
+ def gc_percentage?
165
+ require 'bioroebe/calculate/calculate_gc_content.rb'
166
+ Bioroebe.gc_content(string?)
167
+ end
168
+
169
+ end
170
+
171
+ # =========================================================================== #
172
+ # === Bioroebe.to_aminoacids
173
+ #
174
+ # This method can be used to convert a String such as 'ATG' into the
175
+ # corresponding aminoacid sequence - in this example, the String 'M'.
176
+ #
177
+ # Invocation examples:
178
+ #
179
+ # Bioroebe.to_aminoacids 'AUGGCCAUGGCGCCCAGAACUGAGAUCAAUAGUACCCGUAUUAACGGGUGA' # => "MAMAPRTEINSTRING"
180
+ # Bioroebe.to_aminoacids '/rosalind_prot.txt' # => "MAMAPRTEINSTRING"
181
+ #
182
+ # =========================================================================== #
183
+ def self.to_aminoacids(i, &block)
184
+ if i and File.file?(i)
185
+ i = File.read(i).strip
186
+ end
187
+ result = ::Bioroebe::DNA.new.to_aminoacids(i, &block)
188
+ if i.is_a?(String) and !result.is_a?(String)
189
+ # ======================================================================= #
190
+ # If the user did input a String, then we must make sure that the
191
+ # returned value will also be a String.
192
+ # ======================================================================= #
193
+ result = result.join(' ').strip
194
+ end
195
+ result
196
+ end; self.instance_eval { alias to_aa to_aminoacids } # === Bioroebe.to_aa
197
+ self.instance_eval { alias to_protein to_aminoacids } # === Bioroebe.to_protein
198
+ self.instance_eval { alias rna_to_protein to_aminoacids } # === Bioroebe.rna_to_protein
199
+
200
+ # =========================================================================== #
201
+ # === Bioroebe.rna_sequence
202
+ #
203
+ # Usage example:
204
+ #
205
+ # dna = Bioroebe.rna_sequence('ATTCGGU')
206
+ #
207
+ # =========================================================================== #
208
+ def self.rna_sequence(i)
209
+ i = i.first if i.is_a? Array
210
+ i.delete!('T') # Reject Thymine there.
211
+ ::Bioroebe::RNA.new(i)
212
+ end
213
+
214
+ end
215
+
216
+ if __FILE__ == $PROGRAM_NAME
217
+ rna = Bioroebe::RNA.new(ARGV)
218
+ puts 'The DNA sequence is: '+rna.sequence?
219
+ puts 'The RNA sequence is: '+rna.to_dna
220
+ end # dna ATCGATCGAAATTACCCCCCCC