bioroebe 0.10.80 → 0.12.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of bioroebe might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/README.md +3612 -2781
- data/bin/bioroebe +7 -1
- data/bin/bioroebe_hash +7 -0
- data/bin/codon_to_aminoacid +1 -0
- data/bioroebe.gemspec +3 -3
- data/doc/README.gen +3612 -2742
- data/doc/quality_control/commandline_applications.md +3 -3
- data/doc/todo/bioroebe_java_todo.md +22 -0
- data/doc/todo/bioroebe_todo.md +2059 -2615
- data/lib/bioroebe/aminoacids/aminoacid_substitution.rb +1 -9
- data/lib/bioroebe/aminoacids/codon_percentage.rb +1 -9
- data/lib/bioroebe/aminoacids/deduce_aminoacid_sequence.rb +1 -9
- data/lib/bioroebe/aminoacids/display_aminoacid_table.rb +1 -0
- data/lib/bioroebe/aminoacids/show_hydrophobicity.rb +1 -6
- data/lib/bioroebe/base/colours_for_base/colours_for_base.rb +18 -8
- data/lib/bioroebe/base/commandline_application/commandline_arguments.rb +15 -11
- data/lib/bioroebe/base/commandline_application/misc.rb +66 -49
- data/lib/bioroebe/base/commandline_application/opn.rb +8 -8
- data/lib/bioroebe/base/commandline_application/reset.rb +3 -2
- data/lib/bioroebe/base/misc.rb +35 -0
- data/lib/bioroebe/base/prototype/misc.rb +11 -1
- data/lib/bioroebe/codon_tables/frequencies/parse_frequency_table.rb +2 -10
- data/lib/bioroebe/codons/codons.rb +1 -1
- data/lib/bioroebe/codons/convert_this_codon_to_that_aminoacid.rb +192 -58
- data/lib/bioroebe/codons/possible_codons_for_this_aminoacid.rb +1 -9
- data/lib/bioroebe/codons/show_codon_tables.rb +6 -2
- data/lib/bioroebe/codons/show_codon_usage.rb +15 -4
- data/lib/bioroebe/colours/rev.rb +4 -1
- data/lib/bioroebe/constants/aminoacids_and_proteins.rb +1 -0
- data/lib/bioroebe/constants/database_constants.rb +1 -1
- data/lib/bioroebe/constants/files_and_directories.rb +31 -4
- data/lib/bioroebe/constants/misc.rb +20 -0
- data/lib/bioroebe/conversions/dna_to_aminoacid_sequence.rb +58 -24
- data/lib/bioroebe/count/count_amount_of_aminoacids.rb +3 -2
- data/lib/bioroebe/count/count_amount_of_nucleotides.rb +3 -0
- data/lib/bioroebe/crystal/README.md +2 -0
- data/lib/bioroebe/crystal/to_rna.cr +19 -0
- data/lib/bioroebe/data/README.md +11 -8
- data/lib/bioroebe/data/electron_microscopy/pos_example.pos +396 -0
- data/lib/bioroebe/data/electron_microscopy/test_particles.star +36 -0
- data/lib/bioroebe/data/fasta/human/Homo_sapiens_hemoglobin_subunit_alpha_HBB_mRNA.fasta +9 -0
- data/lib/bioroebe/data/fasta/human/Homo_sapiens_hemoglobin_subunit_beta_HBB_mRNA.fasta +8 -0
- data/lib/bioroebe/data/fasta/human/README.md +2 -0
- data/lib/bioroebe/electron_microscopy/coordinate_analyzer.rb +15 -18
- data/lib/bioroebe/{fasta_and_fastq/parse_fasta/run.rb → electron_microscopy/electron_microscopy_module.rb} +16 -8
- data/lib/bioroebe/electron_microscopy/fix_pos_file.rb +1 -9
- data/lib/bioroebe/electron_microscopy/flipy.rb +83 -0
- data/lib/bioroebe/electron_microscopy/parse_coordinates.rb +2 -10
- data/lib/bioroebe/electron_microscopy/read_file_xmd.rb +1 -9
- data/lib/bioroebe/electron_microscopy/simple_star_file_generator.rb +4 -9
- data/lib/bioroebe/enzymes/has_this_restriction_enzyme.rb +10 -3
- data/lib/bioroebe/enzymes/restriction_enzyme.rb +23 -1
- data/lib/bioroebe/enzymes/restriction_enzymes/statistics.rb +65 -0
- data/lib/bioroebe/fasta_and_fastq/autocorrect_the_name_of_this_fasta_file.rb +1 -9
- data/lib/bioroebe/fasta_and_fastq/compact_fasta_file/compact_fasta_file.rb +7 -9
- data/lib/bioroebe/fasta_and_fastq/fasta_defline/fasta_defline.rb +1 -5
- data/lib/bioroebe/fasta_and_fastq/fasta_to_yaml/fasta_to_yaml.rb +81 -0
- data/lib/bioroebe/fasta_and_fastq/parse_fasta/parse_fasta.rb +1465 -7
- data/lib/bioroebe/fasta_and_fastq/return_fasta_subsection_of_this_file.rb +11 -2
- data/lib/bioroebe/fasta_and_fastq/show_fasta_headers.rb +27 -12
- data/lib/bioroebe/fasta_and_fastq/simplify_fasta_header/simplify_fasta_header.rb +1 -5
- data/lib/bioroebe/fasta_and_fastq/split_this_fasta_file_into_chromosomes/constants.rb +0 -5
- data/lib/bioroebe/genome/README.md +4 -0
- data/lib/bioroebe/genome/genome.rb +67 -0
- data/lib/bioroebe/genomes/genome_pattern.rb +3 -9
- data/lib/bioroebe/gui/gtk +1 -0
- data/lib/bioroebe/gui/gtk3/alignment/alignment.rb +73 -128
- data/lib/bioroebe/gui/gtk3/controller/controller.rb +45 -27
- data/lib/bioroebe/gui/gtk3/dna_to_aminoacid_widget/dna_to_aminoacid_widget.rb +76 -50
- data/lib/bioroebe/gui/gtk3/fasta_table_widget/fasta_table_widget.rb +99 -21
- data/lib/bioroebe/gui/gtk3/hamming_distance/hamming_distance.rb +42 -28
- data/lib/bioroebe/gui/gtk3/nucleotide_analyser/nucleotide_analyser.rb +119 -71
- data/lib/bioroebe/gui/gtk3/protein_to_DNA/protein_to_DNA.rb +18 -18
- data/lib/bioroebe/gui/gtk3/random_sequence/random_sequence.rb +19 -11
- data/lib/bioroebe/gui/jruby/alignment/alignment.rb +165 -0
- data/lib/bioroebe/gui/libui/alignment/alignment.rb +3 -1
- data/lib/bioroebe/gui/libui/controller/controller.rb +116 -0
- data/lib/bioroebe/gui/libui/random_sequence/random_sequence.rb +18 -2
- data/lib/bioroebe/gui/libui/show_codon_table/show_codon_table.rb +2 -0
- data/lib/bioroebe/gui/libui/three_to_one/three_to_one.rb +8 -6
- data/lib/bioroebe/gui/shared_code/alignment/alignment_module.rb +102 -0
- data/lib/bioroebe/gui/shared_code/levensthein_distance/levensthein_distance_module.rb +18 -16
- data/lib/bioroebe/gui/shared_code/protein_to_DNA/protein_to_DNA_module.rb +14 -14
- data/lib/bioroebe/gui/swing/three_to_one/ThreeToOne$1.class +0 -0
- data/lib/bioroebe/gui/swing/three_to_one/ThreeToOne$CloseListener.class +0 -0
- data/lib/bioroebe/gui/swing/three_to_one/ThreeToOne.class +0 -0
- data/lib/bioroebe/gui/swing/three_to_one/ThreeToOne.java +141 -0
- data/lib/bioroebe/images/FORWARD_PRIMER.png +0 -0
- data/lib/bioroebe/images/REVERSE_PRIMER.png +0 -0
- data/lib/bioroebe/java/README.md +4 -0
- data/lib/bioroebe/java/bioroebe/Sequence.java +25 -1
- data/lib/bioroebe/java/bioroebe/src/main/java/bioroebe/Base.class +0 -0
- data/lib/bioroebe/java/bioroebe/{Base.java → src/main/java/bioroebe/Base.java} +15 -2
- data/lib/bioroebe/java/bioroebe/{BisulfiteTreatment.class → src/main/java/bioroebe/BisulfiteTreatment.class} +0 -0
- data/lib/bioroebe/java/bioroebe/{Codons.class → src/main/java/bioroebe/Codons.class} +0 -0
- data/lib/bioroebe/java/bioroebe/src/main/java/bioroebe/Codons.java +34 -0
- data/lib/bioroebe/java/bioroebe/src/main/java/bioroebe/Commandline.class +0 -0
- data/lib/bioroebe/java/bioroebe/src/main/java/bioroebe/Commandline.java +101 -0
- data/lib/bioroebe/java/bioroebe/{GenerateRandomDnaSequence.class → src/main/java/bioroebe/GenerateRandomDnaSequence.class} +0 -0
- data/lib/bioroebe/java/bioroebe/{GenerateRandomDnaSequence.java → src/main/java/bioroebe/GenerateRandomDnaSequence.java} +8 -2
- data/lib/bioroebe/java/bioroebe/{IsPalindrome.class → src/main/java/bioroebe/IsPalindrome.class} +0 -0
- data/lib/bioroebe/java/bioroebe/{IsPalindrome.java → src/main/java/bioroebe/IsPalindrome.java} +5 -1
- data/lib/bioroebe/java/bioroebe/src/main/java/bioroebe/PartnerNucleotide.class +0 -0
- data/lib/bioroebe/java/bioroebe/src/main/java/bioroebe/PartnerNucleotide.java +56 -0
- data/lib/bioroebe/java/bioroebe/{RemoveFile.java → src/main/java/bioroebe/RemoveFile.java} +10 -4
- data/lib/bioroebe/java/bioroebe/{RemoveNumbers.class → src/main/java/bioroebe/RemoveNumbers.class} +0 -0
- data/lib/bioroebe/java/bioroebe/{RemoveNumbers.java → src/main/java/bioroebe/RemoveNumbers.java} +1 -0
- data/lib/bioroebe/java/bioroebe/{ToCamelcase.class → src/main/java/bioroebe/ToCamelcase.class} +0 -0
- data/lib/bioroebe/java/bioroebe/{ToCamelcase.java → src/main/java/bioroebe/ToCamelcase.java} +3 -3
- data/lib/bioroebe/java/bioroebe/src/main/java/bioroebe/ToRNA.class +0 -0
- data/lib/bioroebe/java/bioroebe/src/main/java/bioroebe/ToRNA.java +42 -0
- data/lib/bioroebe/java/bioroebe/src/main/java/bioroebe/toplevel_methods/BaseComposition.class +0 -0
- data/lib/bioroebe/java/bioroebe/src/main/java/bioroebe/toplevel_methods/BaseComposition.java +75 -0
- data/lib/bioroebe/misc/ruler.rb +11 -2
- data/lib/bioroebe/nucleotides/most_likely_nucleotide_sequence_for_this_aminoacid_sequence.rb +1 -9
- data/lib/bioroebe/nucleotides/show_nucleotide_sequence.rb +7 -7
- data/lib/bioroebe/parsers/genbank_parser.rb +347 -26
- data/lib/bioroebe/parsers/gff.rb +1 -9
- data/lib/bioroebe/patterns/scan_for_repeat.rb +1 -5
- data/lib/bioroebe/pdb/fetch_fasta_sequence_from_pdb.rb +1 -9
- data/lib/bioroebe/pdb/parse_mmCIF_file.rb +1 -9
- data/lib/bioroebe/pdb/parse_pdb_file.rb +4 -10
- data/lib/bioroebe/project/project.rb +1 -1
- data/lib/bioroebe/python/README.md +1 -0
- data/lib/bioroebe/python/__pycache__/mymodule.cpython-39.pyc +0 -0
- data/lib/bioroebe/python/gui/gtk3/all_in_one.css +4 -0
- data/lib/bioroebe/python/gui/gtk3/all_in_one.py +59 -0
- data/lib/bioroebe/python/gui/gtk3/widget1.py +20 -0
- data/lib/bioroebe/python/gui/tkinter/all_in_one.py +91 -0
- data/lib/bioroebe/python/mymodule.py +8 -0
- data/lib/bioroebe/python/protein_to_dna.py +33 -0
- data/lib/bioroebe/python/shell/shell.py +19 -0
- data/lib/bioroebe/python/to_rna.py +14 -0
- data/lib/bioroebe/python/toplevel_methods/esystem.py +12 -0
- data/lib/bioroebe/python/toplevel_methods/open_in_browser.py +20 -0
- data/lib/bioroebe/python/toplevel_methods/palindromes.py +42 -0
- data/lib/bioroebe/python/toplevel_methods/rds.py +13 -0
- data/lib/bioroebe/python/toplevel_methods/shuffleseq.py +23 -0
- data/lib/bioroebe/python/toplevel_methods/three_delimiter.py +37 -0
- data/lib/bioroebe/python/toplevel_methods/time_and_date.py +43 -0
- data/lib/bioroebe/python/toplevel_methods/to_camelcase.py +21 -0
- data/lib/bioroebe/requires/require_the_bioroebe_project.rb +3 -1
- data/lib/bioroebe/sequence/alignment.rb +14 -4
- data/lib/bioroebe/sequence/dna.rb +1 -0
- data/lib/bioroebe/sequence/nucleotide_module/nucleotide_module.rb +28 -25
- data/lib/bioroebe/sequence/protein.rb +105 -3
- data/lib/bioroebe/sequence/sequence.rb +87 -21
- data/lib/bioroebe/shell/menu.rb +3829 -3714
- data/lib/bioroebe/shell/misc.rb +59 -4307
- data/lib/bioroebe/shell/readline/readline.rb +1 -1
- data/lib/bioroebe/shell/shell.rb +11255 -28
- data/lib/bioroebe/siRNA/siRNA.rb +81 -1
- data/lib/bioroebe/string_matching/find_longest_substring.rb +3 -2
- data/lib/bioroebe/string_matching/hamming_distance.rb +1 -9
- data/lib/bioroebe/taxonomy/class_methods.rb +3 -8
- data/lib/bioroebe/taxonomy/constants.rb +4 -3
- data/lib/bioroebe/taxonomy/edit.rb +2 -1
- data/lib/bioroebe/taxonomy/help/help.rb +10 -10
- data/lib/bioroebe/taxonomy/help/helpline.rb +2 -2
- data/lib/bioroebe/taxonomy/info/check_available.rb +15 -9
- data/lib/bioroebe/taxonomy/info/info.rb +18 -11
- data/lib/bioroebe/taxonomy/info/is_dna.rb +46 -36
- data/lib/bioroebe/taxonomy/interactive.rb +140 -104
- data/lib/bioroebe/taxonomy/menu.rb +27 -18
- data/lib/bioroebe/taxonomy/parse_fasta.rb +3 -1
- data/lib/bioroebe/taxonomy/shared.rb +1 -0
- data/lib/bioroebe/taxonomy/taxonomy.rb +1 -0
- data/lib/bioroebe/toplevel_methods/aminoacids_and_proteins.rb +31 -24
- data/lib/bioroebe/toplevel_methods/colourize_related_methods.rb +164 -0
- data/lib/bioroebe/toplevel_methods/databases.rb +1 -1
- data/lib/bioroebe/toplevel_methods/digest.rb +18 -8
- data/lib/bioroebe/toplevel_methods/fasta_and_fastq.rb +107 -63
- data/lib/bioroebe/toplevel_methods/file_and_directory_related_actions.rb +14 -2
- data/lib/bioroebe/toplevel_methods/frequencies.rb +8 -1
- data/lib/bioroebe/toplevel_methods/misc.rb +142 -12
- data/lib/bioroebe/toplevel_methods/nucleotides.rb +118 -46
- data/lib/bioroebe/toplevel_methods/open_in_browser.rb +2 -0
- data/lib/bioroebe/toplevel_methods/palindromes.rb +1 -2
- data/lib/bioroebe/toplevel_methods/taxonomy.rb +2 -2
- data/lib/bioroebe/toplevel_methods/to_camelcase.rb +5 -0
- data/lib/bioroebe/utility_scripts/align_open_reading_frames.rb +1 -9
- data/lib/bioroebe/utility_scripts/check_for_mismatches/check_for_mismatches.rb +1 -9
- data/lib/bioroebe/utility_scripts/compacter.rb +1 -9
- data/lib/bioroebe/utility_scripts/compseq/compseq.rb +1 -9
- data/lib/bioroebe/utility_scripts/consensus_sequence.rb +6 -6
- data/lib/bioroebe/utility_scripts/create_batch_entrez_file.rb +1 -9
- data/lib/bioroebe/utility_scripts/dot_alignment.rb +1 -9
- data/lib/bioroebe/utility_scripts/move_file_to_its_correct_location.rb +1 -4
- data/lib/bioroebe/utility_scripts/parse_taxonomy.rb +2 -2
- data/lib/bioroebe/utility_scripts/showorf/constants.rb +0 -5
- data/lib/bioroebe/utility_scripts/showorf/reset.rb +1 -4
- data/lib/bioroebe/version/version.rb +2 -2
- data/lib/bioroebe/www/embeddable_interface.rb +103 -54
- data/lib/bioroebe/www/sinatra/sinatra.rb +186 -70
- data/lib/bioroebe/yaml/aminoacids/amino_acids_long_name_to_one_letter.yml +2 -2
- data/lib/bioroebe/yaml/configuration/browser.yml +1 -1
- data/lib/bioroebe/yaml/configuration/temp_dir.yml +1 -1
- data/lib/bioroebe/yaml/genomes/README.md +3 -4
- data/lib/bioroebe/yaml/restriction_enzymes/restriction_enzymes.yml +27 -27
- metadata +81 -64
- data/doc/setup.rb +0 -1655
- data/lib/bioroebe/fasta_and_fastq/parse_fasta/constants.rb +0 -50
- data/lib/bioroebe/fasta_and_fastq/parse_fasta/initialize.rb +0 -86
- data/lib/bioroebe/fasta_and_fastq/parse_fasta/menu.rb +0 -117
- data/lib/bioroebe/fasta_and_fastq/parse_fasta/misc.rb +0 -981
- data/lib/bioroebe/fasta_and_fastq/parse_fasta/report.rb +0 -156
- data/lib/bioroebe/fasta_and_fastq/parse_fasta/reset.rb +0 -128
- data/lib/bioroebe/genbank/genbank_parser.rb +0 -291
- data/lib/bioroebe/java/bioroebe/Base.class +0 -0
- data/lib/bioroebe/java/bioroebe/Codons.java +0 -22
- data/lib/bioroebe/java/bioroebe/PartnerNucleotide.class +0 -0
- data/lib/bioroebe/java/bioroebe/PartnerNucleotide.java +0 -19
- data/lib/bioroebe/java/bioroebe.jar +0 -0
- data/lib/bioroebe/shell/add.rb +0 -108
- data/lib/bioroebe/shell/assign.rb +0 -360
- data/lib/bioroebe/shell/chop_and_cut.rb +0 -281
- data/lib/bioroebe/shell/constants.rb +0 -166
- data/lib/bioroebe/shell/download.rb +0 -335
- data/lib/bioroebe/shell/enable_and_disable.rb +0 -158
- data/lib/bioroebe/shell/enzymes.rb +0 -310
- data/lib/bioroebe/shell/fasta.rb +0 -345
- data/lib/bioroebe/shell/gtk.rb +0 -76
- data/lib/bioroebe/shell/history.rb +0 -132
- data/lib/bioroebe/shell/initialize.rb +0 -217
- data/lib/bioroebe/shell/loop.rb +0 -74
- data/lib/bioroebe/shell/prompt.rb +0 -107
- data/lib/bioroebe/shell/random.rb +0 -289
- data/lib/bioroebe/shell/reset.rb +0 -335
- data/lib/bioroebe/shell/scan_and_parse.rb +0 -135
- data/lib/bioroebe/shell/search.rb +0 -337
- data/lib/bioroebe/shell/sequences.rb +0 -200
- data/lib/bioroebe/shell/show_report_and_display.rb +0 -2901
- data/lib/bioroebe/shell/startup.rb +0 -127
- data/lib/bioroebe/shell/taxonomy.rb +0 -14
- data/lib/bioroebe/shell/tk.rb +0 -23
- data/lib/bioroebe/shell/user_input.rb +0 -88
- data/lib/bioroebe/shell/xorg.rb +0 -45
- /data/lib/bioroebe/java/bioroebe/{BisulfiteTreatment.java → src/main/java/bioroebe/BisulfiteTreatment.java} +0 -0
- /data/lib/bioroebe/java/bioroebe/{Esystem.class → src/main/java/bioroebe/Esystem.class} +0 -0
- /data/lib/bioroebe/java/bioroebe/{Esystem.java → src/main/java/bioroebe/Esystem.java} +0 -0
- /data/lib/bioroebe/java/bioroebe/{RemoveFile.class → src/main/java/bioroebe/RemoveFile.class} +0 -0
@@ -2,65 +2,152 @@
|
|
2
2
|
# Encoding: UTF-8
|
3
3
|
# frozen_string_literal: true
|
4
4
|
# =========================================================================== #
|
5
|
+
# === Bioroebe::ConvertThisCodonToThatAminoacid
|
6
|
+
#
|
7
|
+
# This class can be used to convert a particular codon, such as 'ATG',
|
8
|
+
# into the corresponding aminoacid, in this case being 'M' for
|
9
|
+
# Methionin. A String will be returned by this method.
|
10
|
+
#
|
11
|
+
# The characters in that String will correspond to the one-letter
|
12
|
+
# format of aminoacids, such as the example shown above 'M' for
|
13
|
+
# Methionin.
|
14
|
+
#
|
15
|
+
# The method has to handle invalid input arguments as well, to some
|
16
|
+
# extent.
|
17
|
+
#
|
18
|
+
# The method supports both DNA and mRNA as "input".
|
19
|
+
#
|
20
|
+
# In order for the method to do its job properly, the method will
|
21
|
+
# make use of the codon table stored in:
|
22
|
+
#
|
23
|
+
# Bioroebe.aa_to_rna_codon_table
|
24
|
+
#
|
25
|
+
# Also note that this method can easily be used to translate
|
26
|
+
# other frames - simply provide the proper input to it.
|
27
|
+
#
|
28
|
+
# Note that this method will return the result - it will NOT
|
29
|
+
# output the result.
|
30
|
+
#
|
31
|
+
# Usage examples:
|
32
|
+
#
|
33
|
+
# Bioroebe::ConvertThisCodonToThatAminoacid.new
|
34
|
+
# puts Bioroebe.codon_to_aminoacid('ATG') # => "M"
|
35
|
+
# puts Bioroebe.codon_to_aminoacid('GUG') # => "V"
|
36
|
+
# puts Bioroebe.decode_this_codon('CCG') # => "P"
|
37
|
+
# puts Bioroebe.codon_to_aminoacid('GUGGUG') # => "VV"
|
38
|
+
# puts Bioroebe.codon_to_aminoacid('ATGA') # => "M"
|
39
|
+
# puts Bioroebe.convert_dna_to_protein_sequence('ATGA') # => "M"
|
40
|
+
# puts Bioroebe.convert_this_codon_to_that_aminoacid('ATGA') # => "M"
|
41
|
+
#
|
42
|
+
# Commandline usage example:
|
43
|
+
#
|
44
|
+
# dcodon TTT TTC # => ["TTY"]
|
45
|
+
#
|
46
|
+
# =========================================================================== #
|
5
47
|
# require 'bioroebe/codons/convert_this_codon_to_that_aminoacid.rb'
|
6
48
|
# =========================================================================== #
|
49
|
+
require 'bioroebe/base/commandline_application/commandline_application.rb'
|
50
|
+
|
7
51
|
module Bioroebe
|
8
52
|
|
53
|
+
class ConvertThisCodonToThatAminoacid < ::Bioroebe::CommandlineApplication # === Bioroebe::ConvertThisCodonToThatAminoacid
|
54
|
+
|
9
55
|
require 'bioroebe/codons/codon_table.rb'
|
10
56
|
|
11
57
|
# ========================================================================= #
|
12
|
-
# ===
|
13
|
-
#
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
#
|
35
|
-
#
|
36
|
-
#
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
58
|
+
# === initialize
|
59
|
+
# ========================================================================= #
|
60
|
+
def initialize(
|
61
|
+
i = nil, # This should be an Array.
|
62
|
+
run_already = true,
|
63
|
+
&block
|
64
|
+
)
|
65
|
+
reset
|
66
|
+
set_commandline_arguments(i)
|
67
|
+
if block_given?
|
68
|
+
yielded = yield
|
69
|
+
case yielded
|
70
|
+
# ======================================================================= #
|
71
|
+
# === :be_quiet
|
72
|
+
# ======================================================================= #
|
73
|
+
when :be_quiet
|
74
|
+
be_quiet
|
75
|
+
end
|
76
|
+
end
|
77
|
+
run if run_already
|
78
|
+
end
|
79
|
+
|
80
|
+
# ========================================================================= #
|
81
|
+
# === reset (reset tag)
|
82
|
+
# ========================================================================= #
|
83
|
+
def reset
|
84
|
+
super()
|
85
|
+
# ======================================================================= #
|
86
|
+
# === @shall_we_replace_stop_codons
|
87
|
+
# ======================================================================= #
|
88
|
+
@shall_we_replace_stop_codons = :default
|
89
|
+
# ======================================================================= #
|
90
|
+
# === @with_trailer
|
91
|
+
# ======================================================================= #
|
92
|
+
@with_trailer = false
|
93
|
+
end
|
94
|
+
|
48
95
|
# ========================================================================= #
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
96
|
+
# === menu (menu tag)
|
97
|
+
# ========================================================================= #
|
98
|
+
def menu(
|
99
|
+
i = commandline_arguments_starting_with_a_hyphen?
|
53
100
|
)
|
54
|
-
|
101
|
+
if i.is_a? Array
|
102
|
+
i.each {|entry| menu(entry) }
|
103
|
+
else
|
104
|
+
case i # case tag
|
105
|
+
# ===================================================================== #
|
106
|
+
# === codon_to_aa --with-trailer
|
107
|
+
# ===================================================================== #
|
108
|
+
when /^-?-?with(-|_)?trailer$/i
|
109
|
+
@with_trailer = true
|
110
|
+
# ===================================================================== #
|
111
|
+
# === codon_to_aa --help
|
112
|
+
# ===================================================================== #
|
113
|
+
when /^-?-?help$/i
|
114
|
+
show_help
|
115
|
+
exit
|
116
|
+
end
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
120
|
+
# ========================================================================= #
|
121
|
+
# === show_help (help tag)
|
122
|
+
# ========================================================================= #
|
123
|
+
def show_help
|
124
|
+
e
|
125
|
+
e " --with-trailer # display any result via 5'- and -3' padding"
|
126
|
+
e
|
127
|
+
end
|
128
|
+
|
129
|
+
# ========================================================================= #
|
130
|
+
# === run (run tag)
|
131
|
+
# ========================================================================= #
|
132
|
+
def run
|
133
|
+
i = commandline_arguments?
|
134
|
+
menu(
|
135
|
+
commandline_arguments_starting_with_a_hyphen(i)
|
136
|
+
)
|
137
|
+
case @shall_we_replace_stop_codons
|
138
|
+
# ======================================================================= #
|
139
|
+
# === :default
|
140
|
+
# ======================================================================= #
|
55
141
|
when :default
|
56
|
-
shall_we_replace_stop_codons = true
|
142
|
+
@shall_we_replace_stop_codons = true
|
57
143
|
end
|
58
144
|
if i.is_a? Array
|
59
|
-
i = i.join
|
145
|
+
i = reject_hyphens(i).join
|
60
146
|
end
|
61
147
|
i = i.to_s.dup
|
62
148
|
i.upcase!
|
63
149
|
i.tr!('U','T') # We need DNA here, so U becomes T.
|
150
|
+
use_this_codon_table = codon_table_dataset?.dup
|
64
151
|
# ======================================================================= #
|
65
152
|
# Obtain the dataset from the correct codon_table next.
|
66
153
|
# ======================================================================= #
|
@@ -80,23 +167,70 @@ module Bioroebe
|
|
80
167
|
}
|
81
168
|
result = scanned
|
82
169
|
result = result.join if result.is_a? Array
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
170
|
+
if @with_trailer
|
171
|
+
result = result.dup
|
172
|
+
result.prepend("5'-")
|
173
|
+
result << "-3'"
|
174
|
+
end
|
175
|
+
@result = result
|
176
|
+
report
|
177
|
+
end
|
178
|
+
|
179
|
+
# ========================================================================= #
|
180
|
+
# === report
|
181
|
+
# ========================================================================= #
|
182
|
+
def report
|
183
|
+
e @result if be_verbose?
|
184
|
+
end
|
185
|
+
|
186
|
+
# ========================================================================= #
|
187
|
+
# === result?
|
188
|
+
# ========================================================================= #
|
189
|
+
def result?
|
190
|
+
@result
|
191
|
+
end; alias sequence? result? # === sequence?
|
192
|
+
|
193
|
+
# ========================================================================= #
|
194
|
+
# === Bioroebe::ConvertThisCodonToThatAminoacid[]
|
195
|
+
#
|
196
|
+
# Usage example:
|
197
|
+
#
|
198
|
+
# Bioroebe::ConvertThisCodonToThatAminoacid[]
|
199
|
+
#
|
200
|
+
# ========================================================================= #
|
201
|
+
def self.[](i = '')
|
202
|
+
new(i).result?
|
203
|
+
end
|
204
|
+
|
205
|
+
end
|
206
|
+
|
207
|
+
# =========================================================================== #
|
208
|
+
# === Bioroebe.convert_this_codon_to_that_aminoacid
|
209
|
+
# =========================================================================== #
|
210
|
+
def self.convert_this_codon_to_that_aminoacid(i = ARGV)
|
211
|
+
Bioroebe::ConvertThisCodonToThatAminoacid.new(i) { :be_quiet }
|
212
|
+
end; self.instance_eval { alias decode_this_codon convert_this_codon_to_that_aminoacid } # === Bioroebe.decode_this_codon
|
213
|
+
self.instance_eval { alias convert_dna_to_protein_sequence convert_this_codon_to_that_aminoacid } # === Bioroebe.convert_dna_to_protein_sequence
|
214
|
+
self.instance_eval { alias translate_dna_into_aminoacid convert_this_codon_to_that_aminoacid } # === Bioroebe.translate_dna_into_aminoacid
|
215
|
+
self.instance_eval { alias dna_to_aa convert_this_codon_to_that_aminoacid } # === Bioroebe.dna_to_aa
|
216
|
+
self.instance_eval { alias codon_to_aminoacid convert_this_codon_to_that_aminoacid } # === Bioroebe.codon_to_aminoacid
|
89
217
|
|
90
218
|
end
|
91
219
|
|
92
220
|
if __FILE__ == $PROGRAM_NAME
|
93
221
|
alias e puts
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
222
|
+
if ARGV.empty?
|
223
|
+
# ======================================================================= #
|
224
|
+
# pp Bioroebe.convert_this_codon_to_that_aminoacid(ARGV)
|
225
|
+
# pp Bioroebe.convert_this_codon_to_that_aminoacid(ARGV)
|
226
|
+
# ======================================================================= #
|
227
|
+
e 'GUGGUG → '+Bioroebe.codon_to_aminoacid('GUGGUG') # => "VV"
|
228
|
+
e 'ATG → '+Bioroebe.codon_to_aminoacid('ATG') # => "M"
|
229
|
+
e 'GUG → '+Bioroebe.codon_to_aminoacid('GUG') # => "V"
|
230
|
+
e 'CCG → '+Bioroebe.decode_this_codon('CCG') # => "P"
|
231
|
+
e 'ATGA → '+Bioroebe.codon_to_aminoacid('ATGA') # => "M"
|
232
|
+
e 'ATGA → '+Bioroebe.convert_dna_to_protein_sequence('ATGA') # => "M"
|
233
|
+
else
|
234
|
+
_ = Bioroebe::ConvertThisCodonToThatAminoacid.new(ARGV)
|
235
|
+
end
|
236
|
+
end # ConvertThisCodonToThatAminoacid GGT GGC
|
@@ -27,11 +27,6 @@ class PossibleCodonsForThisAminoacid < ::Bioroebe::CommandlineApplication # ===
|
|
27
27
|
|
28
28
|
require 'bioroebe/codons/codon_table.rb'
|
29
29
|
|
30
|
-
# ========================================================================= #
|
31
|
-
# === NAMESPACE
|
32
|
-
# ========================================================================= #
|
33
|
-
NAMESPACE = inspect
|
34
|
-
|
35
30
|
# ========================================================================= #
|
36
31
|
# === SHOW_ADDITIONAL_HINTS
|
37
32
|
#
|
@@ -93,10 +88,7 @@ class PossibleCodonsForThisAminoacid < ::Bioroebe::CommandlineApplication # ===
|
|
93
88
|
# ========================================================================= #
|
94
89
|
def reset
|
95
90
|
super()
|
96
|
-
|
97
|
-
# === @namespace
|
98
|
-
# ======================================================================= #
|
99
|
-
@namespace = NAMESPACE
|
91
|
+
infer_the_namespace
|
100
92
|
# ======================================================================= #
|
101
93
|
# === @try_to_identify_purines_and_pyrimidines
|
102
94
|
# ======================================================================= #
|
@@ -37,6 +37,7 @@ class ShowCodonTables < ::Bioroebe::CommandlineApplication # === Bioroebe::ShowC
|
|
37
37
|
else
|
38
38
|
first = show_what
|
39
39
|
end
|
40
|
+
first = first.to_s.delete('-')
|
40
41
|
case first.to_sym
|
41
42
|
# ======================================================================= #
|
42
43
|
# === :human
|
@@ -56,7 +57,9 @@ class ShowCodonTables < ::Bioroebe::CommandlineApplication # === Bioroebe::ShowC
|
|
56
57
|
:headers,
|
57
58
|
'--headers'
|
58
59
|
::Bioroebe::CodonTables.definitions?.each_pair {|number, long_name|
|
59
|
-
e number.to_s.rjust(3)
|
60
|
+
e turquoise(number.to_s.rjust(3))
|
61
|
+
+') '+
|
62
|
+
long_name.ljust(70)
|
60
63
|
}
|
61
64
|
end
|
62
65
|
end
|
@@ -127,4 +130,5 @@ end
|
|
127
130
|
if __FILE__ == $PROGRAM_NAME
|
128
131
|
Bioroebe::ShowCodonTables.new(ARGV)
|
129
132
|
end # showcodontables
|
130
|
-
# showcodontables human
|
133
|
+
# showcodontables human
|
134
|
+
# showcodontables everything
|
@@ -24,6 +24,7 @@ module Bioroebe
|
|
24
24
|
class ShowCodonUsage < ::Bioroebe::CommandlineApplication # === Bioroebe::ShowCodonUsage
|
25
25
|
|
26
26
|
require 'bioroebe/toplevel_methods/aminoacids_and_proteins.rb'
|
27
|
+
require 'bioroebe/codons/convert_this_codon_to_that_aminoacid.rb'
|
27
28
|
|
28
29
|
# ========================================================================= #
|
29
30
|
# === initialize
|
@@ -133,12 +134,13 @@ class ShowCodonUsage < ::Bioroebe::CommandlineApplication # === Bioroebe::ShowCo
|
|
133
134
|
# ========================================================================= #
|
134
135
|
def report_the_top_five_codons(from_this_dataset)
|
135
136
|
e
|
136
|
-
|
137
|
+
erev 'The '+mediumpurple('top five codons')+
|
138
|
+
rev+' in use, sorted by frequency, are:'
|
137
139
|
e
|
138
140
|
top_five = from_this_dataset.sort_by {|key, values| values }.reverse[0..4]
|
139
141
|
top_five.each {|name_of_codon, how_many_of_them|
|
140
142
|
_ = name_of_codon.upcase
|
141
|
-
this_codon = codon_to_aminoacid(_)
|
143
|
+
this_codon = codon_to_aminoacid(_).sequence?
|
142
144
|
colourized_this_codon = turquoise(this_codon)
|
143
145
|
e rev+' - '+
|
144
146
|
teal(_)+
|
@@ -184,10 +186,19 @@ end
|
|
184
186
|
|
185
187
|
# =========================================================================== #
|
186
188
|
# === Bioroebe.codon_frequencies_of_this_sequence
|
189
|
+
#
|
190
|
+
# Usage example:
|
191
|
+
#
|
192
|
+
# x = Bioroebe.codon_frequencies_of_this_sequence('ATGGGCGGGGTGATGGCAATGCCTTTAATGCCGCCAAAAAAAAAAAAAAAA')
|
193
|
+
#
|
194
|
+
# Will yield this Hash:
|
195
|
+
#
|
196
|
+
# {"AAA"=>5, "ATG"=>4, "CCA"=>1, "CCG"=>1, "TTA"=>1, "CCT"=>1, "GCA"=>1, "GTG"=>1, "GGG"=>1, "GGC"=>1}
|
197
|
+
#
|
187
198
|
# =========================================================================== #
|
188
199
|
def self.codon_frequencies_of_this_sequence(i = ARGV)
|
189
|
-
Bioroebe::ShowCodonUsage.new(i) { :be_quiet }
|
190
|
-
end
|
200
|
+
Bioroebe::ShowCodonUsage.new(i) { :be_quiet }.result?
|
201
|
+
end; self.instance_eval { alias hash_frequencies codon_frequencies_of_this_sequence } # === Bioroebe.hash_frequencies
|
191
202
|
|
192
203
|
end
|
193
204
|
|
data/lib/bioroebe/colours/rev.rb
CHANGED
@@ -17,7 +17,10 @@ module Bioroebe
|
|
17
17
|
# ========================================================================= #
|
18
18
|
def self.rev
|
19
19
|
if @use_colours
|
20
|
-
|
20
|
+
unless Object.const_defined?(:Colours)
|
21
|
+
require 'colours'
|
22
|
+
end
|
23
|
+
return ::Colours::GREEN # Default colour goes in here.
|
21
24
|
end
|
22
25
|
return ''
|
23
26
|
end
|
@@ -3,6 +3,7 @@
|
|
3
3
|
# frozen_string_literal: true
|
4
4
|
# =========================================================================== #
|
5
5
|
# require 'bioroebe/constants/aminoacids_and_proteins.rb'
|
6
|
+
# Bioroebe.filter_away_invalid_aminoacids
|
6
7
|
# =========================================================================== #
|
7
8
|
module Bioroebe
|
8
9
|
|
@@ -89,7 +89,7 @@ module Postgresql # === Bioroebe::Postgresql
|
|
89
89
|
DROP_TABLE_FASTA = 'DROP TABLE fasta;'
|
90
90
|
|
91
91
|
# ========================================================================= #
|
92
|
-
# === POSTGRE_DROP_FASTA_COMMAND
|
92
|
+
# === Bioroebe::Postgresql::POSTGRE_DROP_FASTA_COMMAND
|
93
93
|
# ========================================================================= #
|
94
94
|
POSTGRE_DROP_FASTA_COMMAND = DROP_FASTA_TABLE = DROP_TABLE_FASTA
|
95
95
|
|
@@ -165,15 +165,23 @@ module Bioroebe
|
|
165
165
|
end
|
166
166
|
|
167
167
|
# ========================================================================= #
|
168
|
-
# ===
|
168
|
+
# === Bioroebe.fasta_dir?
|
169
|
+
# ========================================================================= #
|
170
|
+
def self.fasta_dir?
|
171
|
+
"#{Bioroebe.log_dir?}fasta/"
|
172
|
+
end
|
173
|
+
|
174
|
+
# ========================================================================= #
|
175
|
+
# === Bioroebe.file_fastq_quality_schemes
|
169
176
|
#
|
170
177
|
# This constant will point to a location such as this one here:
|
171
178
|
#
|
172
179
|
# /Programs/Ruby/2.6.4/lib/ruby/site_ruby/2.6.0/bioroebe/yaml/fastq_quality_schemes.yml
|
173
180
|
#
|
174
181
|
# ========================================================================= #
|
175
|
-
|
176
|
-
"#{project_yaml_directory?}fastq_quality_schemes.yml"
|
182
|
+
def self.file_fastq_quality_schemes
|
183
|
+
"#{project_yaml_directory?}fasta_and_fastq/fastq_quality_schemes.yml"
|
184
|
+
end
|
177
185
|
|
178
186
|
# ========================================================================= #
|
179
187
|
# === Bioroebe.file_talens
|
@@ -318,10 +326,17 @@ module Bioroebe
|
|
318
326
|
# ========================================================================= #
|
319
327
|
# === Bioroebe.file_restriction_enzymes
|
320
328
|
# ========================================================================= #
|
321
|
-
def file_restriction_enzymes
|
329
|
+
def self.file_restriction_enzymes
|
322
330
|
FILE_RESTRICTION_ENZYMES
|
323
331
|
end
|
324
332
|
|
333
|
+
# ========================================================================= #
|
334
|
+
# === file_restriction_enzymes
|
335
|
+
# ========================================================================= #
|
336
|
+
def file_restriction_enzymes
|
337
|
+
::Bioroebe.file_restriction_enzymes
|
338
|
+
end
|
339
|
+
|
325
340
|
# ========================================================================= #
|
326
341
|
# === Bioroebe.blosum_directory?
|
327
342
|
# ========================================================================= #
|
@@ -553,6 +568,18 @@ module Bioroebe
|
|
553
568
|
"#{project_yaml_directory?}aminoacids/molecular_weight.yml"
|
554
569
|
end
|
555
570
|
|
571
|
+
# ========================================================================= #
|
572
|
+
# === Bioroebe.file_amino_acids_long_name_to_one_letter
|
573
|
+
#
|
574
|
+
# This method will return a String such as:
|
575
|
+
#
|
576
|
+
# "/home/Programs/Ruby/3.1.2/lib/ruby/site_ruby/3.1.0/bioroebe/yaml/aminoacids/amino_acids_long_name_to_one_letter.yml"
|
577
|
+
#
|
578
|
+
# ========================================================================= #
|
579
|
+
def self.file_amino_acids_long_name_to_one_letter
|
580
|
+
"#{project_yaml_directory?}aminoacids/amino_acids_long_name_to_one_letter.yml"
|
581
|
+
end
|
582
|
+
|
556
583
|
end
|
557
584
|
|
558
585
|
if __FILE__ == $PROGRAM_NAME
|
@@ -43,6 +43,26 @@ module Bioroebe
|
|
43
43
|
# ========================================================================= #
|
44
44
|
TOKEN = '|'
|
45
45
|
|
46
|
+
# ========================================================================= #
|
47
|
+
# === VALID_WAYS_TO_EXIT
|
48
|
+
#
|
49
|
+
# All ways to exit will be recorded here.
|
50
|
+
#
|
51
|
+
# If you need to use more ways, simply append to this Array.
|
52
|
+
#
|
53
|
+
# This constant may have to be moved into the bio-shell part eventually.
|
54
|
+
# ========================================================================= #
|
55
|
+
VALID_WAYS_TO_EXIT = %w(
|
56
|
+
quit q exit qq :q qt
|
57
|
+
bye
|
58
|
+
rda
|
59
|
+
r2
|
60
|
+
tq
|
61
|
+
sq
|
62
|
+
exit_program
|
63
|
+
exitprogram
|
64
|
+
)
|
65
|
+
|
46
66
|
# ========================================================================= #
|
47
67
|
# === NAMES_ENTRIES
|
48
68
|
#
|
@@ -40,6 +40,7 @@ module Bioroebe
|
|
40
40
|
class DnaToAminoacidSequence < ::Bioroebe::CommandlineApplication # === Bioroebe::DnaToAminoacidSequence
|
41
41
|
|
42
42
|
require 'bioroebe/codons/codon_table.rb'
|
43
|
+
require 'bioroebe/misc/ruler.rb'
|
43
44
|
|
44
45
|
# ========================================================================= #
|
45
46
|
# === DEFAULT_RUN_MODE
|
@@ -63,8 +64,9 @@ class DnaToAminoacidSequence < ::Bioroebe::CommandlineApplication # === Bioroebe
|
|
63
64
|
if block_given?
|
64
65
|
yielded = yield
|
65
66
|
case yielded
|
67
|
+
# === :be_verbose
|
66
68
|
when :be_verbose
|
67
|
-
|
69
|
+
set_be_verbose
|
68
70
|
when :be_quiet
|
69
71
|
be_quiet
|
70
72
|
end
|
@@ -155,6 +157,10 @@ class DnaToAminoacidSequence < ::Bioroebe::CommandlineApplication # === Bioroebe
|
|
155
157
|
# ======================================================================= #
|
156
158
|
@internal_hash[:report_result] = true
|
157
159
|
# ======================================================================= #
|
160
|
+
# === :show_ruler
|
161
|
+
# ======================================================================= #
|
162
|
+
@internal_hash[:show_ruler] = false
|
163
|
+
# ======================================================================= #
|
158
164
|
# === :show_as_three_letter_aminoacid_sequence
|
159
165
|
#
|
160
166
|
# If this is true then this class will show "Phe" rather than "F" for
|
@@ -188,7 +194,7 @@ class DnaToAminoacidSequence < ::Bioroebe::CommandlineApplication # === Bioroebe
|
|
188
194
|
# === be_quiet
|
189
195
|
# ========================================================================= #
|
190
196
|
def be_quiet
|
191
|
-
|
197
|
+
set_be_quiet
|
192
198
|
@internal_hash[:report_result] = false
|
193
199
|
end
|
194
200
|
|
@@ -307,7 +313,10 @@ class DnaToAminoacidSequence < ::Bioroebe::CommandlineApplication # === Bioroebe
|
|
307
313
|
)
|
308
314
|
end
|
309
315
|
set_result(result)
|
310
|
-
if report_result? and
|
316
|
+
if report_result? and be_verbose?
|
317
|
+
if show_ruler? # Show a pretty ruler here.
|
318
|
+
e " #{Bioroebe.return_ruler(i)}"
|
319
|
+
end
|
311
320
|
e " #{@result}"
|
312
321
|
e N
|
313
322
|
end
|
@@ -339,23 +348,6 @@ class DnaToAminoacidSequence < ::Bioroebe::CommandlineApplication # === Bioroebe
|
|
339
348
|
]
|
340
349
|
end
|
341
350
|
|
342
|
-
# ========================================================================= #
|
343
|
-
# === show_help (help tag)
|
344
|
-
# ========================================================================= #
|
345
|
-
def show_help
|
346
|
-
e 'Available options:'
|
347
|
-
e
|
348
|
-
e ' --gui # start the GUI'
|
349
|
-
e ' --stop-at-the-first-stop-codon # stop at the first stop codon encountered'
|
350
|
-
e ' --frame1 # show the first frame translation only'
|
351
|
-
e ' --frame2 # show the second frame translation only'
|
352
|
-
e ' --frame3 # show the third frame translation only'
|
353
|
-
e ' --use-this-codon-table=bacteria # specify a specific codon table '\
|
354
|
-
'(in this case bacteria)'
|
355
|
-
e ' --three-letter # show the three letter amino acid code'
|
356
|
-
e
|
357
|
-
end
|
358
|
-
|
359
351
|
# ========================================================================= #
|
360
352
|
# === menu (menu tag)
|
361
353
|
#
|
@@ -372,6 +364,16 @@ class DnaToAminoacidSequence < ::Bioroebe::CommandlineApplication # === Bioroebe
|
|
372
364
|
else
|
373
365
|
case i
|
374
366
|
# ===================================================================== #
|
367
|
+
# === Show a helpful ruler
|
368
|
+
#
|
369
|
+
# Usage example:
|
370
|
+
#
|
371
|
+
# dnatoaminoacidsequence AUGUUU --ruler
|
372
|
+
#
|
373
|
+
# ===================================================================== #
|
374
|
+
when /^-?-?ruler$/i
|
375
|
+
do_show_ruler
|
376
|
+
# ===================================================================== #
|
375
377
|
# === Show the aminoacids as three-letter code
|
376
378
|
#
|
377
379
|
# Usage example:
|
@@ -496,14 +498,33 @@ class DnaToAminoacidSequence < ::Bioroebe::CommandlineApplication # === Bioroebe
|
|
496
498
|
#
|
497
499
|
# The result is stored in the variable called @result.
|
498
500
|
# ===================================================================== #
|
499
|
-
translated_codon = translate_dna_into_aminoacid(this_codon)
|
500
|
-
@result << translated_codon
|
501
|
+
translated_codon = translate_dna_into_aminoacid(this_codon).to_s
|
502
|
+
@result << translated_codon
|
501
503
|
if @stop_at_the_first_stop_codon and (translated_codon == '*')
|
502
504
|
break
|
503
505
|
end
|
504
506
|
}
|
505
507
|
end
|
506
508
|
|
509
|
+
# ========================================================================= #
|
510
|
+
# === show_help (help tag)
|
511
|
+
# ========================================================================= #
|
512
|
+
def show_help
|
513
|
+
e 'Available options:'
|
514
|
+
e
|
515
|
+
e ' --gui # start the GUI'
|
516
|
+
e ' --stop-at-the-first-stop-codon # stop at the first stop codon encountered'
|
517
|
+
e ' --frame1 # show the first frame translation only'
|
518
|
+
e ' --frame2 # show the second frame translation only'
|
519
|
+
e ' --frame3 # show the third frame translation only'
|
520
|
+
e ' --use-this-codon-table=bacteria # specify a specific codon table '\
|
521
|
+
'(in this case bacteria)'
|
522
|
+
e ' --three-letter # show the three letter amino acid code'
|
523
|
+
e ' --ruler # show a helpful ruler on top '\
|
524
|
+
'of the sequence'
|
525
|
+
e
|
526
|
+
end
|
527
|
+
|
507
528
|
# ========================================================================= #
|
508
529
|
# === run (run tag)
|
509
530
|
# ========================================================================= #
|
@@ -512,6 +533,20 @@ class DnaToAminoacidSequence < ::Bioroebe::CommandlineApplication # === Bioroebe
|
|
512
533
|
do_the_conversion_step
|
513
534
|
report
|
514
535
|
end
|
536
|
+
|
537
|
+
# ========================================================================= #
|
538
|
+
# === do_show_ruler
|
539
|
+
# ========================================================================= #
|
540
|
+
def do_show_ruler
|
541
|
+
@internal_hash[:show_ruler] = true
|
542
|
+
end
|
543
|
+
|
544
|
+
# ========================================================================= #
|
545
|
+
# === show_ruler?
|
546
|
+
# ========================================================================= #
|
547
|
+
def show_ruler?
|
548
|
+
@internal_hash[:show_ruler]
|
549
|
+
end
|
515
550
|
|
516
551
|
# ========================================================================= #
|
517
552
|
# === Bioroebe::DnaToAminoacidSequence[]
|
@@ -556,8 +591,7 @@ if __FILE__ == $PROGRAM_NAME
|
|
556
591
|
if _.empty?
|
557
592
|
_ = 'ATGCGTAAAGGAGAAGAACTTTTCACTTGGAGTTGTCCCAATTCTTGTTGGGAATTAGATGGTGATGTTAATGGGCACAAATTTTCTGTCAGTGGAGAGGGTGAAGGTGATGCAACATACGGAAAACTTACCCTTAAATTTATTTGCACTACTGGAAAACTACCTGTTCCATGGCCAACACTTGTCACTACTTTCGGTTATGGTGTTCAATGCTTTGCGAGATACCCAGATCATATGAAACAGCATGACTTTTTCAAGAGTGCCATGCCCGAAGGTTATGTACAGGAAAGAACTATATTTTTCAAAGATGACGGGAACTACAAGACACGTGCTGAAGTCAAGTTTGAAGGTGATACCCTTGTTAATAGAATCGAGTTAAAAGGTATTGATTTTAAAGAAGATGGAAACATTCTTGGACACAAATTGGAATACAACTATAACTCACACAATGTATACATCATGGCAGACAAACAAAAGAATGGAATCAAAGTTAACTTCAAAATTAGACACAACATTGAAGATGGAAGCGTTCAACTAGCAGACCATTATCAACAAAATACTCCAATTGGCGATGGCCCTGTCCTTTTACCAGACAACCATTACCTGTCCACACAATCTGCCCTTTCGAAAGATCCCAACGAAAAGAGAGACCACATGGTCCTTCTTGAGTTTGTAACAGCTGCTGGGATTACACATGGCATGGATGAACTATACAAATAG'
|
558
593
|
end
|
559
|
-
Bioroebe.erev
|
560
|
-
_.join
|
594
|
+
Bioroebe.erev('The input-sequence was: '+_)
|
561
595
|
Bioroebe::DnaToAminoacidSequence.new(_)
|
562
596
|
e
|
563
597
|
e 'Next, all three frames will be translated:'
|