bioroebe 0.10.80 → 0.11.12

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 (67) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +507 -310
  3. data/bioroebe.gemspec +3 -3
  4. data/doc/README.gen +506 -309
  5. data/doc/todo/bioroebe_todo.md +29 -40
  6. data/lib/bioroebe/aminoacids/display_aminoacid_table.rb +1 -0
  7. data/lib/bioroebe/base/colours_for_base/colours_for_base.rb +18 -8
  8. data/lib/bioroebe/base/commandline_application/commandline_arguments.rb +13 -11
  9. data/lib/bioroebe/base/commandline_application/misc.rb +18 -8
  10. data/lib/bioroebe/base/prototype/misc.rb +1 -1
  11. data/lib/bioroebe/codons/show_codon_tables.rb +6 -2
  12. data/lib/bioroebe/constants/aminoacids_and_proteins.rb +1 -0
  13. data/lib/bioroebe/constants/files_and_directories.rb +8 -1
  14. data/lib/bioroebe/count/count_amount_of_nucleotides.rb +3 -0
  15. data/lib/bioroebe/gui/gtk3/protein_to_DNA/protein_to_DNA.rb +18 -18
  16. data/lib/bioroebe/gui/shared_code/protein_to_DNA/protein_to_DNA_module.rb +14 -14
  17. data/lib/bioroebe/parsers/genbank_parser.rb +353 -24
  18. data/lib/bioroebe/python/README.md +1 -0
  19. data/lib/bioroebe/python/__pycache__/mymodule.cpython-39.pyc +0 -0
  20. data/lib/bioroebe/python/gui/gtk3/widget1.py +22 -0
  21. data/lib/bioroebe/python/mymodule.py +8 -0
  22. data/lib/bioroebe/python/protein_to_dna.py +30 -0
  23. data/lib/bioroebe/python/shell/shell.py +19 -0
  24. data/lib/bioroebe/python/to_rna.py +14 -0
  25. data/lib/bioroebe/python/toplevel_methods/to_camelcase.py +11 -0
  26. data/lib/bioroebe/sequence/nucleotide_module/nucleotide_module.rb +28 -25
  27. data/lib/bioroebe/sequence/sequence.rb +54 -2
  28. data/lib/bioroebe/shell/menu.rb +3336 -3304
  29. data/lib/bioroebe/shell/readline/readline.rb +1 -1
  30. data/lib/bioroebe/shell/shell.rb +11233 -28
  31. data/lib/bioroebe/siRNA/siRNA.rb +81 -1
  32. data/lib/bioroebe/string_matching/find_longest_substring.rb +3 -2
  33. data/lib/bioroebe/toplevel_methods/aminoacids_and_proteins.rb +31 -24
  34. data/lib/bioroebe/toplevel_methods/nucleotides.rb +22 -5
  35. data/lib/bioroebe/toplevel_methods/open_in_browser.rb +2 -0
  36. data/lib/bioroebe/toplevel_methods/to_camelcase.rb +5 -0
  37. data/lib/bioroebe/version/version.rb +2 -2
  38. data/lib/bioroebe/yaml/configuration/browser.yml +1 -1
  39. data/lib/bioroebe/yaml/restriction_enzymes/restriction_enzymes.yml +3 -3
  40. metadata +17 -36
  41. data/doc/setup.rb +0 -1655
  42. data/lib/bioroebe/genbank/genbank_parser.rb +0 -291
  43. data/lib/bioroebe/shell/add.rb +0 -108
  44. data/lib/bioroebe/shell/assign.rb +0 -360
  45. data/lib/bioroebe/shell/chop_and_cut.rb +0 -281
  46. data/lib/bioroebe/shell/constants.rb +0 -166
  47. data/lib/bioroebe/shell/download.rb +0 -335
  48. data/lib/bioroebe/shell/enable_and_disable.rb +0 -158
  49. data/lib/bioroebe/shell/enzymes.rb +0 -310
  50. data/lib/bioroebe/shell/fasta.rb +0 -345
  51. data/lib/bioroebe/shell/gtk.rb +0 -76
  52. data/lib/bioroebe/shell/history.rb +0 -132
  53. data/lib/bioroebe/shell/initialize.rb +0 -217
  54. data/lib/bioroebe/shell/loop.rb +0 -74
  55. data/lib/bioroebe/shell/misc.rb +0 -4341
  56. data/lib/bioroebe/shell/prompt.rb +0 -107
  57. data/lib/bioroebe/shell/random.rb +0 -289
  58. data/lib/bioroebe/shell/reset.rb +0 -335
  59. data/lib/bioroebe/shell/scan_and_parse.rb +0 -135
  60. data/lib/bioroebe/shell/search.rb +0 -337
  61. data/lib/bioroebe/shell/sequences.rb +0 -200
  62. data/lib/bioroebe/shell/show_report_and_display.rb +0 -2901
  63. data/lib/bioroebe/shell/startup.rb +0 -127
  64. data/lib/bioroebe/shell/taxonomy.rb +0 -14
  65. data/lib/bioroebe/shell/tk.rb +0 -23
  66. data/lib/bioroebe/shell/user_input.rb +0 -88
  67. data/lib/bioroebe/shell/xorg.rb +0 -45
@@ -1,291 +0,0 @@
1
- #!/usr/bin/ruby -w
2
- # Encoding: UTF-8
3
- # frozen_string_literal: true
4
- # =========================================================================== #
5
- # === Bioroebe::GenbankParser
6
- #
7
- # This is similar to the FastaParser, but instead it will only select the
8
- # content between "ORIGIN" and "//" entries.
9
- #
10
- # You can pass the content of a genbank-file to this class, and it can
11
- # report the nucleotide sequence, e. g. the part starting after the
12
- # ORIGIN string.
13
- #
14
- # The reason why this class has been created was because it is sometimes
15
- # necessary to parse a genebank file.
16
- # =========================================================================== #
17
- # require 'bioroebe/genbank/genbank_parser.rb'
18
- # Bioroebe::GenbankParser.new(ARGV)
19
- # =========================================================================== #
20
- require 'bioroebe/base/commandline_application/commandline_application.rb'
21
-
22
- module Bioroebe
23
-
24
- class GenbankParser < ::Bioroebe::CommandlineApplication # === Bioroebe::GenbankParser
25
-
26
- # ========================================================================= #
27
- # === UPCASE_SEQUENCE
28
- # ========================================================================= #
29
- UPCASE_SEQUENCE = true
30
-
31
- # ========================================================================= #
32
- # === TEST_STRING
33
- #
34
- # Our example test-string, to see how such a genbank file usually looks
35
- # like.
36
- # ========================================================================= #
37
- TEST_STRING = ' /note="internal transcribed spacer 2"
38
- ORIGIN
39
- 1 cgtaacaagg tttccgtagg tgaaccttcg gaaggatcat tgttgagacc cccaaaaaaa
40
- 61 cgatcgagtt aatccggagg accggtgtag tttggtctcc caggggcttt ggctactgtg
41
- 121 gtggccgtga atttccgtcg aacctccttg ggagaattct tgatggcaat tgaacccttg
42
- 181 gcccggcgca gtttcgcccc aagtcaaatg agatggaacc ggcggagggc atcgtcctcc
43
- 241 atggaaccgg ggagggccgg cgttcttccg ttccccccat gaattttttt ttgacaactc
44
- 301 tcggcaacgg atatctcggc tctttgcatc cgatgaaaga acccagcgaa atgtgataag
45
- 361 tggtgtgaat tgcagaatcc cgtgaaccat cgagtctttg aacgcaagtt gcgcccgagg
46
- 421 ccatcaggct aagggcacgc ctgcctgggc gttgcgtgct gcatctctct cccattgcta
47
- 481 aggctgaaca ggcatactgt tcggccggcg cggatgagtg tttggcccct tgttcttcgg
48
- 541 tgcgatgggt ccaagacctg ggcttttgac ggccggaaat ccggcaagag gtggacggac
49
- 601 ggtggctgcg acgaagctgt cgtgcgaatg ccctacgctg tcgtatttga tgggccggaa
50
- 661 taaatccctt ttgagcccca ttggaggcac gtcaacccgt gggcggtcga cggccatttg
51
- 721 gatgcaaccc caggtcaggt gagga
52
- //
53
- LOCUS Z78510 750 bp DNA linear PLN 30-NOV-2006
54
- DEFINITION P.caricinum 5.8S rRNA gene and ITS1 and ITS2 DNA.
55
- ACCESSION Z78510
56
- VERSION Z78510.1 GI:2765635
57
- KEYWORDS 5.8S ribosomal RNA; 5.8S rRNA gene; internal transcribed spacer;
58
- ITS1; ITS2.
59
- SOURCE Phragmipedium caricinum
60
- ORGANISM Phragmipedium caricinum
61
- Eukaryota; Viridiplantae; Streptophyta; Embryophyta; Tracheophyta;
62
- Spermatophyta; Magnoliophyta; Liliopsida; Asparagales; Orchidaceae;
63
- Cypripedioideae; Phragmipedium.
64
- REFERENCE 1
65
- AUTHORS Cox,A.V., Pridgeon,A.M., Albert,V.A. and Chase,M.W.
66
- TITLE Phylogenetics of the slipper orchids (Cypripedioideae:
67
- Orchidaceae): nuclear rDNA ITS sequences
68
- JOURNAL Unpublished
69
- REFERENCE 2 (bases 1 to 750)
70
- AUTHORS Cox,A.V.
71
- TITLE Direct Submission
72
- JOURNAL Submitted (19-AUG-1996) Cox A.V., Royal Botanic Gardens, Kew,
73
- Richmond, Surrey TW9 3AB, UK
74
- FEATURES Location/Qualifiers
75
- source 1..750
76
- /organism="Phragmipedium caricinum"
77
- /mol_type="genomic DNA"
78
- /db_xref="taxon:53127"
79
- misc_feature 1..380
80
- /note="internal transcribed spacer 1"
81
- gene 381..550
82
- /gene="5.8S rRNA"
83
- rRNA 381..550
84
- /gene="5.8S rRNA"
85
- /product="5.8S ribosomal RNA"
86
- misc_feature 551..750
87
- /note="internal transcribed spacer 2"
88
- ORIGIN
89
- 1 ctaaccaggg ttccgaggtg accttcggga ggattccttt ttaagccccc gaaaaaacga
90
- 61 tcgaattaaa ccggaggacc ggtttaattt ggtctcccca ggggctttcc ccccttggtg
91
- 121 gccgtgaatt tccatcgaac ccccctggga gaattcttgg tggccaatgg acccttggcc
92
- 181 cggcgcaatt tcccccccaa tcaaatgaga taggaccggc agggggcgtc cccccccatg
93
- 241 gaaccgggga gggccggcat tcttccgttc ccccctcgga ttttttgaca actctcgcaa
94
- 301 cggatatctc gcctctttgc atcggatgga agaacgcagc gaaatgtgat aagtggtgtg
95
- 361 aattgcagaa tcccgtgaac catcgagtct ttgaacgcaa gttgcgcccg aggccatcag
96
- 421 gctaagggca cgcctgcctg ggcgttgcgt gctgcatctc tcccattgct aaggttgaac
97
- 481 gggcatactg ttcggccggc gcggatgaga gattggcccc ttgttcttcg gtgcgatggg
98
- 541 tccaagacct gggcttttga cggtccaaaa tccggcaaga ggtggacgga cggtggctgc
99
- 601 gacaaagctg tcgtgcgaat gccctgcgtt gtcgtttttg atgggccgga ataaatccct
100
- 661 tttgaacccc attggaggca cgtcaaccca tgggcggttg acggccattt ggatgcaacc
101
- 721 ccaggtcagg tgagccaccc gctgagttta
102
- //
103
- LOCUS Z78509 731 bp DNA linear PLN 30-NOV-2006
104
- DEFINITION P.pearcei 5.8S rRNA gene and ITS1 and ITS2 DNA.
105
- ACCESSION Z78509
106
- VERSION Z78509.1 GI:2765634
107
- KEYWORDS 5.8S ribosomal RNA; 5.8S rRNA gene; internal transcribed spacer;
108
- ITS1; ITS2.
109
- SOURCE Phragmipedium pearcei
110
- ORGANISM Phragmipedium pearcei
111
- Eukaryota; Viridiplantae; Streptophyta; Embryophyta; Tracheophyta;
112
- Spermatophyta; Magnoliophyta; Liliopsida; Asparagales; Orchidaceae;
113
- Cypripedioideae; Phragmipedium.
114
- REFERENCE 1
115
- AUTHORS Cox,A.V., Pridgeon,A.M., Albert,V.A. and Chase,M.W.
116
- TITLE Phylogenetics of the slipper orchids (Cypripedioideae:
117
- Orchidaceae): nuclear rDNA ITS sequences
118
- JOURNAL Unpublished
119
- REFERENCE 2 (bases 1 to 731)
120
- AUTHORS Cox,A.V.
121
- TITLE Direct Submission
122
- JOURNAL Submitted (19-AUG-1996) Cox A.V., Royal Botanic Gardens, Kew,
123
- Richmond, Surrey TW9 3AB, UK
124
- FEATURES Location/Qualifiers
125
- source 1..731
126
- /organism="Phragmipedium pearcei"
127
- /mol_type="genomic DNA"
128
- /db_xref="taxon:53135"
129
- misc_feature 1..380
130
- /note="internal transcribed spacer 1"
131
- gene 381..550
132
- /gene="5.8S rRNA"
133
- rRNA 381..550
134
- /gene="5.8S rRNA"
135
- /product="5.8S ribosomal RNA"
136
- misc_feature 551..731
137
- /note="internal transcribed spacer 2"
138
- ORIGIN
139
- 1 cgtaacaagg tttccgtagg tgaacctgcg gaaggatcat tgttgagacc gccaaatata
140
- 61 cgatcgagtt aatccggagg accggtgtag tttggtctcc caggggcttt cgccgctgtg
141
- 121 gtgaccgtga tttgccatcg agcctccttg ggagatttct tgatggcaat tgaacccttg
142
- 181 gcccggcgca gtttcgcgcc aagtcatatg agatagaacc ggcggagggc gtcgtcctcc
143
- 241 atggagcggg gagggccggc atgctccgtg cccccccatg aatttttctg acaactctcg
144
- 301 gcaacggacg taacaaggtt taaatgtgat aagcaggtgt gaattgcaga atcccgtgaa
145
- 361 ccatcgagtc tttgaacgca agttgcgccc gaggccatca ggttaagggc acgcctgcct
146
- 421 gggcgttgcg tgctgcatct ctcccattgc taaggttgaa cgggcatact gttcggccgg
147
- 481 cgcggatgag agtttggccc cttgttcttc ggtgcgatgg gtccaagacc tgggcttttg
148
- 541 acggtccaaa atccggcaag aggtggacgg acggtggctg cgacagagct gtcgtgcgaa
149
- 601 tgccctacgt tgtcgttttt gatgggccag aataaatccc ttttgaaccc cattggaggc
150
- 661 acgtcaaccc aatggggggt gacgggcatt tggttaaccc cggcaagtta aggcacccgt
151
- 721 taattttagg a
152
- //
153
- LOCUS Z78508 741 bp DNA linear PLN 30-NOV-2006'
154
-
155
- # ========================================================================= #
156
- # === initialize
157
- # ========================================================================= #
158
- def initialize(
159
- dataset = ARGV,
160
- run_already = true
161
- )
162
- reset
163
- determine_dataset(
164
- dataset
165
- )
166
- if block_given?
167
- yielded = yield
168
- case yielded
169
- # ===================================================================== #
170
- # === :do_not_report_anything
171
- # ===================================================================== #
172
- when :do_not_report_anything
173
- @report_dataset = false
174
- end
175
- end
176
- run if run_already
177
- end
178
-
179
- # ========================================================================= #
180
- # === reset
181
- # ========================================================================= #
182
- def reset
183
- super()
184
- # ======================================================================= #
185
- # === @dataset
186
- # ======================================================================= #
187
- @dataset = nil
188
- # ======================================================================= #
189
- # === @report_dataset
190
- # ======================================================================= #
191
- @report_dataset = true
192
- end
193
-
194
- # ========================================================================= #
195
- # === determine_dataset
196
- # ========================================================================= #
197
- def determine_dataset(i = nil)
198
- if i.is_a? Array
199
- i = i.first
200
- end
201
- if i.nil?
202
- e 'Please provide some input to this class.'
203
- return
204
- end
205
- # ======================================================================= #
206
- # === Handle existing .gb files here
207
- # ======================================================================= #
208
- if File.exist?(i) and File.file?(i)
209
- i = File.read(i)
210
- end
211
- case i # case tag
212
- # ======================================================================= #
213
- # === --test
214
- #
215
- # This entry point can be used to test the default TEST_STRING.
216
- # ======================================================================= #
217
- when nil,
218
- /^-?-?test$/i,
219
- /^-?-?test(-|_)?string$/i
220
- i = TEST_STRING
221
- end
222
- # ======================================================================= #
223
- # Store the results in the following array.
224
- # ======================================================================= #
225
- array = []
226
- open = false
227
- splitted = i.split(N)
228
- splitted.each {|line|
229
- if line.start_with? '//'
230
- open = false
231
- end
232
- if open
233
- array.last << line.strip.delete(' ').gsub(/\d/,'')
234
- array.flatten!
235
- end
236
- if line.start_with? 'ORIGIN'
237
- open = true
238
- array << [] # Append a new Array.
239
- end
240
- }
241
- string = array.first
242
- string.upcase! if UPCASE_SEQUENCE
243
- @dataset = string # Assign to the main @dataset here.
244
- end
245
-
246
- # ========================================================================= #
247
- # === report_dataset?
248
- # ========================================================================= #
249
- def report_dataset?
250
- @report_dataset
251
- end
252
-
253
- # ========================================================================= #
254
- # === dataset?
255
- # ========================================================================= #
256
- def dataset?
257
- @dataset
258
- end; alias sequence? dataset? # === sequence?
259
-
260
- # ========================================================================= #
261
- # === report_dataset (report tag)
262
- #
263
- # Simply output the dataset without any further processing to be done.
264
- # ========================================================================= #
265
- def report_dataset
266
- if @dataset
267
- e @dataset if report_dataset?
268
- end
269
- end; alias report report_dataset # === report
270
-
271
- # ========================================================================= #
272
- # === run
273
- # ========================================================================= #
274
- def run
275
- report_dataset
276
- end
277
-
278
- # ========================================================================= #
279
- # === Bioroebe::GenbankParser[]
280
- # ========================================================================= #
281
- def self.[](i)
282
- new(i)
283
- end
284
-
285
- end; end
286
-
287
- if __FILE__ == $PROGRAM_NAME
288
- Bioroebe::GenbankParser.new(ARGV) # Report the dataset as well.
289
- end # genbankparser
290
- # genbankparser sample_file.genbank
291
- # genbankparser --test
@@ -1,108 +0,0 @@
1
- #!/usr/bin/ruby -w
2
- # Encoding: UTF-8
3
- # frozen_string_literal: true
4
- # =========================================================================== #
5
- # require 'bioroebe/shell/add.rb'
6
- # =========================================================================== #
7
- module Bioroebe
8
-
9
- class Shell < ::Bioroebe::CommandlineApplication
10
-
11
- # ========================================================================= #
12
- # === add_to_end
13
- #
14
- # This method will invoke append() if something has to be appended.
15
- # ========================================================================= #
16
- def add_to_end(i)
17
- add_to_start_or_end(i, :end)
18
- end; alias add add_to_end # === add (add tag)
19
-
20
- # ========================================================================= #
21
- # === add_to_start
22
- # ========================================================================= #
23
- def add_to_start(i)
24
- add_to_start_or_end(i, :start)
25
- end; alias left_add add_to_start # === left_add
26
-
27
- # ========================================================================= #
28
- # === add_to_start_or_end
29
- #
30
- # This method can either add to the start or to the end.
31
- #
32
- # The default is to append to the nucleotide sequence.
33
- #
34
- # We can input a number - in this case, we simply add these many
35
- # nucleotides onto the main string.
36
- # ========================================================================= #
37
- def add_to_start_or_end(
38
- i = '',
39
- append_or_prepend = :append
40
- )
41
- i = i.join('') if i.is_a? Array
42
- i = i.dup
43
- old_length = i.size
44
- case i.to_s # Easier start/stop entries.
45
- # ======================================================================= #
46
- # === Add a start codon.
47
- # ======================================================================= #
48
- when 'start',
49
- 'START',
50
- /ORF/i,
51
- ':start'
52
- i = ::Bioroebe.start_codon? # Used to be hardcoded -> 'ATG'
53
- # ======================================================================= #
54
- # === Add a stop codon.
55
- # ======================================================================= #
56
- when /^stop$/i,
57
- ':stop'
58
- i = ::Bioroebe.stop_codons?.sample
59
- end
60
- i.upcase!
61
- case append_or_prepend
62
- # ======================================================================= #
63
- # === :prepend
64
- # ======================================================================= #
65
- when :prepend,
66
- :to_start,
67
- :start
68
- if i =~ /^\d+$/ # If input is only numbers.
69
- erev 'Only numbers were given: Prepending '+
70
- sfancy(i.to_s)+rev+
71
- ' random nucleotides to the main string now.'
72
- i.to_i.times { prepend(add_nucleotide) }
73
- else
74
- erev "Prepending #{sfancy(i)}#{rev} to the main string."
75
- prepend(i)
76
- end
77
- # ======================================================================= #
78
- # === :append
79
- # ======================================================================= #
80
- when :append,
81
- :to_end,
82
- :end
83
- if i =~ /^\d+$/ # If input is only numbers.
84
- erev "Only numbers were given: Adding #{sfancy(i.to_s)}#{rev}"\
85
- " random nucleotides to the main string now."
86
- i.to_i.times { append(return_random_nucleotide) }
87
- else
88
- if only_nucleotides?(i)
89
- msg = "Adding #{sfancy(i)}#{rev}"
90
- msg = msg.dup if msg.frozen?
91
- if ::Bioroebe.is_a_stop_codon? i
92
- msg << ' (a stop codon)'
93
- end
94
- msg << ' to the main string.'
95
- erev msg
96
- end
97
- append(i)
98
- end
99
- end
100
- new_length = string?.size.to_s
101
- unless new_length.to_i == old_length.to_i
102
- erev "The new length of the main string is now: "\
103
- "#{simp(new_length)}#{rev}."
104
- end
105
- show_dna_sequence
106
- end
107
-
108
- end; end