Class: Bioroebe::Shell

Inherits:
CommandlineApplication show all
Defined in:
lib/bioroebe/shell/menu.rb,
lib/bioroebe/shell/shell.rb,
lib/bioroebe/shell/readline.rb,
lib/bioroebe/shell/help/class.rb

Overview

Bioroebe::Shell

Defined Under Namespace

Classes: Help

Constant Summary collapse

TRUNCATE_AT_N_ELEMENTS =
#

TRUNCATE_AT_N_ELEMENTS

If we display nucleotide strings, then by default, these may be very long. So the following constant will act as a threshold.

#
2000
SHALL_WE_DEBUG =
#

SHALL_WE_DEBUG

#
false
RUBY_SRC =
"#{HOME_DIRECTORY_OF_USER_X}programming/ruby/src/"
BIOROEBE =
ENV['HOME']
FILE_USE_SILENT_STARTUP =
#

FILE_USE_SILENT_STARTUP

#
"#{::Bioroebe.project_base_directory?}shell/configuration/use_silent_startup.yml"
MAIN_EDITOR =

else assume that we may be on windows.

'notepad++.exe'
MY_EDITOR =

MY_EDITOR

MAIN_EDITOR
BIOSHELL_SAVE_FILE =
'/home/Temp/bioroebe/shell_file.md'
HOME_DIR =

This is valid at home.

home_dir+'.gem/gems/bioroebe-'+
Bioroebe.version?.to_s+'/lib/bioroebe/'
DEFAULT_PADDING =
#

DEFAULT_PADDING

#
'  '
COMPLETION_PROC =
#

COMPLETION_PROC

#
proc { |s|
  (ARRAY_WITH_COMPLETIONS.grep(/^#{Regexp.escape(s.to_s)}/)+
  self.return_entries_in_the_current_directory.map {|entry|
    (entry+'/').squeeze('/')
  }).flatten
}

Constants inherited from CommandlineApplication

CommandlineApplication::OLD_VERBOSE_VALUE

Constants included from ColoursForBase

ColoursForBase::ARRAY_HTML_COLOURS_IN_USE

Constants inherited from Base

Base::NAMESPACE

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from CommandlineApplication

#all_aminoacids?, #append_what_into, #at_home?, #be_silent, #be_verbose?, #cat, #ccliner, #change_directory, #cliner, #codon_table_dataset?, #codons_for?, #colourize_this_dna_sequence, #cp, #disable_warnings, #download_dir?, #editor?, #enable_warnings, #ensure_that_the_base_directories_exist, #esystem, #extract, #is_this_a_start_codon?, #is_this_a_stop_codon?, #load_bioroebe_yaml_file, #log_directory?, #one_letter_to_long_name, #one_to_three, #only_numbers?, #open_in_browser, #opnerev, #opnn, #pad_with_double_quotes, #pad_with_single_quotes, #partner_nucleotide, #remove_numbers, #remove_trailing_ansii_escape_code, #return_all_possible_start_codons, #return_array_of_one_letter_aminoacids, #return_cheerful_person, #return_chunked_display, #return_ubiquitin_sequence, #runmode?, #set_be_verbose, #set_runmode, #strict_filter_away_invalid_aminoacids, #taxonomy_download_directory?, #use_opn?, #verbose_truth, #was_or_were, #without_extname, #write_what_into

Methods included from BaseModule

#absolute_path, #default_file_read, #file_readlines

Methods included from CommandlineArguments

#commandline_arguments?, #commandline_arguments_that_are_files?, #first?, #first_non_hyphen_argument?, #remove_hyphens_from_the_commandline_arguments, #return_commandline_arguments_as_string, #return_commandline_arguments_that_are_not_files, #return_entries_without_two_leading_hyphens, #select_commandline_arguments, #select_entries_starting_with_two_hyphens, #set_commandline_arguments

Methods included from ColoursForBase

#colourize_this_aminoacid_sequence_for_the_commandline, #colourize_this_nucleotide_sequence, #disable_colours, #ecomment, #efancy, #egold, #enable_colours, #eorange, #eparse, #red, #remove_trailing_escape_part, #return_colour_for_nucleotides, #rev, #sdir, #set_will_we_use_colours, #sfancy, #sfile, #simp, #swarn, #use_colours?, #use_colours_within_the_bioroebe_namespace?

Methods inherited from Base

#append_what_into, #can_base_pair?, #convert_global_env, #delete_file, #directory_to_the_codon_tables?, #is_on_roebe?, #main_encoding?, #mkdir, #move_file, #mv, #no_file_exists_at, #project_yaml_directory?, #rds, #register_sigint, #return_the_first_line_of_this_file, #word_wrap, #write_what_into

Methods included from InternalHashModule

#internal_hash?, #reset_the_internal_hash

Methods included from InferTheNamespaceModule

#infer_the_namespace, #namespace?

Constructor Details

#initialize(commandline_arguments = ARGV, run_already = true) ⇒ Shell

#

initialize

#


186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
# File 'lib/bioroebe/shell/shell.rb', line 186

def initialize(
    commandline_arguments = ARGV,
    run_already           = true
  )
  reset # Must come first, to create @internal_hash.
  set_commandline_arguments(
    commandline_arguments
  )
  # ======================================================================= #
  # === Handle blocks next
  # ======================================================================= #
  if block_given?
    yielded = yield
    case yielded
    # ===================================================================== #
    # === :do_not_run_yet
    # ===================================================================== #
    when :do_not_run_yet
      run_already = false
    end
  end
  # ======================================================================= #
  # Intercept some important commandline arguments next. This must come
  # AFTER we invoked set_commandline_arguments().
  # ======================================================================= #
  case first?
  # ======================================================================= #
  # === no_colours
  #
  # This variant is different from the variant in menu() in that another
  # method will be called to disable the colours.
  #
  # Invocation example:
  #
  #   biosh --disable-colours
  #
  # ======================================================================= #
  when 'nocol',
       'noco',
       /^-?-?no(_|-| )?colou?rs?$/,
       /^-?-?disable(_|-| )?colours$/,
       'dcolours'
    disable_colours_in_an_extended_manner(:be_quiet)
  # ======================================================================= #
  # === bioroebe --help
  #
  # This entry-point will quickly show which options are available for
  # the bioshell.
  # ======================================================================= #
  when /^-?-?help$/
    show_commandline_options
  # ======================================================================= #
  # === bioshell --controller
  # ======================================================================= #
  when /^-?-?controller$/i
    require 'bioroebe/gui/gtk3/controller/controller.rb'
    ::Bioroebe.run_gtk_controller
    exit_program
  # ======================================================================= #
  # === bioshell --do-not-create-directories-on-startup
  # === bioshell --do-not-create-directories
  #
  # Do not create directories on startup.
  #
  # Invocation example:
  #
  #   bioshell --do-not-create-directories-on-startup
  #
  # ======================================================================= #
  when /^-?-?do(-|_| )?not(-|_| )?create(-|_| )?directories(-|_| )?on(-|_| )?startup$/i,
       /^-?-?do(-|_| )?not(-|_| )?create(-|_| )?directories$/i
    @internal_hash[:create_directories_on_startup_of_the_shell] = false
  # ======================================================================= #
  # === bioroebe --protein-to-dna
  #
  # This entry point will try to start the ruby-gtk3 protein-to-DNA
  # converting widget.
  # ======================================================================= #
  when /^-?-?protein(-|_| )?to(-|_| )?dna$/i
    require 'bioroebe/gui/gtk3/protein_to_DNA/protein_to_DNA.rb'
    ::Bioroebe::GUI::Gtk::ProteinToDNA.run_gtk3_widget
    exit
  # ======================================================================= #
  # === bioshell --permanently-disable-startup-intro
  # === bioshell --permanently-disable-startup-notice
  # === bioshell --permanently-no-startup-intro
  # === bioshell --permanently-no-startup-info
  # ======================================================================= #
  when /^-?-?permanently(-|_)?disable(-|_)?startup(-|_)?intro$/,
       /^-?-?permanently(-|_)?disable(-|_)?startup(-|_)?notice$/,
       /^-?-?permanently(-|_)?no(-|_)?startup(-|_)?intro$/,
       /^-?-?permanently(-|_)?no(-|_)?startup(-|_)?info$/
    permanently_disable_startup_intro
  # ======================================================================= #
  # === :no_commandline_arguments
  # ======================================================================= #
  when :no_commandline_arguments
    # ===================================================================== #
    # Simply pass through in this case.
    # ===================================================================== #
  # ======================================================================= #
  # === :exit_gracefully
  # ======================================================================= #
  when :exit_gracefully
    set_exit_gracefully
  # ======================================================================= #
  # === bioroebe --silent-startup
  # ======================================================================= #
  when /^-?-?silent(-|_)?startup$/,
       /^-?-?silent$/
    do_a_silent_startup
  # ======================================================================= #
  # === bioroebe --random-aminoacids=33
  # === bioroebe --n-aminoacids=33
  # ======================================================================= #
  when /^-?-?random(-|_)?aminoacids=(.+)$/i,
       /^-?-?n(-|_)?aminoacids=(.+)$/i
    n_aminoacids = $2.to_s.dup
    ::Bioroebe.create_random_aminoacids(n_aminoacids) { :do_report }
    exit
  # ======================================================================= #
  # === bioroebe --rnafold=cdna.MT.fa
  # ======================================================================= #
  when /^-?-?rnafold=(.+)$/
    try_to_run_rnalfold_on_this_file($1.to_s.dup)
    exit
  # ======================================================================= #
  # === bioroebe --fasta=/Depot/Bioroebe/Arabidopsis_thaliana_chromosome_5_sequence.fasta
  # ======================================================================= #
  when /^-?-?fasta=(.+)$/
    this_fasta_file = $1.to_s.dup
    if File.exist?
      handle_fasta(this_fasta_file)
    else
      e 'No file could be found at `'+sfile(this_fasta_file)+'`.'
    end
  # ======================================================================= #
  # === bioroebe --n-fasta-entries
  #
  # Usage example:
  #
  #   cd /root/Bioroebe/Downloads/; bioroebe --n-fasta-entries
  #
  # ======================================================================= #
  when /^-?-?n(-|_)?fasta(-|_)?entries$/
    require 'bioroebe/fasta/display_how_many_fasta_entries_are_in_this_directory.rb'
    ::Bioroebe::DisplayHowManyFastaEntriesAreInThisDirectory.new
    exit
  # ======================================================================= #
  # === bioroebe --split-this-fasta-file-into-chromosomes=Mus_musculus.GRCm38.ncrna.fa
  # ======================================================================= #
  when /^-?-?split(-|_)?this(-|_)?fasta(-|_)?file(-|_)?into(-|_)?chromosomes=(.+)$/i # $6
    _ = $6.to_s.dup
    require 'bioroebe/fasta/split_this_fasta_file_into_chromosomes/split_this_fasta_file_into_chromosomes.rb'
    ::Bioroebe::SplitThisFastaFileIntoChromosomes.new(_)
    exit
  # ======================================================================= #
  # === bioroebe --stats
  #
  # This entry-point will show some simple fasta-statistics, from
  # the current directory.
  #
  # Usage example:
  #
  #   cd /root/Bioroebe/Downloads/; bioroebe --stats
  #
  # ======================================================================= #
  when /^-?-?stats$/i,
       /^-?-?statistics$/i,
       /^-?-?fasta(-|_)?stats$/i
    require 'bioroebe/fasta/show_fasta_statistics.rb'
    ::Bioroebe.show_fasta_statistics(Dir['*'])
    exit
  # ======================================================================= #
  # === bioroebe --download=ftp://ftp.ensembl.org/pub/release-92/gtf/mus_musculus/
  #
  # This entry point allows us to download a remote program.
  #
  # Invocation example:
  #
  #   bioroebe --download=ftp://ftp.ensembl.org/pub/release-92/gtf/mus_musculus/
  #   bioroebe --download ftp://ftp.ensembl.org/pub/release-92/gtf/mus_musculus/
  #
  # Note that the second variant currently (April 2020) does not work -
  # let's see if we need it again in the future.
  # ======================================================================= #
  when /^-?-?download=(.+)/
    ::Bioroebe.download($1.to_s.dup)
  # ======================================================================= #
  # === bioroebe --sequence=150
  #
  # This entry point allows us to use any sequence, on startup.
  #
  # Invocation example:
  #
  #   bioroebe --sequence=1505
  #
  # ======================================================================= #
  when /^-?-?sequence (.+)/,
       /^-?-?sequence=(.+)/
    set_dna($1.to_s.dup, :be_quiet) # Be quiet here when doing the assignment.
  # ======================================================================= #
  # === bioroebe --show-exon-statistics-for=/tmp/praktikum/Mouse/chromosome_8/parsed/cdna.8.L100.global.gtf
  # ======================================================================= #
  when /^-?-?show(-|_)?exon(-|_)?statistics(-|_)?for=(.+)$/ # === $4
    ::Bioroebe.show_exon_statistics($4.to_s.dup)
    exit
  # ======================================================================= #
  # === bioroebe --sinatra
  # ======================================================================= #
  when /^-?-?sinatra$/i
    do_start_the_sinatra_interface
    return
  end
  run if run_already
end

Class Method Details

.[](i = ARGV) ⇒ Object

#

Bioroebe::Shell[]

#


11902
11903
11904
# File 'lib/bioroebe/shell/shell.rb', line 11902

def self.[](i = ARGV)
  new(i)
end

.colour?Boolean

#

Bioroebe::Shell.colour?

Query-method over @default_colour.

#

Returns:

  • (Boolean)


140
141
142
# File 'lib/bioroebe/shell/shell.rb', line 140

def self.colour?
  @default_colour
end

.generate_pdf_tutorial(also_upload_the_tutorial = true) ⇒ Object

#

Bioroebe::Shell.generate_pdf_tutorial

You can use this method to simply generate a new .pdf file, then upload it anyway.

#


11850
11851
11852
11853
11854
11855
11856
11857
11858
11859
11860
11861
11862
11863
11864
11865
11866
11867
11868
11869
# File 'lib/bioroebe/shell/shell.rb', line 11850

def self.generate_pdf_tutorial(
    also_upload_the_tutorial = true
  )
  url = ::Bioroebe.try_to_pass_through_beautiful_url('bioroebe_tutorial?pdf')
  url = url.first if url.is_a? Array
  url.gsub!(/^\/home\/x\/data\//, LOCALHOST) if url.include? HOME_DIRECTORY_OF_USER_X+'data/'
  OpenURI.send(:open, url)
  # ======================================================================= #
  # === Designate where the tutorial can be found locally
  # ======================================================================= #
  path = FILE_BIOROEBE_TUTORIAL
  if also_upload_the_tutorial
    if File.exist? path
      ::Bioroebe.upload_this_pdf_file(path)
    else
      e "Can not upload from #{sfile(path.to_s)} as this "\
        "path does not exist."
    end
  end
end
#

Bioroebe::Shell.menu

To test this, try:

Bioroebe::Shell.menu('ll')
#


11840
11841
11842
# File 'lib/bioroebe/shell/shell.rb', line 11840

def self.menu(i = ARGV)
  new(:no_commandline_arguments).menu(i)
end

.return_entries_in_the_current_directoryObject

#

Bioroebe::Shell.return_entries_in_the_current_directory

#


46
47
48
# File 'lib/bioroebe/shell/readline.rb', line 46

def self.return_entries_in_the_current_directory
  Dir['*']
end

.set_colour(i) ⇒ Object

#

Bioroebe::Shell.set_colour

Set the default colour here.

#


157
158
159
# File 'lib/bioroebe/shell/shell.rb', line 157

def self.set_colour(i)
  @default_colour = i
end

.upload_this_pdf_file(path) ⇒ Object

#

Bioroebe::Shell.upload_this_pdf_file

Use this method to upload the .pdf tutorial or any other .pdf file. This is primarily useful on my home system and may have very little value to other people.

#


1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
# File 'lib/bioroebe/shell/shell.rb', line 1892

def self.upload_this_pdf_file(path)
  # ======================================================================= #
  # ^^^ This will have generated the .pdf.
  # ======================================================================= #
  # Hardcoded for now where the .pdf will reside.
  # ======================================================================= #
  if Object.const_defined? :FtpParadise
    ftp = FtpParadise.new(:shevy, :dont_run_yet)
    ftp.
    ftp.upload_this_binary_file(path)
    e 'Finished uploading!'
  end
end

Instance Method Details

#aa_to_dna(i) ⇒ Object

#

aa_to_dna

#


10774
10775
10776
10777
10778
10779
10780
10781
10782
10783
# File 'lib/bioroebe/shell/shell.rb', line 10774

def aa_to_dna(i)
  if i.is_a? Array
    i = i.join.strip
  end
  i = ::Bioroebe.aa_to_dna(i)
  if i.is_a? Array
    i = i.join.strip
  end
  e i
end

#add_his_tag(i = 'add 6 random his tags') ⇒ Object

#

add_his_tag

This method can be used to add a his tag. By default we will add 6 Histidin tags in succession. This pattern is commonly found in expression vectors.

These histidin tags will be randomly placed within the DNA sequence, by default. Note that CAT and CAC code for Histidin. In most vectors, there is an alternation between these codons.

#


8987
8988
8989
8990
8991
8992
8993
8994
8995
8996
8997
8998
8999
9000
# File 'lib/bioroebe/shell/shell.rb', line 8987

def add_his_tag(
    i = 'add 6 random his tags'
  )
  n_his_tags_to_add = i.scan(/\d+/).first
  position = rand(main_sequence?.size)+1
  e 'Next adding '+sfancy(n_his_tags_to_add)+rev+
    ' Histidin tags to our main sequence at nucleotide '\
    'position '+sfancy(position.to_s)+rev+'.'
  _ = main_sequence?
  _.insert_at_this_position(
    position+1, 'CAC|CAT|CAC|CAT|CAC|CAT' # Insert the His tag here.
  )
  assign_this_dna_sequence(_.to_str)
end

#add_n_nucleotidesObject

#

add_to_start

Use this method to add to the start of a nucleotide sequence. In other words, to prepend to the main nucleotide sequence.

#

add_n_nucleotides



6922
6923
6924
# File 'lib/bioroebe/shell/shell.rb', line 6922

def add_to_start(i)
  add_to_start_or_end(i, :to_start)
end

#add_poly_a_sequenceObject

#

add_poly_a_sequence

Use this method to tag a PolyA sequence to the 3’ end of a mRNA.

First, the mRNA will be cleaved by the enzyme CPSF, usually at the sequence AAUAAA (most common one, but variants exist). AAUAAA is found in 90% of all sequenced polyadenylation elements.

#


5660
5661
5662
5663
# File 'lib/bioroebe/shell/shell.rb', line 5660

def add_poly_a_sequence
  this_sequence = 'A' * 250
  @internal_hash[:rna].append(this_sequence)
end

#add_the_current_user_input_to_the_historyObject

#

add_the_current_user_input_to_the_history

#


4901
4902
4903
4904
4905
4906
4907
4908
# File 'lib/bioroebe/shell/shell.rb', line 4901

def add_the_current_user_input_to_the_history
  # ======================================================================= #
  # And add the user-input to the array that keeps track of it. This
  # has to be done through a specific method, which can do additional
  # checks before adding the user-input onto the history.
  # ======================================================================= #
  add_to_history(user_input?)
end

#add_timer_snapshotObject

#

add_timer_snapshot

#


8915
8916
8917
# File 'lib/bioroebe/shell/shell.rb', line 8915

def add_timer_snapshot
  array_timer_snapshots? << Time.now
end

#add_to_end(i) ⇒ Object Also known as: add

#

add_to_end

This method will invoke append() if something has to be appended.

#


6027
6028
6029
# File 'lib/bioroebe/shell/shell.rb', line 6027

def add_to_end(i)
  add_to_start_or_end(i, :end)
end

#add_to_history(i = user_input? ) ⇒ Object Also known as: append_this_onto_the_history

#

add_to_history

This method should be used consistently whenever content is added onto the history of the bioshell. Content in this context refers primarily to user-submitted input.

#


7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
# File 'lib/bioroebe/shell/shell.rb', line 7322

def add_to_history(
    i = user_input?
  )
  if i.is_a? Array
    i.each {|entry| add_to_history(entry) }
  else
    i = i.to_s.chomp
    unless i.empty?
      if array_history? and array_history?.respond_to?(:last)
        last_history_element = array_history?.last # <- On startup there is no history, hence this check as safeguard.
        if last_history_element
          unless (last_history_element.strip == i.strip) # Only add if it is new input.
            array_history? << i
            if log_user_input?
              what = "#{i}#{N}"
              into = "#{bioshell_log_dir?}input_history.yml"
              append_what_into(what, into)
            end
          end
        else # This clause is valid for new entries.
          array_history? << i
        end
      end
    end
  end
end

#add_to_start(i) ⇒ Object Also known as: left_add

#

add_to_start

#


6920
6921
6922
# File 'lib/bioroebe/shell/shell.rb', line 6920

def add_to_start(i)
  add_to_start_or_end(i, :to_start)
end

#add_to_start_or_end(i = '', append_or_prepend = :append) ⇒ Object

#

add_to_start_or_end

This method can either add to the start or to the end.

The default is to append to the nucleotide sequence.

We can input a number - in this case, we simply add these many nucleotides onto the main string.

#


10311
10312
10313
10314
10315
10316
10317
10318
10319
10320
10321
10322
10323
10324
10325
10326
10327
10328
10329
10330
10331
10332
10333
10334
10335
10336
10337
10338
10339
10340
10341
10342
10343
10344
10345
10346
10347
10348
10349
10350
10351
10352
10353
10354
10355
10356
10357
10358
10359
10360
10361
10362
10363
10364
10365
10366
10367
10368
10369
10370
10371
10372
10373
10374
10375
10376
10377
10378
10379
10380
10381
10382
10383
10384
10385
# File 'lib/bioroebe/shell/shell.rb', line 10311

def add_to_start_or_end(
    i                 = '',
    append_or_prepend = :append
  )
  if the_main_sequence_is_frozen?
    report_that_the_main_sequence_is_frozen
    return
  end
  i = i.join('') if i.is_a? Array
  i = i.dup
  old_length = i.size
  case i.to_s # Easier start/stop entries.
  # ======================================================================= #
  # === Add a start codon.
  # ======================================================================= #
  when 'start',
       'START',
       /ORF/i,
       ':start'
    i = ::Bioroebe.start_codon? # Used to be hardcoded -> 'ATG'
  # ======================================================================= #
  # === Add a stop codon.
  # ======================================================================= #
  when /^stop$/i,
       ':stop'
    i = ::Bioroebe.stop_codons?.sample
  end
  i = i.dup if i.frozen?
  i.upcase!
  case append_or_prepend
  # ======================================================================= #
  # === :prepend
  # ======================================================================= #
  when :prepend,
       :to_start,
       :start
    if i =~ /^\d+$/ # If input is only numbers.
      erev 'Only numbers were given: Prepending '+
            sfancy(i.to_s)+rev+
           ' random nucleotides to the main string now.'
      i.to_i.times { prepend(add_nucleotide) }
    else
      erev "Prepending #{sfancy(i)}#{rev} to the main string."
      prepend(i)
    end
  # ======================================================================= #
  # === :append
  # ======================================================================= #
  when :append,
       :to_end,
       :end
    if i =~ /^\d+$/ # If input is only numbers.
      erev "Only numbers were given: Adding #{sfancy(i.to_s)}#{rev}"\
           " random nucleotides to the main string now."
      i.to_i.times { append(return_random_nucleotide) }
    else
      if only_nucleotides?(i)
        msg = "Adding #{sfancy(i)}#{rev}"
        msg = msg.dup if msg.frozen?
        if ::Bioroebe.is_a_stop_codon? i
          msg << ' (a stop codon)'
        end
        msg << ' to the main string.'
        erev msg
      end
      append(i)
    end
  end
  new_length = string?.size.to_s
  unless new_length.to_i == old_length.to_i
    erev "The new length of the main string is now: "\
         "#{simp(new_length)}#{rev}."
  end
  show_dna_sequence
end

#add_vertical_barrier_to_sequence(i = dna_sequence? ) ⇒ Object

#

add_vertical_barrier_to_sequence

This will turn a sequence such as “ATGCCC” into “ATG|CCC”.

Invocation example:

barrier ATGCCC
#


10957
10958
10959
10960
10961
10962
10963
10964
10965
# File 'lib/bioroebe/shell/shell.rb', line 10957

def add_vertical_barrier_to_sequence(
    i = dna_sequence?
  )
  i = i.join if i.is_a? Array
  i = dna_sequence? if i.nil?
  splitted = i.scan(/.../)
  joined = splitted.join('|')
  e joined
end

#adenin?Boolean

#

adenin?

This will return e. g. “C5H5N5”.

#

Returns:

  • (Boolean)


8318
8319
8320
# File 'lib/bioroebe/shell/shell.rb', line 8318

def adenin?
  YAML.load_file(FILE_NUCLEOTIDES)['Adenin']
end

#align_ORFS(i = dna_string? ) ⇒ Object

#

align_ORFS

This method is used to align all intrinsic ORFs of agiven sequence.

We delegate into class AlignOpenReadingFrames for the output.

#


2136
2137
2138
2139
2140
2141
# File 'lib/bioroebe/shell/shell.rb', line 2136

def align_ORFS(
    i = dna_string?
  )
  i = dna_string? if i.nil?
  ::Bioroebe::AlignOpenReadingFrames.new(i) # bl $BIOROEBE/align_open_reading_frames.rb
end

#all_arguments?Boolean Also known as: a?

#

all_arguments? (a? tag)

#

Returns:

  • (Boolean)


7446
7447
7448
# File 'lib/bioroebe/shell/shell.rb', line 7446

def all_arguments?
  @internal_hash[:all_arguments]
end

#all_upcase?(i) ⇒ Boolean Also known as: is_all_upcase?

#

all_upcase?

Return true if the input is all upcased.

#

Returns:

  • (Boolean)


6751
6752
6753
6754
# File 'lib/bioroebe/shell/shell.rb', line 6751

def all_upcase?(i)
  return true if i.upcase == i
  return false
end

#analyze(i = sequence? ) ⇒ Object

#

analyze (analyze tag)

The input to this method should be the DNA or aminoacid sequence.

#


6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
# File 'lib/bioroebe/shell/shell.rb', line 6693

def analyze(
    i = sequence?
  )
  if i.is_a? Array
    i << sequence? if i.empty?
    i = i.join
  end
  # ======================================================================= #
  # We require a String past this point.
  # ======================================================================= #
  i = i.to_s
  if File.exist? i # Assume that we have a .pdb file here for now.
    parse_this_pdb_file(i)
  else
    if block_given?
      yielded = yield
      case yielded
      when :dna # Handle DNA "input" here.
        analyze_dna_string(i)
      else
        do_analyze_sequence(i)
      end
    else # Default case without block.
      do_analyze_sequence(i)
    end
  end
end

#analyze_dna_string(i = dna_string? ) ⇒ Object

#

analyze_dna_string

This method presently only counts the amount of nucleotides found in the given DNA string at hand.

We use the class Bioroebe::CountAmountOfNucleotides, in bl count_amount_of_nucleotides.rb

#


8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
# File 'lib/bioroebe/shell/shell.rb', line 8138

def analyze_dna_string(
    i = dna_string?
  )
  # ======================================================================= #
  # Set some default values:
  # ======================================================================= #
  i = dna_string? if i.nil?
  if i.is_a? Array and i.empty?
    i = dna_string?
  end
  ::Bioroebe::CountAmountOfNucleotides.new(
    i, :use_cliner
  ) {{ use_colours: use_colours? }} # bl $BIOROEBE/count_amount_of_nucleotides.rb
end

#annotate_this_file(i) ⇒ Object

#

annotate_this_file

#


9293
9294
9295
# File 'lib/bioroebe/shell/shell.rb', line 9293

def annotate_this_file(i)
  ::Bioroebe::CreateAnnotationFormat.new(i)
end

#append(i) ⇒ Object

#

append (append tag)

You can use this to simply append to the main string.

#


3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
# File 'lib/bioroebe/shell/shell.rb', line 3388

def append(i)
  i = i.join.strip if i.is_a? Array
  i = i.to_s
  # ======================================================================= #
  # First check whether the main sequence is frozen:
  # ======================================================================= #
  if is_the_main_sequence_frozen?
    report_that_the_main_sequence_is_frozen
  else
    case i # case tag
    # ===================================================================== #
    # === start
    # ===================================================================== #
    when 'start'
      i = ::Bioroebe.start_codon?
      erev 'We will append the START codon '+sfancy(i)+rev+' next.'
    # ===================================================================== #
    # === stop
    #
    # Add a random stop-codon in this case.
    # ===================================================================== #
    when 'stop'
      i = ::Bioroebe.stop_codons?.sample
      erev 'We will append the STOP codon '+sfancy(i)+rev+' next.'
    when 'shine'
      i = 'AGGAGGT' # Can only add nucleotides to the main sequence.
      erev 'We will append the '+mediumslateblue('Shine Dalgarno')+
           rev+' (SD) sequence '+sfancy("#{i}-3")+rev+' next.'
    end
    if i =~ /^\d+$/ # If input is only numbers.
        erev "Only numbers were given: Adding #{sfancy(i.to_s)}#{rev}"\
             " random nucleotides to the main string next."
      new_string = ''.dup
      i.to_i.times { new_string << return_random_nucleotide }
      i = new_string
    end
    # ===================================================================== #
    # === Check that we add only DNA or RNA nucleotides past this point
    # ===================================================================== #
    if only_nucleotides?(i)
      erev "Now appending #{simp(i)}#{rev}."
      sequence_object? << i # Next, append to the sequence object here.
      show_DNA_sequence
    else
      # ===================================================================== #
      # The user may also wish to append a restriction site, such
      # as via add EcoRI. We need to enable this here.
      # ===================================================================== #
      _ = ::Bioroebe.return_sequence_that_is_cut_via_restriction_enzyme(i, :no_colours)
      if _
        _.tr!('|','')
        erev "Now appending #{simp(_)}#{rev}."
        sequence_object? << _ # Next, append to the sequence object here.
        show_dna_sequence
      else
        erev 'Can not add the sequence '+simp(i)+rev+' because there '\
             'are non-nucleotides in it.'
      end
    end
  end
end

#array_fasta?Boolean

#

array_fasta?

#

Returns:

  • (Boolean)


9953
9954
9955
# File 'lib/bioroebe/shell/shell.rb', line 9953

def array_fasta?
  @internal_hash[:array_fasta]
end

#array_history?Boolean

#

array_history?

Access the input-history of the bioshell.

#

Returns:

  • (Boolean)


5145
5146
5147
# File 'lib/bioroebe/shell/shell.rb', line 5145

def array_history?
  @internal_hash[:array_history]
end

#array_timer_snapshots?Boolean

#

array_timer_snapshots?

#

Returns:

  • (Boolean)


8922
8923
8924
# File 'lib/bioroebe/shell/shell.rb', line 8922

def array_timer_snapshots?
  @internal_hash[:array_timer_snapshots]
end

#assign_sequence2(i) ⇒ Object

#

assign_sequence2

#


7468
7469
7470
7471
# File 'lib/bioroebe/shell/shell.rb', line 7468

def assign_sequence2(i)
  i = i.join(' ') if i.is_a? Array
  @internal_hash[:sequence2] = Bioroebe::Sequence.new(i)
end

#assume_what_type_this_is(i) ⇒ Object

#

assume_what_type_this_is

Determine what type the given input is.

Note that this currently has limitations in that it does not use a statistical way to determine whether we really have DNA/RNA/Aminoacids here.

Eventually we will write a replacement for it but for now, it has to suffice.

To test this method interactively, do this in the shell:

assume ATCG
assume AUCG
assume NNNLMMLLAAA
#


7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
# File 'lib/bioroebe/shell/shell.rb', line 7232

def assume_what_type_this_is(i)
  if i.is_a? Array
    i = i.join
  end
  if i
    chars = i.chars
    if    chars.all? {|entry| POSSIBLE_DNA_NUCLEOTIDES.include? entry }
      erev 'This must be a DNA sequence.'
    elsif chars.all? {|entry| POSSIBLE_RNA_NUCLEOTIDES.include? entry }
      erev 'This must be a RNA sequence.'
    elsif chars.all? {|entry| POSSIBLE_AMINO_ACIDS.include? entry }
      erev 'This must be an amino acid sequence.'
    else
      erev 'This can not be a valid sequence ('+
            simp('DNA/RNA/Proteins')+rev+').'
    end
  else
    erev 'Missing an input such as '+sfancy('ATCG')+rev+'.'
  end
end

#attempt_to_discover_dna_A_boxesObject

#

attempt_to_discover_dna_A_boxes

#


7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
# File 'lib/bioroebe/shell/shell.rb', line 7081

def attempt_to_discover_dna_A_boxes
  dna_A_box_sequence = 'TTATCCACA'
  erev 'The dnaA box in E. coli has this consensus sequence:'
  e
  efancy "  #{dna_A_box_sequence}#{rev}"
  e
  unless string?.empty?
    results = string?.scan(/#{dna_A_box_sequence}/)
    if results.empty?
      erev 'The given DNA sequence does not contain any dnaA sequence elements.'
    else
      erev 'This sequence can be found '+simp(results.size.to_s)+rev+' times.'
      pp results
    end
  end if dna_sequence?
end

#automatically_rename_this_fasta_file(i) ⇒ Object

#

automatically_rename_this_fasta_file

#


6818
6819
6820
6821
6822
# File 'lib/bioroebe/shell/shell.rb', line 6818

def automatically_rename_this_fasta_file(i)
  [i].flatten.compact.each {|this_fasta_file|
    Bioroebe.automatically_rename_this_fasta_file(this_fasta_file)
  }
end

#backtranseq(i = aminoacid_sequence?, , output_as_dna_or_rna = :dna) ⇒ Object Also known as: translate_aminoacids_into_dna

#

backtranseq

Translate an Aminoacid Sequence back into the most likely DNA sequence that would code for this sequence/protein. Thus, this method translates from Aminoacids to DNA sequence - in other words it does a “reverse-lookup”.

Currently, we hardcode to the homo sapiens frequency codon table, but at a later time, we will probably change to a more flexible layout, to allow a backtranseq for more organisms.

#


4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
# File 'lib/bioroebe/shell/shell.rb', line 4965

def backtranseq(
    i                    = aminoacid_sequence?,
    output_as_dna_or_rna = :dna
  )
  sequence = ConvertAminoacidToDNA[i].to_str.delete('-')
  erev lpad?+
       leading_five_prime+
       sfancy(sequence)+
       rev+
       trailing_three_prime
  erev 'Note that we have also assigned the above to be the new DNA sequence.'
  assign_sequence(sequence, :be_silent)
end

#bioshell_log_dir?Boolean

#

bioshell_log_dir?

This method will return where the bioshell/ log dir is kept.

#

Returns:

  • (Boolean)


9720
9721
9722
# File 'lib/bioroebe/shell/shell.rb', line 9720

def bioshell_log_dir?
  "#{log_dir?}bioshell/"
end

#bisulfite(i) ⇒ Object

#

bisulfite

#


5709
5710
5711
# File 'lib/bioroebe/shell/shell.rb', line 5709

def bisulfite(i)
  return ::Bioroebe.bisulfite_treatment(i)
end

#calculate_atp_cost_for(i = aminoacid_sequence?) ) ⇒ Object

#

calculate_atp_cost_for

This method can be used to calculate the ATP cost in order to synthesize a protein.

#


7259
7260
7261
7262
7263
7264
# File 'lib/bioroebe/shell/shell.rb', line 7259

def calculate_atp_cost_for(i = aminoacid_sequence?)
  i = i.join.strip if i.is_a? Array
  if i.nil?
    i = aminoacid_sequence?
  end
end

#calculate_exponential_growth(a, b) ⇒ Object

#

calculate_exponential_growth

#


6445
6446
6447
# File 'lib/bioroebe/shell/shell.rb', line 6445

def calculate_exponential_growth(a, b)
  erev ::Bioroebe.calculate_exponential_growth(a,b)
end

#calculate_hamming_distance_of(i) ⇒ Object

#

calculate_hamming_distance_of

We will delegate into class HammingDistance here.

The argument to this method should ideally be an Array.

To test this method, do:

hamming AGUUCGAUGG AGUCCGGUCG
hamming AGUUCGAUGGGGGGGTTT AGUCCGGUCGGGG
random 100; setseq2 hamming 1 2
#


5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
# File 'lib/bioroebe/shell/shell.rb', line 5847

def calculate_hamming_distance_of(i)
  if i.is_a? String
    if i.include? ' ' and i =~ /^\d+/ # The String could be "1 3" here, for instance.
      splitted = i.split(' ').map(&:strip)
      case splitted.size
      when 2 # If we have at least 2 entries.
        splitted[-1] = return_sequence_from_this_number(splitted[-1])
        splitted[0]  = return_sequence_from_this_number(splitted[0])
        i = splitted.join(' ')
      end
    end
  end
  ::Bioroebe::HammingDistance[i] # bl $BIOROEBE/hamming*rb
end

#calculate_melting_temperature(i) ⇒ Object

#

calculate_melting_temperature

This method just delegates towards class CalculateMeltungTemperature.

#


6000
6001
6002
6003
6004
6005
6006
6007
# File 'lib/bioroebe/shell/shell.rb', line 6000

def calculate_melting_temperature(i)
  i = string? if i.nil?
  if i == :show_formulas
    CalculateMeltingTemperature.show_formulas # bl $BIOROEBE/calculate_melting_temperature.rb
  else
    @_.calculate_melting_temperature(i)
  end
end

#calculate_time_differenceObject

#

calculate_time_difference

#


8929
8930
8931
# File 'lib/bioroebe/shell/shell.rb', line 8929

def calculate_time_difference
  (@internal_hash[:array_timer_snapshots][-2] - @internal_hash[:array_timer_snapshots][-1]) 
end

#calculcate_at_content(i = dna_sequence? ) ⇒ Object

#

calculcate_at_content

Calculate the AT content of a DNA or RNA sequence.

Usage examples:

set_dna ATGCGCGCGCGAACGATGCATGACTGCTAGTCGACA; calc_at_content
calc_at_content AAAGGG
#


738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
# File 'lib/bioroebe/shell/shell.rb', line 738

def calculcate_at_content(
    i = dna_sequence?
  )
  if i.is_a? Array
    i = i.first
  end
  i = dna_sequence? if i.nil?
  i.upcase!
  total = i.size
  n_A = i.count('A')
  n_T = i.count('T')
  result = ( (n_A + n_T) * 100 ) / total
  erev 'The AT content of this sequence is '+
        simp(result.to_s)+rev+' %.'
end

#calculcate_gc_content(i = dna_sequence_as_string? ) ⇒ Object

#

calculcate_gc_content

Use this method to calculate the GC content of a DNA sequence.

If you need the number, you can use this piece of code:

CalculateGCContent.gc_percentage(i) # Will return the percentage number.
#


943
944
945
946
947
948
949
950
# File 'lib/bioroebe/shell/shell.rb', line 943

def calculcate_gc_content(
    i = dna_sequence_as_string?
  )
  if i.nil? or i.empty? # The second check also checks for empty Arrays.
    i = dna_sequence_as_string? # bl $BIOROEBE/calculate/calculate_gc_content.rb
  end
  CalculateGCContent.new(i)
end

#change_first_nucleotide_to(i = dna_sequence? ) ⇒ Object

#

change_first_nucleotide_to

This will only work if we had already assigned a DNA sequence prior to running it.

#


5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
# File 'lib/bioroebe/shell/shell.rb', line 5599

def change_first_nucleotide_to(
    i = dna_sequence?
  )
  i = i.join(' ').strip if i.is_a? Array
  unless i.empty?
    i = i.upcase
    erev "Now changing the first nucleotide to `#{simp(i)}`."
    sequence?.first_nucleotide = i
    show_string
  end
end

#chdir(i = :default) ⇒ Object Also known as: cd

#

chdir (cd tag)

#


9995
9996
9997
9998
9999
10000
10001
10002
10003
10004
10005
10006
10007
10008
10009
10010
10011
10012
10013
10014
10015
10016
10017
10018
10019
10020
10021
# File 'lib/bioroebe/shell/shell.rb', line 9995

def chdir(
    i = :default
  )
  if i and i.start_with?('cd ')
    i[0,3] = ''
  end
  case i
  # ======================================================================= #
  # === :home
  # ======================================================================= #
  when :home,
       ':home'
    i = log_dir?
  # ======================================================================= #
  # === :default
  # ======================================================================= #
  when :default,
       nil
    i = File.expand_path('~').to_s
  end
  if File.directory? i
    ::Bioroebe.change_directory(i)
  else
    e "No directory at #{sdir(File.absolute_path(i))}#{rev} "\
      "appears to exist."
  end
end

#check_for_local_vectorsObject

#

check_for_local_vectors

#


3067
3068
3069
3070
3071
3072
# File 'lib/bioroebe/shell/shell.rb', line 3067

def check_for_local_vectors
  _ = return_available_vectors
  unless _.empty? # Silent assignment comes next.
    set_sequence_2(::Bioroebe::Sequence.sequence_from_file(_.first))
  end
end

#check_for_mismatchesObject

#

check_for_mismatches

#


5206
5207
5208
# File 'lib/bioroebe/shell/shell.rb', line 5206

def check_for_mismatches
  CheckForMismatches.new
end

#chop(i = 1, chop_from_left_or_right_hand_side = :default) ⇒ Object Also known as: remove_n_nucleotides

#

chop (chop tag)

We use this method to get rid of some nucleotides, from the 3’ end of a nucleotide sequence (aka the “right hand side” of it) by default.

The first argument to this method tells us how many nucleotides are to be removed.

The second argument determines whether to chop from the right side (the 3’ side) or from the left side (the 5’ side).

#


10400
10401
10402
10403
10404
10405
10406
10407
10408
10409
10410
10411
10412
10413
10414
10415
10416
10417
10418
10419
10420
10421
10422
10423
10424
10425
10426
10427
10428
10429
10430
10431
10432
10433
10434
10435
10436
10437
10438
10439
10440
10441
10442
10443
10444
10445
10446
10447
10448
10449
10450
10451
10452
10453
10454
10455
10456
10457
10458
10459
10460
10461
10462
10463
10464
10465
10466
10467
10468
10469
10470
10471
10472
10473
# File 'lib/bioroebe/shell/shell.rb', line 10400

def chop(
    i = 1,
    chop_from_left_or_right_hand_side = :default # The default is the 3' end.
  ) # Default will be to chop off one nucleotide.
  if is_the_main_sequence_frozen?
    report_that_the_main_sequence_is_frozen
    return
  end
  i = i.first if i.is_a? Array
  if i == '?'
    e 'chop allows us to remove nucleotides from the main sequence.'
    return
  end
  i = 1 if i.nil? # Assign to the default then.
  i = i.to_i # Need a number past this point.
  if i == 0
    erev 'Please add a number, such as 1, or any other value.'
  else
    case chop_from_left_or_right_hand_side
    # ===================================================================== #
    # === :right
    # ===================================================================== #
    when :right,
         :default
      which_end = "3'"
    # ===================================================================== #
    # === :left
    # ===================================================================== #
    when :left
      which_end = "5'"
    end
    if dna_sequence_object?.size > 0
      erev "We will now remove some characters (#{simp(i.to_s)}#{rev}"\
           ") from the #{which_end} end of our main string."
    end
    if dna_sequence_object?.size == 0
      erev 'Can not remove anything as the sequence is empty.'
    elsif i > dna_sequence_object?.size
      erev 'We can not remove that many characters, thus we will'
      erev 'simply remove all characters now.'
      reset_string 
    else
      # =================================================================== #
      # Finally do the manipulation. We need to honour from which
      # side we will be operating on.
      # =================================================================== #
      case chop_from_left_or_right_hand_side
      # =================================================================== #
      # === :default
      # =================================================================== #
      when :default,
           :right
        # ================================================================= #
        # We also store the chopped-away sequence, but we have to be
        # mindful here since the sequence-object counts the nucleotides
        # differently than ruby counts Arrays.
        # ================================================================= #
        @internal_hash[:array_these_sequences_were_chopped_away] << seq_object?[(-i)+1, i-1].dup
        seq_object?[-i, i] = ''
      # =================================================================== #
      # === :left
      # =================================================================== #
      when :left
        @internal_hash[:array_these_sequences_were_chopped_away] << seq_object?[0, i].dup
        seq_object?[0, i+1] = ''
      end
    end
    unless dna_sequence_object?.size == 0
      erev "#{rev}The new length of the main string is now: "\
           "#{simp(dna_sequence_object?.size.to_s)}#{rev}."
    end
    show_dna_sequence
  end
end

#chop_to(i) ⇒ Object

#

chop_to

This method will chop up to the first occurence of the given input sequence.

If the given input sequence can not be found, no change is made.

#


4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
# File 'lib/bioroebe/shell/shell.rb', line 4772

def chop_to(i)
  if i.is_a? Array
    i = i.first
  end
  i = i.to_s if i.is_a? Symbol # For instance: chop_to :ATG
  i.delete!(':') if i.include? ':'
  case i
  when 'start'
    i = 'ATG'
  end
  _ = nucleotide_sequence?
  if i.include? 'U'
    # ===================================================================== #
    # Convert Uracil to Thymine next.
    # ===================================================================== #
    erev "The given input sequence includes at the least one "\
         "#{sfancy('U')}#{rev}, which we will convert to #{sfancy('T')}#{rev}."
    i.tr!('U','T')
  end
  if _.include? i
    # ===================================================================== #
    # Ok, we found the search sequence, so now we can chop off the
    # unnecessary sequences.
    # ===================================================================== #
    position = _.index(i)
    erev "Chopping away #{sfancy(position.to_s)}#{rev} nucleotides from "\
         "the left-hand side (5' end) next."
    @internal_hash[:array_these_sequences_were_chopped_away] << seq_object?[0, position+1]
    seq_object?[0, position+1] = ''
    show_dna_sequence
  else
    erev 'No modification can be made as our target nucleotide sequence'
    erev "does not include the given search string #{sfancy(i)}."
  end
end

#chunked_display(i = dna_sequence? ) ⇒ Object

#

chunked_display

This method will show a “chunked” display of the nucleotides that is similar to the FASTA display at NCBI.

Invoke via:

cdisplay
#


6805
6806
6807
6808
6809
6810
6811
6812
# File 'lib/bioroebe/shell/shell.rb', line 6805

def chunked_display(
    i = dna_sequence?
  )
  i = i.join if i.is_a? Array
  i = dna_sequence? if i.nil?
  i = dna_sequence? if i.empty?
  ::Bioroebe::GenbankFlatFileFormatGenerator.new(i) # bl $BIOROEBE/genbank/genbank_flat_file_format_generator.rb
end

#clear(i) ⇒ Object

#

clear

Functionality that is associated with clearing something, can be stored here.

Usage example:

clear highlighting
#


8829
8830
8831
8832
8833
8834
8835
8836
8837
8838
# File 'lib/bioroebe/shell/shell.rb', line 8829

def clear(i)
  if i.is_a? Array
    i = i.join(' ').strip
  end
  case i
  when /^highlight/
    e 'Clearing all highlighting next.'
    set_highlight_colour nil
  end
end

#coding_area?Boolean

#

coding_area?

Query method over the “coding area” that we will focus on. So for example, if we have 100 nucleotides, but the coding area says 3-34, then we will only care for the nucleotides starting at position 3 and ending at position 34.

#

Returns:

  • (Boolean)


8972
8973
8974
# File 'lib/bioroebe/shell/shell.rb', line 8972

def coding_area?
  @internal_hash[:coding_area]
end

#codon(i = sequence? ) ⇒ Object Also known as: codons, codon?, codons?

#

codon

This method will identify codons.

Usage example from within the Shell:

codon AAAGUCCAU
#


3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
# File 'lib/bioroebe/shell/shell.rb', line 3253

def codon(
    i = sequence?
  )
  if i.is_a? Array # We don't want Arrays here.
    i = i.join.strip
  end
  if i.nil?
    i = sequence?
  else
    if i.is_a? String
      i = sequence? if i.empty?
    end
  end
  _ = nucleotides_to_aminoacid(i)
  erev _
end

#codon_to_aminoacid(i) ⇒ Object

#

codon_to_aminoacid

Translate a codon into an aminoacid through this method.

#


8418
8419
8420
# File 'lib/bioroebe/shell/shell.rb', line 8418

def codon_to_aminoacid(i)
  Bioroebe.codon_to_aminoacid(i)
end

#colour_for_nucleotide(i = '') ⇒ Object Also known as: colour_for_nucleotides

#

colour_for_nucleotide

#


2091
2092
2093
# File 'lib/bioroebe/shell/shell.rb', line 2091

def colour_for_nucleotide(i = '')
  royalblue(i)
end

#colour_for_stop_codon(i) ⇒ Object

#

colour_for_stop_codon

#


2084
2085
2086
# File 'lib/bioroebe/shell/shell.rb', line 2084

def colour_for_stop_codon(i)
  orange(i)
end

#colour_scheme_demo(use_this_sequence = 'ATGCATGCATGCATGCATGCATGCATGCATGCATGCATGCATGC') ⇒ Object

#

colour_scheme_demo

#


6567
6568
6569
6570
6571
6572
6573
6574
# File 'lib/bioroebe/shell/shell.rb', line 6567

def colour_scheme_demo(
    use_this_sequence = 'ATGCATGCATGCATGCATGCATGCATGCATGCATGCATGCATGC'
  )
  ColourSchemeDemo.new(use_this_sequence)
  file = ::Bioroebe::ColourSchemeDemo.create_demo_file.to_s
  erev file
  open_in_browser(file) if File.exist? file
end

#colour_scheme_for_aminoacids(i = aminoacid_sequence? ) ⇒ Object

#

colour_scheme_for_aminoacids

Invocation example:

caa TTTHGHGHGIHIHRGGGGAATTTTHGHGHGIHIHRGGGGAATTHGHGHGIHIHRGGGGAAATTT
#


9541
9542
9543
9544
9545
9546
9547
9548
9549
9550
9551
9552
9553
9554
9555
9556
9557
9558
9559
9560
9561
9562
9563
9564
9565
9566
9567
9568
9569
9570
9571
# File 'lib/bioroebe/shell/shell.rb', line 9541

def colour_scheme_for_aminoacids(
    i = aminoacid_sequence?
  )
  i = aminoacid_sequence? if i.nil?
  hash = ::Bioroebe::ColourScheme::Taylor.colours?
  tokens = i
  if tokens.is_a? String
    tokens = tokens.chars
    tokens = tokens.each_slice(80).to_a
  end
  # ======================================================================= #
  # Get it in chunks of 30.
  # ======================================================================= #
  n_chunks = 30
  chunks = tokens.each_slice(n_chunks).to_a
  e; chunks.each {|array|
    array.each {|entry|
      chars = entry.chars
      chars.each {|aminoacid|
        if hash.has_key? aminoacid
          value = hash[aminoacid]
          array = HexToRGB[value] # Obtain the R,G,B Array from here.
          ::Colours.rgb_print(array, aminoacid)
        else
          erev "The hash does not include the key #{simp(aminoacid)}#{rev}."
        end
      }
    }
    e
  }; e
end

#colour_scheme_for_nucleotides(i = dna_sequence? ) ⇒ Object

#

colour_scheme_for_nucleotides

This method can eventually be used to display the colour codes for the nucleotides.

#


6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
# File 'lib/bioroebe/shell/shell.rb', line 6882

def colour_scheme_for_nucleotides(
    i = dna_sequence?
  )
  begin
    require 'roebe/classes/hex_to_rgb.rb'
  rescue LoadError; end
  if Object.const_defined?(:Roebe) and
     Roebe.const_defined?(:HexToRGB)
    i = dna_sequence? if i.nil?
    i = i.first if i.is_a? Array
    hash = ::Bioroebe::ColourScheme::Nucleotide.colours?
    tokens = i.chars
    # ===================================================================== #
    # Get it in chunks of 80.
    # ===================================================================== #
    chunks = tokens.each_slice(80).to_a
    e; chunks.each {|array|
      array.each {|char|
        if hash.has_key? char
          value = hash[char]
          array = Roebe::HexToRGB[value] # Obtain the R,G,B Array from here.
          ::Colours.rgb_print(array, char)
        end
      }
      e
    }; e
  else
    erev 'Please install the gem hex_to_rgb, in order '\
         'to use this method.'
  end
end

#colourize_fasta_file(i) ⇒ Object

#

colourize_fasta_file

Invocation example:

colourize_fasta_file /Depot/Temp/bioroebe/sequence.fasta
#


3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
# File 'lib/bioroebe/shell/shell.rb', line 3677

def colourize_fasta_file(i)
  if i.is_a? Array
    i.each {|entry| colourize_fasta_file(entry) }
  else
    # ===================================================================== #
    # First, get the raw content of the fasta sequence here.
    # ===================================================================== #
    if File.exist? i
      sequence = ::Bioroebe.parse_fasta_file(i).sequence?
      # =================================================================== #
      # Now that we have the sequence, colourize it.
      # =================================================================== #
      cliner {
        ColourSchemeDemo.new(sequence)
      }
    end
  end
end

#colourize_nucleotide(i, add_leading_five_and_trailing_three_primes = true) ⇒ Object Also known as: colourize_nucleotide_sequence

#

colourize_nucleotide

Assemble 5’-sequence-3’, with colours.

#


10998
10999
11000
11001
11002
11003
11004
11005
11006
11007
11008
11009
11010
11011
11012
11013
11014
11015
11016
11017
11018
11019
# File 'lib/bioroebe/shell/shell.rb', line 10998

def colourize_nucleotide(
    i,
    add_leading_five_and_trailing_three_primes = true
  )
  case add_leading_five_and_trailing_three_primes
  # ======================================================================= #
  # === :do_not_add_anything_else
  # ======================================================================= #
  when :do_not_add_anything_else,
       :make_no_modifications
    add_leading_five_and_trailing_three_primes = false
  end
  if add_leading_five_and_trailing_three_primes
    leading_5_prime+
    sfancy(i)+
    rev+
    trailing_3_prime
  else
    sfancy(i)+
    rev
  end
end

#colourize_this_aminoacid(i) ⇒ Object

#

colourize_this_aminoacid

Use this method to colourize any particular aminoacid.

This should make it easier to detect special aminoacids.

#


10935
10936
10937
10938
10939
10940
10941
10942
10943
10944
10945
# File 'lib/bioroebe/shell/shell.rb', line 10935

def colourize_this_aminoacid(i)
  if i.nil?
    erev 'Please supply an argument, an aminoacid. Either one letter, '\
         'such as A for Alanine, or the full name.'
    return
  end
  unless ::Bioroebe.array_colourize_this_aminoacid.include? i
    erev 'We will now colourize the aminoacid `'+swarn(i)+'`.'
    ::Bioroebe.array_colourize_this_aminoacid << i
  end
end

#command_to_be_passed_to_the_menu?Boolean

#

command_to_be_passed_to_the_menu?

#

Returns:

  • (Boolean)


7461
7462
7463
# File 'lib/bioroebe/shell/shell.rb', line 7461

def command_to_be_passed_to_the_menu?
  @internal_hash[:command_to_be_passed_to_the_menu]
end

#compact_file(this_file = nil) ⇒ Object

#

compact_file

Delegate into class Bioroebe::Compacter.

#


7541
7542
7543
7544
7545
# File 'lib/bioroebe/shell/shell.rb', line 7541

def compact_file(
    this_file = nil
  )
  ::Bioroebe::Compacter.new(this_file)
end

#compare_two_files(file_a, file_b) ⇒ Object

#

compare_two_files

We will here compare whether two files are identical.

First argument is the first file, second argument is the second file.

#


8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
# File 'lib/bioroebe/shell/shell.rb', line 8518

def compare_two_files(file_a, file_b)
  if File.exist? file_a
    file_a = File.read(file_a)
  else
    erev file_a+' does not exist.'
  end
  if File.exist? file_b
    file_b = File.read(file_b)
  else
    erev file_b+' does not exist.'
  end
  erev (file_a == file_b)
end

#compare_two_strings_as_alignment(string1 = nil, string2 = nil) ⇒ Object

#

compare_two_strings_as_alignment

This allows us to interactively compare two strings.

#


8785
8786
8787
8788
8789
8790
8791
8792
8793
8794
8795
8796
8797
8798
8799
8800
8801
8802
8803
8804
8805
8806
8807
8808
8809
8810
8811
8812
8813
8814
8815
8816
# File 'lib/bioroebe/shell/shell.rb', line 8785

def compare_two_strings_as_alignment(
    string1 = nil,
    string2 = nil
  )
  if string1 and string2
    # Simply pass through in this case.
  else
    erev 'You desire to compare two strings.'
    e
    erev 'Please input the '+palegreen('first')+rev+' string/sequence now:'
    print '  '
    if has_readline?
      string1 = Readline.readline
    else
      string1 = $stdin.gets.chomp
    end
    erev 'Please input the '+palegreen('second')+rev+' string now:'
    print '  '
    if has_readline?
      string2 = Readline.readline
    else
      string2 = $stdin.gets.chomp
    end
  end
  # ======================================================================= #
  # Delegate into class SimpleStringComparer next.
  # ======================================================================= #
  _ = ::Bioroebe::SimpleStringComparer.new(:dont_run_yet) { :use_vertical_bar } # bl $BIOROEBE/string_matching/simple_string_comparer.rb
  _.string1 = string1
  _.string2 = string2
  _.compare
end

#compseq(i = dna_sequence? ) ⇒ Object

#

compseq

Analyze a given sequence via compseq.

#


5719
5720
5721
5722
5723
5724
# File 'lib/bioroebe/shell/shell.rb', line 5719

def compseq(
    i = dna_sequence?
  )
  i = dna_sequence? if i.nil?
  ::Bioroebe::Compseq.new(i) # bl $BIOROEBE/compseq.rb
end

#config?Boolean Also known as: configuration?

#

config?

#

Returns:

  • (Boolean)


9687
9688
9689
# File 'lib/bioroebe/shell/shell.rb', line 9687

def config?
  @configuration
end

#consider_analysing_the_local_dataset_on_startupObject

#

consider_analysing_the_local_dataset_on_startup

This method will analyse the local dataset (should it exist), and then display some information to the user about it.

#


5217
5218
5219
5220
5221
5222
5223
# File 'lib/bioroebe/shell/shell.rb', line 5217

def consider_analysing_the_local_dataset_on_startup
  if @internal_hash and
     @internal_hash.has_key?(:analyse_the_local_dataset_on_startup) and
     @internal_hash[:analyse_the_local_dataset_on_startup]
    Bioroebe::AnalyseLocalDataset.new
  end
end

#consider_assigning_the_default_dna_sequence_from_a_yaml_fileObject

#

consider_assigning_the_default_dna_sequence_from_a_yaml_file

#


1239
1240
1241
1242
1243
# File 'lib/bioroebe/shell/shell.rb', line 1239

def consider_assigning_the_default_dna_sequence_from_a_yaml_file
  if defined? DEFAULT_DNA_INPUT_YAML_FILE # Main DNA string.
    set_string(DEFAULT_DNA_INPUT_YAML_FILE)
  end
end

#considering_changing_the_title_of_the_kde_konsole_tab(to_this_title = 'BioRoebe') ⇒ Object

#

considering_changing_the_title_of_the_kde_konsole_tab

#


8101
8102
8103
8104
8105
8106
8107
8108
8109
# File 'lib/bioroebe/shell/shell.rb', line 8101

def considering_changing_the_title_of_the_kde_konsole_tab(
    to_this_title = 'BioRoebe'
  )
  if ::Bioroebe.try_to_rename_kde_konsole? and
     Object.const_defined? :Roebe # For project roebe.
    require 'roebe/classes/kde/kde_konsole/kde_konsole.rb'
    Roebe.change_konsole_tab_title(to_this_title, :be_silent)
  end
end

#convert_five_prime_dna_into_five_prime_mrna(this_string = sequence? ) ⇒ Object

#

convert_five_prime_dna_into_five_prime_mrna (DNA to mRNA)

This method will translate the 5’-DNA into 5’-mRNA.

#


6142
6143
6144
6145
6146
6147
6148
# File 'lib/bioroebe/shell/shell.rb', line 6142

def convert_five_prime_dna_into_five_prime_mrna(
    this_string = sequence?
  )
  erev padding?+leading_5_prime+
       sfancy(this_string.upcase.tr('T','U'))+
       rev+trailing_3_prime
end

#copy_bioroebe_shell_before_quittingObject

#

copy_bioroebe_shell_before_quitting

Use this method to copy the Bioroebe shell before quitting.

We will make use of class InstallRubyProject for this.

This was disabled as of Jan 2016. The reason is that it confuses me too much, seriously. Perhaps I will re-enable it again at a later time.

#


8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
# File 'lib/bioroebe/shell/shell.rb', line 8209

def copy_bioroebe_shell_before_quitting
  _ = RUBY_SRC+'bioroebe/'
  begin
    require 'roebe/classes/install_ruby_project.rb'
  rescue LoadError; end
  if Object.const_defined? :Roebe
    irp = Roebe::InstallRubyProject.new(_, false)
    irp.run
  elsif on_roebe?
    erev 'The project custom_methods/install_ruby_project is not available.'
    erev 'We will install it now.'
    cd '$RSRC/roebe/'
    Easycompile.rinstall2 if Object.const_defined? :Easycompile
  end if false # Disabled it here. Not sure if I will re-enable it.
end

#could_this_be_an_amino_acid?(i) ⇒ Boolean

#

could_this_be_an_amino_acid?

If the input is an amino acid, we return true for this method here.

Characters such as ‘?’ will be removed.

Invocation examples:

phenylalanine
glycin
glycine
#

Returns:

  • (Boolean)


6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
# File 'lib/bioroebe/shell/shell.rb', line 6770

def could_this_be_an_amino_acid?(i)
  i = i.to_s.downcase
  i.delete!('?') if i.include? '?' # Get rid of '?' tokens.
  return_value = false
  unless i.empty?
    # ===================================================================== #
    # First, we check here for german names. These names are kept in
    # the file called
    # 'amino_acids_long_name_to_one_letter.yml'
    # ===================================================================== #
    unless AMINO_ACIDS_RESTE.has_key?(i)
      if AMINO_ACIDS_LONG_NAME_TO_ONE_LETTER.has_key?(i)
        i = AMINO_ACIDS_LONG_NAME_TO_ONE_LETTER[i]
        i = AMINO_ACIDS_ENGLISH[i].downcase
      end
    end
    if AMINO_ACIDS_RESTE.has_key?(i)
      return_value = true
    end
  end
  return return_value
end

#count_amount_of_aminoacids(i) ⇒ Object

#

count_amount_of_aminoacids

#


2979
2980
2981
# File 'lib/bioroebe/shell/shell.rb', line 2979

def count_amount_of_aminoacids(i)
  ::Bioroebe::CountAmountOfAminoacids.new(i)
end

#create_balanced_composition(i = nil) ⇒ Object

#

create_balanced_composition

This method will create a balanced nucleotide-composition.

In other words, we can do a DNA string with 25% A, G, C, T each.

#


4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
# File 'lib/bioroebe/shell/shell.rb', line 4221

def create_balanced_composition(i = nil)
  string = ''.dup # The return string.
  if i.nil?
    n_nucleotides_to_be_generated = 1000 # Default.
    # In this case, go interactive.
    erev 'Please enter the percentage of each nucleotide next.'
    ee 'A: '
    a = $stdin.gets.chomp.to_i
    ee 'T: '
    t = $stdin.gets.chomp.to_i
    ee 'C: '
    c = $stdin.gets.chomp.to_i
    erev 'G is automatically calculated.'
    g = 100 - (a + t + c)
    ee 'G: '
    # The following is not yet finished.
    string << ('A' * a)+('T' * t)+('C' * c)+('G' * g)
  else
    i = 1000 if i.nil? or (i.is_a?(Array) and i.empty?) # The default.
    n_nucleotides_to_be_generated = i
    # ===================================================================== #
    # Otherwise, we assume it to be 25% for each nucleotide. The following
    # code will ensure that.
    # ===================================================================== #
    n_times = n_nucleotides_to_be_generated.to_i / 4
    n_times.times {
      _ = return_dna_nucleotides # Get all four entries first.
      _.shuffle.each {|nucleotide|
        string << nucleotide
      }
    }
  end
  erev "Note: we will assume the target size will "\
       "be #{n_nucleotides_to_be_generated.to_s} nucleotides."
  return string # The nucleotide-string to be returned.
end

#create_fasta_fileObject

#

create_fasta_file

#


6065
6066
6067
6068
6069
6070
6071
# File 'lib/bioroebe/shell/shell.rb', line 6065

def create_fasta_file
  set_save_file :default_fasta
  e 'Now creating a new fasta file. Will store into `'+sfile(@save_file)+'`.'
  _ = '>gi|12345|pir|TVHGG| some unknown protein'+N
  _ << string?
  save_file(_, @internal_hash[:save_file])
end

#create_file(i = a?) ) ⇒ Object

#

create_file

#


3373
3374
3375
3376
3377
3378
3379
3380
# File 'lib/bioroebe/shell/shell.rb', line 3373

def create_file(i = a?)
  [i].flatten.each {|this_file|
    unless File.exist?(this_file)
      erev 'Creating the file '+sfile(this_file)+rev+' next.'
      FileUtils.touch(this_file)
    end
  }
end

#create_n_random_amino_acids(n = 1000) ⇒ Object

#

create_n_random_amino_acids

#


7581
7582
7583
# File 'lib/bioroebe/shell/shell.rb', line 7581

def create_n_random_amino_acids(n = 1000)
  set_aminoacids :random, n, :be_verbose
end

#cut(i) ⇒ Object

#

cut (cut tag)

This method will cut away some part from the DNA string.

#


3455
3456
3457
3458
3459
# File 'lib/bioroebe/shell/shell.rb', line 3455

def cut(i)
  i = i.to_i
  sequence?[-i,i] = ''
  show_dna_sequence
end

#cut_at(this_sequence = 'GAATTC', be_verbose = true) ⇒ Object

#

cut_at

Use this method to chop off or rather cut at a DNA sequence.

#


10487
10488
10489
10490
10491
10492
10493
10494
10495
10496
10497
10498
10499
10500
10501
10502
10503
10504
# File 'lib/bioroebe/shell/shell.rb', line 10487

def cut_at(
    this_sequence = 'GAATTC',
    be_verbose    = true
  )
  main_sequence = dna_sequence_object?
  this_sequence = this_sequence.join.strip if this_sequence.is_a? Array
  if be_verbose
    erev "We will chop away (at) the sequence #{simp(this_sequence)}#{rev}."
    erev 'Note that the sequences all originated from the larger '\
         'parent sequence.'
  end
  results = main_sequence.split(/#{this_sequence}/)
  results.each {|sequence|
    _ = properly_spaced_dna(sequence)
    _ << (' ('+sequence.size.to_s+' nucleotides)').rjust(110 - sequence.size)
    erev _
  }
end

#cut_sequence_in_slices_of(threshold = '9') ⇒ Object

#

cut_sequence_in_slices_of

This method cuts the sequence into slices of n, where n is the argument to this method.

So if you input 10 as argument, then we will put the nucleotides into chunks of 10 nucleotides per row.

Usage examples:

cut_sequence_in_slices_of 5
cut_sequence_in_slices_of 6
cut_sequence_in_slices_of 7
#


7489
7490
7491
7492
7493
7494
7495
7496
7497
# File 'lib/bioroebe/shell/shell.rb', line 7489

def cut_sequence_in_slices_of(
    threshold = '9'
  )
  _ = dna_sequence_object?
  matches = _.scan(/.{#{threshold}}/)
  matches.each {|entry|
    erev "  #{entry}"
  }
end

#cut_with_enzyme(i) ⇒ Object

#

cut_with_enzyme

#


3506
3507
3508
3509
# File 'lib/bioroebe/shell/shell.rb', line 3506

def cut_with_enzyme(i)
  i = i.join(' ').strip if i.is_a? Array
  pp sequence_object?.cut_with_enzyme(i)
end

#cutseq(i = [1,3]) ⇒ Object

#

cutseq

This can be used to modify the sequence object. It will cut some segment out from the nucleotide.

Usage examples:

random 30; cutseq 5 8
random 30; cutseq 5-8
#


3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
# File 'lib/bioroebe/shell/shell.rb', line 3473

def cutseq(i = [1,3])
  if i.is_a? Array
    if i.size == 1 and i.first.is_a? String and i.first.include?('-')
      i = [i.first.split('-')].flatten
    end
    if i.empty? # In this case we will ask the user for input.
      erev 'No argument was provided. Please input the start nucleotide position next:'
      start_position = $stdin.gets.chomp.to_i
      erev 'Next, input the end nucleotide position:'
      end_position   = $stdin.gets.chomp
    elsif i.size > 1
      start_position = i.first
      end_position   = i.last
    end
  end
  # ======================================================================= #
  # === Handle +3 relational position given
  # ======================================================================= #
  if end_position.is_a? String and end_position.include?('+')
    end_position = start_position + end_position.delete('+').to_i
  end
  n_nucleotides_will_be_deleted = (end_position.to_i - start_position.to_i)+1
  # ======================================================================= #
  # Notify the user what we will do next.
  # ======================================================================= #
  erev 'Next cutting away '+simp(n_nucleotides_will_be_deleted.to_s)+
        rev+' nucleotides.'
  sequence_object?[start_position, end_position] = ''
end

#cytosin?Boolean

#

cytosin?

#

Returns:

  • (Boolean)


8339
8340
8341
# File 'lib/bioroebe/shell/shell.rb', line 8339

def cytosin?
  YAML.load_file(FILE_NUCLEOTIDES)['Cytosin']
end

#dalton(i) ⇒ Object

#

dalton

This method will calculate the weight of several aminoacids, in Dalton. We assume that each aminoacid will have a weight of 110 Dalton.

#


9944
9945
9946
9947
9948
# File 'lib/bioroebe/shell/shell.rb', line 9944

def dalton(i)
  n_dalton = i.to_f * 110
  e sfancy(i.to_s)+rev+' aminoacids have a molecular weight of '+
    simp(n_dalton.to_s)+rev+' Dalton ('+(n_dalton/1000.0).to_s+' kDa).'
end

#deduce_this_aminoacid_sequence(i = 'Lys-Ser-Pro-Ser-Leu-Asn-Ala-Ala-Lys', show_the_rna_sequence = true) ⇒ Object

#

deduce_this_aminoacid_sequence

Thi method will show the possible codons for an aminoacid sequence.

It will display the result in an ASCII table, on the commandline.

Trigger this like so:

sof
sof Lys-Ser-Pro-Ser-Leu-Asn-Ala-Ala-Lys
sof Thr Thr Glu Ala Val Glu Ser Thr Val Ala Thr Leu Glu Asp Ser
sof T-T-G-A-V-G-S-T-V
#


4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
# File 'lib/bioroebe/shell/shell.rb', line 4653

def deduce_this_aminoacid_sequence(
    i                     = 'Lys-Ser-Pro-Ser-Leu-Asn-Ala-Ala-Lys',
    show_the_rna_sequence = true
  )
  if i.nil? # This is the default.
    if aminoacid_sequence?
      i = aminoacid_sequence?
    else
      i = 'Lys-Ser-Pro-Ser-Leu-Asn-Ala-Ala-Lys'
    end
  end
  DeduceAminoacidSequence.new(i, show_rna: show_the_rna_sequence) # bl DeduceAminoacidSequence
end

#default_length?Boolean

#

default_length?

#

Returns:

  • (Boolean)


7311
7312
7313
# File 'lib/bioroebe/shell/shell.rb', line 7311

def default_length?
  @internal_hash[:default_length]
end

#design_polylinker(optional_length_of_polylinker = nil, be_verbose = true) ⇒ Object

#

design_polylinker

This method will design a polylinker from 3-8 random restriction enzymes sites.

You can pass a first argument to this method.

Example:

design_polylinker 100
#


8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
8648
8649
8650
8651
8652
8653
8654
8655
8656
8657
8658
8659
8660
8661
8662
8663
8664
8665
# File 'lib/bioroebe/shell/shell.rb', line 8637

def design_polylinker(
    optional_length_of_polylinker = nil,
    be_verbose                    = true
  )
  if optional_length_of_polylinker.is_a? Array
    optional_length_of_polylinker = optional_length_of_polylinker[0]
  end
  if optional_length_of_polylinker.nil?
    optional_length_of_polylinker = 20
  end
  optional_length_of_polylinker = optional_length_of_polylinker.to_i
  full_sequence = ''
  n_restriction_sites = rand(6)+3
  n_restriction_sites.times {
    full_sequence << return_random_restriction_enzyme(be_verbose)
  }
  if full_sequence.size < optional_length_of_polylinker
    loop {
      full_sequence << return_random_restriction_enzyme(be_verbose)
      break if full_sequence.size > optional_length_of_polylinker
    }
  end
  erev 'Our generated polylinker has '+sfancy(n_restriction_sites.to_s)+
       ' sites for restriction enzymes available (DNA Sequence '+
       'length is: '+full_sequence.size.to_s+').'
  erev 'We will also assign this sequence as the new DNA sequence.'
  assign_dna_sequence(full_sequence, :be_quiet)
  return full_sequence
end

#designate_this_input_as_coding_entry(i) ⇒ Object

#

designate_this_input_as_coding_entry

Invocation example:

coding_entry 51..3251
#


5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
# File 'lib/bioroebe/shell/shell.rb', line 5964

def designate_this_input_as_coding_entry(i)
  if i.is_a? Array
    i = i.first
  end
  if i.include? '..'
    # ===================================================================== #
    # Assume Range-behaviour here.
    # ===================================================================== #
    @internal_hash[:coding_area] = i
  end
  erev "Using the coding-area #{sfancy(i)}#{rev}."
  erev 'You can test this by e. g. invoking '+sfancy('ORF?')+rev+'.'
end

#determine_and_report_all_stop_codonsObject

#

determine_and_report_all_stop_codons

#


1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
# File 'lib/bioroebe/shell/shell.rb', line 1541

def determine_and_report_all_stop_codons
  dna_sequence = dna_sequence_object?
  erev 'Because 3 different stop codons exist, we have '\
       'to do '+slateblue('3 runs')+rev+'.'
  stop_codons?.each {|this_stop_codon|
    array_matches = ::Bioroebe.return_all_substring_matches(
      dna_sequence, this_stop_codon
    )
    if array_matches.empty?
      erev 'No match has been found.'
    else
      start_position = array_matches.last.first
      erev 'For the stop codon '+sfancy(this_stop_codon)+rev+' the last codon'
      erev 'occurrs at position '+simp(start_position.to_s)+rev+'.'
    end
  }
end

#disable(i) ⇒ Object

#

disable (disable tag)

#


9727
9728
9729
9730
9731
9732
9733
9734
9735
9736
9737
9738
9739
9740
9741
9742
9743
9744
9745
9746
9747
9748
9749
9750
9751
9752
9753
9754
9755
9756
9757
9758
9759
9760
9761
9762
9763
9764
9765
9766
9767
9768
9769
9770
# File 'lib/bioroebe/shell/shell.rb', line 9727

def disable(
    i
  )
  if i.is_a? Array
    i = i.join(' ').strip
  end
  case i.to_s # case tag
  # ======================================================================= #
  # === disable colours
  # ======================================================================= #
  when 'colours',
       'colors',
       /^col/
    disable_colours
  # ======================================================================= #
  # === disable :cd_aliases
  # ======================================================================= #
  when /^-?-?cd(-|_)?aliases$/i
    erev 'We will no longer use class Rcfiles::DirectoryAliases'
    ::Bioroebe::Configuration.do_not_use_expand_cd_aliases
  # ======================================================================= #
  # === truncate
  # ======================================================================= #
  when /^truncate$/i
    disable_truncate
  # ======================================================================= #
  # === prompt
  # ======================================================================= #
  when 'prompt'
    set_prompt :empty # This means to use an empty prompt.
  # ======================================================================= #
  # === padding
  # ======================================================================= #
  when 'padding'
    set_padding 0, :be_verbose
  # ======================================================================= #
  # === disable xsel
  # ======================================================================= #
  when 'xsel'
    disable_xsel
  else
    erev "No such disable-action could be found (#{sfancy(i)}#{rev})"
  end
end

#disable_colours_in_an_extended_manner(be_verbose = :be_quiet) ⇒ Object Also known as: disable_enable_colours, extended_disable_colours

#

disable_colours_in_an_extended_manner (disable tag)

#


703
704
705
706
707
708
709
710
# File 'lib/bioroebe/shell/shell.rb', line 703

def disable_colours_in_an_extended_manner(
    be_verbose = :be_quiet
  )
  disable_colours(be_verbose)
  ::Bioroebe.disable_colours
  @highlight_colour = '' # Use this colour to highlight important sequences.
  set_prompt
end

#disable_truncateObject

#

disable_truncate

#


8709
8710
8711
# File 'lib/bioroebe/shell/shell.rb', line 8709

def disable_truncate
  do_not_truncate
end

#disable_xselObject

#

disable_xsel

#


9233
9234
9235
9236
9237
9238
9239
9240
# File 'lib/bioroebe/shell/shell.rb', line 9233

def disable_xsel
  if use_xsel?
    e 'Now disabling xsel.'
    @internal_hash[:use_xsel] = false
  else
    e 'xsel is already disabled.'
  end
end

#discover_all_palindromes(i = dna_sequence?, , min = 4, max = 10) ⇒ Object

#

discover_all_palindromes

We need to discover all palindromes. For this, we need a min and a max value.

#


7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
# File 'lib/bioroebe/shell/shell.rb', line 7635

def discover_all_palindromes(
    i   = dna_sequence?,
    min =  4,
    max = 10
  )
  i = dna_sequence? unless i
  case i # case tag
  when 'default',
       ':default'
    i = dna_sequence?
  end
  @internal_hash[:array_palindromes] = [] # We store the Palindromes in this Array.
  n_times = i.size

  min.upto(max) {|length|
    # ===================================================================== #
    # First, iterate by starting over the min value.
    # ===================================================================== #
    n_times.times {|counter|
      possible_palindrome_sequence = i[counter, length]
      counter += 1 # Adding +1 because nucleotides start at 1, not 0.
      if ::Bioroebe.is_palindrome?(possible_palindrome_sequence) and
         (possible_palindrome_sequence.size >= length)
        @internal_hash[:array_palindromes] << [possible_palindrome_sequence, counter]
      end
    }
  }
  e; erev 'Starting nucleotide | Palindrome sequence'; e
  @internal_hash[:array_palindromes].each {|array|
    index_position = array.last
    nucleotides    = array.first
    erev '                 '+index_position.to_s.rjust(3)+' '+
         nucleotides+' ('+swarn(nucleotides.size.to_s)+rev+')'
  }; e
end

#display_all_aminoacidsObject

#

display_all_aminoacids

This method will display all Aminoacids.

Invocation example:

daminoacids
#


9307
9308
9309
9310
9311
9312
9313
9314
9315
9316
# File 'lib/bioroebe/shell/shell.rb', line 9307

def display_all_aminoacids
  e
  erev 'Aminoacids Shortnames:'
  erev # Newline here is ok.
  aa = ::Bioroebe::AMINO_ACIDS # Is a hash.
  aa.keys.sort.each {|key|
    result = aa[key].select {|inner_key, value| inner_key.size == 3 }.values.first
    erev '  '+key+': '+sfancy(result)
  }; e # Trailing newline.
end

#display_glycolysis_pathwayObject

#

display_glycolysis_pathway

This method will show the glycolysis Pathway.

#


10109
10110
10111
10112
10113
10114
10115
10116
# File 'lib/bioroebe/shell/shell.rb', line 10109

def display_glycolysis_pathway
  array = Pathways.glycolysis_pathway # Obtain the glyclosis pathway, as Array.
  if Object.const_defined? :Display
    Display.display(array, ')')
  else
    array.each {|entry| e ' - '+entry }
  end
end

#display_nucleotide_sequence(this_sequence = dna_sequence_object?, , &block) ⇒ Object Also known as: display_this_nucleotide_sequence, display_this_sequence, show_this_sequence

#

display_nucleotide_sequence

Consistently use this method whenever you wish to display a nucleotide sequence.

#


1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
# File 'lib/bioroebe/shell/shell.rb', line 1836

def display_nucleotide_sequence(
    this_sequence = dna_sequence_object?,
    &block
  )
  case this_sequence
  when :default
    this_sequence = dna_sequence_object?
  end
  do_show_piped_output = false
  if block_given?
    yielded = yield
    case yielded
    when :piped,
         :show_piped
      do_show_piped_output = true
    end
  end
  hash = {
    padding_to_use:    padding?,
    show_piped_output: do_show_piped_output
  }
  show_nucleotide_sequence?.report_this_sequence(this_sequence) { hash }
end

#display_open_reading_frames(i = dna_sequence_object?, , &block) ⇒ Object

#

display_open_reading_frames

Invocation example:

display_open_reading_frames ATGAGCAAGGCCGACTACGAGAAG
#


5946
5947
5948
5949
5950
5951
5952
5953
5954
# File 'lib/bioroebe/shell/shell.rb', line 5946

def display_open_reading_frames(
    i = dna_sequence_object?, &block
  )
  i = i.first if i.is_a? Array
  i = dna_sequence_object? if i.nil?
  i = dna_sequence_object? if i.empty?
  require 'bioroebe/utility_scripts/display_open_reading_frames/display_open_reading_frames.rb'
  ::Bioroebe::DisplayOpenReadingFrames.new(i, &block)
end

#dna_padding(this_sequence, get_rid_of_spaces = false) ⇒ Object Also known as: properly_spaced_dna, properly_padded_dna_string

#

dna_padding (dna_padding tag)

This method will properly pad a DNA string (with leading 5’ and trailing 3’). That string will be returned.

First argument should be the string (sequence) that you wish to modify.

#


9260
9261
9262
9263
9264
9265
9266
9267
9268
# File 'lib/bioroebe/shell/shell.rb', line 9260

def dna_padding(
    this_sequence,
    get_rid_of_spaces = false
  )
  return left_pad?+
         five_prime(get_rid_of_spaces)+rev+
         sfancy(this_sequence)+rev+
         trailer(get_rid_of_spaces)
end

#dna_sequences?Boolean Also known as: array_sequences?

#

dna_sequences?

#

Returns:

  • (Boolean)


8362
8363
8364
# File 'lib/bioroebe/shell/shell.rb', line 8362

def dna_sequences?
  @internal_hash[:array_dna_sequences]
end

#dna_to_aminoacid_sequence(i = dna_sequence? ) ⇒ Object

#

dna_to_aminoacid_sequence

Convert a DNA sequence into the corresponding aminoacid sequence.

#


6014
6015
6016
6017
6018
6019
6020
# File 'lib/bioroebe/shell/shell.rb', line 6014

def dna_to_aminoacid_sequence(
    i = dna_sequence?
  )
  i = dna_sequence? if i.nil?
  i = dna_sequence? if i.empty?
  ::Bioroebe::DnaToAminoacidSequence.new(i)
end

#dna_translate(i) ⇒ Object

#

dna_translate

#


10823
10824
10825
10826
10827
10828
10829
10830
10831
10832
10833
10834
10835
10836
10837
10838
10839
10840
10841
10842
10843
10844
# File 'lib/bioroebe/shell/shell.rb', line 10823

def dna_translate(i)
  i = i.join(' ').strip if i.is_a? Array
  if i.nil? or i.empty?
    if dna_sequence_as_string?
      i = dna_sequence_as_string?
      erev 'Using the current DNA sequence (size: '+
           i.size.to_s+' nucleotides)'
      # =================================================================== #
      # assign_dna_sequence(i, :be_verbose) # First assign
      # ^^^ Why would we want to re-assign here? Makes no sense, thus it
      #     was disabled as of December 2021. 
      # =================================================================== #
    end
  end
  # ======================================================================= #
  # Find and display the complement to this DNA sequence:
  # ======================================================================= #
  erev "The #{orange('complementary DNA Strand')}#{rev} is:"
  e
  show_nucleotide_sequence?.display(i) { :complementary_strand }
  e
end

#dna_with_ends(i = dna_sequence_as_string?, , optional_colourize = nil, colourize_everything = true) ⇒ Object

#

dna_with_ends

Display DNA with proper ends.

The first argument should be the string that we will colourize.

If the second argument is given (‘optional_colourize`), then this method will colourize the sequence at certain positions. This can be useful to display, for instance, restriction-sites.

#


9855
9856
9857
9858
9859
9860
9861
9862
9863
9864
9865
9866
9867
9868
9869
9870
9871
9872
9873
9874
9875
9876
9877
9878
9879
9880
9881
9882
9883
9884
9885
9886
9887
9888
9889
9890
9891
9892
9893
9894
9895
9896
9897
9898
9899
9900
9901
9902
9903
9904
9905
9906
9907
9908
9909
9910
9911
9912
9913
9914
9915
9916
9917
9918
9919
9920
9921
9922
9923
# File 'lib/bioroebe/shell/shell.rb', line 9855

def dna_with_ends(
    i                    = dna_sequence_as_string?,
    optional_colourize   = nil,
    colourize_everything = true
  )
  i.upcase! if config?.respond_to?(:upcase_nucleotides) and config?.upcase_nucleotides
  if optional_colourize.is_a? String
    optional_colourize = [optional_colourize]
  end
  if block_given?
    yielded = yield
    case yielded
    # ===================================================================== #
    # === :honour_coding_area_if_it_exists
    # ===================================================================== #
    when :honour_coding_area_if_it_exists
      if optional_colourize and @internal_hash[:coding_area]
        # ================================================================= #
        # We will colourize based on the coding area that was designated.
        # ================================================================= #
        _ = @internal_hash[:coding_area]
        # ================================================================= #
        # We deduct 1 because ruby Arrays start at 0.
        # ================================================================= #
        start_position = _.split('..').first.to_i - 1
        end_position   = _.split('..').last.to_i  - 1
        internal_segment = i[start_position .. end_position]
        use_this_as_return_string = ''
        use_this_as_return_string << i[0..(start_position-1)]
        optional_colourize.each {|inner_entry|
          internal_segment.gsub!(inner_entry, yellow+inner_entry+rev)
        }
        use_this_as_return_string << internal_segment
        use_this_as_return_string << i[(end_position+1) .. -1]
        i = use_this_as_return_string
      elsif optional_colourize
        # ================================================================= #
        # Apply all entries given in the Array.
        # ================================================================= #
        if optional_colourize.is_a? Array
          optional_colourize.flatten.each {|inner_entry|
            i.gsub!(
              inner_entry, colour_for_stop_codon(inner_entry)+rev
            ) # Colourize in yellow.
          }
        else
          # =================================================================== #
          # Make sure that we have a String past this point.
          # =================================================================== #
          optional_colourize = optional_colourize.to_s
          if colourize_everything == true
            i.gsub!(optional_colourize, colour_for_stop_codon(optional_colourize)+rev)
          else
            if colourize_everything == 1
              i.sub!(optional_colourize, colour_for_stop_codon(optional_colourize)+rev)
            end
          end
        end
      end
    end
  else
    i = "#{sfancy(i)}#{rev}"
  end
  # ======================================================================= #
  # We will report the DNA sequence with leading 5' prime and
  # trailing 3' prime.
  # ======================================================================= #
  return "#{leading_five_prime}#{i}#{trailing_three_prime}"
end

#do_a_silent_startupObject Also known as: do_silent_startup

#

do_a_silent_startup

Use this method when you want to perform a silent startup.

#


8077
8078
8079
# File 'lib/bioroebe/shell/shell.rb', line 8077

def do_a_silent_startup
  @internal_hash[:silent_startup] = true
end

#do_action(*i) ⇒ Object

#

do_action

Usage example:

do not truncate
#


7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
# File 'lib/bioroebe/shell/shell.rb', line 7169

def do_action(*i)
  if i.is_a? Array
    i.flatten!
  end
  first_argument  = i[0]
  second_argument = i[1]
  case second_argument
  when 'truncate'
    do_not_truncate if first_argument == 'not'
  end
end

#do_analyze_sequence(i = sequence? ) ⇒ Object

#

do_analyze_sequence

Use this method to find unique sequences.

#


4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
# File 'lib/bioroebe/shell/shell.rb', line 4984

def do_analyze_sequence(
    i = sequence?
  )
  if i.is_a?(Array) and i.empty?
    i = sequence?
  end
  if i.empty? and (!aminoacid_sequence?)
    erev 'Please first assign a sequence.'
  elsif aminoacid_sequence?
    aminoacid_sequence = aminoacid_sequence?
    show_protein_composition(aminoacid_sequence)
    # ===================================================================== #
    # Also show the molecular mass.
    # ===================================================================== #
    molecular_mass_of_amino_acids_in_this_sequence(aminoacid_sequence)
  else
    erev 'Searching for '+steelblue('NLS sequences')+rev+' first:'
    run_nls_search
  end
end

#do_mutate_dna_sequence_at_this_nucleotide_position(this_nucleotide_position = 1, new_nucleotide = nil, old_sequence = dna_sequence? ) ⇒ Object

#

do_mutate_dna_sequence_at_this_nucleotide_position

You can use this method to mutate a DNA sequence at a given position.

The first argument should be the specific nucleotide position that you wish to modify. Keep in mind that in BioRoebe we will start to count at nucleotide position 1; in ruby Arrays, we would start to count at position 0 but DNA sequences don’t have a nucleotide called 0 by definition, hence why we use a more (bio)logical way that makes more sense.

Usage example:

random 15; mutate 1
#


5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
# File 'lib/bioroebe/shell/shell.rb', line 5022

def do_mutate_dna_sequence_at_this_nucleotide_position(
    this_nucleotide_position = 1,
    new_nucleotide           = nil,
    old_sequence             = dna_sequence?
  )
  if this_nucleotide_position.is_a? Array
    new_nucleotide = this_nucleotide_position[1] if this_nucleotide_position.size > 1
    this_nucleotide_position = this_nucleotide_position.first
  end
  # ======================================================================= #
  # === this_nucleotide_position must be a Fixnum past that point
  # ======================================================================= #
  this_nucleotide_position = this_nucleotide_position.to_i
  if this_nucleotide_position < 1
    this_nucleotide_position = 1 # 1 is minimum.
  end
  old_nucleotide = old_sequence[this_nucleotide_position-1, 1]
  unless new_nucleotide # Enter this clause if new_nucleotide is nil.
    new_nucleotide = (DNA_NUCLEOTIDES - [old_nucleotide]).sample # Obtain a random but different nucleotide.
  end
  erev 'At nucleotide position '+sfancy(this_nucleotide_position.to_s)+
       rev+' we will replace '+simp(old_nucleotide)+rev+' with '+
       simp(new_nucleotide)+rev+'.'
  old_sequence[this_nucleotide_position-1, 1] = new_nucleotide
  set_dna_sequence(old_sequence) # We'll also assign this.
end

#do_not_show_the_leader(be_verbose = true) ⇒ Object

#

do_not_show_the_leader

#


5824
5825
5826
5827
5828
5829
5830
5831
# File 'lib/bioroebe/shell/shell.rb', line 5824

def do_not_show_the_leader(
    be_verbose = true
  )
  if be_verbose
    e "The 3'-trailer of nucleotide sequences will not be shown."
  end
  @internal_hash[:show_the_leader] = false
end

#do_not_show_the_trailer(be_verbose = true) ⇒ Object

#

do_not_show_the_trailer

#


5812
5813
5814
5815
5816
5817
5818
5819
# File 'lib/bioroebe/shell/shell.rb', line 5812

def do_not_show_the_trailer(
    be_verbose = true
  )
  if be_verbose
    e "The 3'-trailer of nucleotide sequences will not be shown."
  end
  @internal_hash[:show_the_trailer] = false
end

#do_not_truncateObject

#

do_not_truncate

#


9351
9352
9353
9354
# File 'lib/bioroebe/shell/shell.rb', line 9351

def do_not_truncate
  ::Bioroebe.do_not_truncate
  erev 'We will no longer truncate too-long output.'
end

#do_not_use_working_directory_as_promptObject

#

do_not_use_working_directory_as_prompt

#


5101
5102
5103
# File 'lib/bioroebe/shell/shell.rb', line 5101

def do_not_use_working_directory_as_prompt
  @internal_hash[:use_working_directory_as_prompt] = false
end

#do_open(i) ⇒ Object

#

do_open

Open an URL - via browser.

#


11026
11027
11028
11029
11030
11031
11032
11033
# File 'lib/bioroebe/shell/shell.rb', line 11026

def do_open(i)
  case i
  when 'all','ALL'
    open_my_files
  else # Default.
    open_in_browser(i)
  end
end

#do_quit(determine_what_to_do = exit_the_shell_how? ) ⇒ Object

#

do_quit (exit tag, quit tag)

Consistently use this method when quitting from the shell. No exception!

On quitting, we may copy the bioroebe-files.

We may either return a symbol, or we may simply call exit.

#


11725
11726
11727
11728
11729
11730
11731
11732
11733
11734
11735
11736
11737
11738
11739
11740
11741
11742
11743
11744
11745
# File 'lib/bioroebe/shell/shell.rb', line 11725

def do_quit(
    # ===================================================================== #
    # The variable that comes next is usually a Symbol.
    # ===================================================================== #
    determine_what_to_do = exit_the_shell_how?
  )
  # ======================================================================= #
  # We can also copy the content of the Bioroebe-Project - but I am
  # not sure if this is worth the trade-off, so it was disabled again.
  # ======================================================================= #
  # copy_bioroebe_shell_before_quitting
  # ======================================================================= #
  considering_changing_the_title_of_the_kde_konsole_tab('')
  case determine_what_to_do
  when :instantly,
       nil
    :break
  else # This is valid for :exit_gracefully.
    return determine_what_to_do # Allo a graceful exit.
  end
end

#do_start_the_sinatra_interfaceObject

#

do_start_the_sinatra_interface

Invocation example:

biosh --sinatra
#


3184
3185
3186
3187
# File 'lib/bioroebe/shell/shell.rb', line 3184

def do_start_the_sinatra_interface
  require 'bioroebe/sinatra/sinatra_wrapper.rb'
  ::Bioroebe.start_sinatra_interface
end

#do_toggle_debug_valueObject

#

do_toggle_debug_value

#


6034
6035
6036
6037
6038
6039
6040
# File 'lib/bioroebe/shell/shell.rb', line 6034

def do_toggle_debug_value
  if @internal_hash[:debug]
    @internal_hash[:debug] = false
  else
    @internal_hash[:debug] = true
  end
end

#do_truncate?Boolean

#

do_truncate?

#

Returns:

  • (Boolean)


9333
9334
9335
# File 'lib/bioroebe/shell/shell.rb', line 9333

def do_truncate?
  ::Bioroebe.do_truncate?
end

#do_use_working_directory_as_promptObject Also known as: use_working_directory_as_prompt

#

use_working_directory_as_prompt

Use this method if you wish to use the working-directory as your prompt.

#


8686
8687
8688
# File 'lib/bioroebe/shell/shell.rb', line 8686

def do_use_working_directory_as_prompt
  @internal_hash[:use_working_directory_as_prompt] = true
end

#does_this_remote_file_exist?(i) ⇒ Boolean

#

does_this_remote_file_exist?

This method determines, based on wget, whether a remote file exists or whether it does not.

#

Returns:

  • (Boolean)


10284
10285
10286
10287
10288
10289
10290
10291
10292
10293
10294
10295
10296
10297
10298
10299
# File 'lib/bioroebe/shell/shell.rb', line 10284

def does_this_remote_file_exist?(i)
  remote_file_exists = false
  # ======================================================================= #
  # Use wget --spider to check if the remote file exists.
  # ======================================================================= #
  _ = "wget --spider -v #{i} 2>&1"
  result = `#{_}`
  if result.include?('Remote file exists') or # Yes, the remote file exists.
     result =~ /File '.+' exists./
    remote_file_exists = true
  end
  if result.include? '/404'
    remote_file_exists = false
  end
  return remote_file_exists
end

#downcase_main_stringObject

#

downcase_main_string (downcase tag, dcase tag)

Use this method to downcase the main sequence.

#


6929
6930
6931
6932
6933
6934
# File 'lib/bioroebe/shell/shell.rb', line 6929

def downcase_main_string
  downcased_sequence = seq?.downcase
  set_sequence(
    downcased_sequence
  )
end

#download(i) ⇒ Object

#

download (download tag)

General download handler. Some sequences will be changed, such as lambda (for the phage called lambda), to the corresponding entry at NCBI.

#


3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
# File 'lib/bioroebe/shell/shell.rb', line 3518

def download(i)
  if i.is_a? Array
    i.each {|entry| download(entry) }
  else
    case i.to_s
    # ===================================================================== #
    # === The lambda phage sequence
    #
    # Download the lambda-sequence, via:
    #
    #   download lambda
    #
    # ===================================================================== #
    when 'lambda',
         /^-?-?lambda(_|-)?genome$/i
      i = ::Bioroebe.map_ncbi_entry_to_eutils_id('NC_001416.1.fasta')+
          '.fasta'
    # ===================================================================== #
    # === Download the cytochrome c sequence (of humans)
    #
    # This should be equivalent to:
    #
    #   https://www.ncbi.nlm.nih.gov/protein/XP_011521207.1?report=fasta
    #
    # ===================================================================== #
    when /cytochrome_c_protein_sequence/
      return Bioroebe::Ncbi.efetch_by_url('NP_061820.1')
    # ===================================================================== #
    # === P1
    # ===================================================================== #
    when 'P1'
      i = ::Bioroebe.map_ncbi_entry_to_eutils_id('NC_005856.1.fasta')+
          '.fasta'
    # ===================================================================== #
    # === P2
    #
    # The P2 phage, from E. coli, a temperate phage.
    # ===================================================================== #
    when 'P2'
      i = ::Bioroebe.map_ncbi_entry_to_eutils_id('NC_041848.1.fasta')+
          '.fasta'
    # ===================================================================== #
    # === T12
    #
    # This is the Streptococcus phage T12.
    # ===================================================================== #
    when 'T12'
      i = ::Bioroebe.map_ncbi_entry_to_eutils_id('NC_028700.1.fasta')+
          '.fasta'
    # ===================================================================== #
    # === T2
    #
    # This is the phage T2.
    # ===================================================================== #
    when 'T2'
      i = ::Bioroebe.map_ncbi_entry_to_eutils_id('AP018813.1.fasta')+
          '.fasta'
    # ===================================================================== #
    # === T4
    #
    # This is the phage T4.
    # ===================================================================== #
    when 'T4'
      i = ::Bioroebe.map_ncbi_entry_to_eutils_id('NC_000866.4.fasta')+
          '.fasta'
    # ===================================================================== #
    # === T6
    #
    # This is the phage T6.
    # ===================================================================== #
    when 'T6'
      i = ::Bioroebe.map_ncbi_entry_to_eutils_id('MH550421.1.fasta')+
          '.fasta'
    # ===================================================================== #
    # === rhinovirus
    # ===================================================================== #
    when /^-?-?rhinovirus/i
      i = ::Bioroebe.map_ncbi_entry_to_eutils_id('NC_038311')+
          '.fasta'
    # ===================================================================== #
    # === Handle .pdb files here
    # ===================================================================== #
    when /\.pdb$/
      cd :download_directory
      wget i
      register_this_download(i)
      parse_this_pdb_file(File.basename(i))
    end
    # ===================================================================== #
    # === Handle Fasta files next
    # ===================================================================== #
    if i.end_with? '.fa' or i.end_with? '.fasta'
      i = i.dup if i.frozen?
      unless File.exist? i
        _ = Bioroebe::Ncbi.efetch_by_url(
             i.delete_suffix('.fasta')
           )
        if File.exist? _
          erev "The file is now available at `#{sfile(_)}`."
        end
      else
        # ================================================================= #
        # The above download_fasta() makes use of NCBI. We need to rewrite
        # this eventually. For now, we will do another, simpler approach
        # here.
        # ================================================================= #
        what = URI.open(i).read
        into = log_dir?+File.basename(i)
        erev "Storing into `#{sfile(into)}#{rev}`."
        write_what_into(what, into)
        return into # This will also return the local path.
      end
    else
      # erev 'Unsure what to do with '+sfancy(i)
      esystem "wget #{i}"
    end
  end
end

#download_fasta(i = nil) ⇒ Object

#

download_fasta

Use this to download a fasta sequence.

#


10234
10235
10236
10237
10238
10239
10240
10241
10242
10243
10244
10245
10246
10247
10248
10249
10250
10251
10252
10253
# File 'lib/bioroebe/shell/shell.rb', line 10234

def download_fasta(i = nil)
  if i.is_a? Array
    i.each {|entry|
      download_fasta(entry)
    }
  else
    # ===================================================================== #
    # Delegate to a special class here.
    # ===================================================================== #
    stored_here = ::Bioroebe.download_fasta(i) # bl $BIOROEBE/download_fasta.rb
    if stored_here
      if File.exist? stored_here
        assign_sequence(stored_here)
      end
      return stored_here
    else
      e crimson('No result could be found for ')+sfancy(i)+rev
    end
  end
end

#download_this_pdb_file(i = '3O30') ⇒ Object

#

download_this_pdb_file

Use this method to download a .pdb file.

There seem to be at least two major methods how to use the PDB database:

(1) http://www.rcsb.org/pdb/files/3O30.pdb
(2) http://www.rcsb.org/pdb/explore.do?structureId=1QRI

The files/ URI seems to redirect you directly to the .pdb file in question, so I think it is the preferred way. However had, the explore.do query gives additional information.

Other useful URLs are:

http://www.rcsb.org/pdb/explore.do?structureId=1ZAA
http://dx.doi.org/10.2210/pdb1gi5/pdb

Usage example:

download_this_pdb_file http://www.rcsb.org/pdb/files/3O30.pdb
#


3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
# File 'lib/bioroebe/shell/shell.rb', line 3889

def download_this_pdb_file(
    i = '3O30'
  )
  i = ['3O30'] if i.nil? # If nil, use a default value.
  if i.is_a? Array
    i = ['3O30'] if i.empty?
    i.each {|entry| download_this_pdb_file(entry) }
  else
    i = i.to_s.dup
    unless i.end_with? '.pdb'
      i << '.pdb'
    end
    unless i.start_with? 'http://www.rcsb.org/pdb/files/'
      i[0,0] = 'https://www.rcsb.org/pdb/files/'
    end
    target_dir = download_dir?
    cd target_dir
    # ===================================================================== #
    # http://www.rcsb.org/pdb/files/3O30.pdb
    # ===================================================================== #
    download_this = "#{i.to_s}"
    erev "Checking for the availability of "\
         "#{olivedrab(download_this)}#{rev} next ..."
    if does_this_remote_file_exist?(download_this)
      erev 'Next downloading '+sfancy(download_this)+
           rev+' into '+sfancy(target_dir)+'.'
      esystem "wget #{download_this}" # We will just use wget for now.
      _ = ::Bioroebe.pdb_directory?
      if File.directory? _
        new_target = _+File.basename(download_this)
        erev 'Moving into '+sfancy(new_target)+rev+', where '\
             '.pdb files are kept by default.'
        mv(
          target_dir+File.basename(download_this),
          new_target
        )
      end
      register_this_download(download_this)
    else
      erev "The remote file at #{sfile(download_this)} #{rev}does not exist."
      erev 'Hence, we can not download it.'
    end
  end
end

#dump(optional_arguments = nil) ⇒ Object

#

dump

This method can be used to save the main DNA string into a file.

You can also store RNA of course; simply pass the argument “rna” or “to_rna” to this method.

#


8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
8622
# File 'lib/bioroebe/shell/shell.rb', line 8608

def dump(
    optional_arguments = nil
  )
  what = dna_string?
  if optional_arguments.is_a? Array
    optional_arguments = optional_arguments.join(' ').strip
  end
  case optional_arguments
  when 'rna',/to_?rna/
    what = ::Bioroebe.to_rna(what)
  end
  into = file_dna_string_saved?
  erev 'Storing into `'+sfile(into)+'`.'
  write_what_into(what, into)
end

#e(i = '') ⇒ Object

#

e (e tag)

#


955
956
957
958
959
960
961
962
# File 'lib/bioroebe/shell/shell.rb', line 955

def e(
    i = ''
  )
  ::Bioroebe.e(i)
  if i and !i.empty?
    set_result(i) # This method will always assign to :result.
  end
end

#ee(i) ⇒ Object

#

ee (ee tag)

As e, but without newline. So basically it behaves like print.

#


969
970
971
# File 'lib/bioroebe/shell/shell.rb', line 969

def ee(i)
  e(i, false)
end

#efetch(i) ⇒ Object

#

efetch

Invocation example:

efetch https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=nuccore&id=189458859&rettype=fasta&retmode=text
#


1652
1653
1654
1655
1656
1657
1658
# File 'lib/bioroebe/shell/shell.rb', line 1652

def efetch(i)
  if i.is_a? Array
    i.each {|entry| efetch(entry) }
  else
    ::Bioroebe::Ncbi.efetch_by_url(i)
  end
end

#enable(i) ⇒ Object Also known as: use

#

enable (enable tag)

Enable-functionality can be passed through this method here.

Invocation example from within the bioshell:

enable colours
#


3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
# File 'lib/bioroebe/shell/shell.rb', line 3104

def enable(i)
  if i.is_a? Array
    i = i.join.strip
  end
  case i.to_s # case tag
  # ======================================================================= #
  # === enable cd_aliases
  #
  # This variant will be verbose.
  # ======================================================================= #
  when /^-?-?cd(-|_)?aliases$/
    erev 'class '+
         steelblue('Rcfiles::DirectoryAliases')+rev+' will be '\
         'enabled next, allowing'
    erev 'you to navigate the local filesystem '\
         'more easily so.'
    ::Bioroebe::Configuration.do_use_expand_cd_aliases
  # ======================================================================= #
  # === use colours
  # ======================================================================= #
  when /^colou?rs$/
    enable_colours
  # ======================================================================= #
  # === use xsel
  # ======================================================================= #
  when 'xsel'
    enable_xsel
  end
end

#enable_colours_in_an_extended_manner(be_verbose = :be_quiet) ⇒ Object Also known as: extended_enable_colours

#

enable_colours_in_an_extended_manner (enable tag)

We bundle all colour stuff here. Right now we use only the colour yellow.

#


10702
10703
10704
10705
10706
10707
10708
# File 'lib/bioroebe/shell/shell.rb', line 10702

def enable_colours_in_an_extended_manner(
    be_verbose = :be_quiet
  )
  enable_colours(be_verbose)
  ::Bioroebe.enable_colours
  set_default_highlight_colour
end

#enable_configurationObject

#

enable_configuration

#


10713
10714
10715
10716
10717
10718
10719
10720
10721
10722
10723
10724
10725
10726
10727
10728
10729
10730
10731
10732
10733
# File 'lib/bioroebe/shell/shell.rb', line 10713

def enable_configuration
  config_dir = ::Bioroebe.project_yaml_directory?+
               '/configuration/'
  unless Object.const_defined?(:Roebe) and
         Roebe.const_defined?(:Configuration)
    begin
      require 'roebe/configuration/class/configuration.rb'
    rescue LoadError; end
  end
  if Object.const_defined?(:Roebe) and
     Roebe.const_defined?(:Configuration)
    # ===================================================================== #
    # === Initialize @configuration
    # ===================================================================== #
    @configuration = ::Roebe::Configuration.new(config_dir, :do_not_run_yet)
    @configuration.be_verbose if @configuration.respond_to? :be_verbose
    @configuration.run
  else
    @configuration = nil
  end
end

#enable_gtkObject

#

enable_gtk

This enables gtk.

#


8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
# File 'lib/bioroebe/shell/shell.rb', line 8477

def enable_gtk
  begin
    if ENV['IS_ROEBE'].to_s
      load_gtk
      # =================================================================== #
      # Pulling in the controller.rb file is enough to also require the
      # other GTK-GUI components of the Bioroebe project.
      # =================================================================== #
      require 'bioroebe/gui/gtk3/controller/controller.rb'
    end
    return ::Bioroebe.controller # This will instantiate a new GTK widget.
  rescue LoadError => error
    e 'Failed to load GTK-related files. Showing the specific error next:'
    pp error
  end
end

#enable_gtk_section_antisensestrandObject

#

enable_gtk_section_antisensestrand

#


8505
8506
8507
8508
8509
# File 'lib/bioroebe/shell/shell.rb', line 8505

def enable_gtk_section_antisensestrand
  require 'bioroebe/gui/gtk3/anti_sense_strand/anti_sense_strand.rb'
  e 'Starting AntiSenseStrand ...'
  Bioroebe::GUI::Gtk::AntiSenseStrand.start_gui_application
end

#enable_xselObject

#

enable_xsel

#


9005
9006
9007
9008
9009
9010
9011
9012
# File 'lib/bioroebe/shell/shell.rb', line 9005

def enable_xsel
  if @internal_hash[:use_xsel]
    e 'xsel is already enabled.'
  else
    e 'Now enabling xsel.'
    @internal_hash[:use_xsel] = true
  end
end

#ensure_that_the_bioshell_log_directory_existsObject

#

ensure_that_the_bioshell_log_directory_exists

#


5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
# File 'lib/bioroebe/shell/shell.rb', line 5228

def ensure_that_the_bioshell_log_directory_exists
  # ======================================================================= #
  # We must check whether we really wish to create directories on startup
  # or not.
  # ======================================================================= #
  if @internal_hash and
     @internal_hash.has_key?(:create_directories_on_startup_of_the_shell) and
     @internal_hash[:create_directories_on_startup_of_the_shell]
    _ = bioshell_log_dir?
    unless File.directory? _
      unless @internal_hash[:silent_startup]
        erev "Next creating the directory #{sdir(_)}#{rev}."
      end
      mkdir(_)
    end
    # ===================================================================== #
    # Determine the path of the .yml file.
    # ===================================================================== #
    yaml_file = ::Bioroebe.project_yaml_directory?+
                'create_these_directories_on_startup/'\
                'create_these_directories_on_startup.yml'
    if File.exist? yaml_file
      YAML.load_file(yaml_file).each {|entry|
        # ================================================================= #
        # Create all specified subdirectories next.
        # ================================================================= #
        _ = "#{log_dir?}#{entry}/"
        unless File.directory? _
          unless @internal_hash[:silent_startup]
            erev "Next creating the directory #{sdir(rds(_))}#{rev}."
          end
          mkdir(_)
        end
      }
    end
  end
end

#enter_base_directoryObject

#

enter_base_directory

Use this method to enter the base directory.

#


6114
6115
6116
# File 'lib/bioroebe/shell/shell.rb', line 6114

def enter_base_directory
  cd ::Bioroebe.log_dir?
end

#enter_the_main_loopObject Also known as: loop_get_user_input, enter_main_loop

#

enter_the_main_loop (loop tag)

This is the main-loop of the shell.

#


11543
11544
11545
11546
11547
11548
11549
11550
11551
11552
11553
11554
11555
11556
11557
11558
11559
11560
11561
11562
11563
11564
11565
11566
11567
11568
11569
11570
11571
11572
11573
11574
11575
11576
11577
11578
11579
11580
11581
11582
11583
11584
11585
11586
11587
11588
11589
11590
11591
11592
11593
11594
11595
11596
11597
11598
11599
11600
11601
11602
11603
11604
11605
11606
11607
11608
11609
11610
11611
11612
11613
11614
11615
11616
11617
11618
11619
11620
11621
11622
11623
11624
11625
11626
11627
11628
11629
11630
11631
11632
11633
11634
11635
11636
11637
11638
11639
11640
11641
11642
11643
11644
11645
11646
11647
11648
11649
11650
11651
11652
11653
11654
11655
11656
11657
11658
11659
11660
11661
11662
11663
11664
11665
11666
11667
11668
11669
11670
11671
11672
11673
11674
11675
11676
11677
11678
11679
11680
11681
11682
11683
11684
11685
11686
11687
11688
11689
11690
11691
11692
11693
11694
11695
11696
11697
11698
11699
11700
11701
11702
11703
11704
11705
11706
11707
11708
11709
11710
11711
11712
# File 'lib/bioroebe/shell/shell.rb', line 11543

def enter_the_main_loop
  exit_from_the_main_loop = false
  loop {
    begin
      obtain_user_input                         # 1) Obtain the user input here.
      add_the_current_user_input_to_the_history # 2) Add the user input to the history.
      if @internal_hash[:user_input]
        unless @internal_hash[:user_input].empty?
          # =============================================================== #
          # Pass the user input into the menu next. We will use an
          # Array for this, as user input such as "ls; random 20" should
          # also be valid.
          # =============================================================== #
          user_input = [ @internal_hash[:user_input] ].flatten
          user_input.each {|use_this_as_user_input|
            # ============================================================= #
            # Keep track of the "original" input next:
            # ============================================================= #
            @internal_hash[:original_input] = use_this_as_user_input.dup.chomp.dup
            # ============================================================= #
            # Remove leading 5'- and trailing -3' as these are currently
            # forbidden as input. This check should come quite early.
            #
            # Example input for that may demonstrate this:
            #
            #   5'-ATGGGCAAA
            #
            # ============================================================= #
            use_this_as_user_input[0, 3] = '' if use_this_as_user_input.start_with?("5'-")
            use_this_as_user_input[-3,3] = '' if use_this_as_user_input.end_with?("-3'")
            use_this_as_user_input[-3,3] = '' if use_this_as_user_input.end_with?("-'3")
            # ======================================================================= #
            # === Handle special arguments next
            #
            # Must not start and end with a number, as we will assume input such
            # as "11 - 33" in this case. However had, input such as "random 333"
            # must remain valid.
            #
            # Note that the following input may also be valid:
            #
            #   3to1 ARG-ALA-SER-LEU-PHE-TRP-LYS-HIS-ASN-SER-VAL-LEU-ILE-VAL-PRO
            #
            # This explains why the Regex is a bit complicated.
            # ======================================================================= #
            if use_this_as_user_input.include?(' ') and
              (use_this_as_user_input !~ /^\d+\s+/) and
              (use_this_as_user_input !~ /^\d+.+\d{1,3}\s+$/)
              # ===================================================================== #
              # We must keep in mind that input may be an assignment too,
              # sometimes. In these cases the input will include a '='
              # character. But it could also be an assignment towards
              # a sequence, such as in the following case:
              #
              #   [33,0] = GAATTC
              #
              # ===================================================================== #
              case use_this_as_user_input
              # ===================================================================== #
              # === Assignment via [START_POSITION, END_POSITION]
              #
              # This is a shortcut that allows us to quickly grab a subsequence.
              #
              # See the following link for the explanation of the regex:
              #
              #   https://rubular.com/r/J13Eikdly0
              #
              # Usage example:
              #
              #   [33,0] = GAATTC
              #
              # ===================================================================== #
              when /^\[?(\d{0,10}),\s{0,1}(\d{0,10})\]?\s*=\s*'?([A-Za-z]*)'?$/
                start_position = $1.to_s.dup
                end_position   = $2.to_s.dup
                new_string     = $3.to_s.dup
                erev simp(new_string.size.to_s)+rev+' nucleotides will be inserted '\
                     'at nucleotide position '+
                     sfancy(start_position.to_s)+rev+'.'
                dna_sequence_object?[start_position, end_position] = new_string
                return # Do not evaluate any further for this entry point.
              # ===================================================================== #
              # === User may try a comparison such as:
              #
              #   ATCGATCGATCG == ATCGATCG
              #   ATG == ATG
              #
              # ===================================================================== #
              when /==/
                erev try_to_compare_these_two_sequences_for_equality(use_this_as_user_input)
                return # And "exit" here.
              end
            end
            # ======================================================================= #
            # === Chop off "?" if it is the last character
            # ======================================================================= #
            if use_this_as_user_input.end_with?('?') and (use_this_as_user_input.size > 1)
              if debug?
                ewarn 'Removing the last character `?` in order to '\
                      'simplify input handling.'
              end
              use_this_as_user_input.chop!
            end if remove_question_mark?
            # ======================================================================= #
            # Next check for three-letter code as input.
            # ======================================================================= #
            if use_this_as_user_input.include?('-') and
               Bioroebe.is_in_the_three_letter_code?(use_this_as_user_input)
              erev 'A three-letter aminoacid sequence was given as input.'
              erev 'This will be changed into the most likely aminoacid'
              erev 'sequence.'
              use_this_as_user_input = Bioroebe.deduce_most_likely_aminoacid_sequence_as_string(
                    Bioroebe.three_to_one(
                      use_this_as_user_input.delete('-')
                    )
                  )
              assign(use_this_as_user_input) { :be_verbose }
            end
            parse_this_user_input(use_this_as_user_input) # 3) Always parse the user input.
            # ============================================================= #
            # Intercept " quotes here.
            # ============================================================= #
            if use_this_as_user_input.include?('"') and use_this_as_user_input.include?(N)
              # a = start_clipboard('"') if i.include? '"'
              start_clipboard('"') if use_this_as_user_input.include? '"'
            end
            result_from_the_menu = menu(
              @internal_hash[:command_to_be_passed_to_the_menu]
            )
            case result_from_the_menu
            # ============================================================= #
            # === :exit_gracefully
            # ============================================================= #
            when :exit_gracefully
              say_goodbye
              exit_from_the_main_loop = true
            # ============================================================= #
            # === :break
            # ============================================================= #
            when :break
              case exit_the_shell_how?
              # =========================================================== #
              # === :exit_gracefully
              # =========================================================== #
              when :exit_gracefully # User wants to exit here.
                say_goodbye
                exit_from_the_main_loop = true
              # =========================================================== #
              # === :instantly
              # =========================================================== #
              when :instantly
                exit_from_the_main_loop = true
              end
              exit_from_the_main_loop = true
            else
            end
          }
          @internal_hash[:user_input] = nil # And clear it here again.
        end
      end
      if exit_from_the_main_loop == true
        break
      end
    # ===================================================================== #
    # Rescue sigints (aka ctrl-c) and SystemExit.
    # ===================================================================== #
    rescue Interrupt, SystemExit
      e
    end
  }
end

#ereturn(i = '') ⇒ Object

#

ereturn

#


6287
6288
6289
6290
# File 'lib/bioroebe/shell/shell.rb', line 6287

def ereturn(i = '')
  e i
  return
end

#erev(i = '') ⇒ Object

#

erev (erev tag)

Easier wrapper over output that has rev().

#


9247
9248
9249
# File 'lib/bioroebe/shell/shell.rb', line 9247

def erev(i = '')
  e "#{rev}#{i}"
end

#exit_the_shell_how?Boolean

#

exit_the_shell_how?

#

Returns:

  • (Boolean)


1059
1060
1061
# File 'lib/bioroebe/shell/shell.rb', line 1059

def exit_the_shell_how?
  @internal_hash[:exit_the_shell_how]
end

#extract_sequence_from_this_file(i) ⇒ Object Also known as: extract_sequence

#

extract_sequence_from_this_file

Use this method to extract a DNA sequence from the given file.

The given input should thus, logically, be an existing (local) file.

Currently this works via genbank .gb files but in the future, other formats may well be supported too.

#


8944
8945
8946
8947
8948
8949
8950
8951
8952
8953
8954
8955
8956
8957
8958
8959
8960
8961
8962
# File 'lib/bioroebe/shell/shell.rb', line 8944

def extract_sequence_from_this_file(i)
  if i.is_a? Array
    i.each {|entry| extract_sequence_from_this_file(entry) }
  else
    if File.exist? i
      extname = File.extname(i).delete('.')
      case extname
      when 'gb'
        # =================================================================== #
        # Handle genbank .gb files here.
        # =================================================================== #
        _ = ::Bioroebe::GenbankParser.new(i) { :do_not_report_anything }
        assign_sequence(_.sequence?)
      end
    else
      no_file_exists_at(i)
    end
  end
end

#fasta?Boolean Also known as: last_fasta?, last_fasta_entry?

#

fasta?

We need a query method over the main fasta object, IF it was set.

Since we already have an Array that keeps track of these objects, we can simply grab the last one from that collection.

#

Returns:

  • (Boolean)


3664
3665
3666
# File 'lib/bioroebe/shell/shell.rb', line 3664

def fasta?
  array_fasta?.last
end

#fasta_file?(i = :fasta_file) ⇒ Boolean

#

fasta_file?

#

Returns:

  • (Boolean)


6054
6055
6056
6057
6058
6059
6060
# File 'lib/bioroebe/shell/shell.rb', line 6054

def fasta_file?(i = :fasta_file)
  if @internal_hash[:fasta_file].has_key?(i)
    @internal_hash[:fasta_file].fetch(i)
  else
    erev 'We could not find the key called `'+simp(i.to_s)+rev+'`.'
  end
end

#feedback_versionObject

#

feedback_version

#


7560
7561
7562
# File 'lib/bioroebe/shell/shell.rb', line 7560

def feedback_version
  erev version?
end

#feedback_where_files_are_kept_locallyObject

#

feedback_where_files_are_kept_locally

We feedback where some files are kept, like the restriction enzymes.

#


8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
# File 'lib/bioroebe/shell/shell.rb', line 8116

def feedback_where_files_are_kept_locally
  erev 'The restriction enzymes are kept here:'
  e
  e "  #{sfile(::Bioroebe.restriction_enzymes_file)}"
  e
  erev 'The files with the mass table of the amino acids is kept here:'
  e
  e "  #{sfile(::Bioroebe::FILE_AMINO_ACIDS_MASS_TABLE)}"
  e
  report_where_we_store
end

#feedback_whether_we_are_in_debug_modeObject

#

feedback_whether_we_are_in_debug_mode

#


10766
10767
10768
# File 'lib/bioroebe/shell/shell.rb', line 10766

def feedback_whether_we_are_in_debug_mode
  erev 'Are we in debug mode? '+simp(debug?.to_s)+rev
end

#feedback_whether_we_will_also_set_the_xorg_bufferObject

#

feedback_whether_we_will_also_set_the_xorg_buffer

#


8701
8702
8703
8704
# File 'lib/bioroebe/shell/shell.rb', line 8701

def feedback_whether_we_will_also_set_the_xorg_buffer
  erev "Will we also set the Xorg buffer? "\
       "#{sfancy(vt(configuration?.additionally_set_xorg_buffer.to_s))}"
end

#fetch_from_pdb(i) ⇒ Object

#

fetch_from_pdb

This method can obtain a .pdb file from the pdb website.

It can also return the aminoacid sequence.

A URL for the .pdb may be available like this:

https://files.rcsb.org/view/2BTS.pdb
https://files.rcsb.org/view/355D.pdb

For the FASTA sequence, try:

https://www.rcsb.org/fasta/entry/2BTS/display
#


5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
# File 'lib/bioroebe/shell/shell.rb', line 5760

def fetch_from_pdb(i)
  if i.is_a? Array
    i = i.join(' ').strip
  end
  i.upcase!
  remote_url = "https://www.rcsb.org/structure/#{i}"
  erev 'Looking for the protein called '+steelblue(i)+rev+
       ' at pdb next. (URL: '+royalblue(remote_url)+rev+')'
  e
  open_in_browser(remote_url)
  e
  remote_url_to_the_pdb_file = "https://files.rcsb.org/view/#{i}.pdb"
  esystem "wget #{remote_url_to_the_pdb_file}"
  e
  begin
    erev 'The fasta sequence, obtained from '+remote_url+', is:'
    e
    result = ::Bioroebe.return_fasta_sequence_from_this_pdb_file(remote_url)
    e result
    e
    set_aminoacid_sequence(result) # And assign it as well.
  rescue Exception => error
    pp error
  end
  # ======================================================================= #
  # The file may be without a .pdb entry, so rename it in that case.
  # ======================================================================= #
  target = File.basename(remote_url_to_the_pdb_file)
  if File.exist? target
    unless target.end_with? '.pdb'
      unless File.exist? target+'.pdb'
        new_location = target
        rename_file(i, new_location) unless File.exist?(new_location)
        target = new_location
      end
    end
    move_file_to_its_correct_location(target)
  end
end

#file_dna_string_saved?Boolean

#

file_dna_string_saved?

#

Returns:

  • (Boolean)


10801
10802
10803
# File 'lib/bioroebe/shell/shell.rb', line 10801

def file_dna_string_saved?
  @internal_hash[:file_dna_string_saved]
end

#find_all_orfs(i = dna_sequence? ) ⇒ Object

#

find_all_orfs

This method will return all ORFs within the target sequence.

It will return an Array, and then we will display these ORFs, starting with the LONGEST ORF first.

#


11043
11044
11045
11046
11047
11048
11049
11050
11051
11052
11053
11054
11055
11056
11057
11058
11059
11060
11061
11062
11063
11064
11065
11066
11067
11068
11069
11070
11071
11072
11073
11074
11075
11076
11077
11078
11079
11080
11081
11082
11083
# File 'lib/bioroebe/shell/shell.rb', line 11043

def find_all_orfs(
    i = dna_sequence?
  )
  all_start_codons = i.to_enum(:scan, /#{::Bioroebe.start_codon?}/i).map { |match|
    [$`.size] # [$`.size, match]
  }
  all_stop_codons = i.to_enum(:scan, /(TGA|TAG|TAA)/i).map { |match|
    [$`.size]
  }
  array_with_the_proper_matches = []
  current_match = nil
  all_start_codons.each {|start_codon_position|
    start_codon_position = start_codon_position.first
    # ===================================================================== #
    # Find the nearest stop codon position.
    # ===================================================================== #
    all_stop_codons.reverse.each {|stop_codon_position|
      stop_codon_position = stop_codon_position.first
      length = stop_codon_position - start_codon_position
      next if length < 1
      current_match = [start_codon_position, length]
      if current_match
        # Must be a smaller match.
        if length < current_match[1] # [1] refers to the length.
          unless length < 3
            current_match = [start_codon_position, length]
          end
        end 
      end
    }
    array_with_the_proper_matches << current_match
  }
  cliner token: '-'
  pp array_with_the_proper_matches
  cliner token: '-'
  _ = dna_sequence?
  array_with_the_proper_matches.each {|start, stop|
    subsequence = _[start.to_i .. stop.to_i]
    erev subsequence unless subsequence.empty?
  }
end

#find_complementary_strand(i = dna_sequence? ) ⇒ Object Also known as: show_complementary_strand

#

find_complementary_strand

Invoke this via:

3'-ATGCCTGCC
#


11879
11880
11881
11882
11883
11884
11885
11886
11887
11888
11889
11890
11891
11892
11893
11894
11895
11896
11897
# File 'lib/bioroebe/shell/shell.rb', line 11879

def find_complementary_strand(
    i = dna_sequence?
  )
  _ = i.strip # The original input.
  if _.include? "3'-" and _.start_with?('3')
    _.gsub!(/3'-/,'')
    _.gsub!(/-5'/,'')
    _.gsub!(/3'-/,'')
    erev lpad?+leading_three_prime+
         colourize_nucleotide(_, :do_not_add_anything_else)+
         trailing_five_prime
  end
  result = lpad?+
           colourize_nucleotide(
             return_complement(i.reverse)
           )
  erev result
  return result
end

#find_gene(i = :default) ⇒ Object

#

find_gene

Wrapper towards class Bioroebe::FindGene.

#


11185
11186
11187
11188
11189
11190
11191
11192
11193
11194
11195
# File 'lib/bioroebe/shell/shell.rb', line 11185

def find_gene(i = :default)
  case i
  when :default, nil
    i = dna_sequence?
  end 
  if i.empty?
    report_that_a_string_must_be_assigned_first
  else
    ::Bioroebe::FindGene.new(i.upcase) # bl $BIOROEBE/find_gene.rb
  end
end

#find_kdel_sequenceObject

#

find_kdel_sequence

#


4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
# File 'lib/bioroebe/shell/shell.rb', line 4570

def find_kdel_sequence
  # ======================================================================= #
  # We must operate on the aminoacid-sequence next.
  # ======================================================================= #
  aminoacid_sequence = aminoacid_sequence?.to_s
  scan_result = aminoacid_sequence.scan(/KDEL/)
  has_kdel = scan_result.empty?
  if has_kdel
    erev 'This sequence has at the least '+
         steelblue('one')+' KDEL sequence. '\
         '(Has '+scan_result.size.to_s+')'
  else
    erev 'This sequence does not have any KDEL sequence.'
  end
end

#find_longest_substring(i = dna_string?) ) ⇒ Object

#

find_longest_substring

#


6207
6208
6209
6210
6211
6212
# File 'lib/bioroebe/shell/shell.rb', line 6207

def find_longest_substring(i = dna_string?)
  if i.is_a? String and i.include? ' '
    i = i.split(' ')
  end
  ::Bioroebe::FindLongestSubstring.new(i.first, i.last)
end

#find_longest_substring_via_LCS(i) ⇒ Object

#

find_longest_substring_via_LCS

To invoke this, try:

longest_substring? ATTATTGTT | ATTATTCTT
#


7777
7778
7779
7780
# File 'lib/bioroebe/shell/shell.rb', line 7777

def find_longest_substring_via_LCS(i)
  i = i.join(' | ') if i.is_a? Array
  ::Bioroebe::FindLongestSubstringViaLCSalgorithm.new(i) { :do_also_show_the_two_sequences }
end

#find_restriction_enzymes_that_cut_at(i) ⇒ Object

#

find_restriction_enzymes_that_cut_at

A wrapper over find_restriction_sites().

#


9037
9038
9039
9040
9041
9042
9043
9044
# File 'lib/bioroebe/shell/shell.rb', line 9037

def find_restriction_enzymes_that_cut_at(i)
  erev 'Trying to find restriction enzymes that '\
       'cut at `'+sfancy(i)+rev+'`.'
  result = find_restriction_sites(i)
  unless result
    erev 'Found no result for this sequence.'
  end
end

#find_restriction_sites(i = string?) ) ⇒ Object

#

find_restriction_sites

Call the parent method in the Bioroebe class.

#


8230
8231
8232
8233
# File 'lib/bioroebe/shell/shell.rb', line 8230

def find_restriction_sites(i = string?)
  i = string? if i.nil?
  Bioroebe.restriction_sites?(i) # bl mybioruby
end

#find_shine_dalgarno_sequence(i = dna_sequence_as_string? ) ⇒ Object

#

find_shine_dalgarno_sequence

Use this method to attempt to try and find a SD-sequence.

#


3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
# File 'lib/bioroebe/shell/shell.rb', line 3286

def find_shine_dalgarno_sequence(
    i = dna_sequence_as_string?
  )
  i.upcase! # Need to ensure upcased input.
  pure_sd_sequence = 'AGGAGGU'.dup
  if is_dna?
    pure_sd_sequence.tr!('U','T')
  end
  if i.nil?
    report_that_a_string_must_be_assigned_first
  else
    sd_sequence = steelblue(
      dna_padding(pure_sd_sequence, :no_spaces).lstrip
    )
    if i.include? 'T' # Assume that we have a DNA string rather than RNA.
      pure_sd_sequence = 'AGGAGGT'
      sd_sequence = steelblue(
        dna_padding(pure_sd_sequence, :no_spaces).lstrip
      )
    end
    if i.include? pure_sd_sequence
      erev "Yes, our string contains at least one Shine Dalgarno "\
           "(#{sd_sequence}#{rev}) sequence."
      n_sd_sequences = i.scan(/#{pure_sd_sequence}/).size.to_s
      erev 'We have found '+sfancy(n_sd_sequences)+rev+' instance(s) of '\
           'Shine Dalgarno ('+sd_sequence+rev+') Sites.'
      erev 'We will next show the particular sequence in '\
           'question ('+simp(pure_sd_sequence)+rev+').'
      # =================================================================== #
      # Next, try to find restriction enzymes that cut at the
      # Shine-Dalgarno site.
      # =================================================================== #
      try_to_find_restriction_enzymes_for(:shine_dalgarno)
    else
      erev "We did not find a Shine Dalgarno ("\
           "#{simp(sd_sequence)}#{rev}) sequence."
    end
  end
end

#first(i) ⇒ Object

#

first

#


7069
7070
7071
7072
7073
7074
7075
7076
# File 'lib/bioroebe/shell/shell.rb', line 7069

def first(i)
  if i.to_s =~ /^\d+$/ # If the input is only numbers
    erev 'Obtaining the first '+simp(i).to_s+rev+' nucleotides next:'
    erev simp(seq?[0,i.to_i])
  else # Else change the first nucleotide.
    change_first_nucleotide_to(f)
  end
end

#first_argument?Boolean Also known as: f?, f

#

first_argument?

#

Returns:

  • (Boolean)


7438
7439
7440
# File 'lib/bioroebe/shell/shell.rb', line 7438

def first_argument?
  @internal_hash[:first_argument]
end

#format_this_nucleotide_sequence(i, &block) ⇒ Object

#

format_this_nucleotide_sequence

This method will properly format the passed-in nucleotide sequence, by making use of class ShowNucleotideSequence.

It will return the formatted String.

#


6105
6106
6107
# File 'lib/bioroebe/shell/shell.rb', line 6105

def format_this_nucleotide_sequence(i, &block)
  ::Bioroebe.format_this_nucleotide_sequence(i) { block }
end

#freeze_the_main_sequenceObject

#

freeze_the_main_sequence

#


5359
5360
5361
# File 'lib/bioroebe/shell/shell.rb', line 5359

def freeze_the_main_sequence
  @internal_hash[:the_main_sequence_is_frozen] = true
end

#generate_palindrome(i) ⇒ Object

#

generate_palindrome

This method will generate a Palindrome sequence.

#


3642
3643
3644
3645
# File 'lib/bioroebe/shell/shell.rb', line 3642

def generate_palindrome(i)
  i = i.join.strip if i.is_a? Array
  ::Bioroebe::PalindromeGenerator.new(i).report
end

#generate_pdf_tutorialObject

#

generate_pdf_tutorial

Easier wrapper to generate the .pdf Tutorial.

#


5983
5984
5985
# File 'lib/bioroebe/shell/shell.rb', line 5983

def generate_pdf_tutorial
  ::Bioroebe.generate_pdf_tutorial
end

#generate_random_dna_sequence_with_variable_length_and_variable_compositionObject

#

generate_random_dna_sequence_with_variable_length_and_variable_composition

This method will generate a random DNA sequence of variable length and composition.

#


2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
# File 'lib/bioroebe/shell/shell.rb', line 2836

def generate_random_dna_sequence_with_variable_length_and_variable_composition
  e 'Input the desired length of your DNA string:'
  length = $stdin.gets.chomp.to_i
  e 'Input the percentage of Adenine, Thymin, Cytosine and Guanosine. You can'
  e 'omit this, in which case we will default to 25% each.'
  e 'Use a / as delimiter please, as in '+
    orange('30 / 30 / 20 / 20')+rev+'.'
  e
  print 'Adenine / Thymin / Cytosine / Guanosine: '
  composition = $stdin.gets.chomp
  if composition.include? '/'
    splitted = composition.split('/').
               map(&:strip).map(&:to_f)
  else
    splitted = [25,25,25,25]
  end
  # ======================================================================= #
  # Next, we fill in our pool of nucleotides.
  # ======================================================================= #
  pool_of_nucleotides = []
  # ======================================================================= #
  # Next, we must determine how many we will use. The percentage value
  # tells us this.
  # The entries are e. g. 35%. So we first must calculate how much is
  # 1%, then we multiply this.
  # ======================================================================= #
  n_A = (length.to_f / 100) * splitted[0].to_f
  n_T = (length.to_f / 100) * splitted[1].to_f
  n_C = (length.to_f / 100) * splitted[2].to_f
  n_G = (length.to_f / 100) * splitted[3].to_f
  pool_of_nucleotides << (['A'] * n_A)
  pool_of_nucleotides << (['T'] * n_T)
  pool_of_nucleotides << (['C'] * n_C)
  pool_of_nucleotides << (['G'] * n_G)
  pool_of_nucleotides.flatten!
  _ = ''.dup # This is the return string.
  _ << pool_of_nucleotides.shuffle.join
  return _
end

#generate_random_protein_sequence_with_variable_length_and_variable_compositionObject

#

generate_random_protein_sequence_with_variable_length_and_variable_composition

Use this method to generate a random protein sequence with variable length and variable composition.

#


7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
# File 'lib/bioroebe/shell/shell.rb', line 7600

def generate_random_protein_sequence_with_variable_length_and_variable_composition
  _ = {} # This is our hash.
  e 'You can generate a random protein sequence next. First, input the'
  print 'target length of the protein in question: '
  length = $stdin.gets.chomp.to_i
  e
  e 'Next, you have to input the percentage for the respective amino '\
    'acids, separated via the token '+orange('/')+rev+'.'
  e
  e 'This can be quite tedious though. Unfortunately, there is not a'
  e 'much simpler way possible on the commandline, so here we go:'
  e
  print 'Glycine Alanine Valine: '
  glycine_alanine_valine   = $stdin.gets.chomp
  glycine, alanine, valine = glycine_alanine_valine.split('/').map(&:strip)
  _['glycine'] = glycine
  _['alanine'] = alanine
  _['valine'] = valine
  e 'The length of the target protein is '+simp(length.to_s)+'.'
e swarn('!!! THE ABOVE CODE ^^^ IS UNFINISHED !!!!!')+rev
end

#generate_single_sequence_repeatsObject

#

generate_single_sequence_repeats

This method can be used to generate SSR sequences.

#


5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
# File 'lib/bioroebe/shell/shell.rb', line 5582

def generate_single_sequence_repeats
  _ = ''.dup
  length_of_the_SSR_sequence = 2+rand(4) # 2-5
  length_of_the_SSR_sequence.times {
    _ << return_random_nucleotide
  }
  n_repeats = 9+rand(22) # 9-30
  result = _ * n_repeats
  return result
end

#get_long_name_of_amino_acid(i) ⇒ Object

#

get_long_name_of_amino_acid

#


5865
5866
5867
5868
5869
5870
5871
5872
5873
# File 'lib/bioroebe/shell/shell.rb', line 5865

def get_long_name_of_amino_acid(i)
  amino_acids_table = AMINO_ACIDS
  if amino_acids_table.has_key? i
    _ = amino_acids_table[i]
    key = _.keys.select {|inner_key| inner_key.size == 3 }[0]
    i = _[key].to_s
  end
  return i
end

#guanin?Boolean

#

guanin?

#

Returns:

  • (Boolean)


10137
10138
10139
# File 'lib/bioroebe/shell/shell.rb', line 10137

def guanin?
  YAML.load_file(FILE_NUCLEOTIDES)['Guanin']
end

#handle_fasta(i) ⇒ Object Also known as: assign_fasta, handle_this_fasta_file

#

handle_fasta

Use this method to properly handle a fasta file.

The argument should be the (local) path to a fasta file.

#


4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
# File 'lib/bioroebe/shell/shell.rb', line 4349

def handle_fasta(i)
  if i.nil?
    if File.exist? fasta_file?.to_s
      e sfile(fasta_file?.to_s)
    else
      show_my_fasta_file # As a reminder.
    end
  else
    i = i.to_s unless i.is_a? String # Need a String past this point.
    if File.exist?(i) and i.end_with?('.fasta')
      opnerev 'Trying to parse the file `'+sfile(i)+rev+'` next.'
      parse_fasta_format(i)
    else
      fasta_files = Dir['*.fasta']
      unless fasta_files.empty?
        erev 'There seems to be at least one .fasta file in this '\
             'directory ('+sdir(return_pwd)+').'
      end
    end
  end
end

#handle_pdb_files(i) ⇒ Object

#

handle_pdb_files

This method will either show more information about .pdb files or it will simply attempt to download the .pdb file in question.

#


1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
# File 'lib/bioroebe/shell/shell.rb', line 1666

def handle_pdb_files(i)
  if i.nil? or i.empty?
    # In this case, we show some info.
    cliner
    erev '.pdb files are files in the "Protein Data Bank" format.'
    e
    erev 'It is a standard for files containing atomic coordinates.'
    e
    erev 'Each line in a .pdb file is called a "record".'
    e
    erev 'You can pass an ID (a number) and we will attempt to download '\
         'that .pdb file.'
    e
    erev 'Example:'
    e
    erev '  pdb 333'
    e
    erev 'More information can be seen here:'
    e
    efancy '  https://www.cgl.ucsf.edu/chimera/docs/UsersGuide/tutorials/pdbintro.html'
    e
    print rev
    cliner
  else
    download_this_pdb_file(i)
  end
end

#handle_this_file(this_file) ⇒ Object

#

handle_this_file

This method can be used to handle a file in general.

#


4014
4015
4016
4017
4018
# File 'lib/bioroebe/shell/shell.rb', line 4014

def handle_this_file(this_file)
  if File.exist?
    e File.read(this_file)
  end
end

#highlight_colour?Boolean Also known as: yellow

#

highlight_colour?

The highlight colour is primarily the colour that we will use on the commandline, for instance, to denote pretty colours.

#

Returns:

  • (Boolean)


9579
9580
9581
# File 'lib/bioroebe/shell/shell.rb', line 9579

def highlight_colour?
  @highlight_colour
end

#identify_aminoacid(i) ⇒ Object

#

identify_aminoacid

This method will also display the long name of the aminoacid at hand.

Note that you can also identify a batch of aminoacids, by using the ‘-’ character.

Example for this:

identify_aminoacid A-Z

We will ignore invalid aminoacids though.

#


8734
8735
8736
8737
8738
8739
8740
8741
8742
8743
8744
8745
8746
8747
8748
8749
8750
8751
8752
8753
8754
8755
8756
8757
8758
8759
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
# File 'lib/bioroebe/shell/shell.rb', line 8734

def identify_aminoacid(i)
  if i.is_a? Array
    i.flatten!
    if i.any? {|inner_entry| inner_entry.include? '-'}
      # =================================================================== #
      # In this case, at the least one entry has a '-' Range component.
      # So we must substitute there.
      # =================================================================== #
      i.map! {|most_inner_entry|
        if most_inner_entry.include?('-')
          # =============================================================== #
          # Assume a Range in this case and prepare it accordingly.
          # =============================================================== #
          chars = most_inner_entry.chars
          start_position = chars.first
          end_position   = chars.last
          most_inner_entry = (start_position .. end_position).to_a
          most_inner_entry = strict_filter_away_invalid_aminoacids(most_inner_entry)
          most_inner_entry
        end
        most_inner_entry
      }
    end
    # ===================================================================== #
    # Recursively call the method if the input is an Array.
    # ===================================================================== #
    i.flatten!
    e; i.each {|entry|
      identify_aminoacid(entry)
    }; e
  else # else assume a String.
    _ = ::Bioroebe::AMINO_ACIDS_MASS_TABLE
    if i.empty?
      erev 'Please supply at the least one character '\
           '(aminoacid one letter code).'
    elsif _.has_key? i
      long_name_of_the_aminoacid = FILE_AMINO_ACIDS_ENGLISH[i]
      erev i.ljust(3)+' ('+sfancy(long_name_of_the_aminoacid)+
           rev+') corresponds to a molecular weight of '+
           simp(_[i])+rev+' Dalton.'
    else
      erev "Did not find `#{simp(i)}`."
    end
  end
end

#include?(i) ⇒ Boolean

#

include?

This can be used to check if we include a string or not.

#

Returns:

  • (Boolean)


3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
# File 'lib/bioroebe/shell/shell.rb', line 3939

def include?(i)
  _ = dna_string?
  if _
    if _.include? i
      erev 'Yes, we found it. It is at:'
      pp _.scan(/#{i}/)
    else
      erev 'No, we did not find it.'
    end
  else
    erev 'It seems as if you yet have not defined a main string.'
    erev 'Please do so first, via assign() or random().'
  end
end

#index_this_fasta_file(i) ⇒ Object

#

index_this_fasta_file

This will index FASTA files (.fa or .fasta) via the samtools.

#


9184
9185
9186
9187
9188
9189
9190
9191
9192
9193
9194
9195
9196
9197
9198
9199
9200
9201
9202
9203
9204
9205
9206
9207
9208
9209
9210
# File 'lib/bioroebe/shell/shell.rb', line 9184

def index_this_fasta_file(i)
  # ======================================================================= #
  # === Handle blocks first
  # ======================================================================= #
  if block_given?
    yielded = yield
    case yielded
    when :use_all_fasta_files_if_no_argument_was_given
      if i.nil? or i.empty?
        i = Dir['*.fasta']+
            Dir['*.fa'].flatten.compact
      end
    end
  end
  if i.is_a? Array
    i.each {|entry| index_this_fasta_file(entry) }
  else
    i = i.to_s # Need to work on a String past this point.
    if File.exist? i
      erev "Indexing the following file next, via "\
           "#{steelblue('samtools')}#{rev}:"
      Bioroebe.index_this_fasta_file(i)
    else
      no_file_exists_at(i)
    end
  end
end

#initialize_clipboardObject

#

initialize_clipboard

#


7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
# File 'lib/bioroebe/shell/shell.rb', line 7149

def initialize_clipboard
  begin
    require 'roebe/classes/clipboard.rb'
  rescue LoadError; end
  if Object.const_defined?(:Roebe) and
     Roebe.const_defined?(:Clipboard)
    @internal_hash[:clipboard] = Roebe::Clipboard.new
  else
    @internal_hash[:clipboard] = nil
  end
end

#initialize_main_sequence(n_nucleotides = 250) ⇒ Object Also known as: reset_string

#

initialize_main_sequence

Initialize a Sequence-object on startup. We use the length 150 for now.

#


8350
8351
8352
8353
8354
8355
8356
8357
# File 'lib/bioroebe/shell/shell.rb', line 8350

def initialize_main_sequence(n_nucleotides = 250)
  sequence_object = Bioroebe::Sequence.new(n_nucleotides)
  # ======================================================================= #
  # Add support for some methods, such as "to_rna":
  # ======================================================================= #
  sequence_object.automatic_support_for_nucleotides
  @internal_hash[:array_dna_sequences] << sequence_object
end

#initialize_the_user_input_specific_variablesObject

#

initialize_the_user_input_specific_variables

#


7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
# File 'lib/bioroebe/shell/shell.rb', line 7402

def initialize_the_user_input_specific_variables
  # ======================================================================= #
  # === :all_arguments
  #
  # This variable will hold all arguments given by the user.
  # ======================================================================= #
  @internal_hash[:all_arguments] = []
  # ======================================================================= #
  # === :remaining_arguments
  # ======================================================================= #
  @internal_hash[:remaining_arguments] = []
  # ======================================================================= #
  # === :first_argument
  #
  # This variable refers to the first argument passed into a method,
  # from the menu.rb file.
  # ======================================================================= #
  @internal_hash[:first_argument] = nil
  # ======================================================================= #
  # === :command_to_be_passed_to_the_menu
  #
  # This is the command that will be passed into menu().
  # ======================================================================= #
  @internal_hash[:command_to_be_passed_to_the_menu] = nil
end

#install(i) ⇒ Object

#

install (install tag)

#


1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
# File 'lib/bioroebe/shell/shell.rb', line 1697

def install(i)
  case i.to_s
  when 'bioruby',
       'bioroebe',
       'bio',
       '1', # install bioroebe.
       :default
    erev 'We now install Bioruby.'
    file_location = '/home/x/src/bioruby/bioruby-2.0.0.tar.xz'
    begin
      Easycompile::Easycompile.new(file_location) # Make use of Easycompile to install it.
    rescue Exception => error
      pp error
    end
  else
    ewarn "Do not know how to install `#{simp(i)}`."
  end
end

#interactive_colour_menuObject

#

interactive_colour_menu

#


8865
8866
8867
8868
8869
8870
8871
8872
8873
8874
8875
8876
8877
8878
8879
8880
8881
8882
8883
8884
8885
8886
8887
8888
8889
8890
8891
8892
# File 'lib/bioroebe/shell/shell.rb', line 8865

def interactive_colour_menu
  erev 'You can decide here whether you want to use colours or not, and if'
  erev 'you want to use colours, whether these will be simple ansi colours'
  erev 'or the "more advanced" konsole submodule of the colours project.'
  e
  erev '  (1) no colours'
  erev '  (2) ansi colours'
  erev '  (3) konsole colours'
  e
  print 'Input your choice next: '
  user_input = $stdin.gets.chomp
  case user_input
  # === 1
  when '1'
    erev 'We will use no colours.'
    disable_colours
  # === 2
  when '2'
    erev 'We will use ansi colours.'
    enable_colours unless use_colours?
    Shell.set_colour(:AnsiColours)
  # === 3
  when '3'
    erev 'We will use konsole colours.'
    enable_colours unless use_colours?
    Shell.set_colour(:Konsole)
  end
end

#interactive_use_of_levensthein(i = all_arguments? ) ⇒ Object

#

interactive_use_of_levensthein

#


4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
# File 'lib/bioroebe/shell/shell.rb', line 4261

def interactive_use_of_levensthein(
    i = all_arguments?
  )
  require 'bioroebe/string_matching/levensthein.rb'
  erev 'You want to use class '+steelblue('Bioroebe::Levensthein')+
        rev+'. This class needs two'
  erev 'input sequences (defaulting to nucleotides).'
  e
  if i.nil? or i.empty?
    erev 'Input the nucleotide sequence to the '+
         slateblue('first')+rev+' sequence:'
    print '  '; sequence1 = $stdin.gets.chomp
    e
    erev 'Input the nucleotide sequence to the '+
         slateblue('second')+rev+' sequence:'
    print '  '; 
    sequence2 = $stdin.gets.chomp
    ::Bioroebe::Levensthein.new(sequence1, sequence2)
  else
    ::Bioroebe::Levensthein.new(i)
  end
end

#interactively_pick_colourObject

#

interactively_pick_colour

This method can be used to interactively assign a new colour for the rev() part.

#


8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
# File 'lib/bioroebe/shell/shell.rb', line 8276

def interactively_pick_colour
  erev 'You can pick a Konsole colour here, for rev(), which is '\
       'the default colour.'
  erev 'In order to make it a bit easier for you, we will show 5 '\
       'random examples for this:'
  string = ''.dup
  5.times {
    string << ::Colours.colours.sample << ', '
  }
  erev "  #{string}"
  erev 'Input your Colours colour next:'
  user_input = $stdin.gets.chomp
  colour_to_use = ::Colours.send(user_input.to_sym)
  erev colour_to_use+'Testing: '+rev
  # ======================================================================= #
  # Next, set a new default colour to use.
  # ======================================================================= #
  ::Bioroebe.set_default_colour(colour_to_use)
end

#is_a_registered_compound?(i) ⇒ Boolean

#

is_a_registered_compound?

#

Returns:

  • (Boolean)


6200
6201
6202
# File 'lib/bioroebe/shell/shell.rb', line 6200

def is_a_registered_compound?(i)
  %w( glycine ).include? i.to_s.downcase
end

#is_a_stop_codon?(i) ⇒ Boolean

#

is_a_stop_codon?

#

Returns:

  • (Boolean)


4172
4173
4174
# File 'lib/bioroebe/shell/shell.rb', line 4172

def is_a_stop_codon?(i)
  ::Bioroebe.is_a_stop_codon?(i)
end

#is_any_nucleotide_assigned?Boolean

#

is_any_nucleotide_assigned?

#

Returns:

  • (Boolean)


8369
8370
8371
# File 'lib/bioroebe/shell/shell.rb', line 8369

def is_any_nucleotide_assigned?
  !sequence_object?.empty? # If the sequence is not empty, it is assigned.
end

#is_dna?Boolean

#

is_dna?

#

Returns:

  • (Boolean)


10867
10868
10869
# File 'lib/bioroebe/shell/shell.rb', line 10867

def is_dna?
  mode? == :dna
end

#is_palindrome?(i) ⇒ Boolean

#

is_palindrome?

#

Returns:

  • (Boolean)


7625
7626
7627
# File 'lib/bioroebe/shell/shell.rb', line 7625

def is_palindrome?(i)
  erev ::Bioroebe.is_palindrome?(i) # is_palindrome? GATC
end

#is_the_main_sequence_frozen?Boolean Also known as: the_main_sequence_is_frozen?

#

is_the_main_sequence_frozen?

#

Returns:

  • (Boolean)


5373
5374
5375
# File 'lib/bioroebe/shell/shell.rb', line 5373

def is_the_main_sequence_frozen?
  @internal_hash[:the_main_sequence_is_frozen]
end

#is_this_a_cd_alias?(i) ⇒ Boolean

#

is_this_a_cd_alias?

The reason why this does a check for :Rcfiles is because not every user may have the rcfiles-project available.

#

Returns:

  • (Boolean)


7512
7513
7514
7515
# File 'lib/bioroebe/shell/shell.rb', line 7512

def is_this_a_cd_alias?(i)
  Object.const_defined?(:Rcfiles) and
  ::Rcfiles::DirectoryAliases.is_this_input_a_cd_alias?(i)
end

#is_this_a_valid_codon?(i) ⇒ Boolean

#

is_this_a_valid_codon?

This method can determine whether the given input is a valid codon or whether it is not.

#

Returns:

  • (Boolean)


6307
6308
6309
# File 'lib/bioroebe/shell/shell.rb', line 6307

def is_this_a_valid_codon?(i)
  ::Bioroebe.is_this_a_valid_codon?(i)
end

#last_inputted_command?(array_history = array_history? ) ⇒ Boolean

#

last_inputted_command?

This method will return the last user-inputted element.

#

Returns:

  • (Boolean)


5154
5155
5156
5157
5158
5159
5160
# File 'lib/bioroebe/shell/shell.rb', line 5154

def last_inputted_command?(
    array_history = array_history?
  )
  if array_history and array_history.respond_to?(:last)
    return array_history.last
  end
end

#leading_3_primeObject Also known as: leading_three_prime, leading_3

#

leading_3_prime

This is when 3’ is at the start of an output.

#


8052
8053
8054
# File 'lib/bioroebe/shell/shell.rb', line 8052

def leading_3_prime
  "3' - "
end

#leading_5_prime(get_rid_of_spaces = false) ⇒ Object Also known as: five_prime, leading_five_prime, leader, lead_five_prime, return_five_prime_header, leading_five, five_leader?

#

leading_5_prime

This method will output the leading 5’ part, like a header.

#


6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
# File 'lib/bioroebe/shell/shell.rb', line 6165

def leading_5_prime(
    get_rid_of_spaces = false
  )
  if show_the_leader?
    get_rid_of_spaces = true if get_rid_of_spaces == :no_spaces
    _ = "5' - ".dup # <- This here is the header-tag.
    _.delete!(' ') if get_rid_of_spaces
    return _
  end
  return ''
end

#left_chop(i) ⇒ Object

#

left_chop

#


10478
10479
10480
# File 'lib/bioroebe/shell/shell.rb', line 10478

def left_chop(i)
  chop(i, :left)
end

#list(i = nil) ⇒ Object

#

list

#


3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
# File 'lib/bioroebe/shell/shell.rb', line 3972

def list(i = nil)
  case i
  # ======================================================================= #
  # === list ages
  # ======================================================================= #
  when /^age/
    erev 'We will next list the maximum age of different organisms.'
    if File.exist? BIO_LANG
      hash_results = {}
      dataset = File.read(BIO_LANG)
      n_entries = dataset.scan(/  max_age: /).count
      name_of_organism = ''
      dataset.split(N).each {|line|
        next if line.start_with? '#'
        next if line.empty?
        unless line.start_with?(' ')
          name_of_organism = line.delete(':').strip
        end
        if line.include? '  max_age: '
          its_max_age = line.gsub(/max_age:/,'').strip
          if its_max_age.include? '#'
            its_max_age = its_max_age[0, its_max_age.index('#')]
          end
          its_max_age.strip!
          its_max_age << ' years' unless its_max_age.end_with? 'years'
          hash_results[name_of_organism] = its_max_age
        end
      }
      erev 'We did find '+sfancy(n_entries.to_s)+' results.'
      e
      hash_results.sort_by {|value, key| key }.reverse.each { |name, age|
        erev '  '+(name+':').ljust(30)+' '+sfancy(age.rjust(12))
      }; e # Trailing newline looks nice.
    end
  end
end

#load(i = file_dna_string_saved? ) ⇒ Object Also known as: load_dataset_from

#

load (load tag)

This method will try to load from the given input, if this is an existing file.

#


4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
# File 'lib/bioroebe/shell/shell.rb', line 4119

def load(
    i = file_dna_string_saved?
  )
  if i.nil?
    load(file_dna_string_saved?)
  # ======================================================================= #
  # === Handle Arrays
  # ======================================================================= #
  elsif i.is_a? Array
    if i.nil? or i.empty?
      load(file_dna_string_saved?) # Handle default input given.
    else # else batch-process the Array next:
      i.each {|entry| load(entry) }
    end
  else
    i = i.to_s
    # ===================================================================== #
    # Check for i being a number:
    # ===================================================================== #
    if i =~ /^\d+$/i
      entries = Dir['*']
      sorted_entries = entries.sort_by {|entry|
        File.basename(entry).downcase
      }
      i = sorted_entries[i.to_i - 1]
      erev "Using the file #{sfile(i)}.#{rev}"
    end
    if i
      if File.exist? i
        data = File.read(i).chomp
        assign_sequence data
      else
        erev 'Can not read from file '+sfile(i)+rev+
             ' as it does not exist.'
      end
    else
      load_my_file
    end
  end
end

#load_dnaObject

#

load_dna

This method will assign from the default file.

#


10790
10791
10792
10793
10794
10795
10796
# File 'lib/bioroebe/shell/shell.rb', line 10790

def load_dna
  _ = file_dna_string_saved?
  if File.exist? _
    erev "Now loading from the file #{sfile(_)}#{rev}."
    assign(_)
  end
end

#load_gtkObject

#

load_gtk

Load my gtk module.

#


8466
8467
8468
8469
8470
# File 'lib/bioroebe/shell/shell.rb', line 8466

def load_gtk
  begin
    require 'gtk_paradise/require_gtk3.rb'
  rescue LoadError; end
end

#load_gtk3_component_aminoacid_compositionObject

#

load_gtk3_component_aminoacid_composition

#


8456
8457
8458
8459
# File 'lib/bioroebe/shell/shell.rb', line 8456

def load_gtk3_component_aminoacid_composition
  require 'bioroebe/gui/gtk3/aminoacid_composition/aminoacid_composition.rb'
  Bioroebe::GUI::Gtk::AminoacidComposition.run(aminoacid_sequence?)
end

#load_my_fileObject

#

load_my_file (load tag)

We will use this method to load the shell-file.

#


4165
4166
4167
# File 'lib/bioroebe/shell/shell.rb', line 4165

def load_my_file
  assign(save_file?, :do_not_upcase)
end

#log_user_input?Boolean

#

log_user_input?

Delegate to the class method here, via this wrapper-method.

#

Returns:

  • (Boolean)


1232
1233
1234
# File 'lib/bioroebe/shell/shell.rb', line 1232

def log_user_input?
  ::Bioroebe::Configuration.log_user_input?
end

#main_colourObject Also known as: main_col

#

main_colour

#


8309
8310
8311
# File 'lib/bioroebe/shell/shell.rb', line 8309

def main_colour
  ::Bioroebe.main_colour
end

#mass_weight(i = aminoacids?, , be_verbose = true) ⇒ Object

#

mass_weight (mass_weight tag)

This will calculate the weight of some Aminoacids.

#


3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
# File 'lib/bioroebe/shell/shell.rb', line 3204

def mass_weight(
    i          = aminoacids?,
    be_verbose = true
  )
  if i.nil? and aminoacids?
    i = aminoacids?
  end
  if i.nil?
    erev 'Please first assign some aminoacids, like GGG.'
  else
    erev 'Now calculating the weight of `'+sfancy(i)+rev+'`.'
    e
    sum = 0
    i.split(//).each {|aminoacid|
      if aminoacid
        weight = ::Bioroebe::AMINO_ACIDS_MASS_TABLE[aminoacid]
        if be_verbose
          erev '  The weight for '+royalblue(aminoacid)+
               rev+
               ' is: '+
                sfancy(
                  weight.to_s.ljust(6,'0').rjust(10)
                )+rev
        end
        sum += weight
      end
    }
    rounded_sum  = sum.round
    n_aminoacids = i.to_s.chars.size 
    erev '  The total sum of these '+simp(n_aminoacids)+rev+
         ' aminoacids (the raw weight) is: '+sfancy(rounded_sum.to_s)
    adjusted_value = sum - ((n_aminoacids - 1) * 18) # 18 for the H2O molecule.
    erev '  The adjusted value (including loss of water '\
         'molecules in the peptide bonds) is: '+
         sfancy(adjusted_value.round(1).to_s)
    e
  end
end

#may_we_show_the_startup_information?Boolean

#

may_we_show_the_startup_information?

#

Returns:

  • (Boolean)


6280
6281
6282
# File 'lib/bioroebe/shell/shell.rb', line 6280

def may_we_show_the_startup_information?
  @internal_hash[:may_we_show_the_startup_information]
end
#

menu (menu tag)

#


16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
# File 'lib/bioroebe/shell/menu.rb', line 16

def menu(
    i                                     = command_to_be_passed_to_the_menu?,
    report_if_we_did_not_find_the_command = true
  )
  # ======================================================================= #
  # === Handle special instructions given to the second arguments
  # ======================================================================= #
  case report_if_we_did_not_find_the_command
  # ======================================================================= #
  # === :dont_report
  # ======================================================================= #
  when :dont_report,
       :be_quiet,
       :be_quiet_if_the_input_was_not_found
    report_if_we_did_not_find_the_command = false
  end
  if i.is_a?(Array) and !i.empty?
    i.flatten.each {|entry|
      menu(entry, report_if_we_did_not_find_the_command)
    }
  else
    i = i.to_s.strip
    case i # (case tag, casetag, realcase tag)
    # ===================================================================== #
    # === bioroebe --sinatra
    #
    # This entry point starts the sinatra web-interface.
    # ===================================================================== #
    when /^-?-?sinatra2$/i,
         /^-?-?start(_|-| )?sinatra2$/i,
         /^-?-?sinatra$/i
      do_start_the_sinatra_interface
    # ===================================================================== #
    # === mkdir
    # ===================================================================== #
    when /^mkdir$/
      mkdir(f?)
    # ===================================================================== #
    # === no_colours
    # ===================================================================== #
    when 'nocol',
         'noco',
         /^-?-?no(_|-| )?colou?rs?$/,
         /^-?-?disable(_|-| )?colours$/,
         'dcolours'
      disable_colours
    # ===================================================================== #
    # === disable_colours_in_an_extended_manner
    # ===================================================================== #
    when /disable(_|-| )?colours(_|-| )?in(_|-| )?an(_|-| )?extended(_|-| )?manner$/
      disable_colours_in_an_extended_manner(:be_verbose)
    # ===================================================================== #
    # === uniprot
    #
    # This entry point allows the user to download data from uniprot
    # quickly, via the bioshell interface.
    #
    # Invocation examples:
    #
    #   uniprot 2BTS
    #   uniprot A2Z669
    #
    # ===================================================================== #
    when /^uniprot(_|-| )?fetch$/,
         /^uniprot$/i,
         /^unifetch$/i,
         /^fetch(_|-| )?data(_|-| )?from(_|-| )?uniprot$/
      result = uniprot_fetch(f)
      set_result(result)
    # ===================================================================== #
    # === dna_seq?
    # ===================================================================== #
    when 'dna_seq?',
         'dnaseq?',
         'seq?',
         'seqß',
         'dna?',
         'sequence?',
         'string?',
         'sq?',
         'data?',
         's?',
         'show2',
         'show?',
         'report?',
         'print',
         'output',
         /^show(_|-| )?string$/i,
         /^print(_|-| )?dna$/i,
         /^show(_|-| )?dna$/i,
         /^main(_|-| )?string$/i,
         /^show(_|-| )?dna(_|-| )?sequence$/i,
         /^showsequence$/i,
         /^showseq$/i,
         /^dna(_|-| )?string\??$/i,
         'mainstring?',
         'mstring?',
         'dnaß',
         'sdna',
         'normal',
         'DNA?'
      show_dna_sequence
    # ===================================================================== #
    # === Bioroebe.sequence
    # ===================================================================== #
    when 'Bioroebe.sequence?',
         'Bioroebe.seq?'
      e Bioroebe.sequence?
    # ===================================================================== #
    # === dna_sequence?
    # ===================================================================== #
    when /^dna_?sequence\?$/
      pp dna_sequence?
    # ===================================================================== #
    # === fasta?
    # ===================================================================== #
    when 'fasta?',
         /handle_?fasta/ # Feedback information from a local fasta file.
      handle_fasta(a?)
    # ===================================================================== #
    # === chop_to
    #
    # Usage example:
    #
    #   chop_to :ATG
    #
    # ===================================================================== #
    when /^chop_?to$/
      chop_to(a?)
    # ===================================================================== #
    # === chop
    # ===================================================================== #
    when 'chop'
      chop(a?)
    # ===================================================================== #
    # === choppity
    # ===================================================================== #
    when 'choppity',/chop_?codon/
      chop(3)
    # ===================================================================== #
    # === chop33
    # ===================================================================== #
    when /chop(\d+)/ # See: http://rubular.com/r/VWiUYgr5Xq
      chop($1.to_s)
    # ===================================================================== #
    # === default_colours_for_the_aminoacids
    # ===================================================================== #
    when /default(_|-| )?colours(_|-| )?for(_|-| )?the(_|-| )?aminoacids/
      e
      config?.default_colours_for_the_aminoacids.each_pair {|one_letter, colour_to_use|
        e '  '+one_letter+' '+
          ::Colours.send(colour_to_use.to_sym, colour_to_use)+
          rev
      }
      e
    # ===================================================================== #
    # === bioshell_log_dir?
    # ===================================================================== #
    when /bioshell(_|-| )?log(_|-| )?dir\??/i
      e
      e steelblue("  #{log_dir?}bioshell/")
      e
    # ===================================================================== #
    # === dna_to_aminoacids
    #
    # Usage example:
    #
    #   toAA ACGTACGTAGTCATCAGTCAGTA
    #
    # ===================================================================== #
    when /^dna_?to_?aminoacids$/,
         'translate_dna_into_aminoacid',
         'translatednaintoaminoacid',
         'trans',
         'transl',
         'trnas',
         'translateaminoacidintodna',
         'toprotein',
         'to_protein',
         'to_aminoacid',
         'to_aminoacids',
         'aa',
         'toproteins',
         'toaminoacids',
         /to(_|-| )?aa/i,
         'translate',
         'mega',
         'toprotei',
         'translate_aminoacids',
         'toprot',
         'toamin',
         'toamino'
      arguments = a?
      if arguments and arguments.is_a?(Array) and arguments.empty?
        arguments = dna_sequence_as_string?
      end
      show_all_deducible_aminoacid_sequences(arguments)
      if dna_seq?.empty? # This here is ok because the above method checks whether there was a DNA sequence assigned.
        return
      else
        e
        show_protein_composition(
          translate_dna_into_aminoacid(arguments)
        )
        if arguments.empty?
          arguments = dna_sequence?.dup unless a
        end
        ::Bioroebe::DnaToAminoacidSequence.new(arguments)
      end
    # ===================================================================== #
    # === set_dna_sequence
    #
    # Usage examples:
    #
    #   set_sequence /Depot/j/foobar.fasta
    #   set_sequence ACGTACGTACA
    #   set_sequence 555
    #
    # ===================================================================== #
    when 'set_dna_sequence',
         'setdnasequence',
         'setdna',
         'assign',
         'set_dna',
         'assign_sequence',
         'sequence',
         'seq',
         's',
         'asign',
         'set_seq',
         'setseq',
         'assing',
         'set',
         'assig',
         'set_string',
         'setstring',
         'ass',
         'setseq1',
         'setda',
         'read',
         /^assign(_|-| )?dna$/,
         /^assign(_|-| )?this(_|-| )?dna(_|-| )?sequence$/,
         /^set(_|-| )?sequence$/
      set_dna_sequence(a?, :be_verbose) # Always be verbose.
      show_sequence
    # ===================================================================== #
    # === to_mRNA
    # ===================================================================== #
    when /^to(_|-| )?mRNA$/i,
         'mrna',
         /convert_five_prime_dna_into_five_prime_mrna/i
      convert_five_prime_dna_into_five_prime_mrna
    # ===================================================================== #
    # === random
    # ===================================================================== #
    when 'random',
         'rand',
         'ran',
         'ra',
         'random?',
         'rand?',
         'generate',
         'randomseq',
         'ramdpm',
         'setrandom',
         'andom',
         'rando',
         'raond',
         'rnadom',
         'ranom',
         'ranomd',
         'create'
      random(f, remaining_arguments?) # Generate some DNA sequence.
      show_dna_sequence
    # ===================================================================== #
    # === random_dna
    # ===================================================================== #
    when 'random_dna',
         'generate_dna3','generate_dna_variable_composition',
         'generate_random_dna_sequence_with_variable_length_and_variable_composition',
         'generatedna3',
         'generatednavariablecomposition',
         'gdna3',
         'randomdna'
      result = generate_random_dna_sequence_with_variable_length_and_variable_composition
      e result # Display it.
      assign_sequence(result) # And assign it too.
    # ===================================================================== #
    # === is_a_aminoacid?
    #
    # To test this entry point, try:
    #
    #   is_a_aminoacid? Alanin  # => false
    #   is_a_aminoacid? Alanine # => true
    #
    # ===================================================================== #
    when 'is_a_aminoacid?','isaa?'
      pp ::Bioroebe.is_aminoacid?(f?)
    # ===================================================================== #
    # === piped
    # ===================================================================== #
    when 'piped',
         /^show_?codon_?piped_?sequence$/i,
         /^vertical(_|-| )?bar$/i,
         'as_pipe',
         /^codon(_|-| )?piped$/i
      show_codon_piped_sequence
    # ===================================================================== #
    # === pubmed_search
    #
    # Invocation example:
    #
    #   pubmed_search science[journal]+AND+breast+cancer+AND+2008[pdat]
    #
    # ===================================================================== #
    when /^pubmed(_|-| )?search/
      perform_a_pubmed_search(all_arguments?)
    # ===================================================================== #
    # === nohyphen
    #
    # This entry point removes all hyphens.
    #
    # Example:
    #
    #   nohyphen GCA-GCA-AGA-GGA-CTA-AAA-AAA-AAA-CTA-AAA-CTA-ATG-ATG-GCA-GCA-GCA-GCA-GCA
    #
    # ===================================================================== #
    when /nohyphen/
      erev a.join.delete('-')
    # ===================================================================== #
    # === random_aa
    # ===================================================================== #
    when 'random_aa',
         'randomaa',
         'set_random_aminoacids',
         'randomAA',
         'random_aminacids',
         'create_random_aminoacids',
         'random_aminoacids',
         'randomaminoacids'
      set_random_aminoacids
    # ===================================================================== #
    # === all_aminoacids?
    # ===================================================================== #
    when 'all_aminoacids?','display_all_aminoacids','displayallaminoacids',
         'shortnames?',
         'print_aa',
         'printaa',
         'daminoacids',
         'aminoacids_shortnames'
      display_all_aminoacids
    # ===================================================================== #
    # === report_n_start_codons
    #
    # This entry point will report how many start codons can be found
    # in the main Sequence.
    #
    # Invocation example:
    #
    #   report_n_start_codons
    #
    # ===================================================================== #
    when /^report(_|-| )?n(_|-| )?start(_|-| )?codons$/i
      report_n_start_codons
    # ===================================================================== #
    # === palindromes?
    # ===================================================================== #
    when 'palindromes?',
         'PalindromeFinder',
         'pali',
         'palindrome?',
         'pfinder',
         'palindromes'
      ::Bioroebe::PalindromeFinder.new(dna_string?)
    # ===================================================================== #
    # === is_palindrome?
    #
    # Usage examples:
    #
    #   is_palindrome? ATTA
    #   is_palindrome? ATAT
    #
    # ===================================================================== #
    when 'is_palindrome?',
         'ispalindrome?',
         'is_palindrome',
         'is_palindromic?',
         'is_pal?',
         'palindromic?',
         'palinomer?'
      is_palindrome?(f)
    # ===================================================================== #
    # === append
    # ===================================================================== #
    when 'append','<<','merge'
      append(a?) # Call it directly.
    # ===================================================================== #
    # === clear
    # ===================================================================== #
    when 'clear'
      clear(a?)
    # ===================================================================== #
    # === print_aa_table
    # ===================================================================== #
    when 'table_aa','tableaa','print_aa_table','printaatable',
         'molmassen','supertable','table?','maintable',
         'amino_acid_weight','aatable',
         'print_aminoacid_table',
         'patable',
         /^Aminoacids(_|-| )?Mass(_|-| )?Table$/i,
         /^aminoacids(_|-| )?weights\??$/i,
         /^aas(_|-| )?weights\??$/i
      print_aa_table
    # ===================================================================== #
    # === degenerate_primer
    #
    # Invocation example:
    #
    #   dprimer M-T-T-Y-Y-T-A-A-A-STOP
    #
    # ===================================================================== #
    when /^degenerate(_|-| )?primer$/i,
         'degenerate',
         'dprimer', # dprimer M-T-T-Y-Y-T-A-A-A-STOP
         'dprime',
         'dprim',/back_?to_?dna/
      a = aminoacid_sequence? if a.nil? or a.empty?
      dna_sequence = ConvertAminoacidToDNA.new(a?).dna_sequence?.delete('-') # bl $BIOROEBE/convert_aminoacid_to_dna.rb
      erev swarn('Note')+rev+': If you want to assign this DNA sequence to become the new'
      erev 'main sequence, then input:'
      e
      erev orange('  assign_this_dna_sequence')
      e
      @internal_hash[:misc_sequence] = dna_sequence 
    # ===================================================================== #
    # === show_codon_table
    #
    # This entry point can be used to show the (default) codon table,
    # aka the eukaryotic codon table.
    #
    # Usage examples:
    #
    #   ctable
    #   ctable 4
    #
    # ===================================================================== #
    when /^show(_|-)?codon(_|-)?table$/i,
         'codontable?',
         'codontable',
         'codontable2',
         'codon_table?',
         'ctable',
         'ctble',
         'table2',
         'ctable?',
         'alltables'
      show_codon_table(a?)
    # ===================================================================== #
    # === aa_to_dna
    #
    # Translate the aminoacids to the DNA sequence.
    #
    # Usage examples:
    #
    #   aa_to_dna MTTT
    #   aa_to_dna KLMRST
    #
    # ===================================================================== #
    when /^aa(-|_)?to(-|_)?dna$/i
      aa_to_dna(a?)
    # ===================================================================== #
    # === pubmed?
    # ===================================================================== #
    when 'pub',
         'pubmed',
         'pubmed?' # pubmed tag
      pubmed(f?)
    # ===================================================================== #
    # === open_my_files
    # ===================================================================== #
    when /^open(_|-)?my(_|-)?files$/i,
         /^my(_|-)?files$/i,
         'ofiles'
      open_my_files
    # ===================================================================== #
    # === set_codon_table
    # ===================================================================== #
    when 'set_codon_table',
         'setcodontable',
         'codon_table=',
         'ctable=',
         /^choose(_|-)?codon(_|-)?table$/i,
         'choosecodontable',
         'pick_codon_table',
         'codon_table',
         'setcodon',
         'set_codon'
      set_codon_table(f)
    # ===================================================================== #
    # === left_add
    #
    # This will add n nucleotides to the "left" end, aka the 5' end of
    # a DNA or RNA sequence.
    #
    # Invocation example:
    #
    #   left_add 10
    #   ladd 20
    #
    # ===================================================================== #
    when /left(_|-)?add/,
         'ladd'
      left_add(a?)
    # ===================================================================== #
    # === last_input?
    # ===================================================================== #
    when 'last_input?','input?','show_last_input','sli',
         'showlastinput'
      show_last_input
    # ===================================================================== #
    # === human_chromosome_22
    #
    # The human chromosome number 22.
    # ===================================================================== #
    when 'human_chromosome_22'
      _ = 'http://hgdownload.cse.ucsc.edu/goldenpath/hg19/chromosomes/chr22.fa.gz'
      e _
      download _
    # ===================================================================== #
    # === sendai
    #
    # The Sendai virus genome, a 15384 bp genome.
    # ===================================================================== #
    when 'sendai'
      e 'https://www.ncbi.nlm.nih.gov/nuccore/9627219'
    # ===================================================================== #
    # === set_start_codon
    # ===================================================================== #
    when 'set_start_codon',
         'setstartcodon',
         'start_codon=',
         'setinitcodon'
      set_start_codon(f)
    # ===================================================================== #
    # === ncbi_taxonomy?
    # ===================================================================== #
    when 'ncbi_taxonomy?'
      browse_to 'http://www.ncbi.nlm.nih.gov/taxonomy/'
    # ===================================================================== #
    # === itax
    # ===================================================================== #
    when 'itax','taxonomy',
         'tax'
      ::Bioroebe::Taxonomy.interactive :run_connected
    # ===================================================================== #
    # === show_remote_urls
    # ===================================================================== #
    when /^show(_|-)?remote(_|-)?urls$/i,
         'url',
         'taxonomy_urls?',
         'remote_url',
         'ncbi?',
         'sremote'
      Bioroebe.show_remote_urls_to_the_NCBI_taxonomy_webpage(f)
    # ===================================================================== #
    # === n_species?
    # ===================================================================== #
    when 'n_species?',
         'n_species',
         'nspecies?',
         'nspecies',
         /^report(_|-| )?n(_|-| )?species$/i
      ::Bioroebe::Taxonomy.report_n_species
    # ===================================================================== #
    # === home?
    # ===================================================================== #
    when /^home\??$/i
      report_where_the_home_directory_can_be_found
    # ===================================================================== #
    # === codon
    #
    # This entry point will quickly show the codon (the aminoacid
    # sequence) of the given input sequence.
    #
    # Usage example:
    #
    #   codon AAAGUCCAUAAA
    #
    # ===================================================================== #
    when 'codon'
      codon(a?)
    # ===================================================================== #
    # === to_rna
    # ===================================================================== #
    when '@rna',
         'to_rna',
         /^-?-?to_?RNA$/i,
         'rna',
         'dna2rna', # You can also use this like so: ATCGTTGC.to_rna
         'rna_translate',
         'rnatranslate',
         'rna?',
         'transcribe',
         'rawrna'
      show_rna_sequence(f)
    # ===================================================================== #
    # === automatically_rename_this_fasta_file
    #
    # This entry-point can be used to automatically rename a FASTA file.
    # ===================================================================== #
    when /^-?-?automatically(_|-)?rename(_|-)?this(_|-)?fasta(_|-)?file$/i,
         /^-?-?infer(_|-)?fasta$/i,
         /^-?-?ifasta$/i
      automatically_rename_this_fasta_file(a)
    # ===================================================================== #
    # === show_both_strands
    # ===================================================================== #
    when 'show_both_strands',
         'both','dual',
         'showbothstrands',
         /^-?-?show(_|-)?both(_|-)?dna(_|-)?strands$/i,
         'double',
         'show_double_strand',
         /^dsDNA$/i
      show_both_dna_strands
    # ===================================================================== #
    # === UAG?
    # ===================================================================== #
    when /^UAG\??$/i
      this_sequence = dna_string?
      use_this_start_codon = 'UAG'
      if this_sequence.include? 'U'
      else
        use_this_start_codon = 'TAG'
      end
      _ = search_sequence_for_open_reading_frames(
        this_sequence,
        :frame1, # use_which_frame
        use_this_start_codon
      )
      if _.empty?
        erev 'No substring '+i.to_s.delete('?')+' was found.'
      else
        show_nucleotide_sequence?.display(i) {{ colourize_this_subsequence: use_this_start_codon }}
      end
    # ===================================================================== #
    # === size?
    # ===================================================================== #
    when 'size?',
         'nuc?',
         'size',
         'nsizes',
         'nsize',
         'length?',
         'len?',
         'len',
         'report_length_of_the_dna_string',
         'sizeß',
         'n?'
      report_size_of(f?)
    # ===================================================================== #
    # === find_orfs
    # ===================================================================== #
    when 'find_orfs',
         /^find(_|-)?all(_|-)?orfs$/i,
         'forfs','forf'
      find_all_orfs
    # ===================================================================== #
    # === prepend_start
    # ===================================================================== #
    when 'pstart',
         'prepend_start',
         'appendstart',
         'start'
      add_to_start :start
    # ===================================================================== #
    # === fancy
    # ===================================================================== #
    when 'fancy'
      display_open_reading_frames
    # ===================================================================== #
    # === fetch
    #
    # This entry point allows the user to fetch a (remote) .pdb file.
    #
    # Invocation example:
    #
    #   fetch 2BTS
    #
    # ===================================================================== #
    when /^fetch(_|-)?from(_|-)?pdb$/,
         'fetch'
      fetch_from_pdb(f)
    # ===================================================================== #
    # === reverse_complement
    #
    # This entry point will build the "reverse complement" sequence
    # to a given DNA sequence at hand.
    # ===================================================================== #
    when /^reverse(_|-)?complement$/i,
         /^rev(_|-)?complement$/i,
         'rcomplement',
         'rcompl'
      reverse_complement(f)
    # ===================================================================== #
    # === P00995
    # ===================================================================== #
    when 'P00995'
      oib 'https://www.uniprot.org/uniprot/P00995'
      download_this_fasta_sequence 'https://www.uniprot.org/uniprot/P00995.fasta'
    # ===================================================================== #
    # === brenda
    # ===================================================================== #
    when /^brenda$/i
      open_in_browser('https://www.brenda-enzymes.org/')
    # ===================================================================== #
    # === expasy
    # ===================================================================== #
    when /^expasy$/i
      open_expasy(a?)
    # ===================================================================== #
    # === 9cutters
    # ===================================================================== #
    when '9cutter',
         '9cutters',
         '9-cutters',
         '9cut'
      show_restriction_enzymes '9'
    # ===================================================================== #
    # === code?
    # ===================================================================== #
    when 'code?','code','translate_aminoacids_into_dna'
      translate_aminoacids_into_dna(a?)
    # ===================================================================== #
    # === wormbase?
    # ===================================================================== #
    when 'wormbase?',
         'wormbase'
      e (_ = Bioroebe.try_to_pass_through_beautiful_url(_))
        open_in_browser _
    # ===================================================================== #
    # === promoters?
    # ===================================================================== #
    when /^promoters?\??$/,
         /^search_?for_?known_?promoters$/
      search_for_known_promoters
    # ===================================================================== #
    # === samino
    # ===================================================================== #
    when 't2','translate2','aminoacid??','shorten',
         /shorten_?aminoacid/,'samino',
         'saminoacid'
      shorten_aminoacid(a?)
    # ===================================================================== #
    # === frameshift
    # ===================================================================== #
    when 'frameshift','frame','shift','shifter','shifting',
         'perform_frameshift_action','performframeshiftaction',
         'fr','frame?'
      perform_frameshift_action(a?)
    # ===================================================================== #
    # === GPCR?
    # ===================================================================== #
    when 'GPCR?','gpcr?'
      _ = 'http://www.gpcr.org/7tm/'
      e simp(_)+rev
      set_xorg_buffer(_) if @configuration.additionally_set_xorg_buffer
    # ===================================================================== #
    # === generate_random_protein_sequence_with_variable_length_and_variable_composition'
    # ===================================================================== #
    when /^generate(_|-)?random(_|-)?protein(_|-)?sequence(_|-)?with(_|-)?variable(_|-)?length(_|-)?and(_|-)?variable(_|-)?composition$/
      generate_random_protein_sequence_with_variable_length_and_variable_composition
    # ===================================================================== #
    # === wobble?
    # ===================================================================== #
    when 'wobble',
         'wobble?'
      erev 'CAGUI, G->C(U) und U->A(G)sowie I->U,C,A, an der '\
           '5 Prime Position der tRNA.'
    # ===================================================================== #
    # === RNAfold2
    # ===================================================================== #
    when 'RNAfold2'
      esystem 'RNAfold -p --MEA < test.seq'
    # ===================================================================== #
    # === nucleotide_position?
    # ===================================================================== #
    when 'nucleotide_position?',
         'nucleotideposition?',
         'position?'
      show_position_for_the_main_sequence
    # ===================================================================== #
    # === find_gene
    # ===================================================================== #
    when 'find_gene',
         'findgene',
         'fgene',
         'genes?',
         'fingene'
      find_gene(a?)
    # ===================================================================== #
    # === to_talen
    # ===================================================================== #
    when /^to(-|_| )?talen$/,
         'talen',
         '2talen'
      to_talen(a?)
    # ===================================================================== #
    # === debug
    # ===================================================================== #
    when 'debug',
         'deb'
      f 'Toggling debug from '+sfancy(debug?.to_s)+' to: '
      do_toggle_debug_value
      e debug?
    # ===================================================================== #
    # === 2cutters
    # ===================================================================== #
    when '2cutter',
         '2cutters',
         '2-cutters',
         '2cut'
      show_restriction_enzymes '2'
    # ===================================================================== #
    # === 3cutters
    # ===================================================================== #
    when '3cutter',
         '3cutters',
         '3-cutters',
         '3cut'
      show_restriction_enzymes '3'
    # ===================================================================== #
    # === Handle input such as "658-660 =     CCA"
    # ===================================================================== #
    when /^(\d+)(\.\.|-)(\d+)\s*=\s*(.*)$/ # See: https://rubular.com/r/hDLHLND7cc
      _ = dna_sequence? # Keep a reference copy.
      start_position = $1.to_s.to_i # 11-12 = AA
      end_position   = $3.to_s.to_i
      new_sequence   = $4.to_s.strip
      old_sequence   = _[start_position-1, (end_position - start_position)+1]
      erev 'We will perform a match assignment at nucleotide position '+
           start_position.to_s+'-'+end_position.to_s+rev+
           '. The'
      erev 'old subsequence was: '+sfancy(old_sequence)+rev+
           ' - the new subsequence will be '+simp(new_sequence)
      new_sequence.delete!("'")
      _[start_position-1, (end_position - start_position)+1] = new_sequence
      set_dna_sequence(_)
    # ===================================================================== #
    # === dna_analyze
    # ===================================================================== #
    when /^dna(_|-)?analyze$/,
         'danalyze'
      analyze(a?) { :dna }
    # ===================================================================== #
    # === dash
    # ===================================================================== #
    when 'dash',
         'dashed',
         'spacer',
         /^splitted(_|-)?form$/
      show_sequence_in_splitted_form(f,'-')
    # ===================================================================== #
    # === leucine_zippers?
    # ===================================================================== #
    when 'leucine_zippers?','scan_for_leucine_zippers','leucine?',
         'leucinez','zippers','l?','leu?'
      scan_for_leucine_zippers(a?)
    # ===================================================================== #
    # === @aminoacids
    # ===================================================================== #
    when '@aminoacids'
      pp @internal_hash[:aminoacids]
    # ===================================================================== #
    # === open
    # ===================================================================== #
    when /^open$/i
      if f
        open(f)
      else
        open_my_files
      end
    # ===================================================================== #
    # === size_rna
    # ===================================================================== #
    when /^size(_|-)?rna$/i
      e @internal_hash[:rna].sequence.size.to_s
    # ===================================================================== #
    # === toggle_truncate
    # ===================================================================== #
    when /^toggle(_|-)?truncate$/i,
         /^truncate$/i
      toggle_truncate
    # ===================================================================== #
    # === 9mer
    # ===================================================================== #
    when '9mer',
         '9mer?'
      erev 'TTA|TCC|ACA'
      find_in_main_sequence('TTATCCACA')
      erev 'We found the 9mer n times: '+
            sfancy(string?.scan('TTATCCACA').size.to_s)
    # ===================================================================== #
    # === TAG?
    # ===================================================================== #
    when /^TAG\??$/i
      _ = search_sequence_for_open_reading_frames(
        i                    = string?,
        use_which_frame      = :frame1,
        use_this_start_codon = 'TAG'
      )
      if _.empty?
        erev 'No substring '+i.to_s.delete('?')+' was found.'
      else
        show_nucleotide_sequence?.display(i) {{ colourize_this_subsequence: use_this_start_codon }}
      end
    # ===================================================================== #
    # === inicodon?
    # ===================================================================== #
    when 'inicodon?',
         'startcodon?'
      erev ::Bioroebe.start_codon?
    # ===================================================================== #
    # === default_stop_codons?
    # ===================================================================== #
    when 'default_stop_codons?',
         'dstop?',
         'dna_codons?',
         'dna_codons',
         'dnacodons'
      pp ::Bioroebe.stop_codons? # This will be an Array.
    # ===================================================================== #
    # === discover_all_palindromes
    # ===================================================================== #
    when /^discover(_|-)?all(_|-)?palindromes$/i,
         /^dpalindromes$/i,
         'dpal'
      discover_all_palindromes(f)
    # ===================================================================== #
    # === dotplot
    # ===================================================================== #
    when /^dotplot$/i
      show_2D_dotplot(a?)
    # ===================================================================== #
    # === set_length
    # ===================================================================== #
    when /^set(_|-)?length$/i,
         /^set_?maxlength/,
         'length',
         'maxlength',
         'maxlen'
      set_default_length(a, :be_verbose)
    # ===================================================================== #
    # === replay
    # ===================================================================== #
    when 'replay',
         /^save(_|-)?history$/i
      replay(f)
    # ===================================================================== #
    # === raw_aa
    #
    # This entry point will simply display the raw aminoacid sequence,
    # translated from the main DNA sequence.
    # ===================================================================== #
    when /^raw(_|-)?aa$/i
      i = dna_sequence?
      sequence = ::Bioroebe::DnaToAminoacidSequence.new(i) { :be_quiet }.sequence
      e sequence
    # ===================================================================== #
    # === RNAfold3
    # ===================================================================== #
    when 'RNAfold3'
      esystem 'RNAfold -p < 5S.seq'
      esystem 'mountain.pl 5S_dp.ps | xmgrace -pipe'
      esystem 'relplot.pl 5S_ss.ps 5S_dp.ps > 5S_rss.ps'
    # ===================================================================== #
    # === mutate_position
    # ===================================================================== #
    when 'mutate_position','mutateposition','mposition','mpos'
      do_mutate_dna_sequence_at_this_nucleotide_position(a?) # mutate_position 5 C
    # ===================================================================== #
    # === include?
    # ===================================================================== #
    when 'include?',
         'inc?'
      include? f
    # ===================================================================== #
    # === cut
    # ===================================================================== #
    when /^cut$/i,
         'cutter'
      cut(f)
    # ===================================================================== #
    # === parse_gff
    # ===================================================================== #
    when /^-?-?parse(_|-)?gff$/i,
         'gff',
         'gff3',
         'gff?',
         'gff3?',
         /^-?-?scan(_|-)?gff$/i
      scan_or_parse_for_this_gff_file_or_any_gff_file(a?)
    # ===================================================================== #
    # === find
    # ===================================================================== #
    when /^try(_|-)?to(_|-)?find(_|-)?restriction(_|-)?enzymes(_|-)?for$/i,
         /scan(_|-)?for$/i,
         /look(_|-)?for$/i,
         'lfor',
         'find',
         'ind',
         'scan'
      try_to_find_restriction_enzymes_for(a?) # look_for
    # ===================================================================== #
    # === header?
    # ===================================================================== #
    when /^header\??$/i,
         /^headers\??$/i,
         /^show(_|-)?header(_|-)?of$/i
      show_header_of(a?)
    # ===================================================================== #
    # === uncolourize_this_aminoacid
    # ===================================================================== #
    when 'uncolourize',
         'uncolourize_this_aminoacid',
         'uncolourizethisaminoacid',
         'uncolaa',
         'uncola',
         '-colaa',
         'colremove',
         'ucola'
      uncolourize_this_aminoacid(f)
    # ===================================================================== #
    # === split
    # ===================================================================== #
    when 'split',
         'show_sequence_in_splitted_form'
      show_sequence_in_splitted_form(f)
    # ===================================================================== #
    # === namespace?
    # ===================================================================== #
    when 'namespace?'
      e namespace?
    # ===================================================================== #
    # === segments?
    # ===================================================================== #
    when 'segments?',
         'show_segments',
         'segments',
         'segmente'
      show_segments
    # ===================================================================== #
    # === to_rna2
    # ===================================================================== #
    when 'to_rna2'
      to_rna(f)
    # ===================================================================== #
    # === pathways?
    # ===================================================================== #
    when 'pathways?',
         'pathways',
         'pways',
         'pathway?',
         'pathway',
         'meta?',
         'path?',
         'show_all_pathways'
      show_all_pathways
    # ===================================================================== #
    # === aa_families?
    # ===================================================================== #
    when 'aa_families?',
         'aafamilies?',
         'aafamilies'
      pp ::Bioroebe.aa_families?
    # ===================================================================== #
    # === pfam?
    # ===================================================================== #
    when 'pfam?','pfam'
      e 'https://pfam.sanger.ac.uk/'
    # ===================================================================== #
    # === add
    # ===================================================================== #
    when 'add'
      add(a?)
    # ===================================================================== #
    # === set_padding
    # ===================================================================== #
    when /set_?padding/,
         'padding'
      set_padding(f, :be_verbose) # setpadding
    # ===================================================================== #
    # === ccaat?
    # ===================================================================== #
    when 'ccaat?',
         /^show(_|-)?ccaat(_|-)?sites$/,
         'ccaat',
         'ccaa'
      show_ccaat_sites
    # ===================================================================== #
    # === analyze
    # ===================================================================== #
    when 'analyze','ana?','analyze?'
      analyze(a?)
    # ===================================================================== #
    # === SSR?
    # ===================================================================== #
    when 'SSR?','ssr?','SSR','single_sequence_repeats'
      e generate_single_sequence_repeats
    # ===================================================================== #
    # === nucleotide?
    # ===================================================================== #
    when 'nucleotide?',
         'nucleotide',
         'ncbi_nucleotide_search_for'
      ncbi_nucleotide_search_for(a?)
    # ===================================================================== #
    # === three_letters_to_one_letter
    #
    # Usage example:
    #
    #   three_letters_to_one_letter THR
    #
    # ===================================================================== #
    when /^three(_|-)?letters(_|-)?to(_|-)?one(_|-)?letter$/i
      e three_letters_to_one_letter(a?)
    # ===================================================================== #
    # === rest_enzymes
    # ===================================================================== #
    when /^rest(_|-)?enzymes$/
      pp ::Bioroebe.show_restriction_enzymes
    # ===================================================================== #
    # === cutseq
    # ===================================================================== #
    when /^cutse(q|t)?$/i
      cutseq(a?)
    # ===================================================================== #
    # === first
    # ===================================================================== #
    when 'first',
         /^change(_|-)?first(_|-)?nucleotide(_|-)?to$/
      first(f)
    # ===================================================================== #
    # === pdf?
    # ===================================================================== #
    when 'pdf?','report_where_the_pdf_tutorial_can_be_found'
      report_where_the_pdf_tutorial_can_be_found
    # ===================================================================== #
    # === dmp?
    # ===================================================================== #
    when 'dmp?',
         /^show(_|-)?all(_|-)?dmp(_|-)?files$/,
         'dmp'
      show_all_dmp_files
    # ===================================================================== #
    # === codon?
    #
    # Invocation example in the BioShell:
    #
    #   codon? ATG
    #
    # ===================================================================== #
    when 'codon?',
         'kazusa_codon'
      show_codons_of_this_aminoacid_or_show_kazusa_codon(a?)
    # ===================================================================== #
    # === do_not_show_the_trailer
    # ===================================================================== #
    when /^-?-?do_?not_?show_?the_?trailer$/,
         /^-?-?no_?trailer$/
      do_not_show_the_trailer
    # ===================================================================== #
    # === edit
    # ===================================================================== #
    when /^edit$/i
      open_this_file_in_editor :bioshell
    # ===================================================================== #
    # === mpsa_source
    # ===================================================================== #
    when /^-?-?mpsa_?source/
      e '/opt/MPSA/mpsa/mpsa.bashrc'
    # ===================================================================== #
    # === assume?
    # ===================================================================== #
    when 'assume?',
         'assume',
         'assume_what_type_this_is'
      assume_what_type_this_is(a?) # assume ATTGGCCCATATTGGCC
    # ===================================================================== #
    # === bparse
    # ===================================================================== #
    when 'bparse',
         /^biolang(_|-)?parser$/
      BiolangParser.new # bl $BIOROEBE/biolang_parser.rb
    # ===================================================================== #
    # === set_prompt
    # ===================================================================== #
    when /^set(_|-)?prompt$/,
         'prompt',
         'setpwd'
      set_prompt(f)
    # ===================================================================== #
    # === no_prompt
    # ===================================================================== #
    when /^no(_|-)?prompt$/i
      set_prompt :empty
    # ===================================================================== #
    # === pyranose 2-oxidase
    # ===================================================================== #
    when /^pyranose(-|_)?2(-|_)?oxidase$/i
      e
      erev 'https://www.ncbi.nlm.nih.gov/nuccore/XM_008046051.1'
      e
    # ===================================================================== #
    # === disulfide?
    #
    # This entry point can be used to show disulfide positions in the
    # given sequence.
    # ===================================================================== #
    when /^-?-?disulfide\??$/i,
         /^-?-?show(_|-)?disulfides$/i
      show_disulfides
    # ===================================================================== #
    # === colourize_this_aminoacid
    # ===================================================================== #
    when 'colourize',
         /^colourize(_|-)?this(_|-)?aminoacid$/,
         'colaa',
         'cola',
         'colAA',
         'colourize_aminoacid'
      colourize_this_aminoacid(f)
    # ===================================================================== #
    # === frame2
    # ===================================================================== #
    when 'frame2',
         'f2'
      showorf(dna_sequence?, :frame2)
    # ===================================================================== #
    # === frame3
    # ===================================================================== #
    when 'frame3',
         'f3'
      showorf(dna_sequence?, :frame3)
    # ===================================================================== #
    # === mutate_aminoacid_position
    # ===================================================================== #
    when /^mutate(_|-)?aminoacid(_|-)?position$/
      mutate_aminoacid_position(a?)
    # ===================================================================== #
    # === interactive_colour_menu
    # ===================================================================== #
    when /^interactive(_|-)?colour(_|-)?menu$/,
         'icolours'
      interactive_colour_menu
    # ===================================================================== #
    # === aligned
    # ===================================================================== #
    when 'aligned',
         'aligned?',
         'beauty',
         'beautified', # We show the DNA sequence correctly aligned.
         'formatted',
         'padded',
         'beaut',
         'falign',
         'blocked',
         'block',
         /^show(_|-)?this(_|-)?sequence(_|-)?padded$/i
      show_this_sequence_padded(a?)
    # ===================================================================== #
    # === all_arguments
    # ===================================================================== #
    when /^arguments\??$/i
      pp all_arguments?
    # ===================================================================== #
    # === do
    #
    # do_action() as name is better than do(), in my opinion.
    # ===================================================================== #
    when 'do',
         /^do(_|-)?action$/i
      do_action(a?)
    # ===================================================================== #
    # === glutathione
    # ===================================================================== #
    when 'glutathione','glutathion'
      set_aminoacids('GCG')
    # ===================================================================== #
    # === relion_tags
    # ===================================================================== #
    when /^relion(_|-)?tags$/,
         'relion_tags?'
      e
      erev '_rlnImageName' 
      erev '_rlnCoordinateX' 
      erev '_rlnCoordinateY' 
      erev '_rlnMicrographName'
      erev '_rlnImageName'
      erev '_rlnDefocusU'
      erev '_rlnDefocusV'
      erev '_rlnDefocusAngle'
      erev '_rlnVoltage'
      erev '_rlnAmplitudeContrast'
      erev '_rlnSphericalAberration'
      e
    # ===================================================================== #
    # === project_base_dir
    # ===================================================================== #
    when /^project(_|-)?base(_|-)?dir$/i,
         'pdir',
         /^PROJECT(_|-)?BASE(_|-)?DIRECTORY$/i
      e Bioroebe.project_base_directory?
    # ===================================================================== #
    # === set_search
    # ===================================================================== #
    when /^set(_|-)?search$/i,
         /^set(_|-)?sequence$/i,
         /^set(_|-)?search(_|-)?string$/i,
         /^set(_|-)?search(_|-)?sequence$/i
      set_search_for(a?)
    # ===================================================================== #
    # === balanced
    # ===================================================================== #
    when /^create(_|-)?balanced(_|-)?composition$/i,
         'balanced'
      set_dna_string(
        create_balanced_composition(a?)
      )
    # ===================================================================== #
    # === show_local_sequences
    #
    # This entry point shows all local FASTA sequences - typically via
    # .fa or .fasta files.
    # ===================================================================== #
    when 'local_sequences?',
         'show_local_sequences',
         'showlocalsequences',
         'localfasta',
         'sequences?',
         'local?',
         'fastasequences?',
         'show_fasta_files',
         'localfasta?',
         'lfasta',
         /fasta(_|-)?files\??/
      show_local_sequences
      show_hint_how_to_use_the_local_sequences
    # ===================================================================== #
    # === compact_file
    # ===================================================================== #
    when /^compact(_|-)?file$/i,
         'compact',
         'cfile',
         'compacter'
      compact_file(f)
    # ===================================================================== #
    # === peroxisome_pts2
    # ===================================================================== #
    when 'peroxisome_pts2'
      erev 'H₂N-----Arg-Leu-X5-His-Leu-'
    # ===================================================================== #
    # === dna_translate
    # ===================================================================== #
    when /^dna(_|-)?translate/
      dna_translate(all_arguments?)
    # ===================================================================== #
    # === 1igt.pdb
    # ===================================================================== #
    when '1igt.pdb'
      erev 'https://www.rcsb.org/pdb/results/results.do?tabtoshow=Current&qrid=366A3EE'
    # ===================================================================== #
    # === MG1655
    # ===================================================================== #
    when 'MG1655'
      e
      efancy '  https://www.ncbi.nlm.nih.gov/nuccore/NZ_CP032667.1'
      e
    # ===================================================================== #
    # === @configuration
    # ===================================================================== #
    when '@configuration'
      pp @configuration
    # ===================================================================== #
    # === colours?
    # ===================================================================== #
    when 'colours?','ucolours?','ucolours',
         /^will(_|-)?we(_|-)?use(_|-)?colours\??$/i
      will_we_use_colours?
    # ===================================================================== #
    # === @use_working_directory_as_prompt
    # ===================================================================== #
    when '@use_working_directory_as_prompt'
      pp @internal_hash[:use_working_directory_as_prompt]
    # ===================================================================== #
    # === uniprot?
    # ===================================================================== #
    when 'uniprot?',
         /^open(_|-)?in(_|-)?uniprot$/,
         'prot'
      open_in_uniprot(f)
    # ===================================================================== #
    # === HU?
    # ===================================================================== #
    when 'HU?',
         'heat-unstable',
         'heat-unstable-protein'
      erev 'heat-unstable protein in E. coli.'
      erev 'Encoded by hupA and hupB gene - see these links:'
      erev 'hupA:'
      erev '  '+NCBI_GENE+'948499'
      erev '  https://www.ncbi.nlm.nih.gov/nuccore/NC_000913.3?report=fasta&from=4200281&to=4200553'
      erev 'hupB:'
      erev '  '+NCBI_GENE+'949095'
      erev '  https://www.ncbi.nlm.nih.gov/nuccore/NC_000913.3?report=fasta&from=461451&to=461723'
    # ===================================================================== #
    # === snuc
    #
    # Invocation example:
    #
    #   snuc lady slipper orchid
    #
    # ===================================================================== #
    when /^search(_|-)?for(_|-)?nucleotide(_|-)?sequence/i,
         'snuc'
      search_for_nucleotide_sequence(a?) # Delegate into: http://www.ncbi.nlm.nih.gov/nucgss?term=G
    # ===================================================================== #
    # === fasta_header?
    # ===================================================================== #
    when /^show(_|-)?fasta(_|-)?headers$/i,
         'sfasta',
         /^fasta(_|-)?header\??/i,
         'showfasta',
         'fheader'
      show_fasta_headers(f)
    # ===================================================================== #
    # === copyright?
    # ===================================================================== #
    when /^copyright\??$/i
      show_copyright_clause
    # ===================================================================== #
    # === pBR322?
    # ===================================================================== #
    when /pBR322\??/
      e
      erev '  https://www.ncbi.nlm.nih.gov/nuccore/208958?report=fasta' # The pBR322 sequence.
      e
    # ===================================================================== #
    # === ARRAY_WITH_COMPLETIONS
    # ===================================================================== #
    when /^ARRAY(_|-)?WITH(_|-)?COMPLETIONS$/i
      pp ARRAY_WITH_COMPLETIONS
    # ===================================================================== #
    # === @array_these_sequences_were_chopped_away
    #
    # This entry point is mostly used for debugging-purposes.
    # ===================================================================== #
    when '@array_these_sequences_were_chopped_away',
         'chopped?'
      pp @internal_hash[:array_these_sequences_were_chopped_away]
    # ===================================================================== #
    # === array_colourize_this_aminoacid
    # ===================================================================== #
    when 'array_colourize_this_aminoacid'
      pp ::Bioroebe.array_colourize_this_aminoacid
    # ===================================================================== #
    # === @array_sequences
    # ===================================================================== #
    when '@array_sequences'
      pp array_sequences?
    # ===================================================================== #
    # === identical?
    # ===================================================================== #
    when 'identical?',
         'identical',
         'same',
         'same_content?',
         'similar?',
         'compare_two_files',
         'comparetwofiles'
      compare_two_files(f, second_argument)
    # ===================================================================== #
    # === locus?
    # ===================================================================== #
    when 'locus?'
      e @internal_hash[:locus]
    # ===================================================================== #
    # === molmass?
    # ===================================================================== #
    when 'mass?',
         'molecularmass?',
         'molmass?',
         'mmass',
         /^molecular(_|-)?mass(_|-)?of(_|-)?amino(_|-)?acids(_|-)?in(_|-)?the(_|-)?sequence$/i
      molecular_mass_of_amino_acids_in_the_sequence(f)
    # ===================================================================== #
    # === +
    #
    # Show the positively charged aminoacids.
    # ===================================================================== #
    when '+',
         'show_the_positively_charged_aminoacids'
      show_the_positively_charged_aminoacids
    # ===================================================================== #
    # === insulin?
    # ===================================================================== #
    when 'insulin?'
      show_insulin_entries_at_NCBI
    # ===================================================================== #
    # === list
    # ===================================================================== #
    when 'list'
      list(a?)
    # ===================================================================== #
    # === configdir?
    # ===================================================================== #
    when 'configdir?',
         /^show(_|-)?config(_|-)?dir$/i
      show_config_dir
    # ===================================================================== #
    # === show_nucleotides_table
    # ===================================================================== #
    when 'nucleotides?','nucleotide_table','nucleotidetable',
         'nucleotide_table?','nucleotidetable?','stable',
         'show_nucleotides_table','shownucleotidestable',
         'nucleotides_table?'
      show_nucleotides_table
    # ===================================================================== #
    # === print_table
    # ===================================================================== #
    when 'print_table','table','aa?','aminoacid_information',
         'print_aminoacid_information_table','aainfo',
         'aminosäuren','aminoacids','ptable','shortcuts?',
         'ainfo?','aainfo?','printtable','aa_table',
         'aminoacidstable?','aatable?'
      print_aminoacid_information_table
    # ===================================================================== #
    # === assigned?
    # ===================================================================== #
    when /assigned\??/,
         /is(_|-)?any(_|-)?nucleotide(_|-)?assigned\??/
      if is_any_nucleotide_assigned?
        erev 'A nucleotide sequence is assigned.'
      else
        erev 'No nucleotide sequence is assigned.'
      end
    # ===================================================================== #
    # === set_jumper_dir
    # ===================================================================== #
    when /set_?jumper_?dir/,'set_jumper','setjumper','sjumper'
        set_jumper_directory(f)
    # ===================================================================== #
    # === extract_sequence
    # ===================================================================== #
    when /extract_?sequence/,'extract','ext'
      extract_sequence(a?)
    # ===================================================================== #
    # === no_newlines
    # ===================================================================== #
    when /no_?newlines/
      no_newlines(a?)
    # ===================================================================== #
    # === run_sql_query
    # ===================================================================== #
    when 'run_sql_query','runsqlquery' # Input a sql command directly.
      run_sql_query(f)
    # ===================================================================== #
    # === Restriction enzymes
    #
    # Usage example for rest:
    #   rest AAAAAAAAGGCGCCCTGACCATCTAGAAAAA
    # ===================================================================== #
    when 'Bioroebe.restriction_enzymes?','all_restriction_enzymes',
         'allrestrictionenzymes'
      pp ::Bioroebe.restriction_enzymes?
    # ===================================================================== #
    # === search
    # ===================================================================== #
    when 'search','run',/start_?search/
      start_search
    # ===================================================================== #
    # === URLs?
    # ===================================================================== #
    when 'URLs?','URL?','URLS?',/show_?useful_?URLs/
      show_useful_URLs
    # ===================================================================== #
    # === NM_021964.1
    # ===================================================================== #
    when 'NM_021964.1','NM_021964' # This should one day be replaced with a NCBI-query system.
      e 'https://www.ncbi.nlm.nih.gov/nuccore/NM_021964.1'
      e 'https://www.ncbi.nlm.nih.gov/nuccore/NM_021964' # ← This is the updated variant.
    # ===================================================================== #
    # === first_orf?
    # ===================================================================== #
    when /first_?orf\??/,/show_?first_?orf/,'1storf','1st_ORF','1stORF'
      show_first_orf
    # ===================================================================== #
    # === emicroscopy
    # ===================================================================== #
    when 'emicroscopy'
      e 'This has not been ported yet - stay tuned.'
    # ===================================================================== #
    # === 4cutters
    # ===================================================================== #
    when '4cutter','4cutters','4-cutters','4cut'
      show_restriction_enzymes '4'
    # ===================================================================== #
    # === 5cutters
    # ===================================================================== #
    when '5cutter','5cutters','5-cutters','5cut'
      show_restriction_enzymes '5'
    # ===================================================================== #
    # === 6cutters
    # ===================================================================== #
    when '6cutter','6cutters','6-cutters','6cut'
      show_restriction_enzymes '6'
    # ===================================================================== #
    # === 7cutters
    # ===================================================================== #
    when '7cutter','7cutters','7-cutters','7cut'
      show_restriction_enzymes '7'
    # ===================================================================== #
    # === 8cutters
    # ===================================================================== #
    when '8cutter','8cutters','8-cutters','8cut'
      show_restriction_enzymes '8'
    # ===================================================================== #
    # === rawseq
    # ===================================================================== #
    when /rawseq\??/,
         'rawstring',
         'rawstring?',
         /dna_?sequence\??/,
         'fullseq',
         'realseq'
      e string? 
    # ===================================================================== #
    # === mutate
    # ===================================================================== #
    when 'mutate',
         'mutate_dna_sequence',
         'mutatednasequence'
      mutate_dna_sequence(a?)
    # ===================================================================== #
    # === setseq2
    # ===================================================================== #
    when /setseq2/, /seq2[^\?]/
      set_sequence_2(a?)
    # ===================================================================== #
    # === setseq3
    # ===================================================================== #
    when /setseq3/, /seq3[^\?]/
      set_sequence_3(a?)
    # ===================================================================== #
    # === setseq4
    # ===================================================================== #
    when /setseq4/, /seq4[^\?]/
      set_sequence_4(a?)
    # ===================================================================== #
    # === setseq5
    # ===================================================================== #
    when /setseq5/, /seq5[^\?]/
      set_sequence_5(a?)
    # ===================================================================== #
    # === setseq6
    # ===================================================================== #
    when /setseq6/, /seq6[^\?]/
      set_sequence_6(a?)
    # ===================================================================== #
    # === date
    # ===================================================================== #
    when 'date','show_date','showdate','sdate'
      show_date
    # ===================================================================== #
    # === colour_scheme_demo
    # ===================================================================== #
    when 'colour_scheme_demo','colourschemedemo','colour_tests',
         'colourtests','colourdemo'
      colour_scheme_demo
    # ===================================================================== #
    # === colour_scheme_for_aa
    # ===================================================================== #
    when 'colour_scheme_for_aa','colourschemeforaa',
         'colour_scheme_for_aminoacids','colour_scheme2',
         'caa','scheme_aa'
      colour_scheme_for_aminoacids(a?)
    # ===================================================================== #
    # === n_uracil?
    # ===================================================================== #
    when 'n_uracil?',
         'n_uracil',
         'nuracil',
         'nuracil?'
      n_uracil?
    # ===================================================================== #
    # === sixpack
    # ===================================================================== #
    when 'sixpack',
         '6pack',
         'show_sixpack_alignment','showsixpackalignment'
      show_sixpack_alignment(a?)
    # ===================================================================== #
    # === compseq
    #
    # This entry point is a wrapper over "compare sequence" aka compseq.
    # ===================================================================== #
    when 'compseq',
         'compseq?',
         /^compare(_|-)?the(_|-)?sequence$/i,
         'analyze_the_sequence',
         'csequ',
         'cseq',
         'compsqe',
         /^frequency(_|-)?analyzer$/i,
         'emboss',
         /^emboss(_|-)?compseq$/i,
         'dinucleotides',
         /^nucleotide(_|-)?frequency$/i
      compseq(a?) # bl compseq
    # ===================================================================== #
    # === show
    # ===================================================================== #
    when 'show',
         /^do(_|-)?show$/i
      show(a?)
    # ===================================================================== #
    # === generate_palindrome
    # ===================================================================== #
    when /^generate(_|-)?palindrome$/i,
         'palindrome',
         'palindrom',
         'pal',
         'pdrome'
      generate_palindrome(a?)
    # ===================================================================== #
    # === bioroebe --tk1                                           (tk tag)
    # ===================================================================== #
    when /^-?-?tk1$/i
      require 'bioroebe/gui/tk/aminoacid_composition/aminoacid_composition.rb'
      Bioroebe::GUI::Tk::AminoacidComposition.new(ARGV)
    # ===================================================================== #
    # === bioroebe --tk2
    #
    # Invocation example:
    #
    #   bioroebe --tk-three-to-one
    #
    # ===================================================================== #
    when /^-?-?tk2$/i,
         /^-?-?tk(_|-| )?three(_|-| )?to(_|-| )?one$/i
      tk_start_three_to_one
    # ===================================================================== #
    # === bioroebe --tk3
    #
    # Invocation example:
    #
    #   bioroebe --tk3
    #
    # ===================================================================== #
    when /^-?-?tk3$/i
      require 'bioroebe/gui/tk/hamming_distance/hamming_distance.rb'
      Bioroebe::GUI::Tk::HammingDistance.new(ARGV)
    # ===================================================================== #
    # === start_and_stop?
    # ===================================================================== #
    when /^start_?and_?stop\??/
      report_colourized_sequence(:start_and_stop_codon)
    # ===================================================================== #
    # === start_and_stop
    # ===================================================================== #
    when /^start(_|-)?and(_|-)?stop$/i,
         '1+2',
         /^start(_|-)?stop$/i,
         'stopandstart',
         'yin_yang',
         '+-'
      show_start_and_stop_codons
    # ===================================================================== #
    # === stop_extended?
    # ===================================================================== #
    when 'stop_extended?'
      _ = main_sequence?
      stop_codons?.each {|this_stop_codon|
        _splitted = _.split(/#{this_stop_codon}/).each {|line|
          erev line+orange(this_stop_codon)+rev
        }
      }
      pp _splitted
    # ===================================================================== #
    # === rf "Horseradish Peroxidase"
    # ===================================================================== #
    when /^Horseradish(-|_)Peroxidase$/i
      show_resources_about_the_horseradish_peroxidase
    # ===================================================================== #
    # === mimivirus?
    # ===================================================================== #
    when /^mimivirus\??$/,'mimi'
      e 'Accession number is: '+
         sfancy('NC_014649')
    # ===================================================================== #
    # === user_input?
    #
    # This entry point is mostly used for debugging purposes.
    # ===================================================================== #
    when /^user(_|-)?input\??$/i
      pp @internal_hash[:user_input]
    # ===================================================================== #
    # === nls?
    # ===================================================================== #
    when 'nls?',
         'show_known_nls_sequences',
         'showknownnlssequences'
      show_known_nls_sequences
    # ===================================================================== #
    # === reste?
    # ===================================================================== #
    when 'reste?','show_reste','showreste','sreste'
      show_reste
    # ===================================================================== #
    # === test_colour_scheme
    # ===================================================================== #
    when /^test(_|-)?colour(_|-)?scheme$/i,
         'test_random_scheme'
      _ = random_dna_sequence
      colour_scheme_for_nucleotides(_)
    # ===================================================================== #
    # === compare_two_strings_as_alignment
    # ===================================================================== #
    when /compare_?two_?strings_?as_?alignment/i,'sstring','scompare',
         'sscompare','compare_two_strings','compare',
         /string_?compare/
      compare_two_strings_as_alignment(
        first_argument, second_argument
      ) # string_compare
    # ===================================================================== #
    # === left_chop
    #
    # This entry point allows the user to perform a so-called
    # "left-chop operation", aka to trim away nucleotides
    # that are on the left hand side of the sequence.
    # ===================================================================== #
    when /left(_|-)?chop$/,
         /left(_|-)?remove$/,
         /chop(_|-)?first$/,
         'chop5',
         'lchop'
      left_chop(a?)
    # ===================================================================== #
    # === translate_aminoacid
    #
    # Usage example:
    #
    #   translate kkrnn
    #
    # ===================================================================== #
    when /translate(_|-| )?aminoacid/i,
         'transaa',
         'translate_aa',
         'aminosäuren2',
         'translateaa',
         'trans2'
      translate_aminoacid(a?)
    # ===================================================================== #
    # === chi_sequence?
    # ===================================================================== #
    when 'chi_sequence?','chisequence?','chi?'
      e 'The chi sequence goes: '+simp('GCTGGTGG')
    # ===================================================================== #
    # === ncbi
    # ===================================================================== #
    when 'ncbi' # ncbi arabidopsis thaliana CDKs
      open_this_ncbi_page(a?)
    # ===================================================================== #
    # === pcolour
    # ===================================================================== #
    when 'interactively_pick_colour',
         'pick_colour',
         'pickcolour',
         'pcolour',
         'pcolor',
         'pcol'
      interactively_pick_colour
    # ===================================================================== #
    # === bioroebe --gtk1
    #
    # This is for alignment.rb
    # ===================================================================== #
    when /^-?-?gtk1$/i
      require 'bioroebe/gui/gtk3/alignment/alignment.rb'
      Bioroebe::GUI::Gtk::Alignment.run
    # ===================================================================== #
    # === bioroebe --gtk2
    #
    # This is for aminoacid_composition.rb
    # ===================================================================== #
    when /^-?-?gtk2$/i
      require 'bioroebe/gui/gtk3/aminoacid_composition/aminoacid_composition.rb'
      Bioroebe::GUI::Gtk::AminoacidComposition.run
    # ===================================================================== #
    # === bioroebe --gtk3
    #
    # This is for anti_sense_strand.rb
    # ===================================================================== #
    when /^-?-?gtk3$/i
      require 'bioroebe/gui/gtk3/anti_sense_strand/anti_sense_strand.rb'
      Bioroebe::GUI::Gtk::AntiSenseStrand.run
    # ===================================================================== #
    # === bioroebe --gtk4
    #
    # This is for blosum_matrix_viewer.rb
    # ===================================================================== #
    when /^-?-?gtk4$/i
      require 'bioroebe/gui/gtk3/blosum_matrix_viewer/blosum_matrix_viewer.rb'
      Bioroebe::GUI::Gtk::BlosumMatrixViewer.run
    # ===================================================================== #
    # === bioroebe --gtk5
    #
    # This is for calculate_cell_numbers_of_bacteria.rb
    # ===================================================================== #
    when /^-?-?gtk5$/i
      require 'bioroebe/gui/gtk3/calculate_cell_numbers_of_bacteria/calculate_cell_numbers_of_bacteria.rb'
      Bioroebe::GUI::Gtk::CalculateCellNumbersOfBacteria.run
    # ===================================================================== #
    # === bioroebe --gtk6
    #
    # This is for dna_to_aminoacid_widget.rb
    # ===================================================================== #
    when /^-?-?gtk6$/i
      require 'bioroebe/gui/gtk3/dna_to_aminoacid_widget/dna_to_aminoacid_widget.rb'
      Bioroebe::GUI::Gtk::DnaToAminoacidWidget.run
    # ===================================================================== #
    # === bioroebe --gtk7
    #
    # This is for dna_to_reverse_complement_widget.rb
    # ===================================================================== #
    when /^-?-?gtk7$/i
      require 'bioroebe/gui/gtk3/dna_to_reverse_complement_widget/dna_to_reverse_complement_widget.rb'
      Bioroebe::GUI::Gtk::DnaToReverseComplementWidget.run
    # ===================================================================== #
    # === bioroebe --gtk8
    #
    # This is for fasta_table_widget.rb
    # ===================================================================== #
    when /^-?-?gtk8$/i
      require 'bioroebe/gui/gtk3/fasta_table_widget/fasta_table_widget.rb'
      Bioroebe::GUI::Gtk::FastaTableWidget.run
    # ===================================================================== #
    # === bioroebe --gtk9
    #
    # This is for format_converter.rb
    # ===================================================================== #
    when /^-?-?gtk9$/i
      require 'bioroebe/gui/gtk3/format_converter/format_converter.rb'
      Bioroebe::GUI::Gtk::FormatConverter.run
    # ===================================================================== #
    # === bioroebe --gtk10
    #
    # This is for gene.rb
    # ===================================================================== #
    when /^-?-?gtk10$/i
      require 'bioroebe/gui/gtk3/gene/gene.rb'
      Bioroebe::GUI::Gtk::Gene.run
    # ===================================================================== #
    # === bioroebe --gtk11
    #
    # This is for hamming_distance.rb.
    # ===================================================================== #
    when /^-?-?gtk11$/i
      require 'bioroebe/gui/gtk3/hamming_distance/hamming_distance.rb'
      Bioroebe::GUI::Gtk::HammingDistance.run
    # ===================================================================== #
    # === bioroebe --gtk12
    #
    # This is for levensthein_distance.rb.
    # ===================================================================== #
    when /^-?-?gtk12$/i,
         /^-?-?gtk(_|-| )?levensthein$/i # bioroebe --gtk-levensthein
      require 'bioroebe/gui/gtk3/levensthein_distance/levensthein_distance.rb'
      Bioroebe::GUI::Gtk::LevenstheinDistance.run
    # ===================================================================== #
    # === bioroebe --gtk13
    #
    # This is for notebook.rb.
    # ===================================================================== #
    when /^-?-?gtk13$/i
      require 'bioroebe/gui/gtk3/controller/controller.rb'
      Bioroebe::GUI::Gtk::Controller.run
    # ===================================================================== #
    # === bioroebe --gtk14
    #
    # This is for nucleotide_analyser.rb.
    # ===================================================================== #
    when /^-?-?gtk14$/i
      require 'bioroebe/gui/gtk3/nucleotide_analyser/nucleotide_analyser.rb'
      Bioroebe::GUI::Gtk::NucleotideAnalyser.run
    # ===================================================================== #
    # === bioroebe --gtk15
    #
    # This is for parse_pdb_file.rb.
    # ===================================================================== #
    when /^-?-?gtk15$/i
      require 'bioroebe/gui/gtk3/parse_pdb_file/parse_pdb_file.rb'
      Bioroebe::GUI::Gtk::ParsePdbFile.run
    # ===================================================================== #
    # === bioroebe --gtk16
    #
    # This is for primer_design_widget.
    # ===================================================================== #
    when /^-?-?gtk16$/i,
         /^-?-?primer(_|-| )?design$/i # bioroebe --primer-design
      require 'bioroebe/gui/gtk3/primer_design_widget/primer_design_widget.rb'
      Bioroebe::GUI::Gtk::PrimerDesignWidget.run
    # ===================================================================== #
    # === bioroebe --gtk17
    #
    # This is for protein_to_DNA.
    # ===================================================================== #
    when /^-?-?gtk17$/i
      require 'bioroebe/gui/gtk3/protein_to_DNA/protein_to_DNA.rb'
      Bioroebe::GUI::Gtk::ProteinToDNA.run
    # ===================================================================== #
    # === bioroebe --gtk18
    #
    # This is for random_sequence.
    # ===================================================================== #
    when /^-?-?gtk18$/i
      require 'bioroebe/gui/gtk3/random_sequence/random_sequence.rb'
      Bioroebe::GUI::Gtk::RandomSequence.run
    # ===================================================================== #
    # === bioroebe --gtk19
    #
    # This is for restriction_enzymes.
    # ===================================================================== #
    when /^-?-?gtk19$/i
      require 'bioroebe/gui/gtk3/restriction_enzymes/restriction_enzymes.rb'
      Bioroebe::GUI::Gtk::RestrictionEnzymes.run
    # ===================================================================== #
    # === bioroebe --gtk20
    #
    # This is for show_codon_table.
    # ===================================================================== #
    when /^-?-?gtk20$/i
      require 'bioroebe/gui/gtk3/show_codon_table/show_codon_table.rb'
      Bioroebe::GUI::Gtk::ShowCodonTable.run
    # ===================================================================== #
    # === at_content?
    #
    # Usage example:
    #
    #   at_content? AGTACGTACGTCAGTCA
    #
    # ===================================================================== #
    when /^at_?content\??$/i,
         'at?',
         'calc_at_content',
         'calcatcontent'
      calculcate_at_content(a?)
    # ===================================================================== #
    # === ll
    #
    # This is the general entry point for listing the content in the
    # current working directory.
    # ===================================================================== #
    when 'll',
         'ls',
         'l',
         'sdc',
         'lll',
         'llll',
         /^show(_|-)?file(_|-)?listing$/
      show_file_listing
    # ===================================================================== #
    # === remove
    #
    # This entry point can be used to remove a subsequence from the
    # 5' end (the "left" end).
    #
    # Invocation example:
    #
    #   remove 3
    #
    # ===================================================================== #
    when 'remove',
         'delete',
         'del',
         'rm'
      remove(a?)
    # ===================================================================== #
    # === oligo_two
    # ===================================================================== #
    when 'oligo_two',
         'oligo_length_two',
         'oligolengthtwo',
         'two',
         'oligonucleotide_frequency'
      show_oligo_length_two
    # ===================================================================== #
    # === efetch
    # ===================================================================== #
    when /^efetch$/
      efetch(a?)
    # ===================================================================== #
    # === Handle aminoacid sequence
    #
    # This is similar to the variant above, but it will work on the
    # aminoacid sequence. This explains the leading "aa", which
    # is short for "aminoacid".
    #
    # Usage example:
    #
    #   setdna 99; aa22..44
    #
    # ===================================================================== #
    when /^aa\[?([0-9,.]{0,9}\d{1,9})\s*[-.,]{1,4}\s*([0-9,.]{1,9})\]?$/
      show_this_subsequence($1, $2, aminoacid_sequence?)
    # ===================================================================== #
    # === gui_restriction_enzymes
    # ===================================================================== #
    when 'gui_restriction_enzymes','guirestrictionenzymes'
      enable_gtk
      ::Bioroebe::RestrictionEnzymes.start_gui_application
    # ===================================================================== #
    # === 2
    # ===================================================================== #
    when '2','restriction_enzymes','2_restriction_enzymes_run'
      load_gtk
      thread = Thread.new { restriction_enzymes_run }
      thread.join
    # ===================================================================== #
    # === bioroebe --hamming-gui
    # ===================================================================== #
    when /^-?-?hamming(_|-| )?gui$/i
      require 'bioroebe/gui/gtk3/hamming_distance/hamming_distance.rb'
      Thread.new {
        Bioroebe::GUI::Gtk::HammingDistance.run
      }
    # ===================================================================== #
    # === bioroebe --gtk-sizeseq
    # ===================================================================== #
    when /^-?-?gtk(_|-| )?sizeseq$/i
      require 'bioroebe/gui/gtk3/sizeseq/sizeseq.rb'
      Bioroebe::GUI::Gtk::Sizeseq.run
    # ===================================================================== #
    # === bioroebe --gtk-hamming
    # ===================================================================== #
    when /^-?-?gtk(_|-| )?hamming$/i
      require 'bioroebe/gui/gtk3/hamming_distance/hamming_distance.rb'
      Bioroebe::GUI::Gtk::HammingDistance.run
    # ===================================================================== #
    # === pwd
    # ===================================================================== #
    when 'pwd',
         'pdw',
         /^report(_|-)?current(_|-)?working(_|-)?directory$/i
      report_current_working_directory
    # ===================================================================== #
    # === restriction_table?
    # ===================================================================== #
    when /^restriction(_|-)?table\??/,
         /^show(_|-)?restriction(_|-)?table$/
      show_restriction_table
    # ===================================================================== #
    # === dna_weight?
    # ===================================================================== #
    when /dna_?weight\??/,'weight_of_dna_string',
         'weight?',
         'weight',
         'mweight',
         'show_and_calculate_weight_of_dna_string',
         'molwt',
         'show_individual_weight_of_the_four_dna_nucleotides'
      show_and_calculate_weight_of_dna_string_or_aminoacid_sequence(f)
    # ===================================================================== #
    # === dna_analyze?
    #
    # This entry-point can be used to analyze the given DNA strand at hand.
    # ===================================================================== #
    when 'dna_analyze?',
         'analyse',
         'ana',
         /^stats\??$/i,
         'display',
         'stat?',
         'stat',
         'dnaanalyze?',
         'frequencies',
         'frequencies?',
         'statistics?',
         'analyze_dna_string',
         'frequency',
         'superanalyze',
         /^dna(-|_| )?analyse$/i
      analyze_dna_string(a?)
    # ===================================================================== #
    # === tologdir
    # ===================================================================== #
    when /^to(_|-)?log(_|-)?dir$/,
         /^to(_|-)?log$/
      cd log_dir?
    # ===================================================================== #
    # === create_file
    #
    # This entry point allows the user to create a new file.
    # ===================================================================== #
    when /^create(_|-)?file$/,
         'touch'
      create_file(a?)
    # ===================================================================== #
    # === assign_aa
    # ===================================================================== #
    when /^assign(_|-)?aa$/,
         'aaa'
      assign_aminoacid_sequence(a?)
    # ===================================================================== #
    # === --create-jar
    # ===================================================================== #
    when /^-?-?create(_|-)?jar$/i,
         /^-?-?jar$/i
      ::Bioroebe.create_jar_archive
    # ===================================================================== #
    # === help
    # ===================================================================== #
    when 'hel',
         'he','showhelp',
         /^-?-?help$/i,
         'hep',
         'hepl','elp',
         'show_help',
         '?',
         'hlep' # 'h' is reserved already.
      show_help(f)
    # ===================================================================== #
    # === bioroebe --gtk21
    #
    # This is for show_codon_usage.
    # ===================================================================== #
    when /^-?-?gtk21$/i
      require 'bioroebe/gui/gtk3/show_codon_usage/show_codon_usage.rb'
      Bioroebe::GUI::Gtk::ShowCodonUsage.run
    # ===================================================================== #
    # === bioroebe --gtk22
    #
    # This is for sizeseq.
    # ===================================================================== #
    when /^-?-?gtk22$/i
      require 'bioroebe/gui/gtk3/sizeseq/sizeseq.rb'
      Bioroebe::GUI::Gtk::Sizeseq.run
    # ===================================================================== #
    # === bioroebe --gtk23
    #
    # This is for three_to_one.
    # ===================================================================== #
    when /^-?-?gtk23$/i
      require 'bioroebe/gui/gtk3/three_to_one/three_to_one.rb'
      Bioroebe::GUI::Gtk::ThreeToOne.run
    # ===================================================================== #
    # === bioroebe --gtk24
    #
    # This is for www_finder.
    # ===================================================================== #
    when /^-?-?gtk24$/i
      require 'bioroebe/gui/gtk3/www_finder/www_finder.rb'
      Bioroebe::GUI::Gtk::WwwFinder.run
    # ===================================================================== #
    # === gtk3
    # ===================================================================== #
    when 'gtk3',
         'load_gtk_subsection'
      load_gtk
      enable_gtk_section_antisensestrand
    # ===================================================================== #
    # === enable_gtk_section_antisensestrand
    # ===================================================================== #
    when /^enable(_|-)?gtk(_|-)?section(_|-)?antisensestrand$/
      enable_gtk_section_antisensestrand
    # ===================================================================== #
    # === enable_gtk
    # ===================================================================== #
    when /^-?-?enable(_|-)?gtk$/,
         'gtk'
      enable_gtk
    # ===================================================================== #
    # === codon_to_aminoacid
    # ===================================================================== #
    when /^codon(_|-)?to(_|-)?aminoacid$/
      e codon_to_aminoacid(a?)
    # ===================================================================== #
    # === toggle2
    # ===================================================================== #
    when 'toggle2'
      toggle_mode
    # ===================================================================== #
    # === name?
    # ===================================================================== #
    when 'name?',
         /^-?-?show(_|-| )?name(_|-| )?of(_|-| )?the(_|-| )?gene$/i
      show_name_of_the_gene
    # ===================================================================== #
    # === show_memo
    # ===================================================================== #
    when /show_?mnemo/,'mnemo','memo',
         'show_memo',
         'memo?'
      show_mnemo
    # ===================================================================== #
    # === bioroebe --gtk-nucleotide-analyser
    # ===================================================================== #
    when /^-?-?gtk(_|-| )?nucleotide(_|-| )?analyser$/i,
         /^-?-?nucleotide(_|-| )?analyser(_|-| )?gtk$/i
      require 'bioroebe/gui/gtk3/nucleotide_analyser/nucleotide_analyser.rb'
      Bioroebe::GUI::Gtk::NucleotideAnalyser.run
    # ===================================================================== #
    # === download_fasta
    # ===================================================================== #
    when /^download(_|-| )?fasta$/i,
         'dfasta',
         'dfa',
         'wget'
      download_fasta(a?)
    # ===================================================================== #
    # === Handle 33..55 and 33-55 and [33..55] and [33-55]
    #
    # This entry point can be used to obtain a subsequence of our target
    # sequence - it can "handle ranges".
    #
    # See the following link for an explanation of this regex:
    #
    #   https://rubular.com/r/zP7khUUIyC3zA0
    #
    # ===================================================================== #
    when /^\[?([0-9,.]{0,9}\d{1,9})\s*[-.,]{1,4}\s*([0-9,.]{1,9})\]?$/
      show_this_subsequence($1, $2)
    # ===================================================================== #
    # === blosum90
    # ===================================================================== #
    when /^-?-?blosum90/i
      e 'Showing '+i.delete('-')+' next.'+N+N
      Bioroebe::BlosumParser.show_as_2D_table(i)
    # ===================================================================== #
    # === calculate_levensthein
    # ===================================================================== #
    when /calculate(_|-| )?levensthein(_|-| )?distance/i,
         'calculate_levensthein' # lst computation complication
      ::Bioroebe.calculate_levensthein_distance(a?) # This will output the result by default.
    # ===================================================================== #
    # === longest_substring
    # ===================================================================== #
    when /longest(_|-)?substring/,
         'find_substring',
         'substring',
         'sub'
      find_longest_substring(a?) # sub AAAAGATAAACAAAAGGGG ATATCCTAAACAAAAGGGG
    # ===================================================================== #
    # === set_xclip
    # ===================================================================== #
    when /^set(_|-)?xclip$/i,
         'set_buffer',
         'xclip',
         'buffer',
         /^to(_|-)?buffer/i,
         'xorgbuffer',
         'setxorg'
      erev 'Next assigning the main DNA sequence to the Xorg Buffer.'
      set_xclip
    # ===================================================================== #
    # === to_base
    # ===================================================================== #
    when /to(_|-)?base$/,
         'base',
         /enter_?base_?dir/
      enter_base_directory
    # ===================================================================== #
    # === three_to_one
    #
    # This entry point will convert the three-letter code to the
    # one-letter code (in regards to aminoacids).
    #
    # Invocation example:
    #
    #   3to1 ARG-ALA-SER-LEU-PHE-TRP-LYS-HIS-ASN-SER-VAL-LEU-ILE-VAL-PRO
    #
    # ===================================================================== #
    when /^three(_|-)?to(_|-)?one$/,
         '3-1',
         '3letters',
         /^3(_|-| )?to(_|-| )?1$/ # === 3to1
      three_to_one(a?)
    # ===================================================================== #
    # === oligo_three
    # ===================================================================== #
    when /^oligo(_|-)?three$/,
         'oligo_length_three',
         'oligolengththree',
         'three',
         /^show(_|-)?oligo(_|-)?length(_|-)?three$/,
         'oligo_3',
         'oligo3'
      show_oligo_length_three
    # ===================================================================== #
    # === random_insert
    # ===================================================================== #
    when /^random(_|-)?insert$/i,
         'rinsert'
      random_insert(a?)
    # ===================================================================== #
    # === 9cut
    # ===================================================================== #
    when /^\d+cut$/,
         /^cut\d+$/, # Example: "9cut" or "cut9".
         /^cut(_|-)?sequence(_|-)?in(_|-)?slices(_|-)?of$/i
      _ = f.to_s.gsub(/cut/,'')
      cut_sequence_in_slices_of(_)
    # ===================================================================== #
    # === runmode?
    # ===================================================================== #
    when /runmode?/
      e runmode?
    # ===================================================================== #
    # === subseq2
    #
    # Usage example:
    #
    #   set_raw_sequence ATGCATGCAAA; subseq2
    #
    # ===================================================================== #
    when /^-?-?subseq2$/i
      show_this_subsequence(2, 4, raw_sequence?)
      # ===================================================================== #
      # === set_raw_sequence
      #
      # Usage example:
      #
      #   set_raw_sequence ATGCATGCAAA; raw_sequence?
      #   setrawsequence ATGCATGCAAA; raw_sequence?
      #
      # ===================================================================== #
    when /^-?-?set(_|-| )?raw(_|-| )?sequence$/i,
         /^-?-?assign(_|-| )?raw$/i
      erev 'Now assigning to the new sequence '+sfancy(f)
      set_raw_sequence(f)
    # ===================================================================== #
    # === annotate
    # ===================================================================== #
    when 'annotate'
      annotate_this_file(f)
    # ===================================================================== #
    # === hydropathy_table?
    # ===================================================================== #
    when 'hydropathy_table?',
         'hydropathytable?',
         'show_hydropathy_table',
         'showhydropathytable',
         'hydropathy?',
         /hpathy\??/,
         'spathy',
         'hydropathy_table',
         'hytable'
      show_hydropathy_table
    # ===================================================================== #
    # === restriction_sizes
    # ===================================================================== #
    when /^restriction(_|-)?sites$/i,
         'rest',
         'restriction',
         'sites',
         'res',
         'show_restriction_enzymes',
         'enzymes',
         'enz',
         'enzymes?',
         'rest2',
         'r',
         '4',
         'srest',
         'allrest',
         'show_rests'
      show_restriction_enzymes(:show_all) unless f
      find_restriction_sites(f) if f # Only do this if an argument was passed.
      @internal_hash[:bioroebe] << a.upcase if a
      @internal_hash[:bioroebe].restriction_sites?(dna_sequence?)
    # ===================================================================== #
    # === do_not_show_the_leader
    # ===================================================================== #
    when /^-?-?do_?not_?show_?the_?leader$/i,
         /^-?-?no_?leader$/i
      do_not_show_the_leader
    # ===================================================================== #
    # === readline?
    # ===================================================================== #
    when 'readline?'
      report_whether_readline_is_available
    # ===================================================================== #
    # === iaminoacid?
    # ===================================================================== #
    when 'iaminoacid?',
         /^identify(_|-)?aminoacid$/i,
         'iaminoacid',
         'aminoacid'
      identify_aminoacid(a?)
    # ===================================================================== #
    # === kozak?
    # ===================================================================== #
    when /^kozak\??$/i
      e
      erev '  GCCACCAUGG'
      e
    # ===================================================================== #
    # === first_atg?
    #
    # This entry point will show where the first ATG can be found in a
    # given sequence.
    # ===================================================================== #
    when /^first(_|-)?atg\??/i,
         /^report(_|-)?the(_|-)?first(_|-)?atg$/i
      report_the_first_atg
    # ===================================================================== #
    # === insulin
    #
    # This quick-link is used mostly just to quickly jump to the
    # insulin sequence.
    # ===================================================================== #
    when 'insulin'
      _ = NCBI_NUCCORE+'NC_000011.10?report=fasta&from=2159779&to=2161209&strand=true'
      e _
      open_in_browser _
    # ===================================================================== #
    # === Handle numbers given as input
    #
    # This entry point can be used to match numbers, such as 33 or
    # 66.
    # ===================================================================== #
    when /^[0-9]+$/
      assign(i)
    # ===================================================================== #
    # === assign_protein
    # ===================================================================== #
    when /^assign(_|-)?protein$/,
         /^assign(_|-)?aminoacids$/,
         'aprotein'
      assign_protein_sequence(a?)
    # ===================================================================== #
    # === show_complement
    # ===================================================================== #
    when 'show_complement',
         'complement',
         'complement?',
         'complementary',
         'cment',
         'c?',
         'co',
         'clent',
         'compl',
         'partner'
      show_complement(all_arguments?, :show_leading_primes)
    # ===================================================================== #
    # === ensure_that_the_base_directories_exist
    # ===================================================================== #
    when /^ensure(_|-)?that(_|-)?the(_|-)?base(_|-)?directories(_|-)?exist$/i
      erev 'Now creating some '+steelblue('base directories')+rev+
           ' for the bioroebe project.'
      Bioroebe.ensure_that_the_base_directories_exist
    # ===================================================================== #
    # === sizeseq
    # ===================================================================== #
    when /sizeseq/
      run_sizeseq
    # ===================================================================== #
    # === frame123
    # ===================================================================== #
    when 'frame123'
      showorf(dna_sequence?, :frame1_frame2_frame3)
    # ===================================================================== #
    # === find_restriction_sites
    # ===================================================================== #
    when 'find_restriction_sites',
         'rest?',
         'findrestrictionsites'
      find_restriction_sites(string?)
    # ===================================================================== #
    # === 1mbo
    # ===================================================================== #
    when /^1mbo$/
      download_this_pdb_file('1mbo')
    # ===================================================================== #
    # === no_truncate
    # ===================================================================== #
    when /^dont(_|-)?truncate$/,
         'do_not_truncate',
         'donottruncate',
         'no_truncate',
         'notruncate',
         'truncate-',
         '-truncate',
         '-trunc'
      do_not_truncate
    # ===================================================================== #
    # === pstop
    # ===================================================================== #
    when 'pstop',
         'astop'
      append_stop_codon
    # ===================================================================== #
    # === create_fasta
    # ===================================================================== #
    when /^create(_|-)?fasta$/i,
         /^make(_|-)?fasta$/i,
         /^save(_|-)?fasta$/i,
         /^create_?fasta_?file/
      create_fasta_file
    # ===================================================================== #
    # === K12
    # ===================================================================== #
    when 'K12'
      show_Ecoli_K12_information
    # ===================================================================== #
    # === test10
    # ===================================================================== #
    when 'test10'
      # =================================================================== #
      # Just some testing here.
      # =================================================================== #
      dna = ::Bioroebe::DNA.new(string?)
      find_this_subsequence = 'ATG'
      e 'Looking for '+royalblue(find_this_subsequence)
      array = dna.find_this_subsequence find_this_subsequence
      pp array
    # ===================================================================== #
    # === atgccontent
    # ===================================================================== #
    when 'atgccontent',
         'atcgcontent',
         'ncontent',
         'tacgcontent'
      calculcate_at_content(a?)
      calculcate_gc_content(a?)
    # ===================================================================== #
    # === use_fasta
    # ===================================================================== #
    when /^use_?fasta$/i,
         'use_this_fasta',
         'ufasta',
         'usethisfasta',
         'use_this_fasta_file',
         'useasta'
      use_this_fasta_file(f) # Use a fasta file based on its position.
    # ===================================================================== #
    # === The ViennaRNA package
    # ===================================================================== #
    when 'b2ct',
         'ct2db',
         'Kinfold',
         'popt',
         'RNA2Dfold',
         'RNAaliduplex',
         'RNAalifold',
         'RNAcofold',
         'RNAdistance',
         'RNAduplex',
         'RNAeval',
         'RNAfold',
         'RNAforester',
         'RNAheat',
         'RNAinverse',
         'RNALalifold',
         'RNALfold',
         'RNAlocmin',
         'RNApaln',
         'RNAparconv',
         'RNApdist',
         'RNAPKplex',
         'RNAplex',
         'RNAplfold',
         'RNAplot',
         'RNApvmin',
         'RNAsnoop',
         'RNAsubopt',
         'RNAup'
      this_command = i.dup+' '
      if a
        this_command << a.join(' ').chomp
      end
      e
      esystem(this_command)
      e
    # ===================================================================== #
    # === restore
    #
    # This will restore the last chop-operation.
    # ===================================================================== #
    when 'restore'
      restore_the_last_chop_operation
    # ===================================================================== #
    # === mirror_repeat
    # ===================================================================== #
    when /^mirror(_|-)?repeat$/i,
         /^mirror$/i
      mirror_repeat(a?)
    # ===================================================================== #
    # === TTAA
    # ===================================================================== #
    when 'TTAA?',
         'TTAA',
         'TTA_transposon'
      show_colourized_sequence('TTAA')
    # ===================================================================== #
    # === count_nucleotides
    # ===================================================================== #
    when 'cnucleotides',
         /count_?nucleotides/
      ::Bioroebe::CountAmountOfNucleotides.new(f) # cnucleotides ATTGGCTTGCCGGCAGACGA
    # ===================================================================== #
    # === all_sequences?
    # ===================================================================== #
    when 'all_sequences?',
         'allsequences?'
      show_main_dna_sequence # We show them only when they are NOT empty.
      show_seq_2 unless seq2?.empty?
      show_seq_3 unless seq3?.empty?
      show_seq_4 unless seq4?.empty?
      show_seq_5 unless seq5?.empty?
      show_seq_6 unless seq6?.empty?
    # ===================================================================== #
    # === CAP?
    # ===================================================================== #
    when 'CAP?',
         'CAP',
         'cap',
         'cap?'
      try_to_find_restriction_enzymes_for('TGTGA') # See: http://www.jbc.org/content/261/23/10885.full.pdf
    # ===================================================================== #
    # === unfreeze
    # ===================================================================== #
    when /^unfreeze$/,
         /^unfrozen$/,
         /^unfreeze(-|_| )?the(-|_| )?main(-|_| )?sequence$/
      erev 'Unfreezing the main sequence next.'
      unfreeze_the_main_sequence
    # ===================================================================== #
    # === show_editor_in_use
    # ===================================================================== #
    when /^show(_|-)?editor(_|-)?in(_|-)?use$/,
         'editor?',
         'ed?'
      show_editor_in_use
    # ===================================================================== #
    # === Mus_musculus.GRCm38.75.gtf.gz
    # ===================================================================== #
    when 'Mus_musculus.GRCm38.75.gtf.gz'
      download(
        'ftp://ftp.ensembl.org/pub/release-75/gtf/mus_musculus/Mus_musculus.GRCm38.75.gtf.gz'
      )
    # ===================================================================== #
    # === dump
    # ===================================================================== #
    when /^dump$/i
      dump(a?)
    # ===================================================================== #
    # === seq2?
    # ===================================================================== #
    when 'seq2?',
         's2?',
         /^show_?seq_?2/
      show_seq_2
    # ===================================================================== #
    # === seq2
    # ===================================================================== #
    when 'seq2'
      assign_sequence2(a?)
    # ===================================================================== #
    # === index_this_fasta_file
    #
    # This entry point will use samtools to index .fasta file(s).
    #
    # If no argument is given then this method will, by default, try
    # to use all .fasta and .fa files from the current working
    # directory. This feature exists primarily for convenience.
    # ===================================================================== #
    when /^-?-?index(_|-)?this(_|-)?fasta(_|-)?file$/i,
         /^-?-?index$/i
      index_this_fasta_file(a?) { :use_all_fasta_files_if_no_argument_was_given }
    # ===================================================================== #
    # === sanitize_nucleotide_sequence
    # ===================================================================== #
    when /^sanitize(_|-)?nucleotide(_|-)?sequence$/
      sanitize_nucleotide_sequence(a?)
    # ===================================================================== #
    # === align_ORFS
    # ===================================================================== #
    when /^align_?ORFS/i,'alignmorfs',
          'pretty_orf',
         /^align_?open_?reading_?frames/
      align_ORFS # Show all ORFs properly aligned.
    # ===================================================================== #
    # === pcr?
    # ===================================================================== #
    when 'pcr?'
      calculate_melting_temperature :show_formulas
    # ===================================================================== #
    # === completions?
    # ===================================================================== #
    when 'completions?','complet?'
      if use_readline?
        show_readline_completions
      else
        erev 'No completions are known, as the readline '\
             'module is not in use.'
      end
    # ===================================================================== #
    # === phred_quality_score_table
    # ===================================================================== #
    when /phred(_|-)?quality(_|-)?score(_|-)?table/
      require 'bioroebe/ngs/phred_quality_score_table.rb'
      ::Bioroebe::PhredQualityScoreTable.new
    # ===================================================================== #
    # === cuts_at?
    #
    # Where restriction enzymes cut.
    # ===================================================================== #
    when 'cuts_at?',
         'cuts_at',
         'cut?',
         'r?',
         'find_restriction_enzymes_that_cut_at',
         'findcutat?',
         'cutsat?'
      find_restriction_enzymes_that_cut_at(a?)
    # ===================================================================== #
    # === delimiter
    # ===================================================================== #
    when /delimiter/
      show_sequence_in_splitted_form(f) {{ use_this_token: '|' }}
    # ===================================================================== #
    # === aaruler
    #
    # Usage example:
    #
    #   aaruler KLKLKLKLAALKLAKLA
    #
    # ===================================================================== #
    when /^aaruler$/
      _ = aminoacid_sequence? # Default value.
      if f and !f.nil? and !f.empty?
        _ = f
      end
      show_sequence_with_a_ruler(:default, _, :aminoacids)
    # ===================================================================== #
    # === ruler
    #
    # This entry point will display a useful number on each nucleotide
    # position.
    # ===================================================================== #
    when /^ruler$/,
         /^-?-?show(_|-| )?sequence(_|-| )?with(_|-| )?a(_|-| )?ruler$/
      show_sequence_with_a_ruler(a?, :default, :dna)
    # ===================================================================== #
    # === e
    #
    # This entry point can be used to quickly feedback which arguments
    # have been passed.
    #
    # Specific usage example:
    #
    #   e one two three
    #
    # ===================================================================== #
    when 'e'
      e all_arguments?
    # ===================================================================== #
    # === check_for_mismatches
    # ===================================================================== #
    when /^check(_|-)?for(_|-)?mismatches$/i,
         'mismatch',
         'mismatches'
      check_for_mismatches
    # ===================================================================== #
    # === bedtoolsv
    # ===================================================================== #
    when 'bedtoolsv',
         'bedtools?',
         /^try(_|-)?to(_|-)?report(_|-)?the(_|-)?version(_|-)?of(_|-)?bedtools$/
      try_to_report_the_version_of_bedtools
    # ===================================================================== #
    # === return_random_nucleotide
    # ===================================================================== #
    when /^return(_|-)?random(_|-)?nucleotide$/i
      e return_random_nucleotide
    # ===================================================================== #
    # === return_random_aminoacid
    # ===================================================================== #
    when /^return(_|-)?random(_|-)?aminoacid$/i
      e return_random_aminoacid
    # ===================================================================== #
    # === cut_with_enzyme
    #
    # This entry point can be used to cut a DNA sequence with a
    # restriction enzyme.
    #
    # Invocation example:
    #
    #   cut_with_enzyme EcoRI
    #
    # ===================================================================== #
    when /^cut(_|-)?with(_|-)?enzyme$/i
      cut_with_enzyme(a?)
    # ===================================================================== #
    # === show_history
    #
    # This entry point can be used to show the input-history that was
    # used so far. The "input-history" is what the user typed.
    # ===================================================================== #
    when /^show(_|-)?history$/i,
         'h',
         'h?',
         'history',
         'history?',
         'hist',
         'hist?'
      show_history
    # ===================================================================== #
    # === try_to_find_this_restriction_enzyme
    # ===================================================================== #
    when /^try(_|-)?to(_|-)?find(_|-)?this(_|-)?restriction(_|-)?enzyme$/
      try_to_find_this_restriction_enzyme(f)
    # ===================================================================== #
    # === dalton
    # ===================================================================== #
    when /^dalton$/i
      dalton(f?)
    # ===================================================================== #
    # === search_for
    # ===================================================================== #
    when /^search(_|-)?for$/ 
      search_for(a?)
    # ===================================================================== #
    # === colour_test
    # ===================================================================== #
    when /^colour(_|-)?test$/i
      set_highlight_colour(:violet)
    # ===================================================================== #
    # === to_dna
    # ===================================================================== #
    when /^to(_|-| )?DNA$/i,
         'dna',
         'rna2dna'
      to_dna(f)
    # ===================================================================== #
    # === backtranseq
    #
    # This entry point allows us to translate an Aminoacid Sequence back
    # into the most likely DNA sequence.
    #
    # Usage example:
    #
    #   backtranseq ARGARG
    #
    # ===================================================================== #
    when 'backtranseq',
         'backseq',
         'backtrack',
         /^aminoacid(_|-| )?to(_|-| )?dna$/i,
         'runcodons',
         'btrack',
         /^protein(_|-| )?to(_|-| )?dna$/i,
         'proteintodna',
         'p_to_d','ptod',
         /^reverse(_|-| )?dna$/i,
         /^reverse(_|-| )?seq$/i,
         /^reverse(_|-| )?aa$/i, # === reverse_aa
         'bseq',
         'backtraq',
         'backtrach'
      backtranseq(a?)
    # ===================================================================== #
    # === colour_test
    # ===================================================================== #
    when /^colour(_|-)?test/
      e
      erev 'This is a test.'
      e
      erev 'This is another test.'
      erev 'Now for '+slateblue('slateblue')+rev+'.'
      erev 'Now for '+lightgreen('lightgreen')+rev+'.'
      e
    # ===================================================================== #
    # === show_aminoacids_mass_table
    # ===================================================================== #
    when /^show(_|-)?aminoacids(_|-)?mass(_|-)?table$/i,
         /^show(_|-)?aminoacid(_|-)?mass$/i,
         'showmass',
         'aminoacid_table_overview',
         'aminomass',
         'aminomasses'
      show_aminoacids_mass_table
    # ===================================================================== #
    # === stride
    # ===================================================================== #
    when 'stride' # The C-program called stride.
      _ = 'stride '+f?.to_s+' > '+f?.to_s+'_stride_output'
      esystem(_)
    # ===================================================================== #
    # === multliline_assignment
    # ===================================================================== #
    when /^multiline_?assignment$/,
         'mass',
         'multiline2',
         'mline',
         'mmm',
         '___',
         '__',
         '--',
         'assignmultiline',
         'assign_multiline',
         'multiline_input',
         'multilineinput',
         'multi_line',
         'multiline',
         'multi-line',
         'multi_input',
         'multline'
      assign_sequence(:multiline)
    # ===================================================================== #
    # === download_dir?
    # ===================================================================== #
    when /^download(_|-)?dir\??$/,
         'ddir?','base?',
         'depotdir?','depot?',
         /^temp\??$/i,
         /^show(_|-)?download(_|-)?dir$/ # === show_download_dir
      show_download_dir
    # ===================================================================== #
    # === @parse_fasta
    # ===================================================================== #
    when '@parse_fasta'
      last_fasta_entry?.display
    # ===================================================================== #
    # === show_aa
    # ===================================================================== #
    when /^show(_|-)?aa$/i,
         'aminoacids?','aaseq?','aasq?','aminacids?',
         'aminocids?',
         'aasequence?',
         /^show(_|-)?aminoacid(_|-)?sequence$/i
      show_aminoacid_sequence
    # ===================================================================== #
    # === pyrrolysine
    # ===================================================================== #
    when /pyrrolysine?\??/
      erev 'UAG codes for pyrrolysine'
    # ===================================================================== #
    # === to_T
    #
    # Convert all 'U' into 'T', if there are any U at all.
    # ===================================================================== #
    when /^to(_|-)?T$/i
      dna_sequence_object?.extend(Bioroebe::NucleotideModule)
      assign_this_dna_sequence(
        dna_sequence_object?.to_T
      )
    # ===================================================================== #
    # === theory?
    # ===================================================================== #
    when 'theory','theory?'
      e '  T = h ** 2 + h*k + k ** 2'
    # ===================================================================== #
    # === ..
    # ===================================================================== #
    when '..'
      cd '..'
    # ===================================================================== #
    # === last_inputted_command?
    # ===================================================================== #
    when /^last(_|-)?inputted(_|-)?command\??$/i
      e last_inputted_command?
    # ===================================================================== #
    # === flybase?
    # ===================================================================== #
    when /^flybase\??$/i
      open_in_browser(i.delete('?'))
    # ===================================================================== #
    # === fasta_file?
    # ===================================================================== #
    when /^fasta(_|-)?file\??$/i
      e fasta_file?
    # ===================================================================== #
    # === dna?
    # ===================================================================== #
    when 'dnaa?',
         'dnaA',
         'dnaA?'
      attempt_to_discover_dna_A_boxes
    # ===================================================================== #
    # === useful_packages?
    # ===================================================================== #
    when /^useful(_|-)?packages\??$/,
         /^science(_|-)?addons\??$/,
         /^addons\??$/,
         /^external\??$/,
         /^status\??$/,
         /^report$/
      report_useful_packages_installed
    # ===================================================================== #
    # === f23
    # ===================================================================== #
    when 'f2,f3','f23'
      showorf(dna_sequence?, :frame2_frame3)
    # ===================================================================== #
    # === f1,f2
    # ===================================================================== #
    when 'f1,f2','f12'
      showorf(dna_sequence?, :frame1_frame2)
    # ===================================================================== #
    # === f1,f2,f3
    # ===================================================================== #
    when 'f1,f2,f3'
      showorf(dna_sequence?, :frame1_frame2_frame3)
    # ===================================================================== #
    # === genbank?
    # ===================================================================== #
    when 'genbank?'
      open_in_browser :genbank
    # ===================================================================== #
    # === gold?
    # ===================================================================== #
    when 'gold?'
      _ = 'https://gold.jgi.doe.gov/'
      e _
      open_in_browser(_)
    # ===================================================================== #
    # === purge
    # ===================================================================== #
    when 'purge'
      purge(a?)
    # ===================================================================== #
    # === restrictionenzymes?
    # ===================================================================== #
    when 'restrictionenzymes?','restrictionenzymes','restriction?'
      show_restriction_enzymes(:show_all)
    # ===================================================================== #
    # === longest_ORF
    # ===================================================================== #
    when /^longest(_|-| )?ORF$/i
      _ = Bioroebe.longest_ORF?(sequence_as_string?)
      erev 'The longest ORF has a size of '+steelblue(_.size.to_s)+
           rev+' nucleotides.'
      erev 'This sequence is shown next:'
      e
      show_this_sequence(_)
      e
    # ===================================================================== #
    # === codon_usage_database?
    # ===================================================================== #
    when /^codon(_|-)?usage(_|-)?database\??$/i
      erev 'On 20.05.2016 this database has had:'
      e
      erev '  35,799 organisms'
      erev "  3,027,973 complete protein coding genes (CDS's)"
      e
    # ===================================================================== #
    # === 1IGT
    #
    # This .pdb file is related to antibodies.
    # ===================================================================== #
    when '1IGT'
      open_1igt_in_the_browser
    # ===================================================================== #
    # === enable_xsel
    # ===================================================================== #
    when /^enable(_|-)?xsel$/i
      enable_xsel
    # ===================================================================== #
    # === show_xorg_buffer
    # ===================================================================== #
    when /^show(_|-)?xorg(_|-)?buffer$/i,
         /^show(_|-)?xbuffer$/i,
         'sxorgbuffer'
      show_xorg_buffer
    # ===================================================================== #
    # === weight_of_nucleotides
    #
    # This entry point simply shows the weight of the four different
    # nucleotides.
    # ===================================================================== #
    when /^weight(_|-)?of(_|-)?nucleotides$/i,
         /^wnuc$/i
      show_the_weight_of_the_four_individual_nucleotides
    # ===================================================================== #
    # === viennarnav
    # ===================================================================== #
    when /^viennarna(v|\?)?$/i # Allows both "viennarna" and "viennarna?"
      try_to_report_the_version_of_viennarna
    # ===================================================================== #
    # === yaml?
    # ===================================================================== #
    when 'yaml','yaml?',
         /^show(_|-)?all(_|-)?yaml(_|-)?files/i
      show_all_yaml_files
    # ===================================================================== #
    # === match_pattern
    #
    # Usage example:
    #
    #   match_pattern ACGTACGTAACG GTA
    #   match_pattern ATGTGACTACGACGCATATGACGTACGTAACG ATG
    # 
    # ===================================================================== #
    when /^match(_|-)?pattern$/i
      results = Bioroebe.return_array_of_sequence_matches(
        first_argument?, second_argument?
      )
      results.reverse.each {|position|
        show_this_sequence(
          first_argument?[(position-1) .. -1]
        )
      }
    # ===================================================================== #
    # === to_genbank
    #
    # This entry point can be used to convert the main DNA sequence to
    # the genbank format.
    # ===================================================================== #
    when /^to(_|-)?genbank$/,
         'togen',
         'filemaker',
         'format?',
         'genbeauty',
         'beauty2',
         'togenb',
         'genbank',
         'togenban',
         'genbankflatfilegen',
         'formatter',
         'pretty',
         'prettify',
         'beautify',
         'sanitize',
         /table_?formatter/
      to_genbank
    # ===================================================================== #
    # === last_update?
    #
    # This entry point notifies the user as to when the bioroebe project
    # was last updated.
    # ===================================================================== #
    when /^last(_|-)?update\??$/i
      report_when_the_bioroebe_project_was_last_updated
    # ===================================================================== #
    # === colour_scheme
    #
    # Usage example:
    #
    #   colour_scheme ATGACTCAGACACTAGCTAGCTAGCTAGACTACA
    #
    # ===================================================================== #
    when /^colour(_|-)?scheme$/i,
         /^colour(_|-)?scheme(_|-)?for(_|-)?nucleotides$/i,
         'cscheme'
      colour_scheme_for_nucleotides(a?)
    # ===================================================================== #
    # === constants?
    # ===================================================================== #
    when 'constants?'
      pp ::Bioroebe.constants.sort
    # ===================================================================== #
    # === config?
    # ===================================================================== #
    when 'config?',
         'configuration?',
         'con?',
         'show_config',
         'showconfig'
      try_to_show_the_configuration
    # ===================================================================== #
    # === swisss-prot?
    # ===================================================================== #
    when /swiss-?prot\??/,
         /report_?n_?proteins_?registered_?in_?swiss_?prot$/
      report_n_proteins_registered_in_swiss_prot
    # ===================================================================== #
    # === rubyversion
    #
    # The second line is for jruby specifically.
    # ===================================================================== #
    when /^ruby(_|-)?version/i
      e steelblue(RUBY_VERSION)
      if Object.const_defined?(:ENV_JAVA)
        erev 'Java version: '+
             steelblue(ENV_JAVA['java.version'].to_s)
      end
    # ===================================================================== #
    # === disable
    #
    # This entry point allows us to disable specific features, as far
    # as the BioRoebe shell is concerned.
    # ===================================================================== #
    when /^disable/,
         'no'
      disable(a?)
    # ===================================================================== #
    # === shine_dalgarno?
    # ===================================================================== #
    when 'shine_dalgarno?','shine?',
         'shine',
         'shine_dalgarno',
         'sd',
         'sd?',
         'find_shine_dalgarno_sequence',
         'sine'
      find_shine_dalgarno_sequence
    # ===================================================================== #
    # === random_dna_sequence
    #
    # This entry point will simply display the random DNA sequence,
    # the default length. Currently this is 250.
    # ===================================================================== #
    when /^random(_|-)?dna(_|-)?sequence$/i
      display_this_nucleotide_sequence(
        random_dna_sequence
      )
    # ===================================================================== #
    # === raw?
    # ===================================================================== #
    when 'raw?','raw'
      show_dna_string(
        dna_string?, :do_not_truncate_and_do_not_show_leader_and_trailer
      )
    # ===================================================================== #
    # === salt_adjusted_tm
    #
    # Entry point for calculating the salt-adjust Tm (melting temperature).
    #
    # Most useful for primers in the range of 18-25, give or take.
    # ===================================================================== #
    when /^salt(_|-)?adjusted(_|-)?tm$/,
         /^melting(_|-)?temperature2$/
      erev salt_adjusted_tm(a?)
    # ===================================================================== #
    # === melting_temperature?
    # ===================================================================== #
    when 'calculate_melting_temperature','calculatemeltingtemperature',
         'mt','melting_temperature','ctemp','tm','melting?',
         'melting_temperature?','melt',
         'cmelt','calmelt'
      calculate_melting_temperature(a?) # melting? GCCGCGGTTTCGGGA
    # ===================================================================== #
    # === translate3
    # ===================================================================== #
    when 'translate3','t','aminoacid?','trans1'
      translate(a?)
    # ===================================================================== #
    # === bioroebe --libui1
    #
    # All --libui entries should be sorted alphabetically in this
    # menu as well.
    # ===================================================================== #
    when /^-?-?libui1?$/i
      require 'bioroebe/gui/libui/dna_to_aminoacid_widget/dna_to_aminoacid_widget.rb'
      Bioroebe::GUI::LibUI::DnaToAminoacidWidget.run
    # ===================================================================== #
    # === bioroebe --libui2
    # ===================================================================== #
    when /^-?-?libui2$/i
      require 'bioroebe/gui/libui/dna_to_aminoacid_widget/dna_to_aminoacid_widget.rb'
      Bioroebe::GUI::LibUI::DnaToAminoacidWidget.run
    # ===================================================================== #
    # === bioroebe --libui3
    # ===================================================================== #
    when /^-?-?libui3$/i
      require 'bioroebe/gui/libui/random_sequence/random_sequence.rb'
      Bioroebe::GUI::LibUI::RandomSequence.run
    # ===================================================================== #
    # === show_taxid
    # ===================================================================== #
    when 'show_taxid','showtaxid','taxid?','taxid'
      show_taxid(a?)
    # ===================================================================== #
    # === ten_split
    # ===================================================================== #
    when /^ten(_|-)?split$/i
      show_sequence_in_splitted_form(10)
    # ===================================================================== #
    # === n_downloads?
    # ===================================================================== #
    when 'n_downloads?' # How often Bioroebe was downloaded.
      require 'bestgems'
      n_times = Bestgems.client.total_downloads(:bioroebe).values.first
      erev 'The Bioroebe project has been downloaded '+simp(n_times.to_s)+rev+' times.'
    # ===================================================================== #
    # === genbank_version?
    # ===================================================================== #
    when /genbank_?version\??/,'report_current_genbank_version',
         'top',
         'genebank?',
         'reportcurrentgenbankversion',
         'genbankversion?',
         'genbank_version',
         'current_genbank_version?',
         'current_genbank_version'
      report_current_genbank_version(:also_report_the_URL)
    # ===================================================================== #
    # === phosphorylation_sites?
    # ===================================================================== #
    when 'phosphorylation_sites?','psites?','phosphorylationsites?',
         'phosphorylationsites','psites','phosphorylation_site?',
         'phospho?','show_phosphorylation_sites','showphosphorylationsites',
         'p?','P',
         'phosphorylation',
         'P?'
      show_possible_phosphorylation_sites
    # ===================================================================== #
    # === pitch
    # ===================================================================== #
    when 'pitch','alpha_helix_pitch',
         'alphahelixpitch'
      show_length_of_alpha_helix(a?)
    # ===================================================================== #
    # === handle_pdb_files
    #
    # Invocation example:
    #
    #   handle_pdb_files http://www.rcsb.org/pdb/files/3O30.pdb
    #
    # ===================================================================== #
    when /^handle(_|-)?pdb(_|-)?files$/i,
         'pdb','pdb?',
         'download_pdb',
         'dpdb',
         'downloadpdb',
         /^download(_|-)?this(_|-)?pdb(_|-)?file$/i
      handle_pdb_files(a?)
    # ===================================================================== #
    # === pdburl?
    # ===================================================================== #
    when /pdb(_|-| )?url?/,
         'pdb2?'
      e 'https://www.wwpdb.org/'
    # ===================================================================== #
    # === freeze
    # ===================================================================== #
    when /^freeze$/,
         /^frozen$/,
         /^freeze(-|_| )?the(-|_| )?main(-|_| )?sequence$/
      erev 'Freezing the main sequence next.'
      freeze_the_main_sequence
    # ===================================================================== #
    # === parse
    #
    # This is the general-entry for parse-related activities in regards
    # to the bioshell-interface.
    #
    # Examples for files that are parsed include .pdb files and
    # .fasta files.
    # ===================================================================== #
    when 'parse',
         /^parse(_|-| )?this(_|-| )?pdb(_|-| )?file$/,
         /^parse(_|-| )?pdb(_|-| )?file$/,
         /^parse(_|-| )?pdb$/,
          'parse_fasta_format',
         /^parse(_|-| )?fasta$/,
         'pfasta',
         'pasta',
         'fasta',
         'fast',
         /^assign(_|-| )?fasta$/
      parse(a?)
    # ===================================================================== #
    # === cut_at
    # ===================================================================== #
    when /cut(_|-)?at$/i
      cut_at(f)
    # ===================================================================== #
    # === punnet
    # ===================================================================== #
    when 'punnet',
         'pun'
      punnet(a?) # bl $BIOROEBE/shell/shell.rb
    # ===================================================================== #
    # === stop_frame1?
    # ===================================================================== #
    when /^stop(_|-)?frame1\??$/i
      report_main_sequence(dna_sequence_as_string?, :stop_codon_in_frame1)
    # ===================================================================== #
    # === stop_frame2?
    # ===================================================================== #
    when /^stop(_|-)?frame2\??$/i
      report_main_sequence(dna_sequence_as_string?, :stop_codon_in_frame2)
    # ===================================================================== #
    # === stop_frame3?
    # ===================================================================== #
    when /^stop(_|-)?frame3\??$/i
      report_main_sequence(dna_sequence_as_string?, :stop_codon_in_frame3)
    # ===================================================================== #
    # === orf?
    #
    # This entry point will display to the user where open reading
    # frames can be found in the main sequence.
    # ===================================================================== #
    when /^ORF\??$/i,
         /^ORF1\??$/i,
         /^ORFs\??$/i,
         'open_reading_frames',
         'search?',
         'startcodons?',
         'search_for_orfs',
         'orfs?',
         /^open(_|-)?reading(_|-)?frames$/i,
         'start?',
         'toorf',
         'ORFS?',
         'all_ORFs',
         'allorfs',
         'ATG?',
         /^AUG\??$/i
      result = search_sequence_for_open_reading_frames
      print '  '
      pp result
      e
      # =================================================================== #
      # Colourize all ATG tags next. One day this may have to become
      # more flexible so that we can colourize codons other than ATG,
      # since e. g. in bacteria, a few genes start with another codon.
      # =================================================================== #
      show_nucleotide_sequence?.display(main_sequence?) { :colourize_start_codon }
      e
      if f? # User supplied an argument in this case
        report_n_start_codons { f? }
      else
        report_n_start_codons
      end
    # ===================================================================== #
    # === orf2?
    # ===================================================================== #
    when /^ORF2\??$/i
      result = search_sequence_for_open_reading_frames(
        :default, :frame2, :default
      )
      erev result
    # ===================================================================== #
    # === fastq_quality_scores
    # ===================================================================== #
    when /^fastq(_|-)?quality(_|-)?scores$/i,
         /^fastq(_|-)?quality(_|-)?schemes$/i,
         /^show(_|-)?fastq(_|-)?quality(_|-)?score(_|-)?table$/i,
         /^fastq(_|-)?table?/
      show_fastq_quality_score_table
    # ===================================================================== #
    # === Visit the human GRCh38.p14 assembly
    # ===================================================================== #
    when /^GRCh38.p14$/i
      open_in_browser 'https://www.ncbi.nlm.nih.gov/assembly/GCF_000001405.40'
    # ===================================================================== #
    # === Visit the human GRCh38 assembly
    # ===================================================================== #
    when /^GRCh38$/i
      open_in_browser 'https://www.ncbi.nlm.nih.gov/assembly/GCF_000001405.26/'
    # ===================================================================== #
    # === Feedback which browser is in use
    #
    # Usage example:
    #
    #   browser?
    #
    # ===================================================================== #
    when /^browser\??$/i
      e YAML.load_file(project_yaml_directory?+'configuration/browser.yml')
    # ===================================================================== #
    # === one-to-three
    #
    # This will convert from the one-aminoacid letter to the three-aminoacid
    # letter.
    #
    # Usage example:
    #
    #   1to3 KRKAKAGAGAUUGAUGAAGCCACA # => Lys-Arg-Lys-Ala-Lys-Ala-Gly-Ala-Gly-Ala-Sec-Sec-Gly-Ala-Sec-Gly-Ala-Ala-Gly-Cys-Cys-Ala-Cys-Ala
    #
    # ===================================================================== #
    when /^1to3$/i
      e Bioroebe.one_to_three(a?)
    # ===================================================================== #
    # === set_aminoacids
    # ===================================================================== #
    when 'set_aminoacids',
         'aa_seq',
         'aaseq',
         'setaminoacids',
         'setaa',
         'set_aminoacid',
         'set_aa',
         'setamino',
         'setaminoacid',
         'set_aminoacid_sequence'
      set_aminoacids(a?)
    # ===================================================================== #
    # === stop_codons?
    # ===================================================================== #
    when 'stop_codons?',
         /^stopcodons\??$/,
         'scodons?',
         'look_for_stop_codons_in_the_main_sequence',
         /^report(_|-)?all(_|-)?stop(_|-)?codons$/
      report_all_stop_codons
    # ===================================================================== #
    # === version?
    # ===================================================================== #
    when 'version?',
         'version',
         /^feedback(_|-)?version$/i
      feedback_version
    # ===================================================================== #
    # === CpG?
    # ===================================================================== #
    when /^show(_|-)?cpg(_|-)?islands$/,
         'cg?','CG?','CpG?','CpG',
         'cpg?','cpg','cpg_islands',
         'CPG'
      show_cpg_islands
    # ===================================================================== #
    # === is_on_roebe?
    # ===================================================================== #
    when 'is_on_roebe?'
      erev 'Are we on roebe? '+
           verbose_truth(::Bioroebe.is_on_roebe?.to_s)
    # ===================================================================== #
    # === enable_colours
    # ===================================================================== #
    when 'col',
         'enable_colours',
         'enablecolours',
         'ecolours'
      enable_colours
    # ===================================================================== #
    # === enable_colours_in_an_extended_manner
    # ===================================================================== #
    when /enable(_|-| )?colours(_|-| )?in(_|-| )?an(_|-| )?extended(_|-| )?manner$/
      enable_colours_in_an_extended_manner(:be_verbose)
    # ===================================================================== #
    # === deduce_aa_seq?
    #
    # This entry point will show the possible codons that could code for
    # the given aminoacid at hand.
    #
    # Invocation examples:
    #
    #   deduce_this_aminoacid_sequence AARGLKKKLKLMMAAAAA
    #   deduce MTTAGP
    #   deduce MTTAGKLIIBRRSAAP
    #
    # ===================================================================== #
    when /^deduce(_|-| )?this(_|-| )?aminoacid(_|-| )?sequence$/i,
         'deduce',
         'ded',
         'codons',
         'sof',
         'deduce_aa_seq?',
         'sequence_of',
         'sequenceof',
         'peptide',
         'deduce?',
         /^reverse_?DNA$/i,
         /^revseq$/i
      deduce_this_aminoacid_sequence(f)
    # ===================================================================== #
    # === report_main_sequence
    # ===================================================================== #
    when /^report(_|-)?main(_|-)?sequence$/i,
         'report2'
      report_main_sequence
    # ===================================================================== #
    # === stopcodon?
    # ===================================================================== #
    when /^stop_?codon\??/,
         /^determine_?and_?report_?all_?stop_?codons/
      determine_and_report_all_stop_codons
    # ===================================================================== #
    # === what_sequence_is_this?
    # ===================================================================== #
    when 'what_sequence_is_this?',
         'whatsequenceisthis?',
         'whatsequence'
      what_sequence_is_this?
    # ===================================================================== #
    # === tb1
    #
    # This entry point will start the gtk-controller (some gtk-widgets).
    # ===================================================================== #
    when /^tb1$/i
      remote_URL =
        'https://raw.githubusercontent.com/vsbuffalo/bds-files/master/chapter-03-remedial-unix/tb1-protein.fasta'
      cd log_dir?
      esystem 'wget '+remote_URL
      e 'Downloaded into '+sdir(return_pwd)+'.'
    # ===================================================================== #
    # === add_to_start
    # ===================================================================== #
    when /^add(_|-)?start$/i,
         /^add(_|-)?to(_|-)?start$/i,
         'prepend'
        add_to_start(a?)
    # ===================================================================== #
    # === cd                                                       (cd tag)
    #
    # Usage example:
    #
    #   cd /tmp
    #
    # ===================================================================== #
    when 'cd'
      cd(f)
    # ===================================================================== #
    # === blosum62
    # ===================================================================== #
    when /^-?-?blosum62/i
      e 'Showing '+i.delete('-')+' next.'+N+N
      Bioroebe::BlosumParser.show_as_2D_table(i)
    # ===================================================================== #
    # === add_polyA
    # ===================================================================== #
    when 'add_poly_a','add_polyA','polya',
         'addpolya',
         '+polyA',
         'polyA'
      e 'Appending a PolyA sequence to the RNA next (onto @rna).'
      add_poly_a_sequence
    # ===================================================================== #
    # === bioroebe --all_blosum
    # ===================================================================== #
    when /^-?-?all(_|-| )?blosum/i # Show all blosum values here.
      array_all_blosums = %w(
        45 50 62 80 90
      ).map {|entry| entry = entry.dup; entry.prepend('blosum') }
      menu(array_all_blosums)
    # ===================================================================== #
    # === blosum45
    # ===================================================================== #
    when /^-?-?blosum45/i
      e 'Showing '+i.delete('-')+' next.'+N+N
      Bioroebe::BlosumParser.show_as_2D_table(i)
    # ===================================================================== #
    # === blosum50
    # ===================================================================== #
    when /^-?-?blosum50/i
      e 'Showing '+i.delete('-')+' next.'+N+N
      Bioroebe::BlosumParser.show_as_2D_table(i)
    # ===================================================================== #
    # === gc_content?
    #
    # This entry point will calculate the GC content, as a percentage,
    # of the given input sequence. If no input is given then the
    # default DNA sequence will be used (if assigned).
    #
    # Usage example:
    #
    #   GC? ATGGGGGCGCG
    #
    # ===================================================================== #
    when /^gc_?content\??$/i,
         'calculate',
         'cgc',
         'gcontent',
         'gccc',
         /^GC\??$/i,
         'gccontent?',
         'gc_percent',
         'gcpercent'
      calculcate_gc_content(a?) # This variant will be verbose.
    # ===================================================================== #
    # === www_finder
    #
    # Invocation example:
    #
    #   bioroebe --gtk-www-finder
    #
    # ===================================================================== #
    when 'www_finder',
         'wwwfinder',
         'wfind',
         'wfinder',
         /^-?-?gtk(_|-| )?www(_|-| )?finder$/i
      load_gtk
      require 'bioroebe/gui/gtk3/www_finder/www_finder.rb'
      e 'Starting the WWWFinder next.'
      thread = Thread.new { Bioroebe::GUI::Gtk::WwwFinder.run_gtk3_widget }
      thread.join
    # ===================================================================== #
    # === bioroebe --gtk-levensthein
    # ===================================================================== #
    when /^-?-?gtk(_|-| )?levensthein$/i,
         /^-?-?levensthein(_|-| )?gui$/i
      require 'bioroebe/gui/gtk3/levensthein_distance/levensthein_distance.rb'
      Bioroebe::GUI::Gtk::LevenstheinDistance.run
    # ===================================================================== #
    # === count_aminoacids
    # ===================================================================== #
    when 'count_aminoacids',
         'countaminoacids',
         'caminoacids',
         'aminoacid_composition',
         'aminoacidcomposition',
         'acomposition'
      count_amount_of_aminoacids(f)
    # ===================================================================== #
    # === 3iyq.pdb
    # ===================================================================== #
    when '3iyq.pdb'
      download(
        'https://www.rcsb.org/pdb/download/downloadFile.do?fileFormat=fastachain&compression=NO&structureId=3IYR&chainId=B'
      )
    # ===================================================================== #
    # === ubiquitin?
    #
    # This method will simply show the default ubiquitin-sequence.
    # ===================================================================== #
    when 'ubuiquitin?',
         'ubiquitin?',
         'u?',
         'ubiquitin',
         'ub?',
         'return_ubiquitin_sequence',
         'ubi?'
      erev 'N-Terminus '+steelblue(
             ::Bioroebe.return_ubiquitin_sequence
           )+rev+' C-Terminus'
    # ===================================================================== #
    # === KDEL?
    #
    # This entry point will search for a KDEL sequence in the
    # corresponding amino acid sequence.
    #
    # How to test this:
    #
    #   assign AAAAAATTTGGGCCCGCGCCCTTTAAAGATGAACTA; KDEL?
    #
    # ===================================================================== #
    when 'KDEL?',
         'KDEL',
         'find_kdel_sequence'
      find_kdel_sequence
    # ===================================================================== #
    # === bioroebe --blosum80
    # ===================================================================== #
    when /^-?-?blosum80/i
      e 'Showing '+i.delete('-')+' next.'+N+N
      Bioroebe::BlosumParser.show_as_2D_table(i)
    # ===================================================================== #
    # === levensthein
    # ===================================================================== #
    when 'levensthein',
         'lst'
      interactive_use_of_levensthein
    # ===================================================================== #
    # === hamming_distance?
    # ===================================================================== #
    when 'hamming','hamming?',
         /^hamming(_|-| )?distance\??$/,
         /^-?-?hamming$/,
         'the_hamming_distance',
         'align'
      calculate_hamming_distance_of(a?)
    # ===================================================================== #
    # === mass_weight?
    # ===================================================================== #
    when 'mass_weight?',
         'mass_weight',
         'massweight',
         'aa_mass',
         'ma' # Calculate weight of proteins.
      mass_weight(f)
    # ===================================================================== #
    # === show_molweight
    #
    # This entry point will show the molecular weights of the four main
    # DNA bases - Adenin, Guanin, Cytosin and Thymin.
    # ===================================================================== #
    when /^show(_|-)?molweight$/i,
         'molweight?',
         'mweight?',
         'm?'
      show_molweight
    # ===================================================================== #
    # === okular
    # === evince
    #
    # This is mostly so that we can quickly use common .pdf viewers.
    # ===================================================================== #
    when 'okular',
         'evince'
      verbose_handle_this_sys_command(i, a?)
    # ===================================================================== #
    # === RNAfold1
    # ===================================================================== #
    when 'RNAfold1'
      esystem 'RNAfold < test.seq'
    # ===================================================================== #
    # === design_polylinker
    # ===================================================================== #
    when /^design(_|-)?polylinker$/i,
         'polylinker?',
         'mcs',
         'mcs?',
         'primer?'
      e colourize_nucleotide(design_polylinker(f))
    # ===================================================================== #
    # === seqsize2
    # ===================================================================== #
    when /seqsize(\d+)/,
         /seq(\d+?)size\??/ # See: http://rubular.com/r/IDvU2LJBSA for the second regex
      _ = $1.to_s.dup
      case _
      when '2'
        report_size_of_this_sequence seq2?,''
      when '3'
        report_size_of_this_sequence seq3?,''
      when '4'
        report_size_of_this_sequence seq4?,''
      when '5'
        report_size_of_this_sequence seq5?,''
      when '6'
        report_size_of_this_sequence seq6?,''
      end
    # ===================================================================== #
    # === set_locus
    # ===================================================================== #
    when /set_?locus/,
         'locus'
      set_locus(a?) # set_locus NM_021964
    # ===================================================================== #
    # === coding_entry
    #
    # This entry point can be used like this:
    #
    #   coding_entry 51..3251
    #
    # ===================================================================== #
    when /^coding_?entry/
      designate_this_input_as_coding_entry(a?)
    # ===================================================================== #
    # === multiline_fasta
    # ===================================================================== #
    when 'multiline_fasta',
         'multilinefasta',
         'mfasta',
         'm_fasta',
         'multi_assign','multiassign','multifasta',/input_?fasta/
      obtain_multiline_fasta # in fasta.rb
    # ===================================================================== #
    # === prosite
    # ===================================================================== #
    when 'prosite',
         'prosite_homepage'
      e 'PROSITE - a database of protein families and domains.'
      e (_ = Bioroebe.try_to_pass_through_beautiful_url(:prosite))
      open_in_browser _
    # ===================================================================== #
    # === restriction_enzymes_run
    # ===================================================================== #
    when 'test_restriction_enzymes_run','restriction_enzymes_run'
      pp restriction_enzymes_run
    # ===================================================================== #
    # === show_jumper_directories
    # ===================================================================== #
    when 'jumper?','jumpers?','show_jumper_directories',
         'showjumperdirectories'
      show_jumper_directories
    # ===================================================================== #
    # === reset
    # ===================================================================== #
    when 'reset',
         'tabula rasa',
         'tabula_rasa',
         'tabula',
         'clear_aa',
         'cleara',
         'clearaa'
      erev 'Resetting the Bioroebe::Shell now.'
      reset_to_the_initial_state
    # ===================================================================== #
    # === set_highlight_colour
    # ===================================================================== #
    when /^set_?highlight_?colour/,'seek'
      _ = f
      _ = _.to_sym if _
      set_highlight_colour_or_search_for_this_sequence(_)
    # ===================================================================== #
    # === to_DNA
    # ===================================================================== #
    when /^to(_|-| )?DNA/i
      e Bioroebe.to_dna('ACCACACCAUUUCCCAUGGGUGUGUGG') # => "ACCACACCATTTCCCATGGGTGTGTGG"
    # ===================================================================== #
    # === files?
    # ===================================================================== #
    when 'files?',
         'file?',
         'files',
         'feedback_where_files_are_kept_locally',
         'feedbackwherefilesarekeptlocally'
      feedback_where_files_are_kept_locally
    # ===================================================================== #
    # === buffer?
    # ===================================================================== #
    when 'buffer?','b?','show_xorg_buffer2',
         'feedback_whether_we_will_also_set_the_xorg_buffer'
      feedback_whether_we_will_also_set_the_xorg_buffer
      show_xorg_buffer
    # ===================================================================== #
    # === toggle
    # ===================================================================== #
    when 'toggle'
      toggle_xorg_buffer
      buffer?
    # ===================================================================== #
    # === average?
    # ===================================================================== #
    when 'average?',
         'average','avg?',
         'show_average',
         'molecular_weight?','mw', # Perhaps we will move the last entry here.
         /show(_|-)?average(_|-)?weight(_|-)?of(_|-)?a(_|-)?nucleotide$/
      show_average_weight_of_an_aminoacid
      show_average_weight_of_a_nucleotide
    # ===================================================================== #
    # === test
    # ===================================================================== #
    when /test/
      e 'THIS IS A TEST.'
    # ===================================================================== #
    # === sigma?
    # ===================================================================== #
    when 'sigma_tutorial',
         'sigma?',
         'sigmatutorial',
         'sig?',
         'stutorial'
      show_sigma_tutorial
    # ===================================================================== #
    # === stop?
    # ===================================================================== #
    when /^stop\??$/i,
         'BLA',
         'end?'
      if dna_sequence?.empty?
        e 'Please first assign a sequence.'
      else
        e
        report_main_sequence(:stop_codon)
        e
      end
    # ===================================================================== #
    # === mode?
    # ===================================================================== #
    when 'mode?',
         /^report(_|-)?mode$/i
      report_mode
    # ===================================================================== #
    # === todo?
    # ===================================================================== #
    when 'todo?'
      _ = 'https://www.biostars.org/'
      show_todo_file
      erev 'Also consider visiting: '
      e
      erev "  #{_}"
      e
      set_xclip _
    # ===================================================================== #
    # === numbered?
    # ===================================================================== #
    when /^numbered\??/,
         /^with(_|-)?numbers$/i,
         /^show(_|-)?numbered(_|-)?nucleotide(_|-)?positions$/i
      show_numbered_nucleotide_positions
    # ===================================================================== #
    # === padding?
    # ===================================================================== #
    when 'padding?'
      pp padding?
    # ===================================================================== #
    # === Handle +3 and similar instructions
    # ===================================================================== #
    when /^\+(\d+)/ # See http://rubular.com/r/JaeO91V1vt
      add_n_nucleotides($1)
    # ===================================================================== #
    # === highlight
    # ===================================================================== #
    when /^highlight/,'high' # ← This variant is always verbose.
      set_highlight_colour(f, :be_verbose)
    # ===================================================================== #
    # === show_all_codon_tables
    # ===================================================================== #
    when 'show_all_codon_tables',
         'all_codon_tables',
         'atables',
         'alltable?',
         'showallcodontables',
         'codons?',
         'codontables',
         'codontables?',
         'show3',
         'showtables',
         'show_codon_tables'
      show_all_codon_tables
    # ===================================================================== #
    # === seq3?
    # ===================================================================== #
    when 'seq3?','s3?'
      show_seq_3
    # ===================================================================== #
    # === seq4?
    # ===================================================================== #
    when 'seq4?','s4?'
      show_seq_4
    # ===================================================================== #
    # === seq5?
    # ===================================================================== #
    when 'seq5?','s5?'
      show_seq_5
    # ===================================================================== #
    # === seq6?
    # ===================================================================== #
    when 'seq6?','s6?'
      show_seq_6
    # ===================================================================== #
    # === do_analyze_protein_sequence
    # ===================================================================== #
    when 'do_analyze_protein_sequence','do_analyze_sequence',
         'doanalyzesequence','analyze_sequence','analyzesequence'
      do_analyze_sequence
    # ===================================================================== #
    # === glycolysis?
    # ===================================================================== #
    when 'glycolysis?',
         'glykolyse?',
         'glykolyse',
         'glycolysis',
         'glykolysis',
         'display_glycolysis_pathway',
         'glyk?',
         'glyc?'
      display_glycolysis_pathway
    # ===================================================================== #
    # === result?
    # ===================================================================== #
    when 'result?'
      e @internal_hash[:result]
    # ===================================================================== #
    # === cysteines?
    #
    # This entry point will quickly show all cysteines in the given
    # aminoacid sequence. This is meant mostly as a visual aid to
    # the user on the commandline.
    # ===================================================================== #
    when /^-?-?cysteines\??$/i
      _ = aminoacid_sequence? # Get our aminoacid sequence first.
      erev _.to_s.gsub(/C/, gold('C')+rev)
    # ===================================================================== #
    # === Handle -3 and similar instructions
    # ===================================================================== #
    when /^\-(\d+)/
      remove_n_nucleotides($1)
    # ===================================================================== #
    # === pad
    # ===================================================================== #
    when 'pad'
      e pad?+f.to_s
    # ===================================================================== #
    # === ori?
    # ===================================================================== #
    when 'ori?',
         'show_ori_sequences',
         'showorisequences'
      show_ori_sequences
    # ===================================================================== #
    # === short_aa
    # ===================================================================== #
    when 'short_aa',
         'shortaa',
         'shorten_aa'
      dna_to_aminoacid_sequence(a?)
    # ===================================================================== #
    # === add_his_tag
    # ===================================================================== #
    when /add(_|-)?his(_|-)?tag/
      add_his_tag('add 6 random his tags') 
    # ===================================================================== #
    # === names? 
    # ===================================================================== #
    when 'names?'
      show_how_to_use_the_names_for_the_taxonomy_table
    # ===================================================================== #
    # === gem?
    # ===================================================================== #
    when 'gem?','rubygem?',
         /^bioroebe(_|-)?gem/
      remote_URL = 'https://rubygems.org/gems/bioroebe'
      e remote_URL
      open_in_browser(remote_URL) if is_on_roebe?
    # ===================================================================== #
    # === set_download_folder
    # ===================================================================== #
    when /^set(_|-)?download(_|-)?folder$/i,
         'set_download_directory',
         'setdownloaddirectory',
         'setdir'
      set_download_directory(f)
    # ===================================================================== #
    # === parse_taxonomy
    # ===================================================================== #
    when /^parse_?taxonomy/,
         'ptaxo',
         'ptax'
      ParseTaxonomy.new(a?)
    # ===================================================================== #
    # === bisulfite
    #
    # Apply a bisulfite-run against the current sequence at hand.
    #
    # Usage examples:
    #
    #   bisulfite CCCGCAATGCATACCTCGCCG
    #   bis CCCGCAATGCATACCTCGCCG
    #
    # ===================================================================== #
    when /^bisulfite$/,
         /^bis$/
      e format_this_nucleotide_sequence(
          bisulfite(a?)
        )
    # ===================================================================== #
    # === longest_substring?
    #
    # Usage example:
    #
    #   longest_substring? ATGGGAAT GGG
    #
    # ===================================================================== #
    when /^longest(_|-)?substring\??$/,
         /^LCS$/i,
         'McIlroy-Hunt algorithm'
      find_longest_substring_via_LCS(a?)
    # ===================================================================== #
    # === yaml_engine?
    # ===================================================================== #
    when /^yaml(_|-)?engine\??$/i,
         /^report(_|-)?which(_|-)?yaml(_|-)?engine(_|-)?is(_|-)?in(_|-)?use$/, # === report_which_yaml_engine_is_in_use
         /^syck\??$/i
      report_which_yaml_engine_is_in_use
    # ===================================================================== #
    # === ecoli
    # ===================================================================== #
    when /ecoli\??/
      erev '  https://ecocyc.org/'
    # ===================================================================== #
    # === selenocysteine
    # ===================================================================== #
    when /selenocysteine\??/
      erev 'UGA codes for selenocysteine.'
    # ===================================================================== #
    # === aa_analyze?
    # ===================================================================== #
    when 'aa_analyze?',
         'aa_analyze',
         'aminoacid_sequence?',
         /aminoacidsequence\??/,
         'aminoacid_analyze',
         'aminoacidanalyze',
         'protein_composition?',
         'asequence',
         'asequence?'
      show_protein_composition(aminoacid_sequence?)
      molecular_mass_of_amino_acids_in_this_sequence(aminoacid_sequence?)
    # ===================================================================== #
    # === find_TATA
    # ===================================================================== #
    when 'tata?','tata','TATA?',
         /^find(_|-)?TATA\??$/
      search_for_tata_consensus_sequence
    # ===================================================================== #
    # === restore_prompt
    # ===================================================================== #
    when /^restore(_|-)?prompt$/i,
         /^restore(_|-)?default(_|-)?prompt$/i
      restore_default_prompt
    # ===================================================================== #
    # === BASE_DIR
    # ===================================================================== #
    when /^BASE(_|-)?DIR$/i
      e sdir(Bioroebe.base_directory?)
    # ===================================================================== #
    # === histone_table?
    # ===================================================================== #
    when 'histone_table?','htable','show_histone_table','showhistonetable'
      show_histone_table
    # ===================================================================== #
    # === primer
    # ===================================================================== #
    when 'primer'
      primer(f)
    # ===================================================================== #
    # === GFF
    # ===================================================================== #
    when /^GFF\??$/i
      show_information_about_the_gff_format
    # ===================================================================== #
    # === frame1
    # ===================================================================== #
    when 'frame1',
         'f1',
         'f'
      showorf(dna_sequence?, :frame1)
    # ===================================================================== #
    # === open_in_browser
    #
    # Usage example:
    #
    #   oib https://www.uniprot.org/uniprot/P62897
    #
    # ===================================================================== #
    when /^open(_|-)?in(_|-)?browser$/i,
         'oib'
      open_in_browser(a?)
    # ===================================================================== #
    # === composition?
    #
    # This entry point will show the composition of the given DNA sequence
    # at hand.
    # ===================================================================== #
    when /^show(_|-)?composition$/,
         'composition?',
         'composition',
         'comp',
         'compo',
         'compo?',
         'comp?',
         'scompo'
      show_composition
    # ===================================================================== #
    # === load
    # ===================================================================== #
    when 'load',
         /^load(_|-)?from$/i,
         /^use$/i
      load(a?)
    # ===================================================================== #
    # === load_dna
    # ===================================================================== #
    when /^load(_|-)?dna$/i
      load_dna
    # ===================================================================== #
    # === transeq
    # ===================================================================== #
    when 'transeq','transseq','teq'
      i = a?
      i = dna_sequence? unless i
      if i.is_a?(Array) and i.empty?
        i = dna_sequence?
      end
      ::Bioroebe::DnaToAminoacidSequence.new(i) { :be_verbose } # bl dna/dna_to_aminoacid_sequence.rb
    # ===================================================================== #
    # === display_open_reading_frames
    #
    # Usage example:
    #
    #   display_open_reading_frames ATGAGCAAGGCCGACTACGAGAAG
    #
    # ===================================================================== #
    when /^display(_|-)?open(_|-)?reading(_|-)?frames$/i
      display_open_reading_frames(a?) { :show_three_frames }
    # ===================================================================== #
    # === ruler-no-colours
    # ===================================================================== #
    when /^-?-?ruler(_|-)?no(_|-)?colours?$/,
         'ruler2'
      show_sequence_with_a_ruler(first_argument?) { :without_colours }
    # ===================================================================== #
    # === reverse
    # ===================================================================== #
    when 'reverse',
         /^reverse(_|-)?sequence$/,
         'reverse_seq' # This will reverse the complement.
      show_reverse_dna_string
    # ===================================================================== #
    # === reverse!
    # ===================================================================== #
    when 'reverse!'
      set_dna_sequence(return_reverse_dna_string)
    # ===================================================================== #
    # === aasize
    # ===================================================================== #
    when 'aasize',
         'asize',
         'aasize?',
         'aa_size?',
         /^report(_|-)?aminoacid(_|-)?size$/i,
         'reportaasize'
      report_how_many_aminoacids_we_have
    # ===================================================================== #
    # === base_composition
    #
    # Use this like so:
    #
    #    base_composition 10 20 30 40
    #    base_composition 5 5 5 85
    #
    # ===================================================================== #
    when /base_composition/
      hash = {}
      hash[:A] = 0
      hash[:T] = 0
      hash[:C] = 0
      hash[:G] = 0
      hash[:A] = a?[0].to_i
      hash[:T] = a?[1].to_i
      hash[:C] = a?[2].to_i
      hash[:G] = a?[3].to_i
      display_this_sequence(
        Bioroebe.generate_random_dna_sequence(
          :default,
          hash
        )
      )
    # ===================================================================== #
    # === shuffle
    # ===================================================================== #
    when 'shuffle',
         'do_shuffle',
         /^shuffle(_|-)?main(_|-)?string$/i
      shuffle_main_string
    # ===================================================================== #
    # === allweights?
    # ===================================================================== #
    when 'allweights?',
         'allweight',
         'all_weight',
         'allweights',
         'gewicht'
      %w( A T C G U ).each {|entry|
        show_weight_of_this_nucleotide(entry)
      }
    # ===================================================================== #
    # === default
    # ===================================================================== #
    when 'default','def','d' # default action to use.
      i = 'shorten Lys Ser Pro Ser Leu Asn Ala Ala Lys'
      check_input_against_case_menu
    # ===================================================================== #
    # === upcase
    # ===================================================================== #
    when 'upcase',
         'ucase',
         'upcase_main_string',
         'upcasemainstring',
         'uppercase',
         'to_upper',
         'upcas'
      upcase_main_string
    # ===================================================================== #
    # === weight_of_common_proteins?
    #
    # This entry point allows us to show the weight of some common
    # problems, e. g. for easy commandline-display.
    # ===================================================================== #
    when /^weight(_|-)?of(_|-)?common(_|-)?proteins\??/,
         /^show(_|-)?the(_|-)?weight(_|-)?of(_|-)?some(_|-)?common(_|-)?proteins/,
         /^protein(_|-)?mass\??/,
         /^table(_|-)?weights$/i,
         /^weight(_|-)?table$/i,
         'molecular_weights?',
         'sizes?',
         'weights',
         'massweights',
         'molweights?',
         'masssize',
         'showweights',
         'proteins?'
      show_the_weight_of_some_common_proteins
    # ===================================================================== #
    # === protein_weight?
    # ===================================================================== #
    when /^protein(_|-)?weight\??/i,
         /^report(_|-)?the(_|-)?protein(_|-)?weight$/i
      report_the_protein_weight
    # ===================================================================== #
    # === show_weight_of_this_nucleotide
    # ===================================================================== #
    when 'show_weight_of_this_nucleotide',
         'molweight',
         'showweightofthisnucleotide'
      show_weight_of_this_nucleotide(f)
    # ===================================================================== #
    # === weights?
    # ===================================================================== #
    when 'weights?'
      MolecularWeightOfNucleotides.report_weight
    # ===================================================================== #
    # === controller
    #
    # This entry point will start the gtk-controller (some gtk-widgets).
    #
    # Invocation example:
    #
    #   bioroebe --gui
    #
    # ===================================================================== #
    when /^-?-?controller$/i,
         /^-?-?gui$/i,
         /^-?-?gtk(_|-| )?notebook$/i,   # === bioroebe --gtk-notebook
         /^-?-?gtk(_|-| )?controller$/i,
         /^-?-?notebook$/i
      start_gtk_controller
      # =================================================================== #
      # === download                                   (download tag, dl tag)
      #
      # Generic download-related entry point. This can be used like in
      # the following way:
      #
      #   download lambda
      #
      # =================================================================== #
      when /^download$/i
        download(a?)
      # =================================================================== #
      # === download?
      # =================================================================== #
      when 'download?',
           'show_last_downloaded_file',
           'showlastdownloadedfile'
        show_last_downloaded_file
      # =================================================================== #
      # === test
      # =================================================================== #
      when 'test' # Throwaway method for testing.
        # @bioroebe.lazy
        set_dna_sequence '
          ATGTCTGGGGACGCTCCCGATCGGCTCCCGTAACTTACACGGTCTACACAAGACGTGTGTGTATGTCGTCGGACCTTTTAGCTATGAGGCTCGAATGAAGCTACCGAGCCATATCTACGCAGCCTTTTATGGGAACATCAGCATATTTCAATCTACCGCCAGGATGTTGATCCCCGGATGTTAAGGGTTAACCAGTATGATGAACATGGAATTGTGAAGTTACTACGGTTCATTCACGGACGACGCCAAGTTACCATTCTTGCTAACTATCGTCCAGGGATTTTGATATGCATCTGCTCACCTCTGTAGCGGCCTCCCGGAGCTGTCACCACAATC
        '
        e sienna(dna_seq?)
        find_all_orfs
      # =================================================================== #
      # === tphages?
      # =================================================================== #
      when 't-phages?',
         'tphages?',
         /^show(_|-)?t(_|-)?phages$/,
         'tphages',
         'tt','phages?'
      show_t_phages
      # =================================================================== #
      # === raw_sequence?
      # =================================================================== #
      when /^-?-?raw(_|-| )?sequence\??$/i,
           /^-?-?raw(_|-| )?conversion\??$/i
        e sfancy(leading_five_prime)+
          colourize_nucleotide_sequence(
            raw_sequence?, :make_no_modifications
          )+
          sfancy(trailing_three_prime)
    # ===================================================================== #
    # === perform_startup_actions
    # ===================================================================== #
    when /^perform(_|-)?startup(_|-)?actions$/,
         /^startup(_|-)?actions$/
      perform_startup_actions
    # ===================================================================== #
    # === to_fasta
    #
    # toasta is an alias to this entry point.
    # ===================================================================== #
    when /^to(_|-)?f?asta$/i
      to_fasta
    # ===================================================================== #
    # === cat
    # ===================================================================== #
    when 'cat',
         'show_the_content_of_this_file'
      cat(f) # Show the content of a file.
    # ===================================================================== #
    # === blosum?
    # ===================================================================== #
    when 'blosum?',
         'blosum',
         'blosu',
         'blos',
         'blo',
         'bl',
         'b',
         'show_blosum_matrix',
         'matrix',
         'losum'
      show_blosum_matrix
    # ===================================================================== #
    # === debug?
    # ===================================================================== #
    when 'debug?'
      feedback_whether_we_are_in_debug_mode
    # ===================================================================== #
    # === protein_stats?
    # ===================================================================== #
    when 'protein_stats?',
         'protein_stats',
         'pstats?',
         'pstats'
      protein_stats
    # ===================================================================== #
    # === digest
    # ===================================================================== #
    when 'digest',
         /^digest(_|-)?at$/i,
         /^cut(_|-)?with$/i,
         /^cut(_|-)?to$/i
      digest(a?)
    # ===================================================================== #
    # === amino_acids_frequency?
    # ===================================================================== #
    when /^amino(_|-)?acids(_|-)?frequency\??$/i,
         /^show(_|-)?the(_|-)?amino(_|-)?acids(_|-)?frequencies$/i,
         'aa_frequency?',
         'aafrequency?'
      show_the_aminoacids_frequencies
    # ===================================================================== #
    # === basedir?
    # ===================================================================== #
    when /basedir\??/,
         'dir?',
         'base_dir?',
         'log_dir',
         'log_dir?'
      show_config_dir
      show_save_file
      show_log_dir
    # ===================================================================== #
    # === show_log_dir
    # ===================================================================== #
    when /^show(_|-)?log(_|-)?dir$/,
         'logdir?',
         'logdir',
         'sdir?',
         'slog',
         'log?',
         /^-?-?location\??$/i,
         'localdir?'
      show_log_dir
    # ===================================================================== #
    # === set_log_dir
    #
    # This entry point can be used to set a specific log directory
    # from within a running instance of the bioshell.
    #
    # Invocation examples:
    #
    #   set_log_dir /tmp/test
    #   setlogdir /tmp/test
    #
    # ===================================================================== #
    when /^set(_|-)?log(_|-)?dir$/i
      set_log_dir(first_argument?) { :be_verbose }
    # ===================================================================== #
    # === chunked_display
    #
    # Usage example:
    #
    #   cdisplay ATGACAGGACACACTTTTAGCACACACATGACAGGACACACTTTTAGCACACACATGACAGGACACACTTTTAGCACACACATGACAGGACACACTTTTAGCACACACATGACAGGACACACTTTTAGCACACACATGACAGGACACACTTTTAGCACACAC
    #
    # ===================================================================== #
    when /^chunked(_|-)?display$/i,
         'properly_number','cdisplay',
         'chunked',
         'chunk',
         /^beautify(_|-)?body$/
      chunked_display(a?)
    # ===================================================================== #
    # === *
    # ===================================================================== #
    when '*'
      erev 'The occurrence of * in a amino acid sequence denotes a STOP codon.'
    # ===================================================================== #
    # == mmass
    #
    # Usage example:
    #
    #   molmass Glycine
    #
    # ===================================================================== #
    when 'mmasse',
         'molecular_mass_of',
         'molecularmassof',
         'mmase',
         'masse?',
         'molmasse',
         'molmass'
      molecular_mass_of(f)
    # ===================================================================== #
    # === showorf
    # ===================================================================== #
    when /^showorfs?$/,
         'showor',
         'show_orf',
         'show_the_orf'
      showorf(a?)
    # ===================================================================== #
    # === bioshell --permanently-disable-startup-intro
    # ===================================================================== #
    when /^-?-?permanently(_|-)?disable(_|-)?startup(_|-)?intro$/
      permanently_disable_startup_intro
    # ===================================================================== #
    # === startup_info?
    #
    # This entry point exists mostly as a debug-aid.
    # ===================================================================== #
    when /^-?-?startup(_|-)?info\??$/i,
         /^-?-?show(_|-)?startup(_|-)?information$/i,
         /^-?-?show(_|-)?intro$/i,
         /^-?-?sintro$/
      show_startup_information
    # ===================================================================== #
    # === downcase_main_string
    # ===================================================================== #
    when /^downcase(-|_| )?main(-|_| )?string$/,
         /^downcase$/i,
         'dcase',
         'down',
         'lower'
      downcase_main_string
    # ===================================================================== #
    # === silent-startups
    # ===================================================================== #
    when /^-?-?silent(-|_)?startup$/,
         /^-?-?silent$/
      do_a_silent_startup
    # ===================================================================== #
    # === seqsize?
    # ===================================================================== #
    when 'seqsize?'
      e sequence?.to_s.size
    # ===================================================================== #
    # === alu?
    # ===================================================================== #
    when 'alu?',
         'show_alu_sequence',
         'alu_sequence?'
      show_alu_sequence
    # ===================================================================== #
    # === positions?
    # ===================================================================== #
    when 'positions?','positions',
         'show_positions','showpositions',
         'show_position_of_sequence','showpositionofsequence',
         'pos?'
      show_position_of_sequence
    # ===================================================================== #
    # === codon_usage_analyzer
    # ===================================================================== #
    when /^codon_?usage_?analyzer/
      ShowCodonUsage.new(dna_string?)
    # ===================================================================== #
    # === return_all_genes
    # ===================================================================== #
    when 'return_all_genes',
         'returnallgenes'
      return_all_genes
    # ===================================================================== #
    # === install
    # ===================================================================== #
    when 'install'
      install(f)
    # ===================================================================== #
    # === enable
    # ===================================================================== #
    when 'enable',
         'use'
      enable(a?)
    # ===================================================================== #
    # === do_use_expand_cd_aliases
    # ===================================================================== #
    when 'do_use_expand_cd_aliases',
         'douseexpandcdaliases',
         'cdaliases',
         /use(_|-)?expanded(_|-)?aliases$/i # === use_expanded_aliases
      enable :cd_aliases
    # ===================================================================== #
    # === do_not_use_expand_cd_aliases
    # ===================================================================== #
    when 'do_not_use_expand_cd_aliases',
         'no_expand_cd_aliases',
         'no_cd_aliases'
      disable :cd_aliases
    # ===================================================================== #
    # === use_expand_cd_aliases?
    # ===================================================================== #
    when /^use(_|-)?expand(_|-)?cd(_|-)?aliases\??$/i,
         '@use_expand_cd_aliases',
         /^report(_|-)?whether(_|-)?we(_|-)?will(_|-)?make(_|-)?use(_|-)?of(_|-)?expand(_|-)?cd(_|-)?aliases$/i
      report_whether_we_will_make_use_of_expand_cd_aliases
    # ===================================================================== #
    # === pir
    # ===================================================================== #
    when 'pir?',
         'pir'
      e "  #{Bioroebe.try_to_pass_through_beautiful_url('pir').first}"
    # ===================================================================== #
    # === chromosome_table
    # ===================================================================== #
    when /^chromosome(_|-)?table$/i,
         /^show(_|-)?chromosome(_|-)?table$/i
      show_chromosome_table
    # ===================================================================== #
    # === findgene?
    # ===================================================================== #
    when 'findgene?',
         'notify_the_user_as_to_how_findgene_works'
      notify_the_user_as_to_how_findgene_works
    # ===================================================================== #
    # === calculate_exponential_growth
    #
    # Invocation example:
    #
    #   calculate_exponential_growth 1, 10
    #
    # ===================================================================== #
    when /calculate(_|-)?exponential(_|-)?growth$/
      calculate_exponential_growth(first_argument, second_argument)
    # ===================================================================== #
    # === test_help
    # ===================================================================== #
    when 'test_help','testhelp','new_help','newhelp','1'
      ::Bioroebe::Shell::Help[]
    # ===================================================================== #
    # === fasta1
    #
    # This entry point allows us to quickly refer to different
    # FASTA entries from a file, such as:
    #
    #   fasta5 # refers to the 5th entry
    #   fasta6 # refers to the 6th entry
    #   ^^^ and so forth
    #
    # ===================================================================== #
    when /^fasta(\d{1,10})$/i
      try_to_display_this_fasta_entry($1.to_s.dup) { :and_assign_it_as_well }
    # ===================================================================== #
    # === will_we_truncate?
    # ===================================================================== #
    when 'truncate?',
         'will_we_truncate?'
      will_we_truncate?
    # ===================================================================== #
    # === When it starts with one or more numbers, including a ' '.
    #     Example: 100 aa
    # ===================================================================== #
    when /^\d+ aa/ # See: http://rubular.com/r/Lnf2b9RTGP
      case f
      when 'aa'
        create_n_random_amino_acids(_)
      end
    # ===================================================================== #
    # === append_aminoacid
    # ===================================================================== #
    when 'append_aminoacid',
         'add_aa',
         'addaa',
         'append_aa' # Append to aa.
      @internal_hash[:aminoacids] << a
    # ===================================================================== #
    # === find_nls
    # ===================================================================== #
    when 'find_nls',
         'nls',
         'nls_finder',
         'nlsfinder',
         'run_nls_search'
      run_nls_search
    # ===================================================================== #
    # === GFP?
    # ===================================================================== #
    when 'GFP?',
         /^show_?GFP_?sequence$/i,
         /^gfp\??/
      erev "The #{rosybrown('GFP sequence')}#{rev} is:#{N}#{N}"
      show_GFP_sequence
      e
      erev 'Note: If you wish to assign this as the new main nucleotide'
      erev 'sequence, then use this command:'
      e
      erev '  '+sfancy('  assign :GFP')
      e
    # ===================================================================== #
    # === colourize_fasta
    # ===================================================================== #
    when 'colourize_fasta',
         'colourizefasta',
         'colourize_fasta_file',
         'colourizefastafile'
      colourize_fasta_file(a?)
    # ===================================================================== #
    # === urls?
    # ===================================================================== #
    when 'urls?',
         'url?'
      e 'Showing some URLs next:'
      e
      erev '  ftp://ftp.ncbi.nih.gov/genbank/'
      erev '  https://rosalind.info/problems/list-view/'
      erev '  https://biotools.umassmed.edu/bioapps/primer3_www.cgi # Primerdesign'
      e
      pdb_url? # And also show the PDB Url.
    # ===================================================================== #
    # === loxp?
    # ===================================================================== #
    when 'loxp?',
         'loxp'
      erev 'Next showing the loxP sequence:'
      _ = 'ATAACTTCGTATA'
      e
      e sfancy(_)
      e
      find_this_sequence(_) unless dna_sequence?.empty?
    # ===================================================================== #
    # === blast
    # ===================================================================== #
    when 'blast'
      open_blast_webpage
    # ===================================================================== #
    # === telomer?
    # ===================================================================== #
    when 'telomer?',
         'telomere?'
      e padding?+leading_five_prime+'TTAGGG'+trailing_three_prime
    # ===================================================================== #
    # === save_my_file
    # ===================================================================== #
    when /^save(_|-)?my(_|-)?file$/,
         'save'
      save_my_file { :be_verbose }
    # ===================================================================== #
    # === rev?
    # ===================================================================== #
    when 'rev?'
      e 'Testing rev next, the ability to revert to the default colour.'
      pp ::Bioroebe.rev
      if ::Bioroebe.rev.empty?
        e 'Not using any special colours presently.'
      else
        e 'Using special colours.'
      end
      e "Red then revert, if colours are enabled: "\
        "#{swarn('Red then')}#{rev} revert."
    # ===================================================================== #
    # === available_colours?
    # ===================================================================== #
    when /^available_?colours\??/,
         /^show_?html_?colours/,
         'highlight?'
      show_html_colours
    # ===================================================================== #
    # === seq_with_tab?
    # ===================================================================== #
    when /seq_?with_?tab\??/,
         'splitted',
         'splitter'
      show_string { :with_colourized_separator }
    # ===================================================================== #
    # === barrier
    # ===================================================================== #
    when 'barrier','vertical','verti',
         /^add(_|-)?vertical(_|-)?barrier(_|-)?to(_|-)?sequence$/
      add_vertical_barrier_to_sequence(a?)
    # ===================================================================== #
    # === seq5
    # ===================================================================== #
    when /seq5/
      @internal_hash[:array_sequences[4]] = only_valid_dna_nucleotides(a?)
    # ===================================================================== #
    # === pdf_tutorial
    # ===================================================================== #
    when 'generate_pdf_tutorial',
         'generatepdftutorial',
         'generate_pdf_documentation',
         'gpdf',
         'pdf_tutorial',
         'create_pdf'
      erev 'Next creating a .pdf file that includes the Tutorial.'
      generate_pdf_tutorial
    # ===================================================================== #
    # === GenbankFlatFileFormatGenerator
    # ===================================================================== #
    when /^Genbank_?Flat_?File_?Format_?Generator/i
      if File.exist? f
        object = GenbankFlatFileFormatGenerator.new(f)
        pp object
      else
        no_file_exists_at(f)
      end
    # ===================================================================== #
    # === bla
    # ===================================================================== #
    when 'bla' # This is just a test.
      e Bioroebe.store_here?
      e Bioroebe.log_dir
    # ===================================================================== #
    # === debug_seq?
    # ===================================================================== #
    when 'debug_seq?'
      pp string? # Show in a "debug" variant.
    # ===================================================================== #
    # === lernen
    # ===================================================================== #
    when 'lernen'
      _ = 'https://www.biostars.org/'
      e 'Now opening '+_
      open_in_browser(_)
    # ===================================================================== #
    # === peroxisome_pts1
    # ===================================================================== #
    when 'peroxisome_pts1'
      erev '-Ser-Lys-Leu-COOH'
    # ===================================================================== #
    # === atp_cost?
    #
    # Usage example:
    #
    #   atp_cost? 2
    #
    # ===================================================================== #
    when 'atp_cost?',
         'atpcost?',
         'atpcost',
         'atp?'
      calculate_atp_cost_for(a?)
    # ===================================================================== #
    # === vectors?
    # ===================================================================== #
    when /^-?-?vectors\??/,
         /^-?-?show_?available_?vectors?/,
         /^-?-?show_?vector/
      show_available_vectors # show_available_vectors
    # ===================================================================== #
    # === seq3
    # ===================================================================== #
    when /seq3/
      @internal_hash[:array_sequences[2]] = only_valid_dna_nucleotides(a?)
    # ===================================================================== #
    # === seq4
    # ===================================================================== #
    when /seq4/
      @internal_hash[:array_sequences[3]] = only_valid_dna_nucleotides(a?)
    # ===================================================================== #
    # === agarose_table
    # ===================================================================== #
    when /agarose_?table/,
         /show_?agarose_?table/,
         /show_?agarose_?concentration/,
         'agarose'
      show_agarose_table
    # ===================================================================== #
    # === gene_name
    # ===================================================================== #
    when /gene_?name/,
         /set_?name_?of_?gene/,
         'gename',
         'set_name',
         'setname',
         'genename?',
         'setgene',
         'setgen',
         /name_?of_?gene/
      set_name_of_gene(a?)
    # ===================================================================== #
    # === codon_headers
    # ===================================================================== #
    when /codon(_|-)?headers/i,
         'codon_tables_headers',
         'codontablesheaders',
         'headercodon',
         'ctables',
         /^show(_|-)?all(_|-)?codon(_|-)?tables$/i
      show_all_codon_tables(:headers)
    # ===================================================================== #
    # === save?
    # ===================================================================== #
    when 'save?',
         /show_?save_?file/
      show_save_file
    # ===================================================================== #
    # === human_genome_version?
    #
    # Simply show the current human genome version.
    # ===================================================================== #
    when /human(_|-)?genome(_|-)?version\??/,
         /show(_|-)?human(_|-)?genome(_|-)?version$/i
      show_human_genome_version
    # ===================================================================== #
    # === show_aminoacids_residues
    # ===================================================================== #
    when /^show(_|-)?aminoacids(_|-)?residues$/i
      show_aminoacids_residues
    # ===================================================================== #
    # === save_here
    # ===================================================================== #
    when 'save_here',
         'savehere',
         /report(_|-| )?where(_|-| )?we(_|-| )?store$/i
      set_save_file(:default)
      report_where_we_store
    # ===================================================================== #
    # === show_codon_usage
    #
    # This entry point allows the user to analyse the codon usage of
    # the given argument.
    # ===================================================================== #
    when /codon(_|-| )?usage$/i,
         /show(_|-| )?codon(_|-| )?usage$/i,
         'cusage',
         'codo',
         'susage',
         /^-?-?codonusage\??$/i
      show_codon_usage(all_arguments?)
    # ===================================================================== #
    # === quit
    #
    # This entry point will honour all valid ways to exit,
    # store in the constant VALID_WAYS_TO_EXIT.
    # ===================================================================== #
    when *VALID_WAYS_TO_EXIT # bl $BIOROEBE/constants/constants.rb
      do_quit # Quit tag.
    else # else tag
      i = i.first if i.is_a? Array
      return if i.nil?
      # =================================================================== #
      # === First check whether we have a global environment variable.
      #
      # If so then this will be converted.
      # =================================================================== #
      i = convert_global_env(i) if i.to_s.include? '$'
      # =================================================================== #
      # === Handle ExpandCdAliases next
      #
      # Next, check whether we can use the cd-aliases.
      # =================================================================== #
      if use_expand_cd_aliases? and is_this_a_cd_alias?(i)
        target = ::Rcfiles::DirectoryAliases[i]
        cd(target)
      # =================================================================== #
      # === Handle existing local .pdb files next
      #
      # Since as of July 2022 this will also consider downloading
      # a remote .pdb file, if no such file exists yet - not in
      # this clause, but in the very next clause.
      # =================================================================== #
      elsif i and i.end_with?('.pdb') and File.exist?(i)
        parse_pdb_file(i)
      # =================================================================== #
      # === Download missing .pdb files here
      #
      # This must be closely kept in sync with the entry clause above.
      #
      # Usage example:
      #
      #   1hzh.pdb
      #
      # =================================================================== #
      elsif i.end_with?('.pdb') and !File.exist?(i.downcase)
        i = i.downcase
        unless File.exist?(::Bioroebe.pdb_directory?+File.basename(i))
          _result = download_this_pdb_file(i)
        else
          e 'The file already exists at `'+
             sfile(::Bioroebe.pdb_directory?+File.basename(i))+'`.'
        end
      # =================================================================== #
      # === Handle sequence assignments
      #
      # This entry clause is entered if the input consists of only valid
      # DNA nucleotides. Since as of December 2021 we will ignore
      # newlines that are part of the input sequence.
      #
      # Example to enter this clause:
      #
      #   ATGAGCAAGGCCGACTACGAGAAG
      #
      # =================================================================== #
      elsif only_valid_dna_nucleotides?(i.delete('-'))
        set_dna_sequence(i.delete('-'), :be_verbose) { :show_the_sequence_as_well }
      # =================================================================== #
      # === Handle downcased sequence assignments as well
      # =================================================================== #
      elsif only_valid_dna_nucleotides?(i.upcase.delete('-'))
        set_dna_sequence(i.upcase.delete('-'), :be_verbose)
      # =================================================================== #
      # === Handle input such as "227 / 3"
      # =================================================================== #
      elsif i.include?('/') and (i =~ /\d+/)
        result = eval(i)
        e result
      # =================================================================== #
      # === Intercept 3' input given to us.
      # =================================================================== #
      elsif original_input.to_s.strip.start_with?("3'-") # 3'-ATGCCTGCC
        find_complementary_strand(original_input)
      # =================================================================== #
      # === Handle WWW entries by opening them in the browser     (www tag)
      #
      # This includes "https" evidently as well.
      # =================================================================== #
      elsif i.start_with?('http')
        open_in_browser(i)
      # =================================================================== #
      # === Check for Aminoacids
      #
      # Check whether the input could be an Aminoacid such as Glycine.
      # =================================================================== #
      elsif could_this_be_an_amino_acid?(i)
        report_everything_about_this_amino_acid(i)
      # =================================================================== #
      # === Check for numbers as input only
      # =================================================================== #
      elsif (i =~ /^\d+$/) and (not main_sequence?.empty?)
        # ================================================================= #
        # Ok, the user did input only numbers. Display these numbers,
        # assumed to refer to the main sequence.
        # ================================================================= #
        _ = main_sequence?
        end_point = i.to_s.to_i - 1
        _ = _[0, end_point] # Must deduct one because we start nucleotide counting at nucleotide 1.
        erev properly_padded_dna_string(_)
      # =================================================================== #
      # === Handle remote fasta files and so forth
      # =================================================================== #
      elsif i.start_with?('http') and
          ( i.end_with?('.fasta') or i.end_with?('.fa') )
        erev 'We have encountered a remote file (fasta). We '\
             'will download it now.'
        this_file = download(i) # Also return this file.
        parse_fasta_format(this_file)
      # =================================================================== #
      # === Handle input starting with @
      # =================================================================== #
      elsif i.start_with? '@'
        e self.instance_variable_get(i)
      # =================================================================== #
      # === Handle nucleotide sequences next
      # =================================================================== #
      elsif is_all_upcase?(i) and only_valid_nucleotides?(i) and !i.empty?
        assign_dna_sequence(i, :be_verbose)
      # =================================================================== #
      # === Handle NCBI links next
      # =================================================================== #
      elsif i.start_with?('http://www.ncbi.') or
            i.start_with?('https://www.ncbi.')
        erev 'Identified a NCBI link. Will assume that this is a '\
             'fasta sequence'
        erev 'and delegate into the method called download_fasta().'
        download_fasta(i)
      # =================================================================== #
      # === Handle fasta input here if the file exists locally (files)
      #
      # This subsection will test for input that is about locally
      # existing files.
      # =================================================================== #
      elsif File.exist?(i) and !File.directory?(i)
        extname = File.extname(i).delete('.')
        case extname
        # ================================================================= #
        # === ps
        # ================================================================= #
        when 'ps' # check for .ps file type
          esystem "gv #{i}"
        # ================================================================= #
        # === fasta
        # ================================================================= #
        when 'fasta','fa'
          parse_fasta_format(i)
        else
          string_to_run = i.to_s+' '+f.to_s
          esystem(string_to_run)
        end
      # =================================================================== #
      # === Handle restriction enzymes
      # =================================================================== #
      elsif i.end_with?('?') or i.include?('Restriction') # if last character is a '?' character.
        @internal_hash[:result] = try_to_find_this_restriction_enzyme(i)
      # =================================================================== #
      # === Handle codons
      # =================================================================== #
      elsif (i.size == 3) and is_this_a_valid_codon?(i)
        e Bioroebe.dna_to_aminoacid_sequence(i)
      # =================================================================== #
      # === Next handle matches against the full line
      #
      # The input is: cytochrome c
      #
      # =================================================================== #
      elsif (original_input =~ /^-?-?cytochrome(_|-| )?c$/i)
        path = download(:cytochrome_c_protein_sequence)
        if File.exist? path
          parse_this_fasta_sequence(path)
        end
      else
        # ================================================================= #
        # === Check whether a local file exists like that
        #
        # The following code will check whether a file exists with the
        # same name in the log-directory. If so then it will be assigned
        # as input-name. Since this may be problematic, we put it into
        # the "else" clause.
        # ================================================================= #
        unless File.exist? i
          if File.exist?(::Bioroebe.log_dir?+i) and 
             File.file?(::Bioroebe.log_dir?+i) # ← Ensure that it really is a file.
            handle_this_file(::Bioroebe.log_dir?+i)
          end
        end
        # =================================================================== #
        # === Handle the case when we did not find the command
        #
        # This here is the final step - if we could not find anything
        # to do with the given input, we will report this to the user.
        # After all, perhaps he made a typo.
        # =================================================================== #
        if report_if_we_did_not_find_the_command # ← FINAL CHECK HERE
          # ================================================================= #
          # Handle .fasta or .fa files in a special way.
          # ================================================================= #
          unless i.empty?
            if i.end_with?('.fasta','fa') and !File.exist?(i)
              # ============================================================= #
              # In this case, try to also find a file with that name in the
              # log-directory of BioRoebe. That way, a user can just
              # copy/paste any URL or local path, and BioRoebe will try to
              # find a file that matches to this input.
              # ============================================================= #
              possible_location = log_dir?+File.basename(i)
              if File.exist? possible_location
                erev 'The given input was not found. However had, the '\
                     'same file was found at:'
                e "  #{sfancy(possible_location)}"
                erev 'This file will be used next.'
                handle_this_fasta_file(possible_location)
                return
              end
            end
            report_this_input_was_not_found(original_input)
          end
        end
      end
    end
  end
end

#mirror_repeat(i = dna_sequence? ) ⇒ Object

#

mirror_repeat

#


6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
# File 'lib/bioroebe/shell/shell.rb', line 6732

def mirror_repeat(
    i = dna_sequence?
  )
  i = dna_sequence? if i.nil? # Use a proper default in this case.
  i = i.join(' ').strip if i.is_a? Array
  erev default_padding+
       five_prime+
       colourize_dna_sequence(
         ::Bioroebe.mirror_repeat_of(i, :use_separator_token)
       )+
       rev+
       three_trailer
end

#mode?Boolean

#

mode?

#

Returns:

  • (Boolean)


10860
10861
10862
# File 'lib/bioroebe/shell/shell.rb', line 10860

def mode?
  @internal_hash[:mode]
end

#molecular_mass_of(i = aminoacids?, , optional_round_here = nil) ⇒ Object

#

molecular_mass_of

Give out the molecular mass of an amino-acid.

We will use only the first input character, and upcase it.

You can also input an Array here, though.

Usage examples:

mmasse tyrosin
mmasse KKKRAAA
mmasse Glycine
#


6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
# File 'lib/bioroebe/shell/shell.rb', line 6465

def molecular_mass_of(
    i                   = aminoacids?,
    optional_round_here = nil
  )
  case i
  # ======================================================================= #
  # === HELP
  # ======================================================================= #
  when /^-?-?help$/i
    erev 'Input an amino acid, such as H.'
    return
  end if i.is_a? String
  i = aminoacids? if i.nil? # Safeguard.
  # ======================================================================= #
  # === Handle Arrays first
  # ======================================================================= #
  if i.is_a? Array
    i.uniq.each {|entry|
      molecular_mass_of(entry, optional_round_here)
    }
  elsif is_a_registered_compound?(i)
    original_name = i.dup
    # ===================================================================== #
    # This menu is a bit ad-hoc. In the long run we will probably have
    # to make this more generic.
    # ===================================================================== #
    case i
    # ===================================================================== #
    # === Glycine
    # ===================================================================== #
    when /^Glycine?$/i
      i = 'C8H9NO3'
    end
    i = ChemistryParadise.molmass_of?(i)
    erev 'The molecular mass of '+sfancy(original_name)+rev+
         ' is: '+simp(i.to_s.rjust(5))
  else # Else we assume a String here.
    # ===================================================================== #
    # Some input may be like "tyrosin". In this case, we will assume
    # that the user may have input 
    # ===================================================================== #
    if i.size > 1
      if i.size > 3
        _ = i.to_s.downcase
        if _.size > 3
          reversed = AMINO_ACIDS_ABBREVIATIONS.invert
          if reversed.has_key? _
            _ = reversed[_]
            if AMINO_ACIDS_THREE_TO_ONE.has_key? _
              _ = AMINO_ACIDS_THREE_TO_ONE[_]
            end
            molecular_mass_of(_, optional_round_here)
            return
          end
        end
      end
      # =================================================================== #
      # Here, either we grab the mass of each character, or we
      # try to find a single AA replacement.
      # =================================================================== #
      molecular_mass_of(i.chars, optional_round_here)
    else
      if AMINO_ACIDS_MASS_TABLE.has_key? i
        left = rev+'The molecular mass of '+sfancy(i)+rev+' ('+
               get_long_name_of_amino_acid(i)+rev+')'+rev+' is: '
        ljust_value = 72
        ljust_value = 92 if use_colours?
        left = left.ljust(ljust_value)
        result = AMINO_ACIDS_MASS_TABLE[i]
        if optional_round_here
          result = result.to_f.round(optional_round_here)
        end
        erev left+simp(result.to_s.rjust(5))
      else
        # e 'Please input a specific amino acid, such as "H".'
      end
    end
  end
end

#molecular_mass_of_amino_acids_in_the_sequence(i = aminoacid_sequence? ) ⇒ Object Also known as: molecular_mass_of_amino_acids_in_this_sequence

#

molecular_mass_of_amino_acids_in_the_sequence

This method will calculate the mass of all amino acids in the given sequence.

The default input sequence will be the aminoacid sequence.

#


8540
8541
8542
8543
8544
8545
8546
8547
8548
8549
8550
8551
8552
8553
8554
8555
8556
8557
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589
8590
8591
8592
8593
8594
8595
8596
8597
8598
# File 'lib/bioroebe/shell/shell.rb', line 8540

def molecular_mass_of_amino_acids_in_the_sequence(
    i = aminoacid_sequence?
  )
  total_mass = 0
  if i.is_a? Array # We require a String here really.
    if i.empty? # In this case, assign a default.
      i = aminoacid_sequence?
    else
      i = i.join
    end
  elsif i.nil?
    i = aminoacid_sequence?
  end
  # ======================================================================= #
  # The user may have inputted something such as 'lysine'. In this
  # case, we will convert this to the one-letter code.
  # ======================================================================= #
  if (i != ::Bioroebe.return_short_aminoacid_letter_from_long_aminoacid_name(i))
    i = ::Bioroebe.return_short_aminoacid_letter_from_long_aminoacid_name(i)
  end
  _ = i # Use a copy.
  unless _
    erev 'Please assign an aminoacid sequence.'
    return
  end
  dataset_molecular_formula = YAML.load_file(FILE_AMINOACIDS_MOLECULAR_FORMULA)
  chars =_.chars
  chars.each {|this_aminoacid|
    # ===================================================================== #
    # The following constant has the mass of the aminoacid at hand. It
    # is stored in the one-letter abbreviation.
    # ===================================================================== #
    value = AMINO_ACIDS_MASS_TABLE[this_aminoacid]
    total_mass += value.to_f
    molecular_formula = dataset_molecular_formula[one_letter_to_long_name(this_aminoacid).capitalize]
    erev 'The molecular formula for '+sfancy(this_aminoacid)+rev+
         ' is: '+lightgreen(molecular_formula)+rev
  }
  erev "The total mass (#{seagreen('molecular weight')}#{rev}) of "\
       "this sequence (#{_.size.to_s} entries), using "\
       "#{teal('mono-isotopic mass')}#{rev}, is: "
  if has_konsole?
    erev '  '+cadetblue(total_mass.to_s)
  else
    e "  #{simp(total_mass.to_s)}"
  end
  # ======================================================================= #
  # Next calculate the average mass.
  # ======================================================================= #
  total_mass = 0
  i.chars.each {|this_aminoacid|
    value = AMINO_ACIDS_AVERAGE_MASS_TABLE[this_aminoacid]
    total_mass += value.to_f
  }
  erev "The total mass (#{seagreen('molecular weight')}#{rev}) of "\
       "this sequence (#{_.size.to_s} entries), using "\
       "#{teal('average molecular mass')}#{rev}, is: "
  erev '  '+cadetblue(total_mass.to_s)
end

#move_file_to_its_correct_location(i) ⇒ Object

#

move_file_to_its_correct_location

#


5730
5731
5732
# File 'lib/bioroebe/shell/shell.rb', line 5730

def move_file_to_its_correct_location(i)
  ::Bioroebe::MoveFileToItsCorrectLocation.new(i)
end

#mutate_aminoacid_position(this_position = 1) ⇒ Object

#

mutate_aminoacid_position

This method will allow us to mutate the aminoacid sequence.

Full usage example:

random 24; show_aminoacid_sequence; mutate_aminoacid_position 1
#


10977
10978
10979
10980
10981
10982
10983
10984
10985
10986
10987
10988
10989
10990
10991
# File 'lib/bioroebe/shell/shell.rb', line 10977

def mutate_aminoacid_position(this_position = 1)
  if this_position.is_a? Array
    this_position = this_position.join.strip
  end
  this_position = this_position.to_i
  sequence = aa_sequence?
  new_aminoacid = return_random_aminoacid
  old_aminoacid = sequence[this_position-1, 1]
  erev 'We will mutate the aminoacid sequence at position '+
        simp(this_position.to_s)+rev+'. The old aminoacid '
  erev 'was '+simp(old_aminoacid)+rev+', the new aminoacid will '\
       'be '+simp(new_aminoacid)+rev+'.'
  sequence[this_position-1, 1] = new_aminoacid
  show_aminoacid_sequence
end

#mutate_dna_sequence(n_times = 1, old_sequence = dna_sequence? ) ⇒ Object

#

mutate_dna_sequence

Use this method to mutate a DNA nucleotide.

#


3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
# File 'lib/bioroebe/shell/shell.rb', line 3752

def mutate_dna_sequence(
    n_times      = 1,
    old_sequence = dna_sequence?
  )
  if n_times.is_a? Array
    n_times = n_times.join(' ').strip.to_i
  end
  n_times = n_times.to_i
  n_times.times {
    this_nucleotide_position = rand(old_sequence.size)+1
    do_mutate_dna_sequence_at_this_nucleotide_position(
      this_nucleotide_position, old_sequence
    )
    show_dna_sequence
  }
end

#mutate_position(nucleotide_position, mutate_to_this_nucleotide = return_random_nucleotide) ⇒ Object

#

mutate_position

This method can be used to mutate DNA at a specific position.

Usage example:

random 50; mutate_position 5 C
random 15; mutate_position 1
#


2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
# File 'lib/bioroebe/shell/shell.rb', line 2106

def mutate_position(
    nucleotide_position,
    mutate_to_this_nucleotide = return_random_nucleotide # Return randomly A, T, C or G here.
  )
  if nucleotide_position.is_a?(String) and nucleotide_position.strip.include?(' ')
    nucleotide_position = nucleotide_position.split(' ')
  end
  # ======================================================================= #
  # === Handle Arrays as input next
  # ======================================================================= #
  if nucleotide_position.is_a? Array # Assume that the user wanted to use things differently then.
    mutate_to_this_nucleotide = nucleotide_position[1]
    nucleotide_position       = nucleotide_position[0]
  end
  old_sequence = dna_sequence?
  do_mutate_dna_sequence_at_this_nucleotide_position(
    nucleotide_position,
    old_sequence,
    mutate_to_this_nucleotide
  )
  show_dna_sequence
end

#n_uracil?Boolean

#

n_uracil?

#

Returns:

  • (Boolean)


9694
9695
9696
# File 'lib/bioroebe/shell/shell.rb', line 9694

def n_uracil?
  erev sequence_object?.n_uracil?
end

#name_of_gene?Boolean

#

name_of_gene?

#

Returns:

  • (Boolean)


6411
6412
6413
# File 'lib/bioroebe/shell/shell.rb', line 6411

def name_of_gene?
  sequence_object?.name_of_gene?
end

#ncbi_nucleotide_search_for(i = '') ⇒ Object

#

ncbi_nucleotide_search_for

#


7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
# File 'lib/bioroebe/shell/shell.rb', line 7923

def ncbi_nucleotide_search_for(
    i = ''
  )
  i = '' if i.nil? # Reset to default then, in this case.
  i = i.join('+') if i.is_a? Array
  i.strip!
  _ = 'https://www.ncbi.nlm.nih.gov/'.dup
  _ << 'nucgss?term="'+i+'"' unless i.empty? # Use "" quotes to escape shell-code.
  erev 'Now opening '+simp(_)+rev
  open_in_browser _
end

#no_newlines(this_file) ⇒ Object

#

no_newlines

This will get rid of the newlines in a fasta file, at the least for displaying purposes.

#


9277
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
# File 'lib/bioroebe/shell/shell.rb', line 9277

def no_newlines(this_file)
  if this_file.is_a? Array
    this_file.each {|entry| no_newlines(entry) }
  else
    dataset = File.readlines(this_file)
    dataset.map! {|line|
      line.chomp! unless line.start_with? '>'
      line
    }
    e dataset.join
  end
end

#notify_the_user_as_to_how_findgene_worksObject

#

notify_the_user_as_to_how_findgene_works

#


11170
11171
11172
11173
11174
11175
11176
11177
# File 'lib/bioroebe/shell/shell.rb', line 11170

def notify_the_user_as_to_how_findgene_works
  begin
    _ = project_base_dir?+'find_gene.rb'
    ClassDocuShower[_]
  rescue LoadError
    erev 'Please install class_docu_shower for this functionality to work.'
  end
end

#nucleotide_sequence?Boolean Also known as: dna_sequence?, dna_string?, dna_seq?, string?, main_string?, seq?, sequence_1, seq1, seq1?

#

nucleotide_sequence? (string? tag)

Return the DNA sequence in question.

Several aliases exist to this method. It is recommended to use the more explicit name, since this will more accurately reflect the name (and intent) of this method.

#

Returns:

  • (Boolean)


862
863
864
865
# File 'lib/bioroebe/shell/shell.rb', line 862

def nucleotide_sequence?
  # @internal_hash[:nucleotide_sequence]
  @internal_hash[:array_dna_sequences].last
end

#nucleotides_or_aminoacids?Boolean

#

nucleotides_or_aminoacids?

#

Returns:

  • (Boolean)


2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
# File 'lib/bioroebe/shell/shell.rb', line 2532

def nucleotides_or_aminoacids?
  case mode?
  # ======================================================================= #
  # === :dna
  # ======================================================================= #
  when :dna,
       :rna
    'nucleotides'
  # ======================================================================= #
  # === :aminoacids
  # ======================================================================= #
  when :aminoacids
    'aminoacids'
  end
end

#obtain_current_promptObject

#

obtain_current_prompt

This is essentially a getter-method over the instance variable called @internal_hash.

#


5118
5119
5120
5121
5122
5123
# File 'lib/bioroebe/shell/shell.rb', line 5118

def obtain_current_prompt
  if @internal_hash[:use_working_directory_as_prompt]
    @internal_hash[:prompt_to_use] = return_pwd
  end
  @internal_hash[:prompt_to_use]
end

#obtain_current_prompt_while_honouring_coloursObject

#

obtain_current_prompt_while_honouring_colours

#


2473
2474
2475
2476
2477
2478
2479
# File 'lib/bioroebe/shell/shell.rb', line 2473

def obtain_current_prompt_while_honouring_colours
  _ = obtain_current_prompt
  if _ and use_colours?
    _ = "#{Colours::TEAL}#{_}#{rev}"
  end
  return _
end

#obtain_multiline_fastaObject

#

obtain_multiline_fasta

If we want to obtain multiline FASTA input, that is input that includes the “n” newline character, then we can use the following method here.

We will use $stdin to obtain the input. The end-delimiter will be _

#


4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
# File 'lib/bioroebe/shell/shell.rb', line 4466

def obtain_multiline_fasta
  delimiter = ::Bioroebe.delimiter?
  erev 'Input your Fasta format or nucleotide sequence next - '\
       'delimit/end via "'+lightgreen(delimiter)+rev+'" (3x the _ '\
       'character).'
  # ======================================================================= #
  # Chop away all newlines.
  # ======================================================================= #
  dataset = $stdin.gets(delimiter)
  # ======================================================================= #
  # Format the dataset a little.
  # ======================================================================= #
  dataset.chomp!
  dataset.delete!('_')
  dataset.delete!(N)
  dataset.strip!
  parse_fasta_format(dataset)
  # assign_sequence(dataset)
end

#obtain_url_for(i) ⇒ Object

#

obtain_url_for

#


8716
8717
8718
# File 'lib/bioroebe/shell/shell.rb', line 8716

def obtain_url_for(i)
  ::Bioroebe.try_to_pass_through_beautiful_url(i)
end

#obtain_user_inputObject Also known as: get_user_input, read_user_input

#

obtain_user_input (input tag)

This method should be used to fetch/read user input. The user input will be kept in an instance variable (called @internal_hash, where @internal_hash is, unsurprisingly, a Hash).

#


11769
11770
11771
11772
11773
11774
11775
11776
11777
11778
11779
11780
11781
11782
11783
11784
11785
11786
11787
11788
11789
11790
11791
11792
11793
11794
11795
11796
11797
11798
11799
11800
11801
11802
11803
11804
11805
11806
11807
11808
11809
11810
11811
11812
11813
11814
11815
11816
11817
11818
11819
11820
11821
11822
11823
11824
11825
11826
11827
11828
11829
# File 'lib/bioroebe/shell/shell.rb', line 11769

def obtain_user_input
  if readline_is_available?
    # ===================================================================== #
    # This clause is the case for the Readline module.
    # ===================================================================== #
    _ = Readline.readline(
      # =================================================================== #
      # The second argument enables or disables history support.
      # =================================================================== #
      obtain_current_prompt_while_honouring_colours.to_s, true
    )
    # ===================================================================== #
    # === Disallow empty lines to taint the Readline-History
    #
    # Ignore empty lines - or rather, remove them after they were input.
    # ===================================================================== #
    if _ =~ /^\s*$/
      Readline::HISTORY.pop
    # ===================================================================== #
    # If we did input the same command as before, on the previous
    # run, then we will not record this into the readline-history
    # session.
    # ===================================================================== #
    elsif last_inputted_command? == _
      Readline::HISTORY.pop
    end
  else
    # ===================================================================== #
    # This entry point reads in user-input without depending on Readline.
    # ===================================================================== #
    print obtain_current_prompt_while_honouring_colours
    _ = $stdin.gets.chomp
  end
  _.strip! # We do not need or want trailing or leading whitespace.
  unless _.strip.empty? # Ignore empty input given.
    # ===================================================================== #
    # First, let's get rid of input including '#' - these are assumed
    # to be comments and are simply ignored. So, for instance, the
    # input "foo # bar" would be truncated towards "foo" exactly.
    # ===================================================================== #
    if _.include?('#') and (_.size > 1)
      _ = _[0 .. (_.index('#')-1)]
      _.rstrip!
    end
    # ===================================================================== #
    # Next sanitize the situation where the user input consists of only
    # nucleotides, such as ATCG and so forth.
    # ===================================================================== #
    if _.include?(' ') and only_nucleotides?(_.delete(' '))
      _.delete!(' ') # We chop off ' ' tokens, if we only input a nucleotide sequence.
    end
    # ===================================================================== #
    # === Enable multiline input separated via ; next
    # ===================================================================== #
    if _.include? ';'
      _ = _.split(';')
    end
    set_user_input(_)
  end
  return _ # Not strictly necessary, but we return anyway.
end

#only_nucleotides?(i) ⇒ Boolean

#

only_nucleotides?

Just a wrapper over the corresponding module-method.

#

Returns:

  • (Boolean)


5198
5199
5200
# File 'lib/bioroebe/shell/shell.rb', line 5198

def only_nucleotides?(i)
  ::Bioroebe.only_nucleotides?(i)
end

#only_valid_nucleotides?(i) ⇒ Boolean Also known as: only_valid_dna_nucleotides?

#

only_valid_nucleotides?

This method will determine whether our input string (the argument in question) contains only valid nucleotides or whether it does not.

#

Returns:

  • (Boolean)


6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
# File 'lib/bioroebe/shell/shell.rb', line 6863

def only_valid_nucleotides?(i)
  i = i.first if i.is_a? Array
  if i.is_a? String
    i = i.delete("\n ").chars
  end
  uniq = i.uniq
  if uniq.all? {|entry| POSSIBLE_DNA_NUCLEOTIDES.include? entry }
    return true
  else
    return false
  end
end

#open_1igt_in_the_browserObject

#

open_1igt_in_the_browser

#


4287
4288
4289
4290
4291
# File 'lib/bioroebe/shell/shell.rb', line 4287

def open_1igt_in_the_browser
  _ = 'https://www.rcsb.org/structure/1igt'
  e; e _; e
  open_in_browser _
end

#open_blast_webpageObject

open_blast_webpage

#


2524
2525
2526
2527
# File 'lib/bioroebe/shell/shell.rb', line 2524

def open_blast_webpage
  open_in_browser_tab 'https://blast.ncbi.nlm.nih.gov/'\
                      'Blast.cgi?PROGRAM=blastn&PAGE_TYPE=BlastSearch&LINK_LOC=blasthome'
end

#open_expasy(i = all_arguments?) ) ⇒ Object

#

open_expasy

#


6295
6296
6297
6298
# File 'lib/bioroebe/shell/shell.rb', line 6295

def open_expasy(i = all_arguments?)
  _ = 'https://www.expasy.org/'
  open_in_browser(_)
end

#open_in_uniprot(i = 'A1XPA3') ⇒ Object

#

open_in_uniprot

This method will open the remote, associated URL with the protein at hand.

#


9778
9779
9780
9781
9782
9783
9784
9785
9786
# File 'lib/bioroebe/shell/shell.rb', line 9778

def open_in_uniprot(
    i = 'A1XPA3'
  )
  i = 'A1XPA3' if i.nil? # <- Ensure a default.
  _ = 'https://www.uniprot.org/uniprot/?query='+i+'&sort=score'
  erev _
  set_xclip(_) if configuration?.additionally_set_xorg_buffer
  open_in_browser(_)
end

#open_my_filesObject

#

open_my_files (open tag, files tag)

This opens some bioroebe-related files.

#


3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
# File 'lib/bioroebe/shell/shell.rb', line 3822

def open_my_files
  array_my_files = []
  array_my_files << BIOROEBE_AT_HOME+'shell/bioshell.rb'
  array_my_files << BIOROEBE_AT_HOME+'shell/help.rb'
  array_my_files << BIOROEBE_AT_HOME+'shell/menu.rb'
  array_my_files << BIOROEBE_AT_HOME+'bioroebe.rb'
  array_my_files << BIOROEBE_AT_HOME+'constants/constants.rb'
  array_my_files << RUBY_SRC+'/bioroebe/doc/todo/todo.md'
  # array_my_files << BIOROEBE+'/count_amount_of_nucleotides.rb'
  array_my_files.each {|file| open_this_file_in_editor(file) }
end

#open_this_file_in_editor(file) ⇒ Object

#

open_this_file_in_editor (editor tag)

#


5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
# File 'lib/bioroebe/shell/shell.rb', line 5052

def open_this_file_in_editor(file)
  case file
  when :bioshell, :shell
    file = HOME_DIR+'shell.rb'
  end
  _ = MAIN_EDITOR+' '+file
  if File.exist? file
    splitted = _.split(' ')
    splitted[1][0,0] = sfile
    erev splitted.join(' ')+main_colour
    system _
  else
    erev 'The file `'+sfile(file)+rev+'` does not exist.'
  end
end

#open_this_ncbi_page(i) ⇒ Object

#

open_this_ncbi_page

This method will help us open the proper NCBI pages.

#


6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
# File 'lib/bioroebe/shell/shell.rb', line 6550

def open_this_ncbi_page(i)
  search_term = i
  search_term = '' if search_term.nil?
  search_term = search_term.join(' ').strip.to_s if search_term.is_a? Array
  if search_term =~ /^\d+$/ # If only numbers.
    _ = '"https://www.ncbi.nlm.nih.gov/gene/'+search_term.to_s+'"'
  else
    _ = '"https://www.ncbi.nlm.nih.gov/gquery/?term='+search_term+'"'
  end
  erev _
  open_in_browser_tab(_)
end

#original_input?Boolean Also known as: original_input

#

original_input?

#

Returns:

  • (Boolean)


11534
11535
11536
# File 'lib/bioroebe/shell/shell.rb', line 11534

def original_input?
  @internal_hash[:original_input]
end

#padding?Boolean Also known as: pad, pad?, lpad?, left_pad?, left_padding?, default_padding

#

padding? (padding tag)

The alias lpad? used to be ‘ ’, but is now simply an alias to this method.

#

Returns:

  • (Boolean)


3960
3961
3962
# File 'lib/bioroebe/shell/shell.rb', line 3960

def padding?
  @internal_hash[:padding]
end

#parse(i) ⇒ Object

#

parse (parse tag)

#


8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
# File 'lib/bioroebe/shell/shell.rb', line 8013

def parse(i)
  if i.is_a? Array
    i = i.join(' ').strip
  end
  i = i.dup if i.frozen?
  i.chop! if i.end_with?('.')
  # ======================================================================= #
  # We will parse here based on the file-suffix.
  # ======================================================================= #
  case i
  # ======================================================================= #
  # === fasta file
  # ======================================================================= #
  when /\.fasta$/i,
       /\.fa$/i
    parse_fasta_format(i)
    unless array_fasta?.empty?
      # =================================================================== #
      # Assign this dataset next to become the new main sequence.
      # =================================================================== #
      opnerev "We will now assign this data to #{sfancy('@_')}#{rev}."
      set_mode :protein if array_fasta?.last.is_protein?
      assign(array_fasta?.last.sequence)
    end
  # ======================================================================= #
  # === pdb file
  # ======================================================================= #
  when /\.pdb$/i
    parse_this_pdb_file(i)
  else
    erev "Not yet handled: #{steelblue(i)}"
  end
end

#parse_fasta_format(i = nil) ⇒ Object Also known as: parse_this_fasta_file

#

parse_fasta_format

Parse FASTA format here. We will delegate into class Bioroebe::ParseFasta for that.

Usage example:

pfasta NM_001180897.3_Saccharomyces_cerevisiae_S288c_Aga2p_AGA2.fasta
#


4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
# File 'lib/bioroebe/shell/shell.rb', line 4383

def parse_fasta_format(
    i = nil
  )
  if i.is_a? Array
    i.each {|entry|
      parse_fasta_format(entry)
    }
  else
    # ===================================================================== #
    # === If input is only numbers.
    # ===================================================================== #
    i = Dir['*'][i.to_i + 1] if i =~ /^\d+$/ # <- Only numbers.
    case i
    # ===================================================================== #
    # === ASSIGN
    #
    # This entry point can be used by the user to input ad-hoc data
    # for a FASTA sequence.
    # ===================================================================== #
    when /^ASSIGN$/i
      opnerev 'Input your FASTA Data now (Use __ to terminate input):'
      i = $stdin.gets('__').chomp
    end
    # ===================================================================== #
    # If we did not provide an input, we scan for entries with .fa
    # in the current directory.
    # ===================================================================== #
    if i.nil?
      unless Dir['*.fa'].empty?
        i = Dir['*.fa']
      end
    end
    if i.is_a? Array
      i = i.first
    end
    if i
      erev "Now loading from `#{sfancy(i)}#{rev}`."
    end
    @internal_hash[:fasta_file] = i
    parse_fasta_object = ::Bioroebe.parse_fasta(i) # bl $RSRC/bioroebe/lib/bioroebe/fasta/parse_fasta.rb
    # ===================================================================== #
    # === We will store all created fasta objects in an Array
    # ===================================================================== #
    array_fasta? << parse_fasta_object
    this_sequence = parse_fasta_object.sequence?
    # ===================================================================== #
    # Handle large sequences next - we will add a timer. The purpose of
    # this timer is to notify the user how long it took to assign to
    # the main string. At a later point, we can optimize the speed and
    # do the assignment in pure C rather than ruby.
    # ===================================================================== #
    if this_sequence.size > 1_000_000
      add_timer_snapshot
      erev 'The sequence is fairly large - we will time how long it takes to'
      erev 'assign it to the main sequence.'
    end
    # ===================================================================== #
    # Obtain the type next:
    # ===================================================================== #
    type = parse_fasta_object.type?
    unless type == :protein
      set_dna_sequence(this_sequence)
      if this_sequence.size > 1_000_000
        add_timer_snapshot
        n_seconds_difference = calculate_time_difference.abs.to_f.round(3).to_s
        erev "Loading these #{springgreen(this_sequence.size.to_s)}"\
             "#{rev}"\
             " nucleotides "\
             "took #{sfancy(n_seconds_difference)}#{rev} seconds."
      end
    end
  end
end

#parse_this_fasta_sequence(i) ⇒ Object

#

parse_this_fasta_sequence

#


3650
3651
3652
3653
3654
# File 'lib/bioroebe/shell/shell.rb', line 3650

def parse_this_fasta_sequence(i)
  if i and File.file?(i)
    set_aminoacid(File.read(i).delete("\n"))
  end
end

#parse_this_gff_file(i) ⇒ Object

#

parse_this_gff_file

Use this method if you wish to parse a .gff or .gff3 file.

#


7117
7118
7119
7120
7121
7122
7123
# File 'lib/bioroebe/shell/shell.rb', line 7117

def parse_this_gff_file(i)
  if i.is_a? Array
    i.each {|entry| parse_this_gff_file(entry) }
  else
    ::Bioroebe::Parser::GFF.new(i)
  end
end

#parse_this_pdb_file(i) ⇒ Object

#

parse_this_pdb_file

#


5738
5739
5740
# File 'lib/bioroebe/shell/shell.rb', line 5738

def parse_this_pdb_file(i)
  ParsePdbFile.new(i)
end

#parse_this_user_input(i) ⇒ Object

#

parse_this_user_input

This method will always reset the user-input specific variables.

#


782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
# File 'lib/bioroebe/shell/shell.rb', line 782

def parse_this_user_input(i)
  reset_the_user_input_specific_variables
  # ======================================================================= #
  # Act on input that has at the least one ' ' character next.
  # ======================================================================= #
  if i.include? ' '
    splitted = i.split(' ')             
    @internal_hash[:command_to_be_passed_to_the_menu] = splitted[0]
    @internal_hash[:all_arguments]       = splitted[1 .. -1]
    @internal_hash[:first_argument]      = splitted[1]
    @internal_hash[:remaining_arguments] = splitted[2 .. -1] # Unsure if this is correct. 
  else
    @internal_hash[:command_to_be_passed_to_the_menu] = i
  end
end

#perform_a_pubmed_search(i) ⇒ Object

#
#


1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
# File 'lib/bioroebe/shell/shell.rb', line 1601

def perform_a_pubmed_search(i)
  if i.is_a? Array
    i = i.first
  end
  search_term = i.dup.delete('=')
  url = 'https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=pubmed&term='+
        search_term
  dataset = open(url).read
  # =================================================================== #
  # Grab the IDs next - this functionality is very unfinished as of
  # right now (December 2018):
  # =================================================================== #
  id_matches = dataset.scan(/<Id>\d+<\/Id>/)
  unless id_matches.empty?
    e
    erev 'The following '+sfancy(id_matches.size.to_s)+
         rev+' IDs were found:'
    e
    id_matches.each {|entry|
      erev '  '+sfancy(entry.delete('Id</>'))+rev
    }
    e
  end
end

#perform_frameshift_action(i) ⇒ Object

#

perform_frameshift_action

This method attempts to perform a frameshift on our target sequence. We can give, as argument, 1,2,+3 etc. Note that the + character is optional - if omitted, we assume that it was passed.

#


1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
# File 'lib/bioroebe/shell/shell.rb', line 1952

def perform_frameshift_action(i)
  i = i.to_s
  if sequence?.empty?
    erev 'Please first "assign" a sequence before trying to'
    erev 'perform a frameshift on it.'
  else
    if i == 'all'
      erev 'We will perform all frameshift actions next.'
      perform_frameshift_action '+1'
      perform_frameshift_action '+2'
      perform_frameshift_action '+3'
    elsif i.to_i == 0
      report_syntax_help_for_frameshift_action
    else
      erev 'Performing a frameshift on our target sequence next.'
      erev 'The frameshift to perform will be '+simp(('+'+i).squeeze('+'))+'.'
      erev 'We will modify the main sequence directly.'
      sequence?[0, i.to_i] = ''
      show_main_string
    end
  end
end

#perform_startup_actionsObject

#

perform_startup_actions (startup tag)

Currently, the only startup-action we perform is to add to the statistics.yml file.

We must check whether we have proper permissions though.

#


1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
# File 'lib/bioroebe/shell/shell.rb', line 1176

def perform_startup_actions
  # ======================================================================= #
  # Initialize the default stop codons, if they are empty.
  # ======================================================================= #
  if ::Bioroebe.stop_codons?.empty?
    ::Bioroebe.initialize_default_stop_codons
  end
  # ======================================================================= #
  # The next line must come after we checked for the commandline arguments,
  # so that options such as --disable-colours are properly handled.
  # ======================================================================= #
  consider_assigning_the_default_dna_sequence_from_a_yaml_file
  # ======================================================================= #
  # === Handle statistics next
  # ======================================================================= #
  _ = Bioroebe.file_statistics? # Assign a shorter handle to it.
  _ = bioshell_log_dir?+File.basename(_)
  # ======================================================================= #
  # We must check here if we can write into the base directory.
  # ======================================================================= #
  base_directory = File.dirname(_)
  if File.writable?(base_directory)
    if File.exist? _ # If it exists, add one to it.
      what = YAML.load_file(_)
      what[:n_times] = what[:n_times]+1
      write_what_into(YAML.dump(what), _)
    else # else the file does not yet exist, so we create it.
      hash = { n_times: 1 }
      write_what_into(YAML.dump(hash), _)
      if may_we_show_the_startup_information?
        show_startup_information
      end
    end
  else
    e "Can not write into the directory `#{sdir(base_directory)}`."
  end
  ensure_that_the_bioshell_log_directory_exists
  consider_analysing_the_local_dataset_on_startup # Should come after the log-directory-exists check.
  check_for_local_vectors # Also check for local vectors, such as pBR322 datasets stored in fasta files.
  considering_changing_the_title_of_the_kde_konsole_tab
  if is_on_roebe?
    if dna_sequence?.nil? or
       dna_sequence?.empty?
      # =================================================================== #
      # On my home system, we use a sequence of 150 by default.
      # =================================================================== #
      set_dna_sequence(150, :be_quiet)
    end
  end
end

#permanently_disable_startup_introObject

#

permanently_disable_startup_intro

This method can be used to permanently disable the startup intro.

Invocation example:

bioshell --permanently-disable-startup-intro
#


6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
# File 'lib/bioroebe/shell/shell.rb', line 6263

def permanently_disable_startup_intro
  target_file = Bioroebe.project_base_dir?+
                'shell/configuration/may_we_show_the_startup_information.yml'
  what = 'false'
  write_what_into(what, target_file)
  erev 'Storing into the file '+sfile(target_file)+rev+'.'
  if is_on_roebe?
    target_file = RUBY_SRC+
                  'bioroebe/lib/bioroebe/shell/configuration/may_we_show_the_startup_information.yml'
    write_what_into(what, target_file)
    erev 'Storing into the file '+sfile(target_file)+rev+'.'
  end
end

#prepend(i) ⇒ Object

#

prepend

You can use this to simply prepend to the main string.

#


5805
5806
5807
# File 'lib/bioroebe/shell/shell.rb', line 5805

def prepend(i)
  sequence?.prepend(i)
end

#primer(i) ⇒ Object

#

primer?

#


3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
# File 'lib/bioroebe/shell/shell.rb', line 3779

def primer(i)
  i = i.to_s
  if i.empty?
    erev 'Please provide a number, which is the length of the Primer.'
  else
    erev 'We will design two primers, with a '\
         'length of '+i+rev+' each.'
    report_sequence
    _ = sequence?[0, i.to_i]
    reverse_sequence = sequence?.reverse[0, i.to_i]
    forward_primer = leading_three_prime+
                     rev+
                     sfancy(
                       complement(reverse_sequence.reverse)
                     )+rev+trailing_five_prime+
                     rev
    reverse_primer = leading_five_prime+
                     sfancy(
                       complement(_.reverse)
                     )+rev+trailing_three_prime+
                     rev
    erev 'Forward primer: '+forward_primer
    erev 'Reverse primer: '+reverse_primer
    e
    padding = ' ' * (sequence?.size.to_i - _.size)
    erev '  '+padding+forward_primer
    show_sequence # This is the main sequence.
    spacer = '|' * sequence?.size.to_i
    erev "       #{swarn(spacer)} #{rev}" 
    erev '  '+leading_three_prime+rev+
         sfancy(complement(sequence?))+rev+trailing_five_prime+rev
    erev '  '+leading_five_prime+rev+
         sfancy(_.to_s)+rev+
         trailing_three_prime+rev
    e
  end
end
#

print_aa_table

Use this method to print an overview over the aminoacid sequence that was assigned.

#


979
980
981
982
983
984
985
986
987
988
# File 'lib/bioroebe/shell/shell.rb', line 979

def print_aa_table(optional_arguments = all_arguments?)
  require 'bioroebe/aminoacids/display_aminoacid_table.rb'
  if optional_arguments.is_a?(Array) and !optional_arguments.empty?
    _ = optional_arguments
  else
    _ = aminoacids?
  end
  _ = _.first if _.is_a? Array
  Bioroebe::DisplayAminoacidTable.new(_)
end
#

print_aminoacid_information_table

This method will give us as much information as possible about the various different aminoacids in the assumed protein sequence at hand.

#


4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
# File 'lib/bioroebe/shell/shell.rb', line 4184

def print_aminoacid_information_table
  show_mnemo
  e
  show_aminoacids_mass_table # This will also report the average weight of an aminoacid.
  e
  show_aminoacids_residues # Show all aminoacid residues (the "Reste").
  e
  display_all_aminoacids
  e
end
#

print_rev

#


7520
7521
7522
# File 'lib/bioroebe/shell/shell.rb', line 7520

def print_rev
  print rev
end

#protein_statsObject

#

protein_stats

#


6045
6046
6047
6048
6049
# File 'lib/bioroebe/shell/shell.rb', line 6045

def protein_stats
  e
  e 'CURRENTLY NOT IMPLEMENTED'
  e
end

#pubmed(number = 125512) ⇒ Object

#

pubmed

Open a pubmed citation stuff.

#


4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
# File 'lib/bioroebe/shell/shell.rb', line 4730

def pubmed(
    number = 125512
  )
  if number.is_a? Array
    number = number.join(' ').strip
  end
  use_this_url = 'https://pubmed.ncbi.nlm.nih.gov/'.dup
  if number and !number.nil?
    use_this_url << '?term='+number.to_s
  end
  ::Bioroebe.open_in_browser(use_this_url)
end

#punnet(i) ⇒ Object

#

punnet

This method will show a Punnet square.

#


3195
3196
3197
# File 'lib/bioroebe/shell/shell.rb', line 3195

def punnet(i)
  ::Bioroebe::Punnet.new(i)
end

#purge(i) ⇒ Object

#

purge

This method can be used to purge nucleotides. E. g. if you want to get rid of all Thymines.

To invoke this method, do:

purge thymines
#


4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
# File 'lib/bioroebe/shell/shell.rb', line 4678

def purge(i)
  if i.nil?
    erev 'Please provide some input such as "thymine" or "t".'
    return
  end
  if i.is_a? Array
  else
    erev "Now purging all #{simp(i)}#{rev}:"
    case i
    when 'thymine','thymines'
      i = 'T'
    when 'cytosine','cytosines'
      i = 'C'
    when 'guanine','guanines'
      i = 'G'
    end
    new_string = sequence?.tr(i.upcase, '')
    set_sequence(new_string)
    show_string
  end
end

#random(n_elements = default_length?, , dna_or_amino_acid = :dna, do_report_the_sequence = false) ⇒ Object

#

random (random tag, rand tag)

This will generate a random DNA sequence or a random aminoacid sequence.

The first argument tells us how many nucleotides or amino acids should be part of that sequence.

If a second argument was given, we will generate AA. Otherwise we will generate DNA (which is the default).

Usage examples:

random dna
random dna 20
random 2552
random 2552 aa
#


2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
# File 'lib/bioroebe/shell/shell.rb', line 2744

def random(
    n_elements             = default_length?,
    dna_or_amino_acid      = :dna,
    do_report_the_sequence = false
  )
  if dna_or_amino_acid.is_a?(Array) and dna_or_amino_acid.empty?
    dna_or_amino_acid = :dna
  end
  # ====================================================================== #
  # === First handle Arrays
  # ====================================================================== #
  if dna_or_amino_acid.is_a? Array
    dna_or_amino_acid = dna_or_amino_acid.first
  end
  case n_elements.to_s
  # ====================================================================== #
  # === aminoacids
  # ====================================================================== #
  when 'aminoacids',
       /^aa$/i
    five_steps_array = [] # An array from 5 to 50, in 5 steps.
    5.step(50, 5) { |entry| five_steps_array << entry }
    n_elements = 200+five_steps_array.sample
    dna_or_amino_acid = :aminoacids
  # ====================================================================== #
  # === do_not_show_the_string
  # ====================================================================== #
  when 'do_not_show_the_string'
    dna_or_amino_acid = :dna
    n_elements = default_length?
    do_report_the_sequence = false
  # ====================================================================== #
  # === dna
  # ====================================================================== #
  when 'dna','' # This also handles nil.
    n_elements = default_length?
    if only_numbers?(dna_or_amino_acid)
      n_elements = dna_or_amino_acid.to_i
    end
    dna_or_amino_acid = :dna
  # ====================================================================== #
  # === nil
  # ====================================================================== #
  when nil
    n_elements = default_length? # defaults to 1000.
  end
  # ====================================================================== #
  # If input has NOT only numbers alone:
  # ====================================================================== #
  if n_elements.to_s !~ /^\d+$/
    n_elements = default_length?
  end
  dna_or_amino_acid = dna_or_amino_acid.to_s
  # ====================================================================== #
  # === Handle DNA or amino acid as input next
  # ====================================================================== #
  case dna_or_amino_acid
  # ====================================================================== #
  # === dna
  # ====================================================================== #
  when 'dna',
       'd',
       'default',
       ''
    # '' is also the default for this.
    # ==================================================================== #
    # Delegate towards the main setter next. 
    # ==================================================================== #
    set_DNA_sequence(n_elements)
  # ====================================================================== #
  # === aminoacids
  # ====================================================================== #
  when 'aminoacids',
       'aminoacid',
       'aa'
    e 'Generating some ('+sfancy(n_elements.to_s)+rev+') AminoAcids next.'
    _ = set_aminoacids(:generate, n_elements, :be_silent) # We are silent here because we report lateron anyway.
    output = _
  end
  # ======================================================================= #
  # Next, show this string if we also wish to report the sequence.
  # ======================================================================= #
  show_string(output) if do_report_the_sequence
  return _ # Last but not least, return it.
end

#random_dna_sequence(length = 250) ⇒ Object

#

random_dna_sequence

Generate a random DNA sequence. Note that this will return a String - if you wish to put this onto a Sequence object then you have to handle this situation on your own.

The argument shall be how many DNA nucleotides you want to have.

#


5134
5135
5136
5137
5138
# File 'lib/bioroebe/shell/shell.rb', line 5134

def random_dna_sequence(
    length = 250
  )
  ::Bioroebe.generate_random_dna_sequence(length)
end

#random_insert(i) ⇒ Object

#

random_insert

Use this method to do a random insert into your main DNA sequence.

The input should be a nucleotide sequence such as ATGCCA, but it can also be a number - see the examples below for that.

Note that this method will insert the given input into ONE random position of our main sequence.

To use this, try:

random 15; rinsert ATTGGGCCC
random 15; rinsert 5
random 15; rinsert 15
#


3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
# File 'lib/bioroebe/shell/shell.rb', line 3344

def random_insert(i)
  i = i.join if i.is_a? Array
  i.delete!(' ')
  if i =~ /\d+$/ # If it has at the least one number.
    _ = ''.dup
    i.to_i.times { _ << return_random_nucleotide }
    e "The #{simp(i.to_i.to_s)}#{rev} nucleotides to be added "\
      "will be `#{sfancy(_)}#{rev}`."
    i = _
  end
  # ======================================================================= #
  # We need to determine the insert position. The insert_position can
  # be 0 zoo.
  # ======================================================================= #
  insert_position = rand(sequence?.size)
  n_nucleotides = i.size.to_s
  e 'Inserting '+sfancy(n_nucleotides.to_s)+rev+' nucleotides at '\
    'nucleotide position '+simp(insert_position.to_s)+rev+'.'
  old_size = sequence?.size
  sequence?[insert_position+1, 0] = i
  e 'The old size was '+sfancy(old_size.to_s)+
     rev+'. The new size is '+
     sfancy(sequence?.size.to_s)+
     rev+'.'
end

#raw_aminoacid_sequence?Boolean Also known as: aminoacids?, amino_acid_sequence?, aminoacid_sequence?, aa_sequence?, aa?

#

raw_aminoacid_sequence?

Reader method over the aminoacid sequence.

#

Returns:

  • (Boolean)


880
881
882
# File 'lib/bioroebe/shell/shell.rb', line 880

def raw_aminoacid_sequence?
  @internal_hash[:array_aminoacid_sequence].last
end

#raw_sequence?Boolean Also known as: dna_sequence_as_string?, dna_sequence_object_as_string?, sequence_as_string?

#

raw_sequence?

This method must always return a String.

#

Returns:

  • (Boolean)


846
847
848
849
# File 'lib/bioroebe/shell/shell.rb', line 846

def raw_sequence?
  # @internal_hash[:nucleotide_sequence].to_s
  @internal_hash[:array_dna_sequences].last.to_str
end

#readline_is_available?Boolean Also known as: use_readline?, has_readline?

#

readline_is_available?

#

Returns:

  • (Boolean)


74
75
76
# File 'lib/bioroebe/shell/readline.rb', line 74

def readline_is_available?
  ::Bioroebe.readline_is_available? # Query the constant value in this case.
end

#register_this_download(i) ⇒ Object

#

register_this_download

Simply register all downloads - we may use this information at some later point.

The entries here typically are HTTP or HTTPS-URLs.

#


10263
10264
10265
# File 'lib/bioroebe/shell/shell.rb', line 10263

def register_this_download(i)
  @internal_hash[:array_all_downloads] << i
end

#remaining_arguments?Boolean

#

remaining_arguments?

#

Returns:

  • (Boolean)


7431
7432
7433
# File 'lib/bioroebe/shell/shell.rb', line 7431

def remaining_arguments?
  @internal_hash[:remaining_arguments]
end

#remove_question_mark?Boolean

#

remove_question_mark?

#

Returns:

  • (Boolean)


7304
7305
7306
# File 'lib/bioroebe/shell/shell.rb', line 7304

def remove_question_mark?
  @internal_hash[:remove_last_character_if_it_is_a_question_mark]
end

#remove_sequence(i) ⇒ Object Also known as: remove

#

remove_sequence

Use this method to chop away from the beginning part of a nucleotide sequence.

#


3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
# File 'lib/bioroebe/shell/shell.rb', line 3017

def remove_sequence(i)
  i = i.first if i.is_a? Array
  i = i.to_i
  if dna_sequence_as_string?.size == 0
    erev 'Can not remove any more characters as we do not have a '\
         'sequence anymore.'
  else
    erev "Removing #{sfancy(i)}#{rev} characters from the "\
         "start (left side; 5' end)."
    _ = dna_sequence?
    _.remove_n_characters_from_the_left_side(i)
    this_sequence = _
    set_dna_sequence(this_sequence)
  end
end

#remove_trailing_escape_code(i) ⇒ Object

#

remove_trailing_escape_code

#


147
148
149
150
# File 'lib/bioroebe/shell/shell.rb', line 147

def remove_trailing_escape_code(i)
  return i unless use_colours?
  ::Colours.remove_trailing_escape_code(i)
end

#replay(i = nil) ⇒ Object

#

replay

#


11099
11100
11101
11102
11103
11104
11105
11106
11107
11108
11109
11110
11111
11112
11113
11114
11115
11116
11117
11118
11119
11120
11121
11122
11123
11124
11125
11126
11127
11128
11129
11130
11131
11132
11133
# File 'lib/bioroebe/shell/shell.rb', line 11099

def replay(i = nil)
  if i
    # ===================================================================== #
    # The user did input something. Thus continue here.
    # ===================================================================== #
    case i
    # ===================================================================== #
    # === save
    # ===================================================================== #
    when 'save',
         'store'
      verbose_save_history_to_file
    else
      # =================================================================== #
      # Else load the replay file. For instance, via "replay load".
      # =================================================================== #
      replay_file = log_dir?+'replay_file.yml'
      if File.exist? replay_file
        erev 'Now replaying the history from the file `'+sfile(replay_file)+rev+'`.'
        array = YAML.load_file(replay_file)
        array.each {|command|
          run_this_user_input(command)
        }
      else
        erev 'We are trying to replay the old history, but we could not find'
        erev 'any file called '+sfile(replay_file)+'.'
        e
        erev 'You can generate a new replay file by inputting some commands'
        erev 'and then invoking "replay".' 
      end
    end
  else
    verbose_save_history_to_file
  end
end

#report_all_stop_codons(i = dna_sequence_object? ) ⇒ Object

#

report_all_stop_codons

This method will report all stop codons in the given sequence.

We will not modify the input given to this method.

The three stop codons, in RNA, are:

UGA
UAG
UAA
#


1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
# File 'lib/bioroebe/shell/shell.rb', line 1517

def report_all_stop_codons(
    i = dna_sequence_object?
  )
  i.upcase!
  erev 'Our input sequence has '+simp(i.size.to_s)+rev+' nucleotides.'
  n_UGA = 'UGA'
  n_UGA = 'TGA' if is_dna?
  erev 'We did find '+
        simp(
          i.scan(/#{n_UGA}/
        ).size.to_s.rjust(2))+rev+' '+n_UGA+' stop codons.'
  n_UAG = 'UAG'
  n_UAG = 'TAG' if is_dna?
  erev 'We did find '+
        simp(i.scan(/#{n_UAG}/).size.to_s.rjust(2))+rev+' '+n_UAG+' stop codons.'
  n_UAA = 'UAA'
  n_UAA = 'TAA' if is_dna?
  erev 'We did find '+
        simp(i.scan(/#{n_UAA}/).size.to_s.rjust(2))+rev+' '+n_UAA+' stop codons.'
end

#report_colourized_sequence(colourize_what = :start_and_stop_codon) ⇒ Object

#

report_colourized_sequence

This method will use the new class ColourizeSequence, rather than the old internal way.

In the long run, it may be best to transition all of the Bioroebe::Shell into the new class - but for now, we will use a hybrid system.

To invoke this method, try:

start_and_stop?
#


1260
1261
1262
1263
1264
1265
1266
# File 'lib/bioroebe/shell/shell.rb', line 1260

def report_colourized_sequence(
    colourize_what = :start_and_stop_codon
  )
  _ = ColourizeSequence.return_sequence(dna_sequence_object?) { colourize_what }
  show_nucleotide_sequence?.display(_)
  e
end

#report_current_genbank_version(optional_arguments = nil) ⇒ Object

#

report_current_genbank_version

You can use this method to report the current genbank version.

#


6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
# File 'lib/bioroebe/shell/shell.rb', line 6621

def report_current_genbank_version(
    optional_arguments = nil
  )
  remote_url = 'https://www.ncbi.nlm.nih.gov/genbank/statistics/'
  if optional_arguments
    case optional_arguments
    when :also_report_the_URL
      erev 'We will obtain the latest Genbank version from the URL:'
      e
      erev "  #{simp(remote_url)}"
      e
    end
  end
  remote_dataset = URI.open(remote_url).read.split(N)
  # ======================================================================= #
  # For the following Regex, see this link:
  #
  #   https://rubular.com/r/XC97c7i6sR
  #
  # ======================================================================= #
  regex_to_use =
    /<td>(\d{1,3})<\/td><td>(.{1,3}\s{1,3}\d{4})<\/td><td>\d+<\/td><td>\d+<\/td><td>\d+<\/td><td>\d+<\/td><\/tr><\/tbody><\/table>$/
  _ = ''.dup
  is_open = false
  remote_dataset.each {|line|
    if line.include? '<table id="stats_table" summary="GENBANK AND WGS'
      _ << line
      is_open = true
    else
      _ << line if is_open
      if line.include? '</table>'
        is_open = false
      end
    end
  }
  _ =~ regex_to_use # Match the regex against the substring assigned to _.
  version        = $1.to_s.dup
  month_and_year = $2.to_s.dup
  erev 'The current Genbank version is: '+simp(version)+
       rev+' (released on '+simp(month_and_year)+rev+')'
end

#report_current_working_directoryObject

#

report_current_working_directory

#


4023
4024
4025
4026
4027
# File 'lib/bioroebe/shell/shell.rb', line 4023

def report_current_working_directory
  _ = "We are in the directory:\n\n".dup
  _ << "  #{sdir(return_working_directory)}\n\n"
  e _
end

#report_everything_about_this_amino_acid(i) ⇒ Object

#

report_everything_about_this_amino_acid

Use this method to report everything about any particular amino acid.

#


7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
# File 'lib/bioroebe/shell/shell.rb', line 7696

def report_everything_about_this_amino_acid(i)
  if i.is_a? Array
    i.each {|entry| report_everything_about_this_amino_acid(entry) }
  else
    i.delete!('?') if i.include? '?'
    erev 'It seems as is we did find an Amino Acid ('+simp(i)+rev+
         '). Its characteristic residue (R) is:'+N+N
    unless AMINO_ACIDS_RESTE.has_key?(i)
      # =================================================================== #
      # This here is to map german names, such as "glycin",
      # onto "glycine", the corresponding english name.
      # =================================================================== #
      if AMINO_ACIDS_LONG_NAME_TO_ONE_LETTER.has_key?(i)
        i = AMINO_ACIDS_LONG_NAME_TO_ONE_LETTER[i]
        i = AMINO_ACIDS_ENGLISH[i].downcase
      end
    end
    residue = AMINO_ACIDS_RESTE[i.downcase].to_s
    efancy "  #{residue}#{N}"
    erev 'The codons coding for the aminoacid '+simp(i)+rev+' are:'
    e
    e '  '+mediumturquoise(
        ::Bioroebe::PossibleCodonsForThisAminoacid.new(i).pretty_result
      )
    e
    molecular_mass_of(i, 2) # The 2 says to round to 2 digit.
  end
end

#report_five_prime_three_prime(i) ⇒ Object

#

report_five_prime_three_prime

#


7728
7729
7730
# File 'lib/bioroebe/shell/shell.rb', line 7728

def report_five_prime_three_prime(i)
  erev dna_with_ends(i)
end

#report_how_many_aminoacids_we_haveObject

#

report_how_many_aminoacids_we_have

This method will report how many aminoacids we have assigned.

#


2486
2487
2488
2489
2490
2491
2492
2493
2494
# File 'lib/bioroebe/shell/shell.rb', line 2486

def report_how_many_aminoacids_we_have
  if aminoacids?
    n_aminoacids = aminoacids?.size
  else
    n_aminoacids = dna_sequence_object?.size / 3.0
  end
  n_aminoacids = n_aminoacids.to_i
  erev "This sequence has #{simp(n_aminoacids.to_s)}#{rev} aminoacids."
end

#report_main_sequence(input = dna_sequence_as_string?, , colourize = nil) ⇒ Object Also known as: show_main_sequence, show_colourized_sequence, show_dna_sequence, show_DNA_sequence

#

report_main_sequence

We will call dna_with_ends() here in this method. The argument colourize will determine whether we will colourize the DNA strand or not.

Invocation examples:

report_main_sequence(::Bioroebe.start_codon?)
report_main_sequence(:start_codon) # ← is the same as the ^^^ above
report_main_sequence(:stop_codon)  # ← Colourize the stop-codons.
#


1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
# File 'lib/bioroebe/shell/shell.rb', line 1303

def report_main_sequence(
    input     = dna_sequence_as_string?,
    colourize = nil
  )
  case input
  # ======================================================================= #
  # === :stop_codon
  # ======================================================================= #
  when :stop_codon
    colourize = stop_codons?
    input     = dna_sequence_as_string?
  end
  original_input = input.dup
  case colourize
  # ======================================================================= #
  # === :stop_codon
  #
  # We attempt to colourize the stop-codons via this method.
  # ======================================================================= #
  when :stop_codon
    colourize = stop_codons?
  # ======================================================================= #
  # === :stop_codon_in_frame1
  # ======================================================================= #
  when :stop_codon_in_frame1,
       :stop_codon_in_frame2,
       :stop_codon_in_frame3
    new_string = remove_trailing_escape_code(
      colour_for_nucleotides(
        ''.dup
      ).dup
    ).dup
    n_stop_codons_were_found = 0
    prepend_this = ''.dup
    input = input.dup # Work on a copy here.
    case colourize
    when :stop_codon_in_frame2
      prepend_this << input[0,1]
      input[0,1] = ''
    when :stop_codon_in_frame3
      prepend_this << input[0,2]
      input[0,2] = ''
    end
    new_string << prepend_this
    scanned = input.scan(/.../) # Get a group of codons here.
    scanned.each {|codon|
      if is_a_stop_codon? codon
        n_stop_codons_were_found += 1
        new_string << colour_for_stop_codon(codon.dup).dup+
                      remove_trailing_escape_code(
                        colour_for_nucleotides
                      )
      else
        new_string << codon.dup
      end
    }
    case colourize
    # ===================================================================== #
    # === :stop_codon_in_frame2
    # ===================================================================== #
    when :stop_codon_in_frame2
      new_string << input[-2,2]
    # ===================================================================== #
    # === :stop_codon_in_frame3
    # ===================================================================== #
    when :stop_codon_in_frame3
      new_string << input[-1,1]
    end
    
    e "#{padding?}"\
      "#{rev}"\
      "#{leading_five_prime}"\
      "#{new_string}"\
      "#{rev}"\
      "#{trailing_three_prime}"
    erev "#{steelblue(n_stop_codons_were_found)} #{rev}stop "\
         "codons were found in this sequence of #{original_input.size} "\
         "nucleotides."
    return
  # ======================================================================= #
  # === :start_codon
  # ======================================================================= #
  when :start_codon # Instruction to use a start codon here.
    colourize = start_codon?
  # ======================================================================= #
  # === :start_and_stop_codon
  # ======================================================================= #
  when :start_and_stop_codon
    colourize = [start_codon?, stop_codons?]
  end
  # ======================================================================= #
  # The old code was:
  #
  #   erev padding?+
  #        dna_with_ends(input, colourize) { :honour_coding_area_if_it_exists } # The dna_with_ends() method can deal with Arrays.
  #
  # This is now mostly ported (April 2020), but the :honour_coding_area_if_it_exists
  # is not yet ported, so the above code will remain as-is, for the time
  # being.
  # ======================================================================= #
  if run_in_GUI_settings?
    set_result(
      five_leader?+
      input+
      three_trailer?
    )
  else
    show_nucleotide_sequence?.report_this_sequence(input) {{
      padding_to_use:             padding?,
      colourize_this_subsequence: colourize,
      use_colours:                use_colours?
    }}
  end
end

#report_modeObject

#

report_mode

#


11138
11139
11140
# File 'lib/bioroebe/shell/shell.rb', line 11138

def report_mode
  erev mode?
end

#report_n_proteins_registered_in_swiss_protObject

#

report_n_proteins_registered_in_swiss_prot

This method will report how many proteins are registered in swiss-prot.

Invoke this method like so:

swiss-prot?
#


2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
# File 'lib/bioroebe/shell/shell.rb', line 2424

def report_n_proteins_registered_in_swiss_prot
  regex_to_use = /contains (\d+) sequence entries/ # See: http://rubular.com/r/Bl9tHfheEx
  url = 'https://web.expasy.org/docs/relnotes/relstat.html'
  dataset = open(url).read
  dataset =~ regex_to_use
  n_registered_proteins = $1.to_s.dup
  erev 'There are '+simp(n_registered_proteins)+rev+' registered '\
       'proteins in the Swiss-Prot database.'
  erev "The URL used to determine this was: "\
       "#{simp(url)}"
end

#report_n_start_codons(this_string = string?, , use_this_as_start_codon = :default, in_which_frame = :frame1) ⇒ Object

#

report_n_start_codons

Use this method to count how many ATG codons we have. We will honour the default start_codon in use.

The third argument determines which reading frame is to be used. By default, the method will use the first reading frame.

#


5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
# File 'lib/bioroebe/shell/shell.rb', line 5386

def report_n_start_codons(
    this_string             = string?,
    use_this_as_start_codon = :default, # Use the proper start codon.
    in_which_frame          = :frame1
  )
  case use_this_as_start_codon
  # ======================================================================= #
  # === :default
  # ======================================================================= #
  when :default
    use_this_as_start_codon = ::Bioroebe.start_codon?
  end
  # ======================================================================= #
  # === Handle blocks next
  # ======================================================================= #
  if block_given?
    yielded = yield
    case yielded
    when /^frame/
      in_which_frame = yielded.to_sym
    end
  end
  # ======================================================================= #
  # The following can be invoked via:
  #   n_ORF? frame1
  # ======================================================================= #
  case in_which_frame
  # ======================================================================= #
  # === :frame1
  # ======================================================================= #
  when :frame1
    in_which_frame = 'frame 1'
  # ======================================================================= #
  # === :frame2
  # ======================================================================= #
  when :frame2
    in_which_frame = 'frame 2'
  # ======================================================================= #
  # === :frame3
  # ======================================================================= #
  when :frame3
    in_which_frame = 'frame 3'
  end
  n_start_codons = this_string.upcase.scan(
    /#{use_this_as_start_codon}/
  ).size.to_s
  # ======================================================================= #
  # The above is not yet in the proper frame, though.
  # ======================================================================= #
  trailing_message = " Initiation Codons "\
                     "(in #{orangered(in_which_frame)}#{rev})."
  erev "Our main string has #{sfancy(n_start_codons)}#{rev}"\
       " #{simp(use_this_as_start_codon)}#{rev} ("\
       "#{use_this_as_start_codon.tr('T','U')})"+
       trailing_message
  if coding_area? # This has been user-supplied in that case.
    erev 'However had, only the nucleotides from position'
    erev "#{sfancy(coding_area?.to_s.split('..').first.to_s)}#{rev}"\
         " to position #{sfancy(coding_area?.to_s.split('..').last.to_s)}"\
         "#{rev} will be colourized."
  end
end

#report_size_of(i = nil) ⇒ Object

#

report_size_of

#


9504
9505
9506
9507
9508
9509
9510
9511
9512
9513
9514
9515
# File 'lib/bioroebe/shell/shell.rb', line 9504

def report_size_of(
    i = nil
  )
  if i.nil?
    i = dna_sequence_object?
  end
  if i
    erev "This sequence contains #{sfancy(i.size.to_s)}#{rev} nucleotides."
  else
    report_size_of_main_string
  end
end

#report_size_of_main_string(i = dna_sequence_object?, , type_of_string = 'main ') ⇒ Object Also known as: report_length_of_the_dna_string, report_size_of_this_sequence

#

report_size_of_main_string

#


7785
7786
7787
7788
7789
7790
7791
7792
7793
# File 'lib/bioroebe/shell/shell.rb', line 7785

def report_size_of_main_string(
    i              = dna_sequence_object?,
    type_of_string = 'main ' # This is usually the main DNA string.
  )
  i = dna_sequence_object? if i.nil?
  i = dna_sequence_object? if i.is_a?(Array) and i.empty?
  erev 'The '+type_of_string+'string has '+sfancy(i.size.to_s)+
       rev+' '+nucleotides_or_aminoacids?+'.'
end

#report_syntax_help_for_frameshift_actionObject

#

report_syntax_help_for_frameshift_action

#


1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
# File 'lib/bioroebe/shell/shell.rb', line 1154

def report_syntax_help_for_frameshift_action
  result = <<-EOF

#{rev} You can provide these options for the frameshifting menu:

+1
+2
+3
all

EOF
  e result
end

#report_that_a_string_must_be_assigned_firstObject

#

report_that_a_string_must_be_assigned_first

#


6403
6404
6405
6406
# File 'lib/bioroebe/shell/shell.rb', line 6403

def report_that_a_string_must_be_assigned_first
  erev 'No sequence has been assigned yet. Please first "'+
       sfancy('assign')+rev+'" a string.'
end

#report_that_the_main_sequence_is_frozenObject

#

report_that_the_main_sequence_is_frozen

#


2986
2987
2988
2989
2990
2991
# File 'lib/bioroebe/shell/shell.rb', line 2986

def report_that_the_main_sequence_is_frozen
  erev 'The main sequence is frozen and can not be modified '\
       'anymore.'
  erev 'You can "'+steelblue('unfreeze')+rev+
       '" it again, if you want to.'
end

#report_the_first_atgObject

#

report_the_first_atg

This method will simply report the first ATG codon.

#


1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
# File 'lib/bioroebe/shell/shell.rb', line 1137

def report_the_first_atg
  dna_sequence = dna_sequence_object_as_string?
  array_matches = ::Bioroebe.return_all_substring_matches(
    dna_sequence, start_codon?
  )
  start_position = array_matches.first.first
  erev 'The first ATG can be found at position '+
        simp(start_position.to_s)+rev+'.'
  erev 'We will next show the first 100 nucleotides, starting from this:'
  report_five_prime_three_prime(
    dna_sequence_object?[start_position-1,100]
  )
end

#report_the_protein_weightObject

#

report_the_protein_weight

#


8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
# File 'lib/bioroebe/shell/shell.rb', line 8434

def report_the_protein_weight
  _ = aminoacid_sequence?
  if _.include? '*'
    erev 'Note that this aminoacid sequence has a stop codon, '\
         'denoted by the *:'
    e
    erev "  #{sfancy(_)}#{rev}"
    e
    erev 'Since a stop codon is not translated into an aminoacid'
    erev 'it makes little sense to include it into the weight-calculation.'
    erev 'Thus, we will use only the part up to the first * token.'
    _ = _[0 .. (_.index('*') - 1)]
  end
  sum = ::Bioroebe.amino_acid_average_mass(_)
  e 'The total weight of these '+simp(_.size.to_s)+rev+
    ' aminoacids is: '+sfancy(sum.to_f.round(2).to_s)+rev+
    ' Dalton'
end

#report_this_dna_sequence_with_proper_trailer_and_leader(i) ⇒ Object

#

report_this_dna_sequence_with_proper_trailer_and_leader

#


1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
# File 'lib/bioroebe/shell/shell.rb', line 1002

def report_this_dna_sequence_with_proper_trailer_and_leader(i)
  i = i.to_s
  if block_given?
    yielded = yield
    case yielded
    when :try_to_colourize_start_codon
      # =================================================================== #
      # We will try to colourize the start codon here.
      # =================================================================== #
      if i.start_with? start_codon?
        i[0,3] = cyan(i[0,3])+return_colour_for_nucleotides
      end
    end
  end
  colourized_dna_sequence = colourize_this_dna_sequence(i)
  colourized_dna_sequence = remove_trailing_escape_code(
    colourized_dna_sequence
  )
  erev left_pad?+
       leading_5_prime+
       colourized_dna_sequence+
       rev+
       trailing_3_prime
end

#report_this_input_was_not_found(i = '') ⇒ Object

#

report_this_input_was_not_found

This method is used to notify the user that a certain input was not found.

#


9804
9805
9806
9807
9808
9809
9810
9811
# File 'lib/bioroebe/shell/shell.rb', line 9804

def report_this_input_was_not_found(
    i = ''
  )
  unless i.empty?
    erev "Input `#{sfancy(i.to_s)}#{rev}` was not "\
         "found to be a valid input for the BioShell."
  end
end

#report_useful_packages_installedObject

#

report_useful_packages_installed

This aggregate method can be used to report versions that may be installed on the given system, e. g. science-based projects and similar variants.

#


6325
6326
6327
6328
# File 'lib/bioroebe/shell/shell.rb', line 6325

def report_useful_packages_installed
  try_to_report_the_version_of_viennarna
  try_to_report_the_version_of_bedtools
end

#report_when_the_bioroebe_project_was_last_updatedObject

#

report_when_the_bioroebe_project_was_last_updated

#


7863
7864
7865
7866
7867
7868
7869
7870
# File 'lib/bioroebe/shell/shell.rb', line 7863

def report_when_the_bioroebe_project_was_last_updated
  result = 'The Bioroebe-Project was last updated on: '+
            slateblue(LAST_UPDATE)+rev
  result = result.dup
  n_days_difference = ((Time.now - Time.parse(LAST_UPDATE))/60/60/24).round(2).to_s
  result << ' (~'+n_days_difference.to_s+' days ago)'
  erev result
end

#report_where_the_home_directory_can_be_found(i = log_dir? ) ⇒ Object

#

report_where_the_home_directory_can_be_found

#


1786
1787
1788
1789
1790
1791
1792
1793
1794
# File 'lib/bioroebe/shell/shell.rb', line 1786

def report_where_the_home_directory_can_be_found(
    i = log_dir?
  )
  erev 'The "home" directory (actually called the log directory) '\
       'can be found here:'
  e
  e "  #{sdir(i)}"
  e
end

#report_where_the_pdf_tutorial_can_be_foundObject

#

report_where_the_pdf_tutorial_can_be_found

Do notify the user where to find the .pdf tutorial.

#


5569
5570
5571
5572
5573
5574
5575
# File 'lib/bioroebe/shell/shell.rb', line 5569

def report_where_the_pdf_tutorial_can_be_found
  _ = File.basename(FILE_BIOROEBE_TUTORIAL)
  erev 'You can find the tutorial here:'
  e
  erev '  '+simp('http://shevegen.square7.ch/'+_)+rev
  e
end

#report_where_we_storeObject

#

report_where_we_store

#


5990
5991
5992
5993
# File 'lib/bioroebe/shell/shell.rb', line 5990

def report_where_we_store
  erev "We will store output from the Bioroebe-Project "\
       "into #{sfile(save_file?)}."
end

#report_whether_readline_is_availableObject

#

report_whether_readline_is_available

#


4054
4055
4056
4057
4058
4059
4060
4061
# File 'lib/bioroebe/shell/shell.rb', line 4054

def report_whether_readline_is_available
  erev 'Is readline available? '+
    slateblue(
      verbose_truth(
        (Object.const_defined? :Readline)
      )
    )
end

#report_whether_we_will_make_use_of_expand_cd_aliasesObject

#

report_whether_we_will_make_use_of_expand_cd_aliases

#


6314
6315
6316
# File 'lib/bioroebe/shell/shell.rb', line 6314

def report_whether_we_will_make_use_of_expand_cd_aliases
  erev Bioroebe::VerboseTruth[use_expand_cd_aliases?]
end

#report_which_yaml_engine_is_in_useObject

#

report_which_yaml_engine_is_in_use

#


9495
9496
9497
9498
9499
# File 'lib/bioroebe/shell/shell.rb', line 9495

def report_which_yaml_engine_is_in_use
  erev 'The yaml engine in use is: '+
       sfancy(::Bioroebe.use_which_yaml_engine?)+
       rev
end

#reset(be_verbose = true) ⇒ Object

#

reset (reset tag)

#


406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
# File 'lib/bioroebe/shell/shell.rb', line 406

def reset(
    be_verbose = true
  )
  super()
  infer_the_namespace
  reset_to_the_initial_state(be_verbose)
  # ======================================================================= #
  # Make sure that the base directories exist, within reset(). This
  # should come after reset_to_the_initial_state().
  # ======================================================================= #
  ensure_that_the_base_directories_exist
  # ======================================================================= #
  # Next, we have to try to enable the configuration.
  # ======================================================================= #
  enable_configuration # This should come after reset_to_the_initial_state().
  set_default_length # Set the default length of 1000 here.
end

#reset_the_user_input_specific_variablesObject

#

reset_the_user_input_specific_variables

#


801
802
803
804
805
806
807
808
# File 'lib/bioroebe/shell/shell.rb', line 801

def reset_the_user_input_specific_variables
  @internal_hash[:all_arguments].clear
  @internal_hash[:remaining_arguments].clear
  @internal_hash[:first_argument] = nil
  # @internal_hash[:first_argument] = nil if @internal_hash.has_key?(:first_argument)
  @internal_hash[:command_to_be_passed_to_the_menu] = nil
  @internal_hash[:result].clear
end

#reset_to_the_initial_state(be_verbose = true) ⇒ Object Also known as: reset_to_the_internal_state

#

reset_to_the_initial_state

#


427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
# File 'lib/bioroebe/shell/shell.rb', line 427

def reset_to_the_initial_state(
    be_verbose = true
  )
  # ======================================================================= #
  # === :array_palindromes
  # ======================================================================= #
  @internal_hash[:array_palindromes] = []
  # ======================================================================= #
  # === :file_dna_string_saved
  #
  # Where to store our DNA string by default.
  # ======================================================================= #
  @internal_hash[:file_dna_string_saved] = "#{log_dir?}dna_string_saved.yml"
  # ======================================================================= #
  # === :array_jumper_directories
  # ======================================================================= #
  @internal_hash[:array_jumper_directories] = []
  # ======================================================================= #
  # === :array_fasta
  # ======================================================================= #
  @internal_hash[:array_fasta] = []
  # ======================================================================= #
  # === analyse_the_local_dataset_on_startup
  #
  # If this setting is set to true then, on startup, the bioshell
  # will report some information about the local dataset (FASTA
  # files and pdb files).
  # ======================================================================= #
  @internal_hash[:analyse_the_local_dataset_on_startup] = true
  # ======================================================================= #
  # === search_for
  # ======================================================================= #
  @internal_hash[:search_for] = nil
  # ======================================================================= #
  # === coding_area
  # ======================================================================= #
  @internal_hash[:coding_area] = nil # This can keep track of the real coding area.
  # ======================================================================= #
  # === misc_sequence
  # ======================================================================= #
  @internal_hash[:misc_sequence] = nil # This can store a misc DNA or RNA sequence.
  # ======================================================================= #
  # === :array_sequences
  # ======================================================================= #
  # @internal_hash[:array_sequences] = []
  # ======================================================================= #
  # === :registered_actions
  # ======================================================================= #
  @internal_hash[:registered_actions] = ARRAY_REGISTERED_ACTIONS
  # ======================================================================= #
  # === :result
  #
  # The content of this variable can be shown in the jruby-GUI for the
  # bioshell, for instance.
  # ======================================================================= #
  @internal_hash[:result] = ''.dup
  # ======================================================================= #
  # === :array_dna_sequence
  # ======================================================================= #
  @internal_hash[:array_dna_sequences] = []
  # ======================================================================= #
  # === :the_main_sequence_is_frozen
  # ======================================================================= #
  @internal_hash[:the_main_sequence_is_frozen] = false
  # ======================================================================= #
  # === :silent_startup
  #
  # This variable keeps track as to whether we will display a welcome
  # message on startup or whether we will not.
  # ======================================================================= #
  @internal_hash[:silent_startup] = false
  # ======================================================================= #
  # === :create_directories_on_startup_of_the_shell
  #
  # If this variable is set to true then the bio-shell will create
  # some directories on startup. The user can modify this from
  # the commandline, though, and specifically disable it.
  # ======================================================================= #
  @internal_hash[:create_directories_on_startup_of_the_shell] = true
  # ======================================================================= #
  # === array_history
  #
  # This array will keep track of the input-history, aka the commands
  # that the user has used.
  # ======================================================================= #
  @internal_hash[:array_history] = []
  # ======================================================================= #
  # === remove_last_character_if_it_is_a_question_mark
  #
  # If this variable is set to true then we will remove the last
  # input character - at the least if it is a '?'.
  # ======================================================================= #
  @internal_hash[:remove_last_character_if_it_is_a_question_mark] = false
  # ======================================================================= #
  # === :array_aminoacid_sequence
  #
  # This variable should be an empty Array, aka [], initially, so that we
  # can distinguish the case when the user has added data onto that
  # Array.
  # ======================================================================= #
  @internal_hash[:array_aminoacid_sequence] = []
  # ======================================================================= #
  # === exit_the_shell_how
  #
  # The next variable has two valid modes:
  #
  #   :instantly
  #   :exit_gracefully
  #
  # The first is the default; the second can be used if the Bioshell
  # is embedded into another program.
  # ======================================================================= #
  @internal_hash[:exit_the_shell_how] = :instantly
  # ======================================================================= #
  # === search_for
  #
  # This is the sequence we wish to find, in a given nucleotide sequence.
  # By default this will be nil.
  # ======================================================================= #
  @internal_hash[:search_for] = nil
  # ======================================================================= #
  # === show_the_leader
  # ======================================================================= #
  @internal_hash[:show_the_leader]  = true # Show the 5' leader.
  # ======================================================================= #
  # === show_the_trailer
  # ======================================================================= #
  @internal_hash[:show_the_trailer] = true # Show the 3' trailer.
  # ======================================================================= #
  # === :array_rna_sequence
  #
  # This can be populated with sequence objects such as:
  #
  #   Bioroebe::Sequence.new(''.dup, :rna)
  #
  # ======================================================================= #
  @internal_hash[:array_rna_sequences] = []
  # ======================================================================= #
  # === @save_file
  # ======================================================================= #
  @internal_hash[:save_file] = BIOSHELL_SAVE_FILE
  # ======================================================================= #
  # === @use_working_directory_as_prompt
  # ======================================================================= #
  @internal_hash[:use_working_directory_as_prompt] = false
  # ======================================================================= #
  # === @debug
  #
  # Determine whether we will debug or whether we will not
  # ======================================================================= #
  @internal_hash[:debug] = SHALL_WE_DEBUG
  # ======================================================================= #
  # === user_input
  # ======================================================================= #
  @internal_hash[:user_input] = nil
  # ======================================================================= #
  # === prompt_to_use
  #
  # This variable keeps track as to which prompt is to be used.
  # ======================================================================= #
  @internal_hash[:prompt_to_use] = :default
  # ======================================================================= #
  # === :use_xsel
  #
  # This method will determine whether we will use the external
  # program "xsel". By default, at the least on my home system,
  # I prefer to make use of xsel.
  # ======================================================================= #
  @internal_hash[:use_xsel] = true
  # ======================================================================= #
  # === @mode
  #
  # @mode can be either :dna or :rna or :aminoacid
  # ======================================================================= #
  @internal_hash[:mode] = :dna
  # ======================================================================= #
  # === @array_these_sequences_were_chopped_away
  #
  # Keep an Array that can be used to keep track of which sequences
  # were chopped away. Whenever we perform a chop-related action we
  # will store that sequence in an Array.
  # ======================================================================= #
  @internal_hash[:array_these_sequences_were_chopped_away] = []
  # ======================================================================= #
  # === array_timer_snapshots
  # ======================================================================= #
  @internal_hash[:array_timer_snapshots] = [] # This Array keeps track of the time.
  # ======================================================================= #
  # === may_we_show_the_startup_information
  #
  # This variable determines whether the startup-information may be
  # shown, on start-up of the bioshell. By default this will be true
  # typically, but a config-variable may overrule this.
  # ======================================================================= #
  @internal_hash[:may_we_show_the_startup_information] = true
  if @configuration and @configuration.respond_to? :may_we_show_the_startup_information
    @internal_hash[:may_we_show_the_startup_information] = @configuration.may_we_show_the_startup_information
  end
  # ======================================================================= #
  # === :show_nucleotide_sequence
  # ======================================================================= #
  @internal_hash[:show_nucleotide_sequence] = ::Bioroebe::ShowNucleotideSequence.new(
    '', :do_not_run_yet
  )
  # ======================================================================= #
  # === fasta_file
  #
  # This used to be a standalone @hash variable, but during the
  # rewrite in April 2020 this was integrated into @internal_hash.
  # ======================================================================= #
  @internal_hash[:fasta_file] = {}
  # ======================================================================= #
  # === @array_all_downloads
  # ======================================================================= #
  @internal_hash[:array_all_downloads] = [] # Must be an Array.
  # ======================================================================= #
  # === @use_working_directory_as_prompt
  # ======================================================================= #
  @internal_hash[:use_working_directory_as_prompt] = true
  # ======================================================================= #
  # === Determine whether silent startup is active
  #
  # Next, determine whether we will show a small startup-message or
  # whether we shall not show it. By default this should be false -
  # but if a file called 'use_silent_startup.yml' exists then we
  # will use that file.
  # ======================================================================= #
  if File.exist? FILE_USE_SILENT_STARTUP
    dataset = YAML.load_file(FILE_USE_SILENT_STARTUP)
    if dataset.is_a?(Hash) and dataset.has_key?('use_silent_startup')
      @internal_hash[:silent_startup] = dataset['use_silent_startup']
    end
  else # else it is 
    @internal_hash[:silent_startup] = false
  end
  # ======================================================================= #
  # === Enable the clipboard next:
  # ======================================================================= #
  initialize_clipboard
  # ======================================================================= #
  # === Setting towards a default padding
  #
  # Next comes left-padding, defaulting to '  '. This should come after
  # the clipboard has been initialized, and after @internal_hash has
  # been fully populated.
  # ======================================================================= #
  set_padding :default
  set_sequence_2
  set_sequence_3
  set_sequence_4
  set_sequence_5
  set_sequence_6
  ::Bioroebe.clear_array_colourize_this_aminoacid
  # ======================================================================= #
  # === :nucleotide_sequence
  # ======================================================================= #
  # @internal_hash[:nucleotide_sequence] = ::Bioroebe::Sequence.new
  # ======================================================================= #
  # === :sequence
  #
  # We set thesequence to a new instance of Bioroebe::Sequence next.
  # ======================================================================= #
  reset_string
  # ======================================================================= #
  # === :use_colours
  #
  # Let's enable the colours.
  # ======================================================================= #
  extended_enable_colours(:be_quiet)
  initialize_the_user_input_specific_variables
  set_runmode(:commandline) # Always have a default set.
end

#restore_default_promptObject

#

restore_default_prompt

#


8677
8678
8679
# File 'lib/bioroebe/shell/shell.rb', line 8677

def restore_default_prompt
  set_prompt :default
end

#restore_the_last_chop_operationObject

#

restore_the_last_chop_operation

This method will “restore” the last chop operation.

Presently it will only append onto the 3’ area but in the future this may change, depending on whether we will store the position as well.

#


2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
# File 'lib/bioroebe/shell/shell.rb', line 2557

def restore_the_last_chop_operation
  if @internal_hash[:array_these_sequences_were_chopped_away].empty?
    erev 'Can not restore the last chop-operation as we have not yet'
    erev 'chopped away any nucleotide from the main sequence.'
  else
    this_sequence = @internal_hash[:array_these_sequences_were_chopped_away].pop
    erev 'Now adding the sequence '+
         format_this_nucleotide_sequence(
           this_sequence
         )
    erev 'to our main sequence.'
    main_sequence?.append(this_sequence)
  end
end

#restriction_enzyme_digest(split_at = nil) ⇒ Object Also known as: digest

#

restriction_enzyme_digest

This method allows us to simulate a restriction digest, on a DNA polymer.

You can either give the matching DNA nucleotides or you can use the name of a restriction enzyme instead, such as ‘EcoRI’.

Usage examples:

random 750; digest_at TTGC
random 750; digest_at EcoRI
random 2000; [33,0] = GAATTC; digest_at EcoRI
#


9431
9432
9433
9434
9435
9436
9437
9438
9439
9440
9441
9442
9443
9444
9445
9446
9447
9448
9449
9450
9451
9452
9453
9454
9455
9456
9457
9458
9459
9460
9461
9462
9463
9464
9465
9466
9467
9468
9469
9470
9471
9472
9473
9474
9475
9476
9477
9478
9479
9480
9481
9482
9483
9484
9485
9486
9487
9488
9489
9490
# File 'lib/bioroebe/shell/shell.rb', line 9431

def restriction_enzyme_digest(
    split_at = nil # Default value is nil.
  )
  _ = dna_sequence? # Keep a copy of the DNA sequence.
  # ======================================================================= #
  # === Grab the first entry if we have an Array
  # ======================================================================= #
  split_at = split_at.first if split_at.is_a? Array
  split_at = 'TTG' if split_at.nil?
  split_at = split_at.to_s # Work on Strings past this point here.
  split_at.sub!(/^first_/,'') if split_at.include? 'first_ATG'
  # ======================================================================= #
  # === Chop off all '?' in the sequence
  # ======================================================================= #
  split_at.delete!('?') if split_at.include? '?'
  # ======================================================================= #
  # Next, allow the user to substitute for names of restriction enzymes.
  # How do we determine that a restriction enzyme was given to this
  # method? Simple - we first remove all instances of 'A','T','C','G'
  # in our DNA sequence string. If the string is then still not empty,
  # we will assume that it is the name of a restriction enzyme.
  # ======================================================================= #
  unless (_.delete('ATGC').size > 0)
    erev 'Assumingly a restriction enzyme was given as input.'
    target_sequence = ::Bioroebe.restriction_enzyme(split_at)
    # Must check for nil values still
    if target_sequence
      erev "Substituting with `#{simp(target_sequence)}#{rev}` next (for #{split_at})."
      split_at = target_sequence
    else
      erev 'No substitute could be found for `'+sfancy(split_at)+rev+'`.'
    end
  end
  if _.include? split_at
    splitted = _.split(split_at)
    e
    erev 'We will next display all '+simp(splitted.size.to_s)+rev+
         ' segments that were found (in orange is the part that '\
         'is cut-out):'
    e
    splitted.each_with_index {|sequence, index|
      index += 1
      erev lpad?+lead_five_prime+sfancy(sequence)+rev+
           trail_three_prime+' (size: '+
           violet(sequence.size.to_s)+rev+')'
      unless index > (splitted.size-1)
        erev lpad?+lead_five_prime+orange(split_at)+rev+
          trail_three_prime+rev
      end
    }
    e
    erev 'Note that this will NOT be the actual DNA fragments, '\
         'because the restriction'
    erev 'enzyme may cut differentially within that orange sequence.'
  else # The target sequence was not included in this case.
    erev "No target match for `"\
         "#{simp(target_sequence)}#{rev}` was "\
         "found in the given DNA sequence."
  end
end

#restriction_enzymes_runObject

#

restriction_enzymes_run

#


4337
4338
4339
4340
# File 'lib/bioroebe/shell/shell.rb', line 4337

def restriction_enzymes_run
  require 'bioroebe/gui/gtk2/restriction_enzymes/restriction_enzymes.rb'
  ::Bioroebe::GUI::Gtk::RestrictionEnzymes.start_gui_application
end

#result?Boolean

#

result?

#

Returns:

  • (Boolean)


813
814
815
# File 'lib/bioroebe/shell/shell.rb', line 813

def result?
  @internal_hash[:result]
end

#return_a_random_sequence_of_n_nucleotides(i = 250) ⇒ Object

#

return_a_random_sequence_of_n_nucleotides

#


2662
2663
2664
2665
2666
2667
2668
2669
2670
# File 'lib/bioroebe/shell/shell.rb', line 2662

def return_a_random_sequence_of_n_nucleotides(
    i = 250
  )
  _ = ''.dup
  i.times {
    _ << return_random_nucleotide
  }
  return _
end

#return_all_genesObject

#

return_all_genes

#


8897
8898
8899
8900
8901
8902
8903
8904
8905
8906
8907
8908
8909
8910
# File 'lib/bioroebe/shell/shell.rb', line 8897

def return_all_genes
  _ = dna_sequence?
  result = _.to_enum(:scan, /(ATG|AUG)/i).map { |match|
    $`.size + 1 # +1 because we refer to the nucleotide positions.
  }
  e
  result.each_with_index {|nucleotide_position, index|
    erev simp(index+1).to_s+rev+') DNA sequence:'
    e
    sequence = _[nucleotide_position-1 .. -1]
    erev dna_with_ends(sequence, ::Bioroebe.start_codon?, 1)
    e
  }
end

#return_available_vectorsObject

#

return_available_vectors

#


3060
3061
3062
# File 'lib/bioroebe/shell/shell.rb', line 3060

def return_available_vectors
  Dir["#{::Bioroebe.log_dir?}vector_*"]
end

#return_complement(i = dna_sequence? ) ⇒ Object Also known as: complement, complement_sequence?, reverse

#

return_complement

This method is aliased to complement() as well (def complement).

It will return the complement sequence to a given DNA/RNA sequence.

#


3040
3041
3042
3043
3044
# File 'lib/bioroebe/shell/shell.rb', line 3040

def return_complement(
    i = dna_sequence?
  )
  return ::Bioroebe::NucleotideModule.complementary_strand(i)
end

#return_default_GFP_sequence(path_to_the_file = FILE_GFP_SEQUENCE) ⇒ Object

#

return_default_GFP_sequence

#


2959
2960
2961
2962
2963
# File 'lib/bioroebe/shell/shell.rb', line 2959

def return_default_GFP_sequence(
    path_to_the_file = FILE_GFP_SEQUENCE
  )
  Fasta.new(path_to_the_file) { :be_quiet }.return_sequence
end

#return_dna_nucleotidesObject

#

return_dna_nucleotides

This method will return the Array holding A, T, C and G (the four DNA nucleotides).

#


7553
7554
7555
# File 'lib/bioroebe/shell/shell.rb', line 7553

def return_dna_nucleotides
  %w( A T C G )
end

#return_dna_sequence_as_sequence_objectObject Also known as: main_sequence?, dna_sequence_object?, sequence_object?, sequence?, seq_object?, sequence, seq_obj?, last_nucleotide_sequence?

#

return_dna_sequence_as_sequence_object

This method will always return the main “sequence object” in question, which is (almost always) a DNA sequence (dsDNA).

#


830
831
832
# File 'lib/bioroebe/shell/shell.rb', line 830

def return_dna_sequence_as_sequence_object
  @internal_hash[:array_dna_sequences].last
end

#return_fasta_files_in_the_log_directoryObject

#

return_fasta_files_in_the_log_directory

#


7574
7575
7576
# File 'lib/bioroebe/shell/shell.rb', line 7574

def return_fasta_files_in_the_log_directory
  Dir[::Bioroebe.log_dir?+'*.fa*']
end

#return_pwdObject Also known as: return_default_prompt

#

return_pwd

#


5108
5109
5110
# File 'lib/bioroebe/shell/shell.rb', line 5108

def return_pwd
  ("#{Dir.pwd}/").squeeze('/')
end

#return_random_aminoacidObject

#

return_random_aminoacid

#


2190
2191
2192
# File 'lib/bioroebe/shell/shell.rb', line 2190

def return_random_aminoacid
  Bioroebe.return_random_aminoacid
end

#return_random_nucleotideObject Also known as: add_nucleotide

#

return_random_nucleotide

Here we return a random nucleotide.

#


995
996
997
# File 'lib/bioroebe/shell/shell.rb', line 995

def return_random_nucleotide
  return Bioroebe.return_random_nucleotide
end

#return_random_restriction_enzyme(be_verbose = false) ⇒ Object

#

return_random_restriction_enzyme

This method will return a random restriction enzyme, such as:

["EgeI", "GGCGCC 3"]
#


9022
9023
9024
9025
9026
9027
9028
9029
9030
# File 'lib/bioroebe/shell/shell.rb', line 9022

def return_random_restriction_enzyme(be_verbose = false)
  splitted = ::Bioroebe.restriction_enzymes.sample
  _ = splitted[1].split(' ')[0]
  if be_verbose
    erev 'Now adding restriction site `'+red(splitted[0])+
         '` (cuts at '+simp(_)+').'
  end
  return _
end

#return_reverse_dna_stringObject

#

return_reverse_dna_string

#


5914
5915
5916
# File 'lib/bioroebe/shell/shell.rb', line 5914

def return_reverse_dna_string
  complement_sequence?.reverse
end

#return_sequence_from_this_number(i = 1) ⇒ Object

#

return_sequence_from_this_number

#


2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
# File 'lib/bioroebe/shell/shell.rb', line 2707

def return_sequence_from_this_number(i = 1)
  case i.to_i
  when 1
    seq1?
  when 2
    seq2?
  when 3
    seq3?
  when 4
    seq4?
  when 5
    seq5?
  when 6
    seq6?
  end
end

#reverse_complement(i = sequence? ) ⇒ Object

#

reverse_complement (reverse complement tag)

Reverse-Complement a given sequence at hand. In other words, if given a sequence of DNA or RNA, we will first build the complement to that DNA sequence, and then reverse that complement.

In the shell interface, you can test this like so:

assign AAATTT; reverse_complement
#


6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
# File 'lib/bioroebe/shell/shell.rb', line 6836

def reverse_complement(
    i = sequence?
  )
  i = sequence? if i.nil?
  if i.nil?
    report_that_a_string_must_be_assigned_first
    erev 'Example:'
    e
    e simp('  assign TTATTA')
    e
  else
    result = padding?+leading_five_prime+
             sfancy(
               return_complement(i.reverse)
             )+rev+
             trailing_three_prime
    result << ' ('+orange(i.size)+rev+' nucleotides)'
    erev result
  end
end

#runObject

#

run

#


11505
11506
11507
11508
11509
11510
11511
11512
11513
11514
11515
11516
11517
11518
11519
11520
11521
11522
11523
11524
11525
11526
11527
11528
11529
# File 'lib/bioroebe/shell/shell.rb', line 11505

def run
  # if Bioroebe.is_on_roebe?
  #   # =================================================================== #
  #   # Load up support for FtpParadise, but only on roebe-systems.
  #   # As of Nov 2023 this has been disabled.
  #   # =================================================================== #
  #   begin
  #     require 'ftp_paradise'
  #   rescue LoadError; end
  # end
  setup_readline if use_readline? # This should come before we perform the startup actions.
  perform_startup_actions # Should come before we show the welcome message or call menu().
  show_welcome_message    # The welcome-message should come after the startup actions.
  menu(
    commandline_arguments?,
    :be_quiet_if_the_input_was_not_found
  )
  if runmode_is_commandline?
    # ===================================================================== #
    # Enter the main user-input loop here if we are working in
    # commandline-mode.
    # ===================================================================== #
    enter_the_main_loop
  end
end

#run_in_GUI_mode?Boolean Also known as: run_as_GUI?, run_in_GUI_settings?, run_in_GUI_setting?

#

run_in_GUI_mode?

#

Returns:

  • (Boolean)


10121
10122
10123
# File 'lib/bioroebe/shell/shell.rb', line 10121

def run_in_GUI_mode?
  runmode? == :GUI
end

#run_nls_searchObject

#

Search the sequence for NLS.

#


4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
# File 'lib/bioroebe/shell/shell.rb', line 4614

def run_nls_search
  if aminoacids?
    erev 'We will try to run a NLS search on '+simp(aminoacids?.to_s)+':'
    e
    erev "  #{sfancy(aminoacids?.to_s)}"
    e
    ARRAY_NLS_SEQUENCES.each {|sequence|
      if aminoacids?.include? sequence
        erev 'We found a result for -> '+swarn(sequence)
      else
        e sfancy(sequence)+' <- This NLS is not included.'
      end
    }
  else
    erev 'Please first assign an '+sfancy('aminoacid sequence')+
         ' such as by doing:'
    e
    erev '  set_aminoacids '+
         ::Bioroebe.colourize_aa('PAAKRVKLKKKKKKKKKRKKKPPKLKVKVKLKLKAA')
    e
  end
end

#run_sizeseqObject

#

run_sizeseq

This method essentially does what the Emboss sizeseq is doing.

#


8427
8428
8429
# File 'lib/bioroebe/shell/shell.rb', line 8427

def run_sizeseq
  last_fasta_entry?.do_sort_by_size
end

#run_sql_query(i, be_verbose = true, optional_append_this = '') ⇒ Object Also known as: sql_query, run_query, run_sql

#

run_sql_query

#


7101
7102
7103
7104
7105
7106
7107
# File 'lib/bioroebe/shell/shell.rb', line 7101

def run_sql_query(
    i,
    be_verbose           = true,
    optional_append_this = ''
  )
  ::Bioroebe.run_sql_query(i, be_verbose, optional_append_this)
end

#run_this_user_inputObject

#

menu (menu tag)

#

run_this_user_input()



5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
8533
8534
8535
8536
8537
8538
8539
8540
8541
8542
8543
8544
8545
8546
8547
8548
8549
8550
8551
8552
8553
8554
8555
8556
8557
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589
8590
8591
8592
8593
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
8604
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633
8634
8635
8636
8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
8648
8649
8650
8651
8652
8653
8654
8655
8656
8657
8658
8659
8660
8661
8662
8663
8664
8665
8666
8667
8668
8669
8670
8671
8672
8673
8674
8675
8676
8677
8678
8679
8680
8681
8682
8683
8684
8685
8686
8687
8688
8689
8690
8691
8692
8693
8694
8695
8696
8697
8698
8699
8700
8701
8702
8703
8704
8705
8706
8707
8708
8709
8710
8711
8712
8713
8714
8715
8716
8717
8718
8719
8720
8721
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
8732
8733
8734
8735
8736
8737
8738
8739
8740
8741
8742
8743
8744
8745
8746
8747
8748
8749
8750
8751
8752
8753
8754
8755
8756
8757
8758
8759
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
8779
8780
8781
8782
8783
8784
8785
8786
8787
8788
8789
8790
8791
8792
8793
8794
8795
8796
8797
8798
8799
8800
8801
8802
8803
8804
8805
8806
8807
8808
8809
8810
8811
8812
8813
8814
8815
8816
8817
8818
8819
8820
8821
8822
8823
8824
8825
8826
8827
8828
8829
8830
8831
8832
8833
8834
8835
8836
8837
8838
8839
8840
8841
8842
8843
8844
8845
8846
8847
8848
8849
8850
8851
8852
8853
8854
8855
8856
8857
8858
8859
8860
8861
8862
8863
8864
8865
8866
8867
8868
8869
8870
8871
8872
8873
8874
8875
8876
8877
8878
8879
8880
8881
8882
8883
8884
8885
8886
8887
8888
8889
8890
8891
8892
8893
8894
8895
8896
8897
8898
8899
8900
8901
8902
8903
8904
8905
8906
8907
8908
8909
8910
8911
8912
8913
8914
8915
8916
8917
8918
8919
8920
8921
8922
8923
8924
8925
8926
8927
8928
8929
8930
8931
8932
8933
8934
8935
8936
8937
8938
8939
8940
8941
8942
8943
8944
8945
8946
8947
8948
8949
8950
8951
8952
8953
8954
8955
8956
8957
8958
8959
8960
8961
8962
8963
8964
8965
8966
8967
8968
8969
8970
8971
8972
8973
8974
8975
8976
8977
8978
8979
8980
8981
8982
8983
8984
8985
8986
8987
8988
8989
8990
8991
8992
8993
8994
8995
8996
8997
8998
8999
9000
9001
9002
9003
9004
9005
9006
9007
9008
9009
9010
9011
9012
9013
9014
9015
9016
9017
9018
9019
9020
9021
9022
9023
9024
9025
9026
9027
9028
9029
9030
9031
9032
9033
9034
9035
9036
9037
9038
9039
9040
9041
9042
9043
9044
9045
9046
9047
9048
9049
9050
9051
9052
9053
9054
9055
9056
9057
9058
9059
9060
9061
9062
9063
9064
9065
9066
9067
9068
9069
9070
9071
9072
9073
9074
9075
9076
9077
9078
9079
9080
9081
9082
9083
9084
9085
9086
9087
9088
9089
9090
9091
9092
9093
9094
9095
9096
9097
9098
9099
9100
9101
9102
9103
9104
9105
9106
9107
9108
9109
9110
9111
9112
9113
9114
9115
9116
9117
9118
9119
9120
9121
9122
9123
9124
9125
9126
9127
9128
9129
9130
9131
9132
9133
9134
9135
9136
9137
9138
9139
9140
9141
9142
9143
9144
9145
9146
9147
9148
9149
9150
9151
9152
9153
9154
9155
9156
9157
9158
9159
9160
9161
9162
9163
9164
9165
9166
9167
9168
9169
9170
9171
9172
9173
9174
9175
9176
9177
9178
9179
9180
9181
9182
9183
9184
9185
9186
9187
9188
9189
9190
9191
9192
9193
9194
9195
9196
9197
9198
9199
9200
9201
9202
9203
9204
9205
9206
9207
9208
9209
9210
9211
9212
9213
9214
9215
9216
9217
9218
9219
9220
9221
9222
9223
9224
9225
9226
9227
9228
9229
9230
9231
9232
9233
9234
9235
9236
9237
9238
9239
9240
9241
9242
9243
9244
9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9299
9300
9301
9302
9303
9304
9305
9306
9307
9308
9309
9310
9311
9312
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
9346
9347
9348
9349
9350
9351
9352
9353
9354
9355
9356
9357
9358
9359
9360
9361
9362
9363
9364
9365
9366
9367
9368
9369
9370
9371
9372
9373
9374
9375
9376
9377
9378
9379
9380
9381
9382
9383
9384
9385
9386
9387
9388
9389
9390
9391
9392
9393
9394
9395
9396
9397
9398
9399
9400
9401
9402
9403
9404
9405
9406
9407
9408
9409
9410
9411
9412
9413
9414
9415
9416
9417
9418
9419
9420
9421
9422
9423
9424
9425
9426
9427
9428
9429
9430
9431
9432
9433
9434
9435
9436
9437
9438
9439
9440
9441
9442
9443
9444
9445
9446
9447
9448
9449
9450
9451
9452
9453
9454
9455
9456
9457
9458
9459
9460
9461
9462
9463
9464
9465
9466
9467
9468
9469
9470
9471
9472
9473
9474
9475
9476
9477
9478
9479
9480
9481
9482
9483
9484
9485
9486
9487
9488
9489
9490
9491
9492
9493
9494
9495
9496
9497
9498
9499
9500
9501
9502
9503
9504
9505
9506
9507
9508
9509
9510
9511
9512
9513
9514
9515
9516
9517
9518
9519
9520
9521
9522
9523
9524
9525
9526
9527
9528
9529
9530
9531
9532
9533
9534
9535
9536
9537
9538
9539
9540
9541
9542
9543
9544
9545
9546
9547
9548
9549
9550
9551
9552
9553
9554
9555
9556
9557
9558
9559
9560
9561
9562
9563
9564
9565
9566
9567
9568
9569
9570
9571
9572
9573
9574
9575
9576
9577
9578
9579
9580
9581
9582
9583
9584
9585
9586
9587
9588
9589
9590
9591
9592
9593
9594
9595
9596
9597
9598
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
9614
9615
9616
9617
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
9628
9629
9630
9631
9632
9633
9634
9635
9636
9637
9638
9639
9640
9641
9642
9643
9644
9645
9646
9647
9648
9649
9650
9651
9652
9653
9654
9655
9656
9657
9658
9659
9660
9661
9662
9663
9664
9665
9666
9667
9668
9669
9670
9671
9672
9673
9674
9675
9676
9677
9678
9679
9680
9681
9682
9683
9684
9685
9686
9687
9688
9689
9690
9691
9692
9693
9694
9695
9696
9697
9698
9699
9700
9701
9702
9703
9704
9705
9706
9707
9708
9709
9710
9711
9712
9713
9714
9715
9716
9717
9718
9719
9720
9721
9722
9723
9724
9725
9726
9727
9728
9729
9730
9731
9732
9733
9734
9735
9736
9737
9738
9739
9740
9741
9742
9743
9744
9745
9746
9747
9748
9749
9750
9751
9752
9753
9754
9755
9756
9757
9758
9759
9760
9761
9762
9763
9764
9765
9766
9767
9768
9769
9770
9771
9772
9773
9774
9775
9776
9777
9778
9779
9780
9781
9782
9783
9784
9785
9786
9787
9788
9789
9790
9791
9792
9793
9794
9795
9796
9797
9798
9799
9800
9801
9802
9803
9804
9805
9806
9807
9808
9809
9810
9811
9812
9813
9814
9815
9816
9817
9818
9819
9820
9821
9822
9823
9824
9825
9826
9827
9828
9829
9830
9831
9832
9833
9834
9835
9836
9837
9838
9839
9840
9841
9842
9843
9844
9845
9846
9847
9848
9849
9850
9851
9852
9853
9854
9855
9856
9857
9858
9859
9860
9861
9862
9863
9864
9865
9866
9867
9868
9869
9870
9871
9872
9873
9874
9875
9876
9877
9878
9879
9880
9881
9882
9883
9884
9885
9886
9887
9888
9889
9890
9891
9892
9893
9894
9895
9896
9897
9898
9899
9900
9901
9902
9903
9904
9905
9906
9907
9908
9909
9910
9911
9912
9913
9914
9915
9916
9917
9918
9919
9920
9921
9922
9923
9924
9925
9926
9927
9928
9929
9930
9931
9932
9933
9934
9935
9936
9937
9938
9939
9940
9941
9942
9943
9944
9945
9946
9947
9948
9949
9950
9951
9952
9953
9954
9955
9956
9957
9958
9959
9960
9961
9962
9963
9964
9965
9966
9967
9968
9969
9970
9971
9972
9973
9974
9975
9976
9977
9978
9979
9980
9981
9982
9983
9984
9985
9986
9987
9988
9989
9990
9991
9992
9993
9994
9995
9996
9997
9998
9999
10000
10001
10002
10003
10004
10005
10006
10007
10008
10009
10010
10011
10012
10013
10014
10015
10016
10017
10018
10019
10020
10021
10022
10023
10024
10025
10026
10027
10028
10029
10030
10031
10032
10033
10034
10035
10036
10037
10038
10039
10040
10041
10042
10043
10044
10045
10046
10047
10048
10049
10050
10051
10052
10053
10054
10055
10056
10057
10058
10059
10060
10061
10062
10063
10064
10065
10066
10067
10068
10069
10070
10071
10072
10073
10074
10075
10076
10077
10078
10079
10080
10081
10082
10083
10084
10085
10086
10087
10088
10089
10090
10091
10092
10093
10094
10095
10096
10097
10098
10099
10100
10101
10102
10103
10104
10105
10106
10107
10108
10109
10110
10111
10112
10113
10114
10115
10116
10117
10118
10119
10120
10121
10122
10123
10124
10125
10126
10127
10128
10129
10130
10131
10132
10133
10134
10135
10136
10137
10138
10139
10140
10141
10142
10143
10144
10145
10146
10147
10148
10149
10150
10151
10152
10153
10154
10155
10156
10157
10158
10159
10160
10161
10162
10163
10164
10165
10166
10167
10168
10169
10170
10171
10172
10173
10174
10175
10176
10177
10178
10179
10180
10181
10182
10183
10184
10185
10186
10187
10188
10189
10190
10191
10192
10193
10194
10195
10196
10197
10198
10199
10200
10201
10202
10203
10204
10205
10206
10207
10208
10209
10210
10211
10212
10213
10214
10215
10216
10217
10218
10219
10220
10221
10222
10223
10224
10225
10226
10227
10228
10229
10230
10231
10232
10233
10234
10235
10236
10237
10238
10239
10240
10241
10242
10243
10244
10245
10246
10247
10248
10249
10250
10251
10252
10253
10254
10255
10256
10257
10258
10259
10260
10261
10262
10263
10264
10265
10266
10267
10268
10269
10270
10271
10272
10273
10274
10275
10276
10277
10278
10279
10280
10281
10282
10283
10284
10285
10286
10287
10288
10289
10290
10291
10292
10293
10294
10295
10296
10297
10298
10299
10300
10301
10302
10303
10304
10305
10306
10307
10308
10309
10310
10311
10312
10313
10314
10315
10316
10317
10318
10319
10320
10321
10322
10323
10324
10325
10326
10327
10328
10329
10330
10331
10332
10333
10334
10335
10336
10337
10338
10339
10340
10341
10342
10343
10344
10345
10346
10347
10348
10349
10350
10351
10352
10353
10354
10355
10356
10357
10358
10359
10360
10361
10362
10363
10364
10365
10366
10367
10368
10369
10370
10371
10372
10373
10374
10375
10376
10377
10378
10379
10380
10381
10382
10383
10384
10385
10386
10387
10388
10389
10390
10391
10392
10393
10394
10395
10396
10397
10398
10399
10400
10401
10402
10403
10404
10405
10406
10407
10408
10409
10410
10411
10412
10413
10414
10415
10416
10417
10418
10419
10420
10421
10422
10423
10424
10425
10426
10427
10428
10429
10430
10431
10432
10433
10434
10435
10436
10437
10438
10439
10440
10441
10442
10443
10444
10445
10446
10447
10448
10449
10450
10451
10452
10453
10454
10455
10456
10457
10458
10459
10460
10461
10462
10463
10464
10465
10466
10467
10468
10469
10470
10471
10472
10473
10474
10475
10476
10477
10478
10479
10480
10481
10482
10483
10484
10485
10486
10487
10488
10489
10490
10491
10492
10493
10494
10495
10496
10497
10498
10499
10500
10501
10502
10503
10504
10505
10506
10507
10508
10509
10510
10511
10512
10513
10514
10515
10516
10517
10518
10519
10520
10521
10522
10523
10524
10525
10526
10527
10528
10529
10530
10531
10532
10533
10534
10535
10536
10537
10538
10539
10540
10541
10542
10543
10544
10545
10546
10547
10548
10549
10550
10551
10552
10553
10554
10555
10556
10557
10558
10559
10560
10561
10562
10563
10564
10565
10566
10567
10568
10569
10570
10571
10572
10573
10574
10575
10576
10577
10578
10579
10580
10581
10582
10583
10584
10585
10586
10587
10588
10589
10590
10591
10592
10593
10594
10595
10596
10597
10598
10599
10600
10601
10602
10603
10604
10605
10606
10607
10608
10609
10610
10611
10612
10613
10614
10615
10616
10617
10618
10619
10620
10621
10622
10623
10624
10625
10626
10627
10628
10629
10630
10631
10632
10633
10634
10635
10636
10637
10638
10639
10640
10641
10642
10643
10644
10645
10646
10647
10648
10649
10650
10651
10652
10653
10654
10655
10656
10657
10658
10659
10660
10661
10662
10663
10664
10665
10666
10667
10668
10669
10670
10671
10672
10673
10674
10675
10676
10677
10678
10679
10680
10681
10682
10683
10684
10685
10686
10687
10688
10689
10690
10691
10692
10693
10694
10695
10696
10697
10698
10699
10700
10701
10702
# File 'lib/bioroebe/shell/menu.rb', line 5359

def menu(
    i                                     = command_to_be_passed_to_the_menu?,
    report_if_we_did_not_find_the_command = true
  )
  # ======================================================================= #
  # === Handle special instructions given to the second arguments
  # ======================================================================= #
  case report_if_we_did_not_find_the_command
  # ======================================================================= #
  # === :dont_report
  # ======================================================================= #
  when :dont_report,
       :be_quiet,
       :be_quiet_if_the_input_was_not_found
    report_if_we_did_not_find_the_command = false
  end
  if i.is_a?(Array) and !i.empty?
    i.flatten.each {|entry|
      menu(entry, report_if_we_did_not_find_the_command)
    }
  else
    i = i.to_s.strip
    case i # (case tag, casetag, realcase tag)
    # ===================================================================== #
    # === bioroebe --sinatra
    #
    # This entry point starts the sinatra web-interface.
    # ===================================================================== #
    when /^-?-?sinatra2$/i,
         /^-?-?start(_|-| )?sinatra2$/i,
         /^-?-?sinatra$/i
      do_start_the_sinatra_interface
    # ===================================================================== #
    # === mkdir
    # ===================================================================== #
    when /^mkdir$/
      mkdir(f?)
    # ===================================================================== #
    # === no_colours
    # ===================================================================== #
    when 'nocol',
         'noco',
         /^-?-?no(_|-| )?colou?rs?$/,
         /^-?-?disable(_|-| )?colours$/,
         'dcolours'
      disable_colours
    # ===================================================================== #
    # === disable_colours_in_an_extended_manner
    # ===================================================================== #
    when /disable(_|-| )?colours(_|-| )?in(_|-| )?an(_|-| )?extended(_|-| )?manner$/
      disable_colours_in_an_extended_manner(:be_verbose)
    # ===================================================================== #
    # === uniprot
    #
    # This entry point allows the user to download data from uniprot
    # quickly, via the bioshell interface.
    #
    # Invocation examples:
    #
    #   uniprot 2BTS
    #   uniprot A2Z669
    #
    # ===================================================================== #
    when /^uniprot(_|-| )?fetch$/,
         /^uniprot$/i,
         /^unifetch$/i,
         /^fetch(_|-| )?data(_|-| )?from(_|-| )?uniprot$/
      result = uniprot_fetch(f)
      set_result(result)
    # ===================================================================== #
    # === dna_seq?
    # ===================================================================== #
    when 'dna_seq?',
         'dnaseq?',
         'seq?',
         'seqß',
         'dna?',
         'sequence?',
         'string?',
         'sq?',
         'data?',
         's?',
         'show2',
         'show?',
         'report?',
         'print',
         'output',
         /^show(_|-| )?string$/i,
         /^print(_|-| )?dna$/i,
         /^show(_|-| )?dna$/i,
         /^main(_|-| )?string$/i,
         /^show(_|-| )?dna(_|-| )?sequence$/i,
         /^showsequence$/i,
         /^showseq$/i,
         /^dna(_|-| )?string\??$/i,
         'mainstring?',
         'mstring?',
         'dnaß',
         'sdna',
         'normal',
         'DNA?'
      show_dna_sequence
    # ===================================================================== #
    # === Bioroebe.sequence
    # ===================================================================== #
    when 'Bioroebe.sequence?',
         'Bioroebe.seq?'
      e Bioroebe.sequence?
    # ===================================================================== #
    # === dna_sequence?
    # ===================================================================== #
    when /^dna_?sequence\?$/
      pp dna_sequence?
    # ===================================================================== #
    # === fasta?
    # ===================================================================== #
    when 'fasta?',
         /handle_?fasta/ # Feedback information from a local fasta file.
      handle_fasta(a?)
    # ===================================================================== #
    # === chop_to
    #
    # Usage example:
    #
    #   chop_to :ATG
    #
    # ===================================================================== #
    when /^chop_?to$/
      chop_to(a?)
    # ===================================================================== #
    # === chop
    # ===================================================================== #
    when 'chop'
      chop(a?)
    # ===================================================================== #
    # === choppity
    # ===================================================================== #
    when 'choppity',/chop_?codon/
      chop(3)
    # ===================================================================== #
    # === chop33
    # ===================================================================== #
    when /chop(\d+)/ # See: http://rubular.com/r/VWiUYgr5Xq
      chop($1.to_s)
    # ===================================================================== #
    # === default_colours_for_the_aminoacids
    # ===================================================================== #
    when /default(_|-| )?colours(_|-| )?for(_|-| )?the(_|-| )?aminoacids/
      e
      config?.default_colours_for_the_aminoacids.each_pair {|one_letter, colour_to_use|
        e '  '+one_letter+' '+
          ::Colours.send(colour_to_use.to_sym, colour_to_use)+
          rev
      }
      e
    # ===================================================================== #
    # === bioshell_log_dir?
    # ===================================================================== #
    when /bioshell(_|-| )?log(_|-| )?dir\??/i
      e
      e steelblue("  #{log_dir?}bioshell/")
      e
    # ===================================================================== #
    # === dna_to_aminoacids
    #
    # Usage example:
    #
    #   toAA ACGTACGTAGTCATCAGTCAGTA
    #
    # ===================================================================== #
    when /^dna_?to_?aminoacids$/,
         'translate_dna_into_aminoacid',
         'translatednaintoaminoacid',
         'trans',
         'transl',
         'trnas',
         'translateaminoacidintodna',
         'toprotein',
         'to_protein',
         'to_aminoacid',
         'to_aminoacids',
         'aa',
         'toproteins',
         'toaminoacids',
         /to(_|-| )?aa/i,
         'translate',
         'mega',
         'toprotei',
         'translate_aminoacids',
         'toprot',
         'toamin',
         'toamino'
      arguments = a?
      if arguments and arguments.is_a?(Array) and arguments.empty?
        arguments = dna_sequence_as_string?
      end
      show_all_deducible_aminoacid_sequences(arguments)
      if dna_seq?.empty? # This here is ok because the above method checks whether there was a DNA sequence assigned.
        return
      else
        e
        show_protein_composition(
          translate_dna_into_aminoacid(arguments)
        )
        if arguments.empty?
          arguments = dna_sequence?.dup unless a
        end
        ::Bioroebe::DnaToAminoacidSequence.new(arguments)
      end
    # ===================================================================== #
    # === set_dna_sequence
    #
    # Usage examples:
    #
    #   set_sequence /Depot/j/foobar.fasta
    #   set_sequence ACGTACGTACA
    #   set_sequence 555
    #
    # ===================================================================== #
    when 'set_dna_sequence',
         'setdnasequence',
         'setdna',
         'assign',
         'set_dna',
         'assign_sequence',
         'sequence',
         'seq',
         's',
         'asign',
         'set_seq',
         'setseq',
         'assing',
         'set',
         'assig',
         'set_string',
         'setstring',
         'ass',
         'setseq1',
         'setda',
         'read',
         /^assign(_|-| )?dna$/,
         /^assign(_|-| )?this(_|-| )?dna(_|-| )?sequence$/,
         /^set(_|-| )?sequence$/
      set_dna_sequence(a?, :be_verbose) # Always be verbose.
      show_sequence
    # ===================================================================== #
    # === to_mRNA
    # ===================================================================== #
    when /^to(_|-| )?mRNA$/i,
         'mrna',
         /convert_five_prime_dna_into_five_prime_mrna/i
      convert_five_prime_dna_into_five_prime_mrna
    # ===================================================================== #
    # === random
    # ===================================================================== #
    when 'random',
         'rand',
         'ran',
         'ra',
         'random?',
         'rand?',
         'generate',
         'randomseq',
         'ramdpm',
         'setrandom',
         'andom',
         'rando',
         'raond',
         'rnadom',
         'ranom',
         'ranomd',
         'create'
      random(f, remaining_arguments?) # Generate some DNA sequence.
      show_dna_sequence
    # ===================================================================== #
    # === random_dna
    # ===================================================================== #
    when 'random_dna',
         'generate_dna3','generate_dna_variable_composition',
         'generate_random_dna_sequence_with_variable_length_and_variable_composition',
         'generatedna3',
         'generatednavariablecomposition',
         'gdna3',
         'randomdna'
      result = generate_random_dna_sequence_with_variable_length_and_variable_composition
      e result # Display it.
      assign_sequence(result) # And assign it too.
    # ===================================================================== #
    # === is_a_aminoacid?
    #
    # To test this entry point, try:
    #
    #   is_a_aminoacid? Alanin  # => false
    #   is_a_aminoacid? Alanine # => true
    #
    # ===================================================================== #
    when 'is_a_aminoacid?','isaa?'
      pp ::Bioroebe.is_aminoacid?(f?)
    # ===================================================================== #
    # === piped
    # ===================================================================== #
    when 'piped',
         /^show_?codon_?piped_?sequence$/i,
         /^vertical(_|-| )?bar$/i,
         'as_pipe',
         /^codon(_|-| )?piped$/i
      show_codon_piped_sequence
    # ===================================================================== #
    # === pubmed_search
    #
    # Invocation example:
    #
    #   pubmed_search science[journal]+AND+breast+cancer+AND+2008[pdat]
    #
    # ===================================================================== #
    when /^pubmed(_|-| )?search/
      perform_a_pubmed_search(all_arguments?)
    # ===================================================================== #
    # === nohyphen
    #
    # This entry point removes all hyphens.
    #
    # Example:
    #
    #   nohyphen GCA-GCA-AGA-GGA-CTA-AAA-AAA-AAA-CTA-AAA-CTA-ATG-ATG-GCA-GCA-GCA-GCA-GCA
    #
    # ===================================================================== #
    when /nohyphen/
      erev a.join.delete('-')
    # ===================================================================== #
    # === random_aa
    # ===================================================================== #
    when 'random_aa',
         'randomaa',
         'set_random_aminoacids',
         'randomAA',
         'random_aminacids',
         'create_random_aminoacids',
         'random_aminoacids',
         'randomaminoacids'
      set_random_aminoacids
    # ===================================================================== #
    # === all_aminoacids?
    # ===================================================================== #
    when 'all_aminoacids?','display_all_aminoacids','displayallaminoacids',
         'shortnames?',
         'print_aa',
         'printaa',
         'daminoacids',
         'aminoacids_shortnames'
      display_all_aminoacids
    # ===================================================================== #
    # === report_n_start_codons
    #
    # This entry point will report how many start codons can be found
    # in the main Sequence.
    #
    # Invocation example:
    #
    #   report_n_start_codons
    #
    # ===================================================================== #
    when /^report(_|-| )?n(_|-| )?start(_|-| )?codons$/i
      report_n_start_codons
    # ===================================================================== #
    # === palindromes?
    # ===================================================================== #
    when 'palindromes?',
         'PalindromeFinder',
         'pali',
         'palindrome?',
         'pfinder',
         'palindromes'
      ::Bioroebe::PalindromeFinder.new(dna_string?)
    # ===================================================================== #
    # === is_palindrome?
    #
    # Usage examples:
    #
    #   is_palindrome? ATTA
    #   is_palindrome? ATAT
    #
    # ===================================================================== #
    when 'is_palindrome?',
         'ispalindrome?',
         'is_palindrome',
         'is_palindromic?',
         'is_pal?',
         'palindromic?',
         'palinomer?'
      is_palindrome?(f)
    # ===================================================================== #
    # === append
    # ===================================================================== #
    when 'append','<<','merge'
      append(a?) # Call it directly.
    # ===================================================================== #
    # === clear
    # ===================================================================== #
    when 'clear'
      clear(a?)
    # ===================================================================== #
    # === print_aa_table
    # ===================================================================== #
    when 'table_aa','tableaa','print_aa_table','printaatable',
         'molmassen','supertable','table?','maintable',
         'amino_acid_weight','aatable',
         'print_aminoacid_table',
         'patable',
         /^Aminoacids(_|-| )?Mass(_|-| )?Table$/i,
         /^aminoacids(_|-| )?weights\??$/i,
         /^aas(_|-| )?weights\??$/i
      print_aa_table
    # ===================================================================== #
    # === degenerate_primer
    #
    # Invocation example:
    #
    #   dprimer M-T-T-Y-Y-T-A-A-A-STOP
    #
    # ===================================================================== #
    when /^degenerate(_|-| )?primer$/i,
         'degenerate',
         'dprimer', # dprimer M-T-T-Y-Y-T-A-A-A-STOP
         'dprime',
         'dprim',/back_?to_?dna/
      a = aminoacid_sequence? if a.nil? or a.empty?
      dna_sequence = ConvertAminoacidToDNA.new(a?).dna_sequence?.delete('-') # bl $BIOROEBE/convert_aminoacid_to_dna.rb
      erev swarn('Note')+rev+': If you want to assign this DNA sequence to become the new'
      erev 'main sequence, then input:'
      e
      erev orange('  assign_this_dna_sequence')
      e
      @internal_hash[:misc_sequence] = dna_sequence 
    # ===================================================================== #
    # === show_codon_table
    #
    # This entry point can be used to show the (default) codon table,
    # aka the eukaryotic codon table.
    #
    # Usage examples:
    #
    #   ctable
    #   ctable 4
    #
    # ===================================================================== #
    when /^show(_|-)?codon(_|-)?table$/i,
         'codontable?',
         'codontable',
         'codontable2',
         'codon_table?',
         'ctable',
         'ctble',
         'table2',
         'ctable?',
         'alltables'
      show_codon_table(a?)
    # ===================================================================== #
    # === aa_to_dna
    #
    # Translate the aminoacids to the DNA sequence.
    #
    # Usage examples:
    #
    #   aa_to_dna MTTT
    #   aa_to_dna KLMRST
    #
    # ===================================================================== #
    when /^aa(-|_)?to(-|_)?dna$/i
      aa_to_dna(a?)
    # ===================================================================== #
    # === pubmed?
    # ===================================================================== #
    when 'pub',
         'pubmed',
         'pubmed?' # pubmed tag
      pubmed(f?)
    # ===================================================================== #
    # === open_my_files
    # ===================================================================== #
    when /^open(_|-)?my(_|-)?files$/i,
         /^my(_|-)?files$/i,
         'ofiles'
      open_my_files
    # ===================================================================== #
    # === set_codon_table
    # ===================================================================== #
    when 'set_codon_table',
         'setcodontable',
         'codon_table=',
         'ctable=',
         /^choose(_|-)?codon(_|-)?table$/i,
         'choosecodontable',
         'pick_codon_table',
         'codon_table',
         'setcodon',
         'set_codon'
      set_codon_table(f)
    # ===================================================================== #
    # === left_add
    #
    # This will add n nucleotides to the "left" end, aka the 5' end of
    # a DNA or RNA sequence.
    #
    # Invocation example:
    #
    #   left_add 10
    #   ladd 20
    #
    # ===================================================================== #
    when /left(_|-)?add/,
         'ladd'
      left_add(a?)
    # ===================================================================== #
    # === last_input?
    # ===================================================================== #
    when 'last_input?','input?','show_last_input','sli',
         'showlastinput'
      show_last_input
    # ===================================================================== #
    # === human_chromosome_22
    #
    # The human chromosome number 22.
    # ===================================================================== #
    when 'human_chromosome_22'
      _ = 'http://hgdownload.cse.ucsc.edu/goldenpath/hg19/chromosomes/chr22.fa.gz'
      e _
      download _
    # ===================================================================== #
    # === sendai
    #
    # The Sendai virus genome, a 15384 bp genome.
    # ===================================================================== #
    when 'sendai'
      e 'https://www.ncbi.nlm.nih.gov/nuccore/9627219'
    # ===================================================================== #
    # === set_start_codon
    # ===================================================================== #
    when 'set_start_codon',
         'setstartcodon',
         'start_codon=',
         'setinitcodon'
      set_start_codon(f)
    # ===================================================================== #
    # === ncbi_taxonomy?
    # ===================================================================== #
    when 'ncbi_taxonomy?'
      browse_to 'http://www.ncbi.nlm.nih.gov/taxonomy/'
    # ===================================================================== #
    # === itax
    # ===================================================================== #
    when 'itax','taxonomy',
         'tax'
      ::Bioroebe::Taxonomy.interactive :run_connected
    # ===================================================================== #
    # === show_remote_urls
    # ===================================================================== #
    when /^show(_|-)?remote(_|-)?urls$/i,
         'url',
         'taxonomy_urls?',
         'remote_url',
         'ncbi?',
         'sremote'
      Bioroebe.show_remote_urls_to_the_NCBI_taxonomy_webpage(f)
    # ===================================================================== #
    # === n_species?
    # ===================================================================== #
    when 'n_species?',
         'n_species',
         'nspecies?',
         'nspecies',
         /^report(_|-| )?n(_|-| )?species$/i
      ::Bioroebe::Taxonomy.report_n_species
    # ===================================================================== #
    # === home?
    # ===================================================================== #
    when /^home\??$/i
      report_where_the_home_directory_can_be_found
    # ===================================================================== #
    # === codon
    #
    # This entry point will quickly show the codon (the aminoacid
    # sequence) of the given input sequence.
    #
    # Usage example:
    #
    #   codon AAAGUCCAUAAA
    #
    # ===================================================================== #
    when 'codon'
      codon(a?)
    # ===================================================================== #
    # === to_rna
    # ===================================================================== #
    when '@rna',
         'to_rna',
         /^-?-?to_?RNA$/i,
         'rna',
         'dna2rna', # You can also use this like so: ATCGTTGC.to_rna
         'rna_translate',
         'rnatranslate',
         'rna?',
         'transcribe',
         'rawrna'
      show_rna_sequence(f)
    # ===================================================================== #
    # === automatically_rename_this_fasta_file
    #
    # This entry-point can be used to automatically rename a FASTA file.
    # ===================================================================== #
    when /^-?-?automatically(_|-)?rename(_|-)?this(_|-)?fasta(_|-)?file$/i,
         /^-?-?infer(_|-)?fasta$/i,
         /^-?-?ifasta$/i
      automatically_rename_this_fasta_file(a)
    # ===================================================================== #
    # === show_both_strands
    # ===================================================================== #
    when 'show_both_strands',
         'both','dual',
         'showbothstrands',
         /^-?-?show(_|-)?both(_|-)?dna(_|-)?strands$/i,
         'double',
         'show_double_strand',
         /^dsDNA$/i
      show_both_dna_strands
    # ===================================================================== #
    # === UAG?
    # ===================================================================== #
    when /^UAG\??$/i
      this_sequence = dna_string?
      use_this_start_codon = 'UAG'
      if this_sequence.include? 'U'
      else
        use_this_start_codon = 'TAG'
      end
      _ = search_sequence_for_open_reading_frames(
        this_sequence,
        :frame1, # use_which_frame
        use_this_start_codon
      )
      if _.empty?
        erev 'No substring '+i.to_s.delete('?')+' was found.'
      else
        show_nucleotide_sequence?.display(i) {{ colourize_this_subsequence: use_this_start_codon }}
      end
    # ===================================================================== #
    # === size?
    # ===================================================================== #
    when 'size?',
         'nuc?',
         'size',
         'nsizes',
         'nsize',
         'length?',
         'len?',
         'len',
         'report_length_of_the_dna_string',
         'sizeß',
         'n?'
      report_size_of(f?)
    # ===================================================================== #
    # === find_orfs
    # ===================================================================== #
    when 'find_orfs',
         /^find(_|-)?all(_|-)?orfs$/i,
         'forfs','forf'
      find_all_orfs
    # ===================================================================== #
    # === prepend_start
    # ===================================================================== #
    when 'pstart',
         'prepend_start',
         'appendstart',
         'start'
      add_to_start :start
    # ===================================================================== #
    # === fancy
    # ===================================================================== #
    when 'fancy'
      display_open_reading_frames
    # ===================================================================== #
    # === fetch
    #
    # This entry point allows the user to fetch a (remote) .pdb file.
    #
    # Invocation example:
    #
    #   fetch 2BTS
    #
    # ===================================================================== #
    when /^fetch(_|-)?from(_|-)?pdb$/,
         'fetch'
      fetch_from_pdb(f)
    # ===================================================================== #
    # === reverse_complement
    #
    # This entry point will build the "reverse complement" sequence
    # to a given DNA sequence at hand.
    # ===================================================================== #
    when /^reverse(_|-)?complement$/i,
         /^rev(_|-)?complement$/i,
         'rcomplement',
         'rcompl'
      reverse_complement(f)
    # ===================================================================== #
    # === P00995
    # ===================================================================== #
    when 'P00995'
      oib 'https://www.uniprot.org/uniprot/P00995'
      download_this_fasta_sequence 'https://www.uniprot.org/uniprot/P00995.fasta'
    # ===================================================================== #
    # === brenda
    # ===================================================================== #
    when /^brenda$/i
      open_in_browser('https://www.brenda-enzymes.org/')
    # ===================================================================== #
    # === expasy
    # ===================================================================== #
    when /^expasy$/i
      open_expasy(a?)
    # ===================================================================== #
    # === 9cutters
    # ===================================================================== #
    when '9cutter',
         '9cutters',
         '9-cutters',
         '9cut'
      show_restriction_enzymes '9'
    # ===================================================================== #
    # === code?
    # ===================================================================== #
    when 'code?','code','translate_aminoacids_into_dna'
      translate_aminoacids_into_dna(a?)
    # ===================================================================== #
    # === wormbase?
    # ===================================================================== #
    when 'wormbase?',
         'wormbase'
      e (_ = Bioroebe.try_to_pass_through_beautiful_url(_))
        open_in_browser _
    # ===================================================================== #
    # === promoters?
    # ===================================================================== #
    when /^promoters?\??$/,
         /^search_?for_?known_?promoters$/
      search_for_known_promoters
    # ===================================================================== #
    # === samino
    # ===================================================================== #
    when 't2','translate2','aminoacid??','shorten',
         /shorten_?aminoacid/,'samino',
         'saminoacid'
      shorten_aminoacid(a?)
    # ===================================================================== #
    # === frameshift
    # ===================================================================== #
    when 'frameshift','frame','shift','shifter','shifting',
         'perform_frameshift_action','performframeshiftaction',
         'fr','frame?'
      perform_frameshift_action(a?)
    # ===================================================================== #
    # === GPCR?
    # ===================================================================== #
    when 'GPCR?','gpcr?'
      _ = 'http://www.gpcr.org/7tm/'
      e simp(_)+rev
      set_xorg_buffer(_) if @configuration.additionally_set_xorg_buffer
    # ===================================================================== #
    # === generate_random_protein_sequence_with_variable_length_and_variable_composition'
    # ===================================================================== #
    when /^generate(_|-)?random(_|-)?protein(_|-)?sequence(_|-)?with(_|-)?variable(_|-)?length(_|-)?and(_|-)?variable(_|-)?composition$/
      generate_random_protein_sequence_with_variable_length_and_variable_composition
    # ===================================================================== #
    # === wobble?
    # ===================================================================== #
    when 'wobble',
         'wobble?'
      erev 'CAGUI, G->C(U) und U->A(G)sowie I->U,C,A, an der '\
           '5 Prime Position der tRNA.'
    # ===================================================================== #
    # === RNAfold2
    # ===================================================================== #
    when 'RNAfold2'
      esystem 'RNAfold -p --MEA < test.seq'
    # ===================================================================== #
    # === nucleotide_position?
    # ===================================================================== #
    when 'nucleotide_position?',
         'nucleotideposition?',
         'position?'
      show_position_for_the_main_sequence
    # ===================================================================== #
    # === find_gene
    # ===================================================================== #
    when 'find_gene',
         'findgene',
         'fgene',
         'genes?',
         'fingene'
      find_gene(a?)
    # ===================================================================== #
    # === to_talen
    # ===================================================================== #
    when /^to(-|_| )?talen$/,
         'talen',
         '2talen'
      to_talen(a?)
    # ===================================================================== #
    # === debug
    # ===================================================================== #
    when 'debug',
         'deb'
      f 'Toggling debug from '+sfancy(debug?.to_s)+' to: '
      do_toggle_debug_value
      e debug?
    # ===================================================================== #
    # === 2cutters
    # ===================================================================== #
    when '2cutter',
         '2cutters',
         '2-cutters',
         '2cut'
      show_restriction_enzymes '2'
    # ===================================================================== #
    # === 3cutters
    # ===================================================================== #
    when '3cutter',
         '3cutters',
         '3-cutters',
         '3cut'
      show_restriction_enzymes '3'
    # ===================================================================== #
    # === Handle input such as "658-660 =     CCA"
    # ===================================================================== #
    when /^(\d+)(\.\.|-)(\d+)\s*=\s*(.*)$/ # See: https://rubular.com/r/hDLHLND7cc
      _ = dna_sequence? # Keep a reference copy.
      start_position = $1.to_s.to_i # 11-12 = AA
      end_position   = $3.to_s.to_i
      new_sequence   = $4.to_s.strip
      old_sequence   = _[start_position-1, (end_position - start_position)+1]
      erev 'We will perform a match assignment at nucleotide position '+
           start_position.to_s+'-'+end_position.to_s+rev+
           '. The'
      erev 'old subsequence was: '+sfancy(old_sequence)+rev+
           ' - the new subsequence will be '+simp(new_sequence)
      new_sequence.delete!("'")
      _[start_position-1, (end_position - start_position)+1] = new_sequence
      set_dna_sequence(_)
    # ===================================================================== #
    # === dna_analyze
    # ===================================================================== #
    when /^dna(_|-)?analyze$/,
         'danalyze'
      analyze(a?) { :dna }
    # ===================================================================== #
    # === dash
    # ===================================================================== #
    when 'dash',
         'dashed',
         'spacer',
         /^splitted(_|-)?form$/
      show_sequence_in_splitted_form(f,'-')
    # ===================================================================== #
    # === leucine_zippers?
    # ===================================================================== #
    when 'leucine_zippers?','scan_for_leucine_zippers','leucine?',
         'leucinez','zippers','l?','leu?'
      scan_for_leucine_zippers(a?)
    # ===================================================================== #
    # === @aminoacids
    # ===================================================================== #
    when '@aminoacids'
      pp @internal_hash[:aminoacids]
    # ===================================================================== #
    # === open
    # ===================================================================== #
    when /^open$/i
      if f
        open(f)
      else
        open_my_files
      end
    # ===================================================================== #
    # === size_rna
    # ===================================================================== #
    when /^size(_|-)?rna$/i
      e @internal_hash[:rna].sequence.size.to_s
    # ===================================================================== #
    # === toggle_truncate
    # ===================================================================== #
    when /^toggle(_|-)?truncate$/i,
         /^truncate$/i
      toggle_truncate
    # ===================================================================== #
    # === 9mer
    # ===================================================================== #
    when '9mer',
         '9mer?'
      erev 'TTA|TCC|ACA'
      find_in_main_sequence('TTATCCACA')
      erev 'We found the 9mer n times: '+
            sfancy(string?.scan('TTATCCACA').size.to_s)
    # ===================================================================== #
    # === TAG?
    # ===================================================================== #
    when /^TAG\??$/i
      _ = search_sequence_for_open_reading_frames(
        i                    = string?,
        use_which_frame      = :frame1,
        use_this_start_codon = 'TAG'
      )
      if _.empty?
        erev 'No substring '+i.to_s.delete('?')+' was found.'
      else
        show_nucleotide_sequence?.display(i) {{ colourize_this_subsequence: use_this_start_codon }}
      end
    # ===================================================================== #
    # === inicodon?
    # ===================================================================== #
    when 'inicodon?',
         'startcodon?'
      erev ::Bioroebe.start_codon?
    # ===================================================================== #
    # === default_stop_codons?
    # ===================================================================== #
    when 'default_stop_codons?',
         'dstop?',
         'dna_codons?',
         'dna_codons',
         'dnacodons'
      pp ::Bioroebe.stop_codons? # This will be an Array.
    # ===================================================================== #
    # === discover_all_palindromes
    # ===================================================================== #
    when /^discover(_|-)?all(_|-)?palindromes$/i,
         /^dpalindromes$/i,
         'dpal'
      discover_all_palindromes(f)
    # ===================================================================== #
    # === dotplot
    # ===================================================================== #
    when /^dotplot$/i
      show_2D_dotplot(a?)
    # ===================================================================== #
    # === set_length
    # ===================================================================== #
    when /^set(_|-)?length$/i,
         /^set_?maxlength/,
         'length',
         'maxlength',
         'maxlen'
      set_default_length(a, :be_verbose)
    # ===================================================================== #
    # === replay
    # ===================================================================== #
    when 'replay',
         /^save(_|-)?history$/i
      replay(f)
    # ===================================================================== #
    # === raw_aa
    #
    # This entry point will simply display the raw aminoacid sequence,
    # translated from the main DNA sequence.
    # ===================================================================== #
    when /^raw(_|-)?aa$/i
      i = dna_sequence?
      sequence = ::Bioroebe::DnaToAminoacidSequence.new(i) { :be_quiet }.sequence
      e sequence
    # ===================================================================== #
    # === RNAfold3
    # ===================================================================== #
    when 'RNAfold3'
      esystem 'RNAfold -p < 5S.seq'
      esystem 'mountain.pl 5S_dp.ps | xmgrace -pipe'
      esystem 'relplot.pl 5S_ss.ps 5S_dp.ps > 5S_rss.ps'
    # ===================================================================== #
    # === mutate_position
    # ===================================================================== #
    when 'mutate_position','mutateposition','mposition','mpos'
      do_mutate_dna_sequence_at_this_nucleotide_position(a?) # mutate_position 5 C
    # ===================================================================== #
    # === include?
    # ===================================================================== #
    when 'include?',
         'inc?'
      include? f
    # ===================================================================== #
    # === cut
    # ===================================================================== #
    when /^cut$/i,
         'cutter'
      cut(f)
    # ===================================================================== #
    # === parse_gff
    # ===================================================================== #
    when /^-?-?parse(_|-)?gff$/i,
         'gff',
         'gff3',
         'gff?',
         'gff3?',
         /^-?-?scan(_|-)?gff$/i
      scan_or_parse_for_this_gff_file_or_any_gff_file(a?)
    # ===================================================================== #
    # === find
    # ===================================================================== #
    when /^try(_|-)?to(_|-)?find(_|-)?restriction(_|-)?enzymes(_|-)?for$/i,
         /scan(_|-)?for$/i,
         /look(_|-)?for$/i,
         'lfor',
         'find',
         'ind',
         'scan'
      try_to_find_restriction_enzymes_for(a?) # look_for
    # ===================================================================== #
    # === header?
    # ===================================================================== #
    when /^header\??$/i,
         /^headers\??$/i,
         /^show(_|-)?header(_|-)?of$/i
      show_header_of(a?)
    # ===================================================================== #
    # === uncolourize_this_aminoacid
    # ===================================================================== #
    when 'uncolourize',
         'uncolourize_this_aminoacid',
         'uncolourizethisaminoacid',
         'uncolaa',
         'uncola',
         '-colaa',
         'colremove',
         'ucola'
      uncolourize_this_aminoacid(f)
    # ===================================================================== #
    # === split
    # ===================================================================== #
    when 'split',
         'show_sequence_in_splitted_form'
      show_sequence_in_splitted_form(f)
    # ===================================================================== #
    # === namespace?
    # ===================================================================== #
    when 'namespace?'
      e namespace?
    # ===================================================================== #
    # === segments?
    # ===================================================================== #
    when 'segments?',
         'show_segments',
         'segments',
         'segmente'
      show_segments
    # ===================================================================== #
    # === to_rna2
    # ===================================================================== #
    when 'to_rna2'
      to_rna(f)
    # ===================================================================== #
    # === pathways?
    # ===================================================================== #
    when 'pathways?',
         'pathways',
         'pways',
         'pathway?',
         'pathway',
         'meta?',
         'path?',
         'show_all_pathways'
      show_all_pathways
    # ===================================================================== #
    # === aa_families?
    # ===================================================================== #
    when 'aa_families?',
         'aafamilies?',
         'aafamilies'
      pp ::Bioroebe.aa_families?
    # ===================================================================== #
    # === pfam?
    # ===================================================================== #
    when 'pfam?','pfam'
      e 'https://pfam.sanger.ac.uk/'
    # ===================================================================== #
    # === add
    # ===================================================================== #
    when 'add'
      add(a?)
    # ===================================================================== #
    # === set_padding
    # ===================================================================== #
    when /set_?padding/,
         'padding'
      set_padding(f, :be_verbose) # setpadding
    # ===================================================================== #
    # === ccaat?
    # ===================================================================== #
    when 'ccaat?',
         /^show(_|-)?ccaat(_|-)?sites$/,
         'ccaat',
         'ccaa'
      show_ccaat_sites
    # ===================================================================== #
    # === analyze
    # ===================================================================== #
    when 'analyze','ana?','analyze?'
      analyze(a?)
    # ===================================================================== #
    # === SSR?
    # ===================================================================== #
    when 'SSR?','ssr?','SSR','single_sequence_repeats'
      e generate_single_sequence_repeats
    # ===================================================================== #
    # === nucleotide?
    # ===================================================================== #
    when 'nucleotide?',
         'nucleotide',
         'ncbi_nucleotide_search_for'
      ncbi_nucleotide_search_for(a?)
    # ===================================================================== #
    # === three_letters_to_one_letter
    #
    # Usage example:
    #
    #   three_letters_to_one_letter THR
    #
    # ===================================================================== #
    when /^three(_|-)?letters(_|-)?to(_|-)?one(_|-)?letter$/i
      e three_letters_to_one_letter(a?)
    # ===================================================================== #
    # === rest_enzymes
    # ===================================================================== #
    when /^rest(_|-)?enzymes$/
      pp ::Bioroebe.show_restriction_enzymes
    # ===================================================================== #
    # === cutseq
    # ===================================================================== #
    when /^cutse(q|t)?$/i
      cutseq(a?)
    # ===================================================================== #
    # === first
    # ===================================================================== #
    when 'first',
         /^change(_|-)?first(_|-)?nucleotide(_|-)?to$/
      first(f)
    # ===================================================================== #
    # === pdf?
    # ===================================================================== #
    when 'pdf?','report_where_the_pdf_tutorial_can_be_found'
      report_where_the_pdf_tutorial_can_be_found
    # ===================================================================== #
    # === dmp?
    # ===================================================================== #
    when 'dmp?',
         /^show(_|-)?all(_|-)?dmp(_|-)?files$/,
         'dmp'
      show_all_dmp_files
    # ===================================================================== #
    # === codon?
    #
    # Invocation example in the BioShell:
    #
    #   codon? ATG
    #
    # ===================================================================== #
    when 'codon?',
         'kazusa_codon'
      show_codons_of_this_aminoacid_or_show_kazusa_codon(a?)
    # ===================================================================== #
    # === do_not_show_the_trailer
    # ===================================================================== #
    when /^-?-?do_?not_?show_?the_?trailer$/,
         /^-?-?no_?trailer$/
      do_not_show_the_trailer
    # ===================================================================== #
    # === edit
    # ===================================================================== #
    when /^edit$/i
      open_this_file_in_editor :bioshell
    # ===================================================================== #
    # === mpsa_source
    # ===================================================================== #
    when /^-?-?mpsa_?source/
      e '/opt/MPSA/mpsa/mpsa.bashrc'
    # ===================================================================== #
    # === assume?
    # ===================================================================== #
    when 'assume?',
         'assume',
         'assume_what_type_this_is'
      assume_what_type_this_is(a?) # assume ATTGGCCCATATTGGCC
    # ===================================================================== #
    # === bparse
    # ===================================================================== #
    when 'bparse',
         /^biolang(_|-)?parser$/
      BiolangParser.new # bl $BIOROEBE/biolang_parser.rb
    # ===================================================================== #
    # === set_prompt
    # ===================================================================== #
    when /^set(_|-)?prompt$/,
         'prompt',
         'setpwd'
      set_prompt(f)
    # ===================================================================== #
    # === no_prompt
    # ===================================================================== #
    when /^no(_|-)?prompt$/i
      set_prompt :empty
    # ===================================================================== #
    # === pyranose 2-oxidase
    # ===================================================================== #
    when /^pyranose(-|_)?2(-|_)?oxidase$/i
      e
      erev 'https://www.ncbi.nlm.nih.gov/nuccore/XM_008046051.1'
      e
    # ===================================================================== #
    # === disulfide?
    #
    # This entry point can be used to show disulfide positions in the
    # given sequence.
    # ===================================================================== #
    when /^-?-?disulfide\??$/i,
         /^-?-?show(_|-)?disulfides$/i
      show_disulfides
    # ===================================================================== #
    # === colourize_this_aminoacid
    # ===================================================================== #
    when 'colourize',
         /^colourize(_|-)?this(_|-)?aminoacid$/,
         'colaa',
         'cola',
         'colAA',
         'colourize_aminoacid'
      colourize_this_aminoacid(f)
    # ===================================================================== #
    # === frame2
    # ===================================================================== #
    when 'frame2',
         'f2'
      showorf(dna_sequence?, :frame2)
    # ===================================================================== #
    # === frame3
    # ===================================================================== #
    when 'frame3',
         'f3'
      showorf(dna_sequence?, :frame3)
    # ===================================================================== #
    # === mutate_aminoacid_position
    # ===================================================================== #
    when /^mutate(_|-)?aminoacid(_|-)?position$/
      mutate_aminoacid_position(a?)
    # ===================================================================== #
    # === interactive_colour_menu
    # ===================================================================== #
    when /^interactive(_|-)?colour(_|-)?menu$/,
         'icolours'
      interactive_colour_menu
    # ===================================================================== #
    # === aligned
    # ===================================================================== #
    when 'aligned',
         'aligned?',
         'beauty',
         'beautified', # We show the DNA sequence correctly aligned.
         'formatted',
         'padded',
         'beaut',
         'falign',
         'blocked',
         'block',
         /^show(_|-)?this(_|-)?sequence(_|-)?padded$/i
      show_this_sequence_padded(a?)
    # ===================================================================== #
    # === all_arguments
    # ===================================================================== #
    when /^arguments\??$/i
      pp all_arguments?
    # ===================================================================== #
    # === do
    #
    # do_action() as name is better than do(), in my opinion.
    # ===================================================================== #
    when 'do',
         /^do(_|-)?action$/i
      do_action(a?)
    # ===================================================================== #
    # === glutathione
    # ===================================================================== #
    when 'glutathione','glutathion'
      set_aminoacids('GCG')
    # ===================================================================== #
    # === relion_tags
    # ===================================================================== #
    when /^relion(_|-)?tags$/,
         'relion_tags?'
      e
      erev '_rlnImageName' 
      erev '_rlnCoordinateX' 
      erev '_rlnCoordinateY' 
      erev '_rlnMicrographName'
      erev '_rlnImageName'
      erev '_rlnDefocusU'
      erev '_rlnDefocusV'
      erev '_rlnDefocusAngle'
      erev '_rlnVoltage'
      erev '_rlnAmplitudeContrast'
      erev '_rlnSphericalAberration'
      e
    # ===================================================================== #
    # === project_base_dir
    # ===================================================================== #
    when /^project(_|-)?base(_|-)?dir$/i,
         'pdir',
         /^PROJECT(_|-)?BASE(_|-)?DIRECTORY$/i
      e Bioroebe.project_base_directory?
    # ===================================================================== #
    # === set_search
    # ===================================================================== #
    when /^set(_|-)?search$/i,
         /^set(_|-)?sequence$/i,
         /^set(_|-)?search(_|-)?string$/i,
         /^set(_|-)?search(_|-)?sequence$/i
      set_search_for(a?)
    # ===================================================================== #
    # === balanced
    # ===================================================================== #
    when /^create(_|-)?balanced(_|-)?composition$/i,
         'balanced'
      set_dna_string(
        create_balanced_composition(a?)
      )
    # ===================================================================== #
    # === show_local_sequences
    #
    # This entry point shows all local FASTA sequences - typically via
    # .fa or .fasta files.
    # ===================================================================== #
    when 'local_sequences?',
         'show_local_sequences',
         'showlocalsequences',
         'localfasta',
         'sequences?',
         'local?',
         'fastasequences?',
         'show_fasta_files',
         'localfasta?',
         'lfasta',
         /fasta(_|-)?files\??/
      show_local_sequences
      show_hint_how_to_use_the_local_sequences
    # ===================================================================== #
    # === compact_file
    # ===================================================================== #
    when /^compact(_|-)?file$/i,
         'compact',
         'cfile',
         'compacter'
      compact_file(f)
    # ===================================================================== #
    # === peroxisome_pts2
    # ===================================================================== #
    when 'peroxisome_pts2'
      erev 'H₂N-----Arg-Leu-X5-His-Leu-'
    # ===================================================================== #
    # === dna_translate
    # ===================================================================== #
    when /^dna(_|-)?translate/
      dna_translate(all_arguments?)
    # ===================================================================== #
    # === 1igt.pdb
    # ===================================================================== #
    when '1igt.pdb'
      erev 'https://www.rcsb.org/pdb/results/results.do?tabtoshow=Current&qrid=366A3EE'
    # ===================================================================== #
    # === MG1655
    # ===================================================================== #
    when 'MG1655'
      e
      efancy '  https://www.ncbi.nlm.nih.gov/nuccore/NZ_CP032667.1'
      e
    # ===================================================================== #
    # === @configuration
    # ===================================================================== #
    when '@configuration'
      pp @configuration
    # ===================================================================== #
    # === colours?
    # ===================================================================== #
    when 'colours?','ucolours?','ucolours',
         /^will(_|-)?we(_|-)?use(_|-)?colours\??$/i
      will_we_use_colours?
    # ===================================================================== #
    # === @use_working_directory_as_prompt
    # ===================================================================== #
    when '@use_working_directory_as_prompt'
      pp @internal_hash[:use_working_directory_as_prompt]
    # ===================================================================== #
    # === uniprot?
    # ===================================================================== #
    when 'uniprot?',
         /^open(_|-)?in(_|-)?uniprot$/,
         'prot'
      open_in_uniprot(f)
    # ===================================================================== #
    # === HU?
    # ===================================================================== #
    when 'HU?',
         'heat-unstable',
         'heat-unstable-protein'
      erev 'heat-unstable protein in E. coli.'
      erev 'Encoded by hupA and hupB gene - see these links:'
      erev 'hupA:'
      erev '  '+NCBI_GENE+'948499'
      erev '  https://www.ncbi.nlm.nih.gov/nuccore/NC_000913.3?report=fasta&from=4200281&to=4200553'
      erev 'hupB:'
      erev '  '+NCBI_GENE+'949095'
      erev '  https://www.ncbi.nlm.nih.gov/nuccore/NC_000913.3?report=fasta&from=461451&to=461723'
    # ===================================================================== #
    # === snuc
    #
    # Invocation example:
    #
    #   snuc lady slipper orchid
    #
    # ===================================================================== #
    when /^search(_|-)?for(_|-)?nucleotide(_|-)?sequence/i,
         'snuc'
      search_for_nucleotide_sequence(a?) # Delegate into: http://www.ncbi.nlm.nih.gov/nucgss?term=G
    # ===================================================================== #
    # === fasta_header?
    # ===================================================================== #
    when /^show(_|-)?fasta(_|-)?headers$/i,
         'sfasta',
         /^fasta(_|-)?header\??/i,
         'showfasta',
         'fheader'
      show_fasta_headers(f)
    # ===================================================================== #
    # === copyright?
    # ===================================================================== #
    when /^copyright\??$/i
      show_copyright_clause
    # ===================================================================== #
    # === pBR322?
    # ===================================================================== #
    when /pBR322\??/
      e
      erev '  https://www.ncbi.nlm.nih.gov/nuccore/208958?report=fasta' # The pBR322 sequence.
      e
    # ===================================================================== #
    # === ARRAY_WITH_COMPLETIONS
    # ===================================================================== #
    when /^ARRAY(_|-)?WITH(_|-)?COMPLETIONS$/i
      pp ARRAY_WITH_COMPLETIONS
    # ===================================================================== #
    # === @array_these_sequences_were_chopped_away
    #
    # This entry point is mostly used for debugging-purposes.
    # ===================================================================== #
    when '@array_these_sequences_were_chopped_away',
         'chopped?'
      pp @internal_hash[:array_these_sequences_were_chopped_away]
    # ===================================================================== #
    # === array_colourize_this_aminoacid
    # ===================================================================== #
    when 'array_colourize_this_aminoacid'
      pp ::Bioroebe.array_colourize_this_aminoacid
    # ===================================================================== #
    # === @array_sequences
    # ===================================================================== #
    when '@array_sequences'
      pp array_sequences?
    # ===================================================================== #
    # === identical?
    # ===================================================================== #
    when 'identical?',
         'identical',
         'same',
         'same_content?',
         'similar?',
         'compare_two_files',
         'comparetwofiles'
      compare_two_files(f, second_argument)
    # ===================================================================== #
    # === locus?
    # ===================================================================== #
    when 'locus?'
      e @internal_hash[:locus]
    # ===================================================================== #
    # === molmass?
    # ===================================================================== #
    when 'mass?',
         'molecularmass?',
         'molmass?',
         'mmass',
         /^molecular(_|-)?mass(_|-)?of(_|-)?amino(_|-)?acids(_|-)?in(_|-)?the(_|-)?sequence$/i
      molecular_mass_of_amino_acids_in_the_sequence(f)
    # ===================================================================== #
    # === +
    #
    # Show the positively charged aminoacids.
    # ===================================================================== #
    when '+',
         'show_the_positively_charged_aminoacids'
      show_the_positively_charged_aminoacids
    # ===================================================================== #
    # === insulin?
    # ===================================================================== #
    when 'insulin?'
      show_insulin_entries_at_NCBI
    # ===================================================================== #
    # === list
    # ===================================================================== #
    when 'list'
      list(a?)
    # ===================================================================== #
    # === configdir?
    # ===================================================================== #
    when 'configdir?',
         /^show(_|-)?config(_|-)?dir$/i
      show_config_dir
    # ===================================================================== #
    # === show_nucleotides_table
    # ===================================================================== #
    when 'nucleotides?','nucleotide_table','nucleotidetable',
         'nucleotide_table?','nucleotidetable?','stable',
         'show_nucleotides_table','shownucleotidestable',
         'nucleotides_table?'
      show_nucleotides_table
    # ===================================================================== #
    # === print_table
    # ===================================================================== #
    when 'print_table','table','aa?','aminoacid_information',
         'print_aminoacid_information_table','aainfo',
         'aminosäuren','aminoacids','ptable','shortcuts?',
         'ainfo?','aainfo?','printtable','aa_table',
         'aminoacidstable?','aatable?'
      print_aminoacid_information_table
    # ===================================================================== #
    # === assigned?
    # ===================================================================== #
    when /assigned\??/,
         /is(_|-)?any(_|-)?nucleotide(_|-)?assigned\??/
      if is_any_nucleotide_assigned?
        erev 'A nucleotide sequence is assigned.'
      else
        erev 'No nucleotide sequence is assigned.'
      end
    # ===================================================================== #
    # === set_jumper_dir
    # ===================================================================== #
    when /set_?jumper_?dir/,'set_jumper','setjumper','sjumper'
        set_jumper_directory(f)
    # ===================================================================== #
    # === extract_sequence
    # ===================================================================== #
    when /extract_?sequence/,'extract','ext'
      extract_sequence(a?)
    # ===================================================================== #
    # === no_newlines
    # ===================================================================== #
    when /no_?newlines/
      no_newlines(a?)
    # ===================================================================== #
    # === run_sql_query
    # ===================================================================== #
    when 'run_sql_query','runsqlquery' # Input a sql command directly.
      run_sql_query(f)
    # ===================================================================== #
    # === Restriction enzymes
    #
    # Usage example for rest:
    #   rest AAAAAAAAGGCGCCCTGACCATCTAGAAAAA
    # ===================================================================== #
    when 'Bioroebe.restriction_enzymes?','all_restriction_enzymes',
         'allrestrictionenzymes'
      pp ::Bioroebe.restriction_enzymes?
    # ===================================================================== #
    # === search
    # ===================================================================== #
    when 'search','run',/start_?search/
      start_search
    # ===================================================================== #
    # === URLs?
    # ===================================================================== #
    when 'URLs?','URL?','URLS?',/show_?useful_?URLs/
      show_useful_URLs
    # ===================================================================== #
    # === NM_021964.1
    # ===================================================================== #
    when 'NM_021964.1','NM_021964' # This should one day be replaced with a NCBI-query system.
      e 'https://www.ncbi.nlm.nih.gov/nuccore/NM_021964.1'
      e 'https://www.ncbi.nlm.nih.gov/nuccore/NM_021964' # ← This is the updated variant.
    # ===================================================================== #
    # === first_orf?
    # ===================================================================== #
    when /first_?orf\??/,/show_?first_?orf/,'1storf','1st_ORF','1stORF'
      show_first_orf
    # ===================================================================== #
    # === emicroscopy
    # ===================================================================== #
    when 'emicroscopy'
      e 'This has not been ported yet - stay tuned.'
    # ===================================================================== #
    # === 4cutters
    # ===================================================================== #
    when '4cutter','4cutters','4-cutters','4cut'
      show_restriction_enzymes '4'
    # ===================================================================== #
    # === 5cutters
    # ===================================================================== #
    when '5cutter','5cutters','5-cutters','5cut'
      show_restriction_enzymes '5'
    # ===================================================================== #
    # === 6cutters
    # ===================================================================== #
    when '6cutter','6cutters','6-cutters','6cut'
      show_restriction_enzymes '6'
    # ===================================================================== #
    # === 7cutters
    # ===================================================================== #
    when '7cutter','7cutters','7-cutters','7cut'
      show_restriction_enzymes '7'
    # ===================================================================== #
    # === 8cutters
    # ===================================================================== #
    when '8cutter','8cutters','8-cutters','8cut'
      show_restriction_enzymes '8'
    # ===================================================================== #
    # === rawseq
    # ===================================================================== #
    when /rawseq\??/,
         'rawstring',
         'rawstring?',
         /dna_?sequence\??/,
         'fullseq',
         'realseq'
      e string? 
    # ===================================================================== #
    # === mutate
    # ===================================================================== #
    when 'mutate',
         'mutate_dna_sequence',
         'mutatednasequence'
      mutate_dna_sequence(a?)
    # ===================================================================== #
    # === setseq2
    # ===================================================================== #
    when /setseq2/, /seq2[^\?]/
      set_sequence_2(a?)
    # ===================================================================== #
    # === setseq3
    # ===================================================================== #
    when /setseq3/, /seq3[^\?]/
      set_sequence_3(a?)
    # ===================================================================== #
    # === setseq4
    # ===================================================================== #
    when /setseq4/, /seq4[^\?]/
      set_sequence_4(a?)
    # ===================================================================== #
    # === setseq5
    # ===================================================================== #
    when /setseq5/, /seq5[^\?]/
      set_sequence_5(a?)
    # ===================================================================== #
    # === setseq6
    # ===================================================================== #
    when /setseq6/, /seq6[^\?]/
      set_sequence_6(a?)
    # ===================================================================== #
    # === date
    # ===================================================================== #
    when 'date','show_date','showdate','sdate'
      show_date
    # ===================================================================== #
    # === colour_scheme_demo
    # ===================================================================== #
    when 'colour_scheme_demo','colourschemedemo','colour_tests',
         'colourtests','colourdemo'
      colour_scheme_demo
    # ===================================================================== #
    # === colour_scheme_for_aa
    # ===================================================================== #
    when 'colour_scheme_for_aa','colourschemeforaa',
         'colour_scheme_for_aminoacids','colour_scheme2',
         'caa','scheme_aa'
      colour_scheme_for_aminoacids(a?)
    # ===================================================================== #
    # === n_uracil?
    # ===================================================================== #
    when 'n_uracil?',
         'n_uracil',
         'nuracil',
         'nuracil?'
      n_uracil?
    # ===================================================================== #
    # === sixpack
    # ===================================================================== #
    when 'sixpack',
         '6pack',
         'show_sixpack_alignment','showsixpackalignment'
      show_sixpack_alignment(a?)
    # ===================================================================== #
    # === compseq
    #
    # This entry point is a wrapper over "compare sequence" aka compseq.
    # ===================================================================== #
    when 'compseq',
         'compseq?',
         /^compare(_|-)?the(_|-)?sequence$/i,
         'analyze_the_sequence',
         'csequ',
         'cseq',
         'compsqe',
         /^frequency(_|-)?analyzer$/i,
         'emboss',
         /^emboss(_|-)?compseq$/i,
         'dinucleotides',
         /^nucleotide(_|-)?frequency$/i
      compseq(a?) # bl compseq
    # ===================================================================== #
    # === show
    # ===================================================================== #
    when 'show',
         /^do(_|-)?show$/i
      show(a?)
    # ===================================================================== #
    # === generate_palindrome
    # ===================================================================== #
    when /^generate(_|-)?palindrome$/i,
         'palindrome',
         'palindrom',
         'pal',
         'pdrome'
      generate_palindrome(a?)
    # ===================================================================== #
    # === bioroebe --tk1                                           (tk tag)
    # ===================================================================== #
    when /^-?-?tk1$/i
      require 'bioroebe/gui/tk/aminoacid_composition/aminoacid_composition.rb'
      Bioroebe::GUI::Tk::AminoacidComposition.new(ARGV)
    # ===================================================================== #
    # === bioroebe --tk2
    #
    # Invocation example:
    #
    #   bioroebe --tk-three-to-one
    #
    # ===================================================================== #
    when /^-?-?tk2$/i,
         /^-?-?tk(_|-| )?three(_|-| )?to(_|-| )?one$/i
      tk_start_three_to_one
    # ===================================================================== #
    # === bioroebe --tk3
    #
    # Invocation example:
    #
    #   bioroebe --tk3
    #
    # ===================================================================== #
    when /^-?-?tk3$/i
      require 'bioroebe/gui/tk/hamming_distance/hamming_distance.rb'
      Bioroebe::GUI::Tk::HammingDistance.new(ARGV)
    # ===================================================================== #
    # === start_and_stop?
    # ===================================================================== #
    when /^start_?and_?stop\??/
      report_colourized_sequence(:start_and_stop_codon)
    # ===================================================================== #
    # === start_and_stop
    # ===================================================================== #
    when /^start(_|-)?and(_|-)?stop$/i,
         '1+2',
         /^start(_|-)?stop$/i,
         'stopandstart',
         'yin_yang',
         '+-'
      show_start_and_stop_codons
    # ===================================================================== #
    # === stop_extended?
    # ===================================================================== #
    when 'stop_extended?'
      _ = main_sequence?
      stop_codons?.each {|this_stop_codon|
        _splitted = _.split(/#{this_stop_codon}/).each {|line|
          erev line+orange(this_stop_codon)+rev
        }
      }
      pp _splitted
    # ===================================================================== #
    # === rf "Horseradish Peroxidase"
    # ===================================================================== #
    when /^Horseradish(-|_)Peroxidase$/i
      show_resources_about_the_horseradish_peroxidase
    # ===================================================================== #
    # === mimivirus?
    # ===================================================================== #
    when /^mimivirus\??$/,'mimi'
      e 'Accession number is: '+
         sfancy('NC_014649')
    # ===================================================================== #
    # === user_input?
    #
    # This entry point is mostly used for debugging purposes.
    # ===================================================================== #
    when /^user(_|-)?input\??$/i
      pp @internal_hash[:user_input]
    # ===================================================================== #
    # === nls?
    # ===================================================================== #
    when 'nls?',
         'show_known_nls_sequences',
         'showknownnlssequences'
      show_known_nls_sequences
    # ===================================================================== #
    # === reste?
    # ===================================================================== #
    when 'reste?','show_reste','showreste','sreste'
      show_reste
    # ===================================================================== #
    # === test_colour_scheme
    # ===================================================================== #
    when /^test(_|-)?colour(_|-)?scheme$/i,
         'test_random_scheme'
      _ = random_dna_sequence
      colour_scheme_for_nucleotides(_)
    # ===================================================================== #
    # === compare_two_strings_as_alignment
    # ===================================================================== #
    when /compare_?two_?strings_?as_?alignment/i,'sstring','scompare',
         'sscompare','compare_two_strings','compare',
         /string_?compare/
      compare_two_strings_as_alignment(
        first_argument, second_argument
      ) # string_compare
    # ===================================================================== #
    # === left_chop
    #
    # This entry point allows the user to perform a so-called
    # "left-chop operation", aka to trim away nucleotides
    # that are on the left hand side of the sequence.
    # ===================================================================== #
    when /left(_|-)?chop$/,
         /left(_|-)?remove$/,
         /chop(_|-)?first$/,
         'chop5',
         'lchop'
      left_chop(a?)
    # ===================================================================== #
    # === translate_aminoacid
    #
    # Usage example:
    #
    #   translate kkrnn
    #
    # ===================================================================== #
    when /translate(_|-| )?aminoacid/i,
         'transaa',
         'translate_aa',
         'aminosäuren2',
         'translateaa',
         'trans2'
      translate_aminoacid(a?)
    # ===================================================================== #
    # === chi_sequence?
    # ===================================================================== #
    when 'chi_sequence?','chisequence?','chi?'
      e 'The chi sequence goes: '+simp('GCTGGTGG')
    # ===================================================================== #
    # === ncbi
    # ===================================================================== #
    when 'ncbi' # ncbi arabidopsis thaliana CDKs
      open_this_ncbi_page(a?)
    # ===================================================================== #
    # === pcolour
    # ===================================================================== #
    when 'interactively_pick_colour',
         'pick_colour',
         'pickcolour',
         'pcolour',
         'pcolor',
         'pcol'
      interactively_pick_colour
    # ===================================================================== #
    # === bioroebe --gtk1
    #
    # This is for alignment.rb
    # ===================================================================== #
    when /^-?-?gtk1$/i
      require 'bioroebe/gui/gtk3/alignment/alignment.rb'
      Bioroebe::GUI::Gtk::Alignment.run
    # ===================================================================== #
    # === bioroebe --gtk2
    #
    # This is for aminoacid_composition.rb
    # ===================================================================== #
    when /^-?-?gtk2$/i
      require 'bioroebe/gui/gtk3/aminoacid_composition/aminoacid_composition.rb'
      Bioroebe::GUI::Gtk::AminoacidComposition.run
    # ===================================================================== #
    # === bioroebe --gtk3
    #
    # This is for anti_sense_strand.rb
    # ===================================================================== #
    when /^-?-?gtk3$/i
      require 'bioroebe/gui/gtk3/anti_sense_strand/anti_sense_strand.rb'
      Bioroebe::GUI::Gtk::AntiSenseStrand.run
    # ===================================================================== #
    # === bioroebe --gtk4
    #
    # This is for blosum_matrix_viewer.rb
    # ===================================================================== #
    when /^-?-?gtk4$/i
      require 'bioroebe/gui/gtk3/blosum_matrix_viewer/blosum_matrix_viewer.rb'
      Bioroebe::GUI::Gtk::BlosumMatrixViewer.run
    # ===================================================================== #
    # === bioroebe --gtk5
    #
    # This is for calculate_cell_numbers_of_bacteria.rb
    # ===================================================================== #
    when /^-?-?gtk5$/i
      require 'bioroebe/gui/gtk3/calculate_cell_numbers_of_bacteria/calculate_cell_numbers_of_bacteria.rb'
      Bioroebe::GUI::Gtk::CalculateCellNumbersOfBacteria.run
    # ===================================================================== #
    # === bioroebe --gtk6
    #
    # This is for dna_to_aminoacid_widget.rb
    # ===================================================================== #
    when /^-?-?gtk6$/i
      require 'bioroebe/gui/gtk3/dna_to_aminoacid_widget/dna_to_aminoacid_widget.rb'
      Bioroebe::GUI::Gtk::DnaToAminoacidWidget.run
    # ===================================================================== #
    # === bioroebe --gtk7
    #
    # This is for dna_to_reverse_complement_widget.rb
    # ===================================================================== #
    when /^-?-?gtk7$/i
      require 'bioroebe/gui/gtk3/dna_to_reverse_complement_widget/dna_to_reverse_complement_widget.rb'
      Bioroebe::GUI::Gtk::DnaToReverseComplementWidget.run
    # ===================================================================== #
    # === bioroebe --gtk8
    #
    # This is for fasta_table_widget.rb
    # ===================================================================== #
    when /^-?-?gtk8$/i
      require 'bioroebe/gui/gtk3/fasta_table_widget/fasta_table_widget.rb'
      Bioroebe::GUI::Gtk::FastaTableWidget.run
    # ===================================================================== #
    # === bioroebe --gtk9
    #
    # This is for format_converter.rb
    # ===================================================================== #
    when /^-?-?gtk9$/i
      require 'bioroebe/gui/gtk3/format_converter/format_converter.rb'
      Bioroebe::GUI::Gtk::FormatConverter.run
    # ===================================================================== #
    # === bioroebe --gtk10
    #
    # This is for gene.rb
    # ===================================================================== #
    when /^-?-?gtk10$/i
      require 'bioroebe/gui/gtk3/gene/gene.rb'
      Bioroebe::GUI::Gtk::Gene.run
    # ===================================================================== #
    # === bioroebe --gtk11
    #
    # This is for hamming_distance.rb.
    # ===================================================================== #
    when /^-?-?gtk11$/i
      require 'bioroebe/gui/gtk3/hamming_distance/hamming_distance.rb'
      Bioroebe::GUI::Gtk::HammingDistance.run
    # ===================================================================== #
    # === bioroebe --gtk12
    #
    # This is for levensthein_distance.rb.
    # ===================================================================== #
    when /^-?-?gtk12$/i,
         /^-?-?gtk(_|-| )?levensthein$/i # bioroebe --gtk-levensthein
      require 'bioroebe/gui/gtk3/levensthein_distance/levensthein_distance.rb'
      Bioroebe::GUI::Gtk::LevenstheinDistance.run
    # ===================================================================== #
    # === bioroebe --gtk13
    #
    # This is for notebook.rb.
    # ===================================================================== #
    when /^-?-?gtk13$/i
      require 'bioroebe/gui/gtk3/controller/controller.rb'
      Bioroebe::GUI::Gtk::Controller.run
    # ===================================================================== #
    # === bioroebe --gtk14
    #
    # This is for nucleotide_analyser.rb.
    # ===================================================================== #
    when /^-?-?gtk14$/i
      require 'bioroebe/gui/gtk3/nucleotide_analyser/nucleotide_analyser.rb'
      Bioroebe::GUI::Gtk::NucleotideAnalyser.run
    # ===================================================================== #
    # === bioroebe --gtk15
    #
    # This is for parse_pdb_file.rb.
    # ===================================================================== #
    when /^-?-?gtk15$/i
      require 'bioroebe/gui/gtk3/parse_pdb_file/parse_pdb_file.rb'
      Bioroebe::GUI::Gtk::ParsePdbFile.run
    # ===================================================================== #
    # === bioroebe --gtk16
    #
    # This is for primer_design_widget.
    # ===================================================================== #
    when /^-?-?gtk16$/i,
         /^-?-?primer(_|-| )?design$/i # bioroebe --primer-design
      require 'bioroebe/gui/gtk3/primer_design_widget/primer_design_widget.rb'
      Bioroebe::GUI::Gtk::PrimerDesignWidget.run
    # ===================================================================== #
    # === bioroebe --gtk17
    #
    # This is for protein_to_DNA.
    # ===================================================================== #
    when /^-?-?gtk17$/i
      require 'bioroebe/gui/gtk3/protein_to_DNA/protein_to_DNA.rb'
      Bioroebe::GUI::Gtk::ProteinToDNA.run
    # ===================================================================== #
    # === bioroebe --gtk18
    #
    # This is for random_sequence.
    # ===================================================================== #
    when /^-?-?gtk18$/i
      require 'bioroebe/gui/gtk3/random_sequence/random_sequence.rb'
      Bioroebe::GUI::Gtk::RandomSequence.run
    # ===================================================================== #
    # === bioroebe --gtk19
    #
    # This is for restriction_enzymes.
    # ===================================================================== #
    when /^-?-?gtk19$/i
      require 'bioroebe/gui/gtk3/restriction_enzymes/restriction_enzymes.rb'
      Bioroebe::GUI::Gtk::RestrictionEnzymes.run
    # ===================================================================== #
    # === bioroebe --gtk20
    #
    # This is for show_codon_table.
    # ===================================================================== #
    when /^-?-?gtk20$/i
      require 'bioroebe/gui/gtk3/show_codon_table/show_codon_table.rb'
      Bioroebe::GUI::Gtk::ShowCodonTable.run
    # ===================================================================== #
    # === at_content?
    #
    # Usage example:
    #
    #   at_content? AGTACGTACGTCAGTCA
    #
    # ===================================================================== #
    when /^at_?content\??$/i,
         'at?',
         'calc_at_content',
         'calcatcontent'
      calculcate_at_content(a?)
    # ===================================================================== #
    # === ll
    #
    # This is the general entry point for listing the content in the
    # current working directory.
    # ===================================================================== #
    when 'll',
         'ls',
         'l',
         'sdc',
         'lll',
         'llll',
         /^show(_|-)?file(_|-)?listing$/
      show_file_listing
    # ===================================================================== #
    # === remove
    #
    # This entry point can be used to remove a subsequence from the
    # 5' end (the "left" end).
    #
    # Invocation example:
    #
    #   remove 3
    #
    # ===================================================================== #
    when 'remove',
         'delete',
         'del',
         'rm'
      remove(a?)
    # ===================================================================== #
    # === oligo_two
    # ===================================================================== #
    when 'oligo_two',
         'oligo_length_two',
         'oligolengthtwo',
         'two',
         'oligonucleotide_frequency'
      show_oligo_length_two
    # ===================================================================== #
    # === efetch
    # ===================================================================== #
    when /^efetch$/
      efetch(a?)
    # ===================================================================== #
    # === Handle aminoacid sequence
    #
    # This is similar to the variant above, but it will work on the
    # aminoacid sequence. This explains the leading "aa", which
    # is short for "aminoacid".
    #
    # Usage example:
    #
    #   setdna 99; aa22..44
    #
    # ===================================================================== #
    when /^aa\[?([0-9,.]{0,9}\d{1,9})\s*[-.,]{1,4}\s*([0-9,.]{1,9})\]?$/
      show_this_subsequence($1, $2, aminoacid_sequence?)
    # ===================================================================== #
    # === gui_restriction_enzymes
    # ===================================================================== #
    when 'gui_restriction_enzymes','guirestrictionenzymes'
      enable_gtk
      ::Bioroebe::RestrictionEnzymes.start_gui_application
    # ===================================================================== #
    # === 2
    # ===================================================================== #
    when '2','restriction_enzymes','2_restriction_enzymes_run'
      load_gtk
      thread = Thread.new { restriction_enzymes_run }
      thread.join
    # ===================================================================== #
    # === bioroebe --hamming-gui
    # ===================================================================== #
    when /^-?-?hamming(_|-| )?gui$/i
      require 'bioroebe/gui/gtk3/hamming_distance/hamming_distance.rb'
      Thread.new {
        Bioroebe::GUI::Gtk::HammingDistance.run
      }
    # ===================================================================== #
    # === bioroebe --gtk-sizeseq
    # ===================================================================== #
    when /^-?-?gtk(_|-| )?sizeseq$/i
      require 'bioroebe/gui/gtk3/sizeseq/sizeseq.rb'
      Bioroebe::GUI::Gtk::Sizeseq.run
    # ===================================================================== #
    # === bioroebe --gtk-hamming
    # ===================================================================== #
    when /^-?-?gtk(_|-| )?hamming$/i
      require 'bioroebe/gui/gtk3/hamming_distance/hamming_distance.rb'
      Bioroebe::GUI::Gtk::HammingDistance.run
    # ===================================================================== #
    # === pwd
    # ===================================================================== #
    when 'pwd',
         'pdw',
         /^report(_|-)?current(_|-)?working(_|-)?directory$/i
      report_current_working_directory
    # ===================================================================== #
    # === restriction_table?
    # ===================================================================== #
    when /^restriction(_|-)?table\??/,
         /^show(_|-)?restriction(_|-)?table$/
      show_restriction_table
    # ===================================================================== #
    # === dna_weight?
    # ===================================================================== #
    when /dna_?weight\??/,'weight_of_dna_string',
         'weight?',
         'weight',
         'mweight',
         'show_and_calculate_weight_of_dna_string',
         'molwt',
         'show_individual_weight_of_the_four_dna_nucleotides'
      show_and_calculate_weight_of_dna_string_or_aminoacid_sequence(f)
    # ===================================================================== #
    # === dna_analyze?
    #
    # This entry-point can be used to analyze the given DNA strand at hand.
    # ===================================================================== #
    when 'dna_analyze?',
         'analyse',
         'ana',
         /^stats\??$/i,
         'display',
         'stat?',
         'stat',
         'dnaanalyze?',
         'frequencies',
         'frequencies?',
         'statistics?',
         'analyze_dna_string',
         'frequency',
         'superanalyze',
         /^dna(-|_| )?analyse$/i
      analyze_dna_string(a?)
    # ===================================================================== #
    # === tologdir
    # ===================================================================== #
    when /^to(_|-)?log(_|-)?dir$/,
         /^to(_|-)?log$/
      cd log_dir?
    # ===================================================================== #
    # === create_file
    #
    # This entry point allows the user to create a new file.
    # ===================================================================== #
    when /^create(_|-)?file$/,
         'touch'
      create_file(a?)
    # ===================================================================== #
    # === assign_aa
    # ===================================================================== #
    when /^assign(_|-)?aa$/,
         'aaa'
      assign_aminoacid_sequence(a?)
    # ===================================================================== #
    # === --create-jar
    # ===================================================================== #
    when /^-?-?create(_|-)?jar$/i,
         /^-?-?jar$/i
      ::Bioroebe.create_jar_archive
    # ===================================================================== #
    # === help
    # ===================================================================== #
    when 'hel',
         'he','showhelp',
         /^-?-?help$/i,
         'hep',
         'hepl','elp',
         'show_help',
         '?',
         'hlep' # 'h' is reserved already.
      show_help(f)
    # ===================================================================== #
    # === bioroebe --gtk21
    #
    # This is for show_codon_usage.
    # ===================================================================== #
    when /^-?-?gtk21$/i
      require 'bioroebe/gui/gtk3/show_codon_usage/show_codon_usage.rb'
      Bioroebe::GUI::Gtk::ShowCodonUsage.run
    # ===================================================================== #
    # === bioroebe --gtk22
    #
    # This is for sizeseq.
    # ===================================================================== #
    when /^-?-?gtk22$/i
      require 'bioroebe/gui/gtk3/sizeseq/sizeseq.rb'
      Bioroebe::GUI::Gtk::Sizeseq.run
    # ===================================================================== #
    # === bioroebe --gtk23
    #
    # This is for three_to_one.
    # ===================================================================== #
    when /^-?-?gtk23$/i
      require 'bioroebe/gui/gtk3/three_to_one/three_to_one.rb'
      Bioroebe::GUI::Gtk::ThreeToOne.run
    # ===================================================================== #
    # === bioroebe --gtk24
    #
    # This is for www_finder.
    # ===================================================================== #
    when /^-?-?gtk24$/i
      require 'bioroebe/gui/gtk3/www_finder/www_finder.rb'
      Bioroebe::GUI::Gtk::WwwFinder.run
    # ===================================================================== #
    # === gtk3
    # ===================================================================== #
    when 'gtk3',
         'load_gtk_subsection'
      load_gtk
      enable_gtk_section_antisensestrand
    # ===================================================================== #
    # === enable_gtk_section_antisensestrand
    # ===================================================================== #
    when /^enable(_|-)?gtk(_|-)?section(_|-)?antisensestrand$/
      enable_gtk_section_antisensestrand
    # ===================================================================== #
    # === enable_gtk
    # ===================================================================== #
    when /^-?-?enable(_|-)?gtk$/,
         'gtk'
      enable_gtk
    # ===================================================================== #
    # === codon_to_aminoacid
    # ===================================================================== #
    when /^codon(_|-)?to(_|-)?aminoacid$/
      e codon_to_aminoacid(a?)
    # ===================================================================== #
    # === toggle2
    # ===================================================================== #
    when 'toggle2'
      toggle_mode
    # ===================================================================== #
    # === name?
    # ===================================================================== #
    when 'name?',
         /^-?-?show(_|-| )?name(_|-| )?of(_|-| )?the(_|-| )?gene$/i
      show_name_of_the_gene
    # ===================================================================== #
    # === show_memo
    # ===================================================================== #
    when /show_?mnemo/,'mnemo','memo',
         'show_memo',
         'memo?'
      show_mnemo
    # ===================================================================== #
    # === bioroebe --gtk-nucleotide-analyser
    # ===================================================================== #
    when /^-?-?gtk(_|-| )?nucleotide(_|-| )?analyser$/i,
         /^-?-?nucleotide(_|-| )?analyser(_|-| )?gtk$/i
      require 'bioroebe/gui/gtk3/nucleotide_analyser/nucleotide_analyser.rb'
      Bioroebe::GUI::Gtk::NucleotideAnalyser.run
    # ===================================================================== #
    # === download_fasta
    # ===================================================================== #
    when /^download(_|-| )?fasta$/i,
         'dfasta',
         'dfa',
         'wget'
      download_fasta(a?)
    # ===================================================================== #
    # === Handle 33..55 and 33-55 and [33..55] and [33-55]
    #
    # This entry point can be used to obtain a subsequence of our target
    # sequence - it can "handle ranges".
    #
    # See the following link for an explanation of this regex:
    #
    #   https://rubular.com/r/zP7khUUIyC3zA0
    #
    # ===================================================================== #
    when /^\[?([0-9,.]{0,9}\d{1,9})\s*[-.,]{1,4}\s*([0-9,.]{1,9})\]?$/
      show_this_subsequence($1, $2)
    # ===================================================================== #
    # === blosum90
    # ===================================================================== #
    when /^-?-?blosum90/i
      e 'Showing '+i.delete('-')+' next.'+N+N
      Bioroebe::BlosumParser.show_as_2D_table(i)
    # ===================================================================== #
    # === calculate_levensthein
    # ===================================================================== #
    when /calculate(_|-| )?levensthein(_|-| )?distance/i,
         'calculate_levensthein' # lst computation complication
      ::Bioroebe.calculate_levensthein_distance(a?) # This will output the result by default.
    # ===================================================================== #
    # === longest_substring
    # ===================================================================== #
    when /longest(_|-)?substring/,
         'find_substring',
         'substring',
         'sub'
      find_longest_substring(a?) # sub AAAAGATAAACAAAAGGGG ATATCCTAAACAAAAGGGG
    # ===================================================================== #
    # === set_xclip
    # ===================================================================== #
    when /^set(_|-)?xclip$/i,
         'set_buffer',
         'xclip',
         'buffer',
         /^to(_|-)?buffer/i,
         'xorgbuffer',
         'setxorg'
      erev 'Next assigning the main DNA sequence to the Xorg Buffer.'
      set_xclip
    # ===================================================================== #
    # === to_base
    # ===================================================================== #
    when /to(_|-)?base$/,
         'base',
         /enter_?base_?dir/
      enter_base_directory
    # ===================================================================== #
    # === three_to_one
    #
    # This entry point will convert the three-letter code to the
    # one-letter code (in regards to aminoacids).
    #
    # Invocation example:
    #
    #   3to1 ARG-ALA-SER-LEU-PHE-TRP-LYS-HIS-ASN-SER-VAL-LEU-ILE-VAL-PRO
    #
    # ===================================================================== #
    when /^three(_|-)?to(_|-)?one$/,
         '3-1',
         '3letters',
         /^3(_|-| )?to(_|-| )?1$/ # === 3to1
      three_to_one(a?)
    # ===================================================================== #
    # === oligo_three
    # ===================================================================== #
    when /^oligo(_|-)?three$/,
         'oligo_length_three',
         'oligolengththree',
         'three',
         /^show(_|-)?oligo(_|-)?length(_|-)?three$/,
         'oligo_3',
         'oligo3'
      show_oligo_length_three
    # ===================================================================== #
    # === random_insert
    # ===================================================================== #
    when /^random(_|-)?insert$/i,
         'rinsert'
      random_insert(a?)
    # ===================================================================== #
    # === 9cut
    # ===================================================================== #
    when /^\d+cut$/,
         /^cut\d+$/, # Example: "9cut" or "cut9".
         /^cut(_|-)?sequence(_|-)?in(_|-)?slices(_|-)?of$/i
      _ = f.to_s.gsub(/cut/,'')
      cut_sequence_in_slices_of(_)
    # ===================================================================== #
    # === runmode?
    # ===================================================================== #
    when /runmode?/
      e runmode?
    # ===================================================================== #
    # === subseq2
    #
    # Usage example:
    #
    #   set_raw_sequence ATGCATGCAAA; subseq2
    #
    # ===================================================================== #
    when /^-?-?subseq2$/i
      show_this_subsequence(2, 4, raw_sequence?)
      # ===================================================================== #
      # === set_raw_sequence
      #
      # Usage example:
      #
      #   set_raw_sequence ATGCATGCAAA; raw_sequence?
      #   setrawsequence ATGCATGCAAA; raw_sequence?
      #
      # ===================================================================== #
    when /^-?-?set(_|-| )?raw(_|-| )?sequence$/i,
         /^-?-?assign(_|-| )?raw$/i
      erev 'Now assigning to the new sequence '+sfancy(f)
      set_raw_sequence(f)
    # ===================================================================== #
    # === annotate
    # ===================================================================== #
    when 'annotate'
      annotate_this_file(f)
    # ===================================================================== #
    # === hydropathy_table?
    # ===================================================================== #
    when 'hydropathy_table?',
         'hydropathytable?',
         'show_hydropathy_table',
         'showhydropathytable',
         'hydropathy?',
         /hpathy\??/,
         'spathy',
         'hydropathy_table',
         'hytable'
      show_hydropathy_table
    # ===================================================================== #
    # === restriction_sizes
    # ===================================================================== #
    when /^restriction(_|-)?sites$/i,
         'rest',
         'restriction',
         'sites',
         'res',
         'show_restriction_enzymes',
         'enzymes',
         'enz',
         'enzymes?',
         'rest2',
         'r',
         '4',
         'srest',
         'allrest',
         'show_rests'
      show_restriction_enzymes(:show_all) unless f
      find_restriction_sites(f) if f # Only do this if an argument was passed.
      @internal_hash[:bioroebe] << a.upcase if a
      @internal_hash[:bioroebe].restriction_sites?(dna_sequence?)
    # ===================================================================== #
    # === do_not_show_the_leader
    # ===================================================================== #
    when /^-?-?do_?not_?show_?the_?leader$/i,
         /^-?-?no_?leader$/i
      do_not_show_the_leader
    # ===================================================================== #
    # === readline?
    # ===================================================================== #
    when 'readline?'
      report_whether_readline_is_available
    # ===================================================================== #
    # === iaminoacid?
    # ===================================================================== #
    when 'iaminoacid?',
         /^identify(_|-)?aminoacid$/i,
         'iaminoacid',
         'aminoacid'
      identify_aminoacid(a?)
    # ===================================================================== #
    # === kozak?
    # ===================================================================== #
    when /^kozak\??$/i
      e
      erev '  GCCACCAUGG'
      e
    # ===================================================================== #
    # === first_atg?
    #
    # This entry point will show where the first ATG can be found in a
    # given sequence.
    # ===================================================================== #
    when /^first(_|-)?atg\??/i,
         /^report(_|-)?the(_|-)?first(_|-)?atg$/i
      report_the_first_atg
    # ===================================================================== #
    # === insulin
    #
    # This quick-link is used mostly just to quickly jump to the
    # insulin sequence.
    # ===================================================================== #
    when 'insulin'
      _ = NCBI_NUCCORE+'NC_000011.10?report=fasta&from=2159779&to=2161209&strand=true'
      e _
      open_in_browser _
    # ===================================================================== #
    # === Handle numbers given as input
    #
    # This entry point can be used to match numbers, such as 33 or
    # 66.
    # ===================================================================== #
    when /^[0-9]+$/
      assign(i)
    # ===================================================================== #
    # === assign_protein
    # ===================================================================== #
    when /^assign(_|-)?protein$/,
         /^assign(_|-)?aminoacids$/,
         'aprotein'
      assign_protein_sequence(a?)
    # ===================================================================== #
    # === show_complement
    # ===================================================================== #
    when 'show_complement',
         'complement',
         'complement?',
         'complementary',
         'cment',
         'c?',
         'co',
         'clent',
         'compl',
         'partner'
      show_complement(all_arguments?, :show_leading_primes)
    # ===================================================================== #
    # === ensure_that_the_base_directories_exist
    # ===================================================================== #
    when /^ensure(_|-)?that(_|-)?the(_|-)?base(_|-)?directories(_|-)?exist$/i
      erev 'Now creating some '+steelblue('base directories')+rev+
           ' for the bioroebe project.'
      Bioroebe.ensure_that_the_base_directories_exist
    # ===================================================================== #
    # === sizeseq
    # ===================================================================== #
    when /sizeseq/
      run_sizeseq
    # ===================================================================== #
    # === frame123
    # ===================================================================== #
    when 'frame123'
      showorf(dna_sequence?, :frame1_frame2_frame3)
    # ===================================================================== #
    # === find_restriction_sites
    # ===================================================================== #
    when 'find_restriction_sites',
         'rest?',
         'findrestrictionsites'
      find_restriction_sites(string?)
    # ===================================================================== #
    # === 1mbo
    # ===================================================================== #
    when /^1mbo$/
      download_this_pdb_file('1mbo')
    # ===================================================================== #
    # === no_truncate
    # ===================================================================== #
    when /^dont(_|-)?truncate$/,
         'do_not_truncate',
         'donottruncate',
         'no_truncate',
         'notruncate',
         'truncate-',
         '-truncate',
         '-trunc'
      do_not_truncate
    # ===================================================================== #
    # === pstop
    # ===================================================================== #
    when 'pstop',
         'astop'
      append_stop_codon
    # ===================================================================== #
    # === create_fasta
    # ===================================================================== #
    when /^create(_|-)?fasta$/i,
         /^make(_|-)?fasta$/i,
         /^save(_|-)?fasta$/i,
         /^create_?fasta_?file/
      create_fasta_file
    # ===================================================================== #
    # === K12
    # ===================================================================== #
    when 'K12'
      show_Ecoli_K12_information
    # ===================================================================== #
    # === test10
    # ===================================================================== #
    when 'test10'
      # =================================================================== #
      # Just some testing here.
      # =================================================================== #
      dna = ::Bioroebe::DNA.new(string?)
      find_this_subsequence = 'ATG'
      e 'Looking for '+royalblue(find_this_subsequence)
      array = dna.find_this_subsequence find_this_subsequence
      pp array
    # ===================================================================== #
    # === atgccontent
    # ===================================================================== #
    when 'atgccontent',
         'atcgcontent',
         'ncontent',
         'tacgcontent'
      calculcate_at_content(a?)
      calculcate_gc_content(a?)
    # ===================================================================== #
    # === use_fasta
    # ===================================================================== #
    when /^use_?fasta$/i,
         'use_this_fasta',
         'ufasta',
         'usethisfasta',
         'use_this_fasta_file',
         'useasta'
      use_this_fasta_file(f) # Use a fasta file based on its position.
    # ===================================================================== #
    # === The ViennaRNA package
    # ===================================================================== #
    when 'b2ct',
         'ct2db',
         'Kinfold',
         'popt',
         'RNA2Dfold',
         'RNAaliduplex',
         'RNAalifold',
         'RNAcofold',
         'RNAdistance',
         'RNAduplex',
         'RNAeval',
         'RNAfold',
         'RNAforester',
         'RNAheat',
         'RNAinverse',
         'RNALalifold',
         'RNALfold',
         'RNAlocmin',
         'RNApaln',
         'RNAparconv',
         'RNApdist',
         'RNAPKplex',
         'RNAplex',
         'RNAplfold',
         'RNAplot',
         'RNApvmin',
         'RNAsnoop',
         'RNAsubopt',
         'RNAup'
      this_command = i.dup+' '
      if a
        this_command << a.join(' ').chomp
      end
      e
      esystem(this_command)
      e
    # ===================================================================== #
    # === restore
    #
    # This will restore the last chop-operation.
    # ===================================================================== #
    when 'restore'
      restore_the_last_chop_operation
    # ===================================================================== #
    # === mirror_repeat
    # ===================================================================== #
    when /^mirror(_|-)?repeat$/i,
         /^mirror$/i
      mirror_repeat(a?)
    # ===================================================================== #
    # === TTAA
    # ===================================================================== #
    when 'TTAA?',
         'TTAA',
         'TTA_transposon'
      show_colourized_sequence('TTAA')
    # ===================================================================== #
    # === count_nucleotides
    # ===================================================================== #
    when 'cnucleotides',
         /count_?nucleotides/
      ::Bioroebe::CountAmountOfNucleotides.new(f) # cnucleotides ATTGGCTTGCCGGCAGACGA
    # ===================================================================== #
    # === all_sequences?
    # ===================================================================== #
    when 'all_sequences?',
         'allsequences?'
      show_main_dna_sequence # We show them only when they are NOT empty.
      show_seq_2 unless seq2?.empty?
      show_seq_3 unless seq3?.empty?
      show_seq_4 unless seq4?.empty?
      show_seq_5 unless seq5?.empty?
      show_seq_6 unless seq6?.empty?
    # ===================================================================== #
    # === CAP?
    # ===================================================================== #
    when 'CAP?',
         'CAP',
         'cap',
         'cap?'
      try_to_find_restriction_enzymes_for('TGTGA') # See: http://www.jbc.org/content/261/23/10885.full.pdf
    # ===================================================================== #
    # === unfreeze
    # ===================================================================== #
    when /^unfreeze$/,
         /^unfrozen$/,
         /^unfreeze(-|_| )?the(-|_| )?main(-|_| )?sequence$/
      erev 'Unfreezing the main sequence next.'
      unfreeze_the_main_sequence
    # ===================================================================== #
    # === show_editor_in_use
    # ===================================================================== #
    when /^show(_|-)?editor(_|-)?in(_|-)?use$/,
         'editor?',
         'ed?'
      show_editor_in_use
    # ===================================================================== #
    # === Mus_musculus.GRCm38.75.gtf.gz
    # ===================================================================== #
    when 'Mus_musculus.GRCm38.75.gtf.gz'
      download(
        'ftp://ftp.ensembl.org/pub/release-75/gtf/mus_musculus/Mus_musculus.GRCm38.75.gtf.gz'
      )
    # ===================================================================== #
    # === dump
    # ===================================================================== #
    when /^dump$/i
      dump(a?)
    # ===================================================================== #
    # === seq2?
    # ===================================================================== #
    when 'seq2?',
         's2?',
         /^show_?seq_?2/
      show_seq_2
    # ===================================================================== #
    # === seq2
    # ===================================================================== #
    when 'seq2'
      assign_sequence2(a?)
    # ===================================================================== #
    # === index_this_fasta_file
    #
    # This entry point will use samtools to index .fasta file(s).
    #
    # If no argument is given then this method will, by default, try
    # to use all .fasta and .fa files from the current working
    # directory. This feature exists primarily for convenience.
    # ===================================================================== #
    when /^-?-?index(_|-)?this(_|-)?fasta(_|-)?file$/i,
         /^-?-?index$/i
      index_this_fasta_file(a?) { :use_all_fasta_files_if_no_argument_was_given }
    # ===================================================================== #
    # === sanitize_nucleotide_sequence
    # ===================================================================== #
    when /^sanitize(_|-)?nucleotide(_|-)?sequence$/
      sanitize_nucleotide_sequence(a?)
    # ===================================================================== #
    # === align_ORFS
    # ===================================================================== #
    when /^align_?ORFS/i,'alignmorfs',
          'pretty_orf',
         /^align_?open_?reading_?frames/
      align_ORFS # Show all ORFs properly aligned.
    # ===================================================================== #
    # === pcr?
    # ===================================================================== #
    when 'pcr?'
      calculate_melting_temperature :show_formulas
    # ===================================================================== #
    # === completions?
    # ===================================================================== #
    when 'completions?','complet?'
      if use_readline?
        show_readline_completions
      else
        erev 'No completions are known, as the readline '\
             'module is not in use.'
      end
    # ===================================================================== #
    # === phred_quality_score_table
    # ===================================================================== #
    when /phred(_|-)?quality(_|-)?score(_|-)?table/
      require 'bioroebe/ngs/phred_quality_score_table.rb'
      ::Bioroebe::PhredQualityScoreTable.new
    # ===================================================================== #
    # === cuts_at?
    #
    # Where restriction enzymes cut.
    # ===================================================================== #
    when 'cuts_at?',
         'cuts_at',
         'cut?',
         'r?',
         'find_restriction_enzymes_that_cut_at',
         'findcutat?',
         'cutsat?'
      find_restriction_enzymes_that_cut_at(a?)
    # ===================================================================== #
    # === delimiter
    # ===================================================================== #
    when /delimiter/
      show_sequence_in_splitted_form(f) {{ use_this_token: '|' }}
    # ===================================================================== #
    # === aaruler
    #
    # Usage example:
    #
    #   aaruler KLKLKLKLAALKLAKLA
    #
    # ===================================================================== #
    when /^aaruler$/
      _ = aminoacid_sequence? # Default value.
      if f and !f.nil? and !f.empty?
        _ = f
      end
      show_sequence_with_a_ruler(:default, _, :aminoacids)
    # ===================================================================== #
    # === ruler
    #
    # This entry point will display a useful number on each nucleotide
    # position.
    # ===================================================================== #
    when /^ruler$/,
         /^-?-?show(_|-| )?sequence(_|-| )?with(_|-| )?a(_|-| )?ruler$/
      show_sequence_with_a_ruler(a?, :default, :dna)
    # ===================================================================== #
    # === e
    #
    # This entry point can be used to quickly feedback which arguments
    # have been passed.
    #
    # Specific usage example:
    #
    #   e one two three
    #
    # ===================================================================== #
    when 'e'
      e all_arguments?
    # ===================================================================== #
    # === check_for_mismatches
    # ===================================================================== #
    when /^check(_|-)?for(_|-)?mismatches$/i,
         'mismatch',
         'mismatches'
      check_for_mismatches
    # ===================================================================== #
    # === bedtoolsv
    # ===================================================================== #
    when 'bedtoolsv',
         'bedtools?',
         /^try(_|-)?to(_|-)?report(_|-)?the(_|-)?version(_|-)?of(_|-)?bedtools$/
      try_to_report_the_version_of_bedtools
    # ===================================================================== #
    # === return_random_nucleotide
    # ===================================================================== #
    when /^return(_|-)?random(_|-)?nucleotide$/i
      e return_random_nucleotide
    # ===================================================================== #
    # === return_random_aminoacid
    # ===================================================================== #
    when /^return(_|-)?random(_|-)?aminoacid$/i
      e return_random_aminoacid
    # ===================================================================== #
    # === cut_with_enzyme
    #
    # This entry point can be used to cut a DNA sequence with a
    # restriction enzyme.
    #
    # Invocation example:
    #
    #   cut_with_enzyme EcoRI
    #
    # ===================================================================== #
    when /^cut(_|-)?with(_|-)?enzyme$/i
      cut_with_enzyme(a?)
    # ===================================================================== #
    # === show_history
    #
    # This entry point can be used to show the input-history that was
    # used so far. The "input-history" is what the user typed.
    # ===================================================================== #
    when /^show(_|-)?history$/i,
         'h',
         'h?',
         'history',
         'history?',
         'hist',
         'hist?'
      show_history
    # ===================================================================== #
    # === try_to_find_this_restriction_enzyme
    # ===================================================================== #
    when /^try(_|-)?to(_|-)?find(_|-)?this(_|-)?restriction(_|-)?enzyme$/
      try_to_find_this_restriction_enzyme(f)
    # ===================================================================== #
    # === dalton
    # ===================================================================== #
    when /^dalton$/i
      dalton(f?)
    # ===================================================================== #
    # === search_for
    # ===================================================================== #
    when /^search(_|-)?for$/ 
      search_for(a?)
    # ===================================================================== #
    # === colour_test
    # ===================================================================== #
    when /^colour(_|-)?test$/i
      set_highlight_colour(:violet)
    # ===================================================================== #
    # === to_dna
    # ===================================================================== #
    when /^to(_|-| )?DNA$/i,
         'dna',
         'rna2dna'
      to_dna(f)
    # ===================================================================== #
    # === backtranseq
    #
    # This entry point allows us to translate an Aminoacid Sequence back
    # into the most likely DNA sequence.
    #
    # Usage example:
    #
    #   backtranseq ARGARG
    #
    # ===================================================================== #
    when 'backtranseq',
         'backseq',
         'backtrack',
         /^aminoacid(_|-| )?to(_|-| )?dna$/i,
         'runcodons',
         'btrack',
         /^protein(_|-| )?to(_|-| )?dna$/i,
         'proteintodna',
         'p_to_d','ptod',
         /^reverse(_|-| )?dna$/i,
         /^reverse(_|-| )?seq$/i,
         /^reverse(_|-| )?aa$/i, # === reverse_aa
         'bseq',
         'backtraq',
         'backtrach'
      backtranseq(a?)
    # ===================================================================== #
    # === colour_test
    # ===================================================================== #
    when /^colour(_|-)?test/
      e
      erev 'This is a test.'
      e
      erev 'This is another test.'
      erev 'Now for '+slateblue('slateblue')+rev+'.'
      erev 'Now for '+lightgreen('lightgreen')+rev+'.'
      e
    # ===================================================================== #
    # === show_aminoacids_mass_table
    # ===================================================================== #
    when /^show(_|-)?aminoacids(_|-)?mass(_|-)?table$/i,
         /^show(_|-)?aminoacid(_|-)?mass$/i,
         'showmass',
         'aminoacid_table_overview',
         'aminomass',
         'aminomasses'
      show_aminoacids_mass_table
    # ===================================================================== #
    # === stride
    # ===================================================================== #
    when 'stride' # The C-program called stride.
      _ = 'stride '+f?.to_s+' > '+f?.to_s+'_stride_output'
      esystem(_)
    # ===================================================================== #
    # === multliline_assignment
    # ===================================================================== #
    when /^multiline_?assignment$/,
         'mass',
         'multiline2',
         'mline',
         'mmm',
         '___',
         '__',
         '--',
         'assignmultiline',
         'assign_multiline',
         'multiline_input',
         'multilineinput',
         'multi_line',
         'multiline',
         'multi-line',
         'multi_input',
         'multline'
      assign_sequence(:multiline)
    # ===================================================================== #
    # === download_dir?
    # ===================================================================== #
    when /^download(_|-)?dir\??$/,
         'ddir?','base?',
         'depotdir?','depot?',
         /^temp\??$/i,
         /^show(_|-)?download(_|-)?dir$/ # === show_download_dir
      show_download_dir
    # ===================================================================== #
    # === @parse_fasta
    # ===================================================================== #
    when '@parse_fasta'
      last_fasta_entry?.display
    # ===================================================================== #
    # === show_aa
    # ===================================================================== #
    when /^show(_|-)?aa$/i,
         'aminoacids?','aaseq?','aasq?','aminacids?',
         'aminocids?',
         'aasequence?',
         /^show(_|-)?aminoacid(_|-)?sequence$/i
      show_aminoacid_sequence
    # ===================================================================== #
    # === pyrrolysine
    # ===================================================================== #
    when /pyrrolysine?\??/
      erev 'UAG codes for pyrrolysine'
    # ===================================================================== #
    # === to_T
    #
    # Convert all 'U' into 'T', if there are any U at all.
    # ===================================================================== #
    when /^to(_|-)?T$/i
      dna_sequence_object?.extend(Bioroebe::NucleotideModule)
      assign_this_dna_sequence(
        dna_sequence_object?.to_T
      )
    # ===================================================================== #
    # === theory?
    # ===================================================================== #
    when 'theory','theory?'
      e '  T = h ** 2 + h*k + k ** 2'
    # ===================================================================== #
    # === ..
    # ===================================================================== #
    when '..'
      cd '..'
    # ===================================================================== #
    # === last_inputted_command?
    # ===================================================================== #
    when /^last(_|-)?inputted(_|-)?command\??$/i
      e last_inputted_command?
    # ===================================================================== #
    # === flybase?
    # ===================================================================== #
    when /^flybase\??$/i
      open_in_browser(i.delete('?'))
    # ===================================================================== #
    # === fasta_file?
    # ===================================================================== #
    when /^fasta(_|-)?file\??$/i
      e fasta_file?
    # ===================================================================== #
    # === dna?
    # ===================================================================== #
    when 'dnaa?',
         'dnaA',
         'dnaA?'
      attempt_to_discover_dna_A_boxes
    # ===================================================================== #
    # === useful_packages?
    # ===================================================================== #
    when /^useful(_|-)?packages\??$/,
         /^science(_|-)?addons\??$/,
         /^addons\??$/,
         /^external\??$/,
         /^status\??$/,
         /^report$/
      report_useful_packages_installed
    # ===================================================================== #
    # === f23
    # ===================================================================== #
    when 'f2,f3','f23'
      showorf(dna_sequence?, :frame2_frame3)
    # ===================================================================== #
    # === f1,f2
    # ===================================================================== #
    when 'f1,f2','f12'
      showorf(dna_sequence?, :frame1_frame2)
    # ===================================================================== #
    # === f1,f2,f3
    # ===================================================================== #
    when 'f1,f2,f3'
      showorf(dna_sequence?, :frame1_frame2_frame3)
    # ===================================================================== #
    # === genbank?
    # ===================================================================== #
    when 'genbank?'
      open_in_browser :genbank
    # ===================================================================== #
    # === gold?
    # ===================================================================== #
    when 'gold?'
      _ = 'https://gold.jgi.doe.gov/'
      e _
      open_in_browser(_)
    # ===================================================================== #
    # === purge
    # ===================================================================== #
    when 'purge'
      purge(a?)
    # ===================================================================== #
    # === restrictionenzymes?
    # ===================================================================== #
    when 'restrictionenzymes?','restrictionenzymes','restriction?'
      show_restriction_enzymes(:show_all)
    # ===================================================================== #
    # === longest_ORF
    # ===================================================================== #
    when /^longest(_|-| )?ORF$/i
      _ = Bioroebe.longest_ORF?(sequence_as_string?)
      erev 'The longest ORF has a size of '+steelblue(_.size.to_s)+
           rev+' nucleotides.'
      erev 'This sequence is shown next:'
      e
      show_this_sequence(_)
      e
    # ===================================================================== #
    # === codon_usage_database?
    # ===================================================================== #
    when /^codon(_|-)?usage(_|-)?database\??$/i
      erev 'On 20.05.2016 this database has had:'
      e
      erev '  35,799 organisms'
      erev "  3,027,973 complete protein coding genes (CDS's)"
      e
    # ===================================================================== #
    # === 1IGT
    #
    # This .pdb file is related to antibodies.
    # ===================================================================== #
    when '1IGT'
      open_1igt_in_the_browser
    # ===================================================================== #
    # === enable_xsel
    # ===================================================================== #
    when /^enable(_|-)?xsel$/i
      enable_xsel
    # ===================================================================== #
    # === show_xorg_buffer
    # ===================================================================== #
    when /^show(_|-)?xorg(_|-)?buffer$/i,
         /^show(_|-)?xbuffer$/i,
         'sxorgbuffer'
      show_xorg_buffer
    # ===================================================================== #
    # === weight_of_nucleotides
    #
    # This entry point simply shows the weight of the four different
    # nucleotides.
    # ===================================================================== #
    when /^weight(_|-)?of(_|-)?nucleotides$/i,
         /^wnuc$/i
      show_the_weight_of_the_four_individual_nucleotides
    # ===================================================================== #
    # === viennarnav
    # ===================================================================== #
    when /^viennarna(v|\?)?$/i # Allows both "viennarna" and "viennarna?"
      try_to_report_the_version_of_viennarna
    # ===================================================================== #
    # === yaml?
    # ===================================================================== #
    when 'yaml','yaml?',
         /^show(_|-)?all(_|-)?yaml(_|-)?files/i
      show_all_yaml_files
    # ===================================================================== #
    # === match_pattern
    #
    # Usage example:
    #
    #   match_pattern ACGTACGTAACG GTA
    #   match_pattern ATGTGACTACGACGCATATGACGTACGTAACG ATG
    # 
    # ===================================================================== #
    when /^match(_|-)?pattern$/i
      results = Bioroebe.return_array_of_sequence_matches(
        first_argument?, second_argument?
      )
      results.reverse.each {|position|
        show_this_sequence(
          first_argument?[(position-1) .. -1]
        )
      }
    # ===================================================================== #
    # === to_genbank
    #
    # This entry point can be used to convert the main DNA sequence to
    # the genbank format.
    # ===================================================================== #
    when /^to(_|-)?genbank$/,
         'togen',
         'filemaker',
         'format?',
         'genbeauty',
         'beauty2',
         'togenb',
         'genbank',
         'togenban',
         'genbankflatfilegen',
         'formatter',
         'pretty',
         'prettify',
         'beautify',
         'sanitize',
         /table_?formatter/
      to_genbank
    # ===================================================================== #
    # === last_update?
    #
    # This entry point notifies the user as to when the bioroebe project
    # was last updated.
    # ===================================================================== #
    when /^last(_|-)?update\??$/i
      report_when_the_bioroebe_project_was_last_updated
    # ===================================================================== #
    # === colour_scheme
    #
    # Usage example:
    #
    #   colour_scheme ATGACTCAGACACTAGCTAGCTAGCTAGACTACA
    #
    # ===================================================================== #
    when /^colour(_|-)?scheme$/i,
         /^colour(_|-)?scheme(_|-)?for(_|-)?nucleotides$/i,
         'cscheme'
      colour_scheme_for_nucleotides(a?)
    # ===================================================================== #
    # === constants?
    # ===================================================================== #
    when 'constants?'
      pp ::Bioroebe.constants.sort
    # ===================================================================== #
    # === config?
    # ===================================================================== #
    when 'config?',
         'configuration?',
         'con?',
         'show_config',
         'showconfig'
      try_to_show_the_configuration
    # ===================================================================== #
    # === swisss-prot?
    # ===================================================================== #
    when /swiss-?prot\??/,
         /report_?n_?proteins_?registered_?in_?swiss_?prot$/
      report_n_proteins_registered_in_swiss_prot
    # ===================================================================== #
    # === rubyversion
    #
    # The second line is for jruby specifically.
    # ===================================================================== #
    when /^ruby(_|-)?version/i
      e steelblue(RUBY_VERSION)
      if Object.const_defined?(:ENV_JAVA)
        erev 'Java version: '+
             steelblue(ENV_JAVA['java.version'].to_s)
      end
    # ===================================================================== #
    # === disable
    #
    # This entry point allows us to disable specific features, as far
    # as the BioRoebe shell is concerned.
    # ===================================================================== #
    when /^disable/,
         'no'
      disable(a?)
    # ===================================================================== #
    # === shine_dalgarno?
    # ===================================================================== #
    when 'shine_dalgarno?','shine?',
         'shine',
         'shine_dalgarno',
         'sd',
         'sd?',
         'find_shine_dalgarno_sequence',
         'sine'
      find_shine_dalgarno_sequence
    # ===================================================================== #
    # === random_dna_sequence
    #
    # This entry point will simply display the random DNA sequence,
    # the default length. Currently this is 250.
    # ===================================================================== #
    when /^random(_|-)?dna(_|-)?sequence$/i
      display_this_nucleotide_sequence(
        random_dna_sequence
      )
    # ===================================================================== #
    # === raw?
    # ===================================================================== #
    when 'raw?','raw'
      show_dna_string(
        dna_string?, :do_not_truncate_and_do_not_show_leader_and_trailer
      )
    # ===================================================================== #
    # === salt_adjusted_tm
    #
    # Entry point for calculating the salt-adjust Tm (melting temperature).
    #
    # Most useful for primers in the range of 18-25, give or take.
    # ===================================================================== #
    when /^salt(_|-)?adjusted(_|-)?tm$/,
         /^melting(_|-)?temperature2$/
      erev salt_adjusted_tm(a?)
    # ===================================================================== #
    # === melting_temperature?
    # ===================================================================== #
    when 'calculate_melting_temperature','calculatemeltingtemperature',
         'mt','melting_temperature','ctemp','tm','melting?',
         'melting_temperature?','melt',
         'cmelt','calmelt'
      calculate_melting_temperature(a?) # melting? GCCGCGGTTTCGGGA
    # ===================================================================== #
    # === translate3
    # ===================================================================== #
    when 'translate3','t','aminoacid?','trans1'
      translate(a?)
    # ===================================================================== #
    # === bioroebe --libui1
    #
    # All --libui entries should be sorted alphabetically in this
    # menu as well.
    # ===================================================================== #
    when /^-?-?libui1?$/i
      require 'bioroebe/gui/libui/dna_to_aminoacid_widget/dna_to_aminoacid_widget.rb'
      Bioroebe::GUI::LibUI::DnaToAminoacidWidget.run
    # ===================================================================== #
    # === bioroebe --libui2
    # ===================================================================== #
    when /^-?-?libui2$/i
      require 'bioroebe/gui/libui/dna_to_aminoacid_widget/dna_to_aminoacid_widget.rb'
      Bioroebe::GUI::LibUI::DnaToAminoacidWidget.run
    # ===================================================================== #
    # === bioroebe --libui3
    # ===================================================================== #
    when /^-?-?libui3$/i
      require 'bioroebe/gui/libui/random_sequence/random_sequence.rb'
      Bioroebe::GUI::LibUI::RandomSequence.run
    # ===================================================================== #
    # === show_taxid
    # ===================================================================== #
    when 'show_taxid','showtaxid','taxid?','taxid'
      show_taxid(a?)
    # ===================================================================== #
    # === ten_split
    # ===================================================================== #
    when /^ten(_|-)?split$/i
      show_sequence_in_splitted_form(10)
    # ===================================================================== #
    # === n_downloads?
    # ===================================================================== #
    when 'n_downloads?' # How often Bioroebe was downloaded.
      require 'bestgems'
      n_times = Bestgems.client.total_downloads(:bioroebe).values.first
      erev 'The Bioroebe project has been downloaded '+simp(n_times.to_s)+rev+' times.'
    # ===================================================================== #
    # === genbank_version?
    # ===================================================================== #
    when /genbank_?version\??/,'report_current_genbank_version',
         'top',
         'genebank?',
         'reportcurrentgenbankversion',
         'genbankversion?',
         'genbank_version',
         'current_genbank_version?',
         'current_genbank_version'
      report_current_genbank_version(:also_report_the_URL)
    # ===================================================================== #
    # === phosphorylation_sites?
    # ===================================================================== #
    when 'phosphorylation_sites?','psites?','phosphorylationsites?',
         'phosphorylationsites','psites','phosphorylation_site?',
         'phospho?','show_phosphorylation_sites','showphosphorylationsites',
         'p?','P',
         'phosphorylation',
         'P?'
      show_possible_phosphorylation_sites
    # ===================================================================== #
    # === pitch
    # ===================================================================== #
    when 'pitch','alpha_helix_pitch',
         'alphahelixpitch'
      show_length_of_alpha_helix(a?)
    # ===================================================================== #
    # === handle_pdb_files
    #
    # Invocation example:
    #
    #   handle_pdb_files http://www.rcsb.org/pdb/files/3O30.pdb
    #
    # ===================================================================== #
    when /^handle(_|-)?pdb(_|-)?files$/i,
         'pdb','pdb?',
         'download_pdb',
         'dpdb',
         'downloadpdb',
         /^download(_|-)?this(_|-)?pdb(_|-)?file$/i
      handle_pdb_files(a?)
    # ===================================================================== #
    # === pdburl?
    # ===================================================================== #
    when /pdb(_|-| )?url?/,
         'pdb2?'
      e 'https://www.wwpdb.org/'
    # ===================================================================== #
    # === freeze
    # ===================================================================== #
    when /^freeze$/,
         /^frozen$/,
         /^freeze(-|_| )?the(-|_| )?main(-|_| )?sequence$/
      erev 'Freezing the main sequence next.'
      freeze_the_main_sequence
    # ===================================================================== #
    # === parse
    #
    # This is the general-entry for parse-related activities in regards
    # to the bioshell-interface.
    #
    # Examples for files that are parsed include .pdb files and
    # .fasta files.
    # ===================================================================== #
    when 'parse',
         /^parse(_|-| )?this(_|-| )?pdb(_|-| )?file$/,
         /^parse(_|-| )?pdb(_|-| )?file$/,
         /^parse(_|-| )?pdb$/,
          'parse_fasta_format',
         /^parse(_|-| )?fasta$/,
         'pfasta',
         'pasta',
         'fasta',
         'fast',
         /^assign(_|-| )?fasta$/
      parse(a?)
    # ===================================================================== #
    # === cut_at
    # ===================================================================== #
    when /cut(_|-)?at$/i
      cut_at(f)
    # ===================================================================== #
    # === punnet
    # ===================================================================== #
    when 'punnet',
         'pun'
      punnet(a?) # bl $BIOROEBE/shell/shell.rb
    # ===================================================================== #
    # === stop_frame1?
    # ===================================================================== #
    when /^stop(_|-)?frame1\??$/i
      report_main_sequence(dna_sequence_as_string?, :stop_codon_in_frame1)
    # ===================================================================== #
    # === stop_frame2?
    # ===================================================================== #
    when /^stop(_|-)?frame2\??$/i
      report_main_sequence(dna_sequence_as_string?, :stop_codon_in_frame2)
    # ===================================================================== #
    # === stop_frame3?
    # ===================================================================== #
    when /^stop(_|-)?frame3\??$/i
      report_main_sequence(dna_sequence_as_string?, :stop_codon_in_frame3)
    # ===================================================================== #
    # === orf?
    #
    # This entry point will display to the user where open reading
    # frames can be found in the main sequence.
    # ===================================================================== #
    when /^ORF\??$/i,
         /^ORF1\??$/i,
         /^ORFs\??$/i,
         'open_reading_frames',
         'search?',
         'startcodons?',
         'search_for_orfs',
         'orfs?',
         /^open(_|-)?reading(_|-)?frames$/i,
         'start?',
         'toorf',
         'ORFS?',
         'all_ORFs',
         'allorfs',
         'ATG?',
         /^AUG\??$/i
      result = search_sequence_for_open_reading_frames
      print '  '
      pp result
      e
      # =================================================================== #
      # Colourize all ATG tags next. One day this may have to become
      # more flexible so that we can colourize codons other than ATG,
      # since e. g. in bacteria, a few genes start with another codon.
      # =================================================================== #
      show_nucleotide_sequence?.display(main_sequence?) { :colourize_start_codon }
      e
      if f? # User supplied an argument in this case
        report_n_start_codons { f? }
      else
        report_n_start_codons
      end
    # ===================================================================== #
    # === orf2?
    # ===================================================================== #
    when /^ORF2\??$/i
      result = search_sequence_for_open_reading_frames(
        :default, :frame2, :default
      )
      erev result
    # ===================================================================== #
    # === fastq_quality_scores
    # ===================================================================== #
    when /^fastq(_|-)?quality(_|-)?scores$/i,
         /^fastq(_|-)?quality(_|-)?schemes$/i,
         /^show(_|-)?fastq(_|-)?quality(_|-)?score(_|-)?table$/i,
         /^fastq(_|-)?table?/
      show_fastq_quality_score_table
    # ===================================================================== #
    # === Visit the human GRCh38.p14 assembly
    # ===================================================================== #
    when /^GRCh38.p14$/i
      open_in_browser 'https://www.ncbi.nlm.nih.gov/assembly/GCF_000001405.40'
    # ===================================================================== #
    # === Visit the human GRCh38 assembly
    # ===================================================================== #
    when /^GRCh38$/i
      open_in_browser 'https://www.ncbi.nlm.nih.gov/assembly/GCF_000001405.26/'
    # ===================================================================== #
    # === Feedback which browser is in use
    #
    # Usage example:
    #
    #   browser?
    #
    # ===================================================================== #
    when /^browser\??$/i
      e YAML.load_file(project_yaml_directory?+'configuration/browser.yml')
    # ===================================================================== #
    # === one-to-three
    #
    # This will convert from the one-aminoacid letter to the three-aminoacid
    # letter.
    #
    # Usage example:
    #
    #   1to3 KRKAKAGAGAUUGAUGAAGCCACA # => Lys-Arg-Lys-Ala-Lys-Ala-Gly-Ala-Gly-Ala-Sec-Sec-Gly-Ala-Sec-Gly-Ala-Ala-Gly-Cys-Cys-Ala-Cys-Ala
    #
    # ===================================================================== #
    when /^1to3$/i
      e Bioroebe.one_to_three(a?)
    # ===================================================================== #
    # === set_aminoacids
    # ===================================================================== #
    when 'set_aminoacids',
         'aa_seq',
         'aaseq',
         'setaminoacids',
         'setaa',
         'set_aminoacid',
         'set_aa',
         'setamino',
         'setaminoacid',
         'set_aminoacid_sequence'
      set_aminoacids(a?)
    # ===================================================================== #
    # === stop_codons?
    # ===================================================================== #
    when 'stop_codons?',
         /^stopcodons\??$/,
         'scodons?',
         'look_for_stop_codons_in_the_main_sequence',
         /^report(_|-)?all(_|-)?stop(_|-)?codons$/
      report_all_stop_codons
    # ===================================================================== #
    # === version?
    # ===================================================================== #
    when 'version?',
         'version',
         /^feedback(_|-)?version$/i
      feedback_version
    # ===================================================================== #
    # === CpG?
    # ===================================================================== #
    when /^show(_|-)?cpg(_|-)?islands$/,
         'cg?','CG?','CpG?','CpG',
         'cpg?','cpg','cpg_islands',
         'CPG'
      show_cpg_islands
    # ===================================================================== #
    # === is_on_roebe?
    # ===================================================================== #
    when 'is_on_roebe?'
      erev 'Are we on roebe? '+
           verbose_truth(::Bioroebe.is_on_roebe?.to_s)
    # ===================================================================== #
    # === enable_colours
    # ===================================================================== #
    when 'col',
         'enable_colours',
         'enablecolours',
         'ecolours'
      enable_colours
    # ===================================================================== #
    # === enable_colours_in_an_extended_manner
    # ===================================================================== #
    when /enable(_|-| )?colours(_|-| )?in(_|-| )?an(_|-| )?extended(_|-| )?manner$/
      enable_colours_in_an_extended_manner(:be_verbose)
    # ===================================================================== #
    # === deduce_aa_seq?
    #
    # This entry point will show the possible codons that could code for
    # the given aminoacid at hand.
    #
    # Invocation examples:
    #
    #   deduce_this_aminoacid_sequence AARGLKKKLKLMMAAAAA
    #   deduce MTTAGP
    #   deduce MTTAGKLIIBRRSAAP
    #
    # ===================================================================== #
    when /^deduce(_|-| )?this(_|-| )?aminoacid(_|-| )?sequence$/i,
         'deduce',
         'ded',
         'codons',
         'sof',
         'deduce_aa_seq?',
         'sequence_of',
         'sequenceof',
         'peptide',
         'deduce?',
         /^reverse_?DNA$/i,
         /^revseq$/i
      deduce_this_aminoacid_sequence(f)
    # ===================================================================== #
    # === report_main_sequence
    # ===================================================================== #
    when /^report(_|-)?main(_|-)?sequence$/i,
         'report2'
      report_main_sequence
    # ===================================================================== #
    # === stopcodon?
    # ===================================================================== #
    when /^stop_?codon\??/,
         /^determine_?and_?report_?all_?stop_?codons/
      determine_and_report_all_stop_codons
    # ===================================================================== #
    # === what_sequence_is_this?
    # ===================================================================== #
    when 'what_sequence_is_this?',
         'whatsequenceisthis?',
         'whatsequence'
      what_sequence_is_this?
    # ===================================================================== #
    # === tb1
    #
    # This entry point will start the gtk-controller (some gtk-widgets).
    # ===================================================================== #
    when /^tb1$/i
      remote_URL =
        'https://raw.githubusercontent.com/vsbuffalo/bds-files/master/chapter-03-remedial-unix/tb1-protein.fasta'
      cd log_dir?
      esystem 'wget '+remote_URL
      e 'Downloaded into '+sdir(return_pwd)+'.'
    # ===================================================================== #
    # === add_to_start
    # ===================================================================== #
    when /^add(_|-)?start$/i,
         /^add(_|-)?to(_|-)?start$/i,
         'prepend'
        add_to_start(a?)
    # ===================================================================== #
    # === cd                                                       (cd tag)
    #
    # Usage example:
    #
    #   cd /tmp
    #
    # ===================================================================== #
    when 'cd'
      cd(f)
    # ===================================================================== #
    # === blosum62
    # ===================================================================== #
    when /^-?-?blosum62/i
      e 'Showing '+i.delete('-')+' next.'+N+N
      Bioroebe::BlosumParser.show_as_2D_table(i)
    # ===================================================================== #
    # === add_polyA
    # ===================================================================== #
    when 'add_poly_a','add_polyA','polya',
         'addpolya',
         '+polyA',
         'polyA'
      e 'Appending a PolyA sequence to the RNA next (onto @rna).'
      add_poly_a_sequence
    # ===================================================================== #
    # === bioroebe --all_blosum
    # ===================================================================== #
    when /^-?-?all(_|-| )?blosum/i # Show all blosum values here.
      array_all_blosums = %w(
        45 50 62 80 90
      ).map {|entry| entry = entry.dup; entry.prepend('blosum') }
      menu(array_all_blosums)
    # ===================================================================== #
    # === blosum45
    # ===================================================================== #
    when /^-?-?blosum45/i
      e 'Showing '+i.delete('-')+' next.'+N+N
      Bioroebe::BlosumParser.show_as_2D_table(i)
    # ===================================================================== #
    # === blosum50
    # ===================================================================== #
    when /^-?-?blosum50/i
      e 'Showing '+i.delete('-')+' next.'+N+N
      Bioroebe::BlosumParser.show_as_2D_table(i)
    # ===================================================================== #
    # === gc_content?
    #
    # This entry point will calculate the GC content, as a percentage,
    # of the given input sequence. If no input is given then the
    # default DNA sequence will be used (if assigned).
    #
    # Usage example:
    #
    #   GC? ATGGGGGCGCG
    #
    # ===================================================================== #
    when /^gc_?content\??$/i,
         'calculate',
         'cgc',
         'gcontent',
         'gccc',
         /^GC\??$/i,
         'gccontent?',
         'gc_percent',
         'gcpercent'
      calculcate_gc_content(a?) # This variant will be verbose.
    # ===================================================================== #
    # === www_finder
    #
    # Invocation example:
    #
    #   bioroebe --gtk-www-finder
    #
    # ===================================================================== #
    when 'www_finder',
         'wwwfinder',
         'wfind',
         'wfinder',
         /^-?-?gtk(_|-| )?www(_|-| )?finder$/i
      load_gtk
      require 'bioroebe/gui/gtk3/www_finder/www_finder.rb'
      e 'Starting the WWWFinder next.'
      thread = Thread.new { Bioroebe::GUI::Gtk::WwwFinder.run_gtk3_widget }
      thread.join
    # ===================================================================== #
    # === bioroebe --gtk-levensthein
    # ===================================================================== #
    when /^-?-?gtk(_|-| )?levensthein$/i,
         /^-?-?levensthein(_|-| )?gui$/i
      require 'bioroebe/gui/gtk3/levensthein_distance/levensthein_distance.rb'
      Bioroebe::GUI::Gtk::LevenstheinDistance.run
    # ===================================================================== #
    # === count_aminoacids
    # ===================================================================== #
    when 'count_aminoacids',
         'countaminoacids',
         'caminoacids',
         'aminoacid_composition',
         'aminoacidcomposition',
         'acomposition'
      count_amount_of_aminoacids(f)
    # ===================================================================== #
    # === 3iyq.pdb
    # ===================================================================== #
    when '3iyq.pdb'
      download(
        'https://www.rcsb.org/pdb/download/downloadFile.do?fileFormat=fastachain&compression=NO&structureId=3IYR&chainId=B'
      )
    # ===================================================================== #
    # === ubiquitin?
    #
    # This method will simply show the default ubiquitin-sequence.
    # ===================================================================== #
    when 'ubuiquitin?',
         'ubiquitin?',
         'u?',
         'ubiquitin',
         'ub?',
         'return_ubiquitin_sequence',
         'ubi?'
      erev 'N-Terminus '+steelblue(
             ::Bioroebe.return_ubiquitin_sequence
           )+rev+' C-Terminus'
    # ===================================================================== #
    # === KDEL?
    #
    # This entry point will search for a KDEL sequence in the
    # corresponding amino acid sequence.
    #
    # How to test this:
    #
    #   assign AAAAAATTTGGGCCCGCGCCCTTTAAAGATGAACTA; KDEL?
    #
    # ===================================================================== #
    when 'KDEL?',
         'KDEL',
         'find_kdel_sequence'
      find_kdel_sequence
    # ===================================================================== #
    # === bioroebe --blosum80
    # ===================================================================== #
    when /^-?-?blosum80/i
      e 'Showing '+i.delete('-')+' next.'+N+N
      Bioroebe::BlosumParser.show_as_2D_table(i)
    # ===================================================================== #
    # === levensthein
    # ===================================================================== #
    when 'levensthein',
         'lst'
      interactive_use_of_levensthein
    # ===================================================================== #
    # === hamming_distance?
    # ===================================================================== #
    when 'hamming','hamming?',
         /^hamming(_|-| )?distance\??$/,
         /^-?-?hamming$/,
         'the_hamming_distance',
         'align'
      calculate_hamming_distance_of(a?)
    # ===================================================================== #
    # === mass_weight?
    # ===================================================================== #
    when 'mass_weight?',
         'mass_weight',
         'massweight',
         'aa_mass',
         'ma' # Calculate weight of proteins.
      mass_weight(f)
    # ===================================================================== #
    # === show_molweight
    #
    # This entry point will show the molecular weights of the four main
    # DNA bases - Adenin, Guanin, Cytosin and Thymin.
    # ===================================================================== #
    when /^show(_|-)?molweight$/i,
         'molweight?',
         'mweight?',
         'm?'
      show_molweight
    # ===================================================================== #
    # === okular
    # === evince
    #
    # This is mostly so that we can quickly use common .pdf viewers.
    # ===================================================================== #
    when 'okular',
         'evince'
      verbose_handle_this_sys_command(i, a?)
    # ===================================================================== #
    # === RNAfold1
    # ===================================================================== #
    when 'RNAfold1'
      esystem 'RNAfold < test.seq'
    # ===================================================================== #
    # === design_polylinker
    # ===================================================================== #
    when /^design(_|-)?polylinker$/i,
         'polylinker?',
         'mcs',
         'mcs?',
         'primer?'
      e colourize_nucleotide(design_polylinker(f))
    # ===================================================================== #
    # === seqsize2
    # ===================================================================== #
    when /seqsize(\d+)/,
         /seq(\d+?)size\??/ # See: http://rubular.com/r/IDvU2LJBSA for the second regex
      _ = $1.to_s.dup
      case _
      when '2'
        report_size_of_this_sequence seq2?,''
      when '3'
        report_size_of_this_sequence seq3?,''
      when '4'
        report_size_of_this_sequence seq4?,''
      when '5'
        report_size_of_this_sequence seq5?,''
      when '6'
        report_size_of_this_sequence seq6?,''
      end
    # ===================================================================== #
    # === set_locus
    # ===================================================================== #
    when /set_?locus/,
         'locus'
      set_locus(a?) # set_locus NM_021964
    # ===================================================================== #
    # === coding_entry
    #
    # This entry point can be used like this:
    #
    #   coding_entry 51..3251
    #
    # ===================================================================== #
    when /^coding_?entry/
      designate_this_input_as_coding_entry(a?)
    # ===================================================================== #
    # === multiline_fasta
    # ===================================================================== #
    when 'multiline_fasta',
         'multilinefasta',
         'mfasta',
         'm_fasta',
         'multi_assign','multiassign','multifasta',/input_?fasta/
      obtain_multiline_fasta # in fasta.rb
    # ===================================================================== #
    # === prosite
    # ===================================================================== #
    when 'prosite',
         'prosite_homepage'
      e 'PROSITE - a database of protein families and domains.'
      e (_ = Bioroebe.try_to_pass_through_beautiful_url(:prosite))
      open_in_browser _
    # ===================================================================== #
    # === restriction_enzymes_run
    # ===================================================================== #
    when 'test_restriction_enzymes_run','restriction_enzymes_run'
      pp restriction_enzymes_run
    # ===================================================================== #
    # === show_jumper_directories
    # ===================================================================== #
    when 'jumper?','jumpers?','show_jumper_directories',
         'showjumperdirectories'
      show_jumper_directories
    # ===================================================================== #
    # === reset
    # ===================================================================== #
    when 'reset',
         'tabula rasa',
         'tabula_rasa',
         'tabula',
         'clear_aa',
         'cleara',
         'clearaa'
      erev 'Resetting the Bioroebe::Shell now.'
      reset_to_the_initial_state
    # ===================================================================== #
    # === set_highlight_colour
    # ===================================================================== #
    when /^set_?highlight_?colour/,'seek'
      _ = f
      _ = _.to_sym if _
      set_highlight_colour_or_search_for_this_sequence(_)
    # ===================================================================== #
    # === to_DNA
    # ===================================================================== #
    when /^to(_|-| )?DNA/i
      e Bioroebe.to_dna('ACCACACCAUUUCCCAUGGGUGUGUGG') # => "ACCACACCATTTCCCATGGGTGTGTGG"
    # ===================================================================== #
    # === files?
    # ===================================================================== #
    when 'files?',
         'file?',
         'files',
         'feedback_where_files_are_kept_locally',
         'feedbackwherefilesarekeptlocally'
      feedback_where_files_are_kept_locally
    # ===================================================================== #
    # === buffer?
    # ===================================================================== #
    when 'buffer?','b?','show_xorg_buffer2',
         'feedback_whether_we_will_also_set_the_xorg_buffer'
      feedback_whether_we_will_also_set_the_xorg_buffer
      show_xorg_buffer
    # ===================================================================== #
    # === toggle
    # ===================================================================== #
    when 'toggle'
      toggle_xorg_buffer
      buffer?
    # ===================================================================== #
    # === average?
    # ===================================================================== #
    when 'average?',
         'average','avg?',
         'show_average',
         'molecular_weight?','mw', # Perhaps we will move the last entry here.
         /show(_|-)?average(_|-)?weight(_|-)?of(_|-)?a(_|-)?nucleotide$/
      show_average_weight_of_an_aminoacid
      show_average_weight_of_a_nucleotide
    # ===================================================================== #
    # === test
    # ===================================================================== #
    when /test/
      e 'THIS IS A TEST.'
    # ===================================================================== #
    # === sigma?
    # ===================================================================== #
    when 'sigma_tutorial',
         'sigma?',
         'sigmatutorial',
         'sig?',
         'stutorial'
      show_sigma_tutorial
    # ===================================================================== #
    # === stop?
    # ===================================================================== #
    when /^stop\??$/i,
         'BLA',
         'end?'
      if dna_sequence?.empty?
        e 'Please first assign a sequence.'
      else
        e
        report_main_sequence(:stop_codon)
        e
      end
    # ===================================================================== #
    # === mode?
    # ===================================================================== #
    when 'mode?',
         /^report(_|-)?mode$/i
      report_mode
    # ===================================================================== #
    # === todo?
    # ===================================================================== #
    when 'todo?'
      _ = 'https://www.biostars.org/'
      show_todo_file
      erev 'Also consider visiting: '
      e
      erev "  #{_}"
      e
      set_xclip _
    # ===================================================================== #
    # === numbered?
    # ===================================================================== #
    when /^numbered\??/,
         /^with(_|-)?numbers$/i,
         /^show(_|-)?numbered(_|-)?nucleotide(_|-)?positions$/i
      show_numbered_nucleotide_positions
    # ===================================================================== #
    # === padding?
    # ===================================================================== #
    when 'padding?'
      pp padding?
    # ===================================================================== #
    # === Handle +3 and similar instructions
    # ===================================================================== #
    when /^\+(\d+)/ # See http://rubular.com/r/JaeO91V1vt
      add_n_nucleotides($1)
    # ===================================================================== #
    # === highlight
    # ===================================================================== #
    when /^highlight/,'high' # ← This variant is always verbose.
      set_highlight_colour(f, :be_verbose)
    # ===================================================================== #
    # === show_all_codon_tables
    # ===================================================================== #
    when 'show_all_codon_tables',
         'all_codon_tables',
         'atables',
         'alltable?',
         'showallcodontables',
         'codons?',
         'codontables',
         'codontables?',
         'show3',
         'showtables',
         'show_codon_tables'
      show_all_codon_tables
    # ===================================================================== #
    # === seq3?
    # ===================================================================== #
    when 'seq3?','s3?'
      show_seq_3
    # ===================================================================== #
    # === seq4?
    # ===================================================================== #
    when 'seq4?','s4?'
      show_seq_4
    # ===================================================================== #
    # === seq5?
    # ===================================================================== #
    when 'seq5?','s5?'
      show_seq_5
    # ===================================================================== #
    # === seq6?
    # ===================================================================== #
    when 'seq6?','s6?'
      show_seq_6
    # ===================================================================== #
    # === do_analyze_protein_sequence
    # ===================================================================== #
    when 'do_analyze_protein_sequence','do_analyze_sequence',
         'doanalyzesequence','analyze_sequence','analyzesequence'
      do_analyze_sequence
    # ===================================================================== #
    # === glycolysis?
    # ===================================================================== #
    when 'glycolysis?',
         'glykolyse?',
         'glykolyse',
         'glycolysis',
         'glykolysis',
         'display_glycolysis_pathway',
         'glyk?',
         'glyc?'
      display_glycolysis_pathway
    # ===================================================================== #
    # === result?
    # ===================================================================== #
    when 'result?'
      e @internal_hash[:result]
    # ===================================================================== #
    # === cysteines?
    #
    # This entry point will quickly show all cysteines in the given
    # aminoacid sequence. This is meant mostly as a visual aid to
    # the user on the commandline.
    # ===================================================================== #
    when /^-?-?cysteines\??$/i
      _ = aminoacid_sequence? # Get our aminoacid sequence first.
      erev _.to_s.gsub(/C/, gold('C')+rev)
    # ===================================================================== #
    # === Handle -3 and similar instructions
    # ===================================================================== #
    when /^\-(\d+)/
      remove_n_nucleotides($1)
    # ===================================================================== #
    # === pad
    # ===================================================================== #
    when 'pad'
      e pad?+f.to_s
    # ===================================================================== #
    # === ori?
    # ===================================================================== #
    when 'ori?',
         'show_ori_sequences',
         'showorisequences'
      show_ori_sequences
    # ===================================================================== #
    # === short_aa
    # ===================================================================== #
    when 'short_aa',
         'shortaa',
         'shorten_aa'
      dna_to_aminoacid_sequence(a?)
    # ===================================================================== #
    # === add_his_tag
    # ===================================================================== #
    when /add(_|-)?his(_|-)?tag/
      add_his_tag('add 6 random his tags') 
    # ===================================================================== #
    # === names? 
    # ===================================================================== #
    when 'names?'
      show_how_to_use_the_names_for_the_taxonomy_table
    # ===================================================================== #
    # === gem?
    # ===================================================================== #
    when 'gem?','rubygem?',
         /^bioroebe(_|-)?gem/
      remote_URL = 'https://rubygems.org/gems/bioroebe'
      e remote_URL
      open_in_browser(remote_URL) if is_on_roebe?
    # ===================================================================== #
    # === set_download_folder
    # ===================================================================== #
    when /^set(_|-)?download(_|-)?folder$/i,
         'set_download_directory',
         'setdownloaddirectory',
         'setdir'
      set_download_directory(f)
    # ===================================================================== #
    # === parse_taxonomy
    # ===================================================================== #
    when /^parse_?taxonomy/,
         'ptaxo',
         'ptax'
      ParseTaxonomy.new(a?)
    # ===================================================================== #
    # === bisulfite
    #
    # Apply a bisulfite-run against the current sequence at hand.
    #
    # Usage examples:
    #
    #   bisulfite CCCGCAATGCATACCTCGCCG
    #   bis CCCGCAATGCATACCTCGCCG
    #
    # ===================================================================== #
    when /^bisulfite$/,
         /^bis$/
      e format_this_nucleotide_sequence(
          bisulfite(a?)
        )
    # ===================================================================== #
    # === longest_substring?
    #
    # Usage example:
    #
    #   longest_substring? ATGGGAAT GGG
    #
    # ===================================================================== #
    when /^longest(_|-)?substring\??$/,
         /^LCS$/i,
         'McIlroy-Hunt algorithm'
      find_longest_substring_via_LCS(a?)
    # ===================================================================== #
    # === yaml_engine?
    # ===================================================================== #
    when /^yaml(_|-)?engine\??$/i,
         /^report(_|-)?which(_|-)?yaml(_|-)?engine(_|-)?is(_|-)?in(_|-)?use$/, # === report_which_yaml_engine_is_in_use
         /^syck\??$/i
      report_which_yaml_engine_is_in_use
    # ===================================================================== #
    # === ecoli
    # ===================================================================== #
    when /ecoli\??/
      erev '  https://ecocyc.org/'
    # ===================================================================== #
    # === selenocysteine
    # ===================================================================== #
    when /selenocysteine\??/
      erev 'UGA codes for selenocysteine.'
    # ===================================================================== #
    # === aa_analyze?
    # ===================================================================== #
    when 'aa_analyze?',
         'aa_analyze',
         'aminoacid_sequence?',
         /aminoacidsequence\??/,
         'aminoacid_analyze',
         'aminoacidanalyze',
         'protein_composition?',
         'asequence',
         'asequence?'
      show_protein_composition(aminoacid_sequence?)
      molecular_mass_of_amino_acids_in_this_sequence(aminoacid_sequence?)
    # ===================================================================== #
    # === find_TATA
    # ===================================================================== #
    when 'tata?','tata','TATA?',
         /^find(_|-)?TATA\??$/
      search_for_tata_consensus_sequence
    # ===================================================================== #
    # === restore_prompt
    # ===================================================================== #
    when /^restore(_|-)?prompt$/i,
         /^restore(_|-)?default(_|-)?prompt$/i
      restore_default_prompt
    # ===================================================================== #
    # === BASE_DIR
    # ===================================================================== #
    when /^BASE(_|-)?DIR$/i
      e sdir(Bioroebe.base_directory?)
    # ===================================================================== #
    # === histone_table?
    # ===================================================================== #
    when 'histone_table?','htable','show_histone_table','showhistonetable'
      show_histone_table
    # ===================================================================== #
    # === primer
    # ===================================================================== #
    when 'primer'
      primer(f)
    # ===================================================================== #
    # === GFF
    # ===================================================================== #
    when /^GFF\??$/i
      show_information_about_the_gff_format
    # ===================================================================== #
    # === frame1
    # ===================================================================== #
    when 'frame1',
         'f1',
         'f'
      showorf(dna_sequence?, :frame1)
    # ===================================================================== #
    # === open_in_browser
    #
    # Usage example:
    #
    #   oib https://www.uniprot.org/uniprot/P62897
    #
    # ===================================================================== #
    when /^open(_|-)?in(_|-)?browser$/i,
         'oib'
      open_in_browser(a?)
    # ===================================================================== #
    # === composition?
    #
    # This entry point will show the composition of the given DNA sequence
    # at hand.
    # ===================================================================== #
    when /^show(_|-)?composition$/,
         'composition?',
         'composition',
         'comp',
         'compo',
         'compo?',
         'comp?',
         'scompo'
      show_composition
    # ===================================================================== #
    # === load
    # ===================================================================== #
    when 'load',
         /^load(_|-)?from$/i,
         /^use$/i
      load(a?)
    # ===================================================================== #
    # === load_dna
    # ===================================================================== #
    when /^load(_|-)?dna$/i
      load_dna
    # ===================================================================== #
    # === transeq
    # ===================================================================== #
    when 'transeq','transseq','teq'
      i = a?
      i = dna_sequence? unless i
      if i.is_a?(Array) and i.empty?
        i = dna_sequence?
      end
      ::Bioroebe::DnaToAminoacidSequence.new(i) { :be_verbose } # bl dna/dna_to_aminoacid_sequence.rb
    # ===================================================================== #
    # === display_open_reading_frames
    #
    # Usage example:
    #
    #   display_open_reading_frames ATGAGCAAGGCCGACTACGAGAAG
    #
    # ===================================================================== #
    when /^display(_|-)?open(_|-)?reading(_|-)?frames$/i
      display_open_reading_frames(a?) { :show_three_frames }
    # ===================================================================== #
    # === ruler-no-colours
    # ===================================================================== #
    when /^-?-?ruler(_|-)?no(_|-)?colours?$/,
         'ruler2'
      show_sequence_with_a_ruler(first_argument?) { :without_colours }
    # ===================================================================== #
    # === reverse
    # ===================================================================== #
    when 'reverse',
         /^reverse(_|-)?sequence$/,
         'reverse_seq' # This will reverse the complement.
      show_reverse_dna_string
    # ===================================================================== #
    # === reverse!
    # ===================================================================== #
    when 'reverse!'
      set_dna_sequence(return_reverse_dna_string)
    # ===================================================================== #
    # === aasize
    # ===================================================================== #
    when 'aasize',
         'asize',
         'aasize?',
         'aa_size?',
         /^report(_|-)?aminoacid(_|-)?size$/i,
         'reportaasize'
      report_how_many_aminoacids_we_have
    # ===================================================================== #
    # === base_composition
    #
    # Use this like so:
    #
    #    base_composition 10 20 30 40
    #    base_composition 5 5 5 85
    #
    # ===================================================================== #
    when /base_composition/
      hash = {}
      hash[:A] = 0
      hash[:T] = 0
      hash[:C] = 0
      hash[:G] = 0
      hash[:A] = a?[0].to_i
      hash[:T] = a?[1].to_i
      hash[:C] = a?[2].to_i
      hash[:G] = a?[3].to_i
      display_this_sequence(
        Bioroebe.generate_random_dna_sequence(
          :default,
          hash
        )
      )
    # ===================================================================== #
    # === shuffle
    # ===================================================================== #
    when 'shuffle',
         'do_shuffle',
         /^shuffle(_|-)?main(_|-)?string$/i
      shuffle_main_string
    # ===================================================================== #
    # === allweights?
    # ===================================================================== #
    when 'allweights?',
         'allweight',
         'all_weight',
         'allweights',
         'gewicht'
      %w( A T C G U ).each {|entry|
        show_weight_of_this_nucleotide(entry)
      }
    # ===================================================================== #
    # === default
    # ===================================================================== #
    when 'default','def','d' # default action to use.
      i = 'shorten Lys Ser Pro Ser Leu Asn Ala Ala Lys'
      check_input_against_case_menu
    # ===================================================================== #
    # === upcase
    # ===================================================================== #
    when 'upcase',
         'ucase',
         'upcase_main_string',
         'upcasemainstring',
         'uppercase',
         'to_upper',
         'upcas'
      upcase_main_string
    # ===================================================================== #
    # === weight_of_common_proteins?
    #
    # This entry point allows us to show the weight of some common
    # problems, e. g. for easy commandline-display.
    # ===================================================================== #
    when /^weight(_|-)?of(_|-)?common(_|-)?proteins\??/,
         /^show(_|-)?the(_|-)?weight(_|-)?of(_|-)?some(_|-)?common(_|-)?proteins/,
         /^protein(_|-)?mass\??/,
         /^table(_|-)?weights$/i,
         /^weight(_|-)?table$/i,
         'molecular_weights?',
         'sizes?',
         'weights',
         'massweights',
         'molweights?',
         'masssize',
         'showweights',
         'proteins?'
      show_the_weight_of_some_common_proteins
    # ===================================================================== #
    # === protein_weight?
    # ===================================================================== #
    when /^protein(_|-)?weight\??/i,
         /^report(_|-)?the(_|-)?protein(_|-)?weight$/i
      report_the_protein_weight
    # ===================================================================== #
    # === show_weight_of_this_nucleotide
    # ===================================================================== #
    when 'show_weight_of_this_nucleotide',
         'molweight',
         'showweightofthisnucleotide'
      show_weight_of_this_nucleotide(f)
    # ===================================================================== #
    # === weights?
    # ===================================================================== #
    when 'weights?'
      MolecularWeightOfNucleotides.report_weight
    # ===================================================================== #
    # === controller
    #
    # This entry point will start the gtk-controller (some gtk-widgets).
    #
    # Invocation example:
    #
    #   bioroebe --gui
    #
    # ===================================================================== #
    when /^-?-?controller$/i,
         /^-?-?gui$/i,
         /^-?-?gtk(_|-| )?notebook$/i,   # === bioroebe --gtk-notebook
         /^-?-?gtk(_|-| )?controller$/i,
         /^-?-?notebook$/i
      start_gtk_controller
      # =================================================================== #
      # === download                                   (download tag, dl tag)
      #
      # Generic download-related entry point. This can be used like in
      # the following way:
      #
      #   download lambda
      #
      # =================================================================== #
      when /^download$/i
        download(a?)
      # =================================================================== #
      # === download?
      # =================================================================== #
      when 'download?',
           'show_last_downloaded_file',
           'showlastdownloadedfile'
        show_last_downloaded_file
      # =================================================================== #
      # === test
      # =================================================================== #
      when 'test' # Throwaway method for testing.
        # @bioroebe.lazy
        set_dna_sequence '
          ATGTCTGGGGACGCTCCCGATCGGCTCCCGTAACTTACACGGTCTACACAAGACGTGTGTGTATGTCGTCGGACCTTTTAGCTATGAGGCTCGAATGAAGCTACCGAGCCATATCTACGCAGCCTTTTATGGGAACATCAGCATATTTCAATCTACCGCCAGGATGTTGATCCCCGGATGTTAAGGGTTAACCAGTATGATGAACATGGAATTGTGAAGTTACTACGGTTCATTCACGGACGACGCCAAGTTACCATTCTTGCTAACTATCGTCCAGGGATTTTGATATGCATCTGCTCACCTCTGTAGCGGCCTCCCGGAGCTGTCACCACAATC
        '
        e sienna(dna_seq?)
        find_all_orfs
      # =================================================================== #
      # === tphages?
      # =================================================================== #
      when 't-phages?',
         'tphages?',
         /^show(_|-)?t(_|-)?phages$/,
         'tphages',
         'tt','phages?'
      show_t_phages
      # =================================================================== #
      # === raw_sequence?
      # =================================================================== #
      when /^-?-?raw(_|-| )?sequence\??$/i,
           /^-?-?raw(_|-| )?conversion\??$/i
        e sfancy(leading_five_prime)+
          colourize_nucleotide_sequence(
            raw_sequence?, :make_no_modifications
          )+
          sfancy(trailing_three_prime)
    # ===================================================================== #
    # === perform_startup_actions
    # ===================================================================== #
    when /^perform(_|-)?startup(_|-)?actions$/,
         /^startup(_|-)?actions$/
      perform_startup_actions
    # ===================================================================== #
    # === to_fasta
    #
    # toasta is an alias to this entry point.
    # ===================================================================== #
    when /^to(_|-)?f?asta$/i
      to_fasta
    # ===================================================================== #
    # === cat
    # ===================================================================== #
    when 'cat',
         'show_the_content_of_this_file'
      cat(f) # Show the content of a file.
    # ===================================================================== #
    # === blosum?
    # ===================================================================== #
    when 'blosum?',
         'blosum',
         'blosu',
         'blos',
         'blo',
         'bl',
         'b',
         'show_blosum_matrix',
         'matrix',
         'losum'
      show_blosum_matrix
    # ===================================================================== #
    # === debug?
    # ===================================================================== #
    when 'debug?'
      feedback_whether_we_are_in_debug_mode
    # ===================================================================== #
    # === protein_stats?
    # ===================================================================== #
    when 'protein_stats?',
         'protein_stats',
         'pstats?',
         'pstats'
      protein_stats
    # ===================================================================== #
    # === digest
    # ===================================================================== #
    when 'digest',
         /^digest(_|-)?at$/i,
         /^cut(_|-)?with$/i,
         /^cut(_|-)?to$/i
      digest(a?)
    # ===================================================================== #
    # === amino_acids_frequency?
    # ===================================================================== #
    when /^amino(_|-)?acids(_|-)?frequency\??$/i,
         /^show(_|-)?the(_|-)?amino(_|-)?acids(_|-)?frequencies$/i,
         'aa_frequency?',
         'aafrequency?'
      show_the_aminoacids_frequencies
    # ===================================================================== #
    # === basedir?
    # ===================================================================== #
    when /basedir\??/,
         'dir?',
         'base_dir?',
         'log_dir',
         'log_dir?'
      show_config_dir
      show_save_file
      show_log_dir
    # ===================================================================== #
    # === show_log_dir
    # ===================================================================== #
    when /^show(_|-)?log(_|-)?dir$/,
         'logdir?',
         'logdir',
         'sdir?',
         'slog',
         'log?',
         /^-?-?location\??$/i,
         'localdir?'
      show_log_dir
    # ===================================================================== #
    # === set_log_dir
    #
    # This entry point can be used to set a specific log directory
    # from within a running instance of the bioshell.
    #
    # Invocation examples:
    #
    #   set_log_dir /tmp/test
    #   setlogdir /tmp/test
    #
    # ===================================================================== #
    when /^set(_|-)?log(_|-)?dir$/i
      set_log_dir(first_argument?) { :be_verbose }
    # ===================================================================== #
    # === chunked_display
    #
    # Usage example:
    #
    #   cdisplay ATGACAGGACACACTTTTAGCACACACATGACAGGACACACTTTTAGCACACACATGACAGGACACACTTTTAGCACACACATGACAGGACACACTTTTAGCACACACATGACAGGACACACTTTTAGCACACACATGACAGGACACACTTTTAGCACACAC
    #
    # ===================================================================== #
    when /^chunked(_|-)?display$/i,
         'properly_number','cdisplay',
         'chunked',
         'chunk',
         /^beautify(_|-)?body$/
      chunked_display(a?)
    # ===================================================================== #
    # === *
    # ===================================================================== #
    when '*'
      erev 'The occurrence of * in a amino acid sequence denotes a STOP codon.'
    # ===================================================================== #
    # == mmass
    #
    # Usage example:
    #
    #   molmass Glycine
    #
    # ===================================================================== #
    when 'mmasse',
         'molecular_mass_of',
         'molecularmassof',
         'mmase',
         'masse?',
         'molmasse',
         'molmass'
      molecular_mass_of(f)
    # ===================================================================== #
    # === showorf
    # ===================================================================== #
    when /^showorfs?$/,
         'showor',
         'show_orf',
         'show_the_orf'
      showorf(a?)
    # ===================================================================== #
    # === bioshell --permanently-disable-startup-intro
    # ===================================================================== #
    when /^-?-?permanently(_|-)?disable(_|-)?startup(_|-)?intro$/
      permanently_disable_startup_intro
    # ===================================================================== #
    # === startup_info?
    #
    # This entry point exists mostly as a debug-aid.
    # ===================================================================== #
    when /^-?-?startup(_|-)?info\??$/i,
         /^-?-?show(_|-)?startup(_|-)?information$/i,
         /^-?-?show(_|-)?intro$/i,
         /^-?-?sintro$/
      show_startup_information
    # ===================================================================== #
    # === downcase_main_string
    # ===================================================================== #
    when /^downcase(-|_| )?main(-|_| )?string$/,
         /^downcase$/i,
         'dcase',
         'down',
         'lower'
      downcase_main_string
    # ===================================================================== #
    # === silent-startups
    # ===================================================================== #
    when /^-?-?silent(-|_)?startup$/,
         /^-?-?silent$/
      do_a_silent_startup
    # ===================================================================== #
    # === seqsize?
    # ===================================================================== #
    when 'seqsize?'
      e sequence?.to_s.size
    # ===================================================================== #
    # === alu?
    # ===================================================================== #
    when 'alu?',
         'show_alu_sequence',
         'alu_sequence?'
      show_alu_sequence
    # ===================================================================== #
    # === positions?
    # ===================================================================== #
    when 'positions?','positions',
         'show_positions','showpositions',
         'show_position_of_sequence','showpositionofsequence',
         'pos?'
      show_position_of_sequence
    # ===================================================================== #
    # === codon_usage_analyzer
    # ===================================================================== #
    when /^codon_?usage_?analyzer/
      ShowCodonUsage.new(dna_string?)
    # ===================================================================== #
    # === return_all_genes
    # ===================================================================== #
    when 'return_all_genes',
         'returnallgenes'
      return_all_genes
    # ===================================================================== #
    # === install
    # ===================================================================== #
    when 'install'
      install(f)
    # ===================================================================== #
    # === enable
    # ===================================================================== #
    when 'enable',
         'use'
      enable(a?)
    # ===================================================================== #
    # === do_use_expand_cd_aliases
    # ===================================================================== #
    when 'do_use_expand_cd_aliases',
         'douseexpandcdaliases',
         'cdaliases',
         /use(_|-)?expanded(_|-)?aliases$/i # === use_expanded_aliases
      enable :cd_aliases
    # ===================================================================== #
    # === do_not_use_expand_cd_aliases
    # ===================================================================== #
    when 'do_not_use_expand_cd_aliases',
         'no_expand_cd_aliases',
         'no_cd_aliases'
      disable :cd_aliases
    # ===================================================================== #
    # === use_expand_cd_aliases?
    # ===================================================================== #
    when /^use(_|-)?expand(_|-)?cd(_|-)?aliases\??$/i,
         '@use_expand_cd_aliases',
         /^report(_|-)?whether(_|-)?we(_|-)?will(_|-)?make(_|-)?use(_|-)?of(_|-)?expand(_|-)?cd(_|-)?aliases$/i
      report_whether_we_will_make_use_of_expand_cd_aliases
    # ===================================================================== #
    # === pir
    # ===================================================================== #
    when 'pir?',
         'pir'
      e "  #{Bioroebe.try_to_pass_through_beautiful_url('pir').first}"
    # ===================================================================== #
    # === chromosome_table
    # ===================================================================== #
    when /^chromosome(_|-)?table$/i,
         /^show(_|-)?chromosome(_|-)?table$/i
      show_chromosome_table
    # ===================================================================== #
    # === findgene?
    # ===================================================================== #
    when 'findgene?',
         'notify_the_user_as_to_how_findgene_works'
      notify_the_user_as_to_how_findgene_works
    # ===================================================================== #
    # === calculate_exponential_growth
    #
    # Invocation example:
    #
    #   calculate_exponential_growth 1, 10
    #
    # ===================================================================== #
    when /calculate(_|-)?exponential(_|-)?growth$/
      calculate_exponential_growth(first_argument, second_argument)
    # ===================================================================== #
    # === test_help
    # ===================================================================== #
    when 'test_help','testhelp','new_help','newhelp','1'
      ::Bioroebe::Shell::Help[]
    # ===================================================================== #
    # === fasta1
    #
    # This entry point allows us to quickly refer to different
    # FASTA entries from a file, such as:
    #
    #   fasta5 # refers to the 5th entry
    #   fasta6 # refers to the 6th entry
    #   ^^^ and so forth
    #
    # ===================================================================== #
    when /^fasta(\d{1,10})$/i
      try_to_display_this_fasta_entry($1.to_s.dup) { :and_assign_it_as_well }
    # ===================================================================== #
    # === will_we_truncate?
    # ===================================================================== #
    when 'truncate?',
         'will_we_truncate?'
      will_we_truncate?
    # ===================================================================== #
    # === When it starts with one or more numbers, including a ' '.
    #     Example: 100 aa
    # ===================================================================== #
    when /^\d+ aa/ # See: http://rubular.com/r/Lnf2b9RTGP
      case f
      when 'aa'
        create_n_random_amino_acids(_)
      end
    # ===================================================================== #
    # === append_aminoacid
    # ===================================================================== #
    when 'append_aminoacid',
         'add_aa',
         'addaa',
         'append_aa' # Append to aa.
      @internal_hash[:aminoacids] << a
    # ===================================================================== #
    # === find_nls
    # ===================================================================== #
    when 'find_nls',
         'nls',
         'nls_finder',
         'nlsfinder',
         'run_nls_search'
      run_nls_search
    # ===================================================================== #
    # === GFP?
    # ===================================================================== #
    when 'GFP?',
         /^show_?GFP_?sequence$/i,
         /^gfp\??/
      erev "The #{rosybrown('GFP sequence')}#{rev} is:#{N}#{N}"
      show_GFP_sequence
      e
      erev 'Note: If you wish to assign this as the new main nucleotide'
      erev 'sequence, then use this command:'
      e
      erev '  '+sfancy('  assign :GFP')
      e
    # ===================================================================== #
    # === colourize_fasta
    # ===================================================================== #
    when 'colourize_fasta',
         'colourizefasta',
         'colourize_fasta_file',
         'colourizefastafile'
      colourize_fasta_file(a?)
    # ===================================================================== #
    # === urls?
    # ===================================================================== #
    when 'urls?',
         'url?'
      e 'Showing some URLs next:'
      e
      erev '  ftp://ftp.ncbi.nih.gov/genbank/'
      erev '  https://rosalind.info/problems/list-view/'
      erev '  https://biotools.umassmed.edu/bioapps/primer3_www.cgi # Primerdesign'
      e
      pdb_url? # And also show the PDB Url.
    # ===================================================================== #
    # === loxp?
    # ===================================================================== #
    when 'loxp?',
         'loxp'
      erev 'Next showing the loxP sequence:'
      _ = 'ATAACTTCGTATA'
      e
      e sfancy(_)
      e
      find_this_sequence(_) unless dna_sequence?.empty?
    # ===================================================================== #
    # === blast
    # ===================================================================== #
    when 'blast'
      open_blast_webpage
    # ===================================================================== #
    # === telomer?
    # ===================================================================== #
    when 'telomer?',
         'telomere?'
      e padding?+leading_five_prime+'TTAGGG'+trailing_three_prime
    # ===================================================================== #
    # === save_my_file
    # ===================================================================== #
    when /^save(_|-)?my(_|-)?file$/,
         'save'
      save_my_file { :be_verbose }
    # ===================================================================== #
    # === rev?
    # ===================================================================== #
    when 'rev?'
      e 'Testing rev next, the ability to revert to the default colour.'
      pp ::Bioroebe.rev
      if ::Bioroebe.rev.empty?
        e 'Not using any special colours presently.'
      else
        e 'Using special colours.'
      end
      e "Red then revert, if colours are enabled: "\
        "#{swarn('Red then')}#{rev} revert."
    # ===================================================================== #
    # === available_colours?
    # ===================================================================== #
    when /^available_?colours\??/,
         /^show_?html_?colours/,
         'highlight?'
      show_html_colours
    # ===================================================================== #
    # === seq_with_tab?
    # ===================================================================== #
    when /seq_?with_?tab\??/,
         'splitted',
         'splitter'
      show_string { :with_colourized_separator }
    # ===================================================================== #
    # === barrier
    # ===================================================================== #
    when 'barrier','vertical','verti',
         /^add(_|-)?vertical(_|-)?barrier(_|-)?to(_|-)?sequence$/
      add_vertical_barrier_to_sequence(a?)
    # ===================================================================== #
    # === seq5
    # ===================================================================== #
    when /seq5/
      @internal_hash[:array_sequences[4]] = only_valid_dna_nucleotides(a?)
    # ===================================================================== #
    # === pdf_tutorial
    # ===================================================================== #
    when 'generate_pdf_tutorial',
         'generatepdftutorial',
         'generate_pdf_documentation',
         'gpdf',
         'pdf_tutorial',
         'create_pdf'
      erev 'Next creating a .pdf file that includes the Tutorial.'
      generate_pdf_tutorial
    # ===================================================================== #
    # === GenbankFlatFileFormatGenerator
    # ===================================================================== #
    when /^Genbank_?Flat_?File_?Format_?Generator/i
      if File.exist? f
        object = GenbankFlatFileFormatGenerator.new(f)
        pp object
      else
        no_file_exists_at(f)
      end
    # ===================================================================== #
    # === bla
    # ===================================================================== #
    when 'bla' # This is just a test.
      e Bioroebe.store_here?
      e Bioroebe.log_dir
    # ===================================================================== #
    # === debug_seq?
    # ===================================================================== #
    when 'debug_seq?'
      pp string? # Show in a "debug" variant.
    # ===================================================================== #
    # === lernen
    # ===================================================================== #
    when 'lernen'
      _ = 'https://www.biostars.org/'
      e 'Now opening '+_
      open_in_browser(_)
    # ===================================================================== #
    # === peroxisome_pts1
    # ===================================================================== #
    when 'peroxisome_pts1'
      erev '-Ser-Lys-Leu-COOH'
    # ===================================================================== #
    # === atp_cost?
    #
    # Usage example:
    #
    #   atp_cost? 2
    #
    # ===================================================================== #
    when 'atp_cost?',
         'atpcost?',
         'atpcost',
         'atp?'
      calculate_atp_cost_for(a?)
    # ===================================================================== #
    # === vectors?
    # ===================================================================== #
    when /^-?-?vectors\??/,
         /^-?-?show_?available_?vectors?/,
         /^-?-?show_?vector/
      show_available_vectors # show_available_vectors
    # ===================================================================== #
    # === seq3
    # ===================================================================== #
    when /seq3/
      @internal_hash[:array_sequences[2]] = only_valid_dna_nucleotides(a?)
    # ===================================================================== #
    # === seq4
    # ===================================================================== #
    when /seq4/
      @internal_hash[:array_sequences[3]] = only_valid_dna_nucleotides(a?)
    # ===================================================================== #
    # === agarose_table
    # ===================================================================== #
    when /agarose_?table/,
         /show_?agarose_?table/,
         /show_?agarose_?concentration/,
         'agarose'
      show_agarose_table
    # ===================================================================== #
    # === gene_name
    # ===================================================================== #
    when /gene_?name/,
         /set_?name_?of_?gene/,
         'gename',
         'set_name',
         'setname',
         'genename?',
         'setgene',
         'setgen',
         /name_?of_?gene/
      set_name_of_gene(a?)
    # ===================================================================== #
    # === codon_headers
    # ===================================================================== #
    when /codon(_|-)?headers/i,
         'codon_tables_headers',
         'codontablesheaders',
         'headercodon',
         'ctables',
         /^show(_|-)?all(_|-)?codon(_|-)?tables$/i
      show_all_codon_tables(:headers)
    # ===================================================================== #
    # === save?
    # ===================================================================== #
    when 'save?',
         /show_?save_?file/
      show_save_file
    # ===================================================================== #
    # === human_genome_version?
    #
    # Simply show the current human genome version.
    # ===================================================================== #
    when /human(_|-)?genome(_|-)?version\??/,
         /show(_|-)?human(_|-)?genome(_|-)?version$/i
      show_human_genome_version
    # ===================================================================== #
    # === show_aminoacids_residues
    # ===================================================================== #
    when /^show(_|-)?aminoacids(_|-)?residues$/i
      show_aminoacids_residues
    # ===================================================================== #
    # === save_here
    # ===================================================================== #
    when 'save_here',
         'savehere',
         /report(_|-| )?where(_|-| )?we(_|-| )?store$/i
      set_save_file(:default)
      report_where_we_store
    # ===================================================================== #
    # === show_codon_usage
    #
    # This entry point allows the user to analyse the codon usage of
    # the given argument.
    # ===================================================================== #
    when /codon(_|-| )?usage$/i,
         /show(_|-| )?codon(_|-| )?usage$/i,
         'cusage',
         'codo',
         'susage',
         /^-?-?codonusage\??$/i
      show_codon_usage(all_arguments?)
    # ===================================================================== #
    # === quit
    #
    # This entry point will honour all valid ways to exit,
    # store in the constant VALID_WAYS_TO_EXIT.
    # ===================================================================== #
    when *VALID_WAYS_TO_EXIT # bl $BIOROEBE/constants/constants.rb
      do_quit # Quit tag.
    else # else tag
      i = i.first if i.is_a? Array
      return if i.nil?
      # =================================================================== #
      # === First check whether we have a global environment variable.
      #
      # If so then this will be converted.
      # =================================================================== #
      i = convert_global_env(i) if i.to_s.include? '$'
      # =================================================================== #
      # === Handle ExpandCdAliases next
      #
      # Next, check whether we can use the cd-aliases.
      # =================================================================== #
      if use_expand_cd_aliases? and is_this_a_cd_alias?(i)
        target = ::Rcfiles::DirectoryAliases[i]
        cd(target)
      # =================================================================== #
      # === Handle existing local .pdb files next
      #
      # Since as of July 2022 this will also consider downloading
      # a remote .pdb file, if no such file exists yet - not in
      # this clause, but in the very next clause.
      # =================================================================== #
      elsif i and i.end_with?('.pdb') and File.exist?(i)
        parse_pdb_file(i)
      # =================================================================== #
      # === Download missing .pdb files here
      #
      # This must be closely kept in sync with the entry clause above.
      #
      # Usage example:
      #
      #   1hzh.pdb
      #
      # =================================================================== #
      elsif i.end_with?('.pdb') and !File.exist?(i.downcase)
        i = i.downcase
        unless File.exist?(::Bioroebe.pdb_directory?+File.basename(i))
          _result = download_this_pdb_file(i)
        else
          e 'The file already exists at `'+
             sfile(::Bioroebe.pdb_directory?+File.basename(i))+'`.'
        end
      # =================================================================== #
      # === Handle sequence assignments
      #
      # This entry clause is entered if the input consists of only valid
      # DNA nucleotides. Since as of December 2021 we will ignore
      # newlines that are part of the input sequence.
      #
      # Example to enter this clause:
      #
      #   ATGAGCAAGGCCGACTACGAGAAG
      #
      # =================================================================== #
      elsif only_valid_dna_nucleotides?(i.delete('-'))
        set_dna_sequence(i.delete('-'), :be_verbose) { :show_the_sequence_as_well }
      # =================================================================== #
      # === Handle downcased sequence assignments as well
      # =================================================================== #
      elsif only_valid_dna_nucleotides?(i.upcase.delete('-'))
        set_dna_sequence(i.upcase.delete('-'), :be_verbose)
      # =================================================================== #
      # === Handle input such as "227 / 3"
      # =================================================================== #
      elsif i.include?('/') and (i =~ /\d+/)
        result = eval(i)
        e result
      # =================================================================== #
      # === Intercept 3' input given to us.
      # =================================================================== #
      elsif original_input.to_s.strip.start_with?("3'-") # 3'-ATGCCTGCC
        find_complementary_strand(original_input)
      # =================================================================== #
      # === Handle WWW entries by opening them in the browser     (www tag)
      #
      # This includes "https" evidently as well.
      # =================================================================== #
      elsif i.start_with?('http')
        open_in_browser(i)
      # =================================================================== #
      # === Check for Aminoacids
      #
      # Check whether the input could be an Aminoacid such as Glycine.
      # =================================================================== #
      elsif could_this_be_an_amino_acid?(i)
        report_everything_about_this_amino_acid(i)
      # =================================================================== #
      # === Check for numbers as input only
      # =================================================================== #
      elsif (i =~ /^\d+$/) and (not main_sequence?.empty?)
        # ================================================================= #
        # Ok, the user did input only numbers. Display these numbers,
        # assumed to refer to the main sequence.
        # ================================================================= #
        _ = main_sequence?
        end_point = i.to_s.to_i - 1
        _ = _[0, end_point] # Must deduct one because we start nucleotide counting at nucleotide 1.
        erev properly_padded_dna_string(_)
      # =================================================================== #
      # === Handle remote fasta files and so forth
      # =================================================================== #
      elsif i.start_with?('http') and
          ( i.end_with?('.fasta') or i.end_with?('.fa') )
        erev 'We have encountered a remote file (fasta). We '\
             'will download it now.'
        this_file = download(i) # Also return this file.
        parse_fasta_format(this_file)
      # =================================================================== #
      # === Handle input starting with @
      # =================================================================== #
      elsif i.start_with? '@'
        e self.instance_variable_get(i)
      # =================================================================== #
      # === Handle nucleotide sequences next
      # =================================================================== #
      elsif is_all_upcase?(i) and only_valid_nucleotides?(i) and !i.empty?
        assign_dna_sequence(i, :be_verbose)
      # =================================================================== #
      # === Handle NCBI links next
      # =================================================================== #
      elsif i.start_with?('http://www.ncbi.') or
            i.start_with?('https://www.ncbi.')
        erev 'Identified a NCBI link. Will assume that this is a '\
             'fasta sequence'
        erev 'and delegate into the method called download_fasta().'
        download_fasta(i)
      # =================================================================== #
      # === Handle fasta input here if the file exists locally (files)
      #
      # This subsection will test for input that is about locally
      # existing files.
      # =================================================================== #
      elsif File.exist?(i) and !File.directory?(i)
        extname = File.extname(i).delete('.')
        case extname
        # ================================================================= #
        # === ps
        # ================================================================= #
        when 'ps' # check for .ps file type
          esystem "gv #{i}"
        # ================================================================= #
        # === fasta
        # ================================================================= #
        when 'fasta','fa'
          parse_fasta_format(i)
        else
          string_to_run = i.to_s+' '+f.to_s
          esystem(string_to_run)
        end
      # =================================================================== #
      # === Handle restriction enzymes
      # =================================================================== #
      elsif i.end_with?('?') or i.include?('Restriction') # if last character is a '?' character.
        @internal_hash[:result] = try_to_find_this_restriction_enzyme(i)
      # =================================================================== #
      # === Handle codons
      # =================================================================== #
      elsif (i.size == 3) and is_this_a_valid_codon?(i)
        e Bioroebe.dna_to_aminoacid_sequence(i)
      # =================================================================== #
      # === Next handle matches against the full line
      #
      # The input is: cytochrome c
      #
      # =================================================================== #
      elsif (original_input =~ /^-?-?cytochrome(_|-| )?c$/i)
        path = download(:cytochrome_c_protein_sequence)
        if File.exist? path
          parse_this_fasta_sequence(path)
        end
      else
        # ================================================================= #
        # === Check whether a local file exists like that
        #
        # The following code will check whether a file exists with the
        # same name in the log-directory. If so then it will be assigned
        # as input-name. Since this may be problematic, we put it into
        # the "else" clause.
        # ================================================================= #
        unless File.exist? i
          if File.exist?(::Bioroebe.log_dir?+i) and 
             File.file?(::Bioroebe.log_dir?+i) # ← Ensure that it really is a file.
            handle_this_file(::Bioroebe.log_dir?+i)
          end
        end
        # =================================================================== #
        # === Handle the case when we did not find the command
        #
        # This here is the final step - if we could not find anything
        # to do with the given input, we will report this to the user.
        # After all, perhaps he made a typo.
        # =================================================================== #
        if report_if_we_did_not_find_the_command # ← FINAL CHECK HERE
          # ================================================================= #
          # Handle .fasta or .fa files in a special way.
          # ================================================================= #
          unless i.empty?
            if i.end_with?('.fasta','fa') and !File.exist?(i)
              # ============================================================= #
              # In this case, try to also find a file with that name in the
              # log-directory of BioRoebe. That way, a user can just
              # copy/paste any URL or local path, and BioRoebe will try to
              # find a file that matches to this input.
              # ============================================================= #
              possible_location = log_dir?+File.basename(i)
              if File.exist? possible_location
                erev 'The given input was not found. However had, the '\
                     'same file was found at:'
                e "  #{sfancy(possible_location)}"
                erev 'This file will be used next.'
                handle_this_fasta_file(possible_location)
                return
              end
            end
            report_this_input_was_not_found(original_input)
          end
        end
      end
    end
  end
end

#runmode_is_commandline?Boolean

#

runmode_is_commandline?

#

Returns:

  • (Boolean)


10130
10131
10132
# File 'lib/bioroebe/shell/shell.rb', line 10130

def runmode_is_commandline?
  runmode? == :commandline
end

#salt_adjusted_tm(i) ⇒ Object

#

salt_adjusted_tm

#


6153
6154
6155
6156
6157
6158
# File 'lib/bioroebe/shell/shell.rb', line 6153

def salt_adjusted_tm(i)
  if i.is_a? Array
    i = i.join.strip
  end
  return ::Bioroebe.salt_adjusted_tm(i)
end

#sanitize_input(i) ⇒ Object

#

sanitize_input

Right now this method only gets rid of ‘-’ but check if the string contains ‘-’ first before calling this method.

#


8302
8303
8304
# File 'lib/bioroebe/shell/shell.rb', line 8302

def sanitize_input(i)
  i.tr('-','')
end

#sanitize_nucleotide_sequence(i) ⇒ Object

#

sanitize_nucleotide_sequence

Invocation example:

sanitize_nucleotide_sequence "  10 AGTA \n  20 TTGC"
#


11204
11205
11206
11207
11208
11209
11210
# File 'lib/bioroebe/shell/shell.rb', line 11204

def sanitize_nucleotide_sequence(i)
  if i.is_a? Array
    i = i.join
  end
  @result = ::Bioroebe::SanitizeNucleotideSequence.new(i).result?.delete('"')
  set_dna_sequence(@result)
end

#save_file?Boolean

#

save_file?

#

Returns:

  • (Boolean)


5702
5703
5704
# File 'lib/bioroebe/shell/shell.rb', line 5702

def save_file?
  @internal_hash[:save_file]
end

#save_history_to_file(dataset = ) ⇒ Object

#

save_history_to_file

This method will save the history to a local file.

#


8166
8167
8168
8169
8170
8171
8172
# File 'lib/bioroebe/shell/shell.rb', line 8166

def save_history_to_file(
    dataset = array_history?[0..-2]
  )
  what = YAML.dump(dataset) # Save all but the last entry. Last entry will be "replay" usually.
  into = "#{log_dir?}replay_file.yml"
  write_what_into(what, into)
end

#save_my_file(&block) ⇒ Object

#

save_my_file (save tag)

We .strip on the @sequence because I think it is better to not have any padding on it.

#


2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
# File 'lib/bioroebe/shell/shell.rb', line 2999

def save_my_file(&block)
  _ = dna_sequence_as_string?
  if _.empty?
    erev 'Can not save anything as the main string is empty.'
  else
    erev 'Saving the main string now into the file `'+
          sfile(save_file?)+
          rev+'`.'
    save_file(_.strip, save_file?)
  end # string must be empty.
end

#say_goodbyeObject

#

say_goodbye

#


3275
3276
3277
3278
3279
# File 'lib/bioroebe/shell/shell.rb', line 3275

def say_goodbye
  _ = ' '+version?.to_s
  _ = '' if _.size == 1
  erev "Bye from the BioShell#{_}!"
end

#scan_for_gff_filesObject

#

scan_for_gff_files

#


5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
# File 'lib/bioroebe/shell/shell.rb', line 5614

def scan_for_gff_files
  results_for_gff_files  = Dir['*.gff']
  results_for_gff3_files = Dir['*.gff3']
  unless results_for_gff_files.empty?
    erev 'There are '+sfancy(results_for_gff_files.size.to_s)+rev+
         ' .gff files in the current directory.'
  end
  unless results_for_gff3_files.empty?
    erev 'There are '+sfancy(results_for_gff3_files.size.to_s)+
         ' .gff3 files in the current directory.'
    erev 'We will simply pass the first entry there into '\
         'class Bioroebe::Parser::GFF.'
    parse_this_gff_file(results_for_gff3_files.first)
  end
end

#scan_for_leucine_zippers(i = amino_acid_sequence? ) ⇒ Object

#

scan_for_leucine_zippers

What is a leucine zipper?

https://en.wikipedia.org/wiki/Leucine_zipper
#


9364
9365
9366
9367
9368
9369
9370
9371
9372
9373
9374
9375
9376
9377
9378
9379
9380
# File 'lib/bioroebe/shell/shell.rb', line 9364

def scan_for_leucine_zippers(
    i = amino_acid_sequence?
  )
  if i.nil?
    i = amino_acid_sequence?
  end
  chars = i.chars
  # ======================================================================= #
  # We start to count at the first leucine zipper.
  # ======================================================================= #
  index = chars.index('L')
  erev 'The string '+simp(i)+rev+' has these at every 7th step.'
  print '  ' # Leading indent.
  (index..chars.size).step(7) {|token|
    print simp(chars[token]),' '
  }; e # And a final newline.
end

#scan_or_parse_for_this_gff_file_or_any_gff_file(i) ⇒ Object

#

scan_or_parse_for_this_gff_file_or_any_gff_file

#


5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
# File 'lib/bioroebe/shell/shell.rb', line 5633

def scan_or_parse_for_this_gff_file_or_any_gff_file(i)
  if i.is_a? Array
    i.each {|entry|
      if entry.nil?
        scan_for_gff_files
      else
        scan_or_parse_for_this_gff_file_or_any_gff_file(entry)
      end
    }
  else
    if File.exist? i.to_s
      parse_this_gff_file(i)
    else # else scan for any .gff or .gff3 file.
      scan_for_gff_files
    end
  end
end

#search_for(i, be_verbose = true) ⇒ Object

#

search_for (search_for tag)

This method essentially combines the two methods set_search_for() and start_search().

#


3166
3167
3168
3169
3170
3171
3172
3173
3174
# File 'lib/bioroebe/shell/shell.rb', line 3166

def search_for(
    i, be_verbose = true
  )
  if i.is_a? Array
    i = i.join(' ').strip
  end
  set_search_for(i, be_verbose)
  start_search(be_verbose)
end

#search_for?Boolean

#

search_for?

This method can be queried from the interactive-bioshell via:

search_for?
#

Returns:

  • (Boolean)


7395
7396
7397
# File 'lib/bioroebe/shell/shell.rb', line 7395

def search_for?
  @internal_hash[:search_for]
end

#search_for_known_promotersObject

#

search_for_known_promoters

This method will attempt to identify promoter elements.

#


3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
# File 'lib/bioroebe/shell/shell.rb', line 3148

def search_for_known_promoters
  erev 'Next searching for known promoters.'
  e
  erev "35S Promoter (#{sfancy('TGAGACTTTT')}#{rev}):"
  how_many_35S_promoters_are_in_the_sequence = 
    search_for 'TGAGACTTTT', :be_quiet
  if how_many_35S_promoters_are_in_the_sequence > 0
    erev 'There appears to be at the least one 35S promoter '\
         'in the target sequence.' 
  end
end

#search_for_nucleotide_sequence(i) ⇒ Object

#

search_for_nucleotide_sequence

This method will use the NCBI interface to search for nucleotide sequences.

Usage example:

snuc lady slipper orchid
#


7984
7985
7986
7987
# File 'lib/bioroebe/shell/shell.rb', line 7984

def search_for_nucleotide_sequence(i)
  i = i.join '+' if i.is_a? Array
  open_in_browser "https://www.ncbi.nlm.nih.gov/nucgss?term=#{i}"
end

#search_for_tata_consensus_sequenceObject

#

search_for_tata_consensus_sequence

Use this method to search for a TATA consensus sequence in the target string (the so-called “TATA box”). The TATA box is an AT-rich sequence that can be found upstream of the transcription start site.

A short overview of this sequence format can be found here:

https://en.wikiversity.org/wiki/Gene_transcriptions/Boxes/TATA#Consensus_sequence

The major consensus sequence is:

3'-TATAAA-5'

This is just the major one; there are variants of this sequences such as

3'-TATAAA(A)AAA-5'

And similar variants.

Usage example:

set_string GGGCTATAAAAATTGGGATATAAAATTGTATATA; find_TATA?
#


10061
10062
10063
10064
10065
10066
10067
10068
10069
10070
10071
10072
10073
10074
10075
10076
10077
10078
10079
10080
10081
10082
10083
10084
10085
10086
10087
10088
10089
10090
10091
10092
10093
10094
10095
10096
10097
10098
10099
10100
10101
10102
# File 'lib/bioroebe/shell/shell.rb', line 10061

def search_for_tata_consensus_sequence
  full_sequence = sequence? # Grab hold of the sequence.
  # ======================================================================= #
  # Next define our TATA box which we will try to discover:
  # ======================================================================= #
  tata_box_sequence = 'TATAAA'
  results = full_sequence.scan(/#{tata_box_sequence}/)
  if results.empty?
    erev 'Our target string (length: '+full_sequenze.size.to_s+') '\
         'does not include `'+
         simp(tata_box_sequence)+rev+'`.'
  else
    n_results = results.size.to_s # <- Determine how many matches were found.
    erev "We did find #{simp(n_results)} "\
         "#{sfancy(tata_box_sequence)}#{rev} entries."
    erev 'Their starting positions are at:'
    array = []
    splitted_sequence = full_sequence.split(//)
    splitted_sequence.each_with_index {|entry, index|
      case entry
      when 'T' # This could be a TATA sequence.
        # ================================================================= #
        # Next we will compare whether the sequence matches.
        # ================================================================= #
        subsequence = full_sequence[index, tata_box_sequence.size]
        if tata_box_sequence == subsequence
          array << index # <- Append into our Array here.
        end
      end
    }
    e
    print '  '
    pp array
    # ===================================================================== #
    # As of May 2016 we will also use find() to find the TATA box.
    # ===================================================================== #
    e
    erev 'We will also show the sequence in a highlighted manner next:'
    e
    try_to_find_restriction_enzymes_for(tata_box_sequence)
  end
end

#search_sequence_for_open_reading_frames(i = :default, use_which_frame = :frame1, use_this_start_codon = :default) ⇒ Object

#

search_sequence_for_open_reading_frames

Use this method to search for Open Reading Frames (i.e. “AUG” codons).

Since we use Bioroebe.start_codon?, this may also default to another start codon.

#


5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
# File 'lib/bioroebe/shell/shell.rb', line 5457

def search_sequence_for_open_reading_frames(
    i                    = :default,
    use_which_frame      = :frame1,
    use_this_start_codon = :default
  )
  case use_this_start_codon
  # ======================================================================= #
  # === :default
  # ======================================================================= #
  when :default
    use_this_start_codon = ::Bioroebe.start_codon?
  end
  case i
  # ======================================================================= #
  # === :default
  # ======================================================================= #
  when :default
    i = string?
  end
  i.upcase!
  if i
    if i.include? use_this_start_codon # This asks whether the string includes 'ATG'.
      report_n_start_codons # Will report how many Start sequences we have.
      e
      erev "These can be found (and will start) at these positions"
      erev "(later shown via red colour):#{N}#{N}"
      copy = i.to_s.dup # Work on a copy here.
      if use_which_frame == :frame2 # Chop off the first entry then.
        copy[0,1] = ''
      end
      # =================================================================== #
      # We will search for both ATG and AUG though, respectively the
      # input variants given to us. If the following regex appears to
      # be complicated to you, here is the old variant for the regex:
      #
      #   use_this_regex = /(ATG|AUG)/i
      #
      # =================================================================== #
      array_results = []
      array_results << Bioroebe.return_array_of_sequence_matches(copy, use_this_start_codon)
      if use_this_start_codon.include? 'T'
        array_results << Bioroebe.return_array_of_sequence_matches(copy, use_this_start_codon.tr('T','U'))
      end
      array_results.flatten!
      array_results.compact!
      # =================================================================== #
      # This will hold data such as:
      #   [16, ["ATG"]]
      # At the least up until April 2020, before it was changed.
      # =================================================================== #
      return array_results
    else
      []
    end
  else
    ewarn 'It seems as if you have not yet assigned a string.'
    ewarn 'You could run "random" to assign a random string.'
  end
end

#second_argument?Boolean Also known as: second_argument

#

second_argument?

#

Returns:

  • (Boolean)


7454
7455
7456
# File 'lib/bioroebe/shell/shell.rb', line 7454

def second_argument?
  @internal_hash[:all_arguments][1]
end

#sequence_2Object Also known as: seq2, seq2?

#

sequence2

#


7019
7020
7021
# File 'lib/bioroebe/shell/shell.rb', line 7019

def sequence_2
  @sequence_2.to_str
end

#sequence_3Object Also known as: seq3, seq3?

#

sequence3

#


6987
6988
6989
# File 'lib/bioroebe/shell/shell.rb', line 6987

def sequence_3
  @sequence_3.to_str
end

#sequence_4Object Also known as: seq4, seq4?

#

sequence4

#


6995
6996
6997
# File 'lib/bioroebe/shell/shell.rb', line 6995

def sequence_4
  @sequence_4.to_str
end

#sequence_5Object Also known as: seq5, seq5?

#

sequence5

#


7003
7004
7005
# File 'lib/bioroebe/shell/shell.rb', line 7003

def sequence_5
  @sequence_5.to_str
end

#sequence_6Object Also known as: seq6, seq6?

#

sequence6

#


7011
7012
7013
# File 'lib/bioroebe/shell/shell.rb', line 7011

def sequence_6
  @sequence_6.to_str
end

#set_aminoacids(i = :random, how_many_to_generate = :default, be_verbose = true) ⇒ Object Also known as: assign_aminoacid_sequence, assign_protein_sequence, set_aminoacid_sequence

#

set_aminoacids (assign protein tag, set aminoacids tag)

Assign a protein sequence here. The first argument shall be the aminoacid sequence in question.

Usage example:

assign_protein FLIMVSPTAYHQNKDECWRGX*
#


1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
# File 'lib/bioroebe/shell/shell.rb', line 1075

def set_aminoacids(
    i                    = :random,
    how_many_to_generate = :default, # Will only be applied if the input is :random or :generate
    be_verbose           = true
  )
  case how_many_to_generate
  # ======================================================================= #
  # === :default
  # ======================================================================= #
  when :default
    how_many_to_generate = 1000
  end
  # ======================================================================= #
  # === Sanitize the third argument next
  # ======================================================================= #
  case be_verbose
  when :be_silent,
       :be_quiet
    be_verbose = false
  end
  i = :random unless i
  case i
  # ======================================================================= #
  # === :random
  # ======================================================================= #
  when :random,
       :generate 
    i = Bioroebe.create_random_aminoacids(how_many_to_generate) # Generate them here.
  end
  i = i.join if i.is_a? Array
  if i.is_a?(String) and i =~ /^\d+$/ # only numbers
    i = Bioroebe.create_random_aminoacids(i)
  end
  if i.is_a? String # Convert it into a Sequence object here.
    i = ::Bioroebe.sequence(i) { :aminoacid }
  end
  i = i.dup
  if i.is_a?(Bioroebe::ConvertThisCodonToThatAminoacid)
    i = i.sequence?
  end
  i.upcase!
  if be_verbose
    erev "Now assigning aminoacid sequence to: #{sfancy(i.to_s)}"
  end
  # ======================================================================= #
  # Do the assignment next.
  # ======================================================================= #
  if @internal_hash[:array_aminoacid_sequence].empty?
    @internal_hash[:array_aminoacid_sequence] << i
  else
    @internal_hash[:array_aminoacid_sequence].pop
    @internal_hash[:array_aminoacid_sequence] << i
  end 
end

#set_codon_table(i) ⇒ Object

#

set_codon_table

Set which codon table to use.

#


3090
3091
3092
# File 'lib/bioroebe/shell/shell.rb', line 3090

def set_codon_table(i)
  ::Bioroebe.set_codon_table(i, :be_verbose) # defined in codon_table.rb
end

#set_default_highlight_colourObject

#

set_default_highlight_colour

#


8670
8671
8672
# File 'lib/bioroebe/shell/shell.rb', line 8670

def set_default_highlight_colour
  @highlight_colour = Colours::YELLOW # So to avoid a warning if we were to use the method.
end

#set_default_length(i = DEFAULT_LENGTH_FOR_DNA, be_verbose = false) ⇒ Object Also known as: set_maxlength

#

set_default_length

#


7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
# File 'lib/bioroebe/shell/shell.rb', line 7128

def set_default_length(
    i          = DEFAULT_LENGTH_FOR_DNA,
    be_verbose = false
  )
  case be_verbose
  when :be_verbose
    be_verbose = true
  end
  if i.is_a? Array
    i = i.join(' ').strip
  end
  i = i.to_i
  if be_verbose
    erev 'Setting to a default length of `'+simp(i.to_s)+rev+'` next.'
  end
  @internal_hash[:default_length] = i
end

#set_download_directory(i = ::Bioroebe.log_dir?) ⇒ Object

#

set_download_directory

#


10270
10271
10272
10273
10274
10275
10276
# File 'lib/bioroebe/shell/shell.rb', line 10270

def set_download_directory(
    i = ::Bioroebe.log_dir?
  )
  i = i.to_s
  erev "Setting the download directory to #{simp(i)}#{rev} next:"
  ::Bioroebe.set_log_dir(i)
end

#set_exit_gracefullyObject

#

set_exit_gracefully

#


9960
9961
9962
# File 'lib/bioroebe/shell/shell.rb', line 9960

def set_exit_gracefully
  @internal_hash[:exit_the_shell_how] = :exit_gracefully
end

#set_highlight_colour(i = :violet, be_verbose = false) ⇒ Object

#

set_highlight_colour

You can use this method to highlight different substrings.

#


9588
9589
9590
9591
9592
9593
9594
9595
9596
9597
9598
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
9614
9615
# File 'lib/bioroebe/shell/shell.rb', line 9588

def set_highlight_colour(
    i          = :violet,
    be_verbose = false
  )
  if be_verbose == :be_verbose
    be_verbose = true
  end
  i = i.to_s unless i.is_a? String
  case i
  when 'random'
    i = ::Colours.random_html_colour
  end
  if i
    if be_verbose
      erev "We will use the colour #{sfancy(i.to_s)}#{rev}"\
           " for highlighting important subsequences."
    end
    if ::Colours.respond_to? i
      i = ::Colours.send(i) # Assume that the user wants to use a KDE Konsole colour.
    else # else Konsole does not respond to this particular colour.
      erev "You are trying to use the colour #{i}"
      erev 'This is not part of the Colours namespace, though. '\
           'If you are trying to use a'
      erev 'colour, you may want to pick another colour.'
    end
  end
  @highlight_colour = i
end

#set_highlight_colour_or_search_for_this_sequence(i, be_verbose = false) ⇒ Object

#

set_highlight_colour_or_search_for_this_sequence

#


9520
9521
9522
9523
9524
9525
9526
9527
9528
9529
9530
9531
# File 'lib/bioroebe/shell/shell.rb', line 9520

def set_highlight_colour_or_search_for_this_sequence(
    i, be_verbose = false
  )
  # ======================================================================= #
  # First check if the input consists of only upcased characters.
  # ======================================================================= #
  if (i == i.upcase)
    report_main_sequence(i)
  else
    set_highlight_colour(i, be_verbose)
  end
end

#set_jumper_directory(i) ⇒ Object

#

set_jumper_directory

#


9791
9792
9793
9794
9795
9796
# File 'lib/bioroebe/shell/shell.rb', line 9791

def set_jumper_directory(i)
  if i
    erev 'Adding '+sdir(i)+' to the jumper directories.'
    @internal_hash[:array_jumper_directories] << i
  end
end

#set_locus(i) ⇒ Object

#

set_locus

#


7567
7568
7569
# File 'lib/bioroebe/shell/shell.rb', line 7567

def set_locus(i)
  @internal_hash[:locus] = i
end

#set_log_dir(i = first_argument? ) ⇒ Object

#

set_log_dir

#


2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
# File 'lib/bioroebe/shell/shell.rb', line 2575

def set_log_dir(
    i = first_argument?
  )
  i = i.dup if i.frozen?
  i << '/' unless i.end_with? '/'
  # ======================================================================= #
  # === Handle blocks next
  # ======================================================================= #
  if block_given?
    yielded = yield
    case yielded
    when :be_verbose
      erev 'Will be using '+sdir(i)+rev+' as the new log-directory.'
    end
  end
  unless File.directory? i
    mkdir(i)
  end
  ::Bioroebe.set_log_dir(i)
end

#set_mode(i = :dna) ⇒ Object

#

set_mode

#


10849
10850
10851
10852
10853
10854
10855
# File 'lib/bioroebe/shell/shell.rb', line 10849

def set_mode(i = :dna)
  case i
  when :protein, :proteins # Aliases.
    i = :aminoacids
  end
  @internal_hash[:mode] = i
end

#set_name_of_gene(i = '', be_verbose = :be_verbose) ⇒ Object

#

set_name_of_gene

Use this method to set the name of a gene in question.

#


6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
# File 'lib/bioroebe/shell/shell.rb', line 6420

def set_name_of_gene(
    i          = '',
    be_verbose = :be_verbose
  )
  case be_verbose
  when :be_verbose
    be_verbose = true
  end
  if i.is_a? Array # We don't want Arrays here.
    i = i.join(' ').strip
  end
  if i.nil? or i.to_s.empty?
    erev 'Please assign a non-empty name for the gene.'
    return
  end
  if be_verbose
    erev 'Now assigning the gene name to "'+simp(i)+rev+'", without '\
         'the quotes.'
  end
  sequence_object?.name_of_gene = i
end

#set_nucleotide_sequence(i = nil, be_verbose = false, do_upcase = :check_for_config_value_here, &block) ⇒ Object Also known as: set_dna_sequence, set_DNA_sequence, assign_sequence, set_sequence, assign_dna_sequence, assign_this_dna_sequence, assign, set_dna_string, set_string, set_main_sequence, set_dna, set_assign, set_raw_sequence

#

set_nucleotide_sequence (assign tag, assigning tag)

This method can be used to set/assign to the main DNA string in use, also called the “main nucleotide sequence”.

This method is fairly long, mostly because it will do lots of additional tasks, way aside from setting/assigning to a DNA sequence only. This makes it a bit difficult to change, so ideally we should avoid adding code that is not really necessary here.

Since as of June 2016, the method will also keep a backup of the generated sequence in a local file as well. This will allow us to “replay” the given sequence on startup of the shell.

Note that as of Jun 2016, we will chop off any ‘“’ found in the input String.

#


11231
11232
11233
11234
11235
11236
11237
11238
11239
11240
11241
11242
11243
11244
11245
11246
11247
11248
11249
11250
11251
11252
11253
11254
11255
11256
11257
11258
11259
11260
11261
11262
11263
11264
11265
11266
11267
11268
11269
11270
11271
11272
11273
11274
11275
11276
11277
11278
11279
11280
11281
11282
11283
11284
11285
11286
11287
11288
11289
11290
11291
11292
11293
11294
11295
11296
11297
11298
11299
11300
11301
11302
11303
11304
11305
11306
11307
11308
11309
11310
11311
11312
11313
11314
11315
11316
11317
11318
11319
11320
11321
11322
11323
11324
11325
11326
11327
11328
11329
11330
11331
11332
11333
11334
11335
11336
11337
11338
11339
11340
11341
11342
11343
11344
11345
11346
11347
11348
11349
11350
11351
11352
11353
11354
11355
11356
11357
11358
11359
11360
11361
11362
11363
11364
11365
11366
11367
11368
11369
11370
11371
11372
11373
11374
11375
11376
11377
11378
11379
11380
11381
11382
11383
11384
11385
11386
11387
11388
11389
11390
11391
11392
11393
11394
11395
11396
11397
11398
11399
11400
11401
11402
11403
11404
11405
11406
11407
11408
11409
11410
11411
11412
11413
11414
11415
11416
11417
11418
11419
11420
11421
11422
11423
11424
11425
11426
11427
11428
11429
11430
11431
11432
11433
11434
11435
11436
11437
11438
11439
11440
11441
11442
11443
11444
11445
11446
11447
11448
11449
11450
11451
11452
11453
11454
11455
11456
11457
11458
11459
11460
11461
11462
11463
11464
11465
11466
11467
11468
11469
11470
11471
11472
11473
11474
11475
11476
11477
11478
11479
11480
11481
11482
11483
11484
11485
11486
11487
# File 'lib/bioroebe/shell/shell.rb', line 11231

def set_nucleotide_sequence(
    i          = nil,
    be_verbose = false,
    do_upcase  = :check_for_config_value_here,
    &block
  )
  # ======================================================================= #
  # First check whether the main sequence is frozen:
  # ======================================================================= #
  if is_the_main_sequence_frozen?
    report_that_the_main_sequence_is_frozen
    return
  end
  case do_upcase
  # ======================================================================= #
  # === :check_for_config_value_here
  # ======================================================================= #
  when :check_for_config_value_here,
       :default
    if @configuration and @configuration.respond_to?(:upcase_nucleotides)
      do_upcase = @configuration.upcase_nucleotides
    else
      do_upcase = false
    end
  # ======================================================================= #
  # === :do_not_upcase
  # ======================================================================= #
  when :do_not_upcase
    do_upcase = false
  end
  # ======================================================================= #
  # === Sanitize the second variable next
  # ======================================================================= #
  case be_verbose
  # ======================================================================= #
  # === :be_verbose
  # ======================================================================= #
  when :be_verbose
    be_verbose = true
  # ======================================================================= #
  # === :do_not_upcase
  # ======================================================================= #
  when :do_not_upcase,
       :no_upcase,
       :no_upcasing,
    shall_we_upcase = false
    be_verbose = true # Sync this.
  # ======================================================================= #
  # === :be_silent
  # ======================================================================= #
  when :be_silent,
       :be_quiet
    be_verbose = false
  end
  # ======================================================================= #
  # === Convert Array into String next
  # ======================================================================= #
  i = i.join if i.is_a? Array
  # ======================================================================= #
  # === Handle Fasta format next (the input may be an Integer, so we have
  #     to use .to_s here)
  # ======================================================================= #
  if i and i.to_s.start_with?('>') and i.to_s.include?(N)
    erev 'It seems as if you have a FASTA sequence there, as it '\
         'starts with a > character.'
    erev 'We will omit this first section (the header) though.'
    i[0 .. i.index(N)] = '' # This does the chop-off action.
  end
  if i.nil?
    # ===================================================================== #
    # === Hande nil value for the variable i next:
    #
    # In this entry point, we will handle if the first input argument
    # is nil.
    #
    # If @internal_hash[:misc_sequence] is NOT nil, then it will be used
    # once, then cleared. Otherwise, we will use dna_sequence?.
    # ===================================================================== #
    if @internal_hash[:misc_sequence]
      i = @internal_hash[:misc_sequence]
      @internal_hash[:misc_sequence] = nil # Set it to nil again.
    else
      i = dna_sequence?
    end
  end
  if i and i.to_s.include? ' ' # Sanitize the input a little bit.
    i = i.strip.delete(' ')
  end
  if i.to_s.include? '|' # I think we will not need '|' in our main string.
    i.delete!('|')
  end
  # ======================================================================= #
  # === If the input has only numbers
  # ======================================================================= #
  if i.is_a?(Numeric) or (i =~ /^\d+$/)
    i = random_dna_sequence(i)
  end
  i = i.to_s # Work on a String past this point here.
  # ======================================================================= #
  # Assume a file was given. Read its content then.
  # ======================================================================= #
  if File.exist?(i)
    if i.end_with? '.yml'
      i = YAML.load_file(i)
    else
      i = File.readlines(i).reject {|line|
        line.start_with? '>'
      }.join
    end
  end
  # ======================================================================= #
  # Unfreeze Strings if necessary:
  # ======================================================================= #
  i = i.dup if i.frozen?
  if i.nil? or i.empty?
    erev 'Missing Input to set_nucleotide_sequence(). Please input '\
         'your DNA string now (Hitting the enter key will finish this):'
    i = $stdin.gets.chomp
    i = i.upcase if shall_we_upcase
  end
  # ======================================================================= #
  # === Handle special sequences (nucleotide sequences) next
  # ======================================================================= #
  case i
  # ======================================================================= #
  # === :GFP
  #
  # Usage example:
  #
  #   setsequence :GFP
  #
  # ======================================================================= #
  when ':GFP' # ← This means the default GFP sequence.
    i = return_default_GFP_sequence
  # ======================================================================= #
  # === random
  #
  # Usage example:
  #
  #   setsequence random
  #
  # ======================================================================= #
  when /^random$/i,
       '' # As of 04.01.2015, we will try '' too here.
    i = return_a_random_sequence_of_n_nucleotides
  # ======================================================================= #
  # === multiline
  # ======================================================================= #
  when 'multiline' # Handle multiline input.
    erev 'Multiline input detected.'
    erev 'Finish by issuing __ on an empty line. (These are 2 "_" tokens.)'
    i = $stdin.gets('__')
    # ===================================================================== #
    # Next, sanitize it a bit if it starts with a '>' identifier.
    # ===================================================================== #
    if i.strip.start_with? '>'
      i = i[(i.index(N)+1)..-1]
    end
  end
  # ======================================================================= #
  # Also get rid of numbers.
  # ======================================================================= #
  i.gsub!(/\d/,'')
  i.delete!('-') if i.include? '-'
  i.delete!('_') if i.include? '_' # Don't want '_' characters.
  i.delete!('?') if i.include? '?'
  i.delete!('#') if i.include? '#' # This was added at 08.05.2016.
  i.delete!('"') if i.include? '"' # This was added at 02.06.2016.
  # ======================================================================= #
  # === Remove possible newlines in the given input
  # ======================================================================= #
  i.delete!(N)   if i.include? N
  # i.delete!('_') if i.include? '_'
  i.gsub!(/\^C/,'') if i.include? '^C'
  # ======================================================================= #
  # === Next upcase the input if the flag was set
  # ======================================================================= #
  if do_upcase
    i.upcase!
  end
  # ======================================================================= #
  # === Check for verbosity next:
  # ======================================================================= #
  if be_verbose
    msg = 'Assigning a '.dup
    if mode? == :dna
      msg << 'DNA '
    end
    msg << "sequence next, containing "\
           "#{steelblue(i.size.to_s)}#{rev} nucleotides."
    # ===================================================================== #
    # === Report that we will perform an assignment next in this case
    #  ==================================================================== #
    erev msg
  end
  # ======================================================================= #
  # === :coding_area
  #
  # Whenever the DNA sequence is modified like that, we will also reset
  # the "coding_area" entry in the internal Hash to the initial nil state.
  # ======================================================================= #
  @internal_hash[:coding_area] = nil if i and !i.empty?
  # ======================================================================= #
  # Finally assign it to the last nucleotide sequence:
  # ======================================================================= #
  last_nucleotide_sequence?.set_sequence(i)
  # ======================================================================= #
  # Next we will save into a file, but not empty nucleotide Strings,
  # hence the check:
  # ======================================================================= #
  unless i.empty?
    # ===================================================================== #
    # We will save into a file next.
    # ===================================================================== #
    this_file = "#{log_dir?}bioshell/dna_string.yml"
    last_nucleotide_sequence?.save_sequence_to_this_file(this_file) # Save it here.
  end
  # ======================================================================= #
  # === "Automatically" update the aminoacid sequence as well
  #     afterwards:
  # ======================================================================= #
  aminoacid_sequence = translate_dna_into_aminoacid(i)
  set_aminoacids(aminoacid_sequence, :default, :be_quiet) # Second argument is n aminoacids to generate.
  # ======================================================================= #
  # Since as of Jun 2016, we will also create a new RNA string.
  #
  # This has been disabled as of December 2021. It was too strange
  # to automatically create a RNA string. One may question whether
  # the aminoacid sequence should be automatically created, but I
  # found this to be useful, so who knows - perhaps creating a
  # corresponding RNA sequence may be re-added one day in the
  # future.
  # ======================================================================= #
  # if @internal_hash[:array_rna_sequence]
  #   @internal_hash[:array_rna_sequence].last.set_sequence(result)
  # end
  # ======================================================================= #
  # === Set the Xorg Buffer next, if the configuration mandates this
  # ======================================================================= #
  if @configuration and @configuration.respond_to?(:additionally_set_xorg_buffer) and
     @configuration.additionally_set_xorg_buffer
    begin
      set_xorg_buffer(i)
    rescue NoMethodError; end
  end
  if block_given?
    yielded = yield
    case yielded
    # ===================================================================== #
    # === :show_the_sequence_as_well
    # ===================================================================== #
    when :show_the_sequence_as_well
      show_DNA_sequence
    end
  end
  return i # And return it, just in case.
end

#set_padding(i = DEFAULT_PADDING, be_verbose = :be_quiet) ⇒ Object

#

set_padding

This method allows us to set the default (left) padding that we may display for DNA strings.

#


4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
# File 'lib/bioroebe/shell/shell.rb', line 4299

def set_padding(
    i          = DEFAULT_PADDING,
    be_verbose = :be_quiet
  )
  case be_verbose
  when :be_quiet
    be_verbose = false
  when :be_verbose
    be_verbose = true
  end
  case i.to_s
  when /(\d{1,3})/
    i = ' ' * $1.to_s.dup.to_i
  when 'default'
    i = DEFAULT_PADDING
  end
  if be_verbose
    erev 'The new padding will have '+sfancy(i.count(' ').to_s)+rev+
         ' space characters.'
  end
  @internal_hash[:padding] = i
end

#set_random_aminoacidsObject

#

set_random_aminoacids

Simply delegate to set_aminoacids.

#


7590
7591
7592
# File 'lib/bioroebe/shell/shell.rb', line 7590

def set_random_aminoacids
  set_aminoacids :random
end

#set_result(i) ⇒ Object

#

set_result

#


820
821
822
# File 'lib/bioroebe/shell/shell.rb', line 820

def set_result(i)
  @internal_hash[:result] = i
end

#set_save_file(i = :default) ⇒ Object

#

set_save_file

#


5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
# File 'lib/bioroebe/shell/shell.rb', line 5675

def set_save_file(
    i = :default
  )
  case i
  # ======================================================================= #
  # === :default_fasta
  # ======================================================================= #
  when :default_fasta
    i = return_pwd+'standard_fasta.fa'
  # ======================================================================= #
  # === :pwd
  # ======================================================================= #
  when :pwd
    return_pwd+File.basename(save_file?)
  # ======================================================================= #
  # === :default
  # ======================================================================= #
  when :default
    i = Bioroebe.log_dir?+
        File.basename(save_file?)
  end
  @internal_hash[:save_file] = i
end

#set_search_for(i, be_verbose = true) ⇒ Object Also known as: set_search_string

#

set_search_for

This setter-method can be used to designate for which subsequence we may search-for, if this is necessary, e. g. to detect “AUG” in a sequence of “GGCAUGGGC”.

#


7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
# File 'lib/bioroebe/shell/shell.rb', line 7996

def set_search_for(
    i, be_verbose = true
  )
  case be_verbose
  when :be_quiet
    be_verbose = false
  end
  i = i.join if i.is_a? Array
  if be_verbose
    erev "We will now search for: #{simp(i.to_s)}" if i
  end
  @internal_hash[:search_for] = i
end

#set_sequence_2(i = '') ⇒ Object

#

set_sequence_2

#


8376
8377
8378
8379
8380
8381
# File 'lib/bioroebe/shell/shell.rb', line 8376

def set_sequence_2(i = '')
  i = i.join(' ').strip if i.is_a? Array
  i.delete!(N)
  i = i.to_str unless i.is_a? String
  @sequence_2 = ::Bioroebe.sequence(i)
end

#set_sequence_3(i = '') ⇒ Object

#

set_sequence_3

#


8386
8387
8388
8389
8390
8391
# File 'lib/bioroebe/shell/shell.rb', line 8386

def set_sequence_3(i = '')
  i = i.join(' ').strip if i.is_a? Array
  i.delete!(N)
  i = i.to_str unless i.is_a? String
  @sequence_3 = ::Bioroebe.sequence(i)
end

#set_sequence_4(i = '') ⇒ Object

#

set_sequence_4

#


8396
8397
8398
8399
8400
8401
# File 'lib/bioroebe/shell/shell.rb', line 8396

def set_sequence_4(i = '')
  i = i.join(' ').strip if i.is_a? Array
  i.delete!(N)
  i = i.to_str unless i.is_a? String
  @sequence_4 = ::Bioroebe.sequence(i)
end

#set_sequence_5(i = '') ⇒ Object

#

set_sequence_5

#


8406
8407
8408
8409
8410
8411
# File 'lib/bioroebe/shell/shell.rb', line 8406

def set_sequence_5(i = '')
  i = i.join(' ').strip if i.is_a? Array
  i.delete!(N)
  i = i.to_str unless i.is_a? String
  @sequence_5 = ::Bioroebe.sequence(i)
end

#set_sequence_6(i = '') ⇒ Object

#

set_sequence_6

#


5165
5166
5167
5168
5169
5170
# File 'lib/bioroebe/shell/shell.rb', line 5165

def set_sequence_6(i = '')
  i = i.join(' ').strip if i.is_a? Array
  i.delete!(N)
  i = i.to_str unless i.is_a? String
  @sequence_6 = ::Bioroebe.sequence(i)
end

#set_start_codon(i = nil) ⇒ Object

#

set_start_codon

If you wish to use another start codon, this is the right method.

#


9703
9704
9705
9706
9707
9708
9709
9710
9711
9712
9713
# File 'lib/bioroebe/shell/shell.rb', line 9703

def set_start_codon(i = nil)
  i = i.to_s
  i.tr!('U','T')
  if i.empty?
    erev 'Please assign a non-empty start codon.'
  else
    erev 'Setting to use this as start codon next: '+
          simp(i)
    ::Bioroebe.set_start_codon(i)
  end
end

#set_use_this_prompt(i = NAME_OF_BIO_SHELL) ⇒ Object Also known as: set_prompt

#

set_use_this_prompt

This method can be used to set the prompt of the bio-shell.

#


9387
9388
9389
9390
9391
9392
9393
9394
9395
9396
9397
9398
9399
9400
9401
9402
9403
9404
9405
9406
9407
9408
9409
9410
9411
9412
9413
# File 'lib/bioroebe/shell/shell.rb', line 9387

def set_use_this_prompt(i = NAME_OF_BIO_SHELL)
  case i # case tag
  # ======================================================================= #
  # === NONE
  # ======================================================================= #
  when /^NONE$/i,
       'empty',
       :empty
    i = "\n"
    do_not_use_working_directory_as_prompt
  # ======================================================================= #
  # === pwd
  # ======================================================================= #
  when 'pwd', :cwd, nil 
    i = return_default_prompt
    do_use_working_directory_as_prompt
  # ======================================================================= #
  # === REVERT
  # ======================================================================= #
  when /^REVERT$/i,
       /^DEFAULT$/i,
       :default
    i = NAME_OF_BIO_SHELL
    do_not_use_working_directory_as_prompt
  end
  @internal_hash[:prompt_to_use] = i
end

#set_user_input(i) ⇒ Object

#

set_user_input

#


11750
11751
11752
# File 'lib/bioroebe/shell/shell.rb', line 11750

def set_user_input(i)
  @internal_hash[:user_input] = i
end

#set_xclip(i = dna_string? ) ⇒ Object

#

set_xclip (xclip tag, xorg tag, buffer tag)

Use this method to assign to the Linux Xorg Buffer.

By default we will assign the DNA nucleotide sequence to be the new buffer.

#


5076
5077
5078
5079
5080
# File 'lib/bioroebe/shell/shell.rb', line 5076

def set_xclip(
    i = dna_string?
  )
  XorgBuffer.set_xorg_buffer(i)
end

#setup_readlineObject

#

setup_readline

We will make use of the constant COMPLETION_PROC for the readline component.

#


66
67
68
69
# File 'lib/bioroebe/shell/readline.rb', line 66

def setup_readline
  Readline.completion_append_character = ' '
  Readline.completion_proc = COMPLETION_PROC
end

#shorten_aminoacid(these_aminoacids = aminoacid_sequence? ) ⇒ Object

#

shorten_aminoacid

This method will translate an Aminoacid from Lys to K.

Usage example:

shorten Lys Val His His Leu Met Ala Ala Lys
#


2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
# File 'lib/bioroebe/shell/shell.rb', line 2153

def shorten_aminoacid(
    these_aminoacids = aminoacid_sequence?
  )
  unless these_aminoacids
    erev 'Please either assign an aminoacid sequence prior to invoking'
    erev 'this method or simply pass in the aminoacids that you wish'
    erev 'to short. Example:'
    erev '  shorten Lys Val His'
    return
  end
  erev N+'Now translating three letter Aminoacid to their one '\
       'letter representation: '+N+'  '+sfancy(these_aminoacids)+rev+N
  if these_aminoacids.include? ' '
    these_aminoacids.delete!(' ') # get rid of ' '
  end
  if these_aminoacids.include? '-'
    these_aminoacids = sanitize_input(these_aminoacids)
  end
  # ========================================================================= #
  # Instantiate a new Bioroebe object next.
  # ========================================================================= #
  @bioroebe = ::Bioroebe.new(these_aminoacids)
  erev '  '+@bioroebe.three_to_one+N
  _ = @bioroebe.three_to_one
  e
  erev 'Next we will show the available codons for these aminoacids:'
  e
  _.scan(/./).each { |f|
    erev '  '+f+' -> '+
         '['+@bioroebe.aminoacid_to_codon(f).join(', ')+']'
  }
  e
end

#show(i) ⇒ Object

#

show (show tag)

Bundle together some show-related methods.

#


1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
# File 'lib/bioroebe/shell/shell.rb', line 1818

def show(i)
  i = i.join(' ').strip if i.is_a? Array
  case i
  when 'codon_table','codon','codon table'
    show_codon_table
  when 'blosum','blosum matrix','blosum_matrix'
    show_blosum_matrix
  when '',nil # Empty or nil.
    show_dna_string
  end
end

#show_2D_dotplot(string1 = nil, string2 = nil) ⇒ Object

#

show_2D_dotplot

#


2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
# File 'lib/bioroebe/shell/shell.rb', line 2315

def show_2D_dotplot(
    string1 = nil, string2 = nil
  )
  if string1.nil? and string2.nil?
    erev 'You want to use a dotplot.'
    erev 'Please provide the first string, which will be on the left side:'
    string1 = $stdin.gets.chomp
    erev 'Please provide the second string, which will be on the top side:'
    string2 = $stdin.gets.chomp
  end
  ::Bioroebe::AdvancedDotplot.new(string1, string2)
end

#show_agarose_tableObject

#

show_agarose_table

This method will simply show common agarose concentrations.

#


4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
# File 'lib/bioroebe/shell/shell.rb', line 4713

def show_agarose_table
  hash = load_bioroebe_yaml_file(:agarose)
  e
  e 'Agarose concentrations:'
  e
  hash.each_pair {|concentration_of_the_gel, kb_fragment|
    erev '  A concentration of '+simp(concentration_of_the_gel.to_s+'%')+
         rev+' will separate DNA fragments between '+sfancy(kb_fragment)+
         rev+' kb.'
  }; e
end

#show_all_codon_tables(show_what = :everything) ⇒ Object

#

show_all_codon_tables

We used to tap into the Bio::CodonTable here for this part.

But since some time, we no longer depend on this part - we have made available all of this in yaml files.

The argument to this method can either be:

:everything
:only_names

The first one is the default. This means that we will show everything.

The second version is useful if you only what to report the names of the codon table in question. Several aliases exist for the second invocation.

#


6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
# File 'lib/bioroebe/shell/shell.rb', line 6595

def show_all_codon_tables(
    show_what = :everything
  )
  unless Bioroebe.const_defined? :ShowCodonTables
    require 'bioroebe/codons/show_codon_tables.rb'
  end
  e
  ::Bioroebe::ShowCodonTables.new(show_what)
  e
end

#show_all_deducible_aminoacid_sequences(i = dna_sequence_as_string?, , also_show_numbers = true, show_translations_aligned = true) ⇒ Object

#

show_all_deducible_aminoacid_sequences

Note that if the string is too short, we won’t display the other frames.

If the third argument, ‘show_translations_aligned`, is set to true then we will additionally display all 3 frames aligned one to another.

Usage example:

toproteins AUG
toproteins AUGAUGUUGAAU
toproteins AUG-AUG-UUG-AAA-GGU-CGC-AAU-STOP
#


5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
# File 'lib/bioroebe/shell/shell.rb', line 5291

def show_all_deducible_aminoacid_sequences(
    i                         = dna_sequence_as_string?,
    also_show_numbers         = true,
    show_translations_aligned = true
  )
  if i and i.is_a?(Array) and i.empty?
    i = dna_sequence_as_string?
  end
  i = dna_sequence_as_string? if i.nil?
  i = i.join(' ').strip if i.is_a? Array
  i = i.to_s.dup # To avoid nil-operations.
  i.delete!('-') if i.include? '-'
  if i.empty? # This means that the user has not yet assigned a DNA sequence.
    erev 'Please assign some DNA sequence. You can also randomly generate'
    erev 'a new sequence via "random".'
    return
  end
  cliner
  erev N+'The amino acid sequence for '+sfancy('Frame 1')+rev+' is: '
  e
  converted_sequence_for_frame_1 = translate_dna_into_aminoacid(i).to_s
  erev '  '+converted_sequence_for_frame_1+N+N
  # ======================================================================= #
  # === Also show numbers
  # ======================================================================= #
  if also_show_numbers
    verbose_report_numbered_amino_acid_sequence(converted_sequence_for_frame_1)
  end
  cliner
  if i && i.size > 2
    erev N+N+'The amino acid sequence for '+sfancy('Frame 2')+rev+' is: '
    e
    converted_sequence_for_frame_2 = translate_dna_into_aminoacid_frame2(i)
    erev '  '+converted_sequence_for_frame_2+N+N
    if also_show_numbers
      verbose_report_numbered_amino_acid_sequence(converted_sequence_for_frame_2, '2')
    end
    cliner
    e
    erev N+N+'The amino acid sequence for '+sfancy('Frame 3')+rev+' is: '
    e
    converted_sequence_for_frame_3 = translate_dna_into_aminoacid_frame3(i)
    erev '  '+converted_sequence_for_frame_3+N+N
    if also_show_numbers
      verbose_report_numbered_amino_acid_sequence(converted_sequence_for_frame_3, '3')
    end
    e
    cliner
    if show_translations_aligned
      showorf(i) # Delegate into class Showorf here.
    end
  end
end

#show_all_dmp_filesObject

#

show_all_dmp_files

Show all .dmp files here.

#


2237
2238
2239
# File 'lib/bioroebe/shell/shell.rb', line 2237

def show_all_dmp_files
  show_directory_content('.dmp')
end

#show_all_pathwaysObject

#

show_all_pathways

Simply show all Pathways.

#


1439
1440
1441
# File 'lib/bioroebe/shell/shell.rb', line 1439

def show_all_pathways
  ::Bioroebe::Pathways.show_all_pathways
end

#show_all_yaml_filesObject

#

show_all_yaml_files

We show which yaml files we will use here.

#


2380
2381
2382
2383
2384
2385
# File 'lib/bioroebe/shell/shell.rb', line 2380

def show_all_yaml_files
  erev 'The file that holds our restriction enzymes can be found here:'
  e
  erev "  #{sfile(::Bioroebe.restriction_enzymes_file)}"
  e
end

#show_alu_sequenceObject

#

show_alu_sequence

Invoke this method by doing something like:

alu_sequence?
#


1495
1496
1497
1498
1499
1500
1501
# File 'lib/bioroebe/shell/shell.rb', line 1495

def show_alu_sequence
  fasta_dataset = ::Bioroebe.parse_fasta(FILE_ALU_ELEMENTS)
  _ = fasta_dataset.fasta_sequence
  erev 'The ALU sequence in humans may be this (length: '+
        sfancy(_.size.to_s)+rev+'):'
  erev'  '+simp(_)
end

#show_aminoacid_sequenceObject

#

show_aminoacid_sequence

To show the aminoacid sequence, do:

show_aa
#


10691
10692
10693
10694
# File 'lib/bioroebe/shell/shell.rb', line 10691

def show_aminoacid_sequence
  erev padding?+
       aminoacid_sequence? # aminoacids? # Will also use some padding.
end

#show_aminoacids_mass_tableObject Also known as: aminoacid_table_overview

#

show_aminoacids_mass_table

This shows the weight of the aminoacids, in a table-layout.

#


1428
1429
1430
1431
# File 'lib/bioroebe/shell/shell.rb', line 1428

def show_aminoacids_mass_table
  AminoacidsMassTable.report_which_file_is_used
  AminoacidsMassTable.show(padding?) # bl aminoacids_mass_table.rb
end

#show_aminoacids_residuesObject

#

show_aminoacids_residues

#


1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
# File 'lib/bioroebe/shell/shell.rb', line 1279

def show_aminoacids_residues
  _ = ''.dup
  _ << "#{rev}The aminoacid residues are:\n\n"
  ENGLISH_LONG_NAMES_FOR_THE_AMINO_ACIDS.each {|this_aminoacid|
    _ << this_aminoacid.ljust(14)+': '+
         simp(AMINO_ACIDS_RESTE[this_aminoacid.downcase])+N # Must downcase.
  }
  _ << N
  e _
end

#show_and_calculate_weight_of_dna_string(i = dna_sequence_object? ) ⇒ Object

#

show_and_calculate_weight_of_dna_string

#


10144
10145
10146
10147
10148
10149
10150
10151
10152
10153
10154
10155
10156
10157
10158
10159
10160
10161
10162
10163
10164
10165
10166
10167
10168
10169
10170
10171
10172
# File 'lib/bioroebe/shell/shell.rb', line 10144

def show_and_calculate_weight_of_dna_string(
    i = dna_sequence_object?
  )
  i = dna_sequence_object? if i.nil?
  i = dna_sequence_object? if is_a? Array and i.empty?
  sum = 0
  i.upcase.chars.each {|nucleotide|
    _ = case nucleotide
    when 'A'
      weight_of_adenin?
    when 'T'
      weight_of_thymin?
    when 'C'
      weight_of_cytosin?
    when 'G'
      weight_of_guanin?
    when 'U'
      weight_of_uracil?
    end
    sum += _.to_f
  }
  # ======================================================================= #
  # Round the sum properly here.
  # ======================================================================= #
  sum = sum.round(2)
  erev 'The weight of this nucleotide sequence ('+i.size.to_s+
       ' entries) is: '+
       simp(sum.to_s)+rev+' Dalton.'
end

#show_and_calculate_weight_of_dna_string_or_aminoacid_sequence(i = dna_sequence_object? ) ⇒ Object

#

show_and_calculate_weight_of_dna_string_or_aminoacid_sequence

#


2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
# File 'lib/bioroebe/shell/shell.rb', line 2634

def show_and_calculate_weight_of_dna_string_or_aminoacid_sequence(
    i = dna_sequence_object?
  )
  if i.nil?
    if dna_sequence_object?
      i = dna_sequence_object?
    end
  end
  # ======================================================================= #
  # First, we check if the input is an aminoacid-sequence.
  # ======================================================================= #
  if ::Bioroebe.is_aminoacid?(i)
    reverse = AMINO_ACIDS_ENGLISH.reverse
    i = reverse[i] # Replace it with the one-letter code next.
    # ===================================================================== #
    # Obtain the mass of this aminoacid.
    # ===================================================================== #
    i = AMINO_ACIDS_AVERAGE_MASS_TABLE[i]
    erev 'The weight of this aminoacid is: '+
          simp(i.to_s)+rev+' Dalton.'
  else
    show_and_calculate_weight_of_dna_string(i)
  end
end

#show_available_vectorsObject

#

show_available_vectors

#


7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
# File 'lib/bioroebe/shell/shell.rb', line 7352

def show_available_vectors
  erev 'We will next try to show the available vectors.'
  erev 'For now, these are all file names that start with the '\
       'the prefix '+orange('vector_')+rev+'.'
  _ = return_available_vectors # Defined in bioroebe/shell.rb
  if _.empty?
    erev 'No vector-sequence was found.'
  else
    erev 'We found at the least one entry.'
    print '  '
    pp _
    erev 'Assigning the first one to the second sequence.'
    set_sequence_2(Bioroebe::Sequence.sequence_from_file(_.first))
    erev 'You can feedback this sequence via:'
    e
    erev '  seq2?'
    e
  end
end

#show_average_weight_of_a_nucleotideObject

#

show_average_weight_of_a_nucleotide

The formulat was obtained from the following website:

http://www.biophp.org/minitools/useful_formulas/demo.php
#


10182
10183
10184
10185
# File 'lib/bioroebe/shell/shell.rb', line 10182

def show_average_weight_of_a_nucleotide
  erev 'The average molecular weight (MW) of dsDNA is '+sfancy('660')+' Da.'
  erev 'The average molecular weight (MW) of ssDNA is '+sfancy('330')+' Da.'
end

#show_average_weight_of_an_aminoacidObject

#

show_average_weight_of_an_aminoacid

Show the average weight for an aminoacid that is part of a protein.

#


8086
8087
8088
8089
# File 'lib/bioroebe/shell/shell.rb', line 8086

def show_average_weight_of_an_aminoacid
  erev "The average molecular weight (MW) of an "\
       "amino acid is #{sfancy('110')} Da."
end

#show_blosum_matrixObject

#

show_blosum_matrix

Delegate towards bioroebe here, and invoke the .blosum() method.

#


5350
5351
5352
5353
5354
# File 'lib/bioroebe/shell/shell.rb', line 5350

def show_blosum_matrix
  erev 'Showing the blosum matrix next:'
  require 'bioroebe/blosum/blosum.rb'
  Bioroebe::Blosum.show_matrix
end

#show_both_dna_strandsObject Also known as: show_double_strand

#

show_double_strand

#


1799
1800
1801
1802
# File 'lib/bioroebe/shell/shell.rb', line 1799

def show_both_dna_strands
  show_main_sequence
  show_complement(string?, :include_prime_ends)
end

#show_ccaat_sites(search_for_this_sequence = 'CCAAT') ⇒ Object Also known as: show_CCAAT_sites

#

show_ccaat_sites

Use this method to locate CCAAT sites in the DNA string (the main string).

A CCAAT box, sometimes abbreviated a “CAAT box” or a “CAT box”, is a distinct pattern of nucleotides with the sequence “GGCCAATCT” or a sequence similar to that string.

This sequence usually occurs upstream by 60-100 bases to the initial transcription start site.

To test this method, you can try:

assign ATTTACGCGCCCGGCCAATCTGGCCGCGTACCCCCCCCCCGGCCAATCTATTTACGCGCCCGGCCAATCTGGCCGCGTACCCCCCCCCCGGCCAATCT; ccaat?
#


5893
5894
5895
5896
5897
5898
5899
# File 'lib/bioroebe/shell/shell.rb', line 5893

def show_ccaat_sites(
    search_for_this_sequence = 'CCAAT' # 'GGCCAATCT'
  )
  find_this_sequence(search_for_this_sequence)
  n_entries = raw_sequence?.scan("#{search_for_this_sequence}").size
  erev "The main sequence has #{simp(n_entries)}#{rev} CCAAT sites."
end

#show_chromosome_tableObject

#

show_chromosome_table

#


7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
# File 'lib/bioroebe/shell/shell.rb', line 7674

def show_chromosome_table
  lpadding_to_use = 16
  erev 'Chromosome Table from file '+sfile(FILE_CHROMOSOME_NUMBERS)+rev
  if File.exist? FILE_CHROMOSOME_NUMBERS
    dataset = YAML.load_file(FILE_CHROMOSOME_NUMBERS)
    e
    dataset.each_pair {|key, value|
      erev "  "+key.ljust(lpadding_to_use)+
           ' '+
           steelblue(value.to_s.rjust(3))
    }
    e
  else
    no_file_exists_at(FILE_CHROMOSOME_NUMBERS)
  end
end

#show_codon_piped_sequenceObject

#

show_codon_piped_sequence

#


1807
1808
1809
1810
1811
# File 'lib/bioroebe/shell/shell.rb', line 1807

def show_codon_piped_sequence
  # _ = dna_sequence_object?.gsub(/(...)/, "\\1|") # Add | at every third position.
  # erev rev+padding?+leading_5_prime+sfancy(_)+rev+trailing_3_prime
  display_nucleotide_sequence(:default) { :piped }
end

#show_codon_table(i = nil) ⇒ Object

#

show_codon_table

#


2499
2500
2501
2502
2503
2504
# File 'lib/bioroebe/shell/shell.rb', line 2499

def show_codon_table(i = nil)
  if i and i.is_a?(Array) and i.empty?
    i << 1 # Default to the vertebrate codon table in this case.
  end
  ShowThisCodonTable.new(i)
end

#show_codon_usage(i = dna_sequence_as_string? ) ⇒ Object

#

show_codon_usage

This shows the codon usage of the string.

#


4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
# File 'lib/bioroebe/shell/shell.rb', line 4916

def show_codon_usage(
    i = dna_sequence_as_string?
  )
  if i.is_a? Array
    if i.empty?
      i = dna_sequence_as_string?
    else
      i = i.flatten.compact.join
    end
  end
  ::Bioroebe::ShowCodonUsage.new(i)
end

#show_codons_of_this_aminoacid_or_show_kazusa_codon(i = nil) ⇒ Object

#

show_codons_of_this_aminoacid_or_show_kazusa_codon

This method can be used to output which codon codes for a specific aminoacid.

The input to this method should be a specific codon, such as ATG or GGC and so forth.

If no input is provided, we will instead show the webpage of kazusa.

Invocation examples:

codon? ATG # => M
codon? AUG # => M
#


2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
# File 'lib/bioroebe/shell/shell.rb', line 2455

def show_codons_of_this_aminoacid_or_show_kazusa_codon(i = nil)
  if i.is_a? Array
    i = i.first
  end
  if i # If the user provided input, we check it.
    # ===================================================================== #
    # Next, find all codons for the given aminoacid.
    # ===================================================================== #
    e ::Bioroebe.codon_to_aminoacid(i)
  else
    erev "The URL is at: "\
         "#{simp('http://www.kazusa.or.jp/codon/')}"
  end
end

#show_commandline_optionsObject

#

show_commandline_options

Show the available commandline options.

To invoke this method from the commandline, do:

bioroebe --help
#


6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
# File 'lib/bioroebe/shell/shell.rb', line 6224

def show_commandline_options
  e
  ecomment('  --silent               # perform a silent startup')
  ecomment('  --sequence             # use this nucleotide sequence on '\
           'startup; can be a number too such as 150')
  ecomment('  --n_fasta_entries      # report how many fasta '\
           'entries are in this directory')
  ecomment('  --disable-opn          # permanently disable opn')
  ecomment('  --random-aminoacids=33 # "generate" 33 random amino acids and display them')
  ecomment('  --n-aminoacids=33      # an alias to the ^^^ above')
  ecomment('  --protein-to-dna       # convert protein-aminoacid '\
           'sequence back to DNA')
  e
  erev 'Next some generic options will be shown. These may eventually'
  erev 'be moved into bin/bioroebe one day - but for now they will'
  erev 'be part of '+sfancy('Bioroebe::Shell')+'.'
  e
  erev 'The commandline interface for the java bindings can be found'
  erev 'at:'
  e
  efancy '  bioroebe/java/bioroebe/src/main/java/bioroebe/Commandline.java'
  e
  e
  ecomment('  --create-jar           # This will package the .java specific '\
           'code into a .jar file.')
  e
  exit
end

#show_complement(i = dna_string?, , also_include_prime_ends = false) ⇒ Object

#

show_complement

If the second argument is true, we pad via 5’ and 3’.

As of Feb 2015, we will try with leading padding as well.

#


6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
# File 'lib/bioroebe/shell/shell.rb', line 6943

def show_complement(
    i                       = dna_string?,
    also_include_prime_ends = false
  )
  case also_include_prime_ends
  # ======================================================================= #
  # === :show_leading_primes
  # ======================================================================= #
  when :show_leading_primes,
       :include_prime_ends
    also_include_prime_ends = true
  end
  i = dna_string? if i.nil?
  i = i.join('') if i.is_a? Array
  if also_include_prime_ends
    erev padding?+rev+
         leading_3_prime+
         sfancy(complement(i))+
         rev+trailing_5_prime
  else
    erev complement(i)
  end
end

#show_composition(i = dna_string? ) ⇒ Object

#

show_composition

This method will analyse the DNA string composition.

Invocation example:

scompo
#


3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
# File 'lib/bioroebe/shell/shell.rb', line 3723

def show_composition(
    i = dna_string?
  )
  length = i.size
  report_size_of_main_string
  hash = ::Bioroebe::CountAmountOfNucleotides.show_composition(i) # bl count_nucleotides
  erev 'Showing how many of the '+steelblue('four nucleotides')+rev+
       ' are in that sequence (absolute numbers):'
  print '  '
  string = ''.dup
  hash.each_pair {|nucleotide, n_times|
    string << "#{nucleotide}: #{lightslategray(n_times.to_s)}#{rev}, "
  }
  e string.rstrip.chop # .chop() to get rid of the last ',' token.
  erev "The respective frequencies derived from these absolute "\
       "numbers, #{steelblue('in percent')}#{rev}"\
       ", are:"
  print '  '
  hash.each_pair {|nucleotide, n_times|
    percentage = (n_times.to_f * 100 / length).round(2).to_s
    print "#{rev}#{nucleotide}: #{orange(percentage)}#{rev}% "
  }; erev
end

#show_config_dirObject

#

show_config_dir

This method will show the configuration directory.

#


4591
4592
4593
4594
4595
# File 'lib/bioroebe/shell/shell.rb', line 4591

def show_config_dir
  config_dir = File.dirname(__FILE__)+'/configuration/'
  erev 'The configuration directory for the Bioroebe::Shell is at:'
  erev '  `'+sfile(config_dir)+rev+'`'
end
#

This method will simply show the licence used for the project.

This has to be updated manually, though; and since the licence may change one day, I will keep track when this method has been last modified, which is on the 28.04.2020 (28th April, 2020).

#


6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
# File 'lib/bioroebe/shell/shell.rb', line 6672

def show_copyright_clause
  e
  erev 'This project is free software, licensed under the LGPL-2.0 license.'
  erev 'No "any later clause"; LGPL-2.0 applies to it.'
  e
  erev '  Copyright: Robert A. Heiler (2010-2022 and later)'
  e
  erev 'The biomart component is licensed under the MIT license and is'
  erev 'written by Darren Oakley. The MIT license is retained for the'
  erev 'Biomart component.'
  e
  erev '(Note that the bioroebe project used to be under the GPL licence'
  erev 'before some time; see the homepage of this gem for the explanation'
  erev 'as to why a switch occurred towards LGPL.)'
end

#show_cpg_islandsObject

#

show_cpg_islands

Use this method to “search” for CpG islands in a sequence. These will then be highlighted, sort of.

To invoke this, try:

CG?
#


6978
6979
6980
6981
6982
# File 'lib/bioroebe/shell/shell.rb', line 6978

def show_cpg_islands
  display_nucleotide_sequence(main_sequence?.to_str) {{
    colourize_this_subsequence: 'CG'
  }}
end

#show_dateObject

#

show_date

#


10681
10682
10683
# File 'lib/bioroebe/shell/shell.rb', line 10681

def show_date
  erev Time.now.strftime('%d.%m.%Y')
end

#show_directory_content(of_this_dir = '*') ⇒ Object

#

show_directory_content

#


1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
# File 'lib/bioroebe/shell/shell.rb', line 1585

def show_directory_content(
    of_this_dir = '*'
  )
  of_this_dir.prepend '*' unless of_this_dir.include? '*'
  cliner {
    Dir[of_this_dir].sort.each_with_index {|entry, index|
      index += 1
      entry << '/' if File.directory?(entry)
      erev index.to_s.rjust(2)+') '+entry
    }
  }
end

#show_disulfidesObject

#

show_disulfides

Show the (possible) disulfide positions in a protein.

#


2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
# File 'lib/bioroebe/shell/shell.rb', line 2045

def show_disulfides
  _ = aminoacid_sequence?
  if _.include? 'C'
    n_cytosines = _.count('C')
    erev "This aminoacid sequence has #{steelblue(n_cytosines.to_s)}#{rev} cysteines."
    if n_cytosines > 1
      erev 'Thus, there could be disulfide bonds. '+
           gold(cheerful_person)+rev
      show_sequence_with_a_ruler(:default, _)
      erev 'The positions of cysteines are at:'
      _.chars.each_with_index {|aminoacid, index|
        if aminoacid == 'C'
          erev 'Position: '+steelblue((index+1).to_s.rjust(3))
        end
      }
    end
  else
    e 'This aminoacid sequence has no cystein. Thus, '\
      'there can not be any disulfide bonds.'
  end
end

#show_dna_string(this_string = dna_string?, , truncate_too_long_result = do_truncate? ) ⇒ Object Also known as: show_main_string, report_sequence, show_sequence, show_main_dna_sequence, show_string

#

show_dna_string (show string tag, show tag)

Use this method to show the @sequence, or another string of your choosing, if you pass it to the method.

You can also invoke this method with something like this:

show_string { :with_colourized_separator }

This means that we will use ‘|’ separators that are colourized.

#


4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
# File 'lib/bioroebe/shell/shell.rb', line 4498

def show_dna_string(
    this_string              = dna_string?,
    truncate_too_long_result = do_truncate?
  )
  result = rev.dup # This is the String that will be returned.
  case truncate_too_long_result
  when :do_not_truncate
    truncate_too_long_result = false
  end
  truncate_at_n_elements = TRUNCATE_AT_N_ELEMENTS
  if this_string.nil?
    this_string = dna_string? if dna_string?
  end
  if this_string.to_s.empty?
    report_that_a_string_must_be_assigned_first
  else
    # this_string.upcase! # Nope, do not upcase here. Use other methods to do so.
    if mode? == :dna
      if this_string.size > truncate_at_n_elements # Threshold for now.
        if truncate_too_long_result or
          (truncate_too_long_result == :do_not_truncate_and_do_not_show_leader_and_trailer)
          this_string =
            this_string[0, truncate_at_n_elements]+
            swarn(' [TRUNCATED as the sequence '\
            'is longer than '+truncate_at_n_elements.to_s+' nucleotides]')
        end
      end
      # =================================================================== #
      # Next, display the main string, without upcasing it.
      # =================================================================== #
      if block_given?
        yielded = yield
        case yielded
        when :with_colourized_separator
          _ = this_string.split(//)
          str = ''.dup
          _.each_with_index {|char, index|
            str << char
            str << paleturquoise('|')+sfancy if (index+1) % 3 == 0
          }
          this_string = str
        end
      end
      if truncate_too_long_result == :do_not_truncate_and_do_not_show_leader_and_trailer
      else
        result << padding?+leading_5_prime
      end
      # =================================================================== #
      # Next, add the DNA sequence to the result that will be displayed.
      # =================================================================== #
      result << colourize_dna_sequence(this_string)+rev
      if truncate_too_long_result == :do_not_truncate_and_do_not_show_leader_and_trailer
      else
        result << trailing_3_prime
      end
      # =================================================================== #
      # Delegate to class ShowNucleotideSequence next:
      # =================================================================== #
      display_nucleotide_sequence(this_string)
    else # Else use the aminoacid mode.
      show_aminoacid_sequence
    end
  end
end

#show_download_dirObject

#

show_download_dir

#


2344
2345
2346
# File 'lib/bioroebe/shell/shell.rb', line 2344

def show_download_dir
  erev ::Bioroebe.download_directory?
end

#show_Ecoli_K12_informationObject

#

show_Ecoli_K12_information

#


3077
3078
3079
3080
3081
3082
3083
# File 'lib/bioroebe/shell/shell.rb', line 3077

def show_Ecoli_K12_information
  e
  erev 'Escherichia coli str. K-12 substr. MG1655, complete genome'
  e
  erev "  #{sfancy('https://www.ncbi.nlm.nih.gov/nuccore/NC_000913.3')}#{rev}"
  e
end

#show_editor_in_useObject

#

show_editor_in_use

#


7799
7800
7801
# File 'lib/bioroebe/shell/shell.rb', line 7799

def show_editor_in_use
  e MAIN_EDITOR
end

#show_fasta_headers(i) ⇒ Object

#

show_fasta_headers

Just show the fasta headers.

#


5907
5908
5909
# File 'lib/bioroebe/shell/shell.rb', line 5907

def show_fasta_headers(i)
  ::Bioroebe::ShowFastaHeaders.new(i) # Delegate into class Bioroebe::ShowFastaHeaders.
end

#show_fastq_quality_score_table(_ = Bioroebe.file_fastq_quality_schemes) ⇒ Object

#

show_fastq_quality_score_table

This method will output the FASTQ quality score table.

#


2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
# File 'lib/bioroebe/shell/shell.rb', line 2677

def show_fastq_quality_score_table(
    _ = Bioroebe.file_fastq_quality_schemes
  )
  if File.exist? _
    erev 'Showing the dataset stored in '+sfile(_)+rev+' next:'
    e
    dataset = YAML.load_file(_)
    keys = dataset.keys
    keys.each {|this_key|
      e sfancy(this_key+':')
      e
      inner_dataset = dataset[this_key]
      erev '  ASCII character range: '+
           seagreen(inner_dataset['ascii_character_range'].to_s)
      erev '  Offset:                '+
           seagreen(inner_dataset['offset'].to_s)
      erev '  Quality score type:    '+
           seagreen(inner_dataset['quality_score_type'].to_s)
      erev '  Quality score range:   '+
           seagreen(inner_dataset['quality_score_range'].to_s)
      e
    }; e
  else
    erev 'No file exists at '+sfile(_)+rev+'.'
  end
end

#show_file_listing(from_this_directory = Dir.pwd) ⇒ Object

#

show_file_listing

Make use of DirectoryContent to show the content of a file.

To invoke this method from within the Bioroebe::Shell, do:

ll
#


9645
9646
9647
9648
9649
9650
9651
9652
9653
9654
9655
9656
9657
9658
9659
9660
# File 'lib/bioroebe/shell/shell.rb', line 9645

def show_file_listing(
    from_this_directory = Dir.pwd
  )
  unless Object.const_defined?(:DirectoryParadise)
    begin
      require 'directory_paradise'
    rescue LoadError; end
  end
  _ = DirectoryParadise::Report.new(from_this_directory, :dont_run_yet)
  _.dont_report_total_filesize
  if run_as_GUI?
    _.disable_colours
  end
  _.disable_colours unless use_colours?
  _.run
end

#show_first_orf(of_this_sequence = dna_sequence_object? ) ⇒ Object

#

show_first_orf

This will show the first ORF.

Invocation example:

show_first_orf
#


2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
# File 'lib/bioroebe/shell/shell.rb', line 2397

def show_first_orf(
    of_this_sequence = dna_sequence_object?
  )
  _ = of_this_sequence
  return_all_possible_start_codons.each {|this_codon|
    if _.include? this_codon
      index = _.index(this_codon)
      sequence = _[index..-1]
      e rev+padding?+leading_5_prime+sfancy(sequence)+
        rev+trailing_3_prime+' (Start position at nucleotide: '+
        orange((index+1).to_s)+rev+')'
    else
      erev "Not found the codon #{simp(this_codon)}#{rev}."
    end
  }
end

#show_GFP_sequenceObject

#

show_GFP_sequence (gfp tag)

This method will show the GFP sequence, on the DNA level.

#


2951
2952
2953
2954
# File 'lib/bioroebe/shell/shell.rb', line 2951

def show_GFP_sequence
  erev return_five_prime_header+
       return_default_GFP_sequence
end

#show_header_of(i) ⇒ Object

#

show_header_of

#


2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
# File 'lib/bioroebe/shell/shell.rb', line 2928

def show_header_of(i)
  if i.is_a? Array
    i.each {|entry| show_header_of(entry) }
  else
    unless File.exist? i
      erev "No file exists at `#{sfile(i)}#{rev}`."
      return
    end
    case i
    # ===================================================================== #
    # === .pdb
    # ===================================================================== #
    when /\.pdb$/
      show_header_of_this_pdb_file(i)
    end
  end
end

#show_header_of_this_pdb_file(i) ⇒ Object

#

show_header_of_this_pdb_file

#


3855
3856
3857
3858
3859
3860
3861
# File 'lib/bioroebe/shell/shell.rb', line 3855

def show_header_of_this_pdb_file(i)
  lines  = File.readlines(i)
  first  = lines.first.split(' ')[1..-1].join(' ').strip
  second = lines[1].split(' ')[1..-1].join(' ').strip
  erev first
  erev "  #{second}"
end

#show_help(optional_arguments = nil) ⇒ Object

#

show_help (help tag, he tag)

This is a wrapper over the class Help. For more documentation, please look at the class Bioroebe::BioShell::Help.

#


9623
9624
9625
9626
9627
9628
9629
9630
9631
9632
9633
# File 'lib/bioroebe/shell/shell.rb', line 9623

def show_help(
    optional_arguments = nil
  )
  if run_in_GUI_mode?
    _ = ::Bioroebe::Shell::Help.new(:do_not_use_colours, :do_not_run_yet) { optional_arguments }
    _.build_help_string
    set_result(_.result?)
  else # This is the default for the commandline variant.
    ::Bioroebe::Shell::Help.new(use_colours?) { optional_arguments }
  end
end

#show_hint_how_to_use_the_local_sequencesObject

#

show_hint_how_to_use_the_local_sequences

Show a hint for the user.

#


2072
2073
2074
2075
2076
2077
2078
2079
# File 'lib/bioroebe/shell/shell.rb', line 2072

def show_hint_how_to_use_the_local_sequences
  unless return_fasta_files_in_the_log_directory.empty?
    erev 'You can load up any of these sequences by issuing:'
    e
    erev '  use_this_fasta 1 # for file number 1'
    e
  end
end

#show_histone_tableObject

#

show_histone_table

#


7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
# File 'lib/bioroebe/shell/shell.rb', line 7375

def show_histone_table
  erev 'The following table will show Calf Thymus Histones:'
  e
  erev 'Histone | number of residues | mass in kDa | n% Arginine | n% Lysine'
  erev '  H1             215               23.0          1             29'
  erev '  H2A            129               14.0          9             11'
  erev '  H2B            125               13.8          6             16'
  erev '  H3             135               15.3         13             10'
  erev '  H4             102               11.3         14             11'
  e
end

#show_historyObject

#

show_history (history tag)

Method to show the history.

#


8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
# File 'lib/bioroebe/shell/shell.rb', line 8179

def show_history
  print_rev
  cliner {
    erev "Now showing the #{sfancy('history')}#{rev} of the BioShell:"
  }
  array_history = array_history?
  if array_history.empty?
    erev 'No input-history was used yet.'
  else
    result = ''.dup
    array_history.each_with_index {|item, index|
      index += 1
      result << ' - '.dup # Need to unfreeze the string.
      result << ' ' if array_history.size > 9 and index.to_s.size < 2
      result << '('+simp((index).to_s)+rev+') '+item.to_s+"\n"
    }
    erev result
  end
end

#show_how_to_use_the_names_for_the_taxonomy_tableObject

#

show_how_to_use_the_names_for_the_taxonomy_table

#


7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
# File 'lib/bioroebe/shell/shell.rb', line 7199

def show_how_to_use_the_names_for_the_taxonomy_table
  e 'We use these values for the names table:'
  e
  e '  taxid'
  e '  name_txt'
  e '  unique_name'
  e '  name_class'
  e
  e 'We will also try to show a random selection of 10 entries from '\
    'there now:'
  run_sql 'SELECT taxid,name_txt,unique_name,name_class FROM names 
    ORDER BY RANDOM(), taxid LIMIT 10'
end

#show_html_coloursObject

#

show_html_colours

#


2279
2280
2281
2282
# File 'lib/bioroebe/shell/shell.rb', line 2279

def show_html_colours
  e 'The available HTML colours are:'; e
  ::Colours.show_html_colours; e
end

#show_human_genome_version(remote_URL = 'https://www.ensembl.org/Homo_sapiens/Info/Index') ⇒ Object

#

show_human_genome_version

Use this method to show the most current human genome version.

#


1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
# File 'lib/bioroebe/shell/shell.rb', line 1448

def show_human_genome_version(
    remote_URL = 'https://www.ensembl.org/Homo_sapiens/Info/Index'
  )
  human_genome_version = '' # Default.
  dataset = URI.open(remote_URL).read
  use_this_regex = /Genome assembly: (.{1,11}\.p\d+) <small>/ # See: https://rubular.com/r/DD5FhaPs3b
  scanned = dataset.scan(use_this_regex).flatten
  human_genome_version = scanned.first.to_s
  _ = "#{rev}The most current human genome version is: "\
      "#{sfancy(human_genome_version)}\n".dup
  _ << "The URL that was used to query this has been: "\
       "#{steelblue(remote_URL)}"
  e _
end

#show_hydropathy_tableObject

#

show_hydropathy_table

Show the hydropathy table.

#


1032
1033
1034
1035
1036
1037
1038
# File 'lib/bioroebe/shell/shell.rb', line 1032

def show_hydropathy_table
  e
  HYDROPATHY_TABLE.each_pair {|aminoacid_one_letter, hydropathy_value|
    e '  '+sfancy(aminoacid_one_letter)+'  | '+
      simp(hydropathy_value.to_s.rjust(4))
  }; e
end

#show_information_about_the_gff_formatObject

#

show_information_about_the_gff_format

#


7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
# File 'lib/bioroebe/shell/shell.rb', line 7875

def show_information_about_the_gff_format
  erev 'Fields must be tab-separated in the .gff format.'
  e
  erev 'All but the final field in each feature line must'
  erev 'contain a value; "empty" columns should be denoted with a "."'
  e
  egold 'seqname:'
  erev 'This is the name of the chromosome or scaffold; chromosome names'
  erev 'can be given with or without the "chr" prefix.'
  erev 'Important note: the seqname must be one used within Ensembl, '
  erev 'i.e. a standard chromosome name or an Ensembl identifier such as a'
  erev 'scaffold ID, without any additional content such as species or'
  erev 'assembly. See the example GFF output below.'
  e
  egold 'source:'
  erev 'Name of the program that generated this feature, or '
  erev 'the data source (database or project name)'
  e
  egold 'feature:'
  erev 'feature type name, e.g. Gene, Variation, Similarity'
  e
  egold 'start:'
  erev 'Start position of the feature, with sequence numbering starting at 1.'
  e
  egold 'end:'
  erev 'End position of the feature, with sequence numbering '\
       'starting at 1.'
  e
  egold 'score:'
  erev 'A floating point value.'
  e
  egold 'strand:'
  erev 'defined as + (forward) or - (reverse).'
  e
  egold "frame:"
  erev " - One of '0', '1' or '2'. '0' indicates that the first base "
  erev "of the feature is the first base of a codon, '1' that the second "
  erev "base is the first base of a codon, and so on."
  e
  egold 'attribute:'
  erev 'A semicolon-separated list of tag-value pairs, providing '
  erev 'additional information about each feature.'
  e
end

#show_insulin_entries_at_NCBIObject

#

show_insulin_entries_at_NCBI

#


757
758
759
760
761
762
763
# File 'lib/bioroebe/shell/shell.rb', line 757

def show_insulin_entries_at_NCBI
  e
  e 'https://www.ncbi.nlm.nih.gov/gene/3630'
  e 'https://www.ncbi.nlm.nih.gov/nuccore/NM_000207.3'
  e 'https://www.ncbi.nlm.nih.gov/protein/NP_000198.1'
  e
end

#show_jumper_directoriesObject

#

show_jumper_directories

#


9928
9929
9930
9931
9932
9933
9934
9935
# File 'lib/bioroebe/shell/shell.rb', line 9928

def show_jumper_directories
  if @internal_hash[:array_jumper_directories].empty?
    erev 'No jumper directory has been assigned yet.'
  else
    erev 'The available jumper directories are:'
    pp @internal_hash[:array_jumper_directories]
  end
end

#show_known_nls_sequencesObject

#

show_known_nls_sequences

This Wikipedia page may be useful:

https://en.wikipedia.org/wiki/Nuclear_localization_sequence
#


1048
1049
1050
1051
1052
1053
1054
# File 'lib/bioroebe/shell/shell.rb', line 1048

def show_known_nls_sequences
  erev "These NLS sequences are known:#{N}#{N}"
  padding = 36
  NUCLEAR_LOCALIZATION_SEQUENCES.each_pair {|key, value|
    e sfancy(key.ljust(padding))+' '+value
  }
end

#show_last_downloaded_fileObject

#

show_last_downloaded_file

#


4600
4601
4602
4603
4604
4605
4606
4607
# File 'lib/bioroebe/shell/shell.rb', line 4600

def show_last_downloaded_file
  if array_all_downloads?.empty?
    erev 'We have not yet downloaded any file.'
  else
    erev 'The last downloaded data was: '+
          sfancy(array_all_downloads?.last)
  end
end

#show_last_inputObject

#

show_last_input

sli can be used as command to access this method.

#


4105
4106
4107
4108
4109
4110
4111
# File 'lib/bioroebe/shell/shell.rb', line 4105

def show_last_input
  if readline_is_available?
    e sfancy(Readline::HISTORY[-1])
    Readline::HISTORY.pop
  end
  e "The last user input was: #{sfancy(user_input?)}"
end

#show_length_of_alpha_helix(i) ⇒ Object

#

show_length_of_alpha_helix

#


1272
1273
1274
# File 'lib/bioroebe/shell/shell.rb', line 1272

def show_length_of_alpha_helix(i)
  erev ::Bioroebe::AlphaHelix.length?(i)
end

#show_local_sequencesObject

#

show_local_sequences

This method will show the available local sequences.

#


9818
9819
9820
9821
9822
9823
9824
9825
9826
9827
9828
9829
9830
9831
9832
9833
9834
9835
# File 'lib/bioroebe/shell/shell.rb', line 9818

def show_local_sequences
  possible_matches = return_fasta_files_in_the_log_directory
  if possible_matches.empty?
    erev 'No local fasta sequences could be found.'
  else
    e
    erev 'The following local sequences were found in '\
         'the main log'
    erev 'directory ('+sdir(log_dir?)+rev+').'
    e
    possible_matches.each_with_index {|entry, index|
      index += 1
      _ = possible_matches.size.to_s.size
      erev padding?+'('+index.to_s.rjust(_)+') '+rev+
           sfile(File.basename(entry))+rev
    }; e
  end
end

#show_log_dirObject

#

show_log_dir

#


3848
3849
3850
# File 'lib/bioroebe/shell/shell.rb', line 3848

def show_log_dir
  e ::Bioroebe.log_dir?
end

#show_mnemoObject

#

show_mnemo

A little helper-method to memorize things.

#


4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
# File 'lib/bioroebe/shell/shell.rb', line 4034

def show_mnemo
  e
  erev 'Amino Acids with negatively charged side groups: -'
  e sfancy('  D E')
  erev 'Amino Acids with positive charged side groups: +'
  e sfancy('  K R H')
  e
  e sfancy('Oxidoreduktasen:')+rev+' Oxidations-Reduktions-Reaktionen'
  e sfancy('Transferasen:')+rev+'    Übertragung funktioneller Gruppen'
  e sfancy('Hydrolasen:')+rev+'      Hydrolasereaktionen'
  e sfancy('Lyasen:')+rev+'          Eliminierung von Gruppen unter '\
    'Ausbildung von Doppelbindungen'
  e sfancy('Isomerasen:')+rev+'      Isomerisierungen'
  e sfancy('Ligasen:')+rev+'         ATP-hydrolytic formation of bonds'
  e
end

#show_molweight(use_cliner = true) ⇒ Object

#

show_molweight

#


4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
# File 'lib/bioroebe/shell/shell.rb', line 4746

def show_molweight(
    use_cliner = true
  )
  cliner if use_cliner
  MolecularWeightOfNucleotides.weights.each_with_index {|entry, index|
    case index
    when 0
      erev 'Adenine:  '+sfancy(entry.to_s)+rev
    when 1
      erev 'Thymine:  '+sfancy(entry.to_s)+rev
    when 2
      erev 'Guanine:  '+sfancy(entry.to_s)+rev
    when 3
      erev 'Cytosine: '+sfancy(entry.to_s)+rev
    end
  }; cliner if use_cliner
end

#show_my_fasta_fileObject

#

show_my_fasta_file

#


2287
2288
2289
2290
# File 'lib/bioroebe/shell/shell.rb', line 2287

def show_my_fasta_file
  e HOME_DIRECTORY_OF_USER_X+
    'data/science/BIOINFORMATIK/data/FASTA/tardigrada_fasta.ffn'
end

#show_name_of_the_geneObject

#

show_name_of_the_gene

#


4703
4704
4705
4706
# File 'lib/bioroebe/shell/shell.rb', line 4703

def show_name_of_the_gene
  erev 'The name of the gene at hand is: '+
        sfancy(sequence_object?.name_of_gene)
end

#show_nucleotide_sequence?Boolean Also known as: display_nucleotide_object?

#

show_nucleotide_sequence?

#

Returns:

  • (Boolean)


9840
9841
9842
# File 'lib/bioroebe/shell/shell.rb', line 9840

def show_nucleotide_sequence?
  @internal_hash[:show_nucleotide_sequence]
end

#show_nucleotides_tableObject

#

show_nucleotides_table

Use this method to show the nucleotides table - their formula and the molecular mass.

#


1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
# File 'lib/bioroebe/shell/shell.rb', line 1469

def show_nucleotides_table
  array_display_these = %w(
    Adenin Cytosin Guanin Thymin
  )
  # ======================================================================= #
  # Grab the nucleotides.yml dataset next
  # ======================================================================= #
  dataset = YAML.load_file(FILE_NUCLEOTIDES)
  dataset.each_pair {|key, chemical_formula|
    if array_display_these.include? key # Display it in this case.
      molmasse = ChemistryParadise::CalculateAtomicMass.new(chemical_formula, :do_not_report).masse?
      molmasse = molmasse.to_f.round(2)
      e key.to_s.ljust(8)+' -> '+chemical_formula.to_s.rjust(8)+
        rev+' (Molecular mass: '+simp(molmasse.to_s)+')'+rev
    end
  }
end

#show_numbered_nucleotide_positions(_ = sequence?.string?) ⇒ Object

#

show_numbered_nucleotide_positions

This method will show “numbered” nucleotide positions such as:

1234567891234567891234567
ATGCAGGTCATCAGTCAGTCAGTCA
#


7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
# File 'lib/bioroebe/shell/shell.rb', line 7812

def show_numbered_nucleotide_positions(
    _ = sequence?.string?
  )
  chars = _.chars
  chunk = chars.each_slice(40) 
  chunked = chunk.map {|line| line.join }
  chunked.each {|line|
    chars = line.chars
    upper_strand = ''.dup
    counter = 0
    chars.each {|char| counter += 1
      if counter > 9
        counter = 0
      end
      upper_strand << counter.to_s
    }
    e lightsteelblue(upper_strand)
    erev line
  }
end

#show_oligo_length_three(sequence = dna_sequence_object? ) ⇒ Object

#

show_oligo_length_three

We align in chunks of three and tell the user how often we can find these individual codons.

Invocation example:

random 99; oligo_3
#


10746
10747
10748
10749
10750
10751
10752
10753
10754
10755
10756
10757
10758
10759
10760
10761
# File 'lib/bioroebe/shell/shell.rb', line 10746

def show_oligo_length_three(
    sequence = dna_sequence_object?
  )
  sequence = sequence.upcase # This is the sequence that will be scanned.
  dna = ::Bioroebe.dna? # This is equal to A, T, C and G.
  erev 'We will align the nucleotides in chunks of 3 and show their '\
       'frequency.'
  dna.each {|first_entry| # First nucleotide.
    dna.each {|second_entry| # Second nucleotide.
      dna.each {|third_entry| # Third nucleotide.
        _ = first_entry+second_entry+third_entry
        erev _+' '+sequence.scan(_).size.to_s
      }
    }
  }
end

#show_oligo_length_two(string = string? ) ⇒ Object

#

show_oligo_length_two

Show all oligo of length two.

#


1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
# File 'lib/bioroebe/shell/shell.rb', line 1911

def show_oligo_length_two(
    string = string?
  )
  sequence = string.upcase # Shorter copy and always upcased.
  dna = ::Bioroebe.dna?
  dna.each {|first_entry|
    dna.each {|second_entry|
      _ = "#{first_entry}#{second_entry}"
      erev _+' '+sequence.scan(_).size.to_s
    }
  }
end

#show_ori_sequencesObject

#

show_ori_sequences

The DnaA box is: TTATC[CA]AA

#


8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
# File 'lib/bioroebe/shell/shell.rb', line 8259

def show_ori_sequences
  erev 'The DnaA box has this consensus sequence: '+
        sfancy("5'-TTATC[CA]A[CA]A-3'")
  _ = 'TTATCCACA'
  erev 'Searching for '+_
  try_to_find_restriction_enzymes_for(_)
  _ = 'TTATCAAAA'
  erev 'Searching for '+_
  try_to_find_restriction_enzymes_for(_)
end

#show_position_for_the_main_sequenceObject

#

show_position_for_the_main_sequence

#


1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
# File 'lib/bioroebe/shell/shell.rb', line 1927

def show_position_for_the_main_sequence
  array = sequence?.scan(/.{,25}/)
  index_position = 1
  array.each {|entry|
    unless entry.empty?
      erev entry.split(//).join('   ')
      second_line = ''
      start = index_position
      index_position += entry.size
      start.upto(index_position-1) {|position|
        second_line << position.to_s.ljust(4)
      }
      erev cadetblue(second_line)+rev
      e
    end
  }
end

#show_position_of_sequence(i = aa_sequence?, , chunk_size = 10) ⇒ Object

#

show_position_of_sequence

This currently works only for Amino Acids - at the least I have tested it only on aminoacids so far, and not on DNA/RNA.

#


7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
# File 'lib/bioroebe/shell/shell.rb', line 7279

def show_position_of_sequence(
    i          = aa_sequence?,
    chunk_size = 10 # How many chunks to display per row.
  )
  array = i.chars
  _ = ''.dup # The Display-String.
  index_string = ''
  0.upto(array.size) {|index|
    _ << array[index].to_s.rjust(2)+' '
    unless array.size == index
      index_string << palevioletred((index+1).to_s.rjust(2)+' ')
    end
    if index % chunk_size == (chunk_size - 1)
      _ << N
      _ << index_string << rev << N << N
      index_string = ''
    end
  }
  erev _ # Report it finally.
  erev index_string
end

#show_possible_codons_for_this_aminoacid(i) ⇒ Object

#

show_possible_codons_for_this_aminoacid

#


10671
10672
10673
10674
10675
10676
# File 'lib/bioroebe/shell/shell.rb', line 10671

def show_possible_codons_for_this_aminoacid(i)
  possible_codons = PossibleCodonsForThisAminoacid[i,
    :use_only_the_four_standard_nucleotide_letters]
  array_aminoacid_sequence? << possible_codons
  return possible_codons
end

#show_possible_phosphorylation_sites(i = aminoacid_sequence?) ) ⇒ Object

#

show_possible_phosphorylation_sites

This method will find all possible phosphorylation sites in any given target sequence. It will also identify the aminoacids that can be phosphorylated.

To test this, try:

random 250; P?
#


10585
10586
10587
10588
10589
10590
10591
10592
10593
10594
10595
10596
10597
10598
10599
10600
10601
10602
10603
10604
10605
10606
10607
10608
10609
10610
10611
10612
10613
10614
10615
10616
10617
10618
10619
10620
10621
10622
10623
10624
10625
10626
10627
10628
10629
10630
10631
10632
10633
10634
10635
10636
10637
10638
10639
10640
10641
10642
10643
10644
10645
10646
10647
10648
10649
10650
10651
10652
10653
10654
10655
10656
10657
10658
10659
10660
10661
10662
10663
10664
10665
10666
# File 'lib/bioroebe/shell/shell.rb', line 10585

def show_possible_phosphorylation_sites(i = aminoacid_sequence?)
  _ = dna_sequence_object?
  array_all_codons = []
  array_all_codons << ::Bioroebe.codons_for?(:serine)
  array_all_codons << ::Bioroebe.codons_for?(:tyrosine)
  array_all_codons << ::Bioroebe.codons_for?(:threonine)
  array_all_codons.flatten!
  # ======================================================================= #
  # === Convert Y into Purine/Pyrimidine next
  # ======================================================================= #
  if array_all_codons.any? {|entry| entry.end_with? 'Y' }
    array_all_codons.map! {|inner_entry|
      if inner_entry.end_with? 'Y'
        inner_entry = [
          inner_entry.sub(/Y$/,'T'),
          inner_entry.sub(/Y$/,'C')
        ]
      end
      inner_entry
    }
    array_all_codons.flatten!
  end
  all_codons_found_in_the_sequence = []
  n_phosphorylation_sites = 0
  n_phosphorylation_sites = 
    array_all_codons.map {|entry|
      if _.scan(/#{entry}/).size > 0
        all_codons_found_in_the_sequence << entry
      end
      _.scan(/#{entry}/).size  }.inject(0){|sum, inner_element| sum + inner_element
    }
  all_codons_found_in_the_sequence.uniq!
  singular_or_plural = 'site'
  if n_phosphorylation_sites < 1
    singular_or_plural << 's'
  end
  erev 'In this sequence, we have found '+simp(n_phosphorylation_sites.to_s)+rev+
       ' possible phosphorylation '+singular_or_plural+', using all '\
       '3 possible frames.'
  e
  erev 'In particular, these '+all_codons_found_in_the_sequence.size.to_s+
       ' different codons were found: '
  e
  erev '  '+simp(all_codons_found_in_the_sequence.join('/'))+rev
  e
  erev 'For the first frame, the start positions are these:'
  e
  # ======================================================================= #
  # === Find the start positions for frame 1 next
  # ======================================================================= #
  array_start_positions_for_frame_1 = []
  scanned_result = _.scan(/.../)
  scanned_result.each_with_index {|codon, index|
    if all_codons_found_in_the_sequence.include? codon
      array_start_positions_for_frame_1 << (index * 3)+1
    end
  }
  erev '  DNA:     '+simp(array_start_positions_for_frame_1.join('/'))+rev
  erev '  Protein: '+simp(array_start_positions_for_frame_1.map {|entry|
    entry = entry.to_i * 3
    entry.to_s
  }.join('/'))+rev
  # ======================================================================= #
  # Now modify the DNA sequence there but only in the first frame.
  # ======================================================================= #
  new_colourized_dna_sequence = ''
  all_triplets = _.scan(/.../)
  all_triplets.each {|codon|
    codon = swarn(codon) if all_codons_found_in_the_sequence.include? codon
    new_colourized_dna_sequence << codon+rev
  }
  e
  erev 'The DNA sequence with possible phosphorylation sites is:'
  e
  erev left_padding?+leading_five_prime+new_colourized_dna_sequence+trailing_three_prime
  e
  erev 'The Aminoacid sequence with possible phosphorylation sites is:'
  e
  erev '  '+
       ::Bioroebe.colourize_aa(i, ARRAY_AMINOACIDS_THAT_CAN_BE_PHOSPHORYLATED).to_s
  e
end

#show_protein_composition(i) ⇒ Object

#

show_protein_composition

Delegate towards class CountAmountOfAminoacids

#


5271
5272
5273
# File 'lib/bioroebe/shell/shell.rb', line 5271

def show_protein_composition(i)
  ::Bioroebe::CountAmountOfAminoacids.new(i) # bl $BIOROEBE/count_amount_of_aminoacids.rb
end

#show_readline_completionsObject

#

show_readline_completions

#


82
83
84
85
86
87
# File 'lib/bioroebe/shell/readline.rb', line 82

def show_readline_completions
  e 'The available completions are:'
  e
  pp ARRAY_WITH_COMPLETIONS
  e
end

#show_resources_about_the_horseradish_peroxidaseObject

#

show_resources_about_the_horseradish_peroxidase

#


1574
1575
1576
1577
1578
1579
1580
# File 'lib/bioroebe/shell/shell.rb', line 1574

def show_resources_about_the_horseradish_peroxidase
  e
  e 'https://www.ncbi.nlm.nih.gov/gene/?term=%22Horseradish+Peroxidase%22'
  e 'https://www.ncbi.nlm.nih.gov/gene/836533'
  e 'Fasta: https://www.ncbi.nlm.nih.gov/nuccore/NC_003076.8?report=fasta&from=25659257&to=25661007&strand=true'
  e
end

#show_resteObject

#

show_reste

This will show the residues of the various amino acids.

#


10192
10193
10194
10195
10196
# File 'lib/bioroebe/shell/shell.rb', line 10192

def show_reste
  e; AMINO_ACIDS_RESTE.each_pair {|key, value|
    erev '  '+key.ljust(14)+' -> '+sfancy(value)
  }; e
end

#show_restriction_enzymes(optional_input = nil) ⇒ Object

#

show_restriction_enzymes

Display the available restriction enzymes here.

If we pass an argument, then we assume that we wish to show only these restriction enzymes that cut at n bp.

Invocation example:

show_restriction_enzymes(:show_all)
#


9059
9060
9061
9062
9063
9064
9065
9066
9067
9068
9069
9070
9071
9072
9073
9074
9075
9076
9077
9078
9079
9080
9081
9082
9083
9084
9085
9086
# File 'lib/bioroebe/shell/shell.rb', line 9059

def show_restriction_enzymes(optional_input = nil)
  case optional_input
  when nil, :show_all # This means to show everything.
    ::Bioroebe.show_restriction_enzymes # Defined in module_methods.rb
  else # Ok we gave input then.
    _ = ::Bioroebe.restriction_enzymes
    _.select! {|entry|
      last = entry.last
      last = last.split(' ').last
      if last == optional_input
        true
      else
        false
      end
    }
    if _.empty?
      erev 'We found no match for '+optional_input+'.'
    else # else display the cutters.
      erev 'These enzymes cut at `'+sfancy(optional_input)+rev+'` nucleotides.'
      _.each {|entry|
        entry[0] = entry[0].rjust(15)
        entry[1] = entry[1].gsub(/ (.+)/, swarn(' \\1')+rev)
        e "  #{entry.join(' -> ')}"
      }
      erev 'These are '+simp(_.size.to_s)+rev+' restriction enzymes.'
    end
  end
end

#show_restriction_tableObject

#

show_restriction_table

This method will show a restriction table, that is, a table with some different restriction enzymes.

To invoke this method, do:

show_restriction_table
#


2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
# File 'lib/bioroebe/shell/shell.rb', line 2887

def show_restriction_table
  most_ljust = 20
  _ = ''.dup
  _ << 'Showing a few different cutters (4,5,6,7,8) in table format next:'+N
  _ << '---------------------------------------------------------'+N
  _ << peru('  4-cutter'.ljust(most_ljust))+' | '+orange('ChaI'.ljust(10))+' | '+
       olivedrab('GATC'.ljust(10))+N
  _ << peru('  5-cutter'.ljust(most_ljust))+' | '+orange('FmuI'.ljust(10))+' | '+
       olivedrab('GGNCC'.ljust(10))+N
  _ << peru('  6-cutter'.ljust(most_ljust))+' | '+orange('EcoRI'.ljust(10))+' | '+
       olivedrab('GAATTC'.ljust(10))+N
  _ << peru('  7-cutter'.ljust(most_ljust))+' | '+orange('PfoI'.ljust(10))+' | '+
       olivedrab('TCCNGGA'.ljust(10))+N
  _ << peru('  8-cutter'.ljust(most_ljust))+' | '+orange('PacI'.ljust(10))+' | '+
       olivedrab('TTAATTAA'.ljust(10))+N
  _ << '---------------------------------------------------------'+N
  erev _
end

#show_reverse_dna_stringObject

#

show_reverse_dna_string

This method will simply show the DNA sequence reversed.

#


2333
2334
2335
2336
2337
2338
2339
# File 'lib/bioroebe/shell/shell.rb', line 2333

def show_reverse_dna_string
  erev padding?+
       leading_five_prime+
       sfancy(return_reverse_dna_string)+
       rev+
       trailing_three_prime
end

#show_rna_sequence(i = sequence_object?.to_rna) ⇒ Object

#

show_rna_sequence

Use this method to convert a given sequence to RNA.

#


2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
# File 'lib/bioroebe/shell/shell.rb', line 2511

def show_rna_sequence(
    i = sequence_object?.to_rna
  )
  i = sequence_object?.to_rna if i.nil?
  i = i.to_str if i.respond_to? :to_str
  if i.include? 'T'
    i.tr!('T','U')
  end
  display_nucleotide_object?.display(i) {{ use_this_as_padding: lpad? }}
end

#show_save_fileObject

#

show_save_file

#


1562
1563
1564
1565
1566
1567
1568
1569
# File 'lib/bioroebe/shell/shell.rb', line 1562

def show_save_file
  result = <<-EOF
#{rev}We will store into the file #{sfile(save_file?)}#{rev}.
#{rev}If you wish to instead store into the current directory,
#{rev}input "save_here".
EOF
  e result
end

#show_segmentsObject

#

show_segments

This method will show the DNA segments via a R-compatible way.

Usage example:

set AAAATGCAGTAACCCATGCCC; show_segments
#


10561
10562
10563
10564
10565
10566
10567
10568
10569
10570
10571
# File 'lib/bioroebe/shell/shell.rb', line 10561

def show_segments
  array = ::Bioroebe.scan_this_input_for_startcodons(dna_sequence_object?)
  erev '         start end width'
  array.each_with_index {|inner_array, index|
    index += 1
    start_position = inner_array.first
    codon          = inner_array.last.first
    erev '  ['+index.to_s+']  '+start_position.to_s.rjust(5)+' '+
          (start_position+2).to_s.rjust(5)+' '+'3'.rjust(4)+' ['+codon.downcase+']'
  }
end

#show_seq_1(i = seq1?) ) ⇒ Object

#

show_seq_1

#


10509
10510
10511
10512
# File 'lib/bioroebe/shell/shell.rb', line 10509

def show_seq_1(i = seq1?)
  erev padding?+leading_five_prime+
       sfancy(i)+rev+trailing_three_prime
end

#show_seq_2(i = seq2?) ) ⇒ Object

#

show_seq_2

#


10517
10518
10519
10520
# File 'lib/bioroebe/shell/shell.rb', line 10517

def show_seq_2(i = seq2?)
  erev padding?+leading_five_prime+
       sfancy(i)+rev+trailing_three_prime
end

#show_seq_3(i = seq3?) ) ⇒ Object

#

show_seq_3

#


10525
10526
10527
10528
# File 'lib/bioroebe/shell/shell.rb', line 10525

def show_seq_3(i = seq3?)
  erev padding?+leading_five_prime+
       sfancy(i)+rev+trailing_three_prime
end

#show_seq_4Object

#

show_seq_4

#


10533
10534
10535
# File 'lib/bioroebe/shell/shell.rb', line 10533

def show_seq_4
  erev padding?+leading_five_prime+sfancy(seq4?)+rev+trailing_three_prime
end

#show_seq_5Object

#

show_seq_5

#


10540
10541
10542
# File 'lib/bioroebe/shell/shell.rb', line 10540

def show_seq_5
  erev padding?+leading_five_prime+sfancy(seq5?)+rev+trailing_three_prime
end

#show_seq_6Object

#

show_seq_6

#


10547
10548
10549
# File 'lib/bioroebe/shell/shell.rb', line 10547

def show_seq_6
  erev padding?+leading_five_prime+sfancy(seq6?)+rev+trailing_three_prime
end

#show_sequence_in_splitted_form(how_many = 3, use_this_token_for_rejoining = ' ') ⇒ Object

#

show_sequence_in_splitted_form

We will show the main DNA sequence in a three-letter splitted form.

You can optionally use an argument, the first argument, a number. By default this is 3, so we will split into chunks of 3.

The second argument says which token we will use for rejoining. It defaults to ‘ ’ so the nucleotides will be rejoined via ‘ ’, but you can also use another token such as ‘-’, which may lead to a String such as ‘ATG-CGA-ACC’ and so forth.

#


1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
# File 'lib/bioroebe/shell/shell.rb', line 1988

def show_sequence_in_splitted_form(
    how_many                     = 3,
    use_this_token_for_rejoining = ' ' # <- Which token to use for the re-joining action.
  )
  case how_many
  when nil, :default # Use a default value here.
    how_many = 3
  end
  result = '.' * how_many.to_i
  use_this_regex = /#{result}/
  if string?.empty?
    erev 'Please first "assign" a sequence.'
  else
    if block_given?
      yielded = yield
      if yielded.is_a? Hash
        # ================================================================= #
        # === :use_this_token
        # ================================================================= #
        if yielded.has_key? :use_this_token
          use_this_token_for_rejoining = yielded.delete(:use_this_token)
        end
      end
    end
    string = string?.to_s
    scanned = string.scan(use_this_regex)
    scanned.map! {|entry|
      # =================================================================== #
      # Colourize start codons next.
      # =================================================================== #
      if is_this_a_start_codon? entry
        entry = mediumseagreen(entry)+
                return_colour_for_nucleotides
      elsif is_this_a_stop_codon? entry
        entry = mediumorchid(entry)+
                return_colour_for_nucleotides
      end
      entry
    }
    _ = scanned.join(use_this_token_for_rejoining)
    # ===================================================================== #
    # Finally show the sequence.
    # ===================================================================== #
    erev left_padding?+
         five_prime+
         return_colour_for_nucleotides+
         _+
         rev+
         three_prime
  end
end

#show_sequence_with_a_ruler(group_together_n_nucleotides = :default, use_this_sequence = main_sequence?, , type = type? ) ⇒ Object

#

show_sequence_with_a_ruler

This will show the main sequence together with a “ruler” on top.

The first argument specifies how many nucleotides are to be displayed per given line.

This method can also be called in this way:

show_sequence_with_a_ruler { :without_colours }

This will skip showing the ruler.

#


4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
# File 'lib/bioroebe/shell/shell.rb', line 4829

def show_sequence_with_a_ruler(
    group_together_n_nucleotides = :default,
    use_this_sequence            = main_sequence?,
    type                         = type?
  )
  case use_this_sequence
  # ======================================================================= #
  # === :default
  # ======================================================================= #
  when :default
    use_this_sequence = main_sequence?
  end
  if group_together_n_nucleotides.is_a?(Array)
    group_together_n_nucleotides = group_together_n_nucleotides.first
    if group_together_n_nucleotides.nil? or group_together_n_nucleotides.empty?
      group_together_n_nucleotides = :default
    end
  end
  case group_together_n_nucleotides
  # ======================================================================= #
  # === :default
  # ======================================================================= #
  when :default,
       nil
    group_together_n_nucleotides = 70
  end
  if group_together_n_nucleotides.is_a? String
    # ===================================================================== #
    # We need an Integer here.
    # ===================================================================== #
    group_together_n_nucleotides = group_together_n_nucleotides.to_i
  end
  e
  msg = "Displaying the main sequence (length: #{use_this_sequence.to_s.size}) "\
        "in a chunk of #{slateblue(group_together_n_nucleotides.to_s)}#{rev}\n".dup 
  case type
  when :dna
    msg << "nucleotides"
  when :aminoacids
    msg << "aminoacids"
  end
  msg << " next."
  e msg
  e
  use_this_sequence = use_this_sequence.to_s
  chunks = use_this_sequence.split(/(.{#{group_together_n_nucleotides}})/).reject(&:empty?)
  array = chunks.each_slice(group_together_n_nucleotides).to_a.flatten #.join.split("\n")
  use_this_ruler_type = :show_ruler # Note that :show_ruler is the default.
  # ======================================================================= #
  # === Handle blocks given next
  # ======================================================================= #
  if block_given?
    yielded = yield
    case yielded
    # ===================================================================== #
    # === :without_colours
    # ===================================================================== #
    when :without_colours
      use_this_ruler_type = :without_colours
    end
  end
  array.each {|sequence|
    show_nucleotide_sequence?.display_with_prior_formatting(sequence) {
      use_this_ruler_type
    }
    e
  }
end

#show_sigma_tutorialObject

#

show_sigma_tutorial

This method tells the user a bit about the sigma factors.

#


4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
# File 'lib/bioroebe/shell/shell.rb', line 4068

def show_sigma_tutorial
  erev 'This subsection contains some information about Sigmafactors.'
  e
  erev 'A sigma factor a protein needed for initiation of RNA synthesis.'
  e
  erev 'It is a bacterial transcription initiation factor.'
  e
  erev 'It will enable the specific binding of RNA polymerase to gene promoters.'
  e
  erev 'Sigma factors vary, which allows the bacterial cell to respond to'
  erev 'different environmental signals.'
  e
  erev 'Every molecule of RNA polymerase holoenzyme will contain only one '\
       'sigma factor.'
  e
  erev 'The number of sigma factors varies between bacterial species.'
  e
  erev 'E. coli has seven sigma factors.'
  e
  erev 'Sigma factors are distinguished by their characteristic molecular '\
       'weights.'
  e
  erev 'For instance, sigma-70 refers to the sigma factor with a molecular '\
       'weight of 70 kDa.'
  e
  erev 'Once initiation of RNA transcription is complete, the sigma'
  erev 'factor can leave the complex.'
  e
  erev 'Sigmafactor rpoD 70 can be found here:'
  e '  '+simp('http://www.ncbi.nlm.nih.gov/gene/947567')
end

#show_sixpack_alignment(i = dna_sequence_object? ) ⇒ Object

#

show_sixpack_alignment

We will feed some input to class Bioroebe::SimpleStringComparer.

#


10204
10205
10206
10207
10208
10209
10210
10211
10212
10213
10214
10215
10216
10217
10218
10219
# File 'lib/bioroebe/shell/shell.rb', line 10204

def show_sixpack_alignment(
    i = dna_sequence_object?
  )
  erev 'Input sequence 1:'
  string1 = $stdin.gets.chomp
  erev 'Input sequence 2:'
  string2 = $stdin.gets.chomp
  # ======================================================================= #
  # Delegate into class SimpleStringComparer next.
  # ======================================================================= #
  _ = ::Bioroebe::SimpleStringComparer.new(:dont_run_yet) # bl $BIOROEBE/string_matching/simple_string_comparer.rb
  _.set_main_alignment_token_to '|'
  _.string1 = string1
  _.string2 = string2
  _.compare
end

#show_start_and_stop_codonsObject

#

show_start_and_stop_codons

This will show BOTH start and stop codons, in different colours.

Since start codons may be more important, we will first locate and colourize them, and afterwards, will also colourize the stop codons.

#


7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
# File 'lib/bioroebe/shell/shell.rb', line 7842

def show_start_and_stop_codons
  _ = string?
  start_codon = ::Bioroebe.start_codon?
  stop_codons = ::Bioroebe.stop_codons?
  _.gsub!(/(#{start_codon})/, yellow+'\\1'+colour_for_nucleotide)
  stop_codons.each {|stop_codon|
    _.gsub!(/(#{stop_codon})/, salmon('\\1')+colour_for_nucleotide)
  }
  erev 'Start codon: '+yellow+start_codon+rev
  stop_codons = stop_codons.join(', ').strip
  stop_codons.chop! if stop_codons.end_with? ','
  # ======================================================================= #
  # Show the stop codons that we will use:
  # ======================================================================= #
  erev 'Stop codons: '+salmon(stop_codons)+rev
  erev dna_padding(_)
end

#show_startup_informationObject

#

show_startup_information

This method here will usually be shown only once, on an initial startup of the Bioroebe::Shell. Afterwards, it will no longer be shown at all.

Note that showing this can be disabled.

#


7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
# File 'lib/bioroebe/shell/shell.rb', line 7740

def show_startup_information
  e
  erev "This seems to be the first time that you are using the "\
       "#{olivedrab('Bioroebe::Shell')}#{rev}, at the least on"
  erev 'this computer.'
  e
  erev 'It is recommended to have a look at the following components first:'
  e
  efancy '   help'
  efancy '   random'
  efancy '   assign'
  efancy '   complement'
  e
  erev 'If you want to show this intro-menu again, do:'
  e
  efancy '  show-intro'
  e
  erev 'You can also see more documentation at:'
  e
  e "  #{slateblue(URL_TO_THE_DOCUMENTATION)}"
  e
  erev 'If you feel that something is missing or incorrect, feel '\
       'free to send an email to:'
  e
  efancy "  #{EMAIL}"
  e
end

#show_t_phagesObject

#

show_t_phages

#


2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
# File 'lib/bioroebe/shell/shell.rb', line 2244

def show_t_phages
  dataset = YAML.load_file(
    ::Bioroebe.yaml_dir?+'viruses/ecoli_phages.yml'
  )
  # ======================================================================= #
  # Next, display that as a table.
  # ======================================================================= #
  erev 'Name of Phage | Plaque Size | Head diameter | tail length | latent period | burst size'
  cliner length: 88
  dataset.each_pair {|name_of_phage, value|
    print '|',name_of_phage.to_s.center(13),'|'
    # ===================================================================== #
    # Display the plague size next, aka small, medium or large.
    # ===================================================================== #
    plaque_size = value['plaque_size']
    print plaque_size.to_s.center(13),'|'
    head = value['head']
    print head.to_s.center(15),'|'
    tail = value['tail']
    print tail.to_s.center(13),'|'
    # ===================================================================== #
    # Display the latent period.
    # ===================================================================== #
    latent_period = value['latent_period']
    print latent_period.to_s.center(15),'|'
    burst_size = value['burst_size']
    print burst_size.to_s.center(12),'|'
    e
    cliner length: 88
  }
end

#show_taxid(id = 9606) ⇒ Object

#

show_taxid

This method will show the particular TaxID, using the NCBI taxonomy database.

The tax-id 9606 is “Homo sapiens”.

#


1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
# File 'lib/bioroebe/shell/shell.rb', line 1870

def show_taxid(
    id = 9606
  )
  id = 9606 if id.nil?
  id = id.to_s
  url = 'http://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?id='+id+'&lvl=0'
  erev 'The remote URL is: '+sfancy(url)
  webpage = open(url).read
  regex = /^<table width="100%"><tr><td valign="top"><h2>(Homo sapiens)<\/h2>/ # See: http://rubular.com/r/aQK5O8ZfGa
  webpage =~ regex
  name_of_the_organism = $1.to_s.dup
  erev 'The TaxID of '+simp(id)+rev+' corresponds to `'+
        sfancy(name_of_the_organism)+rev+'`.'
end

#show_the_aminoacids_frequenciesObject

#

show_the_aminoacids_frequencies

#


7502
7503
7504
# File 'lib/bioroebe/shell/shell.rb', line 7502

def show_the_aminoacids_frequencies
  pp YAML.load_file(FILE_AMINO_ACIDS_FREQUENCY)
end

#show_the_leader?Boolean

#

show_the_leader?

#

Returns:

  • (Boolean)


6186
6187
6188
# File 'lib/bioroebe/shell/shell.rb', line 6186

def show_the_leader?
  @internal_hash[:show_the_leader]
end

#show_the_positively_charged_aminoacidsObject

#

show_the_positively_charged_aminoacids

#


768
769
770
771
772
773
774
775
# File 'lib/bioroebe/shell/shell.rb', line 768

def show_the_positively_charged_aminoacids
  result = <<-EOF
Lysine (K)
Arginine (R)
Histidine (H)
EOF
  e result
end

#show_the_trailer?Boolean

#

show_the_trailer?

#

Returns:

  • (Boolean)


6193
6194
6195
# File 'lib/bioroebe/shell/shell.rb', line 6193

def show_the_trailer?
  @internal_hash[:show_the_trailer]
end

#show_the_weight_of_some_common_proteins(use_this_file = FILE_WEIGHT_OF_COMMON_PROTEINS) ⇒ Object

#

show_the_weight_of_some_common_proteins

#


5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
# File 'lib/bioroebe/shell/shell.rb', line 5175

def show_the_weight_of_some_common_proteins(
    use_this_file = FILE_WEIGHT_OF_COMMON_PROTEINS
  )
  erev 'Showing the weight of some common proteins next (in kDa):'
  e
  dataset = File.readlines(use_this_file).select {|line|
    line.include? ' # '
  }
  dataset.each {|line|
    splitted = line.split(':')
    key = splitted[0]
    value = splitted[1 .. -1].join(' ').strip
    erev "  #{(key+':').ljust(25)} "\
         "#{lightblue((value.to_s+' kDa').rjust(12))}"
  }
  e
end

#show_the_weight_of_the_four_individual_nucleotidesObject

#

show_the_weight_of_the_four_individual_nucleotides

#


11145
11146
11147
11148
11149
11150
11151
11152
11153
11154
11155
11156
# File 'lib/bioroebe/shell/shell.rb', line 11145

def show_the_weight_of_the_four_individual_nucleotides
  e
  erev '  A: '+adenin?.rjust(10)+' '+
        palevioletred(weight_of_adenin?)
  erev '  T: '+thymin?.rjust(10)+' '+
        palevioletred(weight_of_thymin?)
  erev '  C: '+cytosin?.rjust(10)+' '+
        palevioletred(weight_of_cytosin?)
  erev '  G: '+guanin?.rjust(10)+' '+
        palevioletred(weight_of_guanin?)
  e
end

#show_this_sequence_padded(i = dna_sequence_object? ) ⇒ Object

#

show_this_sequence_padded

Usage example:

show_this_sequence_padded ATGACTTAGCCACAACTGCATGCATATGCATGACTGACT
#


2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
# File 'lib/bioroebe/shell/shell.rb', line 2356

def show_this_sequence_padded(
    i = dna_sequence_object?
  )
  if i.is_a? Array and i.empty?
    i << dna_sequence_object?
  end
  if i.is_a? Array
    i = i.join
  end
  # ======================================================================= #
  # First, split it into an array of 80 characters each.
  # ======================================================================= #
  array = i.scan(/.{,80}/).reject {|entry| entry.empty? }
  array.each {|entry|
    erev entry
  }
end

#show_this_subsequence(start_position = 1, end_position = 10, work_on_this_sequence = dna_sequence_object? ) ⇒ Object

#

show_this_subsequence

Sometimes we want to show a subsequence. This method helps us to do so, too.

The input may be “tainted”, e. g. be a String like “12,345” or “12.345”, so this method will have to eliminate the ‘,’ and ‘.’ characters as well, before converting this String into an Integer. (It must be an Integer because nucleotide counting can logically not be a Float.)

Usage example:

random 99; [22..33]
#


1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
# File 'lib/bioroebe/shell/shell.rb', line 1733

def show_this_subsequence(
    start_position        =  1,
    end_position          = 10,
    work_on_this_sequence = dna_sequence_object?
  )
  start_position = start_position.to_s.delete(',.').to_i
  end_position   = end_position.to_s.delete(',.').to_i
  if start_position < 1
    erev 'The minimum for the start-position must be 1, so this'
    erev 'is now treated as one rather than '+start_position.to_s+'.'
    start_position = 1
  end
  if end_position > work_on_this_sequence.size
    erev 'The sequence is '+slateblue('too long')+rev+' ('+
         crimson('end_position')+rev+' is '\
         'at '+sfancy(end_position.to_s)+rev+', '+
         nucleotides_or_aminoacids?.to_s+' sequence length '\
         'was: '+sfancy(work_on_this_sequence.size.to_s)+
         rev+').'
    erev 'It will be limited next to '+
         sfancy(work_on_this_sequence.size.to_s)+rev+' in length.'
    end_position = work_on_this_sequence.size
  end
  sequence = work_on_this_sequence.start_end(
    start_position,
    end_position
  )
  if sequence
    size = sequence.size.to_s
    nucleotides_or_aminoacids_or_empty = ''
    if work_on_this_sequence.respond_to? :nucleotides_or_aminoacids?
      nucleotides_or_aminoacids_or_empty = work_on_this_sequence.nucleotides_or_aminoacids?.to_s
    end
    erev 'Next showing a subsequence, '+
         nucleotides_or_aminoacids_or_empty+' '+
         olive(start_position.to_s)+rev+' to '+
         olive(end_position.to_s)+rev+
         ' (including '+olive(start_position.to_s)+
         rev+' and '+olive(end_position.to_s)+rev+').'
    erev 'The length of the fragment will be '+
         simp(size)+rev+' '+
         nucleotides_or_aminoacids_or_empty.strip+
         '.'
    report_this_dna_sequence_with_proper_trailer_and_leader(sequence) { :try_to_colourize_start_codon }
  else
    erev 'This subsequence appears to be invalid '\
         '(start: '+start_position.to_s+', end: '+end_position.to_s+')'
  end
end

#show_todo_fileObject

#

show_todo_file

#


5560
5561
5562
# File 'lib/bioroebe/shell/shell.rb', line 5560

def show_todo_file
  cat '$RUBY_SRC/bioroebe/doc/TODO_FOR_THE_BIOROEBE_PROJECT.md'
end

#show_useful_URLsObject

#

show_useful_URLs

This method will simply show some important, bioinformatics related URLs. In particular URLs that may be important for bioinformatics related tasks, e. g. NCBI, GeneBank and so forth.

#


2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
# File 'lib/bioroebe/shell/shell.rb', line 2913

def show_useful_URLs
  result = <<-EOF

#{rev}NCBI:    #{sfancy(obtain_url_for(:ncbi))}
#{rev}GenBank: #{sfancy(obtain_url_for(:genbank))}
#{rev}PDB:     #{sfancy(obtain_url_for(:pdb))}
#{rev}Prosite: #{sfancy(obtain_url_for(:prosite))}

EOF
  e result
end

#show_weight_of_this_nucleotide(i) ⇒ Object

#

show_weight_of_this_nucleotide

Use this method to show the total weight of a specific nucleotide.

Usage examples:

weight? U
weight? T
weight? Adenine
#


5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
# File 'lib/bioroebe/shell/shell.rb', line 5529

def show_weight_of_this_nucleotide(i)
  i = i.to_s
  if i.empty?
    erev 'Please supply a nucleotide, such as "Adenine" or "A".'
    erev 'Note that the short variant is preferred.'
    return
  end
  i = i[0,1] if i.size > 1
  _ = FILE_NUCLEOTIDES_WEIGHT # bl /Users/x/DATA/SCIENCE/YAML/nucleotides_weight.yml
  if File.exist?(_)
    _ = YAML.load_file(_)
    dataset = {}
    _.each_pair {|key, value|
      dataset[key[0,1]] = value
    }
    if dataset.has_key?(i)
      erev 'The weight of '+sfancy(i)+rev+' is: '+
        sfancy(
          ChemistryParadise.atomic_mass_of(dataset[i])
        )
    else
      erev 'The key `'+sfancy(i)+rev+'` was not found.'
    end
  else
    ewarn 'We did not find a required file at '+sfile(_)+rev+'.'
  end
end

#show_welcome_messageObject

#

show_welcome_message

Show a little welcome message on startup. This can be disabled of course.

#


8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
# File 'lib/bioroebe/shell/shell.rb', line 8241

def show_welcome_message
  unless silent_startup?
    erev 'Welcome to the '+violet('Bioroebe::Shell')+
         rev+' Version '+
         sfancy(version?.to_s)+
         rev+
         ', last updated: '+
         simp(::Bioroebe.last_updated?)+
         rev+'.'
    erev "Type \"#{sfancy('help')}#{rev}\" to get some help."
  end
end

#show_xorg_bufferObject

#

show_xorg_buffer

#


3051
3052
3053
3054
3055
# File 'lib/bioroebe/shell/shell.rb', line 3051

def show_xorg_buffer
  if @internal_hash[:use_xsel]
    esystem 'xsel -o'
  end
end

#showorf(i = dna_sequence_object?, , show_how_many_frames = :show_three_frames) ⇒ Object

#

showorf (showorf tag)

Use this method to show the open reading frame of a given sequence.

We can also use it to selectively show a certain frame, such as frame2. See class Bioroebe::ShowOrf for this.

Note that in May 2020 (10.05.2020) class Bioroebe::ShowOrf here was replaced with

#


5929
5930
5931
5932
5933
5934
5935
5936
# File 'lib/bioroebe/shell/shell.rb', line 5929

def showorf(
    i                    = dna_sequence_object?,
    show_how_many_frames = :show_three_frames
  )
  i = dna_sequence_object? if i.nil?
  i = dna_sequence_object? if i.is_a?(Array) and i.empty?
  display_open_reading_frames(i) { show_how_many_frames }
end

#shuffle_main_stringObject

#

shuffle_main_string

This method will re-arrange the main DNA sequence.

#


10028
10029
10030
10031
10032
10033
# File 'lib/bioroebe/shell/shell.rb', line 10028

def shuffle_main_string
  erev 'Shuffling the main DNA string next.'
  _ = dna_sequence?.split(//).shuffle.join
  set_dna_string(_, :be_quiet)
  show_dna_sequence
end

#silent_startup?Boolean

#

silent_startup?

#

Returns:

  • (Boolean)


8068
8069
8070
# File 'lib/bioroebe/shell/shell.rb', line 8068

def silent_startup?
  @internal_hash and @internal_hash[:silent_startup]
end

#start_clipboard(i = '"') ⇒ Object

#

start_clipboard

Make use of the clipboard here.

#


7186
7187
7188
7189
7190
7191
7192
7193
7194
# File 'lib/bioroebe/shell/shell.rb', line 7186

def start_clipboard(i = '"')
  _ = @internal_hash[:clipboard]
  if _
    erev 'Starting Clipboard now (exit it with '+i+')'
    _.set_exit_token(i) # Set closing token. Default to }
    _.fetch_input
    return _.buffer?
  end
end

#start_codon?Boolean

#

start_codon?

#

Returns:

  • (Boolean)


2221
2222
2223
# File 'lib/bioroebe/shell/shell.rb', line 2221

def start_codon?
  ::Bioroebe.start_codon?
end

#start_gtk_controllerObject

#

start_gtk_controller

#


8497
8498
8499
8500
# File 'lib/bioroebe/shell/shell.rb', line 8497

def start_gtk_controller
  require 'bioroebe/gui/gtk3/controller/controller.rb'
  ::Bioroebe.run_gtk_controller
end

#start_search(be_verbose = true) ⇒ Object

#

start_search (start_search tag)

This will attempt to locate @search_for substring in the main nucleotide sequence.

#


7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
# File 'lib/bioroebe/shell/shell.rb', line 7941

def start_search(
    be_verbose = true
  )
  case be_verbose
  when :be_quiet
    be_verbose = false
  end
  _ = search_for? # Obtain a handle to the sequence we are trying to find.
  if _
    results = sequence?.scan(_)
    if be_verbose
      erev "Trying to now find `#{simp(_)}#{rev}`."
      pp results
    end
    msg = "We found `#{simp(results.size.to_s)}#{rev}` entr".dup
    if (results.size > 1) or (results.size == 0)
      msg << 'ies' # Plural form.
    else
      msg << 'y'   # Singular form.
    end
    msg << '.'
    erev msg
    return results.size
  else
    erev "No value for #{paleturquoise('@search_for')}#{rev} was "\
         "set yet. Please set one via invoking:"
    e
    erev '  set_search_for'
    e
  end
end

#stop_codons?Boolean

#

stop_codons?

#

Returns:

  • (Boolean)


2228
2229
2230
# File 'lib/bioroebe/shell/shell.rb', line 2228

def stop_codons?
  ::Bioroebe.stop_codons?
end

#store_here?Boolean

#

store_here?

Where to store output generated by BioRoebe. Should point to a locally existing directory.

#

Returns:

  • (Boolean)


3841
3842
3843
# File 'lib/bioroebe/shell/shell.rb', line 3841

def store_here?
  ::Bioroebe.store_here?
end

#three_to_one(i) ⇒ Object

#

three_to_one

This method will translate, and output, a three-letter aminoacid into the corresponding single-letter code.

Invocation example:

three_to_one Thr Thr Glu Ala Val Glu Ser Thr Val Ala Thr Leu Glu Asp Ser # => T T E A V E S T V A T L E D S
3to1 ARG-ALA-SER-LEU-PHE-TRP-LYS-HIS-ASN-SER-VAL-LEU-ILE-VAL-PRO
#


2304
2305
2306
2307
2308
2309
# File 'lib/bioroebe/shell/shell.rb', line 2304

def three_to_one(i)
  if i.is_a? Array
    i = i.join('-').strip
  end
  e ::Bioroebe.three_to_one(i).strip
end

#thymin?Boolean

#

thymin?

#

Returns:

  • (Boolean)


8332
8333
8334
# File 'lib/bioroebe/shell/shell.rb', line 8332

def thymin?
  YAML.load_file(FILE_NUCLEOTIDES)['Thymin']
end

#tk_start_three_to_oneObject

#

start_three_to_one

Mostly an ad-hoc way to load up a specific ruby-tk widget.

#


6611
6612
6613
6614
# File 'lib/bioroebe/shell/shell.rb', line 6611

def tk_start_three_to_one
  require 'bioroebe/gui/tk/three_to_one/three_to_one.rb'
  Bioroebe::GUI::Tk::ThreeToOne.new(ARGV)
end

#to_dna(i = sequence? ) ⇒ Object

#

to_dna

#


9215
9216
9217
9218
9219
9220
9221
9222
9223
9224
9225
9226
9227
9228
# File 'lib/bioroebe/shell/shell.rb', line 9215

def to_dna(
    i = sequence?
  )
  if i.nil?
    if seq?
      i = seq?
    elsif aminoacids? # Handle Aminoacids here.
      i = aminoacids?
      return
    end
  end
  erev padding?+
       dna_with_ends(Bioroebe.to_dna(i))
end

#to_fasta(i = dna_sequence? ) ⇒ Object

#

to_fasta

Create a Fasta format from the target sequence.

#


3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
# File 'lib/bioroebe/shell/shell.rb', line 3701

def to_fasta(
    i = dna_sequence?
  )
  array = i.scan(/.{,80}/).reject {|entry| entry.empty? }
  name_of_the_gene = sequence_object?.name_of_gene?.to_s
  if name_of_the_gene.empty?
    name_of_the_gene << 'Drosophila melanogaster chromosome'
  end
  array[0,0] = '>gi|671162122:c7086083-7083225 '+name_of_the_gene
  e array.join(N)
end

#to_genbank(this_sequence = dna_sequence_as_string? ) ⇒ Object

#

to_genbank

This method will generate, or rather output, the GenBank file format.

#


4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
# File 'lib/bioroebe/shell/shell.rb', line 4934

def to_genbank(
    this_sequence = dna_sequence_as_string?
  )
  if fasta?
    id = fasta?.sequence_id?
    # ===================================================================== #
    # bl $BIOROEBE/genbank/genbank_flat_file_format_generator.rb
    # ===================================================================== #
    _ = GenbankFlatFileFormatGenerator.new(this_sequence, :do_not_run_yet)
    _.use_this_as_id = id
    _.run
  elsif !this_sequence.empty?
    GenbankFlatFileFormatGenerator.new(this_sequence)
  else
    erev 'There does not seem to be any FASTA sequence assigned.'
  end
end

#to_rna(i = seq_object?) ) ⇒ Object

#

to_rna

#


11088
11089
11090
11091
11092
11093
11094
# File 'lib/bioroebe/shell/shell.rb', line 11088

def to_rna(i = seq_object?)
  i = seq_object? if i.nil? # Assign to default in this case.
  if i.respond_to? :to_rna
    i = i.to_rna
  end
  erev i
end

#to_talen(i = dna_sequence? ) ⇒ Object

#

to_talen

#


10808
10809
10810
10811
10812
10813
10814
10815
10816
10817
10818
# File 'lib/bioroebe/shell/shell.rb', line 10808

def to_talen(
    i = dna_sequence?
  )
  i = dna_sequence? if i.nil? # Obtain the DNA sequence.
  talen_sequence = '' # This will contain our final talen-sequence.
  talens = YAML.load_file(::Bioroebe.file_talens)
  i.scan(/./).each {|char|
    talen_sequence << "{ #{talens[char]} }"
  }
  pp talen_sequence
end

#toggle_modeObject

#

toggle_mode

#


4325
4326
4327
4328
4329
4330
4331
4332
# File 'lib/bioroebe/shell/shell.rb', line 4325

def toggle_mode
  case @internal_hash[:mode]
  when :dna
    set_mode(:aminoacid)
  else
    set_mode(:dna)
  end
end

#toggle_truncateObject

#

toggle_truncate

#


9321
9322
9323
9324
9325
9326
9327
9328
# File 'lib/bioroebe/shell/shell.rb', line 9321

def toggle_truncate
  if do_truncate?
    do_not_truncate
  else
    ::Bioroebe.do_truncate
    erev 'We will truncate too-long output.'
  end
end

#toggle_xorg_bufferObject

#

toggle_xorg_buffer

#


8693
8694
8695
8696
# File 'lib/bioroebe/shell/shell.rb', line 8693

def toggle_xorg_buffer
  @configuration.additionally_set_xorg_buffer = !@configuration.additionally_set_xorg_buffer
  @configuration.save
end

#trailing_3_prime(get_rid_of_spaces = false) ⇒ Object Also known as: three_trailer, three_trailer?, trailer, three_prime, trailing_three_prime, trail_three_prime, trail_three, trailing_three

#

trailing_3_prime

This will essentually return a “ -3’” string.

#


6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
# File 'lib/bioroebe/shell/shell.rb', line 6078

def trailing_3_prime(
    get_rid_of_spaces = false
  )
  if show_the_trailer?
    get_rid_of_spaces = true if get_rid_of_spaces == :no_spaces
    _ = " - 3'".dup
    _.delete!(' ') if get_rid_of_spaces
    return _
  end
  return '' # Else return an empty String.
end

#trailing_five_primeObject Also known as: trailing_5_prime, five_prime_trailer

#

trailing_five_prime

#


6724
6725
6726
# File 'lib/bioroebe/shell/shell.rb', line 6724

def trailing_five_prime
  " - 5'"
end

#translate(i, be_verbose = true) ⇒ Object

#

translate

General translate method.

#


3139
3140
3141
# File 'lib/bioroebe/shell/shell.rb', line 3139

def translate(i, be_verbose = true)  # Translate tag.
  translate_aminoacid(i, be_verbose) # for now, we default to this.
end

#translate_aminoacid(these_aminoacids = string?, , be_verbose = true) ⇒ Object

#

translate_aminoacid

Translate aminoacids from one letter to full name.

Usage example:

translate kkrnn
#


7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
# File 'lib/bioroebe/shell/shell.rb', line 7034

def translate_aminoacid(
    these_aminoacids = string?,
    be_verbose       = true
  )
  these_aminoacids = string? if these_aminoacids.nil?
  if these_aminoacids.include? ','
    these_aminoacids.delete!(',')
  end
  if these_aminoacids == '?'
    erev 'Help requested:' # The user requested help here.
    erev '  '+sfancy('-> ')+rev+'Simply input some AminoAcids here.'
    erev '  '+sfancy('-> ')+rev+'for instance, "translate kkrrr".'
  else
    if these_aminoacids
      these_aminoacids = these_aminoacids.join(' ') if these_aminoacids.is_a? Array
      these_aminoacids.gsub!(/#{N}/,'')
      _ = these_aminoacids.gsub(/ /,'').upcase
      if be_verbose
        erev 'Now translating one letter Aminoacid to '\
             'their full names: '
        print '    '+these_aminoacids.upcase
      end
      _ = ::Bioroebe.translate(_)
      if use_colours?
        _ = sienna(_) if Object.const_defined? :Colours
      end
      erev ' -> '+_ # Invoke .translate if be_verbose
      return _
    end
  end
end

#translate_dna_into_aminoacid(i = dna_sequence?, , frame = 1) ⇒ Object Also known as: translate_dna_into_aminoacid_frame1

#

translate_dna_into_aminoacid

The first argument should be the DNA sequence.

#


908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
# File 'lib/bioroebe/shell/shell.rb', line 908

def translate_dna_into_aminoacid(
    i     = dna_sequence?,
    frame = 1
  )
  i = dna_sequence? if i.nil?
  if i.is_a? Array
    i.each {|entry| translate_dna_into_aminoacid(entry) }
  else
    i.upcase!
    case frame
    when 1 # normal frame, default.
    when 2 # one shifted
      i[0,1] = ''
    when 3 # two shifted
      i[0,1] = ''
      i[0,1] = ''
    end
    # ===================================================================== #
    # Next, return the result.
    # ===================================================================== #
    return ::Bioroebe.translate_dna_into_aminoacid(i)
  end
end

#translate_dna_into_aminoacid_frame2(i = nil) ⇒ Object

#

translate_dna_into_aminoacid_frame2

#


891
892
893
# File 'lib/bioroebe/shell/shell.rb', line 891

def translate_dna_into_aminoacid_frame2(i = nil)
  translate_dna_into_aminoacid(i, 2) # Frame 2.
end

#translate_dna_into_aminoacid_frame3(i = nil) ⇒ Object

#

translate_dna_into_aminoacid_frame3

#


898
899
900
# File 'lib/bioroebe/shell/shell.rb', line 898

def translate_dna_into_aminoacid_frame3(i = nil)
  translate_dna_into_aminoacid(i, 3) # Frame 3.
end

#try_to_compare_these_two_sequences_for_equality(i) ⇒ Object

#

try_to_compare_these_two_sequences_for_equality

This method will compare two sequences for equality, e. g. will return true or false, depending on whether they are equal or not.

nil will be returned if the method could not find the necessary ‘==’ characters.

Invocation example from within a running bio-shell:

ATCGATCGATCG == ATCGATCG
#


9979
9980
9981
9982
9983
9984
9985
9986
9987
9988
9989
9990
# File 'lib/bioroebe/shell/shell.rb', line 9979

def try_to_compare_these_two_sequences_for_equality(i)
  i.strip!
  if i.include? '=='
    splitted = i.split('==').map(&:strip)
    # ===================================================================== #
    # Do the comparison next.
    # ===================================================================== #
    splitted.first == splitted.last
  else
    nil
  end
end

#try_to_display_this_fasta_entry(i) ⇒ Object

#

try_to_display_this_fasta_entry

#


8843
8844
8845
8846
8847
8848
8849
8850
8851
8852
8853
8854
8855
8856
8857
8858
8859
8860
# File 'lib/bioroebe/shell/shell.rb', line 8843

def try_to_display_this_fasta_entry(i)
  if i.is_a? String
    i = i.to_i - 1 # -1 because Arrays in ruby begin at 0.
  end
  last_entry = array_fasta?.last
  sequence_data = last_entry[i]
  erev sequence_data
  if block_given?
    yielded = yield
    case yielded
    # ===================================================================== #
    # === :and_assign_it_as_well
    # ===================================================================== #
    when :and_assign_it_as_well
      assign(sequence_data) # In this case it will become the new main sequence data.
    end
  end
end

#try_to_find_restriction_enzymes_for(i) ⇒ Object Also known as: find_this_sequence, find_in_main_sequence

#

try_to_find_restriction_enzymes_for

This method name is a slight misnomer; we can simply find any target sequence.

The method can also handle some Symbols as input, such as the symbol :shine_dalgarno, which will be replaced accordingly to the SD sequence.

#


6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
# File 'lib/bioroebe/shell/shell.rb', line 6365

def try_to_find_restriction_enzymes_for(
    i
  )
  # ======================================================================= #
  # === We always have to work with an Array as input
  # ======================================================================= #
  unless i.is_a? Array
    i = [i]
  end
  i.map! {|entry|
    case entry # Use special sequences.
    when :shine_dalgarno
      entry = 'AGGAGGT'
    end
    # ===================================================================== #
    # Past this point, we will assume a String as input. But we will have
    # to make sure, still.
    # ===================================================================== #
    entry = entry.to_s unless entry.is_a? String
    entry.delete!('-') if entry.include? '-'
    entry
  }
  i.each {|entry|
    report_main_sequence(entry) { :with_ruler }
    possible_results = dna_string?.scan(/#{entry}/)
    unless possible_results.empty?
      e
      erev "Start nucleotide position is at: "\
           "#{simp((dna_string?.index(entry)+1))}#{rev}"
      e
    end
  }
end

#try_to_find_this_restriction_enzyme(i) ⇒ Object

#

try_to_find_this_restriction_enzyme

Use this method to find a specific restriction enzyme.

The restriction enzymes are stored in this yaml file here:

bl $BIOROEBE/yaml/restriction_enzymes/restriction_enzymes.yml

Usage example:

MvnI?
#


9102
9103
9104
9105
9106
9107
9108
9109
9110
9111
9112
9113
9114
9115
9116
9117
9118
9119
9120
9121
9122
9123
9124
9125
9126
9127
9128
9129
9130
9131
9132
9133
9134
9135
9136
9137
9138
9139
9140
9141
9142
9143
9144
9145
9146
9147
9148
9149
9150
9151
9152
9153
9154
9155
9156
9157
9158
9159
9160
9161
9162
9163
9164
9165
9166
9167
9168
9169
9170
9171
9172
9173
9174
9175
9176
# File 'lib/bioroebe/shell/shell.rb', line 9102

def try_to_find_this_restriction_enzyme(i)
  i = i.dup if i.frozen?
  i.delete!('?') # We do not need any '?' characters.
  original_input = i.dup
  # i = i.downcase # No longer downcase since as of June 2018.
  if i.include? 'restriction'
    i.sub!(/restriction/,'')
  end
  if i.include? '.site' # Assume a syntax such as: Restriction.EcoRI.site
    e ::Bioroebe.restriction_enzyme(i)
  else # else it will be more verbose
    i.delete!('.') if i.include? '.'
    if i.end_with?('1') and !::Bioroebe.has_this_restriction_enzyme?(i) # Is invalid. 
      erev 'The input `'+simp(i)+rev+'` ends with the number 1. This '\
           'is not possible, so'
      erev 'we replace the trailing 1 with a capital I.'
      i[-1,1] = 'i' # Ok not a capital one, because we store in a downcased variant.
      original_input[-1,1] = 'I'
    end
    if ::Bioroebe.has_this_restriction_enzyme? i
      target_sequence_data = ::Bioroebe.return_restriction_enzyme_sequence_and_cut_position(i)
      # =================================================================== #
      # Tap into the method Bioroebe.restriction_enzyme
      # =================================================================== #
      _ = ::Bioroebe.restriction_enzyme(i) # bl $BIOROEBE/module_methods.rb
      erev "We have found a restriction enzyme called "\
           "#{sfancy(original_input)}#{rev}."
      e
      e "#{rev}The sequence this #{mediumorchid(_.size.to_s+'-cutter')}#{rev}"\
        " relates to is: `"\
        "#{sfancy(five_prime+simp(_)+rev)}"\
        "#{sfancy(three_trailer)}#{rev}`"
      e
      # =================================================================== #
      # The variable target_sequence_data will look like this:
      #   ["GCCNNNNNGGC", "7", "7"]
      # =================================================================== #
      if target_sequence_data.last == :blunt
        erev "This restriction enzyme will produce a "\
             "#{seagreen('blunt')}#{rev} overhang."
        e
      else
        erev "This restriction enzyme will produce a "\
             "#{seagreen('sticky-end')}#{rev} overhang."
        e
      end
      # =================================================================== #
      # Next, show the exact cut that will be made.
      # =================================================================== #
      sequence = ::Bioroebe.return_sequence_that_is_cut_via_restriction_enzyme(i)
      erev 'It will specifically cut between:     '+
            sfancy(five_prime)+rev+
            simp(sequence)+
            sfancy(three_trailer)+rev
      # =================================================================== #
      # And the complementary sequence follows next. The colour used
      # is swarn().
      # =================================================================== #
      complementary_sequence = reverse(
        Colours.remove_escape_sequences(sequence)
      )
      # =================================================================== #
      # We must insert a | at the right position.
      # =================================================================== #
      target_sequence_data = target_sequence_data[1].to_i
      complementary_sequence[-target_sequence_data,0] = swarn('|')+rev
      erev ''.ljust(38)+sfancy(leading_three_prime)+rev+
           complementary_sequence+rev+
           sfancy(five_prime_trailer)+rev
    else
      erev 'We were unable to find a restriction enzyme called '\
           '`'+sfancy(i)+'`'+rev
    end
  end
end

#try_to_report_the_version_of_bedtoolsObject

#

try_to_report_the_version_of_bedtools

#


9665
9666
9667
9668
9669
9670
9671
9672
9673
9674
9675
9676
9677
9678
9679
9680
9681
9682
# File 'lib/bioroebe/shell/shell.rb', line 9665

def try_to_report_the_version_of_bedtools
  result = `bedtools --version 2>&1`
  if result.include? 'command not found'
    e
    erev 'The bedtools do not appear to be installed / available.'
    e
    if is_on_roebe?
      erev 'You may be able to install it via:'
      e
      erev '  rbt bedtools'
      e
    end
  else
    version = result.sub(/bedtools/,'').strip.to_s.delete('v')
    erev "The version of bedtools is: "\
         "#{orange(version)}#{rev}"
  end
end

#try_to_report_the_version_of_viennarnaObject

#

try_to_report_the_version_of_viennarna

This method can be used to see the version of ViennaRNA, if it is installed at all.

#


6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
# File 'lib/bioroebe/shell/shell.rb', line 6336

def try_to_report_the_version_of_viennarna
  result = `RNAplfold --version 2>&1`
  if result.include? 'command not found'
    e
    erev 'ViennaRNA does not appear to be installed / available.'
    e
    if is_on_roebe?
      erev 'You may be able to install it via:'
      e
      erev '  rbt viennarna'
      e
    end
  else
    version = result.sub(/RNAplfold/,'').strip.to_s
    erev 'The version of ViennaRNA is: '+
       orange(version)+rev
  end
end

#try_to_run_rnalfold_on_this_file(i) ⇒ Object

#

try_to_run_rnalfold_on_this_file

#


7527
7528
7529
7530
7531
7532
7533
# File 'lib/bioroebe/shell/shell.rb', line 7527

def try_to_run_rnalfold_on_this_file(i)
  if File.exist? i
    esystem("RNALfold --infile=#{i}")
  else
    erev 'No file called `'+sfile(i)+rev+'` exists.'
  end
end

#try_to_show_the_configurationObject

#

try_to_show_the_configuration

#


2968
2969
2970
2971
2972
2973
2974
# File 'lib/bioroebe/shell/shell.rb', line 2968

def try_to_show_the_configuration
  @configuration.show_config if @configuration.respond_to? :show_config
  _ = verbose_truth(use_expand_cd_aliases?)
  colourized_yes_or_no = simp(_.to_s)
  erev 'Will we use class Rcfiles::DirectoryAliases: '+
       colourized_yes_or_no
end

#type?Boolean

#

type?

#

Returns:

  • (Boolean)


4811
4812
4813
# File 'lib/bioroebe/shell/shell.rb', line 4811

def type?
  sequence?.type?
end

#uncolourize_this_aminoacid(i) ⇒ Object

#

uncolourize_this_aminoacid

#


10915
10916
10917
10918
10919
10920
10921
10922
10923
10924
10925
10926
# File 'lib/bioroebe/shell/shell.rb', line 10915

def uncolourize_this_aminoacid(i)
  if i.nil?
    erev 'Please supply an argument, an aminoacid. Either one '\
         'letter or the full name.'
    return
  end
  unless ::Bioroebe.array_colourize_this_aminoacid.include? i
    erev 'We will no longer colourize the '\
         'aminoacid `'+swarn(i)+'`.'
    ::Bioroebe.array_colourize_this_aminoacid.delete i # Using .delete() works here.
  end
end

#unfreeze_the_main_sequenceObject

#

unfreeze_the_main_sequence

#


5366
5367
5368
# File 'lib/bioroebe/shell/shell.rb', line 5366

def unfreeze_the_main_sequence
  @internal_hash[:the_main_sequence_is_frozen] = false
end

#uniprot_fetch(i = 'P12345') ⇒ Object

#

uniprot_fetch

This method can be sued to obtain the .fasta sequence of a protein listed at uniprot.

#


720
721
722
723
724
725
# File 'lib/bioroebe/shell/shell.rb', line 720

def uniprot_fetch(
    i = 'P12345'
  )
  i = 'P12345' if i.nil?
  return ::Bioroebe.fetch_data_from_uniprot(i).string?
end

#upcase_main_stringObject

#

upcase_main_string

Use this method to upcase the main sequence.

#


11163
11164
11165
# File 'lib/bioroebe/shell/shell.rb', line 11163

def upcase_main_string
  set_sequence(sequence?.upcase)
end

#uracil?Boolean

#

uracil?

#

Returns:

  • (Boolean)


8325
8326
8327
# File 'lib/bioroebe/shell/shell.rb', line 8325

def uracil?
  YAML.load_file(FILE_NUCLEOTIDES)['Uracil']
end

#use_expand_cd_aliases?Boolean

#

use_expand_cd_aliases?

#

Returns:

  • (Boolean)


5668
5669
5670
# File 'lib/bioroebe/shell/shell.rb', line 5668

def use_expand_cd_aliases?
  ::Bioroebe::Configuration.use_expand_cd_aliases?
end

#use_this_fasta_file(at_position = 1) ⇒ Object

#

use_this_fasta_file

Use a fasta file based on its position.

For instance, fasta file at position 2 will be the second fasta file kept in the main log directory.

#


2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
# File 'lib/bioroebe/shell/shell.rb', line 2202

def use_this_fasta_file(
    at_position = 1
  )
  # ======================================================================= #
  # We need to map the given position to the existing (local) file at hand.
  # ======================================================================= #
  this_fasta_file = return_fasta_files_in_the_log_directory[at_position.to_i - 1]
  if this_fasta_file
    assign_fasta(this_fasta_file)
  else
    erev 'Could not find any file at position '+simp(at_position.to_s)+rev+'.'
    erev 'Use "'+steelblue('show_fasta_files')+rev+
         '" to see which fasta files are available.'
  end
end

#use_which_prompt?Boolean

#

use_which_prompt?

#

Returns:

  • (Boolean)


8094
8095
8096
# File 'lib/bioroebe/shell/shell.rb', line 8094

def use_which_prompt?
  @internal_hash[:prompt_to_use]
end

#use_xsel?Boolean

#

use_xsel?

#

Returns:

  • (Boolean)


7269
7270
7271
# File 'lib/bioroebe/shell/shell.rb', line 7269

def use_xsel?
  @internal_hash[:use_xsel]
end

#user_input?Boolean

#

user_input?

#

Returns:

  • (Boolean)


11757
11758
11759
# File 'lib/bioroebe/shell/shell.rb', line 11757

def user_input?
  @internal_hash[:user_input]
end

#verbose_handle_this_sys_command(i, arguments = a? ) ⇒ Object

#

verbose_handle_this_sys_command

#


4198
4199
4200
4201
4202
4203
4204
4205
# File 'lib/bioroebe/shell/shell.rb', line 4198

def verbose_handle_this_sys_command(
    i, arguments = a?
  )
  if a and a.is_a?(Array)
    arguments = a.join(' ').strip
  end
  esystem i+' '+arguments.to_s+' &'
end

#verbose_report_numbered_amino_acid_sequence(i, which_frame = '1') ⇒ Object

#

verbose_report_numbered_amino_acid_sequence

This method can be used to show a verbose and properly-aligned frame shift table for the given aminoacid sequence.

#


10877
10878
10879
10880
10881
10882
10883
10884
10885
10886
10887
10888
10889
10890
10891
10892
10893
10894
10895
10896
10897
10898
10899
10900
10901
10902
10903
10904
10905
10906
10907
10908
10909
10910
# File 'lib/bioroebe/shell/shell.rb', line 10877

def verbose_report_numbered_amino_acid_sequence(
    i,
    which_frame = '1'
  )
  n_chunks = ::Bioroebe::Configuration.n_chunks?
  erev 'The amino acid sequence, with numbers and split into chunks '\
       'of '+plum(n_chunks.to_s)+rev+', for '+
       sfancy('Frame '+which_frame.to_s)+rev+' is: '
  e # Newline is good.
  chars = i.chars
  # ======================================================================= #
  # Split into lines of 40, or rather what value was given to n_chunks.
  # ======================================================================= #
  slice = chars.each_slice(n_chunks).to_a
  position = 1
  slice.each {|array|
    print '  '
    array.each {|char|
      char = char.rjust(3)
      char = ::Bioroebe.colourize_aa(char)
      print rev+char+rev+swarn('|')+rev
    }; e # Do a newline for good measure.
    print '  ' # Always have two ' ' before a new line.
    # ===================================================================== #
    # === Show the position of the aminoacid next
    # ===================================================================== #
    array.size.times {
      print forestgreen(position.to_s.rjust(3))+rev+swarn('|')+rev
      position += 1
    }
    e; e
  }
  e
end

#verbose_save_history_to_fileObject

#

verbose_save_history_to_file

#


8156
8157
8158
8159
# File 'lib/bioroebe/shell/shell.rb', line 8156

def verbose_save_history_to_file
  erev 'We will next save the input-history into a file.'
  save_history_to_file
end

#version?Boolean

#

version?

#

Returns:

  • (Boolean)


8061
8062
8063
# File 'lib/bioroebe/shell/shell.rb', line 8061

def version?
  ::Bioroebe.version
end

#weight_of_adenin?Boolean

#

weight_of_adenin?

#

Returns:

  • (Boolean)


2599
2600
2601
# File 'lib/bioroebe/shell/shell.rb', line 2599

def weight_of_adenin?
  ChemistryParadise::CalculateAtomicMass[adenin?].to_s.ljust(7,'0')
end

#weight_of_cytosin?Boolean

#

weight_of_cytosin?

#

Returns:

  • (Boolean)


2613
2614
2615
# File 'lib/bioroebe/shell/shell.rb', line 2613

def weight_of_cytosin?
  ChemistryParadise::CalculateAtomicMass[cytosin?].to_s.ljust(7,'0')
end

#weight_of_guanin?Boolean

#

weight_of_guanin?

#

Returns:

  • (Boolean)


2627
2628
2629
# File 'lib/bioroebe/shell/shell.rb', line 2627

def weight_of_guanin?
  ChemistryParadise::CalculateAtomicMass[guanin?].to_s.ljust(7,'0')
end

#weight_of_thymin?Boolean

#

weight_of_thymin?

#

Returns:

  • (Boolean)


2606
2607
2608
# File 'lib/bioroebe/shell/shell.rb', line 2606

def weight_of_thymin?
  ChemistryParadise::CalculateAtomicMass[thymin?].to_s.ljust(7,'0')
end

#weight_of_uracil?Boolean

#

weight_of_uracil?

#

Returns:

  • (Boolean)


2620
2621
2622
# File 'lib/bioroebe/shell/shell.rb', line 2620

def weight_of_uracil?
  ChemistryParadise::CalculateAtomicMass[uracil?].to_s.ljust(7,'0')
end

#wget(i) ⇒ Object

#

wget (wget tag)

Simply use wget to download remote files.

#


5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
# File 'lib/bioroebe/shell/shell.rb', line 5087

def wget(i)
  if i.is_a? Array
    i.each {|entry| wget(entry) }
  else
    unless i.start_with? 'wget '
      i = "wget #{i}"
    end
    esystem i
  end
end

#what_sequence_is_this?(i = dna_sequence? ) ⇒ Boolean

#

what_sequence_is_this?

This method attempts to find common sequences.

#

Returns:

  • (Boolean)


1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
# File 'lib/bioroebe/shell/shell.rb', line 1631

def what_sequence_is_this?(
    i = dna_sequence?
  )
  erev 'The sequence length is '+i.size.to_s+'.'
  # ======================================================================= #
  # Obtain the corresponding aminoacid sequence next.
  # ======================================================================= #
  aa_sequence = ::Bioroebe.dna_to_aa(i)
  if aa_sequence.include? ::Bioroebe.ubiquitin
    erev 'The aminoacid sequence has at least one Ubiquitin-related sequence.'
  end
end

#will_we_truncate?Boolean

#

will_we_truncate?

#

Returns:

  • (Boolean)


9340
9341
9342
9343
9344
9345
9346
# File 'lib/bioroebe/shell/shell.rb', line 9340

def will_we_truncate?
  if do_truncate?
    erev 'We will truncate.'
  else
    erev 'We will not truncate.'
  end
end

#will_we_use_colours?Boolean

#

will_we_use_colours?

#

Returns:

  • (Boolean)


4210
4211
4212
# File 'lib/bioroebe/shell/shell.rb', line 4210

def will_we_use_colours?
  erev "Will we use colours? #{verbose_truth(@use_colours)}#{rev}"
end

#www_finder_runObject

#

www_finder_run

#


3772
3773
3774
# File 'lib/bioroebe/shell/shell.rb', line 3772

def www_finder_run
  Bioroebe::GUI::Gtk::WwwFinder.run
end