bioroebe 0.12.24 → 0.13.31
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.md +7 -8
- data/README.md +566 -354
- data/bin/all_positions_of_this_nucleotide +1 -1
- data/bin/aminoacid_frequencies +1 -1
- data/bin/automatically_rename_this_fasta_file +1 -1
- data/bin/base_composition +1 -1
- data/bin/batch_create_windows_executables +1 -1
- data/bin/bioroebe +12 -1
- data/bin/bioroebe_cat +7 -0
- data/bin/calculate_exponential_growth +7 -0
- data/bin/calculate_n50_value +1 -1
- data/bin/calculate_the_frequencies_of_this_species +7 -0
- data/bin/chunked_display +1 -1
- data/bin/codon_frequency +1 -1
- data/bin/codon_to_aminoacid +1 -1
- data/bin/colourize_this_fasta_sequence +1 -1
- data/bin/complementary_dna_strand +1 -1
- data/bin/complementary_rna_strand +1 -1
- data/bin/consensus_sequence +1 -1
- data/bin/dna_to_rna +1 -1
- data/bin/downcase_chunked_display +1 -1
- data/bin/download_this_pdb +1 -1
- data/bin/fasta_index +1 -1
- data/bin/fetch_data_from_uniprot +1 -1
- data/bin/filter_away_invalid_nucleotides +1 -1
- data/bin/find_substring +1 -1
- data/bin/input_as_dna +1 -1
- data/bin/is_palindrome +1 -1
- data/bin/leading_five_prime +1 -1
- data/bin/longest_ORF +1 -1
- data/bin/longest_substring +1 -1
- data/bin/open_reading_frames +1 -1
- data/bin/partner_nucleotide +1 -1
- data/bin/plain_palindrome +1 -1
- data/bin/random_dna_sequence +1 -1
- data/bin/random_sequence +1 -1
- data/bin/raw_hamming_distance +1 -1
- data/bin/return_longest_substring_via_LCS_algorithm +1 -1
- data/bin/reverse_sequence +1 -1
- data/bin/short_aminoacid_letter_from_long_aminoacid_name +1 -1
- data/bin/show_atomic_composition +1 -1
- data/bin/show_fasta_header +1 -1
- data/bin/show_nucleotide_sequence +1 -1
- data/bin/show_this_dna_sequence +1 -1
- data/bin/show_time_now +7 -0
- data/bin/sort_aminoacid_based_on_its_hydrophobicity +1 -1
- data/bin/strict_filter_away_invalid_aminoacids +1 -1
- data/{lib/bioroebe/base/reset.rb → bin/three_delimiter} +9 -6
- data/bin/three_to_one +1 -1
- data/bin/to_rna +1 -1
- data/bin/trailing_three_prime +1 -1
- data/bin/upcase_this_aminoacid_sequence_and_remove_numbers +1 -1
- data/bioroebe.gemspec +6 -7
- data/doc/README.gen +534 -322
- data/doc/blosum/blosum.md +4 -0
- data/doc/compatibility/BIO_PHP.md +20 -18
- data/doc/compatibility/README.md +2 -3
- data/doc/compatibility/emboss.md +5 -3
- data/doc/{extensive_usage_example.md → extensive_usage_example/extensive_usage_example.md} +4 -2
- data/doc/{instructions_for_the_taxonomy_subproject.md → instructions_for_the_taxonomy_subproject/instructions_for_the_taxonomy_subproject.md} +36 -33
- data/doc/{legacy_paths.md → legacy_paths/legacy_paths.md} +3 -3
- data/doc/statistics/statistics.md +12 -10
- data/doc/todo/bioroebe_GUI_todo.md +6 -1
- data/doc/todo/bioroebe_java_todo.md +3 -2
- data/doc/todo/bioroebe_todo.md +328 -310
- data/doc/{using_biomart.md → using_biomart/using_biomart.md} +7 -3
- data/lib/bioroebe/abstract/features.rb +0 -0
- data/lib/bioroebe/aminoacids/aminoacid_substitution.rb +1 -1
- data/lib/bioroebe/aminoacids/aminoacids_mass_table.rb +3 -1
- data/lib/bioroebe/aminoacids/codon_percentage.rb +18 -10
- data/lib/bioroebe/aminoacids/create_random_aminoacids.rb +5 -2
- data/lib/bioroebe/aminoacids/deduce_aminoacid_sequence.rb +90 -64
- data/lib/bioroebe/aminoacids/display_aminoacid_table.rb +1 -3
- data/lib/bioroebe/aminoacids/show_hydrophobicity.rb +2 -2
- data/lib/bioroebe/annotations/create_annotation_format.rb +2 -2
- data/lib/bioroebe/base/base.rb +101 -6
- data/lib/bioroebe/base/base_module/base_module.rb +9 -1
- data/lib/bioroebe/base/colours.rb +3 -0
- data/lib/bioroebe/base/colours_for_base/colours_for_base.rb +80 -44
- data/lib/bioroebe/base/commandline_application/README.md +1 -1
- data/lib/bioroebe/base/commandline_application/commandline_application.rb +661 -22
- data/lib/bioroebe/base/commandline_application/commandline_arguments.rb +2 -1
- data/lib/bioroebe/base/infer_the_namespace_module/infer_the_namespace_module.rb +37 -0
- data/lib/bioroebe/base/internal_hash_module/internal_hash_module.rb +1 -6
- data/lib/bioroebe/base/prototype/prototype.rb +155 -14
- data/lib/bioroebe/biomart/attribute.rb +1 -1
- data/lib/bioroebe/biomart/biomart.rb +8 -9
- data/lib/bioroebe/biomart/server.rb +1 -1
- data/lib/bioroebe/blosum/blosum.rb +2 -2
- data/lib/bioroebe/calculate/calculate_blosum_score.rb +5 -3
- data/lib/bioroebe/calculate/calculate_gc_content.rb +1 -1
- data/lib/bioroebe/calculate/calculate_levensthein_distance.rb +5 -3
- data/lib/bioroebe/calculate/calculate_melting_temperature.rb +2 -10
- data/lib/bioroebe/calculate/calculate_melting_temperature_for_more_than_thirteen_nucleotides.rb +6 -15
- data/lib/bioroebe/calculate/calculate_the_position_specific_scoring_matrix.rb +4 -2
- data/lib/bioroebe/cell/cell.rb +3 -2
- data/lib/bioroebe/cell/specialized_cells/B_cell.rb +60 -0
- data/lib/bioroebe/cell/specialized_cells/Macrophage.rb +60 -0
- data/lib/bioroebe/cell/specialized_cells/README.md +5 -0
- data/lib/bioroebe/cell/specialized_cells/T_cell.rb +60 -0
- data/lib/bioroebe/cleave_and_digest/cleave.rb +3 -1
- data/lib/bioroebe/cleave_and_digest/digestion.rb +1 -1
- data/lib/bioroebe/codon_tables/frequencies/10090_Mus_musculus.yml +93 -0
- data/lib/bioroebe/codon_tables/frequencies/107243_Thlaspi_caerulescens.yml +72 -0
- data/lib/bioroebe/codon_tables/frequencies/parse_frequency_table.rb +2 -2
- data/lib/bioroebe/codons/codon_table.rb +10 -2
- data/lib/bioroebe/codons/codons.rb +3 -3
- data/lib/bioroebe/codons/convert_this_codon_to_that_aminoacid.rb +18 -15
- data/lib/bioroebe/codons/determine_optimal_codons.rb +1 -1
- data/lib/bioroebe/codons/possible_codons_for_this_aminoacid.rb +4 -2
- data/lib/bioroebe/codons/show_codon_tables.rb +1 -1
- data/lib/bioroebe/codons/show_codon_usage.rb +1 -2
- data/lib/bioroebe/codons/show_this_codon_table.rb +2 -2
- data/lib/bioroebe/codons/start_codons.rb +7 -3
- data/lib/bioroebe/colours/colour_schemes/README.md +1 -1
- data/lib/bioroebe/colours/colour_schemes/array_available_colour_schemes.rb +3 -3
- data/lib/bioroebe/colours/colour_schemes/colour_scheme.rb +3 -3
- data/lib/bioroebe/colours/colour_schemes/colour_scheme_demo.rb +4 -3
- data/lib/bioroebe/colours/colour_schemes/helix.rb +3 -1
- data/lib/bioroebe/colours/colour_schemes/hydropathy.rb +3 -1
- data/lib/bioroebe/colours/colour_schemes/score.rb +13 -2
- data/lib/bioroebe/colours/colour_schemes/strand.rb +3 -1
- data/lib/bioroebe/colours/colour_schemes/turn.rb +3 -1
- data/lib/bioroebe/colours/colour_schemes/zappo.rb +1 -1
- data/lib/bioroebe/{toplevel_methods/colourize_related_methods.rb → colours/colourize_related_code.rb} +1 -3
- data/lib/bioroebe/colours/colourize_sequence.rb +3 -1
- data/lib/bioroebe/colours/colours.rb +172 -15
- data/lib/bioroebe/configuration/configuration.rb +1 -1
- data/lib/bioroebe/constants/GUIs.rb +2 -2
- data/lib/bioroebe/constants/constants.rb +1349 -0
- data/lib/bioroebe/conversions/convert_aminoacid_to_dna.rb +8 -13
- data/lib/bioroebe/conversions/dna_to_aminoacid_sequence.rb +9 -3
- data/lib/bioroebe/count/count_amount_of_aminoacids.rb +11 -10
- data/lib/bioroebe/count/count_amount_of_nucleotides.rb +1 -1
- data/lib/bioroebe/count/count_at.rb +2 -1
- data/lib/bioroebe/databases/download_taxonomy_database.rb +1 -1
- data/lib/bioroebe/dotplots/advanced_dotplot.rb +2 -2
- data/lib/bioroebe/electron_microscopy/coordinate_analyzer.rb +2 -2
- data/lib/bioroebe/electron_microscopy/fix_pos_file.rb +2 -2
- data/lib/bioroebe/electron_microscopy/flipy.rb +2 -2
- data/lib/bioroebe/electron_microscopy/generate_em2em_file.rb +3 -11
- data/lib/bioroebe/electron_microscopy/parse_coordinates.rb +6 -6
- data/lib/bioroebe/electron_microscopy/read_file_xmd.rb +6 -6
- data/lib/bioroebe/electron_microscopy/simple_star_file_generator.rb +2 -2
- data/lib/bioroebe/enzymes/has_this_restriction_enzyme.rb +1 -1
- data/lib/bioroebe/enzymes/restriction_enzyme.rb +1 -1
- data/lib/bioroebe/enzymes/restriction_enzymes/statistics.rb +4 -3
- data/lib/bioroebe/enzymes/restriction_enzymes_file.rb +1 -1
- data/lib/bioroebe/enzymes/return_sequence_that_is_cut_via_restriction_enzyme.rb +4 -3
- data/lib/bioroebe/enzymes/show_restriction_enzymes.rb +3 -3
- data/lib/bioroebe/ext/main.cpp +0 -1
- data/lib/bioroebe/fasta_and_fastq/autocorrect_the_name_of_this_fasta_file.rb +3 -3
- data/lib/bioroebe/fasta_and_fastq/compact_fasta_file/compact_fasta_file.rb +1 -1
- data/lib/bioroebe/fasta_and_fastq/display_how_many_fasta_entries_are_in_this_directory.rb +1 -1
- data/lib/bioroebe/fasta_and_fastq/download_fasta.rb +8 -14
- data/lib/bioroebe/fasta_and_fastq/fasta_defline/fasta_defline.rb +1 -1
- data/lib/bioroebe/fasta_and_fastq/fasta_to_yaml/fasta_to_yaml.rb +1 -1
- data/lib/bioroebe/fasta_and_fastq/fastq_format_explainer.rb +1 -1
- data/lib/bioroebe/fasta_and_fastq/length_modifier/length_modifier.rb +1 -1
- data/lib/bioroebe/fasta_and_fastq/parse_fasta/parse_fasta.rb +37 -11
- data/lib/bioroebe/fasta_and_fastq/parse_fastq/parse_fastq.rb +2 -2
- data/lib/bioroebe/fasta_and_fastq/return_fasta_subsection_of_this_file.rb +1 -1
- data/lib/bioroebe/fasta_and_fastq/show_fasta_headers.rb +5 -13
- data/lib/bioroebe/fasta_and_fastq/show_fasta_statistics.rb +1 -1
- data/lib/bioroebe/fasta_and_fastq/simplify_fasta_header/simplify_fasta_header.rb +1 -1
- data/lib/bioroebe/fasta_and_fastq/split_this_fasta_file_into_chromosomes/reset.rb +3 -6
- data/lib/bioroebe/fasta_and_fastq/split_this_fasta_file_into_chromosomes/split_this_fasta_file_into_chromosomes.rb +3 -3
- data/lib/bioroebe/genbank/genbank_flat_file_format_generator.rb +20 -11
- data/lib/bioroebe/genome/genome.rb +1 -1
- data/lib/bioroebe/genomes/genome_pattern.rb +17 -16
- data/lib/bioroebe/genomes/genome_retriever.rb +4 -2
- data/lib/bioroebe/gui/experimental/snapgene/snapgene.rb +10 -13
- data/lib/bioroebe/gui/universal_widgets/alignment/alignment.rb +557 -0
- data/lib/bioroebe/gui/{gtk3 → universal_widgets}/aminoacid_composition/aminoacid_composition.rb +498 -198
- data/lib/bioroebe/gui/universal_widgets/anti_sense_strand/anti_sense_strand.rb +665 -0
- data/lib/bioroebe/gui/universal_widgets/blosum_matrix_viewer/blosum_matrix_viewer.rb +329 -0
- data/lib/bioroebe/gui/universal_widgets/calculate_cell_numbers_of_bacteria/calculate_cell_numbers_of_bacteria.rb +423 -0
- data/lib/bioroebe/gui/{gtk3 → universal_widgets}/controller/controller.rb +170 -118
- data/lib/bioroebe/gui/{gtk3 → universal_widgets}/dna_to_aminoacid_widget/dna_to_aminoacid_widget.rb +277 -215
- 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
- data/lib/bioroebe/gui/universal_widgets/fasta_table_widget/fasta_table_widget.rb +643 -0
- data/lib/bioroebe/gui/{gtk3 → universal_widgets}/format_converter/format_converter.rb +236 -164
- data/lib/bioroebe/gui/universal_widgets/gene/gene.rb +278 -0
- data/lib/bioroebe/gui/universal_widgets/hamming_distance/hamming_distance.rb +646 -0
- data/lib/bioroebe/gui/{shared_code/levensthein_distance/levensthein_distance_module.rb → universal_widgets/levensthein_distance/levensthein_distance.rb} +313 -88
- data/lib/bioroebe/gui/{gtk3 → universal_widgets}/nucleotide_analyser/nucleotide_analyser.rb +281 -189
- data/lib/bioroebe/gui/{gtk3 → universal_widgets}/parse_pdb_file/parse_pdb_file.rb +265 -149
- data/lib/bioroebe/gui/{gtk3 → universal_widgets}/primer_design_widget/primer_design_widget.rb +337 -263
- data/lib/bioroebe/gui/universal_widgets/protein_to_DNA/protein_to_DNA.rb +408 -0
- data/lib/bioroebe/gui/{gtk3 → universal_widgets}/random_sequence/random_sequence.rb +245 -187
- data/lib/bioroebe/gui/{gtk3 → universal_widgets}/restriction_enzymes/restriction_enzymes.rb +207 -137
- data/lib/bioroebe/gui/universal_widgets/shell/shell.rb +288 -0
- data/lib/bioroebe/gui/{gtk3/show_codon_table/misc.rb → universal_widgets/show_codon_table/show_codon_table.rb} +290 -110
- 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
- data/lib/bioroebe/gui/{gtk3 → universal_widgets}/sizeseq/sizeseq.rb +151 -69
- data/lib/bioroebe/gui/{gtk3 → universal_widgets}/three_to_one/three_to_one.rb +190 -127
- data/lib/bioroebe/gui/{gtk3 → universal_widgets}/www_finder/www_finder.rb +211 -152
- data/lib/bioroebe/images/images.html +953 -1170
- data/lib/bioroebe/images/misc/README.md +6 -0
- data/lib/bioroebe/images/misc/activation.avif +0 -0
- data/lib/bioroebe/images/misc/inhibition.avif +0 -0
- data/lib/bioroebe/images/misc/small_virus_logo.avif +0 -0
- data/lib/bioroebe/{constants/base_directory.rb → log_directory/log_directory.rb} +79 -59
- data/lib/bioroebe/matplotlib/matplotlib_generator.rb +1 -1
- data/lib/bioroebe/misc/quiz/three_letter_to_aminoacid.rb +1 -1
- data/lib/bioroebe/misc/ruler.rb +5 -5
- data/lib/bioroebe/misc/useful_formulas.rb +3 -3
- data/lib/bioroebe/ncbi/efetch.rb +1 -2
- data/lib/bioroebe/ngs/phred_quality_score_table.rb +3 -3
- data/lib/bioroebe/nucleotides/complementary_dna_strand.rb +3 -6
- data/lib/bioroebe/nucleotides/molecular_weight_of_nucleotides.rb +3 -3
- data/lib/bioroebe/nucleotides/most_likely_nucleotide_sequence_for_this_aminoacid_sequence.rb +6 -10
- data/lib/bioroebe/nucleotides/{show_nucleotide_sequence.rb → show_nucleotide_sequence/show_nucleotide_sequence.rb} +377 -255
- data/lib/bioroebe/palindromes/palindrome_2D_structure.rb +1 -1
- data/lib/bioroebe/palindromes/palindrome_finder.rb +1 -1
- data/lib/bioroebe/palindromes/palindrome_generator.rb +2 -10
- data/lib/bioroebe/parsers/biolang_parser.rb +1 -1
- data/lib/bioroebe/parsers/blosum_parser.rb +14 -19
- data/lib/bioroebe/parsers/genbank_parser.rb +2 -6
- data/lib/bioroebe/parsers/gff.rb +9 -9
- data/lib/bioroebe/parsers/parse_embl.rb +2 -6
- data/lib/bioroebe/parsers/stride_parser.rb +4 -12
- data/lib/bioroebe/patterns/analyse_glycosylation_pattern.rb +2 -2
- data/lib/bioroebe/patterns/is_this_sequence_a_EGF2_pattern.rb +6 -3
- data/lib/bioroebe/patterns/profile_pattern.rb +2 -2
- data/lib/bioroebe/patterns/rgg_scanner.rb +4 -2
- data/lib/bioroebe/{protein_structure → pdb_and_protein_structure}/alpha_helix.rb +2 -2
- data/lib/bioroebe/{pdb → pdb_and_protein_structure}/download_this_pdb.rb +2 -3
- data/lib/bioroebe/{pdb → pdb_and_protein_structure}/fetch_fasta_sequence_from_pdb.rb +4 -4
- data/lib/bioroebe/{protein_structure → pdb_and_protein_structure}/helical_wheel.rb +2 -2
- data/lib/bioroebe/{pdb → pdb_and_protein_structure}/parse_mmCIF_file.rb +1 -1
- data/lib/bioroebe/{pdb → pdb_and_protein_structure}/parse_pdb_file.rb +3 -3
- data/lib/bioroebe/{pdb → pdb_and_protein_structure}/report_secondary_structures_from_this_pdb_file.rb +3 -3
- data/lib/bioroebe/project/project.rb +3 -1
- data/lib/bioroebe/raw_sequence/README.md +8 -8
- data/lib/bioroebe/raw_sequence/raw_sequence.rb +11 -2
- data/lib/bioroebe/regexes/regexes.rb +1 -2
- data/lib/bioroebe/requires/commandline_application.rb +3 -1
- data/lib/bioroebe/requires/require_all_pdb_files.rb +1 -1
- data/lib/bioroebe/requires/require_all_taxonomy_files.rb +1 -1
- data/lib/bioroebe/requires/require_all_utility_scripts_files.rb +10 -0
- data/lib/bioroebe/requires/require_colours.rb +1 -1
- data/lib/bioroebe/requires/require_the_bioroebe_project.rb +5 -7
- data/lib/bioroebe/requires/require_the_bioroebe_sinatra_components.rb +1 -1
- data/lib/bioroebe/requires/require_the_constants.rb +2 -14
- data/lib/bioroebe/requires/require_yaml.rb +7 -5
- data/lib/bioroebe/sequence/alignment.rb +1 -1
- data/lib/bioroebe/sequence/dna.rb +4 -2
- data/lib/bioroebe/sequence/nucleotide_module/nucleotide_module.rb +22 -8
- data/lib/bioroebe/sequence/protein.rb +2 -2
- data/lib/bioroebe/sequence/reverse_complement.rb +3 -3
- data/lib/bioroebe/sequence/rna.rb +9 -8
- data/lib/bioroebe/sequence/sequence.rb +3 -3
- data/lib/bioroebe/shell/configuration/additionally_set_xorg_buffer.yml +0 -0
- data/lib/bioroebe/shell/configuration/may_we_show_the_startup_information.yml +0 -0
- data/lib/bioroebe/shell/configuration/upcase_nucleotides.yml +0 -0
- data/lib/bioroebe/shell/configuration/use_silent_startup.yml +1 -1
- data/lib/bioroebe/shell/help/class.rb +68 -19
- data/lib/bioroebe/shell/menu.rb +5244 -5322
- data/lib/bioroebe/shell/{readline/readline.rb → readline.rb} +1 -3
- data/lib/bioroebe/shell/shell.rb +11240 -453
- data/lib/bioroebe/siRNA/siRNA.rb +3 -3
- data/lib/bioroebe/{gui/shared_code/blosum_matrix_viewer/blosum_matrix_viewer_module.rb → sinatra/sinatra_interface.rb} +28 -19
- data/lib/bioroebe/{www/sinatra/sinatra.rb → sinatra/sinatra_wrapper.rb} +731 -754
- data/lib/bioroebe/string_matching/find_longest_substring.rb +2 -10
- data/lib/bioroebe/string_matching/find_longest_substring_via_LCS_algorithm.rb +4 -14
- data/lib/bioroebe/string_matching/hamming_distance.rb +11 -10
- data/lib/bioroebe/string_matching/levensthein.rb +5 -17
- data/lib/bioroebe/string_matching/simple_string_comparer.rb +48 -4
- data/lib/bioroebe/string_matching/smith_waterman.rb +11 -6
- data/lib/bioroebe/svg/glyph.rb +4 -1
- data/lib/bioroebe/svg/mini_feature.rb +1 -1
- data/lib/bioroebe/svg/page.rb +18 -7
- data/lib/bioroebe/svg/svgee.rb +22 -13
- data/lib/bioroebe/svg/track.rb +20 -4
- data/lib/bioroebe/taxonomy/chart.rb +2 -2
- data/lib/bioroebe/taxonomy/class_methods.rb +5 -6
- data/lib/bioroebe/taxonomy/constants.rb +1 -1
- data/lib/bioroebe/taxonomy/info/info.rb +1 -1
- data/lib/bioroebe/taxonomy/info/is_dna.rb +1 -1
- data/lib/bioroebe/taxonomy/interactive.rb +1 -2
- data/lib/bioroebe/taxonomy/menu.rb +1 -1
- data/lib/bioroebe/taxonomy/node.rb +1 -1
- data/lib/bioroebe/taxonomy/parse_fasta.rb +4 -2
- data/lib/bioroebe/taxonomy/shared.rb +5 -4
- data/lib/bioroebe/taxonomy/taxonomy.rb +2 -4
- data/lib/bioroebe/toplevel_methods/fasta_and_fastq.rb +3 -45
- data/lib/bioroebe/toplevel_methods/{is_on_roebe.rb → roebe.rb} +1 -11
- data/lib/bioroebe/toplevel_methods/taxonomy.rb +6 -12
- data/lib/bioroebe/toplevel_methods/toplevel_methods.rb +5568 -0
- data/lib/bioroebe/utility_scripts/align_open_reading_frames.rb +4 -3
- data/lib/bioroebe/utility_scripts/analyse_local_dataset.rb +2 -2
- data/lib/bioroebe/utility_scripts/check_for_mismatches/check_for_mismatches.rb +16 -9
- data/lib/bioroebe/utility_scripts/compacter/compacter.rb +4 -2
- data/lib/bioroebe/utility_scripts/compare_these_two_sequences_via_blosum.rb +119 -0
- data/lib/bioroebe/utility_scripts/compseq/compseq.rb +11 -9
- data/lib/bioroebe/utility_scripts/{consensus_sequence.rb → consensus_sequence/consensus_sequence.rb} +13 -4
- data/lib/bioroebe/utility_scripts/{create_batch_entrez_file.rb → create_batch_entrez_file/create_batch_entrez_file.rb} +5 -5
- data/lib/bioroebe/utility_scripts/{determine_antigenic_areas.rb → determine_antigenic_areas/determine_antigenic_areas.rb} +5 -5
- data/lib/bioroebe/utility_scripts/{determine_missing_nucleotides_percentage.rb → determine_missing_nucleotides_percentage/determine_missing_nucleotides_percentage.rb} +16 -15
- data/lib/bioroebe/utility_scripts/display_open_reading_frames/display_open_reading_frames.rb +7 -7
- data/lib/bioroebe/utility_scripts/display_open_reading_frames/misc.rb +1 -1
- data/lib/bioroebe/utility_scripts/display_open_reading_frames/report.rb +2 -0
- data/lib/bioroebe/utility_scripts/{dot_alignment.rb → dot_alignment/dot_alignment.rb} +3 -3
- data/lib/bioroebe/utility_scripts/{download_files_from_rebase.rb → download_files_from_rebase/download_files_from_rebase.rb} +5 -5
- data/lib/bioroebe/utility_scripts/fetch_data_from_uniprot/fetch_data_from_uniprot.rb +269 -0
- data/lib/bioroebe/utility_scripts/find_gene.rb +4 -2
- data/lib/bioroebe/utility_scripts/{mirror_repeat.rb → mirror_repeat/mirror_repeat.rb} +5 -5
- data/lib/bioroebe/utility_scripts/move_file_to_its_correct_location.rb +3 -3
- data/lib/bioroebe/utility_scripts/{parse_taxonomy.rb → parse_taxonomy/parse_taxonomy.rb} +15 -6
- data/lib/bioroebe/utility_scripts/{pathways.rb → pathways/pathways.rb} +4 -3
- data/lib/bioroebe/utility_scripts/{permutations.rb → permutations/permutations.rb} +3 -3
- data/lib/bioroebe/utility_scripts/punnet/punnet.rb +4 -2
- data/lib/bioroebe/utility_scripts/{show_this_dna_sequence.rb → show_this_dna_sequence/show_this_dna_sequence.rb} +1 -1
- data/lib/bioroebe/utility_scripts/showorf/showorf.rb +406 -10
- data/lib/bioroebe/version/version.rb +2 -2
- data/lib/bioroebe/viennarna/rnafold_wrapper.rb +5 -13
- data/lib/bioroebe/virus/individual_viruses/README.md +15 -0
- data/lib/bioroebe/virus/individual_viruses/tobacco_mosaic_virus.rb +40 -0
- data/lib/bioroebe/virus/virus.rb +76 -0
- data/lib/bioroebe/www/bioroebe.cgi +4 -3
- data/lib/bioroebe/www/embeddable_interface.rb +85 -49
- data/lib/bioroebe/yaml/agarose/agarose_concentrations.yml +6 -6
- data/lib/bioroebe/yaml/antisense/antisense.yml +2 -0
- data/lib/bioroebe/yaml/blosum/blosum50.yml +6 -0
- data/lib/bioroebe/yaml/blosum/blosum90.yml +2 -1
- data/lib/bioroebe/yaml/chromosomes/chromosome_numbers.yml +2 -2
- data/lib/bioroebe/yaml/configuration/temp_dir.yml +1 -1
- data/lib/bioroebe/yaml/consensus_sequences/consensus_sequences.yml +1 -0
- data/lib/bioroebe/yaml/enzymes/enzyme_classes.yml +7 -6
- data/lib/bioroebe/yaml/humans/human_chromosomes.yml +3 -3
- data/lib/bioroebe/yaml/mRNA/mRNA.yml +1 -5
- data/lib/bioroebe/yaml/nucleotides/abbreviations_for_nucleotides.yml +1 -0
- data/lib/bioroebe/yaml/nucleotides/nucleotide_density.yml +2 -1
- data/lib/bioroebe/yaml/promoters/35S.yml +3 -1
- data/lib/bioroebe/yaml/proteases/proteases.yml +3 -1
- data/lib/bioroebe/yaml/proteins/ubiquitin.yml +4 -1
- data/lib/bioroebe/yaml/restriction_enzymes/restriction_enzymes.yml +7 -7
- data/spec/testing_toplevel_method_editor.rb +1 -1
- data/spec/testing_toplevel_method_verbose.rb +1 -1
- data/test/testing_dna_to_rna_conversion.rb +1 -1
- metadata +127 -235
- data/doc/blosum.md +0 -5
- data/lib/bioroebe/base/commandline_application/aminoacids.rb +0 -33
- data/lib/bioroebe/base/commandline_application/directory.rb +0 -33
- data/lib/bioroebe/base/commandline_application/extract.rb +0 -22
- data/lib/bioroebe/base/commandline_application/misc.rb +0 -502
- data/lib/bioroebe/base/commandline_application/opn.rb +0 -47
- data/lib/bioroebe/base/commandline_application/reset.rb +0 -42
- data/lib/bioroebe/base/commandline_application/warnings.rb +0 -36
- data/lib/bioroebe/base/commandline_application/write_what_into.rb +0 -29
- data/lib/bioroebe/base/initialize.rb +0 -18
- data/lib/bioroebe/base/misc.rb +0 -129
- data/lib/bioroebe/base/namespace.rb +0 -16
- data/lib/bioroebe/base/prototype/e_and_ee.rb +0 -24
- data/lib/bioroebe/base/prototype/misc.rb +0 -114
- data/lib/bioroebe/base/prototype/mkdir.rb +0 -20
- data/lib/bioroebe/base/prototype/reset.rb +0 -36
- data/lib/bioroebe/colours/misc_colours.rb +0 -80
- data/lib/bioroebe/colours/rev.rb +0 -44
- data/lib/bioroebe/colours/sdir.rb +0 -21
- data/lib/bioroebe/colours/sfancy.rb +0 -21
- data/lib/bioroebe/colours/sfile.rb +0 -21
- data/lib/bioroebe/colours/simp.rb +0 -21
- data/lib/bioroebe/colours/swarn.rb +0 -29
- data/lib/bioroebe/constants/aminoacids_and_proteins.rb +0 -147
- data/lib/bioroebe/constants/carriage_return.rb +0 -14
- data/lib/bioroebe/constants/codon_tables.rb +0 -77
- data/lib/bioroebe/constants/database_constants.rb +0 -107
- data/lib/bioroebe/constants/files_and_directories.rb +0 -606
- data/lib/bioroebe/constants/misc.rb +0 -209
- data/lib/bioroebe/constants/newline.rb +0 -14
- data/lib/bioroebe/constants/nucleotides.rb +0 -121
- data/lib/bioroebe/constants/regex.rb +0 -28
- data/lib/bioroebe/constants/roebe.rb +0 -38
- data/lib/bioroebe/constants/row_terminator.rb +0 -16
- data/lib/bioroebe/constants/tabulator.rb +0 -14
- data/lib/bioroebe/constants/unicode.rb +0 -12
- data/lib/bioroebe/constants/urls.rb +0 -50
- data/lib/bioroebe/gui/gtk +0 -1
- data/lib/bioroebe/gui/gtk3/README.md +0 -2
- data/lib/bioroebe/gui/gtk3/alignment/alignment.rb +0 -306
- data/lib/bioroebe/gui/gtk3/anti_sense_strand/anti_sense_strand.rb +0 -29
- data/lib/bioroebe/gui/gtk3/blosum_matrix_viewer/blosum_matrix_viewer.rb +0 -195
- data/lib/bioroebe/gui/gtk3/calculate_cell_numbers_of_bacteria/calculate_cell_numbers_of_bacteria.rb +0 -105
- data/lib/bioroebe/gui/gtk3/dna_to_reverse_complement_widget/dna_to_reverse_complement_widget.rb +0 -188
- data/lib/bioroebe/gui/gtk3/fasta_table_widget/fasta_table_widget.rb +0 -322
- data/lib/bioroebe/gui/gtk3/gene/gene.rb +0 -181
- data/lib/bioroebe/gui/gtk3/hamming_distance/hamming_distance.rb +0 -383
- data/lib/bioroebe/gui/gtk3/levensthein_distance/levensthein_distance.rb +0 -174
- data/lib/bioroebe/gui/gtk3/protein_to_DNA/protein_to_DNA.rb +0 -181
- data/lib/bioroebe/gui/gtk3/show_codon_table/show_codon_table.rb +0 -101
- data/lib/bioroebe/gui/gtk3/show_codon_usage/show_codon_usage.rb +0 -145
- data/lib/bioroebe/gui/gtk3/three_to_one/title.rb +0 -23
- data/lib/bioroebe/gui/jruby/alignment/alignment.rb +0 -165
- data/lib/bioroebe/gui/jruby/aminoacid_composition/aminoacid_composition.rb +0 -166
- data/lib/bioroebe/gui/jruby/blosum_matrix_viewer/blosum_matrix_viewer.rb +0 -82
- data/lib/bioroebe/gui/libui/README.md +0 -4
- data/lib/bioroebe/gui/libui/alignment/alignment.rb +0 -116
- data/lib/bioroebe/gui/libui/blosum_matrix_viewer/blosum_matrix_viewer.rb +0 -112
- data/lib/bioroebe/gui/libui/calculate_cell_numbers_of_bacteria/calculate_cell_numbers_of_bacteria.rb +0 -60
- data/lib/bioroebe/gui/libui/controller/controller.rb +0 -116
- data/lib/bioroebe/gui/libui/dna_to_aminoacid_widget/dna_to_aminoacid_widget.rb +0 -161
- data/lib/bioroebe/gui/libui/dna_to_reverse_complement_widget/dna_to_reverse_complement_widget.rb +0 -76
- data/lib/bioroebe/gui/libui/hamming_distance/hamming_distance.rb +0 -135
- data/lib/bioroebe/gui/libui/levensthein_distance/levensthein_distance.rb +0 -118
- data/lib/bioroebe/gui/libui/protein_to_DNA/protein_to_DNA.rb +0 -115
- data/lib/bioroebe/gui/libui/random_sequence/random_sequence.rb +0 -190
- data/lib/bioroebe/gui/libui/show_codon_table/show_codon_table.rb +0 -134
- data/lib/bioroebe/gui/libui/show_codon_usage/show_codon_usage.rb +0 -89
- data/lib/bioroebe/gui/libui/three_to_one/three_to_one.rb +0 -113
- data/lib/bioroebe/gui/shared_code/alignment/alignment_module.rb +0 -102
- data/lib/bioroebe/gui/shared_code/aminoacid_composition/aminoacid_composition_module.rb +0 -94
- data/lib/bioroebe/gui/shared_code/calculate_cell_numbers_of_bacteria/calculate_cell_numbers_of_bacteria_module.rb +0 -216
- data/lib/bioroebe/gui/shared_code/protein_to_DNA/protein_to_DNA_module.rb +0 -192
- data/lib/bioroebe/gui/shared_code/show_codon_table/show_codon_table_module.rb +0 -72
- data/lib/bioroebe/gui/tk/aminoacid_composition/aminoacid_composition.rb +0 -206
- data/lib/bioroebe/gui/tk/blosum_matrix_viewer/blosum_matrix_viewer.rb +0 -140
- data/lib/bioroebe/gui/tk/hamming_distance/hamming_distance.rb +0 -262
- data/lib/bioroebe/gui/tk/levensthein_distance/levensthein_distance.rb +0 -243
- data/lib/bioroebe/gui/tk/three_to_one/three_to_one.rb +0 -199
- data/lib/bioroebe/gui/unified_widgets/anti_sense_strand/anti_sense_strand.rb +0 -519
- data/lib/bioroebe/shell/colours/colours.rb +0 -235
- data/lib/bioroebe/shell/help/help.rb +0 -25
- data/lib/bioroebe/shell/misc.rb +0 -10227
- data/lib/bioroebe/toplevel_methods/ad_hoc_task.rb +0 -56
- data/lib/bioroebe/toplevel_methods/aminoacids_and_proteins.rb +0 -722
- data/lib/bioroebe/toplevel_methods/atomic_composition.rb +0 -198
- data/lib/bioroebe/toplevel_methods/base_composition.rb +0 -121
- data/lib/bioroebe/toplevel_methods/blast.rb +0 -153
- data/lib/bioroebe/toplevel_methods/calculate_n50_value.rb +0 -57
- data/lib/bioroebe/toplevel_methods/cat.rb +0 -71
- data/lib/bioroebe/toplevel_methods/chunked_display.rb +0 -92
- data/lib/bioroebe/toplevel_methods/cliner.rb +0 -81
- data/lib/bioroebe/toplevel_methods/complement.rb +0 -58
- data/lib/bioroebe/toplevel_methods/convert_global_env.rb +0 -39
- data/lib/bioroebe/toplevel_methods/databases.rb +0 -73
- data/lib/bioroebe/toplevel_methods/delimiter.rb +0 -19
- data/lib/bioroebe/toplevel_methods/digest.rb +0 -81
- data/lib/bioroebe/toplevel_methods/download_and_fetch_data.rb +0 -146
- data/lib/bioroebe/toplevel_methods/e.rb +0 -20
- data/lib/bioroebe/toplevel_methods/editor.rb +0 -21
- data/lib/bioroebe/toplevel_methods/esystem.rb +0 -22
- data/lib/bioroebe/toplevel_methods/exponential_growth.rb +0 -74
- data/lib/bioroebe/toplevel_methods/extract.rb +0 -56
- data/lib/bioroebe/toplevel_methods/file_and_directory_related_actions.rb +0 -269
- data/lib/bioroebe/toplevel_methods/frequencies.rb +0 -99
- data/lib/bioroebe/toplevel_methods/hamming_distance.rb +0 -60
- data/lib/bioroebe/toplevel_methods/infer.rb +0 -66
- data/lib/bioroebe/toplevel_methods/leading_five_prime_and_trailing_three_prime.rb +0 -101
- data/lib/bioroebe/toplevel_methods/levensthein.rb +0 -63
- data/lib/bioroebe/toplevel_methods/log_directory.rb +0 -109
- data/lib/bioroebe/toplevel_methods/longest_common_substring.rb +0 -55
- data/lib/bioroebe/toplevel_methods/map_ncbi_entry_to_eutils_id.rb +0 -88
- data/lib/bioroebe/toplevel_methods/matches.rb +0 -259
- data/lib/bioroebe/toplevel_methods/misc.rb +0 -596
- data/lib/bioroebe/toplevel_methods/nucleotides.rb +0 -787
- data/lib/bioroebe/toplevel_methods/number_of_clones.rb +0 -63
- data/lib/bioroebe/toplevel_methods/open_in_browser.rb +0 -79
- data/lib/bioroebe/toplevel_methods/open_reading_frames.rb +0 -236
- data/lib/bioroebe/toplevel_methods/opn.rb +0 -34
- data/lib/bioroebe/toplevel_methods/palindromes.rb +0 -155
- data/lib/bioroebe/toplevel_methods/parse.rb +0 -59
- data/lib/bioroebe/toplevel_methods/phred_error_probability.rb +0 -68
- data/lib/bioroebe/toplevel_methods/rds.rb +0 -24
- data/lib/bioroebe/toplevel_methods/remove.rb +0 -86
- data/lib/bioroebe/toplevel_methods/return_source_code_of_this_method.rb +0 -35
- data/lib/bioroebe/toplevel_methods/return_subsequence_based_on_indices.rb +0 -68
- data/lib/bioroebe/toplevel_methods/rna_splicing.rb +0 -73
- data/lib/bioroebe/toplevel_methods/rnalfold.rb +0 -69
- data/lib/bioroebe/toplevel_methods/searching_and_finding.rb +0 -116
- data/lib/bioroebe/toplevel_methods/shuffleseq.rb +0 -37
- data/lib/bioroebe/toplevel_methods/statistics.rb +0 -53
- data/lib/bioroebe/toplevel_methods/sum_of_odd_integers.rb +0 -62
- data/lib/bioroebe/toplevel_methods/three_delimiter.rb +0 -34
- data/lib/bioroebe/toplevel_methods/time_and_date.rb +0 -53
- data/lib/bioroebe/toplevel_methods/to_camelcase.rb +0 -31
- data/lib/bioroebe/toplevel_methods/truncate.rb +0 -48
- data/lib/bioroebe/toplevel_methods/url.rb +0 -36
- data/lib/bioroebe/toplevel_methods/verbose.rb +0 -59
- data/lib/bioroebe/utility_scripts/showorf/constants.rb +0 -31
- data/lib/bioroebe/utility_scripts/showorf/help.rb +0 -33
- data/lib/bioroebe/utility_scripts/showorf/initialize.rb +0 -52
- data/lib/bioroebe/utility_scripts/showorf/menu.rb +0 -68
- data/lib/bioroebe/utility_scripts/showorf/reset.rb +0 -36
- data/lib/bioroebe/utility_scripts/showorf/run.rb +0 -152
- data/lib/bioroebe/utility_scripts/showorf/show.rb +0 -97
- /data/doc/{german_names_for_the_aminoacids.md → german_names_for_the_aminoacids/german_names_for_the_aminoacids.md} +0 -0
- /data/doc/{pdb_ATOM_entry.md → pdb_ATOM_entry/pdb_ATOM_entry.md} +0 -0
- /data/doc/{resources.md → resources/resources.md} +0 -0
- /data/lib/bioroebe/gui/{gtk3 → universal_widgets}/aminoacid_composition/customized_dialog.rb +0 -0
- /data/lib/bioroebe/gui/{gtk3 → universal_widgets}/anti_sense_strand/anti_sense_strand.config +0 -0
- /data/lib/bioroebe/gui/{gtk3 → universal_widgets}/calculate_cell_numbers_of_bacteria/calculate_cell_numbers_of_bacteria.config +0 -0
- /data/lib/bioroebe/gui/{gtk3 → universal_widgets}/dna_to_reverse_complement_widget/dna_to_reverse_complement_widget.config +0 -0
- /data/lib/bioroebe/gui/{gtk3 → universal_widgets}/hamming_distance/hamming_distance.config +0 -0
- /data/lib/bioroebe/gui/{gtk3 → universal_widgets}/levensthein_distance/levensthein_distance.config +0 -0
- /data/lib/bioroebe/gui/{gtk3 → universal_widgets}/protein_to_DNA/protein_to_DNA.config +0 -0
- /data/lib/bioroebe/gui/{gtk3 → universal_widgets}/restriction_enzymes/restriction_enzymes.config +0 -0
- /data/lib/bioroebe/gui/{gtk3 → universal_widgets}/www_finder/www_finder.config +0 -0
- /data/lib/bioroebe/yaml/{base_composition_of_dna.yml → base_composition_of_dna/base_composition_of_dna.yml} +0 -0
- /data/lib/bioroebe/yaml/{nuclear_localization_sequences.yml → nuclear_localization_sequences/nuclear_localization_sequences.yml} +0 -0
- /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/
|
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
|
-
|
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::
|
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::
|
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
|
-
|
45
|
-
|
46
|
-
|
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
|
-
# ===
|
57
|
+
# === / (main tag)
|
58
|
+
#
|
59
|
+
# This is the root tag, the root of our web-application.
|
51
60
|
# ========================================================================= #
|
52
|
-
|
53
|
-
|
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
|
-
|
67
|
+
}
|
68
|
+
|
69
|
+
# ========================================================================= #
|
70
|
+
# === reset (reset tag)
|
71
|
+
# ========================================================================= #
|
72
|
+
def reset
|
56
73
|
end
|
57
74
|
|
58
75
|
# ========================================================================= #
|
59
|
-
# ===
|
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/
|
178
|
+
# http://localhost:4568/chunked
|
64
179
|
#
|
65
180
|
# Example:
|
66
181
|
#
|
67
|
-
# http://localhost:4568/
|
182
|
+
# http://localhost:4568/chunked/ATGCUUUUUUUUUU
|
68
183
|
#
|
69
184
|
# ========================================================================= #
|
70
|
-
|
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
|
-
|
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>
|
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 <<
|
97
|
-
|
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?.
|
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
|
-
#
|
249
|
+
# === chunked_display
|
250
|
+
#
|
251
|
+
# http://localhost:4568/chunked_display
|
252
|
+
# http://localhost:4568/chunked
|
253
|
+
# http://localhost:4568/upcase
|
111
254
|
# ========================================================================= #
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
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
|
-
#
|
263
|
+
# === /to_dna
|
141
264
|
#
|
142
|
-
#
|
265
|
+
# Usage Examples:
|
266
|
+
#
|
267
|
+
# http://localhost:4568/to_dna
|
268
|
+
# http://localhost:4568/to_dna/AGUCGAUCGUAUGCAGUCAGUCA
|
143
269
|
#
|
144
270
|
# =========================================================================== #
|
145
|
-
get('/
|
146
|
-
embeddable_interface?.
|
271
|
+
get('/to_dna'){
|
272
|
+
embeddable_interface?.return_sinatra_to_dna
|
147
273
|
}
|
148
274
|
|
149
275
|
# ========================================================================= #
|
150
|
-
#
|
151
|
-
#
|
152
|
-
# http://localhost:4568/shuffleseq
|
276
|
+
# http://localhost:4568/to_aa
|
277
|
+
# http://localhost:4568/to_aminoacids
|
153
278
|
# ========================================================================= #
|
154
|
-
|
279
|
+
Bioroebe::EmbeddableInterface::ARRAY_FOR_TO_AMINOACIDS_CONVERSION.each {|target|
|
155
280
|
get(target) {
|
156
|
-
Cyberweb
|
157
|
-
title: '
|
158
|
-
body:
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
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
|
-
# ===
|
292
|
+
# === /mirror_source
|
293
|
+
#
|
294
|
+
# http://localhost:4568/mirror_source
|
168
295
|
# ========================================================================= #
|
169
|
-
get('/
|
170
|
-
|
171
|
-
if
|
172
|
-
|
173
|
-
|
174
|
-
|
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
|
-
'
|
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
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
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 =
|
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 =
|
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
|
-
# ===
|
516
|
+
# === Convert into DNA (2 tag, second entry, reverse_complement tag)
|
449
517
|
#
|
450
|
-
# This method will
|
451
|
-
# sequence.
|
518
|
+
# This method will convert RNA into DNA.
|
452
519
|
#
|
453
|
-
# http://localhost:4568/
|
520
|
+
# http://localhost:4568/reverse_complement
|
454
521
|
#
|
455
522
|
# Example:
|
456
523
|
#
|
457
|
-
# http://localhost:4568/
|
524
|
+
# http://localhost:4568/reverse_complement/ATGCUUUUUUUUUU
|
458
525
|
#
|
459
526
|
# ========================================================================= #
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
the_params = params[
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
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
|
-
'
|
548
|
+
'reverse-complemented into DNA.</b>'
|
480
549
|
)+
|
481
550
|
return_paragraph_of_hyperlinks
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
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
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
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
|
-
|
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 =
|
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 =
|
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
|
-
|
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
|
-
|
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
|
-
# === /
|
670
|
-
#
|
671
|
-
# Usage Examples:
|
717
|
+
# ========================================================================= #
|
718
|
+
# === /codon_frequency_of_this_string
|
672
719
|
#
|
673
|
-
#
|
674
|
-
#
|
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
|
-
|
678
|
-
|
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
|
-
# ===
|
740
|
+
# === mirror*
|
683
741
|
#
|
684
742
|
# This method will convert RNA into DNA.
|
685
743
|
#
|
686
|
-
# http://localhost:4568/
|
744
|
+
# http://localhost:4568/mirror
|
687
745
|
#
|
688
746
|
# Example:
|
689
747
|
#
|
690
|
-
# http://localhost:4568/
|
748
|
+
# http://localhost:4568/mirror/ATGCUUUUUUUUUU
|
691
749
|
#
|
692
750
|
# ========================================================================= #
|
693
|
-
get('/
|
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
|
-
|
703
|
-
the_params
|
704
|
-
|
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?.
|
708
|
-
|
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?.
|
715
|
-
|
716
|
-
|
717
|
-
|
718
|
-
|
719
|
-
|
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?.
|
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
|
-
# === /
|
786
|
+
# === /blosum
|
772
787
|
#
|
773
788
|
# Example:
|
774
789
|
#
|
775
|
-
# http://localhost:4568/
|
790
|
+
# http://localhost:4568/blosum
|
776
791
|
#
|
777
792
|
# =========================================================================== #
|
778
|
-
get('/
|
779
|
-
|
780
|
-
|
781
|
-
|
782
|
-
|
783
|
-
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
|
789
|
-
|
790
|
-
|
791
|
-
|
792
|
-
|
793
|
-
|
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
|
-
|
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
|
-
|
846
|
+
p(
|
861
847
|
'<b style="color: darkgreen">The input sequence was:</b> <b>'+the_params+'</b>'
|
862
848
|
)+
|
863
|
-
|
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
|
-
|
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
|
-
|
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
|
-
# ===
|
879
|
-
#
|
880
|
-
|
881
|
-
|
882
|
-
|
883
|
-
|
884
|
-
|
885
|
-
|
886
|
-
|
887
|
-
|
888
|
-
|
889
|
-
|
890
|
-
|
891
|
-
|
892
|
-
|
893
|
-
|
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
|
-
# ===
|
925
|
+
# =========================================================================== #
|
926
|
+
# === reverse_complement
|
905
927
|
#
|
906
|
-
#
|
928
|
+
# Invocation example:
|
907
929
|
#
|
908
|
-
# http://localhost:4568/
|
930
|
+
# http://localhost:4568/reverse_complement
|
909
931
|
#
|
910
|
-
#
|
932
|
+
# =========================================================================== #
|
933
|
+
get('/reverse_complement'){
|
934
|
+
embeddable_interface?.method_reverse_complement
|
935
|
+
}
|
936
|
+
|
937
|
+
# =========================================================================== #
|
938
|
+
# === n_stop_codons_in_this_sequence
|
911
939
|
#
|
912
|
-
#
|
940
|
+
# Invocation example:
|
913
941
|
#
|
914
|
-
#
|
915
|
-
|
916
|
-
|
917
|
-
|
918
|
-
|
919
|
-
|
920
|
-
|
921
|
-
|
922
|
-
|
923
|
-
|
924
|
-
|
925
|
-
|
926
|
-
|
927
|
-
|
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
|
-
|
934
|
-
|
935
|
-
|
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
|
-
|
940
|
-
|
941
|
-
|
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
|
-
# === /
|
966
|
+
# =========================================================================== #
|
967
|
+
# === /compseq
|
951
968
|
#
|
952
|
-
#
|
953
|
-
#
|
954
|
-
|
955
|
-
|
956
|
-
|
957
|
-
|
958
|
-
|
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 =
|
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 <<
|
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
|
-
# ===
|
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/
|
1046
|
+
# http://localhost:4568/random_aminoacids/33
|
1022
1047
|
# ========================================================================= #
|
1023
|
-
['/
|
1048
|
+
['/random_aminoacids/*'].each {|target|
|
1024
1049
|
get(target) {
|
1025
|
-
|
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>
|
1054
|
+
'<b>Please provide some argument to this API.</b>'
|
1054
1055
|
)+
|
1055
|
-
|
1056
|
-
|
1057
|
-
|
1058
|
-
|
1059
|
-
|
1060
|
-
|
1061
|
-
|
1062
|
-
|
1063
|
-
|
1064
|
-
|
1065
|
-
|
1066
|
-
|
1067
|
-
|
1068
|
-
|
1069
|
-
|
1070
|
-
|
1071
|
-
|
1072
|
-
|
1073
|
-
|
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
|
-
|
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
|
1101
|
+
end
|
1125
1102
|
|
1126
1103
|
if __FILE__ == $PROGRAM_NAME
|
1127
1104
|
Bioroebe.start_sinatra_interface
|