Class: Bioroebe::SanitizeNucleotideSequence
- Inherits:
-
Base
- Object
- Base
- Bioroebe::SanitizeNucleotideSequence
show all
- Defined in:
- lib/bioroebe/nucleotides/sanitize_nucleotide_sequence.rb
Overview
Bioroebe::SanitizeNucleotideSequence
Constant Summary
Constants inherited
from Base
Base::NAMESPACE
ColoursForBase::ARRAY_HTML_COLOURS_IN_USE
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Base
#append_what_into, #can_base_pair?, #convert_global_env, #delete_file, #directory_to_the_codon_tables?, #file_readlines, #is_on_roebe?, #is_palindrome?, #main_encoding?, #mkdir, #move_file, #mv, #no_file_exists_at, #no_newlines, #project_yaml_directory?, #rds, #register_sigint, #return_pwd, #write_what_into
#colourize_this_aminoacid_sequence_for_the_commandline, #colourize_this_nucleotide_sequence, #disable_colours, #ecomment, #egold, #enable_colours, #eorange, #eparse, #erev, #red, #remove_trailing_escape_part, #return_colour_for_nucleotides, #rev, #sdir, #set_use_colours, #sfancy, #sfile, #simp, #swarn, #use_colours?, #use_colours_within_the_bioroebe_namespace?
Constructor Details
34
35
36
37
38
39
40
41
|
# File 'lib/bioroebe/nucleotides/sanitize_nucleotide_sequence.rb', line 34
def initialize(
i = nil,
run_already = true
)
reset
set_input(i)
run if run_already
end
|
Class Method Details
.[](i = "1 ATCCG\n30 TTA") ⇒ Object
#
Bioroebe::SanitizeNucleotideSequence[]
#
110
111
112
|
# File 'lib/bioroebe/nucleotides/sanitize_nucleotide_sequence.rb', line 110
def self.[](i = "1 ATCCG\n30 TTA") new(i).result?
end
|
Instance Method Details
88
89
90
|
# File 'lib/bioroebe/nucleotides/sanitize_nucleotide_sequence.rb', line 88
def input?
@input
end
|
#report_result ⇒ Object
Also known as:
report
#
report_result
This will report the result, but it has to be invoked manually.
#
97
98
99
|
# File 'lib/bioroebe/nucleotides/sanitize_nucleotide_sequence.rb', line 97
def report_result
e result?
end
|
#reset ⇒ Object
46
47
48
|
# File 'lib/bioroebe/nucleotides/sanitize_nucleotide_sequence.rb', line 46
def reset
super()
end
|
#run ⇒ Object
104
105
|
# File 'lib/bioroebe/nucleotides/sanitize_nucleotide_sequence.rb', line 104
def run
end
|
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
# File 'lib/bioroebe/nucleotides/sanitize_nucleotide_sequence.rb', line 70
def sanitize_input
@input.delete!("\n")
@input.delete!("\\\\n")
chars = input?.chars
chars.reject! {|entry| entry =~ /\d+/ } @input = chars.join(' ')
@input.delete!(' ')
if @input.include? '/'
@input.delete!('/')
end
end
|
53
54
55
56
57
58
59
60
61
62
63
64
65
|
# File 'lib/bioroebe/nucleotides/sanitize_nucleotide_sequence.rb', line 53
def set_input(
i = ''
)
if i.is_a? Array
if i.first.start_with?('>') and i.first.include?(N) i[0] = i[0][i[0].index(N) .. -1] end
i = i.join(' ').strip
end
i = i.to_s.dup
@input = i
sanitize_input
end
|