bioroebe 0.13.31 → 0.13.32

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 43cec66a457f6dfbccd9190fd8c692749601e5851940bfa102f898fef54851bc
4
- data.tar.gz: 403c84a578f8502522ee67d8238faf56bd0e68a6f795708ebbe08428c4aac441
3
+ metadata.gz: e4355114ebcb4402b53e97959a6c5a244b4758af7f7f0fbac28e8fd52a3d3865
4
+ data.tar.gz: 3f5f816dae19cdf3134280dc780eb47702331c7264ef791010b3eadd934cf19e
5
5
  SHA512:
6
- metadata.gz: 37e1fc899fc423b95b1a47a679f9a36de7526e50b7df5040edb67d39e79ef078ffab0f33f8ab24bd7c7db44df8b771843bbf7a14d1ea97656d85f1637bc6b037
7
- data.tar.gz: 3c07cee9ec91029b06efcd2edd4b7528df2555fb6b8d33a6e4782a9e8521eef6a15553b54b0f6005ea529d3877336d37234dc5fc82da533641796b2cc7ca25a5
6
+ metadata.gz: 6e712abd3e2cdea918dd30cfdd8590fbfba8dfaa89b7546030202f14de79520233246cde85cbae9ecce432afda8f16f7ada45b9a770fb86d0be0692a27ea15e9
7
+ data.tar.gz: a8ae0f8fd73f91cf14b920732b1c7b1bf6c5a7f551069f53aca3e79299e7afa9bc6c4799f5bd7f1580cba6927de957ecc622b349b1a609a614813b79e9ad694d
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
  [![forthebadge](https://forthebadge.com/images/badges/made-with-ruby.svg)](https://www.ruby-lang.org/en/)
3
3
  [![Gem Version](https://badge.fury.io/rb/bioroebe.svg)](https://badge.fury.io/rb/bioroebe)
4
4
 
5
- This gem was <b>last updated</b> on the <span style="color: darkblue; font-weight: bold">22.02.2024</span> (dd.mm.yyyy notation), at <span style="color: steelblue; font-weight: bold">13:34:05</span> o'clock.
5
+ This gem was <b>last updated</b> on the <span style="color: darkblue; font-weight: bold">09.04.2024</span> (dd.mm.yyyy notation), at <span style="color: steelblue; font-weight: bold">21:22:36</span> o'clock.
6
6
 
7
7
  # The Bioroebe Project
8
8
 
@@ -1,4 +1,28 @@
1
1
  --------------------------------------------------------------------------------
2
+ https://pepdraw.com/
3
+ ^^^ integrate this
4
+ --------------------------------------------------------------------------------
5
+ W D E N N M
6
+ NH2-Trp-Asp-Glu-Asn-Asn-Met-COOH
7
+
8
+ Nach dem genetischen Code wird dieses Hexa-
9
+ peptid von folgender DNA-Sequenz codiert:
10
+
11
+ to_aa TGG-GAT-GAA-AAT-AAT-ATG
12
+ to_aa TGG-GAC-GAG-AAC-AAC-ATG
13
+
14
+ to_codon W D E N N M
15
+
16
+ ^^^^ bioroebe: show_all_codons from commandline
17
+ AND document this also in the doc
18
+ es also 16 Oligonucleotide,
19
+ welche die Sequenz Trp-Asp-Glu-Asn-Asn-Met
20
+ codieren.
21
+
22
+ deduce WDENNM
23
+ ^^^^ show all of them!!!!
24
+ ^aka show ALL possible codons
25
+ --------------------------------------------------------------------------------
2
26
  add support for
3
27
 
4
28
  class Cell
@@ -162,13 +162,6 @@ class CommandlineApplication < Base # === Bioroebe::CommandlineApplication
162
162
 
163
163
  $VERBOSE = OLD_VERBOSE_VALUE # Reinstate the old verbosity level here.
164
164
 
165
- # ========================================================================= #
166
- # === one_to_three
167
- # ========================================================================= #
168
- def one_to_three(i)
169
- ::Bioroebe.one_to_three(i)
170
- end
171
-
172
165
  # ========================================================================= #
173
166
  # === extract (extract tag)
174
167
  #
@@ -677,4 +670,13 @@ class CommandlineApplication < Base # === Bioroebe::CommandlineApplication
677
670
  opnn; erev i
678
671
  end; alias opne opnerev # === opne
679
672
 
673
+ # ========================================================================= #
674
+ # === one_to_three
675
+ #
676
+ # Delegate towards Bioroebe.one_to_three().
677
+ # ========================================================================= #
678
+ def one_to_three(i)
679
+ ::Bioroebe.one_to_three(i)
680
+ end
681
+
680
682
  end; end
@@ -113,6 +113,9 @@ class DnaToAminoacidSequence < ::Bioroebe::CommandlineApplication # === Bioroebe
113
113
  when :be_quiet
114
114
  be_quiet
115
115
  run_already = DEFAULT_RUN_MODE
116
+ # ======================================================================= #
117
+ # === :do_not_run_yet
118
+ # ======================================================================= #
116
119
  when :do_not_run_yet
117
120
  run_already = false
118
121
  end
@@ -126,6 +129,10 @@ class DnaToAminoacidSequence < ::Bioroebe::CommandlineApplication # === Bioroebe
126
129
  super()
127
130
  set_use_frame_number(:one) # Default is reading frame number one.
128
131
  # ======================================================================= #
132
+ # === :use_a_spacer_between_the_aminoacids
133
+ # ======================================================================= #
134
+ @internal_hash[:use_a_spacer_between_the_aminoacids] = false
135
+ # ======================================================================= #
129
136
  # === @codon_table_dataset
130
137
  #
131
138
  # Obtain the codon table dataset next.
@@ -170,6 +177,13 @@ class DnaToAminoacidSequence < ::Bioroebe::CommandlineApplication # === Bioroebe
170
177
  @internal_hash[:colourize_stop_codons] = true
171
178
  end
172
179
 
180
+ # ========================================================================= #
181
+ # === use_a_spacer_between_the_aminoacids?
182
+ # ========================================================================= #
183
+ def use_a_spacer_between_the_aminoacids?
184
+ @internal_hash[:use_a_spacer_between_the_aminoacids]
185
+ end
186
+
173
187
  # ========================================================================= #
174
188
  # === colourize_stop_codons?
175
189
  # ========================================================================= #
@@ -299,16 +313,25 @@ class DnaToAminoacidSequence < ::Bioroebe::CommandlineApplication # === Bioroebe
299
313
  alias set_sequence set_result # === use_this_sequence=
300
314
 
301
315
  # ========================================================================= #
302
- # === report
316
+ # === do_show_this_reading_frame_header
317
+ # ========================================================================= #
318
+ def do_show_this_reading_frame_header(
319
+ i = @use_frame_number
320
+ )
321
+ e
322
+ coloured_frame = palegreen(
323
+ 'frame-'+one_two_or_three(i)
324
+ )+rev
325
+ e "#{rev}The #{coloured_frame}#{rev} sequence is: (#{sequence?.size} aminoacids)"
326
+ e
327
+ end
328
+
329
+ # ========================================================================= #
330
+ # === report (report tag)
303
331
  # ========================================================================= #
304
332
  def report
305
333
  if be_verbose?
306
- e
307
- coloured_frame = palegreen(
308
- 'frame-'+one_two_or_three(@use_frame_number)
309
- )+rev
310
- e "#{rev}The #{coloured_frame}#{rev} sequence is: (#{sequence?.size} aminoacids)"
311
- e
334
+ do_show_this_reading_frame_header(@use_frame_number)
312
335
  end
313
336
  do_report_the_reading_frame
314
337
  end
@@ -327,11 +350,15 @@ class DnaToAminoacidSequence < ::Bioroebe::CommandlineApplication # === Bioroebe
327
350
  if show_as_three_letter_aminoacid_sequence?
328
351
  i = one_to_three(i)
329
352
  end
353
+ if use_a_spacer_between_the_aminoacids?
354
+ splitted = i.split(//)
355
+ i = splitted.join('-')
356
+ end
330
357
  result = "#{lightgreen(i)}#{rev}"
331
358
  if colourize_stop_codons? and result.include?('*')
332
359
  result = result.dup if result.frozen?
333
360
  # ===================================================================== #
334
- # Colourize stop codons in orchid.
361
+ # Colourize stop codons in orchid colour.
335
362
  # ===================================================================== #
336
363
  result.gsub!(
337
364
  /\*/,
@@ -391,26 +418,39 @@ class DnaToAminoacidSequence < ::Bioroebe::CommandlineApplication # === Bioroebe
391
418
  else
392
419
  case i
393
420
  # ===================================================================== #
394
- # === Show a helpful ruler
421
+ # === Use a spacer token
422
+ #
423
+ # The default spacer token will be '-'.
395
424
  #
396
425
  # Usage example:
397
426
  #
398
- # dnatoaminoacidsequence AUGUUU --ruler
427
+ # dnatoaminoacidsequence ATGGCCGAGATTGTGCTGGAGCACGTCAACAAGAAT --spacer
399
428
  #
400
429
  # ===================================================================== #
401
- when /^-?-?ruler$/i
402
- do_show_ruler
430
+ when /^-?-?3(-|_| )?spacer$/i,
431
+ /^-?-?spacer$/i
432
+ @internal_hash[:use_a_spacer_between_the_aminoacids] = true
403
433
  # ===================================================================== #
404
434
  # === Show the aminoacids as three-letter code
405
435
  #
406
436
  # Usage example:
407
437
  #
408
- # dnatoaminoacidsequence AUGUUU --three-letter
438
+ # dnatoaminoacidsequence AUGUUUAAGCCGAAA --three-letter
409
439
  #
410
440
  # ===================================================================== #
411
441
  when /^-?-?three(-|_| )?letter$/i
412
442
  do_show_as_the_three_letter_aminoacid_sequence
413
443
  # ===================================================================== #
444
+ # === Show a helpful ruler
445
+ #
446
+ # Usage example:
447
+ #
448
+ # dnatoaminoacidsequence AUGUUU --ruler
449
+ #
450
+ # ===================================================================== #
451
+ when /^-?-?ruler$/i
452
+ do_show_ruler
453
+ # ===================================================================== #
414
454
  # === Show the help section
415
455
  #
416
456
  # Usage example:
@@ -65,6 +65,13 @@ class ParseCoordinates < ::Bioroebe::CommandlineApplication # === Bioroebe::Elec
65
65
  clear_coordinates
66
66
  end
67
67
 
68
+ # ========================================================================= #
69
+ # === clear_coordinates
70
+ # ========================================================================= #
71
+ def clear_coordinates
72
+ @array_coordinates = []
73
+ end
74
+
68
75
  # ========================================================================= #
69
76
  # === dataset?
70
77
  # ========================================================================= #
@@ -82,7 +89,7 @@ class ParseCoordinates < ::Bioroebe::CommandlineApplication # === Bioroebe::Elec
82
89
  i = DEFAULT_FILE if i.nil?
83
90
  i = i.to_s.dup
84
91
  if be_verbose?
85
- opnn; e "Next assigning to the file #{sfile(i)}."
92
+ opne "#{rev}Next assigning to the file #{sfile(i)}#{rev}."
86
93
  end
87
94
  @file = i
88
95
  end
@@ -139,17 +146,10 @@ class ParseCoordinates < ::Bioroebe::CommandlineApplication # === Bioroebe::Elec
139
146
  opnerev 'no file at `'+sfile(_)+'`.'
140
147
  else
141
148
  opnerev "We have #{sfancy(@array_coordinates.size.to_s)} "\
142
- "coordinates in #{sfile(_)}."
149
+ "#{rev}coordinates in #{sfile(_)}#{rev}."
143
150
  end
144
151
  end
145
152
 
146
- # ========================================================================= #
147
- # === clear_coordinates
148
- # ========================================================================= #
149
- def clear_coordinates
150
- @array_coordinates = []
151
- end
152
-
153
153
  # ========================================================================= #
154
154
  # === determine_coordinates
155
155
  # ========================================================================= #
@@ -68,7 +68,7 @@ class DownloadFasta < ::Bioroebe::CommandlineApplication # === Bioroebe::Downloa
68
68
  _ = log_dir?
69
69
  if !(return_pwd == _)
70
70
  if be_verbose
71
- opnn; e "Now changing directory to `#{sdir(_)}`."
71
+ opne "#{rev}Now changing directory to `#{sdir(_)}#{rev}`."
72
72
  end
73
73
  unless File.exist? _
74
74
  mkdir(_)
@@ -134,7 +134,7 @@ class DownloadFasta < ::Bioroebe::CommandlineApplication # === Bioroebe::Downloa
134
134
  url.include?('&id=WP_')
135
135
  match = url
136
136
  else
137
- opnn; e "We will use the URL `#{simp(url)}`"
137
+ opne "#{rev}We will use the URL `#{simp(url)}#{rev}`"
138
138
  remote_file_content = ''.dup # Our variable.
139
139
  # =================================================================== #
140
140
  # We store the content of the remote page in the variable called
@@ -164,7 +164,7 @@ class DownloadFasta < ::Bioroebe::CommandlineApplication # === Bioroebe::Downloa
164
164
  end
165
165
  end
166
166
  rescue Errno::ENOENT => error
167
- opnn; e tomato('We encountered an error, which we will feedback next.')
167
+ opne tomato('We encountered an error, which we will feedback next.')
168
168
  pp error
169
169
  match = url
170
170
  end
@@ -143,7 +143,7 @@ class Ncbi < ::Bioroebe::Base
143
143
  if target_id.start_with? 'http'
144
144
  use_this_url = target_id.dup
145
145
  elsif target_id.to_s.empty?
146
- opnn; e 'No target id was passed. Please provide an ID.'
146
+ opne 'No target id was passed. Please provide an ID.'
147
147
  exit
148
148
  else
149
149
  target_id = target_id.to_s
@@ -176,7 +176,7 @@ class Ncbi < ::Bioroebe::Base
176
176
  end
177
177
  end
178
178
  opnn; ::Bioroebe.erev 'We will use the following url: '
179
- opnn; e " #{::Colours.simp(use_this_url)}"
179
+ opne " #{::Colours.simp(use_this_url)}"
180
180
  # ======================================================================= #
181
181
  # Go to our log-directory.
182
182
  # ======================================================================= #
@@ -143,12 +143,12 @@ class HammingDistance < ::Bioroebe::CommandlineApplication
143
143
  notify_the_user = true if input?.empty?
144
144
  end
145
145
  if notify_the_user
146
- opnn; e 'Please provide input.'
147
- opnn; e
148
- opnn; e 'The two strings should be separated by a " ". Example:'
149
- opnn; e
150
- opnn; e simp(' AGUUCGAUGGAAAAT AGUCCGGUCGAAAAA')
151
- opnn; e
146
+ opne 'Please provide input.'
147
+ opne
148
+ opne 'The two strings should be separated by a " ". Example:'
149
+ opne
150
+ opne simp(' AGUUCGAUGGAAAAT AGUCCGGUCGAAAAA')
151
+ opne
152
152
  return
153
153
  end
154
154
  end
@@ -723,13 +723,15 @@ class Interactive < ::Bioroebe::CommandlineApplication # === Bioroebe::Taxonomy:
723
723
  # ========================================================================= #
724
724
  # === create_dirs
725
725
  # ========================================================================= #
726
- def create_dirs(be_verbose = false)
726
+ def create_dirs(
727
+ be_verbose = false
728
+ )
727
729
  case be_verbose
728
730
  when :be_verbose
729
731
  be_verbose = true
730
732
  end
731
733
  if be_verbose
732
- opnn; e 'We will create the temp directory and the download directory next.'
734
+ opne 'We will create the temp directory and the download directory next.'
733
735
  end
734
736
  ensure_that_temp_dir_exists
735
737
  ensure_that_download_dir_exists
@@ -1145,29 +1145,6 @@ EOF
1145
1145
  return result
1146
1146
  end
1147
1147
 
1148
- # ========================================================================= #
1149
- # === Bioroebe.one_to_three
1150
- #
1151
- # This method will convert from the one-aminoacid letter to the
1152
- # three-letter code.
1153
- #
1154
- # Usage example:
1155
- #
1156
- # Bioroebe.one_to_three('HIM') # => "His-Ile-Met"
1157
- #
1158
- # ========================================================================= #
1159
- def self.one_to_three(i)
1160
- if i.is_a? Array
1161
- i = i.join
1162
- end
1163
- inverted_hash = AMINO_ACIDS_THREE_TO_ONE.invert
1164
- chars = i.chars
1165
- result = chars.map {|one_aminoacid_letter|
1166
- inverted_hash[one_aminoacid_letter].capitalize+'-'
1167
- }.join
1168
- return result.chop
1169
- end
1170
-
1171
1148
  # ========================================================================= #
1172
1149
  # === Bioroebe.weight_of_this_aminoacid?
1173
1150
  #
@@ -4409,6 +4386,42 @@ EOF
4409
4386
  esystem "wget #{target}"
4410
4387
  end
4411
4388
 
4389
+ # ========================================================================= #
4390
+ # === Bioroebe.edit_C_to_U
4391
+ #
4392
+ # This method attempts to do a RNA editing job, such as may be done in
4393
+ # mitochondrial DNA.
4394
+ #
4395
+ # Usage examples:
4396
+ #
4397
+ # Bioroebe.edit_C_to_U('AGG-GGU-GCU-UCG-GAU-CGG-GAG') # => "AGGGGUGUUUUGGAUUGGGAG"
4398
+ # Bioroebe.edit_C_to_U('AGG-GGU-GCU-UCG-GAU-CGG-GAG', :retain_hyphens) # => "AGG-GGU-GUU-UUG-GAU-UGG-GAG"
4399
+ # Bioroebe.to_aa(Bioroebe.edit_C_to_U('AGG-GGU-GCU-UCG-GAU-CGG-GAG', false)) # => "AGG-GGU-GUU-UUG-GAU-UGG-GAG")
4400
+ #
4401
+ # ========================================================================= #
4402
+ def self.edit_C_to_U(
4403
+ of_this_sequence,
4404
+ retain_hyphens = false
4405
+ )
4406
+ case retain_hyphens
4407
+ # ======================================================================= #
4408
+ # === :retain_hyphens
4409
+ # ======================================================================= #
4410
+ when :retain_hyphens
4411
+ retain_hyphens = true
4412
+ end
4413
+ if of_this_sequence.is_a? Array
4414
+ of_this_sequence = of_this_sequence.first
4415
+ end
4416
+ if of_this_sequence.frozen?
4417
+ of_this_sequence = of_this_sequence.dup
4418
+ end
4419
+ unless retain_hyphens
4420
+ of_this_sequence.delete!('-') if of_this_sequence.include? '-'
4421
+ end
4422
+ of_this_sequence.tr('C','U')
4423
+ end
4424
+
4412
4425
  # ========================================================================= #
4413
4426
  # === Bioroebe.download
4414
4427
  # ========================================================================= #
@@ -5105,6 +5118,32 @@ EOF
5105
5118
  x # Return the cost here.
5106
5119
  end
5107
5120
 
5121
+ # ========================================================================= #
5122
+ # === Bioroebe.one_to_three
5123
+ #
5124
+ # This method will convert from the one-aminoacid letter to the
5125
+ # three-letter code.
5126
+ #
5127
+ # Usage example:
5128
+ #
5129
+ # Bioroebe.one_to_three('HIM') # => "His-Ile-Met"
5130
+ #
5131
+ # ========================================================================= #
5132
+ def self.one_to_three(
5133
+ i,
5134
+ use_this_as_join_token = '-' # Or it could be empty, for no-join token.
5135
+ )
5136
+ if i.is_a? Array
5137
+ i = i.join
5138
+ end
5139
+ inverted_hash = AMINO_ACIDS_THREE_TO_ONE.invert
5140
+ chars = i.chars
5141
+ result = chars.map {|one_aminoacid_letter|
5142
+ "#{inverted_hash[one_aminoacid_letter].capitalize}#{use_this_as_join_token}"
5143
+ }.join
5144
+ return result.chop
5145
+ end
5146
+
5108
5147
  end
5109
5148
 
5110
5149
  if __FILE__ == $PROGRAM_NAME
@@ -9,7 +9,7 @@ module Bioroebe
9
9
  # ========================================================================= #
10
10
  # === VERSION
11
11
  # ========================================================================= #
12
- VERSION = '0.13.31'
12
+ VERSION = '0.13.32'
13
13
 
14
14
  # ========================================================================= #
15
15
  # === LAST_UPDATE
@@ -17,7 +17,7 @@ module Bioroebe
17
17
  # This variable keeps track as to when the bioroebe project was last
18
18
  # updated. The notation is: DD.MM.YYYY
19
19
  # ========================================================================= #
20
- LAST_UPDATE = '22.02.2024'
20
+ LAST_UPDATE = '09.04.2024'
21
21
 
22
22
  # ========================================================================= #
23
23
  # === URL_TO_THE_DOCUMENTATION
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bioroebe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.31
4
+ version: 0.13.32
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert A. Heiler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-22 00:00:00.000000000 Z
11
+ date: 2024-04-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chemistry_paradise
@@ -954,7 +954,7 @@ post_install_message: |2+
954
954
 
955
955
  For more documentation, have a look at:
956
956
 
957
- https://www.rubydoc.info/gems/bioroebe/0.13.31
957
+ https://www.rubydoc.info/gems/bioroebe/0.13.32
958
958
 
959
959
  rdoc_options: []
960
960
  require_paths:
@@ -968,9 +968,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
968
968
  requirements:
969
969
  - - ">="
970
970
  - !ruby/object:Gem::Version
971
- version: 3.5.6
971
+ version: 3.5.7
972
972
  requirements: []
973
- rubygems_version: 3.5.6
973
+ rubygems_version: 3.5.7
974
974
  signing_key:
975
975
  specification_version: 4
976
976
  summary: 'This is the bioroebe-0.13.x release series. It is encouraged to use ruby