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
@@ -52,13 +52,11 @@ class Interactive < ::Bioroebe::CommandlineApplication # === Bioroebe::Taxonomy:
|
|
52
52
|
Roebe::SqlParadise::Commands.set_temp_dir ::Bioroebe.log_dir?
|
53
53
|
rescue LoadError; end
|
54
54
|
|
55
|
-
# ========================================================================= #
|
56
|
-
# === NAMESPACE
|
57
|
-
# ========================================================================= #
|
58
|
-
NAMESPACE = inspect
|
59
|
-
|
60
55
|
# ========================================================================= #
|
61
56
|
# === FASTA_SQL
|
57
|
+
#
|
58
|
+
# This constant will point towards a location such as
|
59
|
+
# "/home/Temp/bioroebe/autogenerated_sql_files/fasta.sql".
|
62
60
|
# ========================================================================= #
|
63
61
|
FASTA_SQL = AUTOGENERATED_SQL_FILES_DIR+'fasta.sql'
|
64
62
|
|
@@ -102,10 +100,7 @@ class Interactive < ::Bioroebe::CommandlineApplication # === Bioroebe::Taxonomy:
|
|
102
100
|
# ========================================================================= #
|
103
101
|
def reset
|
104
102
|
super()
|
105
|
-
|
106
|
-
# === @namespace
|
107
|
-
# ======================================================================= #
|
108
|
-
@namespace = NAMESPACE
|
103
|
+
infer_the_namespace
|
109
104
|
# ======================================================================= #
|
110
105
|
# === @be_verbose
|
111
106
|
# ======================================================================= #
|
@@ -124,6 +119,69 @@ class Interactive < ::Bioroebe::CommandlineApplication # === Bioroebe::Taxonomy:
|
|
124
119
|
@run_standalone = true
|
125
120
|
end
|
126
121
|
|
122
|
+
# ========================================================================= #
|
123
|
+
# === create_fasta_table
|
124
|
+
#
|
125
|
+
# This method generates the fasta table into either postgresql or
|
126
|
+
# whatever else you stored things into.
|
127
|
+
# ========================================================================= #
|
128
|
+
def create_fasta_table
|
129
|
+
remove(FASTA_SQL)
|
130
|
+
# e 'Now storing into fasta.sql (Fasta-Format).'
|
131
|
+
create_and_save_table(:default_fasta, true) # true for verbose
|
132
|
+
cat FASTA_SQL # Also display it, after creation.
|
133
|
+
# Next, drop the old Fasta table. But we must set the password before.
|
134
|
+
e 'Trying to drop the fasta table next.'
|
135
|
+
drop_table :fasta
|
136
|
+
# And now, read in the new one.
|
137
|
+
read_sql :fasta
|
138
|
+
end
|
139
|
+
|
140
|
+
# ========================================================================= #
|
141
|
+
# === create_and_save_table
|
142
|
+
# ========================================================================= #
|
143
|
+
def create_and_save_table(
|
144
|
+
i, be_verbose = false
|
145
|
+
)
|
146
|
+
case i
|
147
|
+
# ======================================================================= #
|
148
|
+
# === :default_fasta
|
149
|
+
# ======================================================================= #
|
150
|
+
when :default_fasta
|
151
|
+
i = FASTA_SQL
|
152
|
+
end
|
153
|
+
require 'roebe/sql_paradise/commands.rb'
|
154
|
+
Roebe::SqlParadise::Commands.create_and_save_table(i, be_verbose)
|
155
|
+
end
|
156
|
+
|
157
|
+
# ========================================================================= #
|
158
|
+
# === update_local_localomes
|
159
|
+
#
|
160
|
+
# Update the local collection. This will overwrite the old dataset
|
161
|
+
# completely, so be careful when using this.
|
162
|
+
#
|
163
|
+
# To invoke this method via the interactive menu, do:
|
164
|
+
#
|
165
|
+
# update databases
|
166
|
+
#
|
167
|
+
# ========================================================================= #
|
168
|
+
def update_local_localomes
|
169
|
+
show_current_time
|
170
|
+
create_fasta_table # Get in a new, fresh table.
|
171
|
+
_ = get_all_info_entries_with_tax_id
|
172
|
+
show_current_time
|
173
|
+
_.each {|entry|
|
174
|
+
e "Next working on `#{sfile(entry)}`."
|
175
|
+
create_sql_file_from_local_fasta_entry(entry)
|
176
|
+
}
|
177
|
+
report_how_many_info_files_exist_and_how_many_lack_taxonomy_id
|
178
|
+
old_time = @time
|
179
|
+
show_time_now # Show the end time.
|
180
|
+
new_time = @time
|
181
|
+
difference = Time.parse(new_time) - Time.parse(old_time)
|
182
|
+
report_how_long_it_took_us(difference, 'localome table')
|
183
|
+
end
|
184
|
+
|
127
185
|
# ========================================================================= #
|
128
186
|
# === get (get tag)
|
129
187
|
#
|
@@ -204,34 +262,13 @@ class Interactive < ::Bioroebe::CommandlineApplication # === Bioroebe::Taxonomy:
|
|
204
262
|
end
|
205
263
|
end
|
206
264
|
|
207
|
-
# ========================================================================= #
|
208
|
-
# === update_local_localomes
|
209
|
-
#
|
210
|
-
# Update the local collection. This will overwrite the old dataset
|
211
|
-
# completely, so be careful when using this.
|
212
|
-
# ========================================================================= #
|
213
|
-
def update_local_localomes
|
214
|
-
show_current_time
|
215
|
-
create_fasta_table # Get in a new, fresh table.
|
216
|
-
_ = get_all_info_entries_with_tax_id
|
217
|
-
show_current_time
|
218
|
-
_.each {|entry|
|
219
|
-
e 'Next working on '+sfile(entry)
|
220
|
-
create_sql_file_from_local_fasta_entry(entry)
|
221
|
-
}
|
222
|
-
report_how_many_info_files_exist_and_how_many_lack_taxonomy_id
|
223
|
-
old_time = @time
|
224
|
-
show_time_now # Show the end time.
|
225
|
-
new_time = @time
|
226
|
-
difference = Time.parse(new_time) - Time.parse(old_time)
|
227
|
-
report_how_long_it_took_us(difference, 'localome table')
|
228
|
-
end
|
229
|
-
|
230
265
|
# ========================================================================= #
|
231
266
|
# === try_to_display_the_status
|
232
267
|
# ========================================================================= #
|
233
|
-
def try_to_display_the_status(
|
234
|
-
|
268
|
+
def try_to_display_the_status(
|
269
|
+
i = nil
|
270
|
+
)
|
271
|
+
if i and !i.empty? # if an argument was provided
|
235
272
|
StatFile.new(i) if Object.const_defined?(:StatFile)
|
236
273
|
else
|
237
274
|
Taxonomy.status?
|
@@ -333,6 +370,42 @@ class Interactive < ::Bioroebe::CommandlineApplication # === Bioroebe::Taxonomy:
|
|
333
370
|
end
|
334
371
|
end
|
335
372
|
|
373
|
+
# ========================================================================= #
|
374
|
+
# === download
|
375
|
+
#
|
376
|
+
# This method can be used to download the ncbi database.
|
377
|
+
# ========================================================================= #
|
378
|
+
def download(i = f?)
|
379
|
+
i = i.to_s
|
380
|
+
case i # case tag
|
381
|
+
# ======================================================================= #
|
382
|
+
# === --help
|
383
|
+
# ======================================================================= #
|
384
|
+
when 'HELP','?','--help'
|
385
|
+
e 'Currently we can download only the NCBI database.'
|
386
|
+
e
|
387
|
+
e 'To do so, do:'
|
388
|
+
e ' download ncbi'
|
389
|
+
# ======================================================================= #
|
390
|
+
# === download --ncbi
|
391
|
+
# ======================================================================= #
|
392
|
+
when /^-?-?ncbi/i,
|
393
|
+
'database','1','' # '' is also a default here.
|
394
|
+
download_ncbi_database
|
395
|
+
if be_verbose?
|
396
|
+
e
|
397
|
+
e 'If all went well then you could now try to update the '+
|
398
|
+
'database, by issuing:'
|
399
|
+
e
|
400
|
+
efancy ' update databases'
|
401
|
+
e
|
402
|
+
end
|
403
|
+
else
|
404
|
+
e 'In the method download(), we do not know the given '+
|
405
|
+
'input `'+simp(i.to_s)+'`.'
|
406
|
+
end
|
407
|
+
end
|
408
|
+
|
336
409
|
# ========================================================================= #
|
337
410
|
# === report_lineage_ids_and_lineage_scientific_name
|
338
411
|
# ========================================================================= #
|
@@ -378,24 +451,34 @@ class Interactive < ::Bioroebe::CommandlineApplication # === Bioroebe::Taxonomy:
|
|
378
451
|
# the localomes entry.
|
379
452
|
# ========================================================================= #
|
380
453
|
def lupdate(i = :ncbi)
|
381
|
-
i = i.to_s
|
454
|
+
i = i.to_s # Use a String past this point.
|
382
455
|
case i
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
456
|
+
# ======================================================================= #
|
457
|
+
# === localomes
|
458
|
+
# ======================================================================= #
|
459
|
+
when 'localomes',
|
460
|
+
'local','loc','localome','2',
|
461
|
+
'fasta',
|
462
|
+
'database',
|
463
|
+
'databases'
|
464
|
+
update_local_localomes # This will overwrite the old dataset completely, be careful.
|
387
465
|
# ======================================================================= #
|
388
466
|
# === ncbi_database
|
389
467
|
# ======================================================================= #
|
390
|
-
when /^ncbi(-|_| )?database$/,
|
468
|
+
when /^ncbi(-|_| )?database$/,
|
469
|
+
'ncbi',
|
470
|
+
'1',
|
391
471
|
'update_ncbi'
|
392
472
|
update_ncbi_database
|
393
473
|
# ======================================================================= #
|
394
|
-
# ===
|
474
|
+
# === lupdate all
|
395
475
|
# ======================================================================= #
|
396
|
-
when '
|
397
|
-
'
|
398
|
-
|
476
|
+
when 'all',
|
477
|
+
'everything',
|
478
|
+
'both'
|
479
|
+
update_ncbi_database
|
480
|
+
update_local_localomes
|
481
|
+
update_lineage
|
399
482
|
# ======================================================================= #
|
400
483
|
# === lineage
|
401
484
|
# ======================================================================= #
|
@@ -478,8 +561,9 @@ class Interactive < ::Bioroebe::CommandlineApplication # === Bioroebe::Taxonomy:
|
|
478
561
|
# ========================================================================= #
|
479
562
|
# === update_ncbi_database
|
480
563
|
#
|
481
|
-
#
|
482
|
-
#
|
564
|
+
# This method can be used to update the NCBI Taxonomy database.
|
565
|
+
#
|
566
|
+
# This includes a download, extracting it, generating the .sql files,
|
483
567
|
# and then populating the postgresql database.
|
484
568
|
# ========================================================================= #
|
485
569
|
def update_ncbi_database
|
@@ -673,7 +757,9 @@ class Interactive < ::Bioroebe::CommandlineApplication # === Bioroebe::Taxonomy:
|
|
673
757
|
def show_login_information
|
674
758
|
e 'The login information is stored in the file '
|
675
759
|
e
|
676
|
-
e ' '+sfile(
|
760
|
+
e ' '+sfile(
|
761
|
+
Bioroebe::Taxonomy.project_base_dir?+'databases/postgresql_login_command.rb'
|
762
|
+
)
|
677
763
|
e
|
678
764
|
show_port # Show the port as well here.
|
679
765
|
end
|
@@ -682,7 +768,7 @@ class Interactive < ::Bioroebe::CommandlineApplication # === Bioroebe::Taxonomy:
|
|
682
768
|
# === return_shared_code
|
683
769
|
# ========================================================================= #
|
684
770
|
def return_shared_code
|
685
|
-
return
|
771
|
+
return Bioroebe::Taxonomy.project_base_dir?+'shared/shared'
|
686
772
|
end
|
687
773
|
|
688
774
|
# ========================================================================= #
|
@@ -698,7 +784,7 @@ class Interactive < ::Bioroebe::CommandlineApplication # === Bioroebe::Taxonomy:
|
|
698
784
|
# === return_login_file
|
699
785
|
# ========================================================================= #
|
700
786
|
def return_login_file
|
701
|
-
return
|
787
|
+
return Bioroebe::Taxonomy.project_base_dir?+'postgresql_login_command.rb'
|
702
788
|
end
|
703
789
|
|
704
790
|
# ========================================================================= #
|
@@ -974,18 +1060,21 @@ class Interactive < ::Bioroebe::CommandlineApplication # === Bioroebe::Taxonomy:
|
|
974
1060
|
return result
|
975
1061
|
end; alias get_lineage_ids_and_lineage_scientific_name obtain_full_lineage_for
|
976
1062
|
|
1063
|
+
require 'bioroebe/constants/database_constants.rb'
|
977
1064
|
# ========================================================================= #
|
978
1065
|
# === drop_table (drop tag)
|
979
1066
|
#
|
980
1067
|
# Use this method when you wish to drop a table.
|
981
1068
|
# ========================================================================= #
|
982
|
-
def drop_table(
|
1069
|
+
def drop_table(
|
1070
|
+
i = Bioroebe::Postgresql::DROP_FASTA_TABLE
|
1071
|
+
)
|
983
1072
|
case i.to_s
|
984
1073
|
when 'nodes'
|
985
1074
|
when 'fasta',
|
986
1075
|
'localomes',
|
987
1076
|
'localome'
|
988
|
-
i = DROP_FASTA_TABLE
|
1077
|
+
i = Bioroebe::Postgresql::DROP_FASTA_TABLE
|
989
1078
|
end
|
990
1079
|
::Bioroebe.run_sql_query(i)
|
991
1080
|
end
|
@@ -1645,24 +1734,6 @@ class Interactive < ::Bioroebe::CommandlineApplication # === Bioroebe::Taxonomy:
|
|
1645
1734
|
end
|
1646
1735
|
end
|
1647
1736
|
|
1648
|
-
# ========================================================================= #
|
1649
|
-
# === create_fasta_table
|
1650
|
-
#
|
1651
|
-
# This method generates the fasta table into either postgresql or
|
1652
|
-
# whatever else you stored things into.
|
1653
|
-
# ========================================================================= #
|
1654
|
-
def create_fasta_table
|
1655
|
-
remove(FASTA_SQL)
|
1656
|
-
# e 'Now storing into fasta.sql (Fasta-Format).'
|
1657
|
-
create_and_save_table('fasta', true) # true for verbose
|
1658
|
-
cat FASTA_SQL # Also display it, after creation.
|
1659
|
-
# Next, drop the old Fasta table. But we must set the password before.
|
1660
|
-
e 'Trying to drop the fasta table next.'
|
1661
|
-
drop_table :fasta
|
1662
|
-
# And now, read in the new one.
|
1663
|
-
read_sql :fasta
|
1664
|
-
end
|
1665
|
-
|
1666
1737
|
# ========================================================================= #
|
1667
1738
|
# === set_commandline_arguments
|
1668
1739
|
# ========================================================================= #
|
@@ -1846,41 +1917,6 @@ class Interactive < ::Bioroebe::CommandlineApplication # === Bioroebe::Taxonomy:
|
|
1846
1917
|
end
|
1847
1918
|
end
|
1848
1919
|
|
1849
|
-
# ========================================================================= #
|
1850
|
-
# === download
|
1851
|
-
#
|
1852
|
-
# This method can be used to download the ncbi database.
|
1853
|
-
# ========================================================================= #
|
1854
|
-
def download(i = f?)
|
1855
|
-
i = i.to_s
|
1856
|
-
case i # case tag
|
1857
|
-
# ======================================================================= #
|
1858
|
-
# === --help
|
1859
|
-
# ======================================================================= #
|
1860
|
-
when 'HELP','?','--help'
|
1861
|
-
e 'Currently we can download only the NCBI database.'
|
1862
|
-
e
|
1863
|
-
e 'To do so, do:'
|
1864
|
-
e ' download ncbi'
|
1865
|
-
# ======================================================================= #
|
1866
|
-
# === --ncbi
|
1867
|
-
# ======================================================================= #
|
1868
|
-
when 'ncbi','--ncbi','database','1','' # '' is also a default here.
|
1869
|
-
download_ncbi_database
|
1870
|
-
if be_verbose?
|
1871
|
-
e
|
1872
|
-
e 'If all went well then you could now try to update the '+
|
1873
|
-
'database, by issuing:'
|
1874
|
-
e
|
1875
|
-
efancy ' update databases'
|
1876
|
-
e
|
1877
|
-
end
|
1878
|
-
else
|
1879
|
-
e 'In the method download(), we do not know the given '+
|
1880
|
-
'input `'+simp(i.to_s)+'`.'
|
1881
|
-
end
|
1882
|
-
end
|
1883
|
-
|
1884
1920
|
# ========================================================================= #
|
1885
1921
|
# === download_ncbi_database
|
1886
1922
|
# ========================================================================= #
|
@@ -44,6 +44,28 @@ class Interactive < ::Bioroebe::CommandlineApplication
|
|
44
44
|
record_last_command(i, first_argument?) # Record the last command.
|
45
45
|
case i # (case tag)
|
46
46
|
# ======================================================================= #
|
47
|
+
# === update
|
48
|
+
# ======================================================================= #
|
49
|
+
when 'update',
|
50
|
+
'lupdate',
|
51
|
+
'upd'
|
52
|
+
lupdate(f)
|
53
|
+
# ======================================================================= #
|
54
|
+
# === download
|
55
|
+
# ======================================================================= #
|
56
|
+
when 'download'
|
57
|
+
download(f)
|
58
|
+
# ======================================================================= #
|
59
|
+
# === status?
|
60
|
+
# ======================================================================= #
|
61
|
+
when 'status?',
|
62
|
+
'status',
|
63
|
+
'stat',
|
64
|
+
'stats',
|
65
|
+
'data?',
|
66
|
+
'try_to_display_the_status'
|
67
|
+
try_to_display_the_status(f)
|
68
|
+
# ======================================================================= #
|
47
69
|
# === disable_colours
|
48
70
|
# ======================================================================= #
|
49
71
|
when 'disable_colours',
|
@@ -65,11 +87,6 @@ class Interactive < ::Bioroebe::CommandlineApplication
|
|
65
87
|
when /^download(_|-)?database$/i,'ncbi_down'
|
66
88
|
download_ncbi_database
|
67
89
|
# ======================================================================= #
|
68
|
-
# === download
|
69
|
-
# ======================================================================= #
|
70
|
-
when 'download'
|
71
|
-
download(f)
|
72
|
-
# ======================================================================= #
|
73
90
|
# === exit
|
74
91
|
# ======================================================================= #
|
75
92
|
when *VALID_WAYS_TO_EXIT
|
@@ -448,11 +465,6 @@ class Interactive < ::Bioroebe::CommandlineApplication
|
|
448
465
|
# ======================================================================= #
|
449
466
|
# ===
|
450
467
|
# ======================================================================= #
|
451
|
-
when 'update','lupdate','upd'
|
452
|
-
lupdate(f)
|
453
|
-
# ======================================================================= #
|
454
|
-
# ===
|
455
|
-
# ======================================================================= #
|
456
468
|
when 'be'
|
457
469
|
be(f)
|
458
470
|
# ======================================================================= #
|
@@ -589,12 +601,6 @@ class Interactive < ::Bioroebe::CommandlineApplication
|
|
589
601
|
# ======================================================================= #
|
590
602
|
# ===
|
591
603
|
# ======================================================================= #
|
592
|
-
when 'status?','status','stat','stats','data?',
|
593
|
-
'try_to_display_the_status'
|
594
|
-
try_to_display_the_status(f)
|
595
|
-
# ======================================================================= #
|
596
|
-
# ===
|
597
|
-
# ======================================================================= #
|
598
604
|
when 'remove','remove_taxid_from_localome_table',
|
599
605
|
'remove_id'
|
600
606
|
remove_taxid_from_localome_table(f)
|
@@ -647,7 +653,9 @@ class Interactive < ::Bioroebe::CommandlineApplication
|
|
647
653
|
# ======================================================================= #
|
648
654
|
when 'lafo','loadup_localomes','loaduplocalomes','goloc',
|
649
655
|
'localomes_go','localomesgo','golocal','goloco',
|
650
|
-
'localgo',
|
656
|
+
'localgo',
|
657
|
+
'update_local_localomes',
|
658
|
+
'update2',
|
651
659
|
'default'
|
652
660
|
update_local_localomes
|
653
661
|
# ======================================================================= #
|
@@ -796,7 +804,8 @@ class Interactive < ::Bioroebe::CommandlineApplication
|
|
796
804
|
# === update_database
|
797
805
|
# ======================================================================= #
|
798
806
|
when 'update_database','ud','updatedatabases','update_databases',
|
799
|
-
'update_ncbi_database',
|
807
|
+
'update_ncbi_database',
|
808
|
+
'updatencbidatabase','update_ncbi',
|
800
809
|
'main' # This is the main action (main tag).
|
801
810
|
update_ncbi_database
|
802
811
|
# ======================================================================= #
|
@@ -111,7 +111,9 @@ class ParseFasta < ::Bioroebe::CommandlineApplication # === Bioroebe::Taxonomy::
|
|
111
111
|
# ========================================================================= #
|
112
112
|
# === try_to_locate_info_file
|
113
113
|
# ========================================================================= #
|
114
|
-
def try_to_locate_info_file(
|
114
|
+
def try_to_locate_info_file(
|
115
|
+
i = @location
|
116
|
+
)
|
115
117
|
i = File.basename(i)
|
116
118
|
# chop away the extname.
|
117
119
|
i.gsub!(/#{File.extname(i)}/, '')
|
@@ -16,6 +16,7 @@
|
|
16
16
|
# include this module here.
|
17
17
|
# =========================================================================== #
|
18
18
|
# require 'bioroebe/taxonomy/shared/shared.rb'
|
19
|
+
# =========================================================================== #
|
19
20
|
require 'bioroebe/base/commandline_application/commandline_application.rb'
|
20
21
|
|
21
22
|
module Bioroebe # === Bioroebe::Taxonomy::Shared
|
@@ -16,6 +16,7 @@ module Taxonomy
|
|
16
16
|
require 'bioroebe/taxonomy/class_methods.rb'
|
17
17
|
require 'bioroebe/taxonomy/chart.rb'
|
18
18
|
require 'bioroebe/taxonomy/node.rb'
|
19
|
+
require 'bioroebe/constants/misc.rb'
|
19
20
|
|
20
21
|
require 'bioroebe/toplevel_methods/databases.rb'
|
21
22
|
require 'bioroebe/toplevel_methods/file_and_directory_related_actions.rb'
|
@@ -129,29 +129,6 @@ module Bioroebe
|
|
129
129
|
return _
|
130
130
|
end
|
131
131
|
|
132
|
-
# ========================================================================= #
|
133
|
-
# === Bioroebe.remove_invalid_aminoacids
|
134
|
-
#
|
135
|
-
# This method will filter away invalid aminoacids such as "U".
|
136
|
-
# "U" is not a valid aminoacid.
|
137
|
-
#
|
138
|
-
# Usage example:
|
139
|
-
#
|
140
|
-
# Bioroebe.remove_invalid_aminoacids('LKLSUSURZZZ')
|
141
|
-
#
|
142
|
-
# ========================================================================= #
|
143
|
-
def self.remove_invalid_aminoacids(from_this_string)
|
144
|
-
if from_this_string.is_a? Array
|
145
|
-
from_this_string = from_this_string.first
|
146
|
-
end
|
147
|
-
all_valid_aminoacids = YAML.load_file(Bioroebe.file_amino_acids).keys
|
148
|
-
new_result = ''.dup
|
149
|
-
from_this_string.chars.each {|entry|
|
150
|
-
new_result << entry if all_valid_aminoacids.include?(entry)
|
151
|
-
}
|
152
|
-
return new_result
|
153
|
-
end
|
154
|
-
|
155
132
|
# ========================================================================= #
|
156
133
|
# === Bioroebe.colourize_aa
|
157
134
|
#
|
@@ -664,6 +641,36 @@ module Bioroebe
|
|
664
641
|
end
|
665
642
|
end
|
666
643
|
|
644
|
+
# ========================================================================= #
|
645
|
+
# === Bioroebe.remove_invalid_aminoacids
|
646
|
+
#
|
647
|
+
# This method will filter away invalid aminoacids such as "U".
|
648
|
+
# "U" is not a valid aminoacid. It requires the data stored
|
649
|
+
# in the yaml file at:
|
650
|
+
#
|
651
|
+
# "/home/Programs/Ruby/3.1.2/lib/ruby/site_ruby/3.1.0/bioroebe/yaml/aminoacids/amino_acids.yml"
|
652
|
+
#
|
653
|
+
# Note that U is a valid aminoacid - it is selenocysteine.
|
654
|
+
#
|
655
|
+
# Usage example:
|
656
|
+
#
|
657
|
+
# Bioroebe.remove_invalid_aminoacids('LKLSUSURZZZ')
|
658
|
+
#
|
659
|
+
# ========================================================================= #
|
660
|
+
def self.remove_invalid_aminoacids(
|
661
|
+
from_this_string
|
662
|
+
)
|
663
|
+
if from_this_string.is_a? Array
|
664
|
+
from_this_string = from_this_string.first
|
665
|
+
end
|
666
|
+
all_valid_aminoacids = YAML.load_file(Bioroebe.file_amino_acids).keys
|
667
|
+
new_result = ''.dup
|
668
|
+
from_this_string.chars.each {|entry|
|
669
|
+
new_result << entry if all_valid_aminoacids.include?(entry)
|
670
|
+
}
|
671
|
+
return new_result
|
672
|
+
end
|
673
|
+
|
667
674
|
end
|
668
675
|
|
669
676
|
if __FILE__ == $PROGRAM_NAME
|
@@ -682,7 +689,7 @@ if __FILE__ == $PROGRAM_NAME
|
|
682
689
|
input = ARGV.join(' ').strip
|
683
690
|
end
|
684
691
|
|
685
|
-
|
692
|
+
e 'From '+input+' to: '+Bioroebe.three_to_one(input) # => "TRH"
|
686
693
|
# And more tests:
|
687
694
|
# p Bioroebe.is_aminoacid? 'Tryptophan' # => true
|
688
695
|
# p Bioroebe.is_aminoacid? 'Glycine' # => true
|