bioroebe 0.12.24 → 0.13.31

Sign up to get free protection for your applications and to get access to all the features.
Files changed (503) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.md +7 -8
  3. data/README.md +566 -354
  4. data/bin/all_positions_of_this_nucleotide +1 -1
  5. data/bin/aminoacid_frequencies +1 -1
  6. data/bin/automatically_rename_this_fasta_file +1 -1
  7. data/bin/base_composition +1 -1
  8. data/bin/batch_create_windows_executables +1 -1
  9. data/bin/bioroebe +12 -1
  10. data/bin/bioroebe_cat +7 -0
  11. data/bin/calculate_exponential_growth +7 -0
  12. data/bin/calculate_n50_value +1 -1
  13. data/bin/calculate_the_frequencies_of_this_species +7 -0
  14. data/bin/chunked_display +1 -1
  15. data/bin/codon_frequency +1 -1
  16. data/bin/codon_to_aminoacid +1 -1
  17. data/bin/colourize_this_fasta_sequence +1 -1
  18. data/bin/complementary_dna_strand +1 -1
  19. data/bin/complementary_rna_strand +1 -1
  20. data/bin/consensus_sequence +1 -1
  21. data/bin/dna_to_rna +1 -1
  22. data/bin/downcase_chunked_display +1 -1
  23. data/bin/download_this_pdb +1 -1
  24. data/bin/fasta_index +1 -1
  25. data/bin/fetch_data_from_uniprot +1 -1
  26. data/bin/filter_away_invalid_nucleotides +1 -1
  27. data/bin/find_substring +1 -1
  28. data/bin/input_as_dna +1 -1
  29. data/bin/is_palindrome +1 -1
  30. data/bin/leading_five_prime +1 -1
  31. data/bin/longest_ORF +1 -1
  32. data/bin/longest_substring +1 -1
  33. data/bin/open_reading_frames +1 -1
  34. data/bin/partner_nucleotide +1 -1
  35. data/bin/plain_palindrome +1 -1
  36. data/bin/random_dna_sequence +1 -1
  37. data/bin/random_sequence +1 -1
  38. data/bin/raw_hamming_distance +1 -1
  39. data/bin/return_longest_substring_via_LCS_algorithm +1 -1
  40. data/bin/reverse_sequence +1 -1
  41. data/bin/short_aminoacid_letter_from_long_aminoacid_name +1 -1
  42. data/bin/show_atomic_composition +1 -1
  43. data/bin/show_fasta_header +1 -1
  44. data/bin/show_nucleotide_sequence +1 -1
  45. data/bin/show_this_dna_sequence +1 -1
  46. data/bin/show_time_now +7 -0
  47. data/bin/sort_aminoacid_based_on_its_hydrophobicity +1 -1
  48. data/bin/strict_filter_away_invalid_aminoacids +1 -1
  49. data/{lib/bioroebe/base/reset.rb → bin/three_delimiter} +9 -6
  50. data/bin/three_to_one +1 -1
  51. data/bin/to_rna +1 -1
  52. data/bin/trailing_three_prime +1 -1
  53. data/bin/upcase_this_aminoacid_sequence_and_remove_numbers +1 -1
  54. data/bioroebe.gemspec +6 -7
  55. data/doc/README.gen +534 -322
  56. data/doc/blosum/blosum.md +4 -0
  57. data/doc/compatibility/BIO_PHP.md +20 -18
  58. data/doc/compatibility/README.md +2 -3
  59. data/doc/compatibility/emboss.md +5 -3
  60. data/doc/{extensive_usage_example.md → extensive_usage_example/extensive_usage_example.md} +4 -2
  61. data/doc/{instructions_for_the_taxonomy_subproject.md → instructions_for_the_taxonomy_subproject/instructions_for_the_taxonomy_subproject.md} +36 -33
  62. data/doc/{legacy_paths.md → legacy_paths/legacy_paths.md} +3 -3
  63. data/doc/statistics/statistics.md +12 -10
  64. data/doc/todo/bioroebe_GUI_todo.md +6 -1
  65. data/doc/todo/bioroebe_java_todo.md +3 -2
  66. data/doc/todo/bioroebe_todo.md +328 -310
  67. data/doc/{using_biomart.md → using_biomart/using_biomart.md} +7 -3
  68. data/lib/bioroebe/abstract/features.rb +0 -0
  69. data/lib/bioroebe/aminoacids/aminoacid_substitution.rb +1 -1
  70. data/lib/bioroebe/aminoacids/aminoacids_mass_table.rb +3 -1
  71. data/lib/bioroebe/aminoacids/codon_percentage.rb +18 -10
  72. data/lib/bioroebe/aminoacids/create_random_aminoacids.rb +5 -2
  73. data/lib/bioroebe/aminoacids/deduce_aminoacid_sequence.rb +90 -64
  74. data/lib/bioroebe/aminoacids/display_aminoacid_table.rb +1 -3
  75. data/lib/bioroebe/aminoacids/show_hydrophobicity.rb +2 -2
  76. data/lib/bioroebe/annotations/create_annotation_format.rb +2 -2
  77. data/lib/bioroebe/base/base.rb +101 -6
  78. data/lib/bioroebe/base/base_module/base_module.rb +9 -1
  79. data/lib/bioroebe/base/colours.rb +3 -0
  80. data/lib/bioroebe/base/colours_for_base/colours_for_base.rb +80 -44
  81. data/lib/bioroebe/base/commandline_application/README.md +1 -1
  82. data/lib/bioroebe/base/commandline_application/commandline_application.rb +661 -22
  83. data/lib/bioroebe/base/commandline_application/commandline_arguments.rb +2 -1
  84. data/lib/bioroebe/base/infer_the_namespace_module/infer_the_namespace_module.rb +37 -0
  85. data/lib/bioroebe/base/internal_hash_module/internal_hash_module.rb +1 -6
  86. data/lib/bioroebe/base/prototype/prototype.rb +155 -14
  87. data/lib/bioroebe/biomart/attribute.rb +1 -1
  88. data/lib/bioroebe/biomart/biomart.rb +8 -9
  89. data/lib/bioroebe/biomart/server.rb +1 -1
  90. data/lib/bioroebe/blosum/blosum.rb +2 -2
  91. data/lib/bioroebe/calculate/calculate_blosum_score.rb +5 -3
  92. data/lib/bioroebe/calculate/calculate_gc_content.rb +1 -1
  93. data/lib/bioroebe/calculate/calculate_levensthein_distance.rb +5 -3
  94. data/lib/bioroebe/calculate/calculate_melting_temperature.rb +2 -10
  95. data/lib/bioroebe/calculate/calculate_melting_temperature_for_more_than_thirteen_nucleotides.rb +6 -15
  96. data/lib/bioroebe/calculate/calculate_the_position_specific_scoring_matrix.rb +4 -2
  97. data/lib/bioroebe/cell/cell.rb +3 -2
  98. data/lib/bioroebe/cell/specialized_cells/B_cell.rb +60 -0
  99. data/lib/bioroebe/cell/specialized_cells/Macrophage.rb +60 -0
  100. data/lib/bioroebe/cell/specialized_cells/README.md +5 -0
  101. data/lib/bioroebe/cell/specialized_cells/T_cell.rb +60 -0
  102. data/lib/bioroebe/cleave_and_digest/cleave.rb +3 -1
  103. data/lib/bioroebe/cleave_and_digest/digestion.rb +1 -1
  104. data/lib/bioroebe/codon_tables/frequencies/10090_Mus_musculus.yml +93 -0
  105. data/lib/bioroebe/codon_tables/frequencies/107243_Thlaspi_caerulescens.yml +72 -0
  106. data/lib/bioroebe/codon_tables/frequencies/parse_frequency_table.rb +2 -2
  107. data/lib/bioroebe/codons/codon_table.rb +10 -2
  108. data/lib/bioroebe/codons/codons.rb +3 -3
  109. data/lib/bioroebe/codons/convert_this_codon_to_that_aminoacid.rb +18 -15
  110. data/lib/bioroebe/codons/determine_optimal_codons.rb +1 -1
  111. data/lib/bioroebe/codons/possible_codons_for_this_aminoacid.rb +4 -2
  112. data/lib/bioroebe/codons/show_codon_tables.rb +1 -1
  113. data/lib/bioroebe/codons/show_codon_usage.rb +1 -2
  114. data/lib/bioroebe/codons/show_this_codon_table.rb +2 -2
  115. data/lib/bioroebe/codons/start_codons.rb +7 -3
  116. data/lib/bioroebe/colours/colour_schemes/README.md +1 -1
  117. data/lib/bioroebe/colours/colour_schemes/array_available_colour_schemes.rb +3 -3
  118. data/lib/bioroebe/colours/colour_schemes/colour_scheme.rb +3 -3
  119. data/lib/bioroebe/colours/colour_schemes/colour_scheme_demo.rb +4 -3
  120. data/lib/bioroebe/colours/colour_schemes/helix.rb +3 -1
  121. data/lib/bioroebe/colours/colour_schemes/hydropathy.rb +3 -1
  122. data/lib/bioroebe/colours/colour_schemes/score.rb +13 -2
  123. data/lib/bioroebe/colours/colour_schemes/strand.rb +3 -1
  124. data/lib/bioroebe/colours/colour_schemes/turn.rb +3 -1
  125. data/lib/bioroebe/colours/colour_schemes/zappo.rb +1 -1
  126. data/lib/bioroebe/{toplevel_methods/colourize_related_methods.rb → colours/colourize_related_code.rb} +1 -3
  127. data/lib/bioroebe/colours/colourize_sequence.rb +3 -1
  128. data/lib/bioroebe/colours/colours.rb +172 -15
  129. data/lib/bioroebe/configuration/configuration.rb +1 -1
  130. data/lib/bioroebe/constants/GUIs.rb +2 -2
  131. data/lib/bioroebe/constants/constants.rb +1349 -0
  132. data/lib/bioroebe/conversions/convert_aminoacid_to_dna.rb +8 -13
  133. data/lib/bioroebe/conversions/dna_to_aminoacid_sequence.rb +9 -3
  134. data/lib/bioroebe/count/count_amount_of_aminoacids.rb +11 -10
  135. data/lib/bioroebe/count/count_amount_of_nucleotides.rb +1 -1
  136. data/lib/bioroebe/count/count_at.rb +2 -1
  137. data/lib/bioroebe/databases/download_taxonomy_database.rb +1 -1
  138. data/lib/bioroebe/dotplots/advanced_dotplot.rb +2 -2
  139. data/lib/bioroebe/electron_microscopy/coordinate_analyzer.rb +2 -2
  140. data/lib/bioroebe/electron_microscopy/fix_pos_file.rb +2 -2
  141. data/lib/bioroebe/electron_microscopy/flipy.rb +2 -2
  142. data/lib/bioroebe/electron_microscopy/generate_em2em_file.rb +3 -11
  143. data/lib/bioroebe/electron_microscopy/parse_coordinates.rb +6 -6
  144. data/lib/bioroebe/electron_microscopy/read_file_xmd.rb +6 -6
  145. data/lib/bioroebe/electron_microscopy/simple_star_file_generator.rb +2 -2
  146. data/lib/bioroebe/enzymes/has_this_restriction_enzyme.rb +1 -1
  147. data/lib/bioroebe/enzymes/restriction_enzyme.rb +1 -1
  148. data/lib/bioroebe/enzymes/restriction_enzymes/statistics.rb +4 -3
  149. data/lib/bioroebe/enzymes/restriction_enzymes_file.rb +1 -1
  150. data/lib/bioroebe/enzymes/return_sequence_that_is_cut_via_restriction_enzyme.rb +4 -3
  151. data/lib/bioroebe/enzymes/show_restriction_enzymes.rb +3 -3
  152. data/lib/bioroebe/ext/main.cpp +0 -1
  153. data/lib/bioroebe/fasta_and_fastq/autocorrect_the_name_of_this_fasta_file.rb +3 -3
  154. data/lib/bioroebe/fasta_and_fastq/compact_fasta_file/compact_fasta_file.rb +1 -1
  155. data/lib/bioroebe/fasta_and_fastq/display_how_many_fasta_entries_are_in_this_directory.rb +1 -1
  156. data/lib/bioroebe/fasta_and_fastq/download_fasta.rb +8 -14
  157. data/lib/bioroebe/fasta_and_fastq/fasta_defline/fasta_defline.rb +1 -1
  158. data/lib/bioroebe/fasta_and_fastq/fasta_to_yaml/fasta_to_yaml.rb +1 -1
  159. data/lib/bioroebe/fasta_and_fastq/fastq_format_explainer.rb +1 -1
  160. data/lib/bioroebe/fasta_and_fastq/length_modifier/length_modifier.rb +1 -1
  161. data/lib/bioroebe/fasta_and_fastq/parse_fasta/parse_fasta.rb +37 -11
  162. data/lib/bioroebe/fasta_and_fastq/parse_fastq/parse_fastq.rb +2 -2
  163. data/lib/bioroebe/fasta_and_fastq/return_fasta_subsection_of_this_file.rb +1 -1
  164. data/lib/bioroebe/fasta_and_fastq/show_fasta_headers.rb +5 -13
  165. data/lib/bioroebe/fasta_and_fastq/show_fasta_statistics.rb +1 -1
  166. data/lib/bioroebe/fasta_and_fastq/simplify_fasta_header/simplify_fasta_header.rb +1 -1
  167. data/lib/bioroebe/fasta_and_fastq/split_this_fasta_file_into_chromosomes/reset.rb +3 -6
  168. data/lib/bioroebe/fasta_and_fastq/split_this_fasta_file_into_chromosomes/split_this_fasta_file_into_chromosomes.rb +3 -3
  169. data/lib/bioroebe/genbank/genbank_flat_file_format_generator.rb +20 -11
  170. data/lib/bioroebe/genome/genome.rb +1 -1
  171. data/lib/bioroebe/genomes/genome_pattern.rb +17 -16
  172. data/lib/bioroebe/genomes/genome_retriever.rb +4 -2
  173. data/lib/bioroebe/gui/experimental/snapgene/snapgene.rb +10 -13
  174. data/lib/bioroebe/gui/universal_widgets/alignment/alignment.rb +557 -0
  175. data/lib/bioroebe/gui/{gtk3 → universal_widgets}/aminoacid_composition/aminoacid_composition.rb +498 -198
  176. data/lib/bioroebe/gui/universal_widgets/anti_sense_strand/anti_sense_strand.rb +665 -0
  177. data/lib/bioroebe/gui/universal_widgets/blosum_matrix_viewer/blosum_matrix_viewer.rb +329 -0
  178. data/lib/bioroebe/gui/universal_widgets/calculate_cell_numbers_of_bacteria/calculate_cell_numbers_of_bacteria.rb +423 -0
  179. data/lib/bioroebe/gui/{gtk3 → universal_widgets}/controller/controller.rb +170 -118
  180. data/lib/bioroebe/gui/{gtk3 → universal_widgets}/dna_to_aminoacid_widget/dna_to_aminoacid_widget.rb +277 -215
  181. data/lib/bioroebe/gui/{shared_code/dna_to_reverse_complement_widget/dna_to_reverse_complement_widget_module.rb → universal_widgets/dna_to_reverse_complement_widget/dna_to_reverse_complement_widget.rb} +297 -107
  182. data/lib/bioroebe/gui/universal_widgets/fasta_table_widget/fasta_table_widget.rb +643 -0
  183. data/lib/bioroebe/gui/{gtk3 → universal_widgets}/format_converter/format_converter.rb +236 -164
  184. data/lib/bioroebe/gui/universal_widgets/gene/gene.rb +278 -0
  185. data/lib/bioroebe/gui/universal_widgets/hamming_distance/hamming_distance.rb +646 -0
  186. data/lib/bioroebe/gui/{shared_code/levensthein_distance/levensthein_distance_module.rb → universal_widgets/levensthein_distance/levensthein_distance.rb} +313 -88
  187. data/lib/bioroebe/gui/{gtk3 → universal_widgets}/nucleotide_analyser/nucleotide_analyser.rb +281 -189
  188. data/lib/bioroebe/gui/{gtk3 → universal_widgets}/parse_pdb_file/parse_pdb_file.rb +265 -149
  189. data/lib/bioroebe/gui/{gtk3 → universal_widgets}/primer_design_widget/primer_design_widget.rb +337 -263
  190. data/lib/bioroebe/gui/universal_widgets/protein_to_DNA/protein_to_DNA.rb +408 -0
  191. data/lib/bioroebe/gui/{gtk3 → universal_widgets}/random_sequence/random_sequence.rb +245 -187
  192. data/lib/bioroebe/gui/{gtk3 → universal_widgets}/restriction_enzymes/restriction_enzymes.rb +207 -137
  193. data/lib/bioroebe/gui/universal_widgets/shell/shell.rb +288 -0
  194. data/lib/bioroebe/gui/{gtk3/show_codon_table/misc.rb → universal_widgets/show_codon_table/show_codon_table.rb} +290 -110
  195. data/lib/bioroebe/gui/{shared_code/show_codon_usage/show_codon_usage_module.rb → universal_widgets/show_codon_usage/show_codon_usage.rb} +228 -47
  196. data/lib/bioroebe/gui/{gtk3 → universal_widgets}/sizeseq/sizeseq.rb +151 -69
  197. data/lib/bioroebe/gui/{gtk3 → universal_widgets}/three_to_one/three_to_one.rb +190 -127
  198. data/lib/bioroebe/gui/{gtk3 → universal_widgets}/www_finder/www_finder.rb +211 -152
  199. data/lib/bioroebe/images/images.html +953 -1170
  200. data/lib/bioroebe/images/misc/README.md +6 -0
  201. data/lib/bioroebe/images/misc/activation.avif +0 -0
  202. data/lib/bioroebe/images/misc/inhibition.avif +0 -0
  203. data/lib/bioroebe/images/misc/small_virus_logo.avif +0 -0
  204. data/lib/bioroebe/{constants/base_directory.rb → log_directory/log_directory.rb} +79 -59
  205. data/lib/bioroebe/matplotlib/matplotlib_generator.rb +1 -1
  206. data/lib/bioroebe/misc/quiz/three_letter_to_aminoacid.rb +1 -1
  207. data/lib/bioroebe/misc/ruler.rb +5 -5
  208. data/lib/bioroebe/misc/useful_formulas.rb +3 -3
  209. data/lib/bioroebe/ncbi/efetch.rb +1 -2
  210. data/lib/bioroebe/ngs/phred_quality_score_table.rb +3 -3
  211. data/lib/bioroebe/nucleotides/complementary_dna_strand.rb +3 -6
  212. data/lib/bioroebe/nucleotides/molecular_weight_of_nucleotides.rb +3 -3
  213. data/lib/bioroebe/nucleotides/most_likely_nucleotide_sequence_for_this_aminoacid_sequence.rb +6 -10
  214. data/lib/bioroebe/nucleotides/{show_nucleotide_sequence.rb → show_nucleotide_sequence/show_nucleotide_sequence.rb} +377 -255
  215. data/lib/bioroebe/palindromes/palindrome_2D_structure.rb +1 -1
  216. data/lib/bioroebe/palindromes/palindrome_finder.rb +1 -1
  217. data/lib/bioroebe/palindromes/palindrome_generator.rb +2 -10
  218. data/lib/bioroebe/parsers/biolang_parser.rb +1 -1
  219. data/lib/bioroebe/parsers/blosum_parser.rb +14 -19
  220. data/lib/bioroebe/parsers/genbank_parser.rb +2 -6
  221. data/lib/bioroebe/parsers/gff.rb +9 -9
  222. data/lib/bioroebe/parsers/parse_embl.rb +2 -6
  223. data/lib/bioroebe/parsers/stride_parser.rb +4 -12
  224. data/lib/bioroebe/patterns/analyse_glycosylation_pattern.rb +2 -2
  225. data/lib/bioroebe/patterns/is_this_sequence_a_EGF2_pattern.rb +6 -3
  226. data/lib/bioroebe/patterns/profile_pattern.rb +2 -2
  227. data/lib/bioroebe/patterns/rgg_scanner.rb +4 -2
  228. data/lib/bioroebe/{protein_structure → pdb_and_protein_structure}/alpha_helix.rb +2 -2
  229. data/lib/bioroebe/{pdb → pdb_and_protein_structure}/download_this_pdb.rb +2 -3
  230. data/lib/bioroebe/{pdb → pdb_and_protein_structure}/fetch_fasta_sequence_from_pdb.rb +4 -4
  231. data/lib/bioroebe/{protein_structure → pdb_and_protein_structure}/helical_wheel.rb +2 -2
  232. data/lib/bioroebe/{pdb → pdb_and_protein_structure}/parse_mmCIF_file.rb +1 -1
  233. data/lib/bioroebe/{pdb → pdb_and_protein_structure}/parse_pdb_file.rb +3 -3
  234. data/lib/bioroebe/{pdb → pdb_and_protein_structure}/report_secondary_structures_from_this_pdb_file.rb +3 -3
  235. data/lib/bioroebe/project/project.rb +3 -1
  236. data/lib/bioroebe/raw_sequence/README.md +8 -8
  237. data/lib/bioroebe/raw_sequence/raw_sequence.rb +11 -2
  238. data/lib/bioroebe/regexes/regexes.rb +1 -2
  239. data/lib/bioroebe/requires/commandline_application.rb +3 -1
  240. data/lib/bioroebe/requires/require_all_pdb_files.rb +1 -1
  241. data/lib/bioroebe/requires/require_all_taxonomy_files.rb +1 -1
  242. data/lib/bioroebe/requires/require_all_utility_scripts_files.rb +10 -0
  243. data/lib/bioroebe/requires/require_colours.rb +1 -1
  244. data/lib/bioroebe/requires/require_the_bioroebe_project.rb +5 -7
  245. data/lib/bioroebe/requires/require_the_bioroebe_sinatra_components.rb +1 -1
  246. data/lib/bioroebe/requires/require_the_constants.rb +2 -14
  247. data/lib/bioroebe/requires/require_yaml.rb +7 -5
  248. data/lib/bioroebe/sequence/alignment.rb +1 -1
  249. data/lib/bioroebe/sequence/dna.rb +4 -2
  250. data/lib/bioroebe/sequence/nucleotide_module/nucleotide_module.rb +22 -8
  251. data/lib/bioroebe/sequence/protein.rb +2 -2
  252. data/lib/bioroebe/sequence/reverse_complement.rb +3 -3
  253. data/lib/bioroebe/sequence/rna.rb +9 -8
  254. data/lib/bioroebe/sequence/sequence.rb +3 -3
  255. data/lib/bioroebe/shell/configuration/additionally_set_xorg_buffer.yml +0 -0
  256. data/lib/bioroebe/shell/configuration/may_we_show_the_startup_information.yml +0 -0
  257. data/lib/bioroebe/shell/configuration/upcase_nucleotides.yml +0 -0
  258. data/lib/bioroebe/shell/configuration/use_silent_startup.yml +1 -1
  259. data/lib/bioroebe/shell/help/class.rb +68 -19
  260. data/lib/bioroebe/shell/menu.rb +5244 -5322
  261. data/lib/bioroebe/shell/{readline/readline.rb → readline.rb} +1 -3
  262. data/lib/bioroebe/shell/shell.rb +11240 -453
  263. data/lib/bioroebe/siRNA/siRNA.rb +3 -3
  264. data/lib/bioroebe/{gui/shared_code/blosum_matrix_viewer/blosum_matrix_viewer_module.rb → sinatra/sinatra_interface.rb} +28 -19
  265. data/lib/bioroebe/{www/sinatra/sinatra.rb → sinatra/sinatra_wrapper.rb} +731 -754
  266. data/lib/bioroebe/string_matching/find_longest_substring.rb +2 -10
  267. data/lib/bioroebe/string_matching/find_longest_substring_via_LCS_algorithm.rb +4 -14
  268. data/lib/bioroebe/string_matching/hamming_distance.rb +11 -10
  269. data/lib/bioroebe/string_matching/levensthein.rb +5 -17
  270. data/lib/bioroebe/string_matching/simple_string_comparer.rb +48 -4
  271. data/lib/bioroebe/string_matching/smith_waterman.rb +11 -6
  272. data/lib/bioroebe/svg/glyph.rb +4 -1
  273. data/lib/bioroebe/svg/mini_feature.rb +1 -1
  274. data/lib/bioroebe/svg/page.rb +18 -7
  275. data/lib/bioroebe/svg/svgee.rb +22 -13
  276. data/lib/bioroebe/svg/track.rb +20 -4
  277. data/lib/bioroebe/taxonomy/chart.rb +2 -2
  278. data/lib/bioroebe/taxonomy/class_methods.rb +5 -6
  279. data/lib/bioroebe/taxonomy/constants.rb +1 -1
  280. data/lib/bioroebe/taxonomy/info/info.rb +1 -1
  281. data/lib/bioroebe/taxonomy/info/is_dna.rb +1 -1
  282. data/lib/bioroebe/taxonomy/interactive.rb +1 -2
  283. data/lib/bioroebe/taxonomy/menu.rb +1 -1
  284. data/lib/bioroebe/taxonomy/node.rb +1 -1
  285. data/lib/bioroebe/taxonomy/parse_fasta.rb +4 -2
  286. data/lib/bioroebe/taxonomy/shared.rb +5 -4
  287. data/lib/bioroebe/taxonomy/taxonomy.rb +2 -4
  288. data/lib/bioroebe/toplevel_methods/fasta_and_fastq.rb +3 -45
  289. data/lib/bioroebe/toplevel_methods/{is_on_roebe.rb → roebe.rb} +1 -11
  290. data/lib/bioroebe/toplevel_methods/taxonomy.rb +6 -12
  291. data/lib/bioroebe/toplevel_methods/toplevel_methods.rb +5568 -0
  292. data/lib/bioroebe/utility_scripts/align_open_reading_frames.rb +4 -3
  293. data/lib/bioroebe/utility_scripts/analyse_local_dataset.rb +2 -2
  294. data/lib/bioroebe/utility_scripts/check_for_mismatches/check_for_mismatches.rb +16 -9
  295. data/lib/bioroebe/utility_scripts/compacter/compacter.rb +4 -2
  296. data/lib/bioroebe/utility_scripts/compare_these_two_sequences_via_blosum.rb +119 -0
  297. data/lib/bioroebe/utility_scripts/compseq/compseq.rb +11 -9
  298. data/lib/bioroebe/utility_scripts/{consensus_sequence.rb → consensus_sequence/consensus_sequence.rb} +13 -4
  299. data/lib/bioroebe/utility_scripts/{create_batch_entrez_file.rb → create_batch_entrez_file/create_batch_entrez_file.rb} +5 -5
  300. data/lib/bioroebe/utility_scripts/{determine_antigenic_areas.rb → determine_antigenic_areas/determine_antigenic_areas.rb} +5 -5
  301. data/lib/bioroebe/utility_scripts/{determine_missing_nucleotides_percentage.rb → determine_missing_nucleotides_percentage/determine_missing_nucleotides_percentage.rb} +16 -15
  302. data/lib/bioroebe/utility_scripts/display_open_reading_frames/display_open_reading_frames.rb +7 -7
  303. data/lib/bioroebe/utility_scripts/display_open_reading_frames/misc.rb +1 -1
  304. data/lib/bioroebe/utility_scripts/display_open_reading_frames/report.rb +2 -0
  305. data/lib/bioroebe/utility_scripts/{dot_alignment.rb → dot_alignment/dot_alignment.rb} +3 -3
  306. data/lib/bioroebe/utility_scripts/{download_files_from_rebase.rb → download_files_from_rebase/download_files_from_rebase.rb} +5 -5
  307. data/lib/bioroebe/utility_scripts/fetch_data_from_uniprot/fetch_data_from_uniprot.rb +269 -0
  308. data/lib/bioroebe/utility_scripts/find_gene.rb +4 -2
  309. data/lib/bioroebe/utility_scripts/{mirror_repeat.rb → mirror_repeat/mirror_repeat.rb} +5 -5
  310. data/lib/bioroebe/utility_scripts/move_file_to_its_correct_location.rb +3 -3
  311. data/lib/bioroebe/utility_scripts/{parse_taxonomy.rb → parse_taxonomy/parse_taxonomy.rb} +15 -6
  312. data/lib/bioroebe/utility_scripts/{pathways.rb → pathways/pathways.rb} +4 -3
  313. data/lib/bioroebe/utility_scripts/{permutations.rb → permutations/permutations.rb} +3 -3
  314. data/lib/bioroebe/utility_scripts/punnet/punnet.rb +4 -2
  315. data/lib/bioroebe/utility_scripts/{show_this_dna_sequence.rb → show_this_dna_sequence/show_this_dna_sequence.rb} +1 -1
  316. data/lib/bioroebe/utility_scripts/showorf/showorf.rb +406 -10
  317. data/lib/bioroebe/version/version.rb +2 -2
  318. data/lib/bioroebe/viennarna/rnafold_wrapper.rb +5 -13
  319. data/lib/bioroebe/virus/individual_viruses/README.md +15 -0
  320. data/lib/bioroebe/virus/individual_viruses/tobacco_mosaic_virus.rb +40 -0
  321. data/lib/bioroebe/virus/virus.rb +76 -0
  322. data/lib/bioroebe/www/bioroebe.cgi +4 -3
  323. data/lib/bioroebe/www/embeddable_interface.rb +85 -49
  324. data/lib/bioroebe/yaml/agarose/agarose_concentrations.yml +6 -6
  325. data/lib/bioroebe/yaml/antisense/antisense.yml +2 -0
  326. data/lib/bioroebe/yaml/blosum/blosum50.yml +6 -0
  327. data/lib/bioroebe/yaml/blosum/blosum90.yml +2 -1
  328. data/lib/bioroebe/yaml/chromosomes/chromosome_numbers.yml +2 -2
  329. data/lib/bioroebe/yaml/configuration/temp_dir.yml +1 -1
  330. data/lib/bioroebe/yaml/consensus_sequences/consensus_sequences.yml +1 -0
  331. data/lib/bioroebe/yaml/enzymes/enzyme_classes.yml +7 -6
  332. data/lib/bioroebe/yaml/humans/human_chromosomes.yml +3 -3
  333. data/lib/bioroebe/yaml/mRNA/mRNA.yml +1 -5
  334. data/lib/bioroebe/yaml/nucleotides/abbreviations_for_nucleotides.yml +1 -0
  335. data/lib/bioroebe/yaml/nucleotides/nucleotide_density.yml +2 -1
  336. data/lib/bioroebe/yaml/promoters/35S.yml +3 -1
  337. data/lib/bioroebe/yaml/proteases/proteases.yml +3 -1
  338. data/lib/bioroebe/yaml/proteins/ubiquitin.yml +4 -1
  339. data/lib/bioroebe/yaml/restriction_enzymes/restriction_enzymes.yml +7 -7
  340. data/spec/testing_toplevel_method_editor.rb +1 -1
  341. data/spec/testing_toplevel_method_verbose.rb +1 -1
  342. data/test/testing_dna_to_rna_conversion.rb +1 -1
  343. metadata +127 -235
  344. data/doc/blosum.md +0 -5
  345. data/lib/bioroebe/base/commandline_application/aminoacids.rb +0 -33
  346. data/lib/bioroebe/base/commandline_application/directory.rb +0 -33
  347. data/lib/bioroebe/base/commandline_application/extract.rb +0 -22
  348. data/lib/bioroebe/base/commandline_application/misc.rb +0 -502
  349. data/lib/bioroebe/base/commandline_application/opn.rb +0 -47
  350. data/lib/bioroebe/base/commandline_application/reset.rb +0 -42
  351. data/lib/bioroebe/base/commandline_application/warnings.rb +0 -36
  352. data/lib/bioroebe/base/commandline_application/write_what_into.rb +0 -29
  353. data/lib/bioroebe/base/initialize.rb +0 -18
  354. data/lib/bioroebe/base/misc.rb +0 -129
  355. data/lib/bioroebe/base/namespace.rb +0 -16
  356. data/lib/bioroebe/base/prototype/e_and_ee.rb +0 -24
  357. data/lib/bioroebe/base/prototype/misc.rb +0 -114
  358. data/lib/bioroebe/base/prototype/mkdir.rb +0 -20
  359. data/lib/bioroebe/base/prototype/reset.rb +0 -36
  360. data/lib/bioroebe/colours/misc_colours.rb +0 -80
  361. data/lib/bioroebe/colours/rev.rb +0 -44
  362. data/lib/bioroebe/colours/sdir.rb +0 -21
  363. data/lib/bioroebe/colours/sfancy.rb +0 -21
  364. data/lib/bioroebe/colours/sfile.rb +0 -21
  365. data/lib/bioroebe/colours/simp.rb +0 -21
  366. data/lib/bioroebe/colours/swarn.rb +0 -29
  367. data/lib/bioroebe/constants/aminoacids_and_proteins.rb +0 -147
  368. data/lib/bioroebe/constants/carriage_return.rb +0 -14
  369. data/lib/bioroebe/constants/codon_tables.rb +0 -77
  370. data/lib/bioroebe/constants/database_constants.rb +0 -107
  371. data/lib/bioroebe/constants/files_and_directories.rb +0 -606
  372. data/lib/bioroebe/constants/misc.rb +0 -209
  373. data/lib/bioroebe/constants/newline.rb +0 -14
  374. data/lib/bioroebe/constants/nucleotides.rb +0 -121
  375. data/lib/bioroebe/constants/regex.rb +0 -28
  376. data/lib/bioroebe/constants/roebe.rb +0 -38
  377. data/lib/bioroebe/constants/row_terminator.rb +0 -16
  378. data/lib/bioroebe/constants/tabulator.rb +0 -14
  379. data/lib/bioroebe/constants/unicode.rb +0 -12
  380. data/lib/bioroebe/constants/urls.rb +0 -50
  381. data/lib/bioroebe/gui/gtk +0 -1
  382. data/lib/bioroebe/gui/gtk3/README.md +0 -2
  383. data/lib/bioroebe/gui/gtk3/alignment/alignment.rb +0 -306
  384. data/lib/bioroebe/gui/gtk3/anti_sense_strand/anti_sense_strand.rb +0 -29
  385. data/lib/bioroebe/gui/gtk3/blosum_matrix_viewer/blosum_matrix_viewer.rb +0 -195
  386. data/lib/bioroebe/gui/gtk3/calculate_cell_numbers_of_bacteria/calculate_cell_numbers_of_bacteria.rb +0 -105
  387. data/lib/bioroebe/gui/gtk3/dna_to_reverse_complement_widget/dna_to_reverse_complement_widget.rb +0 -188
  388. data/lib/bioroebe/gui/gtk3/fasta_table_widget/fasta_table_widget.rb +0 -322
  389. data/lib/bioroebe/gui/gtk3/gene/gene.rb +0 -181
  390. data/lib/bioroebe/gui/gtk3/hamming_distance/hamming_distance.rb +0 -383
  391. data/lib/bioroebe/gui/gtk3/levensthein_distance/levensthein_distance.rb +0 -174
  392. data/lib/bioroebe/gui/gtk3/protein_to_DNA/protein_to_DNA.rb +0 -181
  393. data/lib/bioroebe/gui/gtk3/show_codon_table/show_codon_table.rb +0 -101
  394. data/lib/bioroebe/gui/gtk3/show_codon_usage/show_codon_usage.rb +0 -145
  395. data/lib/bioroebe/gui/gtk3/three_to_one/title.rb +0 -23
  396. data/lib/bioroebe/gui/jruby/alignment/alignment.rb +0 -165
  397. data/lib/bioroebe/gui/jruby/aminoacid_composition/aminoacid_composition.rb +0 -166
  398. data/lib/bioroebe/gui/jruby/blosum_matrix_viewer/blosum_matrix_viewer.rb +0 -82
  399. data/lib/bioroebe/gui/libui/README.md +0 -4
  400. data/lib/bioroebe/gui/libui/alignment/alignment.rb +0 -116
  401. data/lib/bioroebe/gui/libui/blosum_matrix_viewer/blosum_matrix_viewer.rb +0 -112
  402. data/lib/bioroebe/gui/libui/calculate_cell_numbers_of_bacteria/calculate_cell_numbers_of_bacteria.rb +0 -60
  403. data/lib/bioroebe/gui/libui/controller/controller.rb +0 -116
  404. data/lib/bioroebe/gui/libui/dna_to_aminoacid_widget/dna_to_aminoacid_widget.rb +0 -161
  405. data/lib/bioroebe/gui/libui/dna_to_reverse_complement_widget/dna_to_reverse_complement_widget.rb +0 -76
  406. data/lib/bioroebe/gui/libui/hamming_distance/hamming_distance.rb +0 -135
  407. data/lib/bioroebe/gui/libui/levensthein_distance/levensthein_distance.rb +0 -118
  408. data/lib/bioroebe/gui/libui/protein_to_DNA/protein_to_DNA.rb +0 -115
  409. data/lib/bioroebe/gui/libui/random_sequence/random_sequence.rb +0 -190
  410. data/lib/bioroebe/gui/libui/show_codon_table/show_codon_table.rb +0 -134
  411. data/lib/bioroebe/gui/libui/show_codon_usage/show_codon_usage.rb +0 -89
  412. data/lib/bioroebe/gui/libui/three_to_one/three_to_one.rb +0 -113
  413. data/lib/bioroebe/gui/shared_code/alignment/alignment_module.rb +0 -102
  414. data/lib/bioroebe/gui/shared_code/aminoacid_composition/aminoacid_composition_module.rb +0 -94
  415. data/lib/bioroebe/gui/shared_code/calculate_cell_numbers_of_bacteria/calculate_cell_numbers_of_bacteria_module.rb +0 -216
  416. data/lib/bioroebe/gui/shared_code/protein_to_DNA/protein_to_DNA_module.rb +0 -192
  417. data/lib/bioroebe/gui/shared_code/show_codon_table/show_codon_table_module.rb +0 -72
  418. data/lib/bioroebe/gui/tk/aminoacid_composition/aminoacid_composition.rb +0 -206
  419. data/lib/bioroebe/gui/tk/blosum_matrix_viewer/blosum_matrix_viewer.rb +0 -140
  420. data/lib/bioroebe/gui/tk/hamming_distance/hamming_distance.rb +0 -262
  421. data/lib/bioroebe/gui/tk/levensthein_distance/levensthein_distance.rb +0 -243
  422. data/lib/bioroebe/gui/tk/three_to_one/three_to_one.rb +0 -199
  423. data/lib/bioroebe/gui/unified_widgets/anti_sense_strand/anti_sense_strand.rb +0 -519
  424. data/lib/bioroebe/shell/colours/colours.rb +0 -235
  425. data/lib/bioroebe/shell/help/help.rb +0 -25
  426. data/lib/bioroebe/shell/misc.rb +0 -10227
  427. data/lib/bioroebe/toplevel_methods/ad_hoc_task.rb +0 -56
  428. data/lib/bioroebe/toplevel_methods/aminoacids_and_proteins.rb +0 -722
  429. data/lib/bioroebe/toplevel_methods/atomic_composition.rb +0 -198
  430. data/lib/bioroebe/toplevel_methods/base_composition.rb +0 -121
  431. data/lib/bioroebe/toplevel_methods/blast.rb +0 -153
  432. data/lib/bioroebe/toplevel_methods/calculate_n50_value.rb +0 -57
  433. data/lib/bioroebe/toplevel_methods/cat.rb +0 -71
  434. data/lib/bioroebe/toplevel_methods/chunked_display.rb +0 -92
  435. data/lib/bioroebe/toplevel_methods/cliner.rb +0 -81
  436. data/lib/bioroebe/toplevel_methods/complement.rb +0 -58
  437. data/lib/bioroebe/toplevel_methods/convert_global_env.rb +0 -39
  438. data/lib/bioroebe/toplevel_methods/databases.rb +0 -73
  439. data/lib/bioroebe/toplevel_methods/delimiter.rb +0 -19
  440. data/lib/bioroebe/toplevel_methods/digest.rb +0 -81
  441. data/lib/bioroebe/toplevel_methods/download_and_fetch_data.rb +0 -146
  442. data/lib/bioroebe/toplevel_methods/e.rb +0 -20
  443. data/lib/bioroebe/toplevel_methods/editor.rb +0 -21
  444. data/lib/bioroebe/toplevel_methods/esystem.rb +0 -22
  445. data/lib/bioroebe/toplevel_methods/exponential_growth.rb +0 -74
  446. data/lib/bioroebe/toplevel_methods/extract.rb +0 -56
  447. data/lib/bioroebe/toplevel_methods/file_and_directory_related_actions.rb +0 -269
  448. data/lib/bioroebe/toplevel_methods/frequencies.rb +0 -99
  449. data/lib/bioroebe/toplevel_methods/hamming_distance.rb +0 -60
  450. data/lib/bioroebe/toplevel_methods/infer.rb +0 -66
  451. data/lib/bioroebe/toplevel_methods/leading_five_prime_and_trailing_three_prime.rb +0 -101
  452. data/lib/bioroebe/toplevel_methods/levensthein.rb +0 -63
  453. data/lib/bioroebe/toplevel_methods/log_directory.rb +0 -109
  454. data/lib/bioroebe/toplevel_methods/longest_common_substring.rb +0 -55
  455. data/lib/bioroebe/toplevel_methods/map_ncbi_entry_to_eutils_id.rb +0 -88
  456. data/lib/bioroebe/toplevel_methods/matches.rb +0 -259
  457. data/lib/bioroebe/toplevel_methods/misc.rb +0 -596
  458. data/lib/bioroebe/toplevel_methods/nucleotides.rb +0 -787
  459. data/lib/bioroebe/toplevel_methods/number_of_clones.rb +0 -63
  460. data/lib/bioroebe/toplevel_methods/open_in_browser.rb +0 -79
  461. data/lib/bioroebe/toplevel_methods/open_reading_frames.rb +0 -236
  462. data/lib/bioroebe/toplevel_methods/opn.rb +0 -34
  463. data/lib/bioroebe/toplevel_methods/palindromes.rb +0 -155
  464. data/lib/bioroebe/toplevel_methods/parse.rb +0 -59
  465. data/lib/bioroebe/toplevel_methods/phred_error_probability.rb +0 -68
  466. data/lib/bioroebe/toplevel_methods/rds.rb +0 -24
  467. data/lib/bioroebe/toplevel_methods/remove.rb +0 -86
  468. data/lib/bioroebe/toplevel_methods/return_source_code_of_this_method.rb +0 -35
  469. data/lib/bioroebe/toplevel_methods/return_subsequence_based_on_indices.rb +0 -68
  470. data/lib/bioroebe/toplevel_methods/rna_splicing.rb +0 -73
  471. data/lib/bioroebe/toplevel_methods/rnalfold.rb +0 -69
  472. data/lib/bioroebe/toplevel_methods/searching_and_finding.rb +0 -116
  473. data/lib/bioroebe/toplevel_methods/shuffleseq.rb +0 -37
  474. data/lib/bioroebe/toplevel_methods/statistics.rb +0 -53
  475. data/lib/bioroebe/toplevel_methods/sum_of_odd_integers.rb +0 -62
  476. data/lib/bioroebe/toplevel_methods/three_delimiter.rb +0 -34
  477. data/lib/bioroebe/toplevel_methods/time_and_date.rb +0 -53
  478. data/lib/bioroebe/toplevel_methods/to_camelcase.rb +0 -31
  479. data/lib/bioroebe/toplevel_methods/truncate.rb +0 -48
  480. data/lib/bioroebe/toplevel_methods/url.rb +0 -36
  481. data/lib/bioroebe/toplevel_methods/verbose.rb +0 -59
  482. data/lib/bioroebe/utility_scripts/showorf/constants.rb +0 -31
  483. data/lib/bioroebe/utility_scripts/showorf/help.rb +0 -33
  484. data/lib/bioroebe/utility_scripts/showorf/initialize.rb +0 -52
  485. data/lib/bioroebe/utility_scripts/showorf/menu.rb +0 -68
  486. data/lib/bioroebe/utility_scripts/showorf/reset.rb +0 -36
  487. data/lib/bioroebe/utility_scripts/showorf/run.rb +0 -152
  488. data/lib/bioroebe/utility_scripts/showorf/show.rb +0 -97
  489. /data/doc/{german_names_for_the_aminoacids.md → german_names_for_the_aminoacids/german_names_for_the_aminoacids.md} +0 -0
  490. /data/doc/{pdb_ATOM_entry.md → pdb_ATOM_entry/pdb_ATOM_entry.md} +0 -0
  491. /data/doc/{resources.md → resources/resources.md} +0 -0
  492. /data/lib/bioroebe/gui/{gtk3 → universal_widgets}/aminoacid_composition/customized_dialog.rb +0 -0
  493. /data/lib/bioroebe/gui/{gtk3 → universal_widgets}/anti_sense_strand/anti_sense_strand.config +0 -0
  494. /data/lib/bioroebe/gui/{gtk3 → universal_widgets}/calculate_cell_numbers_of_bacteria/calculate_cell_numbers_of_bacteria.config +0 -0
  495. /data/lib/bioroebe/gui/{gtk3 → universal_widgets}/dna_to_reverse_complement_widget/dna_to_reverse_complement_widget.config +0 -0
  496. /data/lib/bioroebe/gui/{gtk3 → universal_widgets}/hamming_distance/hamming_distance.config +0 -0
  497. /data/lib/bioroebe/gui/{gtk3 → universal_widgets}/levensthein_distance/levensthein_distance.config +0 -0
  498. /data/lib/bioroebe/gui/{gtk3 → universal_widgets}/protein_to_DNA/protein_to_DNA.config +0 -0
  499. /data/lib/bioroebe/gui/{gtk3 → universal_widgets}/restriction_enzymes/restriction_enzymes.config +0 -0
  500. /data/lib/bioroebe/gui/{gtk3 → universal_widgets}/www_finder/www_finder.config +0 -0
  501. /data/lib/bioroebe/yaml/{base_composition_of_dna.yml → base_composition_of_dna/base_composition_of_dna.yml} +0 -0
  502. /data/lib/bioroebe/yaml/{nuclear_localization_sequences.yml → nuclear_localization_sequences/nuclear_localization_sequences.yml} +0 -0
  503. /data/lib/bioroebe/yaml/{talens.yml → talens/talens.yml} +0 -0
@@ -2,18 +2,19 @@
2
2
  # Encoding: UTF-8
3
3
  # frozen_string_literal: true
4
4
  # =========================================================================== #
5
- # require 'bioroebe/www/sinatra/sinatra.rb'
5
+ # require 'bioroebe/sinatra/sinatra_wrapper.rb'
6
+ # Bioroebe.start_sinatra_interface
6
7
  # =========================================================================== #
8
+ require 'bioroebe/sinatra/sinatra_interface.rb'
9
+
10
+ module Bioroebe
11
+
7
12
  begin
8
13
  require 'cyberweb/and_sinatra_base.rb'
9
- require 'sinatra'
10
14
  rescue LoadError; end
11
15
 
12
- module Bioroebe
13
-
14
- class Sinatra < ::Sinatra::Base
16
+ class SinatraWrapper < ::Sinatra::Base # === Bioroebe::SinatraWrapper
15
17
 
16
- require 'bioroebe/www/embeddable_interface.rb'
17
18
  set :port, ::Bioroebe::EmbeddableInterface::USE_THIS_PORT
18
19
 
19
20
  # ========================================================================= #
@@ -22,7 +23,7 @@ class Sinatra < ::Sinatra::Base
22
23
  @embeddable_interface = Bioroebe.embeddable_interface
23
24
 
24
25
  # ========================================================================= #
25
- # === Bioroebe::Sinatra.embeddable_interface?
26
+ # === Bioroebe::SinatraWrapper.embeddable_interface?
26
27
  # ========================================================================= #
27
28
  def self.embeddable_interface?
28
29
  @embeddable_interface
@@ -32,366 +33,282 @@ class Sinatra < ::Sinatra::Base
32
33
  # === embeddable_interface?
33
34
  # ========================================================================= #
34
35
  def embeddable_interface?
35
- ::Bioroebe::Sinatra.embeddable_interface?
36
+ ::Bioroebe::SinatraWrapper.embeddable_interface?
36
37
  end
37
38
 
39
+ # ========================================================================= #
40
+ # === LOCALHOST_TO_USE
41
+ # ========================================================================= #
42
+ LOCALHOST_TO_USE = ::Bioroebe::EmbeddableInterface.localhost_to_use?
43
+
38
44
  # ========================================================================= #
39
45
  # === initialize
40
46
  # ========================================================================= #
41
47
  def initialize
42
48
  super()
43
49
  reset
44
- target = Bioroebe::EmbeddableInterface.localhost_to_use?
45
- use_this_port = ::Bioroebe::EmbeddableInterface::USE_THIS_PORT
46
- Cyberweb.try_to_open_this_URL_via_the_browser(target, use_this_port) { :be_quiet }
50
+ Cyberweb.try_to_open_this_URL_via_the_browser(
51
+ LOCALHOST_TO_USE,
52
+ ::Bioroebe::EmbeddableInterface::USE_THIS_PORT
53
+ ) { :be_quiet }
47
54
  end
48
55
 
49
56
  # ========================================================================= #
50
- # === p
57
+ # === / (main tag)
58
+ #
59
+ # This is the root tag, the root of our web-application.
51
60
  # ========================================================================= #
52
- def p(
53
- i, hash = {}
61
+ get('/') {
62
+ body = embeddable_interface?.return_root_string # Obtain the body-String here.
63
+ Cyberweb.html_template(
64
+ title: 'Bioroebe Web-API',
65
+ body: body
54
66
  )
55
- return HtmlTags.p(i, hash)
67
+ }
68
+
69
+ # ========================================================================= #
70
+ # === reset (reset tag)
71
+ # ========================================================================= #
72
+ def reset
56
73
  end
57
74
 
58
75
  # ========================================================================= #
59
- # === Convert into DNA (2 tag, second entry, reverse_complement tag)
76
+ # === Query how many stop codons are in a given DNA sequence
77
+ #
78
+ # This method will determine how many stop codons are in the given
79
+ # sequence.
80
+ #
81
+ # http://localhost:4568/n_stop_codons_in_this_sequence
82
+ #
83
+ # Example:
84
+ #
85
+ # http://localhost:4568/n_stop_codons_in_this_sequence/ATGCUUUUUUUUUTAG
86
+ #
87
+ # ========================================================================= #
88
+ %w(
89
+ /n_stop_codons_in_this_sequence/*
90
+ /n_stop/*
91
+ /nstop/*
92
+ ).each {|entry|
93
+ get(entry) {
94
+ the_params = params[:splat]
95
+ if the_params.is_a? Array
96
+ the_params = the_params.join(' ')
97
+ end
98
+ if params.has_key? 'user_input'
99
+ the_params = params['user_input']
100
+ end
101
+ the_params = the_params.strip.upcase if the_params
102
+ the_result = ::Bioroebe.return_n_stop_codons_in_this_sequence(the_params)
103
+ if the_params.empty?
104
+ the_result = return_intro_for_n_stop_codons_in_this_sequence+
105
+ p(
106
+ '<b> Please input a DNA sequence which will be '\
107
+ 'investigated next.</b>'
108
+ )+
109
+ return_paragraph_of_hyperlinks
110
+ else
111
+ the_result = return_intro_for_n_stop_codons_in_this_sequence+
112
+ p('This sequence contains <b style="font-size: larger; color: blueviolet">'+
113
+ the_result.to_s+'</b> stop '\
114
+ 'codons.'
115
+ )+
116
+ p(
117
+ '(The <b>input-sequence</b> was <b style="color: darkgreen">'+
118
+ the_params.to_s+'</b>)'
119
+ )
120
+ end
121
+ the_result << return_form_for_n_stop_codons_in_this_sequence(entry.delete('*'))
122
+ the_result << hyperlinks_paragraph
123
+ the_result
124
+ }
125
+ }
126
+
127
+ # ========================================================================= #
128
+ # === /palindromes
129
+ #
130
+ # http://localhost:4568/palindromes
131
+ # ========================================================================= #
132
+ Bioroebe::EmbeddableInterface::ARRAY_FOR_PALINDROMES.each {|target|
133
+ get(target) {
134
+ embeddable_interface?.return_header_for_palindromes+
135
+ HtmlTags.p(
136
+ 'Input how many nucleotides shall be part of '\
137
+ 'a palindrome (input an even number)'
138
+ )+
139
+ embeddable_interface?.return_form_for_palindromes_action+
140
+ embeddable_interface?.footer
141
+ }
142
+ }
143
+
144
+ # ========================================================================= #
145
+ # http://localhost:4568/random_aminoacids_source
146
+ # ========================================================================= #
147
+ ['/random_aminoacids_source'].each {|target|
148
+ get(target) {
149
+ body = HtmlTags.p('The source is:')+
150
+ '<pre>'+
151
+ ::Bioroebe.return_source_code_of_this_method(method(:random_aminoacids))+
152
+ '</pre>'+
153
+ footer
154
+ Cyberweb.html_template(
155
+ title: 'Source code to random_aminoacids()',
156
+ body: body
157
+ )
158
+ }
159
+ }
160
+
161
+ # ========================================================================= #
162
+ # === not_found
163
+ # ========================================================================= #
164
+ not_found {
165
+ Cyberweb.html_template(
166
+ title: 'API was not found',
167
+ body: p('This particular <b>API</b> was not found.')+
168
+ p('You may try any of the following variants instead:')+
169
+ embeddable_interface?.return_index_of_hyperlinks
170
+ ).to_s
171
+ }
172
+
173
+ # ========================================================================= #
174
+ # === Convert into a chunked display
60
175
  #
61
176
  # This method will convert RNA into DNA.
62
177
  #
63
- # http://localhost:4568/reverse_complement
178
+ # http://localhost:4568/chunked
64
179
  #
65
180
  # Example:
66
181
  #
67
- # http://localhost:4568/reverse_complement/ATGCUUUUUUUUUU
182
+ # http://localhost:4568/chunked/ATGCUUUUUUUUUU
68
183
  #
69
184
  # ========================================================================= #
70
- get('/reverse_complement/*') {
185
+ Bioroebe::EmbeddableInterface::ARRAY_FOR_CHUNKED_DISPLAY.each {|target|
186
+ get(target+'/*') {
187
+ the_params = params[:splat]
188
+ if the_params.is_a? Array
189
+ the_params = the_params.join(' ')
190
+ end
191
+ if params.has_key? 'user_input'
192
+ the_params = params['user_input']
193
+ end
194
+ the_params = the_params.strip.upcase if the_params
195
+ the_result = ::Bioroebe.chunked_display(the_params)
196
+ if the_params.empty?
197
+ the_result = p(
198
+ '<b> Please input a DNA sequence</b>'
199
+ )+
200
+ return_paragraph_of_hyperlinks
201
+ else
202
+ the_result = p('Converted into a chunked display:')+
203
+ HtmlTags.pre(
204
+ '<b>'+the_result+'</b>',
205
+ css_style: 'color: darkblue; margin:1em; font-size: larger;'
206
+ )+
207
+ return_paragraph_of_hyperlinks
208
+ end
209
+ Cyberweb.html_template(
210
+ title: 'To chunked display',
211
+ body: the_result
212
+ )
213
+ }
214
+ }
215
+
216
+ # ========================================================================= #
217
+ # === Codon Frequencies
218
+ #
219
+ # Example:
220
+ #
221
+ # http://localhost:4568/frequency_per_thousand/ATGCUUUUUUUUUU
222
+ #
223
+ # ========================================================================= #
224
+ get('/frequency_per_thousand/*') {
71
225
  the_params = params[:splat]
72
- if the_params.is_a? Array
73
- the_params = the_params.join(' ')
74
- end
75
- if params.has_key? 'user_input'
76
- the_params = params['user_input']
77
- end
226
+ the_params = the_params.join(' ') if the_params.is_a? Array
227
+ the_params = params['user_input'] if params.has_key? 'user_input'
78
228
  the_params = the_params.strip.upcase if the_params
79
- if the_params.is_a? Array
80
- the_params = the_params.flatten.first
81
- end
82
- the_reverse_complement = ::Bioroebe.reverse_complement(the_params)
83
- if the_reverse_complement.is_a? Array
84
- the_reverse_complement = the_reverse_complement.first.to_s
85
- end
229
+ the_params = the_params.flatten.first if the_params.is_a? Array
86
230
  the_result = ''.dup
87
231
  if the_params.empty?
88
232
  the_result << return_intro_for_reverse_complement_conversion+
89
233
  p(
90
- '<b> Please input a DNA sequence which will be '\
91
- 'reverse-complemented into DNA.</b>'
234
+ '<b>Please input a DNA sequence.</b>'
92
235
  )+
93
236
  return_paragraph_of_hyperlinks
94
237
  else
95
238
  _ = embeddable_interface?.return_intro_for_reverse_complement_conversion
96
- the_result << _+p(
97
- "The reverse complement of <b>5'-#{the_params.to_s}</b> is:"
98
- )
99
- the_result << p(
100
- "<b>5'-#{the_reverse_complement}</b>",
101
- css_style: 'margin:1em; font-size: larger; color: blueviolet'
239
+ the_result << HtmlTags.pre(
240
+ Bioroebe.frequency_per_thousand(the_params)
102
241
  )
103
242
  end
104
- the_result << embeddable_interface?.return_form_for_reverse_complement_action
243
+ the_result << embeddable_interface?.return_form_for_codon_frequency_of_this_string
105
244
  the_result << embeddable_interface?.hyperlinks_paragraph
106
245
  the_result
107
246
  }
108
247
 
109
248
  # ========================================================================= #
110
- # http://localhost:4568/to_dna_source
249
+ # === chunked_display
250
+ #
251
+ # http://localhost:4568/chunked_display
252
+ # http://localhost:4568/chunked
253
+ # http://localhost:4568/upcase
111
254
  # ========================================================================= #
112
- get([
113
- '/to_dna_source',
114
- '/to_aa_source'
115
- ]){
116
- sanitized_URL_part = request.path_info.to_s.sub('_source','').
117
- delete('/').to_sym
118
- file, line_number = ::Bioroebe.method(sanitized_URL_part).source_location
119
- if File.exist? file
120
- readlines = File.readlines(file)
121
- source_code = readlines[(line_number - 1) .. -1].join
122
- Cyberweb::HtmlTemplate[
123
- title: sanitized_URL_part.to_s+' source code',
124
- body: embeddable_interface?.return_intro_for_to_dna_conversion+
125
- p(
126
- 'The source code for the <b>/'+sanitized_URL_part.to_s+
127
- '</b> functionality is: '
128
- )+
129
- '<pre style="color: darkblue; margin-left:2em; font-weight: bold">'+
130
- source_code+
131
- '</pre>'+
132
- embeddable_interface?.hyperlink_paragraph
133
- ].to_s
134
- else
135
- "Can not read the file's content."
136
- end
255
+ Bioroebe::EmbeddableInterface::ARRAY_FOR_CHUNKED_DISPLAY.each {|target|
256
+ get(target) {
257
+ embeddable_interface?.return_header_to_chunked_display+
258
+ embeddable_interface?.footer
259
+ }
137
260
  }
138
261
 
139
262
  # =========================================================================== #
140
- # Example:
263
+ # === /to_dna
141
264
  #
142
- # http://localhost:4568/shuffleseq
265
+ # Usage Examples:
266
+ #
267
+ # http://localhost:4568/to_dna
268
+ # http://localhost:4568/to_dna/AGUCGAUCGUAUGCAGUCAGUCA
143
269
  #
144
270
  # =========================================================================== #
145
- get('/shuffleseq'){
146
- embeddable_interface?.method_shuffleseq
271
+ get('/to_dna'){
272
+ embeddable_interface?.return_sinatra_to_dna
147
273
  }
148
274
 
149
275
  # ========================================================================= #
150
- # === /shuffleseq
151
- #
152
- # http://localhost:4568/shuffleseq
276
+ # http://localhost:4568/to_aa
277
+ # http://localhost:4568/to_aminoacids
153
278
  # ========================================================================= #
154
- ['/shuffleseq'].each {|target|
279
+ Bioroebe::EmbeddableInterface::ARRAY_FOR_TO_AMINOACIDS_CONVERSION.each {|target|
155
280
  get(target) {
156
- Cyberweb::HtmlTemplate[
157
- title: 'Shuffleseq - Shuffle a sequence',
158
- body: '<pre>'+
159
- ::Bioroebe.shuffleseq(method(:reverse_complement))+
160
- '</pre>'+
161
- footer
162
- ].to_s
281
+ Cyberweb.html_template(
282
+ title: 'To aminoacid conversion',
283
+ body: return_header_to_aminoacid_conversion+
284
+ return_explanation_of_how_to_use_the_aminoacid_conversion+
285
+ return_form_for_to_aa_action+
286
+ footer
287
+ ).to_s
163
288
  }
164
289
  }
165
290
 
166
291
  # ========================================================================= #
167
- # === shuffleseq
292
+ # === /mirror_source
293
+ #
294
+ # http://localhost:4568/mirror_source
168
295
  # ========================================================================= #
169
- get('/shuffleseq/*') {
170
- the_params = params[:splat]
171
- if the_params.is_a? Array
172
- the_params = the_params.join(' ')
173
- end
174
- the_params = the_params.dup
175
- if the_params
176
- the_params = the_params.strip.upcase
177
- end
178
- the_result = ::Bioroebe.shuffleseq(the_params)
179
- body = embeddable_interface?.return_intro_for_shuffleseq.dup
180
- if the_params.empty?
181
- body <<
182
- p(
183
- '<b> Please input a DNA sequence.</b>'
184
- )+
185
- return_paragraph_of_hyperlinks
186
- else
187
- body <<
188
- HtmlTags.p(
189
- 'The shuffled sequence of <b>'+the_params.to_s+'</b> is:'
190
- )+
191
- HtmlTags.p(
192
- '<b>'+the_result.to_s+'</b>',
193
- css_style: 'margin:1em; font-size: larger; color: blueviolet'
194
- )
195
- end
196
- body << embeddable_interface?.return_form_for_shuffleseq_action
197
- body << embeddable_interface?.hyperlinks_paragraph
198
- Cyberweb::HtmlTemplate[
199
- title: 'Shuffleseq - Shuffle a sequence',
200
- body: body
201
- ].to_s
202
- }
203
-
204
- get('/test') {
205
- return_index_of_hyperlinks
206
- }
207
-
208
- # ========================================================================= #
209
- # === Bioroebe::Sinatra.e
210
- # ========================================================================= #
211
- def self.e(i = '')
212
- ::Bioroebe.e(i)
213
- end
214
-
215
- # ========================================================================= #
216
- # === Bioroebe::Sinatra.erev
217
- # ========================================================================= #
218
- def self.erev(i = '')
219
- ::Bioroebe.erev(i)
220
- end
221
-
222
- # ========================================================================= #
223
- # === Bioroebe::Sinatra.start_sinatra_interface
224
- #
225
- # This method can be used to start the sinatra interface.
226
- # ========================================================================= #
227
- def self.start_sinatra_interface
228
- erev 'Trying to start the sinatra-interface of Bioroebe next.'
229
- e
230
- erev 'This should use the following URL:'
231
- e
232
- erev " #{sfancy(Bioroebe::EmbeddableInterface.localhost_to_use?)}"
233
- e
234
- ::Bioroebe::Sinatra.run!
235
- end
236
-
237
- # ========================================================================= #
238
- # === Bioroebe::Sinatra.sfancy
239
- # ========================================================================= #
240
- def self.sfancy(i = '')
241
- ::Bioroebe.sfancy(i)
242
- end
243
-
244
- # ========================================================================= #
245
- # http://localhost:4568/reverse_complement_source
246
- # ========================================================================= #
247
- ['/reverse_complement_source'].each {|target|
248
- get(target) {
249
- body = HtmlTags.p('The source is:')+
250
- '<pre>'+
251
- ::Bioroebe.return_source_code_of_this_method(method(:reverse_complement))+
252
- '</pre>'+
253
- footer
254
- Cyberweb::HtmlTemplate[
255
- title: 'Bioroebe Web-API',
256
- body: body
257
- ].to_s
258
- }
259
- }
260
-
261
- # =========================================================================== #
262
- # Example:
263
- #
264
- # http://localhost:4568/reverse_complement
265
- #
266
- # =========================================================================== #
267
- get('/reverse_complement'){
268
- embeddable_interface?.method_reverse_complement
269
- }
270
-
271
- # =========================================================================== #
272
- # Example:
273
- #
274
- # http://localhost:4568/n_stop_codons_in_this_sequence
275
- # http://localhost:4568/n_stop
276
- #
277
- # =========================================================================== #
278
- %w(
279
- /n_stop_codons_in_this_sequence
280
- /n_stop
281
- /nstop
282
- ).each {|entry|
283
- get(entry){
284
- embeddable_interface?.return_intro_for_n_stop_codons_in_this_sequence+
285
- p(
286
- 'This API will return how many stop codons can be '\
287
- 'found in a given sequence.<br>'
288
- )+
296
+ get('/mirror_source'){
297
+ file, line_number = ::Bioroebe.method(:mirror_repeat).source_location
298
+ if File.exist? file
299
+ readlines = File.readlines(file)
300
+ source_code = readlines[(line_number - 1) .. -1].join
301
+ embeddable_interface?.return_intro_for_mirror_repeat_conversion+
289
302
  p(
290
- 'Simply input the nucleotide String, such as "ATGCTTTAG", '\
291
- 'without the "" quotes.<br><br>'
292
- )+
293
- embeddable_interface?.return_form_for_n_stop_codons_in_this_sequence(entry)+
294
- embeddable_interface?.hyperlink_paragraph
295
- }
296
- }
297
-
298
- # ========================================================================= #
299
- # === /palindromes
300
- #
301
- # http://localhost:4568/palindromes
302
- # ========================================================================= #
303
- Bioroebe::EmbeddableInterface::ARRAY_FOR_PALINDROMES.each {|target|
304
- get(target) {
305
- embeddable_interface?.return_header_for_palindromes+
306
- HtmlTags.p(
307
- 'Input how many nucleotides shall be part of '\
308
- 'a palindrome (input an even number)'
303
+ 'The source code for the <b>/mirror</b> functionality is: '
309
304
  )+
310
- embeddable_interface?.return_form_for_palindromes_action+
311
- embeddable_interface?.footer
312
- }
313
- }
314
-
315
- # ========================================================================= #
316
- # === reset (reset tag)
317
- # ========================================================================= #
318
- def reset
319
- end
320
-
321
- # ========================================================================= #
322
- # === view
323
- #
324
- # http://localhost:4568/view
325
- # ========================================================================= #
326
- get('/view') { # view tag
327
- embeddable_interface?.return_view_string
328
- }
329
-
330
- # ========================================================================= #
331
- # === not_found
332
- # ========================================================================= #
333
- not_found {
334
- Cyberweb::HtmlTemplate[
335
- title: 'API was not found',
336
- body: HtmlTags.p('This particular <b>API</b> was not found.')+
337
- HtmlTags.p('You may try any of the following variants instead:')+
338
- embeddable_interface?.return_index_of_hyperlinks
339
- ].to_s
340
- }
341
- # ========================================================================= #
342
- # http://localhost:4568/random_aminoacids_source
343
- # ========================================================================= #
344
- ['/random_aminoacids_source'].each {|target|
345
- get(target) {
346
- body = HtmlTags.p('The source is:')+
347
- '<pre>'+
348
- ::Bioroebe.return_source_code_of_this_method(method(:random_aminoacids))+
349
- '</pre>'+
350
- footer
351
- Cyberweb::HtmlTemplate[
352
- title: 'Source code to random_aminoacids()',
353
- body: body
354
- ].to_s
355
- }
356
- }
357
-
358
- # ========================================================================= #
359
- # http://localhost:4568/random_aminoacids/33
360
- # ========================================================================= #
361
- ['/random_aminoacids/*'].each {|target|
362
- get(target) {
363
- the_params = params[:splat].join(' ').strip.upcase
364
- if the_params.empty?
365
- return_header_random_aminoacids+
366
- HtmlTags.p(
367
- '<b>Please provide some argument to this API.</b>'
368
- )+
369
- footer
370
- else
371
- # =================================================================== #
372
- # We need to chop the display up a bit if the result is too long.
373
- # =================================================================== #
374
- the_result = ::Bioroebe.random_aminoacids(the_params)
375
- if the_result.size > 80
376
- array = the_result.scan(/[A-Z]{80}/)
377
- the_result = array.join("<br>\n")
378
- end
379
- require 'bioroebe/count/count_amount_of_aminoacids.rb'
380
- hash_composition = Bioroebe.return_composition_from_this_aminoacid_sequence('HSLOEVCKWUCKFLVNUYWYGPNRAQMDCITKM')
381
- result = '<b>'+the_result+'</b>'+'<br><br>'\
382
- '(constituting <b>'+the_result.size.to_s+
383
- '</b> amino acids.)'+"<br>\n"
384
- result2 = "The aminoacid-composition is as follows:<br>\n".dup
385
- hash_composition.each_pair {|aminoacid_one_letter, n_times|
386
- result2 << "<span style=\"padding-left:2em\"><b>#{aminoacid_one_letter}</b></span>: #{n_times}<br>\n"
387
- }
388
- # Build the result next.
389
- return_header_random_aminoacids+
390
- HtmlTags.p(result,'','','margin: 1em')+
391
- HtmlTags.p(result2,'','','font-size: 1.6em; float:left; margin: 1em; font-family: monospace;')+
392
- footer
393
- end
394
- }
305
+ '<pre style="color: darkblue; margin-left:2em; font-weight: bold">'+
306
+ source_code+
307
+ '</pre>'+
308
+ hyperlink_paragraph
309
+ else
310
+ "Can not read the file's content."
311
+ end
395
312
  }
396
313
 
397
314
  # ========================================================================= #
@@ -418,7 +335,7 @@ class Sinatra < ::Sinatra::Base
418
335
  the_params = the_params.to_s.strip.upcase if the_params
419
336
  the_result = ::Bioroebe::PalindromeGenerator.return_as_string(the_params)
420
337
  if the_params.empty?
421
- the_result = HtmlTags.p(
338
+ the_result = p(
422
339
  '<b> Please input a DNA sequence</b>'
423
340
  )+
424
341
  return_paragraph_of_hyperlinks
@@ -429,7 +346,7 @@ class Sinatra < ::Sinatra::Base
429
346
  # =================================================================== #
430
347
  # Overwrite the_result variable next:
431
348
  # =================================================================== #
432
- the_result = HtmlTags.p(
349
+ the_result = p(
433
350
  'Generated the following palindrome of '\
434
351
  'size <b>'+the_params.to_s+'</b>:'
435
352
  )+
@@ -438,62 +355,252 @@ class Sinatra < ::Sinatra::Base
438
355
  css_style: 'color: darkblue; margin: 1em; font-size: larger;'
439
356
  )+
440
357
  return_paragraph_of_hyperlinks
441
- end
442
- the_result << return_form_for_palindromes_action
443
- the_result
444
- }
358
+ end
359
+ the_result << return_form_for_palindromes_action
360
+ the_result
361
+ }
362
+ }
363
+
364
+ # ========================================================================= #
365
+ # === /codon_frequency_of_this_string
366
+ #
367
+ # http://localhost:4568/codon_frequency_of_this_string
368
+ # ========================================================================= #
369
+ ['/codon_frequency_of_this_string'].each {|target|
370
+ get(target) {
371
+ embeddable_interface?.method_codon_frequency_of_this_string
372
+ }
373
+ }
374
+
375
+ # ========================================================================= #
376
+ # === /blosum_source
377
+ #
378
+ # http://localhost:4568/blosum_source
379
+ # ========================================================================= #
380
+ get('/blosum_source'){
381
+ file, line_number = ::Bioroebe.method(:blosum).source_location
382
+ if File.exist? file
383
+ readlines = File.readlines(file)
384
+ source_code = readlines[(line_number - 1) .. -1].join
385
+ embeddable_interface?.return_intro_for_blosum+
386
+ p(
387
+ 'The source code for the <b>/blosum</b> functionality is: '
388
+ )+
389
+ '<pre style="color: darkblue; margin-left:2em; font-weight: bold">'+
390
+ source_code+
391
+ '</pre>'+
392
+ hyperlink_paragraph
393
+ else
394
+ "Can not read the file's content."
395
+ end
396
+ }
397
+
398
+ # =========================================================================== #
399
+ # === /mirror
400
+ #
401
+ # Example:
402
+ #
403
+ # http://localhost:4568/mirror
404
+ # =========================================================================== #
405
+ get('/mirror'){
406
+ body = embeddable_interface?.return_intro_for_mirror_repeat_conversion+
407
+ p(
408
+ 'You can "create" a mirror-repeat of DNA/RNA here.'
409
+ )+
410
+ p(
411
+ 'Simply input the nucleotide String, such as "ATGCT", '\
412
+ 'without the "" quotes.'
413
+ )+
414
+ embeddable_interface?.return_form_for_mirror_repeat_action+
415
+ embeddable_interface?.hyperlink_paragraph
416
+ Cyberweb.html_template(
417
+ title: 'Mirror repeats-API',
418
+ body: body
419
+ )
420
+ }
421
+
422
+ # ========================================================================= #
423
+ # === Convert into DNA (2 tag, second entry, to_dna tag)
424
+ #
425
+ # This method will convert RNA into DNA.
426
+ #
427
+ # http://localhost:4568/to_dna
428
+ #
429
+ # Example:
430
+ #
431
+ # http://localhost:4568/to_dna/ATGCUUUUUUUUUU
432
+ #
433
+ # ========================================================================= #
434
+ get('/to_dna/*') {
435
+ the_params = params[:splat]
436
+ if the_params.is_a? Array
437
+ the_params = the_params.join(' ')
438
+ end
439
+ if params.has_key? 'user_input'
440
+ the_params = params['user_input']
441
+ end
442
+ the_params = the_params.strip.upcase if the_params
443
+ if the_params.include? '&'
444
+ the_params = the_params[0 .. (the_params.index('&') - 1)]
445
+ end
446
+ the_result = ::Bioroebe.to_dna(the_params)
447
+ if the_params.empty?
448
+ the_result = embeddable_interface?.return_intro_for_to_dna_conversion+
449
+ p(
450
+ '<b> Please input a RNA sequence which will be '\
451
+ 'converted into DNA.</b>'
452
+ )+
453
+ return_paragraph_of_hyperlinks
454
+ else
455
+ the_result = embeddable_interface?.return_intro_for_to_dna_conversion+
456
+ p('Converted into DNA, <b>'+the_params+'</b> '\
457
+ 'is equivalent to:')+
458
+ p(
459
+ '<b>'+the_result+'</b>',
460
+ css_style: 'margin:1em; font-size: larger; color: blueviolet'
461
+ )
462
+ end
463
+ the_result << embeddable_interface?.return_form_for_to_dna_action
464
+ the_result << embeddable_interface?.hyperlinks_paragraph
465
+ the_result
466
+ }
467
+
468
+ # ========================================================================= #
469
+ # === view
470
+ #
471
+ # http://localhost:4568/view
472
+ # ========================================================================= #
473
+ get('/view') { # view tag
474
+ embeddable_interface?.return_view_string
475
+ }
476
+
477
+ # ========================================================================= #
478
+ # === Codon Frequencies
479
+ #
480
+ # Example:
481
+ #
482
+ # http://localhost:4568/codon_frequency_of_this_string/ATGCUUUUUUUUUU
483
+ #
484
+ # ========================================================================= #
485
+ get('/codon_frequency_of_this_string/*') {
486
+ the_params = params[:splat]
487
+ if the_params.is_a? Array
488
+ the_params = the_params.join(' ')
489
+ end
490
+ if params.has_key? 'user_input'
491
+ the_params = params['user_input']
492
+ end
493
+ the_params = the_params.strip.upcase if the_params
494
+ if the_params.is_a? Array
495
+ the_params = the_params.flatten.first
496
+ end
497
+ the_result = ''.dup
498
+ if the_params.empty?
499
+ the_result << return_intro_for_reverse_complement_conversion+
500
+ p(
501
+ '<b> Please input a DNA sequence.'
502
+ )+
503
+ return_paragraph_of_hyperlinks
504
+ else
505
+ _ = embeddable_interface?.return_intro_for_reverse_complement_conversion
506
+ the_result << p(
507
+ Bioroebe.codon_frequency_of_this_string(the_params)
508
+ )
509
+ end
510
+ the_result << embeddable_interface?.return_form_for_codon_frequency_of_this_string
511
+ the_result << embeddable_interface?.hyperlinks_paragraph
512
+ the_result
445
513
  }
446
514
 
447
515
  # ========================================================================= #
448
- # === Query how many stop codons are in a given DNA sequence
516
+ # === Convert into DNA (2 tag, second entry, reverse_complement tag)
449
517
  #
450
- # This method will determine how many stop codons are in the given
451
- # sequence.
518
+ # This method will convert RNA into DNA.
452
519
  #
453
- # http://localhost:4568/n_stop_codons_in_this_sequence
520
+ # http://localhost:4568/reverse_complement
454
521
  #
455
522
  # Example:
456
523
  #
457
- # http://localhost:4568/n_stop_codons_in_this_sequence/ATGCUUUUUUUUUTAG
524
+ # http://localhost:4568/reverse_complement/ATGCUUUUUUUUUU
458
525
  #
459
526
  # ========================================================================= #
460
- %w(
461
- /n_stop_codons_in_this_sequence/*
462
- /n_stop/*
463
- /nstop/*
464
- ).each {|entry|
465
- get(entry) {
466
- the_params = params[:splat]
467
- if the_params.is_a? Array
468
- the_params = the_params.join(' ')
469
- end
470
- if params.has_key? 'user_input'
471
- the_params = params['user_input']
472
- end
473
- the_params = the_params.strip.upcase if the_params
474
- the_result = ::Bioroebe.return_n_stop_codons_in_this_sequence(the_params)
475
- if the_params.empty?
476
- the_result = return_intro_for_n_stop_codons_in_this_sequence+
477
- HtmlTags.p(
527
+ get('/reverse_complement/*') {
528
+ the_params = params[:splat]
529
+ if the_params.is_a? Array
530
+ the_params = the_params.join(' ')
531
+ end
532
+ if params.has_key? 'user_input'
533
+ the_params = params['user_input']
534
+ end
535
+ the_params = the_params.strip.upcase if the_params
536
+ if the_params.is_a? Array
537
+ the_params = the_params.flatten.first
538
+ end
539
+ the_reverse_complement = ::Bioroebe.reverse_complement(the_params)
540
+ if the_reverse_complement.is_a? Array
541
+ the_reverse_complement = the_reverse_complement.first.to_s
542
+ end
543
+ the_result = ''.dup
544
+ if the_params.empty?
545
+ the_result << return_intro_for_reverse_complement_conversion+
546
+ p(
478
547
  '<b> Please input a DNA sequence which will be '\
479
- 'investigated next.</b>'
548
+ 'reverse-complemented into DNA.</b>'
480
549
  )+
481
550
  return_paragraph_of_hyperlinks
482
- else
483
- the_result = return_intro_for_n_stop_codons_in_this_sequence+
484
- HtmlTags.p('This sequence contains <b style="font-size: larger; color: blueviolet">'+
485
- the_result.to_s+'</b> stop '\
486
- 'codons.'
551
+ else
552
+ _ = embeddable_interface?.return_intro_for_reverse_complement_conversion
553
+ the_result << _+p(
554
+ "The reverse complement of <b>5'-#{the_params.to_s}</b> is:"
555
+ )
556
+ the_result << p(
557
+ "<b>5'-#{the_reverse_complement}</b>",
558
+ css_style: 'margin:1em; font-size: larger; color: blueviolet'
559
+ )
560
+ end
561
+ the_result << embeddable_interface?.return_form_for_reverse_complement_action
562
+ the_result << embeddable_interface?.hyperlinks_paragraph
563
+ the_result
564
+ }
565
+
566
+ # ========================================================================= #
567
+ # http://localhost:4568/to_dna_source
568
+ # ========================================================================= #
569
+ get([
570
+ '/to_dna_source',
571
+ '/to_aa_source'
572
+ ]){
573
+ sanitized_URL_part = request.path_info.to_s.sub('_source','').
574
+ delete('/').to_sym
575
+ file, line_number = ::Bioroebe.method(sanitized_URL_part).source_location
576
+ if File.exist? file
577
+ readlines = File.readlines(file)
578
+ source_code = readlines[(line_number - 1) .. -1].join
579
+ Cyberweb::HtmlTemplate[
580
+ title: sanitized_URL_part.to_s+' source code',
581
+ body: embeddable_interface?.return_intro_for_to_dna_conversion+
582
+ p(
583
+ 'The source code for the <b>/'+sanitized_URL_part.to_s+
584
+ '</b> functionality is: '
487
585
  )+
488
- HtmlTags.p(
489
- '(The <b>input-sequence</b> was <b style="color: darkgreen">'+
490
- the_params.to_s+'</b>)'
491
- )
492
- end
493
- the_result << return_form_for_n_stop_codons_in_this_sequence(entry.delete('*'))
494
- the_result << hyperlinks_paragraph
495
- the_result
496
- }
586
+ '<pre style="color: darkblue; margin-left:2em; font-weight: bold">'+
587
+ source_code+
588
+ '</pre>'+
589
+ embeddable_interface?.hyperlink_paragraph
590
+ ].to_s
591
+ else
592
+ "Can not read the file's content."
593
+ end
594
+ }
595
+
596
+ # =========================================================================== #
597
+ # Example:
598
+ #
599
+ # http://localhost:4568/shuffleseq
600
+ #
601
+ # =========================================================================== #
602
+ get('/shuffleseq'){
603
+ embeddable_interface?.method_shuffleseq
497
604
  }
498
605
 
499
606
  # ========================================================================= #
@@ -501,7 +608,7 @@ class Sinatra < ::Sinatra::Base
501
608
  # ========================================================================= #
502
609
  get('/is_palindrome') {
503
610
  return_header_for_palindromes('Is palindrome')+
504
- HtmlTags.p(
611
+ p(
505
612
  'Input the target sequence, in order to find out whether '\
506
613
  'that sequence is a <b>palindrome</b> or whether it is not.'
507
614
  )+
@@ -509,6 +616,23 @@ class Sinatra < ::Sinatra::Base
509
616
  footer
510
617
  }
511
618
 
619
+ # ========================================================================= #
620
+ # === /shuffleseq
621
+ #
622
+ # http://localhost:4568/shuffleseq
623
+ # ========================================================================= #
624
+ ['/shuffleseq'].each {|target|
625
+ get(target) {
626
+ Cyberweb.html_template(
627
+ title: 'Shuffleseq - Shuffle a sequence',
628
+ body: '<pre>'+
629
+ ::Bioroebe.shuffleseq(method(:reverse_complement))+
630
+ '</pre>'+
631
+ footer
632
+ )
633
+ }
634
+ }
635
+
512
636
  # ========================================================================= #
513
637
  # === Is this sequence a palindrome
514
638
  #
@@ -528,7 +652,7 @@ class Sinatra < ::Sinatra::Base
528
652
  the_params = the_params.to_s.strip.upcase if the_params
529
653
  the_result = ::Bioroebe.is_this_sequence_a_palindrome?(the_params).to_s
530
654
  if the_params.empty?
531
- the_result = HtmlTags.p(
655
+ the_result = p(
532
656
  '<b> Please input a DNA sequence</b>'
533
657
  )+
534
658
  return_paragraph_of_hyperlinks
@@ -536,7 +660,7 @@ class Sinatra < ::Sinatra::Base
536
660
  # =================================================================== #
537
661
  # Overwrite the_result variable next:
538
662
  # =================================================================== #
539
- the_result = HtmlTags.p(
663
+ the_result = p(
540
664
  'Is the sequence <b>'+the_params.to_s+
541
665
  '</b> a palindrome?<br><br><b style="margin-left:2em">'+
542
666
  ::Bioroebe::VerboseTruth[the_result.to_s]+'</b>'
@@ -547,41 +671,6 @@ class Sinatra < ::Sinatra::Base
547
671
  the_result
548
672
  }
549
673
 
550
- # ========================================================================= #
551
- # === /mirror_source
552
- #
553
- # http://localhost:4568/mirror_source
554
- # ========================================================================= #
555
- get('/mirror_source'){
556
- file, line_number = ::Bioroebe.method(:mirror_repeat).source_location
557
- if File.exist? file
558
- readlines = File.readlines(file)
559
- source_code = readlines[(line_number - 1) .. -1].join
560
- embeddable_interface?.return_intro_for_mirror_repeat_conversion+
561
- HtmlTags.p(
562
- 'The source code for the <b>/mirror</b> functionality is: '
563
- )+
564
- '<pre style="color: darkblue; margin-left:2em; font-weight: bold">'+
565
- source_code+
566
- '</pre>'+
567
- hyperlink_paragraph
568
- else
569
- "Can not read the file's content."
570
- end
571
- }
572
-
573
- # ========================================================================= #
574
- # http://localhost:4568/chunked_display
575
- # http://localhost:4568/chunked
576
- # http://localhost:4568/upcase
577
- # ========================================================================= #
578
- Bioroebe::EmbeddableInterface::ARRAY_FOR_CHUNKED_DISPLAY.each {|target|
579
- get(target) {
580
- embeddable_interface?.return_header_to_chunked_display+
581
- embeddable_interface?.footer
582
- }
583
- }
584
-
585
674
  # ========================================================================= #
586
675
  # === Compseq (compseq)
587
676
  #
@@ -606,91 +695,60 @@ class Sinatra < ::Sinatra::Base
606
695
  the_result = ::Bioroebe.compseq(the_params) { :be_quiet }
607
696
  if the_params.empty?
608
697
  the_result = return_intro_for_compseq+
609
- HtmlTags.p(
610
- '<b> Please input a DNA sequence which will be '\
611
- 'compseq into DNA.</b>'
612
- )+
613
- return_paragraph_of_hyperlinks
614
- else
615
- the_result = return_intro_for_compseq+
616
- HtmlTags.p('The compseq of <b>'+the_params+'</b> is:')+
617
- HtmlTags.pre(
618
- the_result,
619
- css_style: 'margin:1em; margin-left: 4em; font-size: larger; '\
620
- 'font-weight: bold; color: blueviolet'
621
- )
622
- end
623
- the_result << return_form_for_compseq_action
624
- the_result << hyperlinks_paragraph
625
- the_result
626
- }
627
-
628
- # ========================================================================= #
629
- # http://localhost:4568/to_aa
630
- # http://localhost:4568/to_aminoacids
631
- # ========================================================================= #
632
- Bioroebe::EmbeddableInterface::ARRAY_FOR_TO_AMINOACIDS_CONVERSION.each {|target|
633
- get(target) {
634
- Cyberweb::HtmlTemplate[
635
- title: 'To aminoacid conversion',
636
- body: return_header_to_aminoacid_conversion+
637
- return_explanation_of_how_to_use_the_aminoacid_conversion+
638
- return_form_for_to_aa_action+
639
- footer
640
- ].to_s
641
- }
642
- }
643
-
644
- # =========================================================================== #
645
- # === /mirror
646
- #
647
- # Example:
648
- #
649
- # http://localhost:4568/mirror
650
- # =========================================================================== #
651
- get('/mirror'){
652
- body = embeddable_interface?.return_intro_for_mirror_repeat_conversion+
653
- HtmlTags.p(
654
- 'You can "create" a mirror-repeat of DNA/RNA here.'
655
- )+
656
- HtmlTags.p(
657
- 'Simply input the nucleotide String, such as "ATGCT", '\
658
- 'without the "" quotes.'
659
- )+
660
- embeddable_interface?.return_form_for_mirror_repeat_action+
661
- embeddable_interface?.hyperlink_paragraph
662
- Cyberweb::HtmlTemplate[
663
- title: 'Mirror repeats-API',
664
- body: body
665
- ].to_s
698
+ p(
699
+ '<b> Please input a DNA sequence which will be '\
700
+ 'compseq into DNA.</b>'
701
+ )+
702
+ return_paragraph_of_hyperlinks
703
+ else
704
+ the_result = return_intro_for_compseq+
705
+ p('The compseq of <b>'+the_params+'</b> is:')+
706
+ HtmlTags.pre(
707
+ the_result,
708
+ css_style: 'margin:1em; margin-left: 4em; font-size: larger; '\
709
+ 'font-weight: bold; color: blueviolet'
710
+ )
711
+ end
712
+ the_result << return_form_for_compseq_action
713
+ the_result << hyperlinks_paragraph
714
+ the_result
666
715
  }
667
716
 
668
- # =========================================================================== #
669
- # === /to_dna
670
- #
671
- # Usage Examples:
717
+ # ========================================================================= #
718
+ # === /codon_frequency_of_this_string
672
719
  #
673
- # http://localhost:4568/to_dna
674
- # http://localhost:4568/to_dna/AGUCGAUCGUAUGCAGUCAGUCA
720
+ # http://localhost:4568/codon_frequency_of_this_string
721
+ # ========================================================================= #
722
+ ['/codon_frequency_of_this_string'].each {|target|
723
+ get(target) {
724
+ embeddable_interface?.method_codon_frequency_of_this_string
725
+ }
726
+ }
727
+
728
+ # ========================================================================= #
729
+ # === /random_aminoacids
675
730
  #
676
- # =========================================================================== #
677
- get('/to_dna'){
678
- embeddable_interface?.return_sinatra_to_dna
731
+ # http://localhost:4568/random_aminoacids
732
+ # ========================================================================= #
733
+ ['/random_aminoacids'].each {|target|
734
+ get(target) {
735
+ embeddable_interface?.method_random_aminoacids
736
+ }
679
737
  }
680
738
 
681
739
  # ========================================================================= #
682
- # === Convert into DNA (2 tag, second entry, to_dna tag)
740
+ # === mirror*
683
741
  #
684
742
  # This method will convert RNA into DNA.
685
743
  #
686
- # http://localhost:4568/to_dna
744
+ # http://localhost:4568/mirror
687
745
  #
688
746
  # Example:
689
747
  #
690
- # http://localhost:4568/to_dna/ATGCUUUUUUUUUU
748
+ # http://localhost:4568/mirror/ATGCUUUUUUUUUU
691
749
  #
692
750
  # ========================================================================= #
693
- get('/to_dna/*') {
751
+ get('/mirror/*') {
694
752
  the_params = params[:splat]
695
753
  if the_params.is_a? Array
696
754
  the_params = the_params.join(' ')
@@ -699,127 +757,55 @@ class Sinatra < ::Sinatra::Base
699
757
  the_params = params['user_input']
700
758
  end
701
759
  the_params = the_params.strip.upcase if the_params
702
- if the_params.include? '&'
703
- the_params = the_params[0 .. (the_params.index('&') - 1)]
704
- end
705
- the_result = ::Bioroebe.to_dna(the_params)
760
+ the_result = ::Bioroebe.mirror_repeat(
761
+ the_params, false, false, false
762
+ ).delete('|')
706
763
  if the_params.empty?
707
- the_result = embeddable_interface?.return_intro_for_to_dna_conversion+
708
- HtmlTags.p(
764
+ the_result = embeddable_interface?.return_intro_for_mirror_repeat_conversion+
765
+ p(
709
766
  '<b> Please input a RNA sequence which will be '\
710
767
  'converted into DNA.</b>'
711
768
  )+
712
769
  return_paragraph_of_hyperlinks
713
770
  else
714
- the_result = embeddable_interface?.return_intro_for_to_dna_conversion+
715
- HtmlTags.p('Converted into DNA, <b>'+the_params+'</b> '\
716
- 'is equivalent to:')+
717
- HtmlTags.p(
718
- '<b>'+the_result+'</b>',
719
- css_style: 'margin:1em; font-size: larger; color: blueviolet'
720
- )
771
+ the_result = embeddable_interface?.return_intro_for_mirror_repeat_conversion+
772
+ p(
773
+ 'The mirror repeat of <b>'+the_params+'</b> is:'
774
+ )+
775
+ p(
776
+ '<b>'+the_result+'</b>',
777
+ css_style: 'margin:1em; font-size: larger; color: blueviolet'
778
+ )
721
779
  end
722
- the_result << embeddable_interface?.return_form_for_to_dna_action
780
+ the_result << embeddable_interface?.return_form_for_mirror_repeat_action
723
781
  the_result << embeddable_interface?.hyperlinks_paragraph
724
782
  the_result
725
783
  }
726
784
 
727
- # ========================================================================= #
728
- # === Convert into a chunked display
729
- #
730
- # This method will convert RNA into DNA.
731
- #
732
- # http://localhost:4568/chunked
733
- #
734
- # Example:
735
- #
736
- # http://localhost:4568/chunked/ATGCUUUUUUUUUU
737
- #
738
- # ========================================================================= #
739
- Bioroebe::EmbeddableInterface::ARRAY_FOR_CHUNKED_DISPLAY.each {|target|
740
- get(target+'/*') {
741
- the_params = params[:splat]
742
- if the_params.is_a? Array
743
- the_params = the_params.join(' ')
744
- end
745
- if params.has_key? 'user_input'
746
- the_params = params['user_input']
747
- end
748
- the_params = the_params.strip.upcase if the_params
749
- the_result = ::Bioroebe.chunked_display(the_params)
750
- if the_params.empty?
751
- the_result = HtmlTags.p(
752
- '<b> Please input a DNA sequence</b>'
753
- )+
754
- return_paragraph_of_hyperlinks
755
- else
756
- the_result = HtmlTags.p('Converted into a chunked display:')+
757
- HtmlTags.pre(
758
- '<b>'+the_result+'</b>',
759
- css_style: 'color: darkblue; margin:1em; font-size: larger;'
760
- )+
761
- return_paragraph_of_hyperlinks
762
- end
763
- Cyberweb::HtmlTemplate[
764
- title: 'To chunked display',
765
- body: the_result
766
- ].to_s
767
- }
768
- }
769
-
770
785
  # =========================================================================== #
771
- # === /compseq
786
+ # === /blosum
772
787
  #
773
788
  # Example:
774
789
  #
775
- # http://localhost:4568/compseq
790
+ # http://localhost:4568/blosum
776
791
  #
777
792
  # =========================================================================== #
778
- get('/compseq'){
779
- Bioroebe::Sinatra.embeddable_interface?.return_sinatra_method_for_compseq
780
- }
781
-
782
- # =========================================================================== #
783
- # === return_header_to_aminoacid_conversion
784
- # =========================================================================== #
785
- def return_header_to_aminoacid_conversion
786
- Bioroebe::Sinatra.embeddable_interface?.return_header_to_aminoacid_conversion
787
- end
788
-
789
- # =========================================================================== #
790
- # === return_explanation_of_how_to_use_the_aminoacid_conversion
791
- # =========================================================================== #
792
- def return_explanation_of_how_to_use_the_aminoacid_conversion
793
- Bioroebe::Sinatra.embeddable_interface?.return_explanation_of_how_to_use_the_aminoacid_conversion
794
- end
795
-
796
- # =========================================================================== #
797
- # === return_form_for_to_aa_action
798
- # =========================================================================== #
799
- def return_form_for_to_aa_action
800
- Bioroebe::Sinatra.embeddable_interface?.return_form_for_to_aa_action
801
- end
802
-
803
- # =========================================================================== #
804
- # === return_paragraph_of_hyperlinks
805
- # =========================================================================== #
806
- def return_paragraph_of_hyperlinks
807
- embeddable_interface?.return_paragraph_of_hyperlinks
808
- end; alias footer return_paragraph_of_hyperlinks # === footer (footer tag)
809
- alias hyperlink_paragraph return_paragraph_of_hyperlinks # === hyperlink_paragraph
810
- alias hyperlinks_paragraph return_paragraph_of_hyperlinks # === hyperlinks_paragraph
811
-
812
- # ========================================================================= #
813
- # === / (main tag)
814
- #
815
- # This is the root tag, the root of our web-application.
816
- # ========================================================================= #
817
- get('/') {
818
- body = embeddable_interface?.return_root_string
819
- Cyberweb::HtmlTemplate[
820
- title: 'Bioroebe Web-API',
821
- body: body
822
- ].to_s
793
+ get('/blosum'){
794
+ _ = ''.dup
795
+ _ << embeddable_interface?.return_intro_for_blosum
796
+ _ << p(
797
+ "You can view different BLOSUM matrices here.<br><br>Choose from:<br><br>\n"
798
+ )
799
+ available_blosum_matrices = Bioroebe.available_blosum_matrices?
800
+ available_blosum_matrices.each {|entry|
801
+ _ << '<b style="margin-left: 2em">'+entry+'</b><br>'
802
+ }
803
+ _ << p(
804
+ "<br>Name of the BLOSUM matrix:<br>"
805
+ )+
806
+ embeddable_interface?.return_form_for_blosum_action+
807
+ embeddable_interface?.hyperlink_paragraph
808
+ return _
823
809
  }
824
810
 
825
811
  # ========================================================================= #
@@ -839,7 +825,7 @@ class Sinatra < ::Sinatra::Base
839
825
  end
840
826
  if the_params.empty?
841
827
  return_header_to_aminoacid_conversion+
842
- HtmlTags.p(
828
+ p(
843
829
  '<b>Please provide some argument to this API.</b>'
844
830
  )+
845
831
  footer
@@ -857,16 +843,16 @@ class Sinatra < ::Sinatra::Base
857
843
  the_params = the_params.to_s.strip.delete(' ')
858
844
  the_result = ::Bioroebe.to_aa(the_params)
859
845
  return_header_to_aminoacid_conversion+
860
- HtmlTags.p(
846
+ p(
861
847
  '<b style="color: darkgreen">The input sequence was:</b> <b>'+the_params+'</b>'
862
848
  )+
863
- HtmlTags.p(
849
+ p(
864
850
  '<b style="color: darkblue; margin-left: 1em;">Frame 1:</b> <b>'+the_result+'</b> # '+the_result.size.to_s+' aminoacids'
865
851
  )+
866
- HtmlTags.p(
852
+ p(
867
853
  '<b style="color: darkblue; margin-left: 1em;">Frame 2:</b> <b>'+Bioroebe.to_aa(the_params[1 .. -1])+'</b> # '+the_result.size.to_s+' aminoacids'
868
854
  )+
869
- HtmlTags.p(
855
+ p(
870
856
  '<b style="color: darkblue; margin-left: 1em;">Frame 3:</b> <b>'+Bioroebe.to_aa(the_params[2 .. -1])+'</b> # '+the_result.size.to_s+' aminoacids'
871
857
  )+
872
858
  footer
@@ -874,101 +860,151 @@ class Sinatra < ::Sinatra::Base
874
860
  }
875
861
  }
876
862
 
877
- # =========================================================================== #
878
- # === /blosum
879
- #
880
- # Example:
881
- #
882
- # http://localhost:4568/blosum
883
- #
884
- # =========================================================================== #
885
- get('/blosum'){
886
- _ = ''.dup
887
- _ << embeddable_interface?.return_intro_for_blosum
888
- _ << HtmlTags.p(
889
- 'You can view different BLOSUM matrices here. Choose from:'
890
- )
891
- available_blosum_matrices = Bioroebe.available_blosum_matrices?
892
- available_blosum_matrices.each {|entry|
893
- _ << '<b style="margin-left: 2em">'+entry+'</b><br>'
863
+ # ========================================================================= #
864
+ # === shuffleseq
865
+ # ========================================================================= #
866
+ get('/shuffleseq/*') {
867
+ the_params = params[:splat]
868
+ if the_params.is_a? Array
869
+ the_params = the_params.join(' ')
870
+ end
871
+ the_params = the_params.dup
872
+ if the_params
873
+ the_params = the_params.strip.upcase
874
+ end
875
+ the_result = ::Bioroebe.shuffleseq(the_params)
876
+ body = embeddable_interface?.return_intro_for_shuffleseq.dup
877
+ if the_params.empty?
878
+ body <<
879
+ p(
880
+ '<b> Please input a DNA sequence.</b>'
881
+ )+
882
+ return_paragraph_of_hyperlinks
883
+ else
884
+ body <<
885
+ HtmlTags.p(
886
+ 'The shuffled sequence of <b>'+the_params.to_s+'</b> is:'
887
+ )+
888
+ HtmlTags.p(
889
+ '<b>'+the_result.to_s+'</b>',
890
+ css_style: 'margin:1em; font-size: larger; color: blueviolet'
891
+ )
892
+ end
893
+ body << embeddable_interface?.return_form_for_shuffleseq_action
894
+ body << embeddable_interface?.hyperlinks_paragraph
895
+ Cyberweb::HtmlTemplate[
896
+ title: 'Shuffleseq - Shuffle a sequence',
897
+ body: body
898
+ ].to_s
899
+ }
900
+
901
+ # ========================================================================= #
902
+ # http://localhost:4568/test
903
+ # ========================================================================= #
904
+ get('/test') {
905
+ return_index_of_hyperlinks
906
+ }
907
+
908
+ # ========================================================================= #
909
+ # http://localhost:4568/reverse_complement_source
910
+ # ========================================================================= #
911
+ ['/reverse_complement_source'].each {|target|
912
+ get(target) {
913
+ body = HtmlTags.p('The source is:')+
914
+ '<pre>'+
915
+ ::Bioroebe.return_source_code_of_this_method(method(:reverse_complement))+
916
+ '</pre>'+
917
+ footer
918
+ Cyberweb::HtmlTemplate[
919
+ title: 'Bioroebe Web-API',
920
+ body: body
921
+ ].to_s
894
922
  }
895
- _ << HtmlTags.p(
896
- 'Name of the BLOSUM matrix:'
897
- )+
898
- embeddable_interface?.return_form_for_blosum_action+
899
- embeddable_interface?.hyperlink_paragraph
900
- return _
901
923
  }
902
924
 
903
- # ========================================================================= #
904
- # === mirror*
925
+ # =========================================================================== #
926
+ # === reverse_complement
905
927
  #
906
- # This method will convert RNA into DNA.
928
+ # Invocation example:
907
929
  #
908
- # http://localhost:4568/mirror
930
+ # http://localhost:4568/reverse_complement
909
931
  #
910
- # Example:
932
+ # =========================================================================== #
933
+ get('/reverse_complement'){
934
+ embeddable_interface?.method_reverse_complement
935
+ }
936
+
937
+ # =========================================================================== #
938
+ # === n_stop_codons_in_this_sequence
911
939
  #
912
- # http://localhost:4568/mirror/ATGCUUUUUUUUUU
940
+ # Invocation example:
913
941
  #
914
- # ========================================================================= #
915
- get('/mirror/*') {
916
- the_params = params[:splat]
917
- if the_params.is_a? Array
918
- the_params = the_params.join(' ')
919
- end
920
- if params.has_key? 'user_input'
921
- the_params = params['user_input']
922
- end
923
- the_params = the_params.strip.upcase if the_params
924
- the_result = ::Bioroebe.mirror_repeat(
925
- the_params, false, false, false
926
- ).delete('|')
927
- if the_params.empty?
928
- the_result = embeddable_interface?.return_intro_for_mirror_repeat_conversion+
929
- HtmlTags.p(
930
- '<b> Please input a RNA sequence which will be '\
931
- 'converted into DNA.</b>'
942
+ # http://localhost:4568/n_stop_codons_in_this_sequence
943
+ # http://localhost:4568/n_stop
944
+ #
945
+ # =========================================================================== #
946
+ %w(
947
+ /n_stop_codons_in_this_sequence
948
+ /n_stop
949
+ /nstop
950
+ ).each {|entry|
951
+ get(entry){
952
+ embeddable_interface?.return_intro_for_n_stop_codons_in_this_sequence+
953
+ p(
954
+ 'This API will return how many stop codons can be '\
955
+ 'found in a given sequence.<br>'
932
956
  )+
933
- return_paragraph_of_hyperlinks
934
- else
935
- the_result = embeddable_interface?.return_intro_for_mirror_repeat_conversion+
936
- HtmlTags.p(
937
- 'The mirror repeat of <b>'+the_params+'</b> is:'
957
+ p(
958
+ 'Simply input the nucleotide String, such as "ATGCTTTAG", '\
959
+ 'without the "" quotes.<br><br>'
938
960
  )+
939
- HtmlTags.p(
940
- '<b>'+the_result+'</b>',
941
- css_style: 'margin:1em; font-size: larger; color: blueviolet'
942
- )
943
- end
944
- the_result << embeddable_interface?.return_form_for_mirror_repeat_action
945
- the_result << embeddable_interface?.hyperlinks_paragraph
946
- the_result
961
+ embeddable_interface?.return_form_for_n_stop_codons_in_this_sequence(entry)+
962
+ embeddable_interface?.hyperlink_paragraph
963
+ }
947
964
  }
948
965
 
949
- # ========================================================================= #
950
- # === /blosum_source
966
+ # =========================================================================== #
967
+ # === /compseq
951
968
  #
952
- # http://localhost:4568/blosum_source
953
- # ========================================================================= #
954
- get('/blosum_source'){
955
- file, line_number = ::Bioroebe.method(:blosum).source_location
956
- if File.exist? file
957
- readlines = File.readlines(file)
958
- source_code = readlines[(line_number - 1) .. -1].join
959
- embeddable_interface?.return_intro_for_blosum+
960
- HtmlTags.p(
961
- 'The source code for the <b>/blosum</b> functionality is: '
962
- )+
963
- '<pre style="color: darkblue; margin-left:2em; font-weight: bold">'+
964
- source_code+
965
- '</pre>'+
966
- hyperlink_paragraph
967
- else
968
- "Can not read the file's content."
969
- end
969
+ # Example:
970
+ #
971
+ # http://localhost:4568/compseq
972
+ #
973
+ # =========================================================================== #
974
+ get('/compseq'){
975
+ Bioroebe::SinatraWrapper.embeddable_interface?.return_sinatra_method_for_compseq
970
976
  }
971
977
 
978
+ # =========================================================================== #
979
+ # === return_header_to_aminoacid_conversion
980
+ # =========================================================================== #
981
+ def return_header_to_aminoacid_conversion
982
+ Bioroebe::SinatraWrapper.embeddable_interface?.return_header_to_aminoacid_conversion
983
+ end
984
+
985
+ # =========================================================================== #
986
+ # === return_explanation_of_how_to_use_the_aminoacid_conversion
987
+ # =========================================================================== #
988
+ def return_explanation_of_how_to_use_the_aminoacid_conversion
989
+ Bioroebe::SinatraWrapper.embeddable_interface?.return_explanation_of_how_to_use_the_aminoacid_conversion
990
+ end
991
+
992
+ # =========================================================================== #
993
+ # === return_form_for_to_aa_action
994
+ # =========================================================================== #
995
+ def return_form_for_to_aa_action
996
+ Bioroebe::SinatraWrapper.embeddable_interface?.return_form_for_to_aa_action
997
+ end
998
+
999
+ # =========================================================================== #
1000
+ # === return_paragraph_of_hyperlinks
1001
+ # =========================================================================== #
1002
+ def return_paragraph_of_hyperlinks
1003
+ embeddable_interface?.return_paragraph_of_hyperlinks
1004
+ end; alias footer return_paragraph_of_hyperlinks # === footer (footer tag)
1005
+ alias hyperlink_paragraph return_paragraph_of_hyperlinks # === hyperlink_paragraph
1006
+ alias hyperlinks_paragraph return_paragraph_of_hyperlinks # === hyperlinks_paragraph
1007
+
972
1008
  # ========================================================================= #
973
1009
  # === blosum*
974
1010
  #
@@ -991,9 +1027,9 @@ class Sinatra < ::Sinatra::Base
991
1027
  end
992
1028
  # No longer upcase since as of August 2021.
993
1029
  # the_params = the_params.strip.upcase if the_params
994
- the_result = HtmlTags.p('The content of the <b>BLOSUM matrix</b> '\
1030
+ the_result = p('The content of the <b>BLOSUM matrix</b> '\
995
1031
  '<b style="color: blueviolet">'+the_params.to_s+'</b> is:').dup
996
- the_result << HtmlTags.p(
1032
+ the_result << p(
997
1033
  '<pre style="font-size:1.5em">'+
998
1034
  Bioroebe::BlosumParser.return_as_2D_table(the_params).tr('|','|').to_s+
999
1035
  '</pre>',
@@ -1005,123 +1041,64 @@ class Sinatra < ::Sinatra::Base
1005
1041
  }
1006
1042
 
1007
1043
  # ========================================================================= #
1008
- # === /random_aminoacids
1009
- #
1010
- # http://localhost:4568/random_aminoacids
1011
- # ========================================================================= #
1012
- ['/random_aminoacids'].each {|target|
1013
- get(target) {
1014
- embeddable_interface?.method_random_aminoacids
1015
- }
1016
- }
1017
-
1018
- # ========================================================================= #
1019
- # === /codon_frequency_of_this_string
1044
+ # === Random aminoacids
1020
1045
  #
1021
- # http://localhost:4568/codon_frequency_of_this_string
1046
+ # http://localhost:4568/random_aminoacids/33
1022
1047
  # ========================================================================= #
1023
- ['/codon_frequency_of_this_string'].each {|target|
1048
+ ['/random_aminoacids/*'].each {|target|
1024
1049
  get(target) {
1025
- embeddable_interface?.method_codon_frequency_of_this_string
1026
- }
1027
- }
1028
-
1029
- # ========================================================================= #
1030
- # === Codon Frequencies
1031
- #
1032
- # Example:
1033
- #
1034
- # http://localhost:4568/codon_frequency_of_this_string/ATGCUUUUUUUUUU
1035
- #
1036
- # ========================================================================= #
1037
- get('/codon_frequency_of_this_string/*') {
1038
- the_params = params[:splat]
1039
- if the_params.is_a? Array
1040
- the_params = the_params.join(' ')
1041
- end
1042
- if params.has_key? 'user_input'
1043
- the_params = params['user_input']
1044
- end
1045
- the_params = the_params.strip.upcase if the_params
1046
- if the_params.is_a? Array
1047
- the_params = the_params.flatten.first
1048
- end
1049
- the_result = ''.dup
1050
- if the_params.empty?
1051
- the_result << return_intro_for_reverse_complement_conversion+
1050
+ the_params = params[:splat].join(' ').strip.upcase
1051
+ if the_params.empty?
1052
+ return_header_random_aminoacids+
1052
1053
  p(
1053
- '<b> Please input a DNA sequence.'
1054
+ '<b>Please provide some argument to this API.</b>'
1054
1055
  )+
1055
- return_paragraph_of_hyperlinks
1056
- else
1057
- _ = embeddable_interface?.return_intro_for_reverse_complement_conversion
1058
- the_result << p(
1059
- Bioroebe.codon_frequency_of_this_string(the_params)
1060
- )
1061
- end
1062
- the_result << embeddable_interface?.return_form_for_codon_frequency_of_this_string
1063
- the_result << embeddable_interface?.hyperlinks_paragraph
1064
- the_result
1065
- }
1066
- # ========================================================================= #
1067
- # === /codon_frequency_of_this_string
1068
- #
1069
- # http://localhost:4568/codon_frequency_of_this_string
1070
- # ========================================================================= #
1071
- ['/codon_frequency_of_this_string'].each {|target|
1072
- get(target) {
1073
- embeddable_interface?.method_codon_frequency_of_this_string
1056
+ footer
1057
+ else
1058
+ # =================================================================== #
1059
+ # We need to chop the display up a bit if the result is too long.
1060
+ # =================================================================== #
1061
+ the_result = ::Bioroebe.random_aminoacids(the_params)
1062
+ if the_result.size > 80
1063
+ array = the_result.scan(/[A-Z]{80}/)
1064
+ the_result = array.join("<br>\n")
1065
+ end
1066
+ require 'bioroebe/count/count_amount_of_aminoacids.rb'
1067
+ hash_composition = Bioroebe.return_composition_from_this_aminoacid_sequence('HSLOEVCKWUCKFLVNUYWYGPNRAQMDCITKM')
1068
+ result = '<b>'+the_result+'</b>'+'<br><br>'\
1069
+ '(constituting <b>'+the_result.size.to_s+
1070
+ '</b> amino acids.)'+"<br>\n"
1071
+ result2 = "The aminoacid-composition is as follows:<br>\n".dup
1072
+ hash_composition.each_pair {|aminoacid_one_letter, n_times|
1073
+ result2 << "<span style=\"padding-left:2em\"><b>#{aminoacid_one_letter}</b></span>: #{n_times}<br>\n"
1074
+ }
1075
+ # Build the result next.
1076
+ return_header_random_aminoacids+
1077
+ p(result,'','','margin: 1em')+
1078
+ p(result2,'','','font-size: 1.6em; float:left; margin: 1em; font-family: monospace;')+
1079
+ footer
1080
+ end
1074
1081
  }
1075
1082
  }
1076
1083
 
1077
- # ========================================================================= #
1078
- # === Codon Frequencies
1079
- #
1080
- # Example:
1081
- #
1082
- # http://localhost:4568/frequency_per_thousand/ATGCUUUUUUUUUU
1083
- #
1084
- # ========================================================================= #
1085
- get('/frequency_per_thousand/*') {
1086
- the_params = params[:splat]
1087
- if the_params.is_a? Array
1088
- the_params = the_params.join(' ')
1089
- end
1090
- if params.has_key? 'user_input'
1091
- the_params = params['user_input']
1092
- end
1093
- the_params = the_params.strip.upcase if the_params
1094
- if the_params.is_a? Array
1095
- the_params = the_params.flatten.first
1096
- end
1097
- the_result = ''.dup
1098
- if the_params.empty?
1099
- the_result << return_intro_for_reverse_complement_conversion+
1100
- p(
1101
- '<b>Please input a DNA sequence.</b>'
1102
- )+
1103
- return_paragraph_of_hyperlinks
1104
- else
1105
- _ = embeddable_interface?.return_intro_for_reverse_complement_conversion
1106
- the_result << HtmlTags.pre(
1107
- Bioroebe.frequency_per_thousand(the_params)
1108
- )
1109
- end
1110
- the_result << embeddable_interface?.return_form_for_codon_frequency_of_this_string
1111
- the_result << embeddable_interface?.hyperlinks_paragraph
1112
- the_result
1113
- }
1114
-
1115
1084
  end
1116
1085
 
1117
- # =========================================================================== #
1118
- # === Bioroebe.start_sinatra_interface
1119
- # =========================================================================== #
1086
+ # ========================================================================= #
1087
+ # === Bioroebe::SinatraWrapper.start_sinatra_interface
1088
+ #
1089
+ # This method can be used to start the sinatra interface.
1090
+ # ========================================================================= #
1120
1091
  def self.start_sinatra_interface
1121
- ::Bioroebe::Sinatra.start_sinatra_interface
1092
+ erev 'Trying to start the sinatra-interface of Bioroebe next.'
1093
+ e
1094
+ erev 'This should use the following URL:'
1095
+ e
1096
+ erev " #{sfancy(Bioroebe::EmbeddableInterface.localhost_to_use?)}"
1097
+ e
1098
+ ::Bioroebe::SinatraWrapper.run!
1122
1099
  end; self.instance_eval { alias start_sinatra start_sinatra_interface } # === Bioroebe.start_sinatra
1123
1100
 
1124
- end if Object.const_defined? :Sinatra
1101
+ end
1125
1102
 
1126
1103
  if __FILE__ == $PROGRAM_NAME
1127
1104
  Bioroebe.start_sinatra_interface