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
@@ -5,65 +5,61 @@
|
|
5
5
|
# === Bioroebe::ShowNucleotideSequence
|
6
6
|
#
|
7
7
|
# This class, which is quite flexible, can be used to show a nucleotide
|
8
|
-
# sequence. In theory it may also show an aminoacid
|
9
|
-
# the time being we will only show nucleotides.
|
8
|
+
# sequence (on the commandline). In theory it may also show an aminoacid
|
9
|
+
# sequence, but for the time being we will only show nucleotides.
|
10
|
+
#
|
11
|
+
# Usage example:
|
12
|
+
#
|
13
|
+
# Bioroebe::ShowNucleotideSequence.new(ARGV)
|
14
|
+
#
|
10
15
|
# =========================================================================== #
|
11
|
-
# require 'bioroebe/nucleotides/show_nucleotide_sequence.rb'
|
16
|
+
# require 'bioroebe/nucleotides/show_nucleotide_sequence/show_nucleotide_sequence.rb'
|
12
17
|
# Bioroebe::ShowNucleotideSequence.new(ARGV)
|
13
18
|
# =========================================================================== #
|
14
|
-
require 'bioroebe/base/colours_for_base/colours_for_base'
|
15
|
-
require 'bioroebe/requires/require_sequence.rb'
|
16
|
-
|
17
19
|
module Bioroebe
|
18
20
|
|
21
|
+
require 'bioroebe/requires/require_sequence.rb'
|
22
|
+
|
19
23
|
class ShowNucleotideSequence < ::Bioroebe::Sequence # === Bioroebe::ShowNucleotideSequence
|
20
|
-
|
24
|
+
|
25
|
+
alias ee print
|
26
|
+
|
21
27
|
require 'bioroebe/misc/ruler.rb'
|
22
|
-
require 'bioroebe/toplevel_methods/
|
28
|
+
require 'bioroebe/toplevel_methods/toplevel_methods.rb'
|
29
|
+
|
30
|
+
require 'bioroebe/base/commandline_application/commandline_arguments.rb'
|
31
|
+
include Bioroebe::CommandlineArguments
|
32
|
+
|
33
|
+
require 'bioroebe/base/internal_hash_module/internal_hash_module.rb'
|
34
|
+
include Bioroebe::InternalHashModule
|
23
35
|
|
36
|
+
require 'bioroebe/base/infer_the_namespace_module/infer_the_namespace_module.rb'
|
37
|
+
include Bioroebe::InferTheNamespaceModule
|
38
|
+
|
39
|
+
require 'bioroebe/base/colours_for_base/colours_for_base'
|
24
40
|
include ::Bioroebe::ColoursForBase
|
25
41
|
|
26
42
|
# ========================================================================= #
|
27
43
|
# === Bioroebe::ShowNucleotideSequence::USE_THIS_COLOUR
|
28
44
|
#
|
29
|
-
# This
|
45
|
+
# This colour is usually "steelblue".
|
30
46
|
# ========================================================================= #
|
31
47
|
USE_THIS_COLOUR = USE_THIS_COLOUR_FOR_DNA
|
32
48
|
|
33
49
|
# ========================================================================= #
|
34
50
|
# === initialize
|
51
|
+
#
|
52
|
+
# The first argument to this class will become the sequence that is
|
53
|
+
# to be displayed, such as 'ATCG'.
|
35
54
|
# ========================================================================= #
|
36
55
|
def initialize(
|
37
|
-
|
38
|
-
run_already
|
56
|
+
commandline_arguments = nil,
|
57
|
+
run_already = true
|
39
58
|
)
|
40
59
|
reset
|
41
|
-
|
42
|
-
|
43
|
-
if this_sequence.any? {|entry| entry.start_with? '--' }
|
44
|
-
set_commandline_arguments(
|
45
|
-
select_commandline_arguments(this_sequence)
|
46
|
-
)
|
47
|
-
this_sequence.reject! {|inner_entry| inner_entry.start_with? '--' }
|
48
|
-
menu(@commandline_arguments)
|
49
|
-
end
|
50
|
-
end
|
51
|
-
set_this_sequence(
|
52
|
-
this_sequence
|
60
|
+
set_commandline_arguments(
|
61
|
+
commandline_arguments
|
53
62
|
)
|
54
|
-
case run_already
|
55
|
-
# ======================================================================= #
|
56
|
-
# === :do_not_run_yet
|
57
|
-
# ======================================================================= #
|
58
|
-
when :do_not_run_yet,
|
59
|
-
:do_not_run
|
60
|
-
run_already = false
|
61
|
-
# ======================================================================= #
|
62
|
-
# === :do_not_report_anything
|
63
|
-
# ======================================================================= #
|
64
|
-
when :do_not_report_anything
|
65
|
-
do_not_report_anything
|
66
|
-
end
|
67
63
|
# ======================================================================= #
|
68
64
|
# === Handle blocks next
|
69
65
|
# ======================================================================= #
|
@@ -102,78 +98,125 @@ class ShowNucleotideSequence < ::Bioroebe::Sequence # === Bioroebe::ShowNucleoti
|
|
102
98
|
end
|
103
99
|
end
|
104
100
|
end
|
101
|
+
case run_already
|
102
|
+
# ======================================================================= #
|
103
|
+
# === :do_not_run_yet
|
104
|
+
# ======================================================================= #
|
105
|
+
when :do_not_run_yet,
|
106
|
+
:do_not_run
|
107
|
+
run_already = false
|
108
|
+
# ======================================================================= #
|
109
|
+
# === :do_not_report_anything
|
110
|
+
# ======================================================================= #
|
111
|
+
when :do_not_report_anything
|
112
|
+
do_not_report_anything
|
113
|
+
end
|
105
114
|
run if run_already
|
106
115
|
end
|
107
116
|
|
108
117
|
# ========================================================================= #
|
109
|
-
# === reset
|
118
|
+
# === reset (reset tag)
|
110
119
|
# ========================================================================= #
|
111
120
|
def reset
|
112
|
-
|
121
|
+
reset_the_internal_hash # This should come first here.
|
122
|
+
infer_the_namespace
|
123
|
+
enable_colours # This has to be called, in order to get colours-support.
|
113
124
|
# ======================================================================= #
|
114
|
-
# ===
|
115
|
-
#
|
116
|
-
|
117
|
-
# ======================================================================= #
|
118
|
-
# === @sequence_for_display
|
119
|
-
# ======================================================================= #
|
120
|
-
@sequence_for_display = nil
|
121
|
-
# ======================================================================= #
|
122
|
-
# === @may_we_report
|
125
|
+
# === :padding_to_use
|
126
|
+
#
|
127
|
+
# How much padding to use when displaying something.
|
123
128
|
# ======================================================================= #
|
124
|
-
|
129
|
+
set_padding_to_use(7) # 7 * ' '.
|
125
130
|
# ======================================================================= #
|
126
|
-
# === @
|
131
|
+
# === @internal_hash[:show_in_dashed_form]
|
132
|
+
#
|
133
|
+
# The dashed form is e. g. "ATG-GGC-CGC". By default this is not
|
134
|
+
# enabled.
|
127
135
|
# ======================================================================= #
|
128
|
-
@
|
136
|
+
@internal_hash[:show_in_dashed_form] = false
|
129
137
|
# ======================================================================= #
|
130
|
-
# ===
|
138
|
+
# === :sequence_for_display
|
139
|
+
#
|
140
|
+
# Must be nil initially.
|
131
141
|
# ======================================================================= #
|
132
|
-
@
|
142
|
+
@internal_hash[:sequence_for_display] = nil
|
133
143
|
# ======================================================================= #
|
134
|
-
# === @
|
144
|
+
# === @internal_hash[:show_ruler]
|
145
|
+
#
|
146
|
+
# The next variable determines whether a ruler will be displayed
|
147
|
+
# on top of the nucleotide-sequence.
|
135
148
|
# ======================================================================= #
|
136
|
-
@
|
149
|
+
@internal_hash[:show_ruler] = false
|
137
150
|
# ======================================================================= #
|
138
|
-
# ===
|
139
|
-
#
|
140
|
-
# How much padding to use when displaying something.
|
151
|
+
# === :show_five_prime_leader
|
141
152
|
# ======================================================================= #
|
142
|
-
@
|
153
|
+
@internal_hash[:show_five_prime_leader] = true
|
143
154
|
# ======================================================================= #
|
144
|
-
# ===
|
145
|
-
#
|
146
|
-
# The dashed form is e. g. "ATG-GGC-CGC". By default this is not
|
147
|
-
# enable.
|
155
|
+
# === :shall_we_report
|
148
156
|
# ======================================================================= #
|
149
|
-
@
|
157
|
+
@internal_hash[:shall_we_report] = true
|
150
158
|
# ======================================================================= #
|
151
|
-
# ===
|
152
|
-
#
|
153
|
-
# The next variable determines whether a ruler will be displayed
|
154
|
-
# on top of the nucleotide-sequence.
|
159
|
+
# === :show_three_prime_trailer
|
155
160
|
# ======================================================================= #
|
156
|
-
@
|
161
|
+
@internal_hash[:show_three_prime_trailer] = true
|
157
162
|
# ======================================================================= #
|
158
|
-
# === @array_colourize_these_substrings
|
163
|
+
# === @internal_hash[:array_colourize_these_substrings]
|
159
164
|
# ======================================================================= #
|
160
|
-
@array_colourize_these_substrings = []
|
165
|
+
@internal_hash[:array_colourize_these_substrings] = []
|
161
166
|
end
|
162
167
|
|
163
168
|
# ========================================================================= #
|
164
|
-
# ===
|
169
|
+
# === do_not_report_anything
|
165
170
|
# ========================================================================= #
|
166
|
-
def
|
167
|
-
@
|
171
|
+
def do_not_report_anything
|
172
|
+
@internal_hash[:shall_we_report] = false
|
173
|
+
end
|
174
|
+
|
175
|
+
# ========================================================================= #
|
176
|
+
# === show_five_prime_leader?
|
177
|
+
# ========================================================================= #
|
178
|
+
def show_five_prime_leader?
|
179
|
+
@internal_hash[:show_five_prime_leader]
|
180
|
+
end
|
181
|
+
|
182
|
+
# ========================================================================= #
|
183
|
+
# === colourize_dna_sequence
|
184
|
+
#
|
185
|
+
# This method should be used to colourize the primary DNA/RNA sequence.
|
186
|
+
# ========================================================================= #
|
187
|
+
def colourize_dna_sequence(i = '')
|
188
|
+
::Colours.send(USE_THIS_COLOUR, i.dup)
|
189
|
+
end; alias colour_for_nucleotides colourize_dna_sequence # === colour_for_nucleotides
|
190
|
+
alias colourize_rna_sequence colourize_dna_sequence # === colourize_rna_sequence
|
191
|
+
|
192
|
+
# ========================================================================= #
|
193
|
+
# === return_colour_for_the_dna_sequence
|
194
|
+
# ========================================================================= #
|
195
|
+
def return_colour_for_the_dna_sequence
|
196
|
+
result = Colours.remove_trailing_code(
|
197
|
+
::Colours.send(USE_THIS_COLOUR)
|
198
|
+
)
|
199
|
+
return result
|
168
200
|
end
|
169
201
|
|
170
202
|
# ========================================================================= #
|
171
|
-
# ===
|
203
|
+
# === show_in_dashed_form?
|
172
204
|
# ========================================================================= #
|
173
|
-
def
|
174
|
-
@
|
205
|
+
def show_in_dashed_form?
|
206
|
+
@internal_hash[:show_in_dashed_form]
|
175
207
|
end
|
176
208
|
|
209
|
+
# ========================================================================= #
|
210
|
+
# === sequence_for_display?
|
211
|
+
#
|
212
|
+
# This method will return the sequence that will be displayed on the
|
213
|
+
# commandline, for instance.
|
214
|
+
# ========================================================================= #
|
215
|
+
def sequence_for_display?
|
216
|
+
@internal_hash[:sequence_for_display]
|
217
|
+
end; alias formatted_sequence? sequence_for_display? # === formatted_sequence?
|
218
|
+
alias sequence_for_display sequence_for_display? # === sequence_for_display
|
219
|
+
|
177
220
|
# ========================================================================= #
|
178
221
|
# === return_three_prime_leader
|
179
222
|
# ========================================================================= #
|
@@ -186,53 +229,129 @@ class ShowNucleotideSequence < ::Bioroebe::Sequence # === Bioroebe::ShowNucleoti
|
|
186
229
|
# ========================================================================= #
|
187
230
|
def return_five_prime_leader
|
188
231
|
"5' - "
|
232
|
+
end; alias leader? return_five_prime_leader # === leader?
|
233
|
+
|
234
|
+
# ========================================================================= #
|
235
|
+
# === return_three_prime_trailer
|
236
|
+
# ========================================================================= #
|
237
|
+
def return_three_prime_trailer
|
238
|
+
" - 3'"
|
239
|
+
end; alias trailer? return_three_prime_trailer # === trailer?
|
240
|
+
|
241
|
+
# ========================================================================= #
|
242
|
+
# === set_padding_to_use
|
243
|
+
# ========================================================================= #
|
244
|
+
def set_padding_to_use(
|
245
|
+
i = ''
|
246
|
+
)
|
247
|
+
if i and i.to_s =~ /^\d+$/i # And "if it is a number, and a number only".
|
248
|
+
i = ' ' * i.to_i
|
249
|
+
end
|
250
|
+
i = i.dup if i and i.frozen?
|
251
|
+
@internal_hash[:padding_to_use] = i
|
252
|
+
end; alias set_padding set_padding_to_use # === set_padding
|
253
|
+
|
254
|
+
# ========================================================================= #
|
255
|
+
# === padding_to_use?
|
256
|
+
# ========================================================================= #
|
257
|
+
def padding_to_use?
|
258
|
+
@internal_hash[:padding_to_use]
|
259
|
+
end; alias padding? padding_to_use? # === padding?
|
260
|
+
|
261
|
+
# ========================================================================= #
|
262
|
+
# === clear_padding
|
263
|
+
# ========================================================================= #
|
264
|
+
def clear_padding
|
265
|
+
set_padding_to_use('')
|
189
266
|
end
|
190
267
|
|
268
|
+
# ========================================================================= #
|
269
|
+
# === show_three_prime_trailer?
|
270
|
+
# ========================================================================= #
|
271
|
+
def show_three_prime_trailer?
|
272
|
+
@internal_hash[:show_three_prime_trailer]
|
273
|
+
end
|
274
|
+
|
275
|
+
# ========================================================================= #
|
276
|
+
# === shall_we_report?
|
277
|
+
# ========================================================================= #
|
278
|
+
def shall_we_report?
|
279
|
+
@internal_hash[:shall_we_report]
|
280
|
+
end; alias may_we_report? shall_we_report? # === may_we_report?
|
281
|
+
alias shall_we_report shall_we_report? # === shall_we_report
|
282
|
+
|
191
283
|
# ========================================================================= #
|
192
284
|
# === set_sequence_for_display
|
285
|
+
#
|
286
|
+
# This is the raw sequence that will be displayed. Only store the
|
287
|
+
# nucleotides, NOT 5' and 3' primer/trailer.
|
193
288
|
# ========================================================================= #
|
194
289
|
def set_sequence_for_display(i)
|
195
|
-
@sequence_for_display = i
|
290
|
+
@internal_hash[:sequence_for_display] = i
|
291
|
+
end; alias set_this_sequence set_sequence_for_display # === set_this_sequence
|
292
|
+
|
293
|
+
# ========================================================================= #
|
294
|
+
# === show_ruler?
|
295
|
+
# ========================================================================= #
|
296
|
+
def show_ruler?
|
297
|
+
@internal_hash[:show_ruler]
|
196
298
|
end
|
197
299
|
|
198
300
|
# ========================================================================= #
|
199
|
-
# ===
|
200
|
-
#
|
201
|
-
# This method will return the sequence that will be displayed on the
|
202
|
-
# commandline, for instance.
|
301
|
+
# === do_show_the_ruler
|
203
302
|
# ========================================================================= #
|
204
|
-
def
|
205
|
-
@
|
206
|
-
end
|
207
|
-
alias sequence_for_display sequence_for_display? # === sequence_for_display
|
303
|
+
def do_show_the_ruler
|
304
|
+
@internal_hash[:show_ruler] = true
|
305
|
+
end
|
208
306
|
|
209
307
|
# ========================================================================= #
|
210
|
-
# ===
|
308
|
+
# === array_colourize_these_substrings?
|
211
309
|
# ========================================================================= #
|
212
|
-
def
|
213
|
-
@
|
310
|
+
def array_colourize_these_substrings?
|
311
|
+
@internal_hash[:array_colourize_these_substrings]
|
214
312
|
end
|
215
313
|
|
216
314
|
# ========================================================================= #
|
217
|
-
# ===
|
315
|
+
# === main_sequence_as_string?
|
316
|
+
# ========================================================================= #
|
317
|
+
def main_sequence_as_string?
|
318
|
+
sequence_for_display?.to_s
|
319
|
+
end
|
320
|
+
|
218
321
|
# ========================================================================= #
|
219
|
-
|
220
|
-
|
322
|
+
# === do_properly_display_this_nucleotide_sequence (display tag, report tag)
|
323
|
+
#
|
324
|
+
# The first argument to this method is the sequence (DNA or RNA) that
|
325
|
+
# should be displayed.
|
326
|
+
#
|
327
|
+
# This method will only do the reporting by default - not a new
|
328
|
+
# format-operation, unless a block has been given to it.
|
329
|
+
#
|
330
|
+
# Usage example for this method:
|
331
|
+
#
|
332
|
+
# @show_nucleotide_sequence.report_this_sequence(input) {{ padding_to_use: padding? }}
|
333
|
+
#
|
334
|
+
# ========================================================================= #
|
335
|
+
def do_properly_display_this_nucleotide_sequence(
|
336
|
+
i = sequence_for_display?,
|
337
|
+
padding_to_use = padding_to_use?,
|
338
|
+
show_ruler = show_ruler?,
|
339
|
+
show_five_prime_leader = show_five_prime_leader?,
|
340
|
+
show_three_prime_trailer = show_three_prime_trailer?,
|
341
|
+
&block
|
221
342
|
)
|
222
|
-
show_ruler = @show_ruler
|
223
|
-
padding_to_use = @padding_to_use
|
224
|
-
show_five_prime_leader = @show_five_prime_leader
|
225
|
-
show_three_prime_trailer = @show_three_prime_trailer
|
226
343
|
# ======================================================================= #
|
344
|
+
# === result
|
345
|
+
#
|
227
346
|
# The variable called result will contain our modified sequence that
|
228
|
-
# is to be displayed on the commandline.
|
347
|
+
# is to be displayed on the commandline. It should come first, as
|
348
|
+
# other parts in this method may append onto it.
|
229
349
|
# ======================================================================= #
|
230
|
-
result
|
231
|
-
|
232
|
-
|
233
|
-
i = string? if string?
|
350
|
+
result = ''.dup
|
351
|
+
if i.nil? and string?
|
352
|
+
i = string?
|
234
353
|
end
|
235
|
-
|
354
|
+
|
236
355
|
# ======================================================================= #
|
237
356
|
# == Handle blocks given next
|
238
357
|
# ======================================================================= #
|
@@ -240,6 +359,11 @@ class ShowNucleotideSequence < ::Bioroebe::Sequence # === Bioroebe::ShowNucleoti
|
|
240
359
|
yielded = yield
|
241
360
|
case yielded
|
242
361
|
# ===================================================================== #
|
362
|
+
# === :use_colours
|
363
|
+
# ===================================================================== #
|
364
|
+
when :use_colours
|
365
|
+
disable_colours { :be_quiet }
|
366
|
+
# ===================================================================== #
|
243
367
|
# === :colourize_start_codon
|
244
368
|
# ===================================================================== #
|
245
369
|
when :colourize_start_codon
|
@@ -275,7 +399,16 @@ class ShowNucleotideSequence < ::Bioroebe::Sequence # === Bioroebe::ShowNucleoti
|
|
275
399
|
:rna
|
276
400
|
i = to_rna(i)
|
277
401
|
else
|
402
|
+
# =================================================================== #
|
403
|
+
# === Handle Hashes past this point
|
404
|
+
# =================================================================== #
|
278
405
|
if yielded.is_a? Hash
|
406
|
+
# ================================================================= #
|
407
|
+
# === :use_colours
|
408
|
+
# ================================================================= #
|
409
|
+
if yielded.has_key? :use_colours
|
410
|
+
set_use_colours(yielded.delete(:use_colours))
|
411
|
+
end
|
279
412
|
# ================================================================= #
|
280
413
|
# === :use_this_as_padding
|
281
414
|
# ================================================================= #
|
@@ -302,110 +435,42 @@ class ShowNucleotideSequence < ::Bioroebe::Sequence # === Bioroebe::ShowNucleoti
|
|
302
435
|
end
|
303
436
|
end
|
304
437
|
# ======================================================================= #
|
305
|
-
#
|
438
|
+
# Support for dashed-form display comes next, after we colourized
|
439
|
+
# substrings:
|
306
440
|
# ======================================================================= #
|
307
|
-
if
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
441
|
+
if show_in_dashed_form?
|
442
|
+
use_this_token_for_rejoining = '-' # This will be the token used for re-joining.
|
443
|
+
group_by_n_tokens = 3
|
444
|
+
n_times = '.' * group_by_n_tokens.to_i # This line is important to determine the regexp next.
|
445
|
+
use_this_regex = /#{n_times}/ # Our regex to be used for splitting.
|
446
|
+
i = i.scan(use_this_regex).
|
447
|
+
join(use_this_token_for_rejoining) # And re-join it here.
|
314
448
|
end
|
449
|
+
result << rev if use_colours?
|
450
|
+
result << "#{padding_to_use}"
|
315
451
|
# ======================================================================= #
|
316
|
-
#
|
317
|
-
#
|
452
|
+
# Consider showing the ruler next, before determining whether we
|
453
|
+
# will show the 5' prime leader, as well as before we colourize the
|
454
|
+
# substrings:
|
318
455
|
# ======================================================================= #
|
319
|
-
if
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
/(#{this_substring})/,
|
328
|
-
crimson('\1')+
|
329
|
-
remove_trailing_escape_part(colour_for_nucleotides)
|
330
|
-
)
|
331
|
-
end
|
332
|
-
}
|
456
|
+
if show_ruler
|
457
|
+
print "#{rev}#{padding_to_use}"
|
458
|
+
if show_five_prime_leader
|
459
|
+
ee(' '*"#{leader?}".size)
|
460
|
+
end
|
461
|
+
e ::Bioroebe::Ruler.new(i, :default) {{
|
462
|
+
ruler: show_ruler
|
463
|
+
}}.result_as_string?
|
333
464
|
end
|
334
465
|
# ======================================================================= #
|
335
|
-
#
|
466
|
+
# === Show the 5' leader next:
|
336
467
|
# ======================================================================= #
|
337
|
-
if
|
338
|
-
|
339
|
-
use_this_token_for_rejoining = '-'
|
340
|
-
n_times = '.' * how_many_times.to_i
|
341
|
-
use_this_regex = /#{n_times}/
|
342
|
-
i = i.scan(use_this_regex).join(use_this_token_for_rejoining)
|
343
|
-
end
|
344
|
-
result << colourize_dna_sequence(i)+
|
345
|
-
rev
|
346
|
-
if show_three_prime_trailer
|
347
|
-
case show_three_prime_trailer
|
348
|
-
when :use_five_prime_trailer
|
349
|
-
result << " - 5'"
|
350
|
-
else
|
351
|
-
result << " - 3'"
|
352
|
-
end
|
353
|
-
end
|
354
|
-
set_sequence_for_display(
|
355
|
-
result
|
356
|
-
)
|
357
|
-
end; alias format format_this_nucleotide_sequence # === format
|
358
|
-
alias format_this_string format_this_nucleotide_sequence # === format_this_string
|
359
|
-
|
360
|
-
# ========================================================================= #
|
361
|
-
# === menu (menu tag)
|
362
|
-
# ========================================================================= #
|
363
|
-
def menu(
|
364
|
-
i = @commandline_arguments
|
365
|
-
)
|
366
|
-
if i and i.is_a?(Array)
|
367
|
-
i.each {|entry| menu(entry) }
|
368
|
-
else
|
369
|
-
case i
|
370
|
-
# ===================================================================== #
|
371
|
-
# === --ruler
|
372
|
-
#
|
373
|
-
# This can be invoked by doing something like:
|
374
|
-
#
|
375
|
-
# show_nucleotide_sequence ATGATTGCACGACACACATAAA --ruler
|
376
|
-
#
|
377
|
-
# ===================================================================== #
|
378
|
-
when /^-?-?ruler$/i
|
379
|
-
@show_ruler = true
|
380
|
-
end
|
468
|
+
if show_five_prime_leader
|
469
|
+
result << "#{leader?}"
|
381
470
|
end
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
# === show_ruler?
|
386
|
-
# ========================================================================= #
|
387
|
-
def show_ruler?
|
388
|
-
@show_ruler
|
389
|
-
end
|
390
|
-
|
391
|
-
# ========================================================================= #
|
392
|
-
# === do_show_the_ruler
|
393
|
-
# ========================================================================= #
|
394
|
-
def do_show_the_ruler
|
395
|
-
@show_ruler = true
|
396
|
-
end
|
397
|
-
|
398
|
-
# ========================================================================= #
|
399
|
-
# === report_this_sequence
|
400
|
-
#
|
401
|
-
# Usage example for this method:
|
402
|
-
#
|
403
|
-
# @show_nucleotide_sequence.report_this_sequence(input) {{ padding_to_use: padding? }}
|
404
|
-
#
|
405
|
-
# ========================================================================= #
|
406
|
-
def report_this_sequence(
|
407
|
-
i, &block
|
408
|
-
)
|
471
|
+
# ======================================================================= #
|
472
|
+
# === Handle blocks given to the method
|
473
|
+
# ======================================================================= #
|
409
474
|
if block_given?
|
410
475
|
yielded = yield
|
411
476
|
if yielded.is_a? Symbol
|
@@ -415,6 +480,19 @@ class ShowNucleotideSequence < ::Bioroebe::Sequence # === Bioroebe::ShowNucleoti
|
|
415
480
|
# =================================================================== #
|
416
481
|
when :piped
|
417
482
|
i.gsub!(/(...)/, "\\1|") # Add | at every third position.
|
483
|
+
# =================================================================== #
|
484
|
+
# === :colourize_start_codon
|
485
|
+
#
|
486
|
+
# When a block is given then we actually have to re-format the main
|
487
|
+
# string again.
|
488
|
+
# =================================================================== #
|
489
|
+
when :colourize_start_codon
|
490
|
+
do_colourize_the_start_codon
|
491
|
+
# =================================================================== #
|
492
|
+
# === :complementary_strand
|
493
|
+
# =================================================================== #
|
494
|
+
when :complementary_strand
|
495
|
+
i = ::Bioroebe.complementary_strand(i)
|
418
496
|
end
|
419
497
|
elsif yielded.is_a? Hash
|
420
498
|
# =================================================================== #
|
@@ -428,8 +506,9 @@ class ShowNucleotideSequence < ::Bioroebe::Sequence # === Bioroebe::ShowNucleoti
|
|
428
506
|
# =================================================================== #
|
429
507
|
# === :show_piped_output
|
430
508
|
# =================================================================== #
|
431
|
-
if yielded.has_key?(:show_piped_output) and
|
432
|
-
|
509
|
+
if yielded.has_key?(:show_piped_output) and
|
510
|
+
(yielded[:show_piped_output] == true)
|
511
|
+
i.gsub!(/(...)/, "\\1|") # Add | at every third position.
|
433
512
|
end
|
434
513
|
# =================================================================== #
|
435
514
|
# === :padding_to_use
|
@@ -439,65 +518,60 @@ class ShowNucleotideSequence < ::Bioroebe::Sequence # === Bioroebe::ShowNucleoti
|
|
439
518
|
end
|
440
519
|
end
|
441
520
|
end
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
# This method will only do the reporting by default - not a new
|
450
|
-
# format-operation, unless a block has been given to it.
|
451
|
-
# ========================================================================= #
|
452
|
-
def report(
|
453
|
-
i = @sequence_for_display,
|
454
|
-
&block
|
455
|
-
)
|
456
|
-
if block_given?
|
457
|
-
yielded = yield
|
458
|
-
case yielded
|
521
|
+
# ======================================================================= #
|
522
|
+
# === Colourize substrings
|
523
|
+
#
|
524
|
+
# We will next colourize the nucleotides that we determined should
|
525
|
+
# be colourized, in particular ATG start codons.
|
526
|
+
# ======================================================================= #
|
527
|
+
if use_colours? and !array_colourize_these_substrings?.empty?
|
459
528
|
# ===================================================================== #
|
460
|
-
#
|
461
|
-
#
|
462
|
-
# When a block is given then we actually have to re-format the main
|
463
|
-
# string again.
|
529
|
+
# In this case we will try to colourize substrings.
|
464
530
|
# ===================================================================== #
|
465
|
-
|
466
|
-
|
467
|
-
|
531
|
+
array_colourize_these_substrings?.each {|this_substring|
|
532
|
+
if i and i.include?(this_substring) # Only make a change if the substring is part of the main sequence.
|
533
|
+
i = i.dup if i.frozen?
|
534
|
+
i.prepend(return_colour_for_the_dna_sequence)
|
535
|
+
i.gsub!(
|
536
|
+
/(#{this_substring})/,
|
537
|
+
crimson('\1')+
|
538
|
+
remove_trailing_escape_part(colour_for_nucleotides)
|
539
|
+
)
|
540
|
+
end
|
541
|
+
}
|
542
|
+
end
|
543
|
+
result << colourize_dna_sequence(i)
|
544
|
+
# ======================================================================= #
|
545
|
+
# Consider showing the 3' trailer next.
|
546
|
+
# ======================================================================= #
|
547
|
+
if show_three_prime_trailer
|
548
|
+
case show_three_prime_trailer
|
468
549
|
# ===================================================================== #
|
469
|
-
# === :
|
550
|
+
# === :use_five_prime_trailer
|
551
|
+
#
|
552
|
+
# In this case we'll use a 5' trailer, so the reverse display is
|
553
|
+
# used here.
|
470
554
|
# ===================================================================== #
|
471
|
-
when :
|
472
|
-
|
555
|
+
when :use_five_prime_trailer
|
556
|
+
result << "#{rev} - 5'"
|
557
|
+
else
|
558
|
+
result << "#{rev}#{trailer?}"
|
473
559
|
end
|
474
560
|
end
|
475
|
-
|
476
|
-
end; alias display
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
::Colours.send(USE_THIS_COLOUR, i.dup)
|
483
|
-
end; alias colour_for_nucleotides colourize_dna_sequence # === colour_for_nucleotides
|
484
|
-
alias colourize_rna_sequence colourize_dna_sequence # === colourize_rna_sequence
|
485
|
-
|
486
|
-
# ========================================================================= #
|
487
|
-
# === return_colour_for_the_dna_sequence
|
488
|
-
# ========================================================================= #
|
489
|
-
def return_colour_for_the_dna_sequence
|
490
|
-
result = Colours.remove_trailing_code(
|
491
|
-
::Colours.send(USE_THIS_COLOUR)
|
492
|
-
)
|
493
|
-
return result
|
494
|
-
end
|
561
|
+
e result if may_we_report?
|
562
|
+
end; alias display do_properly_display_this_nucleotide_sequence # === display
|
563
|
+
alias report_this_sequence do_properly_display_this_nucleotide_sequence # === report_this_sequence
|
564
|
+
alias report do_properly_display_this_nucleotide_sequence # === report
|
565
|
+
alias format_this_nucleotide_sequence do_properly_display_this_nucleotide_sequence # === format_this_nucleotide_sequence
|
566
|
+
alias format_this_string do_properly_display_this_nucleotide_sequence # === format_this_string
|
567
|
+
alias format do_properly_display_this_nucleotide_sequence # === format
|
495
568
|
|
496
569
|
# ========================================================================= #
|
497
570
|
# === display_with_prior_formatting
|
498
571
|
# ========================================================================= #
|
499
572
|
def display_with_prior_formatting(
|
500
|
-
i =
|
573
|
+
i = sequence_for_display?,
|
574
|
+
&block
|
501
575
|
)
|
502
576
|
do_show_the_ruler
|
503
577
|
clear_padding
|
@@ -505,6 +579,30 @@ class ShowNucleotideSequence < ::Bioroebe::Sequence # === Bioroebe::ShowNucleoti
|
|
505
579
|
report(i) # Need to invoke the original method. Before May 2020 this was display().
|
506
580
|
end
|
507
581
|
|
582
|
+
# ========================================================================= #
|
583
|
+
# === menu (menu tag)
|
584
|
+
# ========================================================================= #
|
585
|
+
def menu(
|
586
|
+
i = commandline_arguments?.select {|inner_entry| inner_entry.start_with? '--' }
|
587
|
+
)
|
588
|
+
if i and i.is_a?(Array)
|
589
|
+
i.each {|entry| menu(entry) }
|
590
|
+
else
|
591
|
+
case i # case tag
|
592
|
+
# ===================================================================== #
|
593
|
+
# === --ruler
|
594
|
+
#
|
595
|
+
# This can be invoked by doing something like:
|
596
|
+
#
|
597
|
+
# shownucleotidesequence ATGAAAAGTCAGTCAGGTCACATTGCACGACACACATAAA --ruler
|
598
|
+
#
|
599
|
+
# ===================================================================== #
|
600
|
+
when /^-?-?ruler$/i
|
601
|
+
@internal_hash[:show_ruler] = true
|
602
|
+
end
|
603
|
+
end
|
604
|
+
end
|
605
|
+
|
508
606
|
# ========================================================================= #
|
509
607
|
# === search_for_this_substring
|
510
608
|
#
|
@@ -514,14 +612,32 @@ class ShowNucleotideSequence < ::Bioroebe::Sequence # === Bioroebe::ShowNucleoti
|
|
514
612
|
if i.is_a? Array
|
515
613
|
i.each {|entry| search_for_this_substring(entry) }
|
516
614
|
else
|
517
|
-
unless @array_colourize_these_substrings.include? i
|
518
|
-
@array_colourize_these_substrings << i
|
519
|
-
@array_colourize_these_substrings.compact! # Added in 2021, to remove possible nil-values.
|
615
|
+
unless @internal_hash[:array_colourize_these_substrings].include? i
|
616
|
+
@internal_hash[:array_colourize_these_substrings] << i
|
617
|
+
@internal_hash[:array_colourize_these_substrings].compact! # Added in 2021, to remove possible nil-values.
|
520
618
|
end
|
521
619
|
end
|
522
620
|
end; alias set_search_for search_for_this_substring # === set_search_for
|
523
621
|
alias add_this_substring search_for_this_substring # === add_this_substring
|
524
622
|
|
623
|
+
# ========================================================================= #
|
624
|
+
# === run (run tag)
|
625
|
+
# ========================================================================= #
|
626
|
+
def run
|
627
|
+
menu(
|
628
|
+
commandline_arguments?
|
629
|
+
)
|
630
|
+
_ = first_argument?
|
631
|
+
if _.nil? or _.empty?
|
632
|
+
erev 'Nothing to display.'
|
633
|
+
else
|
634
|
+
set_sequence_for_display(_) # Always set the sequence in this case.
|
635
|
+
if shall_we_report?
|
636
|
+
do_properly_display_this_nucleotide_sequence(_)
|
637
|
+
end
|
638
|
+
end
|
639
|
+
end
|
640
|
+
|
525
641
|
# ========================================================================= #
|
526
642
|
# === do_colourize_the_start_codon
|
527
643
|
# ========================================================================= #
|
@@ -530,11 +646,10 @@ class ShowNucleotideSequence < ::Bioroebe::Sequence # === Bioroebe::ShowNucleoti
|
|
530
646
|
end
|
531
647
|
|
532
648
|
# ========================================================================= #
|
533
|
-
# ===
|
649
|
+
# === Bioroebe::ShowNucleotideSequence[]
|
534
650
|
# ========================================================================= #
|
535
|
-
def
|
536
|
-
|
537
|
-
report if @may_we_report
|
651
|
+
def self.[](i = ARGV)
|
652
|
+
new(i)
|
538
653
|
end
|
539
654
|
|
540
655
|
end
|
@@ -542,7 +657,10 @@ end
|
|
542
657
|
# =========================================================================== #
|
543
658
|
# === Bioroebe.format_this_nucleotide_sequence
|
544
659
|
# =========================================================================== #
|
545
|
-
def self.format_this_nucleotide_sequence(
|
660
|
+
def self.format_this_nucleotide_sequence(
|
661
|
+
i = ARGV,
|
662
|
+
&block
|
663
|
+
)
|
546
664
|
_ = ::Bioroebe::ShowNucleotideSequence.new(
|
547
665
|
i, :do_not_report_anything, &block
|
548
666
|
)
|
@@ -553,4 +671,8 @@ end; self.instance_eval { alias colourize_this_sequence format_this_nucleotide_s
|
|
553
671
|
|
554
672
|
end
|
555
673
|
|
674
|
+
if __FILE__ == $PROGRAM_NAME
|
675
|
+
Bioroebe::ShowNucleotideSequence.new(ARGV)
|
676
|
+
end
|
677
|
+
|
556
678
|
# shownucleotidesequence ATGATTGCACGACACACACTAGCTAGCTAGACTGTAAAAAGGGGACTAGCTAGCTAATGGACTGTAAAACTAGCTAGCTAGACGCGGCGCGCTACTAGCTAGCTAGACTGTAAAGTAAA
|