bioroebe 0.10.80 → 0.11.24

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.

Files changed (129) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1204 -772
  3. data/bioroebe.gemspec +3 -3
  4. data/doc/README.gen +1203 -771
  5. data/doc/todo/bioroebe_todo.md +391 -365
  6. data/lib/bioroebe/aminoacids/aminoacid_substitution.rb +1 -9
  7. data/lib/bioroebe/aminoacids/codon_percentage.rb +1 -9
  8. data/lib/bioroebe/aminoacids/deduce_aminoacid_sequence.rb +1 -9
  9. data/lib/bioroebe/aminoacids/display_aminoacid_table.rb +1 -0
  10. data/lib/bioroebe/aminoacids/show_hydrophobicity.rb +1 -6
  11. data/lib/bioroebe/base/colours_for_base/colours_for_base.rb +18 -8
  12. data/lib/bioroebe/base/commandline_application/commandline_arguments.rb +13 -11
  13. data/lib/bioroebe/base/commandline_application/misc.rb +18 -8
  14. data/lib/bioroebe/base/misc.rb +16 -0
  15. data/lib/bioroebe/base/prototype/misc.rb +1 -1
  16. data/lib/bioroebe/codons/show_codon_tables.rb +6 -2
  17. data/lib/bioroebe/codons/show_codon_usage.rb +2 -1
  18. data/lib/bioroebe/constants/aminoacids_and_proteins.rb +1 -0
  19. data/lib/bioroebe/constants/database_constants.rb +1 -1
  20. data/lib/bioroebe/constants/files_and_directories.rb +20 -1
  21. data/lib/bioroebe/constants/misc.rb +20 -0
  22. data/lib/bioroebe/count/count_amount_of_nucleotides.rb +3 -0
  23. data/lib/bioroebe/crystal/README.md +2 -0
  24. data/lib/bioroebe/crystal/to_rna.cr +19 -0
  25. data/lib/bioroebe/data/README.md +11 -8
  26. data/lib/bioroebe/data/electron_microscopy/pos_example.pos +396 -0
  27. data/lib/bioroebe/data/electron_microscopy/test_particles.star +36 -0
  28. data/lib/bioroebe/{shell/tk.rb → electron_microscopy/electron_microscopy_module.rb} +15 -10
  29. data/lib/bioroebe/electron_microscopy/simple_star_file_generator.rb +4 -9
  30. data/lib/bioroebe/fasta_and_fastq/show_fasta_headers.rb +27 -12
  31. data/lib/bioroebe/genome/README.md +4 -0
  32. data/lib/bioroebe/genome/genome.rb +67 -0
  33. data/lib/bioroebe/gui/gtk3/protein_to_DNA/protein_to_DNA.rb +18 -18
  34. data/lib/bioroebe/gui/gtk3/random_sequence/random_sequence.rb +19 -11
  35. data/lib/bioroebe/gui/shared_code/protein_to_DNA/protein_to_DNA_module.rb +14 -14
  36. data/lib/bioroebe/misc/ruler.rb +1 -0
  37. data/lib/bioroebe/parsers/genbank_parser.rb +353 -24
  38. data/lib/bioroebe/parsers/gff.rb +1 -9
  39. data/lib/bioroebe/pdb/parse_pdb_file.rb +1 -9
  40. data/lib/bioroebe/project/project.rb +1 -1
  41. data/lib/bioroebe/python/README.md +1 -0
  42. data/lib/bioroebe/python/__pycache__/mymodule.cpython-39.pyc +0 -0
  43. data/lib/bioroebe/python/gui/gtk3/all_in_one.css +4 -0
  44. data/lib/bioroebe/python/gui/gtk3/all_in_one.py +59 -0
  45. data/lib/bioroebe/python/gui/gtk3/widget1.py +20 -0
  46. data/lib/bioroebe/python/gui/tkinter/all_in_one.py +91 -0
  47. data/lib/bioroebe/python/mymodule.py +8 -0
  48. data/lib/bioroebe/python/protein_to_dna.py +33 -0
  49. data/lib/bioroebe/python/shell/shell.py +19 -0
  50. data/lib/bioroebe/python/to_rna.py +14 -0
  51. data/lib/bioroebe/python/toplevel_methods/open_in_browser.py +20 -0
  52. data/lib/bioroebe/python/toplevel_methods/palindromes.py +42 -0
  53. data/lib/bioroebe/python/toplevel_methods/rds.py +13 -0
  54. data/lib/bioroebe/python/toplevel_methods/three_delimiter.py +34 -0
  55. data/lib/bioroebe/python/toplevel_methods/time_and_date.py +43 -0
  56. data/lib/bioroebe/python/toplevel_methods/to_camelcase.py +11 -0
  57. data/lib/bioroebe/requires/require_the_bioroebe_project.rb +3 -1
  58. data/lib/bioroebe/sequence/nucleotide_module/nucleotide_module.rb +28 -25
  59. data/lib/bioroebe/sequence/protein.rb +105 -3
  60. data/lib/bioroebe/sequence/sequence.rb +61 -2
  61. data/lib/bioroebe/shell/menu.rb +3451 -3366
  62. data/lib/bioroebe/shell/misc.rb +51 -4311
  63. data/lib/bioroebe/shell/readline/readline.rb +1 -1
  64. data/lib/bioroebe/shell/shell.rb +11192 -28
  65. data/lib/bioroebe/siRNA/siRNA.rb +81 -1
  66. data/lib/bioroebe/string_matching/find_longest_substring.rb +3 -2
  67. data/lib/bioroebe/taxonomy/class_methods.rb +3 -8
  68. data/lib/bioroebe/taxonomy/constants.rb +4 -3
  69. data/lib/bioroebe/taxonomy/edit.rb +2 -1
  70. data/lib/bioroebe/taxonomy/help/help.rb +10 -10
  71. data/lib/bioroebe/taxonomy/info/check_available.rb +15 -9
  72. data/lib/bioroebe/taxonomy/info/info.rb +17 -2
  73. data/lib/bioroebe/taxonomy/info/is_dna.rb +46 -36
  74. data/lib/bioroebe/taxonomy/interactive.rb +139 -95
  75. data/lib/bioroebe/taxonomy/menu.rb +27 -18
  76. data/lib/bioroebe/taxonomy/parse_fasta.rb +3 -1
  77. data/lib/bioroebe/taxonomy/shared.rb +1 -0
  78. data/lib/bioroebe/taxonomy/taxonomy.rb +1 -0
  79. data/lib/bioroebe/toplevel_methods/aminoacids_and_proteins.rb +31 -24
  80. data/lib/bioroebe/toplevel_methods/databases.rb +1 -1
  81. data/lib/bioroebe/toplevel_methods/fasta_and_fastq.rb +101 -63
  82. data/lib/bioroebe/toplevel_methods/misc.rb +17 -16
  83. data/lib/bioroebe/toplevel_methods/nucleotides.rb +22 -5
  84. data/lib/bioroebe/toplevel_methods/open_in_browser.rb +2 -0
  85. data/lib/bioroebe/toplevel_methods/palindromes.rb +1 -2
  86. data/lib/bioroebe/toplevel_methods/taxonomy.rb +2 -2
  87. data/lib/bioroebe/toplevel_methods/to_camelcase.rb +5 -0
  88. data/lib/bioroebe/utility_scripts/align_open_reading_frames.rb +1 -9
  89. data/lib/bioroebe/utility_scripts/check_for_mismatches/check_for_mismatches.rb +1 -9
  90. data/lib/bioroebe/utility_scripts/compacter.rb +1 -9
  91. data/lib/bioroebe/utility_scripts/compseq/compseq.rb +1 -9
  92. data/lib/bioroebe/utility_scripts/create_batch_entrez_file.rb +1 -9
  93. data/lib/bioroebe/utility_scripts/dot_alignment.rb +1 -9
  94. data/lib/bioroebe/utility_scripts/move_file_to_its_correct_location.rb +1 -4
  95. data/lib/bioroebe/utility_scripts/showorf/constants.rb +0 -5
  96. data/lib/bioroebe/utility_scripts/showorf/reset.rb +1 -4
  97. data/lib/bioroebe/version/version.rb +2 -2
  98. data/lib/bioroebe/www/embeddable_interface.rb +101 -52
  99. data/lib/bioroebe/www/sinatra/sinatra.rb +186 -70
  100. data/lib/bioroebe/yaml/aminoacids/amino_acids_long_name_to_one_letter.yml +2 -2
  101. data/lib/bioroebe/yaml/configuration/browser.yml +1 -1
  102. data/lib/bioroebe/yaml/genomes/README.md +3 -4
  103. data/lib/bioroebe/yaml/restriction_enzymes/restriction_enzymes.yml +3 -3
  104. metadata +32 -35
  105. data/doc/setup.rb +0 -1655
  106. data/lib/bioroebe/genbank/genbank_parser.rb +0 -291
  107. data/lib/bioroebe/shell/add.rb +0 -108
  108. data/lib/bioroebe/shell/assign.rb +0 -360
  109. data/lib/bioroebe/shell/chop_and_cut.rb +0 -281
  110. data/lib/bioroebe/shell/constants.rb +0 -166
  111. data/lib/bioroebe/shell/download.rb +0 -335
  112. data/lib/bioroebe/shell/enable_and_disable.rb +0 -158
  113. data/lib/bioroebe/shell/enzymes.rb +0 -310
  114. data/lib/bioroebe/shell/fasta.rb +0 -345
  115. data/lib/bioroebe/shell/gtk.rb +0 -76
  116. data/lib/bioroebe/shell/history.rb +0 -132
  117. data/lib/bioroebe/shell/initialize.rb +0 -217
  118. data/lib/bioroebe/shell/loop.rb +0 -74
  119. data/lib/bioroebe/shell/prompt.rb +0 -107
  120. data/lib/bioroebe/shell/random.rb +0 -289
  121. data/lib/bioroebe/shell/reset.rb +0 -335
  122. data/lib/bioroebe/shell/scan_and_parse.rb +0 -135
  123. data/lib/bioroebe/shell/search.rb +0 -337
  124. data/lib/bioroebe/shell/sequences.rb +0 -200
  125. data/lib/bioroebe/shell/show_report_and_display.rb +0 -2901
  126. data/lib/bioroebe/shell/startup.rb +0 -127
  127. data/lib/bioroebe/shell/taxonomy.rb +0 -14
  128. data/lib/bioroebe/shell/user_input.rb +0 -88
  129. data/lib/bioroebe/shell/xorg.rb +0 -45
@@ -107,7 +107,7 @@ class ProteinToDNA < ::Gtk::Box # === Bioroebe::GUI::Gtk::ProteinToDNA
107
107
  scrolled_window_right.clear_background
108
108
  scrolled_window_right.width_height(300, 300)
109
109
  scrolled_window_right.bblack1
110
- scrolled_window_right.css_class('mar2px')
110
+ scrolled_window_right.mar2px
111
111
  # ======================================================================= #
112
112
  # === scrolled_window_left
113
113
  # ======================================================================= #
@@ -115,7 +115,7 @@ class ProteinToDNA < ::Gtk::Box # === Bioroebe::GUI::Gtk::ProteinToDNA
115
115
  scrolled_window_left.clear_background
116
116
  scrolled_window_left.width_height(300, 300)
117
117
  scrolled_window_left.bblack1
118
- scrolled_window_left.css_class('mar2px')
118
+ scrolled_window_left.mar2px
119
119
  top_hpaned = gtk_hpaned(
120
120
  scrolled_window_left,
121
121
  scrolled_window_right
@@ -126,22 +126,6 @@ class ProteinToDNA < ::Gtk::Box # === Bioroebe::GUI::Gtk::ProteinToDNA
126
126
  @dataset[:top_hbox] = top_hpaned
127
127
  end
128
128
 
129
- # ========================================================================= #
130
- # === connect_skeleton (connect tag)
131
- # ========================================================================= #
132
- def connect_skeleton
133
- abort_on_exception
134
- @main_vbox.maximal(@dataset[:top_hbox], 4)
135
- @main_vbox.maximal(@middle_bar)
136
- button_box = button_box(
137
- @dataset[:backtrack_button],
138
- @dataset[:quit_button]
139
- )
140
- button_box.vertical_layout
141
- @main_vbox.minimal(button_box)
142
- add(@main_vbox)
143
- end
144
-
145
129
  # ========================================================================= #
146
130
  # === create_left_buffer
147
131
  # ========================================================================= #
@@ -161,6 +145,22 @@ class ProteinToDNA < ::Gtk::Box # === Bioroebe::GUI::Gtk::ProteinToDNA
161
145
  super()
162
146
  end
163
147
 
148
+ # ========================================================================= #
149
+ # === connect_skeleton (connect tag)
150
+ # ========================================================================= #
151
+ def connect_skeleton
152
+ abort_on_exception
153
+ @main_vbox.maximal(@dataset[:top_hbox], 4)
154
+ @main_vbox.maximal(@middle_bar)
155
+ button_box = button_box(
156
+ @dataset[:backtrack_button],
157
+ @dataset[:quit_button]
158
+ )
159
+ button_box.vertical_layout
160
+ @main_vbox.minimal(button_box)
161
+ add(@main_vbox)
162
+ end
163
+
164
164
  # ========================================================================= #
165
165
  # === Bioroebe::GUI::Gtk::ProteinToDNA.run
166
166
  # ========================================================================= #
@@ -43,12 +43,12 @@ class RandomSequence < ::Gtk::Box # === Bioroebe::GUI::Gtk::RandomSequence
43
43
  # ========================================================================= #
44
44
  # === WIDTH
45
45
  # ========================================================================= #
46
- WIDTH = 900
46
+ WIDTH = '45% or minimum 1200px'
47
47
 
48
48
  # ========================================================================= #
49
49
  # === HEIGHT
50
50
  # ========================================================================= #
51
- HEIGHT = 720
51
+ HEIGHT = '45% or minimum 980px'
52
52
 
53
53
  # ========================================================================= #
54
54
  # === USE_THIS_HEADER
@@ -478,8 +478,20 @@ class RandomSequence < ::Gtk::Box # === Bioroebe::GUI::Gtk::RandomSequence
478
478
  create_the_entries
479
479
  end
480
480
 
481
+ # ========================================================================= #
482
+ # === handle_CSS
483
+ # ========================================================================= #
484
+ def handle_CSS
485
+ use_gtk_paradise_project_css_file
486
+ use_project_css_file
487
+ apply_the_CSS
488
+ end
489
+
481
490
  # ========================================================================= #
482
491
  # === do_generate_a_random_sequence
492
+ #
493
+ # This is the method that will be run whenever a new random aminoacid
494
+ # sequence is to be generated.
483
495
  # ========================================================================= #
484
496
  def do_generate_a_random_sequence(
485
497
  n_aminoacids = :default
@@ -521,18 +533,14 @@ class RandomSequence < ::Gtk::Box # === Bioroebe::GUI::Gtk::RandomSequence
521
533
  # list-store.
522
534
  # ======================================================================= #
523
535
  array = array1.zip(array2) # Zip it up with 0-values here.
536
+ # ======================================================================= #
537
+ # Next, populate the liststore with the new data - since as of July
538
+ # 2022 we will sort it based on most aminoacids though:
539
+ # ======================================================================= #
540
+ array = array.sort_by {|a, b| b }.reverse # This sorts by highest first.
524
541
  ::Gtk.populate_this_liststore(@list_store, array)
525
542
  end
526
543
 
527
- # ========================================================================= #
528
- # === handle_CSS
529
- # ========================================================================= #
530
- def handle_CSS
531
- use_gtk_paradise_project_css_file
532
- use_project_css_file
533
- apply_the_CSS
534
- end
535
-
536
544
  # ========================================================================= #
537
545
  # === run
538
546
  # ========================================================================= #
@@ -143,13 +143,6 @@ module ProteinToDNAModule # === Bioroebe::GUI::ProteinToDNAModule
143
143
  end
144
144
  end
145
145
 
146
- # ========================================================================= #
147
- # === left_buffer?
148
- # ========================================================================= #
149
- def left_buffer?
150
- @dataset[:left_buffer]
151
- end; alias left? left_buffer? # === left?
152
-
153
146
  # ========================================================================= #
154
147
  # === right_buffer?
155
148
  # ========================================================================= #
@@ -164,6 +157,20 @@ module ProteinToDNAModule # === Bioroebe::GUI::ProteinToDNAModule
164
157
  @dataset[:left_buffer].set_text(i.to_s)
165
158
  end
166
159
 
160
+ # ========================================================================= #
161
+ # === aminoacid_sequence?
162
+ # ========================================================================= #
163
+ def aminoacid_sequence?
164
+ left_buffer?.to_s
165
+ end
166
+
167
+ # ========================================================================= #
168
+ # === left_buffer?
169
+ # ========================================================================= #
170
+ def left_buffer?
171
+ @dataset[:left_buffer]
172
+ end; alias left? left_buffer? # === left?
173
+
167
174
  # ========================================================================= #
168
175
  # === do_determine_the_backtrack_sequence (click tag)
169
176
  #
@@ -182,11 +189,4 @@ module ProteinToDNAModule # === Bioroebe::GUI::ProteinToDNAModule
182
189
  right_buffer?.set_text(text_for_right_hand_side)
183
190
  end; alias do_determine_the_DNA_sequence do_determine_the_backtrack_sequence # === do_determine_the_DNA_sequence
184
191
 
185
- # ========================================================================= #
186
- # === aminoacid_sequence?
187
- # ========================================================================= #
188
- def aminoacid_sequence?
189
- left_buffer?.to_s
190
- end
191
-
192
192
  end; end; end
@@ -24,6 +24,7 @@
24
24
  # variant - that one should work fine.
25
25
  # =========================================================================== #
26
26
  # require 'bioroebe/misc/ruler.rb'
27
+ # Bioroebe.ruler_return_as_string_without_colours 'ATGCTGACAGGGGGGGEEEEEE'
27
28
  # Bioroebe::Ruler.new(ARGV)
28
29
  # =========================================================================== #
29
30
  require 'bioroebe/base/commandline_application/commandline_application.rb'
@@ -4,10 +4,29 @@
4
4
  # =========================================================================== #
5
5
  # === Bioroebe::GenbankParser
6
6
  #
7
- # This class can be used to parse genbank-files. Their file extension is
8
- # typically ".gbk".
7
+ # This class can be used to parse genbank-files (typically stored as .genbank
8
+ # or .gbk, so their file extension is usually ".gbk").
9
+ #
10
+ # Since as of the rewrite in July 2022 the class can also handle multiple
11
+ # fasta entries now.
12
+ #
13
+ # The class is similar to class FastaParser, but instead it will only
14
+ # select the content between "ORIGIN" and "VERSION" entries.
15
+ #
16
+ # The user can pass the content of a genbank-file to this class, and it
17
+ # can then report the nucleotide sequence, e. g. the part starting after
18
+ # the ORIGIN string.
19
+ #
20
+ # The reason why this class has been created was because it is sometimes
21
+ # necessary to parse a genebank file.
22
+ #
23
+ # Usage example:
24
+ #
25
+ # Bioroebe::GenbankParser.new(ARGV)
26
+ #
9
27
  # =========================================================================== #
10
- # require 'bioroebe/parsers/genbank_parser.rb'
28
+ # require 'bioroebe/genbank/genbank_parser.rb'
29
+ # genbank_parser = Bioroebe::GenbankParser.new(ARGV)
11
30
  # =========================================================================== #
12
31
  require 'bioroebe/base/commandline_application/commandline_application.rb'
13
32
 
@@ -20,59 +39,369 @@ class GenbankParser < ::Bioroebe::CommandlineApplication # === Bioroebe::Genbank
20
39
  # ========================================================================= #
21
40
  NAMESPACE = inspect
22
41
 
42
+ # ========================================================================= #
43
+ # === UPCASE_THE_SEQUENCE
44
+ #
45
+ # Setting this constant to true will cause this class to store the
46
+ # FASTA sequence in an upcased variant, e. g. "AGCAGCTA" rather
47
+ # than "acgatcag".
48
+ # ========================================================================= #
49
+ UPCASE_THE_SEQUENCE = true
50
+
51
+ # ========================================================================= #
52
+ # === TEST_STRING
53
+ #
54
+ # Our example test-string, to see how such a genbank file usually looks
55
+ # like.
56
+ #
57
+ # This will contain two different FASTA sequences.
58
+ # ========================================================================= #
59
+ TEST_STRING = ' /note="internal transcribed spacer 2"
60
+ ORIGIN
61
+ 1 cgtaacaagg tttccgtagg tgaaccttcg gaaggatcat tgttgagacc cccaaaaaaa
62
+ 61 cgatcgagtt aatccggagg accggtgtag tttggtctcc caggggcttt ggctactgtg
63
+ 121 gtggccgtga atttccgtcg aacctccttg ggagaattct tgatggcaat tgaacccttg
64
+ 181 gcccggcgca gtttcgcccc aagtcaaatg agatggaacc ggcggagggc atcgtcctcc
65
+ 241 atggaaccgg ggagggccgg cgttcttccg ttccccccat gaattttttt ttgacaactc
66
+ 301 tcggcaacgg atatctcggc tctttgcatc cgatgaaaga acccagcgaa atgtgataag
67
+ 361 tggtgtgaat tgcagaatcc cgtgaaccat cgagtctttg aacgcaagtt gcgcccgagg
68
+ 421 ccatcaggct aagggcacgc ctgcctgggc gttgcgtgct gcatctctct cccattgcta
69
+ 481 aggctgaaca ggcatactgt tcggccggcg cggatgagtg tttggcccct tgttcttcgg
70
+ 541 tgcgatgggt ccaagacctg ggcttttgac ggccggaaat ccggcaagag gtggacggac
71
+ 601 ggtggctgcg acgaagctgt cgtgcgaatg ccctacgctg tcgtatttga tgggccggaa
72
+ 661 taaatccctt ttgagcccca ttggaggcac gtcaacccgt gggcggtcga cggccatttg
73
+ 721 gatgcaaccc caggtcaggt gagga
74
+ //
75
+ LOCUS Z78510 750 bp DNA linear PLN 30-NOV-2006
76
+ DEFINITION P.caricinum 5.8S rRNA gene and ITS1 and ITS2 DNA.
77
+ ACCESSION Z78510
78
+ VERSION Z78510.1 GI:2765635
79
+ KEYWORDS 5.8S ribosomal RNA; 5.8S rRNA gene; internal transcribed spacer;
80
+ ITS1; ITS2.
81
+ SOURCE Phragmipedium caricinum
82
+ ORGANISM Phragmipedium caricinum
83
+ Eukaryota; Viridiplantae; Streptophyta; Embryophyta; Tracheophyta;
84
+ Spermatophyta; Magnoliophyta; Liliopsida; Asparagales; Orchidaceae;
85
+ Cypripedioideae; Phragmipedium.
86
+ REFERENCE 1
87
+ AUTHORS Cox,A.V., Pridgeon,A.M., Albert,V.A. and Chase,M.W.
88
+ TITLE Phylogenetics of the slipper orchids (Cypripedioideae:
89
+ Orchidaceae): nuclear rDNA ITS sequences
90
+ JOURNAL Unpublished
91
+ REFERENCE 2 (bases 1 to 750)
92
+ AUTHORS Cox,A.V.
93
+ TITLE Direct Submission
94
+ JOURNAL Submitted (19-AUG-1996) Cox A.V., Royal Botanic Gardens, Kew,
95
+ Richmond, Surrey TW9 3AB, UK
96
+ FEATURES Location/Qualifiers
97
+ source 1..750
98
+ /organism="Phragmipedium caricinum"
99
+ /mol_type="genomic DNA"
100
+ /db_xref="taxon:53127"
101
+ misc_feature 1..380
102
+ /note="internal transcribed spacer 1"
103
+ gene 381..550
104
+ /gene="5.8S rRNA"
105
+ rRNA 381..550
106
+ /gene="5.8S rRNA"
107
+ /product="5.8S ribosomal RNA"
108
+ misc_feature 551..750
109
+ /note="internal transcribed spacer 2"
110
+ ORIGIN
111
+ 1 ctaaccaggg ttccgaggtg accttcggga ggattccttt ttaagccccc gaaaaaacga
112
+ 61 tcgaattaaa ccggaggacc ggtttaattt ggtctcccca ggggctttcc ccccttggtg
113
+ 121 gccgtgaatt tccatcgaac ccccctggga gaattcttgg tggccaatgg acccttggcc
114
+ 181 cggcgcaatt tcccccccaa tcaaatgaga taggaccggc agggggcgtc cccccccatg
115
+ 241 gaaccgggga gggccggcat tcttccgttc ccccctcgga ttttttgaca actctcgcaa
116
+ 301 cggatatctc gcctctttgc atcggatgga agaacgcagc gaaatgtgat aagtggtgtg
117
+ 361 aattgcagaa tcccgtgaac catcgagtct ttgaacgcaa gttgcgcccg aggccatcag
118
+ 421 gctaagggca cgcctgcctg ggcgttgcgt gctgcatctc tcccattgct aaggttgaac
119
+ 481 gggcatactg ttcggccggc gcggatgaga gattggcccc ttgttcttcg gtgcgatggg
120
+ 541 tccaagacct gggcttttga cggtccaaaa tccggcaaga ggtggacgga cggtggctgc
121
+ 601 gacaaagctg tcgtgcgaat gccctgcgtt gtcgtttttg atgggccgga ataaatccct
122
+ 661 tttgaacccc attggaggca cgtcaaccca tgggcggttg acggccattt ggatgcaacc
123
+ 721 ccaggtcagg tgagccaccc gctgagttta
124
+ //
125
+ LOCUS Z78509 731 bp DNA linear PLN 30-NOV-2006
126
+ DEFINITION P.pearcei 5.8S rRNA gene and ITS1 and ITS2 DNA.
127
+ ACCESSION Z78509
128
+ VERSION Z78509.1 GI:2765634
129
+ KEYWORDS 5.8S ribosomal RNA; 5.8S rRNA gene; internal transcribed spacer;
130
+ ITS1; ITS2.
131
+ SOURCE Phragmipedium pearcei
132
+ ORGANISM Phragmipedium pearcei
133
+ Eukaryota; Viridiplantae; Streptophyta; Embryophyta; Tracheophyta;
134
+ Spermatophyta; Magnoliophyta; Liliopsida; Asparagales; Orchidaceae;
135
+ Cypripedioideae; Phragmipedium.
136
+ REFERENCE 1
137
+ AUTHORS Cox,A.V., Pridgeon,A.M., Albert,V.A. and Chase,M.W.
138
+ TITLE Phylogenetics of the slipper orchids (Cypripedioideae:
139
+ Orchidaceae): nuclear rDNA ITS sequences
140
+ JOURNAL Unpublished
141
+ REFERENCE 2 (bases 1 to 731)
142
+ AUTHORS Cox,A.V.
143
+ TITLE Direct Submission
144
+ JOURNAL Submitted (19-AUG-1996) Cox A.V., Royal Botanic Gardens, Kew,
145
+ Richmond, Surrey TW9 3AB, UK
146
+ FEATURES Location/Qualifiers
147
+ source 1..731
148
+ /organism="Phragmipedium pearcei"
149
+ /mol_type="genomic DNA"
150
+ /db_xref="taxon:53135"
151
+ misc_feature 1..380
152
+ /note="internal transcribed spacer 1"
153
+ gene 381..550
154
+ /gene="5.8S rRNA"
155
+ rRNA 381..550
156
+ /gene="5.8S rRNA"
157
+ /product="5.8S ribosomal RNA"
158
+ misc_feature 551..731
159
+ /note="internal transcribed spacer 2"
160
+ ORIGIN
161
+ 1 cgtaacaagg tttccgtagg tgaacctgcg gaaggatcat tgttgagacc gccaaatata
162
+ 61 cgatcgagtt aatccggagg accggtgtag tttggtctcc caggggcttt cgccgctgtg
163
+ 121 gtgaccgtga tttgccatcg agcctccttg ggagatttct tgatggcaat tgaacccttg
164
+ 181 gcccggcgca gtttcgcgcc aagtcatatg agatagaacc ggcggagggc gtcgtcctcc
165
+ 241 atggagcggg gagggccggc atgctccgtg cccccccatg aatttttctg acaactctcg
166
+ 301 gcaacggacg taacaaggtt taaatgtgat aagcaggtgt gaattgcaga atcccgtgaa
167
+ 361 ccatcgagtc tttgaacgca agttgcgccc gaggccatca ggttaagggc acgcctgcct
168
+ 421 gggcgttgcg tgctgcatct ctcccattgc taaggttgaa cgggcatact gttcggccgg
169
+ 481 cgcggatgag agtttggccc cttgttcttc ggtgcgatgg gtccaagacc tgggcttttg
170
+ 541 acggtccaaa atccggcaag aggtggacgg acggtggctg cgacagagct gtcgtgcgaa
171
+ 601 tgccctacgt tgtcgttttt gatgggccag aataaatccc ttttgaaccc cattggaggc
172
+ 661 acgtcaaccc aatggggggt gacgggcatt tggttaaccc cggcaagtta aggcacccgt
173
+ 721 taattttagg a
174
+ //
175
+ LOCUS Z78508 741 bp DNA linear PLN 30-NOV-2006'
176
+
23
177
  # ========================================================================= #
24
178
  # === initialize
25
179
  # ========================================================================= #
26
180
  def initialize(
27
- commandline_arguments = ARGV,
181
+ commandline_arguments = nil,
28
182
  run_already = true
29
183
  )
30
184
  reset
31
185
  set_commandline_arguments(
32
186
  commandline_arguments
33
187
  )
188
+ menu
189
+ if block_given?
190
+ yielded = yield
191
+ case yielded
192
+ # ===================================================================== #
193
+ # === :do_not_report_anything
194
+ # ===================================================================== #
195
+ when :do_not_report_anything
196
+ @internal_hash[:report_the_dataset] = false
197
+ end
198
+ end
34
199
  run if run_already
35
200
  end
36
201
 
37
202
  # ========================================================================= #
38
- # === reset
203
+ # === reset (reset tag)
39
204
  # ========================================================================= #
40
205
  def reset
41
206
  super()
207
+ # ======================================================================= #
208
+ # === @namespace
209
+ # ======================================================================= #
210
+ @namespace = NAMESPACE
211
+ # ======================================================================= #
212
+ # === @internal_hash
213
+ # ======================================================================= #
214
+ @internal_hash = {}
215
+ # ======================================================================= #
216
+ # === :work_on_this_file
217
+ # ======================================================================= #
218
+ @internal_hash[:work_on_this_file] = nil
219
+ # ======================================================================= #
220
+ # === :report_the_dataset
221
+ # ======================================================================= #
222
+ @internal_hash[:report_the_dataset] = true
223
+ # ======================================================================= #
224
+ # === :n_FASTA_entries_in_the_file
225
+ #
226
+ # This variable will keep track how many FASTA entries are in
227
+ # the genbank file at hand.
228
+ # ======================================================================= #
229
+ @internal_hash[:n_FASTA_entries_in_the_file] = 0
230
+ # ======================================================================= #
231
+ # === :dataset_from_all_FASTA_entries_as_a_hash
232
+ #
233
+ # This hash will contain all the FASTA sequences in the given
234
+ # genbank file at hand. This constitutes the main dataset of
235
+ # this clas.
236
+ # ======================================================================= #
237
+ @internal_hash[:dataset_from_all_FASTA_entries_as_a_hash] = {}
42
238
  end
43
239
 
44
240
  # ========================================================================= #
45
- # === run
241
+ # === menu (menu tag)
46
242
  # ========================================================================= #
47
- def run
48
- _ = first_argument?
49
- if _ and File.exist?(_)
50
- dataset = File.readlines(_).select {|line|
51
- line.start_with? ' '
52
- }.map {|entry|
53
- splitted = entry.strip.split(' ')
54
- splitted.pop # Remove the last element.
55
- splitted.join.strip
56
- }
57
- if dataset.is_a? Array
58
- dataset = dataset.join
243
+ def menu(
244
+ i = commandline_arguments_containing_leading_hyphens?
245
+ )
246
+ if i.is_a? Array
247
+ i.each {|entry| menu(entry) }
248
+ else
249
+ case i # (case tag)
250
+ # ===================================================================== #
251
+ # === gparser --help
252
+ # ===================================================================== #
253
+ when /^-?-?help$/i
254
+ show_help
255
+ exit
256
+ # ===================================================================== #
257
+ # === gparser --test
258
+ #
259
+ # This entry point can be used to test the default TEST_STRING.
260
+ # ===================================================================== #
261
+ when /^-?-?test$/i,
262
+ /^-?-?test(-|_)?string$/i
263
+ analyse_this_dataset(TEST_STRING)
264
+ exit
59
265
  end
60
- @sequence = dataset
61
266
  end
62
267
  end
63
268
 
269
+ # ========================================================================= #
270
+ # === work_on_which_file?
271
+ # ========================================================================= #
272
+ def work_on_which_file?
273
+ @internal_hash[:work_on_this_file]
274
+ end
275
+
276
+ # ========================================================================= #
277
+ # === report_the_dataset?
278
+ # ========================================================================= #
279
+ def report_the_dataset?
280
+ @internal_hash[:report_the_dataset]
281
+ end
282
+
283
+ # ========================================================================= #
284
+ # === set_work_on_this_file
285
+ # ========================================================================= #
286
+ def set_work_on_this_file(
287
+ i = first_argument?
288
+ )
289
+ @internal_hash[:work_on_this_file] = i
290
+ end
291
+
292
+ # ========================================================================= #
293
+ # === analyse_this_dataset
294
+ # ========================================================================= #
295
+ def analyse_this_dataset(dataset)
296
+ use_this_regex =
297
+ /ORIGIN[\/\-\.\s0-9a-zA-Z]+VERSION\s*[\.0-9A-Z]+/ # See: https://rubular.com/r/0q7rFIUflX7yzw
298
+ scanned = dataset.scan(use_this_regex)
299
+ @internal_hash[:n_FASTA_entries_in_the_file] = scanned
300
+ discover_the_corresponding_FASTA_entries_from_this_dataset(scanned)
301
+ consider_reporting_our_findings_to_the_user
302
+ end; alias determine_dataset analyse_this_dataset # === determine_dataset
303
+
304
+ # ========================================================================= #
305
+ # === dataset?
306
+ # ========================================================================= #
307
+ def dataset?
308
+ @internal_hash[:dataset_from_all_FASTA_entries_as_a_hash]
309
+ end; alias main_dataset? dataset? # === main_dataset?
310
+
311
+ # ========================================================================= #
312
+ # === sequences?
313
+ # ========================================================================= #
314
+ def sequences?
315
+ dataset?.values
316
+ end
317
+
64
318
  # ========================================================================= #
65
319
  # === sequence?
66
320
  # ========================================================================= #
67
321
  def sequence?
68
- @sequence
322
+ sequences?.first
69
323
  end; alias coding_sequence? sequence? # === coding_sequence?
70
324
  alias cds sequence? # === cds
71
325
 
326
+ # ========================================================================= #
327
+ # === discover_the_corresponding_FASTA_entries_from_this_dataset
328
+ # ========================================================================= #
329
+ def discover_the_corresponding_FASTA_entries_from_this_dataset(i)
330
+ regex_to_use_for_the_id = /VERSION\s*([\.A-Za-z0-9]+)/
331
+ if i.is_a? Array
332
+ i.each {|this_dataset|
333
+ this_dataset =~ regex_to_use_for_the_id
334
+ use_this_id = $1.to_s.dup
335
+ use_this_FASTA_sequence = this_dataset.scan(
336
+ /^\s*\d{1,100}([\sa-zA-Z]+)/
337
+ ).flatten.join(' ').delete(" \n")
338
+ use_this_FASTA_sequence.upcase! if UPCASE_THE_SEQUENCE
339
+ @internal_hash[:dataset_from_all_FASTA_entries_as_a_hash][use_this_id] = use_this_FASTA_sequence
340
+ }
341
+ end
342
+ end
343
+
344
+ # ========================================================================= #
345
+ # === verbose_check_whether_the_file_exists
346
+ # ========================================================================= #
347
+ def verbose_check_whether_the_file_exists
348
+ _ = @internal_hash[:work_on_this_file]
349
+ if _ and File.exist?(_)
350
+ true
351
+ else
352
+ opnn; e 'No file exists at '+sfile(_)
353
+ false
354
+ end
355
+ end
356
+
357
+ # ========================================================================= #
358
+ # === consider_reporting_our_findings_to_the_user (report tag)
359
+ # ========================================================================= #
360
+ def consider_reporting_our_findings_to_the_user
361
+ if report_the_dataset? and dataset? and !dataset?.empty?
362
+ main_dataset?.each_pair {|key, value|
363
+ e steelblue("#{key}:")
364
+ e lightblue(value)
365
+ e
366
+ }
367
+ end
368
+ end; alias report consider_reporting_our_findings_to_the_user # === report
369
+ alias report_the_dataset consider_reporting_our_findings_to_the_user # === report_the_dataset
370
+
371
+ # ========================================================================= #
372
+ # === run (run tag)
373
+ # ========================================================================= #
374
+ def run
375
+ set_work_on_this_file(first_argument?)
376
+ # ======================================================================= #
377
+ # First check whether the given file exists or not:
378
+ # ======================================================================= #
379
+ if verbose_check_whether_the_file_exists
380
+ original_dataset = File.read(@internal_hash[:work_on_this_file]) # Just store it completely.
381
+ if original_dataset.include?('ORIGIN') and original_dataset.include?('VERSION ')
382
+ analyse_this_dataset(original_dataset)
383
+ else
384
+ opnn; e 'No keywords ORIGIN and VERSION were found in this file.'
385
+ end
386
+ end
387
+ end
388
+
389
+ # ========================================================================= #
390
+ # === Bioroebe::GenbankParser[]
391
+ # ========================================================================= #
392
+ def self.[](i = '')
393
+ new(i)
394
+ end
395
+
72
396
  end; end
73
397
 
74
398
  if __FILE__ == $PROGRAM_NAME
75
- _ = Bioroebe::GenbankParser.new(ARGV)
76
- pp _.id
77
- pp _.sequence?
78
- end # genbankparser *genbank
399
+ alias e puts
400
+ genbank_parser = Bioroebe::GenbankParser.new(ARGV)
401
+ # genbank_parser = Bioroebe::GenbankParser.new('/home/Temp/bioroebe/ls_orchid.gbk')
402
+ e genbank_parser.sequence?
403
+ # e _.id
404
+ end # genbankparser *genbank
405
+ # genbankparser
406
+ # genbankparser sample_file.genbank
407
+ # genbankparser --test
@@ -68,11 +68,6 @@ module Parser
68
68
 
69
69
  class GFF < ::Bioroebe::CommandlineApplication # === Bioroebe::Parser::GFF
70
70
 
71
- # ========================================================================= #
72
- # === NAMESPACE
73
- # ========================================================================= #
74
- NAMESPACE = inspect
75
-
76
71
  # ========================================================================= #
77
72
  # === INPUT_FILE
78
73
  #
@@ -112,10 +107,7 @@ class GFF < ::Bioroebe::CommandlineApplication # === Bioroebe::Parser::GFF
112
107
  # ========================================================================= #
113
108
  def reset
114
109
  super()
115
- # ======================================================================= #
116
- # === @namespace
117
- # ======================================================================= #
118
- @namespace = NAMESPACE
110
+ infer_the_namespace
119
111
  # ======================================================================= #
120
112
  # === @input_file
121
113
  # ======================================================================= #
@@ -114,11 +114,6 @@ module Bioroebe
114
114
 
115
115
  class ParsePdbFile < ::Bioroebe::CommandlineApplication # === Bioroebe::ParsePdbFile
116
116
 
117
- # ========================================================================= #
118
- # === NAMESPACE
119
- # ========================================================================= #
120
- NAMESPACE = inspect
121
-
122
117
  # ========================================================================= #
123
118
  # === DEFAULT_PDB_FILE
124
119
  # ========================================================================= #
@@ -171,10 +166,7 @@ class ParsePdbFile < ::Bioroebe::CommandlineApplication # === Bioroebe::ParsePdb
171
166
  # ========================================================================= #
172
167
  def reset
173
168
  super()
174
- # ======================================================================= #
175
- # === @namespace
176
- # ======================================================================= #
177
- @namespace = NAMESPACE
169
+ infer_the_namespace
178
170
  # ======================================================================= #
179
171
  # === @do_create_a_fasta_file
180
172
  #
@@ -248,7 +248,7 @@ module Taxonomy
248
248
  # ========================================================================= #
249
249
  def self.project_base_dir?
250
250
  "#{::Bioroebe.project_base_directory?}taxonomy/"
251
- end
251
+ end; self.instance_eval { alias base_dir? project_base_dir? } # === Bioroebe::Taxonomy.base_dir?
252
252
 
253
253
  # ========================================================================= #
254
254
  # === Bioroebe::Taxonomy.project_yaml_dir?
@@ -0,0 +1 @@
1
+ This directory will contain some python-specific code.
@@ -0,0 +1,4 @@
1
+ window {
2
+ font-size: 28px;
3
+ border: 2px solid black;
4
+ }