bioroebe 0.10.80 → 0.11.25
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of bioroebe might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/README.md +3117 -2645
- data/bioroebe.gemspec +3 -3
- data/doc/README.gen +3116 -2644
- data/doc/todo/bioroebe_todo.md +418 -387
- 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 +13 -11
- data/lib/bioroebe/base/commandline_application/misc.rb +18 -8
- data/lib/bioroebe/base/misc.rb +16 -0
- data/lib/bioroebe/base/prototype/misc.rb +1 -1
- data/lib/bioroebe/codons/show_codon_tables.rb +6 -2
- data/lib/bioroebe/codons/show_codon_usage.rb +2 -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 +24 -4
- data/lib/bioroebe/constants/misc.rb +20 -0
- 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/{shell/tk.rb → electron_microscopy/electron_microscopy_module.rb} +15 -10
- data/lib/bioroebe/electron_microscopy/simple_star_file_generator.rb +4 -9
- data/lib/bioroebe/fasta_and_fastq/show_fasta_headers.rb +27 -12
- data/lib/bioroebe/genome/README.md +4 -0
- data/lib/bioroebe/genome/genome.rb +67 -0
- data/lib/bioroebe/gui/gtk +1 -0
- 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/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/shared_code/protein_to_DNA/protein_to_DNA_module.rb +14 -14
- data/lib/bioroebe/misc/ruler.rb +1 -0
- data/lib/bioroebe/parsers/genbank_parser.rb +353 -24
- data/lib/bioroebe/parsers/gff.rb +1 -9
- data/lib/bioroebe/pdb/parse_pdb_file.rb +1 -9
- 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/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/three_delimiter.py +34 -0
- data/lib/bioroebe/python/toplevel_methods/time_and_date.py +43 -0
- data/lib/bioroebe/python/toplevel_methods/to_camelcase.py +11 -0
- data/lib/bioroebe/requires/require_the_bioroebe_project.rb +3 -1
- 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 +61 -2
- data/lib/bioroebe/shell/menu.rb +3752 -3667
- data/lib/bioroebe/shell/misc.rb +51 -4311
- data/lib/bioroebe/shell/readline/readline.rb +1 -1
- data/lib/bioroebe/shell/shell.rb +11199 -28
- data/lib/bioroebe/siRNA/siRNA.rb +81 -1
- data/lib/bioroebe/string_matching/find_longest_substring.rb +3 -2
- 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/info/check_available.rb +15 -9
- data/lib/bioroebe/taxonomy/info/info.rb +17 -2
- data/lib/bioroebe/taxonomy/info/is_dna.rb +46 -36
- data/lib/bioroebe/taxonomy/interactive.rb +139 -95
- 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/databases.rb +1 -1
- data/lib/bioroebe/toplevel_methods/fasta_and_fastq.rb +101 -63
- data/lib/bioroebe/toplevel_methods/misc.rb +17 -16
- data/lib/bioroebe/toplevel_methods/nucleotides.rb +22 -5
- 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/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/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 +101 -52
- 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/genomes/README.md +3 -4
- data/lib/bioroebe/yaml/restriction_enzymes/restriction_enzymes.yml +3 -3
- metadata +33 -35
- data/doc/setup.rb +0 -1655
- data/lib/bioroebe/genbank/genbank_parser.rb +0 -291
- 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/user_input.rb +0 -88
- data/lib/bioroebe/shell/xorg.rb +0 -45
@@ -59,6 +59,9 @@ class Interactive < ::Bioroebe::CommandlineApplication # === Bioroebe::Taxonomy:
|
|
59
59
|
|
60
60
|
# ========================================================================= #
|
61
61
|
# === FASTA_SQL
|
62
|
+
#
|
63
|
+
# This constant will point towards a location such as
|
64
|
+
# "/home/Temp/bioroebe/autogenerated_sql_files/fasta.sql".
|
62
65
|
# ========================================================================= #
|
63
66
|
FASTA_SQL = AUTOGENERATED_SQL_FILES_DIR+'fasta.sql'
|
64
67
|
|
@@ -124,6 +127,69 @@ class Interactive < ::Bioroebe::CommandlineApplication # === Bioroebe::Taxonomy:
|
|
124
127
|
@run_standalone = true
|
125
128
|
end
|
126
129
|
|
130
|
+
# ========================================================================= #
|
131
|
+
# === create_fasta_table
|
132
|
+
#
|
133
|
+
# This method generates the fasta table into either postgresql or
|
134
|
+
# whatever else you stored things into.
|
135
|
+
# ========================================================================= #
|
136
|
+
def create_fasta_table
|
137
|
+
remove(FASTA_SQL)
|
138
|
+
# e 'Now storing into fasta.sql (Fasta-Format).'
|
139
|
+
create_and_save_table(:default_fasta, true) # true for verbose
|
140
|
+
cat FASTA_SQL # Also display it, after creation.
|
141
|
+
# Next, drop the old Fasta table. But we must set the password before.
|
142
|
+
e 'Trying to drop the fasta table next.'
|
143
|
+
drop_table :fasta
|
144
|
+
# And now, read in the new one.
|
145
|
+
read_sql :fasta
|
146
|
+
end
|
147
|
+
|
148
|
+
# ========================================================================= #
|
149
|
+
# === create_and_save_table
|
150
|
+
# ========================================================================= #
|
151
|
+
def create_and_save_table(
|
152
|
+
i, be_verbose = false
|
153
|
+
)
|
154
|
+
case i
|
155
|
+
# ======================================================================= #
|
156
|
+
# === :default_fasta
|
157
|
+
# ======================================================================= #
|
158
|
+
when :default_fasta
|
159
|
+
i = FASTA_SQL
|
160
|
+
end
|
161
|
+
require 'roebe/sql_paradise/commands.rb'
|
162
|
+
Roebe::SqlParadise::Commands.create_and_save_table(i, be_verbose)
|
163
|
+
end
|
164
|
+
|
165
|
+
# ========================================================================= #
|
166
|
+
# === update_local_localomes
|
167
|
+
#
|
168
|
+
# Update the local collection. This will overwrite the old dataset
|
169
|
+
# completely, so be careful when using this.
|
170
|
+
#
|
171
|
+
# To invoke this method via the interactive menu, do:
|
172
|
+
#
|
173
|
+
# update databases
|
174
|
+
#
|
175
|
+
# ========================================================================= #
|
176
|
+
def update_local_localomes
|
177
|
+
show_current_time
|
178
|
+
create_fasta_table # Get in a new, fresh table.
|
179
|
+
_ = get_all_info_entries_with_tax_id
|
180
|
+
show_current_time
|
181
|
+
_.each {|entry|
|
182
|
+
e "Next working on `#{sfile(entry)}`."
|
183
|
+
create_sql_file_from_local_fasta_entry(entry)
|
184
|
+
}
|
185
|
+
report_how_many_info_files_exist_and_how_many_lack_taxonomy_id
|
186
|
+
old_time = @time
|
187
|
+
show_time_now # Show the end time.
|
188
|
+
new_time = @time
|
189
|
+
difference = Time.parse(new_time) - Time.parse(old_time)
|
190
|
+
report_how_long_it_took_us(difference, 'localome table')
|
191
|
+
end
|
192
|
+
|
127
193
|
# ========================================================================= #
|
128
194
|
# === get (get tag)
|
129
195
|
#
|
@@ -204,34 +270,13 @@ class Interactive < ::Bioroebe::CommandlineApplication # === Bioroebe::Taxonomy:
|
|
204
270
|
end
|
205
271
|
end
|
206
272
|
|
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
273
|
# ========================================================================= #
|
231
274
|
# === try_to_display_the_status
|
232
275
|
# ========================================================================= #
|
233
|
-
def try_to_display_the_status(
|
234
|
-
|
276
|
+
def try_to_display_the_status(
|
277
|
+
i = nil
|
278
|
+
)
|
279
|
+
if i and !i.empty? # if an argument was provided
|
235
280
|
StatFile.new(i) if Object.const_defined?(:StatFile)
|
236
281
|
else
|
237
282
|
Taxonomy.status?
|
@@ -333,6 +378,42 @@ class Interactive < ::Bioroebe::CommandlineApplication # === Bioroebe::Taxonomy:
|
|
333
378
|
end
|
334
379
|
end
|
335
380
|
|
381
|
+
# ========================================================================= #
|
382
|
+
# === download
|
383
|
+
#
|
384
|
+
# This method can be used to download the ncbi database.
|
385
|
+
# ========================================================================= #
|
386
|
+
def download(i = f?)
|
387
|
+
i = i.to_s
|
388
|
+
case i # case tag
|
389
|
+
# ======================================================================= #
|
390
|
+
# === --help
|
391
|
+
# ======================================================================= #
|
392
|
+
when 'HELP','?','--help'
|
393
|
+
e 'Currently we can download only the NCBI database.'
|
394
|
+
e
|
395
|
+
e 'To do so, do:'
|
396
|
+
e ' download ncbi'
|
397
|
+
# ======================================================================= #
|
398
|
+
# === download --ncbi
|
399
|
+
# ======================================================================= #
|
400
|
+
when /^-?-?ncbi/i,
|
401
|
+
'database','1','' # '' is also a default here.
|
402
|
+
download_ncbi_database
|
403
|
+
if be_verbose?
|
404
|
+
e
|
405
|
+
e 'If all went well then you could now try to update the '+
|
406
|
+
'database, by issuing:'
|
407
|
+
e
|
408
|
+
efancy ' update databases'
|
409
|
+
e
|
410
|
+
end
|
411
|
+
else
|
412
|
+
e 'In the method download(), we do not know the given '+
|
413
|
+
'input `'+simp(i.to_s)+'`.'
|
414
|
+
end
|
415
|
+
end
|
416
|
+
|
336
417
|
# ========================================================================= #
|
337
418
|
# === report_lineage_ids_and_lineage_scientific_name
|
338
419
|
# ========================================================================= #
|
@@ -378,24 +459,34 @@ class Interactive < ::Bioroebe::CommandlineApplication # === Bioroebe::Taxonomy:
|
|
378
459
|
# the localomes entry.
|
379
460
|
# ========================================================================= #
|
380
461
|
def lupdate(i = :ncbi)
|
381
|
-
i = i.to_s
|
462
|
+
i = i.to_s # Use a String past this point.
|
382
463
|
case i
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
464
|
+
# ======================================================================= #
|
465
|
+
# === localomes
|
466
|
+
# ======================================================================= #
|
467
|
+
when 'localomes',
|
468
|
+
'local','loc','localome','2',
|
469
|
+
'fasta',
|
470
|
+
'database',
|
471
|
+
'databases'
|
472
|
+
update_local_localomes # This will overwrite the old dataset completely, be careful.
|
387
473
|
# ======================================================================= #
|
388
474
|
# === ncbi_database
|
389
475
|
# ======================================================================= #
|
390
|
-
when /^ncbi(-|_| )?database$/,
|
476
|
+
when /^ncbi(-|_| )?database$/,
|
477
|
+
'ncbi',
|
478
|
+
'1',
|
391
479
|
'update_ncbi'
|
392
480
|
update_ncbi_database
|
393
481
|
# ======================================================================= #
|
394
|
-
# ===
|
482
|
+
# === lupdate all
|
395
483
|
# ======================================================================= #
|
396
|
-
when '
|
397
|
-
'
|
398
|
-
|
484
|
+
when 'all',
|
485
|
+
'everything',
|
486
|
+
'both'
|
487
|
+
update_ncbi_database
|
488
|
+
update_local_localomes
|
489
|
+
update_lineage
|
399
490
|
# ======================================================================= #
|
400
491
|
# === lineage
|
401
492
|
# ======================================================================= #
|
@@ -478,8 +569,9 @@ class Interactive < ::Bioroebe::CommandlineApplication # === Bioroebe::Taxonomy:
|
|
478
569
|
# ========================================================================= #
|
479
570
|
# === update_ncbi_database
|
480
571
|
#
|
481
|
-
#
|
482
|
-
#
|
572
|
+
# This method can be used to update the NCBI Taxonomy database.
|
573
|
+
#
|
574
|
+
# This includes a download, extracting it, generating the .sql files,
|
483
575
|
# and then populating the postgresql database.
|
484
576
|
# ========================================================================= #
|
485
577
|
def update_ncbi_database
|
@@ -673,7 +765,9 @@ class Interactive < ::Bioroebe::CommandlineApplication # === Bioroebe::Taxonomy:
|
|
673
765
|
def show_login_information
|
674
766
|
e 'The login information is stored in the file '
|
675
767
|
e
|
676
|
-
e ' '+sfile(
|
768
|
+
e ' '+sfile(
|
769
|
+
Bioroebe::Taxonomy.project_base_dir?+'databases/postgresql_login_command.rb'
|
770
|
+
)
|
677
771
|
e
|
678
772
|
show_port # Show the port as well here.
|
679
773
|
end
|
@@ -682,7 +776,7 @@ class Interactive < ::Bioroebe::CommandlineApplication # === Bioroebe::Taxonomy:
|
|
682
776
|
# === return_shared_code
|
683
777
|
# ========================================================================= #
|
684
778
|
def return_shared_code
|
685
|
-
return
|
779
|
+
return Bioroebe::Taxonomy.project_base_dir?+'shared/shared'
|
686
780
|
end
|
687
781
|
|
688
782
|
# ========================================================================= #
|
@@ -698,7 +792,7 @@ class Interactive < ::Bioroebe::CommandlineApplication # === Bioroebe::Taxonomy:
|
|
698
792
|
# === return_login_file
|
699
793
|
# ========================================================================= #
|
700
794
|
def return_login_file
|
701
|
-
return
|
795
|
+
return Bioroebe::Taxonomy.project_base_dir?+'postgresql_login_command.rb'
|
702
796
|
end
|
703
797
|
|
704
798
|
# ========================================================================= #
|
@@ -974,18 +1068,21 @@ class Interactive < ::Bioroebe::CommandlineApplication # === Bioroebe::Taxonomy:
|
|
974
1068
|
return result
|
975
1069
|
end; alias get_lineage_ids_and_lineage_scientific_name obtain_full_lineage_for
|
976
1070
|
|
1071
|
+
require 'bioroebe/constants/database_constants.rb'
|
977
1072
|
# ========================================================================= #
|
978
1073
|
# === drop_table (drop tag)
|
979
1074
|
#
|
980
1075
|
# Use this method when you wish to drop a table.
|
981
1076
|
# ========================================================================= #
|
982
|
-
def drop_table(
|
1077
|
+
def drop_table(
|
1078
|
+
i = Bioroebe::Postgresql::DROP_FASTA_TABLE
|
1079
|
+
)
|
983
1080
|
case i.to_s
|
984
1081
|
when 'nodes'
|
985
1082
|
when 'fasta',
|
986
1083
|
'localomes',
|
987
1084
|
'localome'
|
988
|
-
i = DROP_FASTA_TABLE
|
1085
|
+
i = Bioroebe::Postgresql::DROP_FASTA_TABLE
|
989
1086
|
end
|
990
1087
|
::Bioroebe.run_sql_query(i)
|
991
1088
|
end
|
@@ -1645,24 +1742,6 @@ class Interactive < ::Bioroebe::CommandlineApplication # === Bioroebe::Taxonomy:
|
|
1645
1742
|
end
|
1646
1743
|
end
|
1647
1744
|
|
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
1745
|
# ========================================================================= #
|
1667
1746
|
# === set_commandline_arguments
|
1668
1747
|
# ========================================================================= #
|
@@ -1846,41 +1925,6 @@ class Interactive < ::Bioroebe::CommandlineApplication # === Bioroebe::Taxonomy:
|
|
1846
1925
|
end
|
1847
1926
|
end
|
1848
1927
|
|
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
1928
|
# ========================================================================= #
|
1885
1929
|
# === download_ncbi_database
|
1886
1930
|
# ========================================================================= #
|
@@ -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
|
@@ -15,7 +15,7 @@ module Bioroebe
|
|
15
15
|
# can pass the password for the postgreSQL database.
|
16
16
|
# ========================================================================= #
|
17
17
|
def self.set_pgpassword(
|
18
|
-
new_password = POSTGRE_PASSWORD
|
18
|
+
new_password = Bioroebe::Postgresql::POSTGRE_PASSWORD
|
19
19
|
)
|
20
20
|
ENV['PGPASSWORD'] = new_password
|
21
21
|
end; self.instance_eval { alias set_password set_pgpassword } # === Bioroebe.set_password
|