Class: Bioroebe::GenbankFlatFileFormatGenerator
Overview
Constant Summary
collapse
- DEFAULT_NAME_OF_THE_LOCUS =
#
DEFAULT_NAME_OF_THE_LOCUS
#
'tmpseq_0'
CommandlineApplication::OLD_VERBOSE_VALUE
ColoursForBase::ARRAY_HTML_COLOURS_IN_USE
Constants inherited
from Base
Base::NAMESPACE
Class Method Summary
collapse
Instance Method Summary
collapse
#all_aminoacids?, #append_what_into, #at_home?, #be_silent, #be_verbose?, #cat, #ccliner, #change_directory, #cliner, #codon_table_dataset?, #codon_to_aminoacid, #codons_for?, #colourize_this_dna_sequence, #complement, #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?, #leading_five_prime, #load_bioroebe_yaml_file, #log_directory?, #one_letter_to_long_name, #one_to_three, #only_numbers?, #open_in_browser, #opne, #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, #set_be_verbose, #start_codon?, #stop_codons?, #strict_filter_away_invalid_aminoacids, #taxonomy_download_directory?, #three_to_one, #to_rna, #trailing_three_prime, #use_opn?, #verbose_truth, #was_or_were, #without_extname, #write_what_into
#commandline_arguments?, #commandline_arguments_that_are_files?, #e, #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
#colourize_this_aminoacid_sequence_for_the_commandline, #colourize_this_nucleotide_sequence, #disable_colours, #ecomment, #efancy, #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?
Methods inherited from Base
#append_what_into, #can_base_pair?, #convert_global_env, #delete_file, #directory_to_the_codon_tables?, #file_readlines, #infer_the_namespace, #is_on_roebe?, #is_palindrome?, #main_encoding?, #mkdir, #move_file, #mv, #namespace?, #no_file_exists_at, #no_newlines, #project_yaml_directory?, #rds, #register_sigint, #return_pwd, #return_the_first_line_of_this_file, #word_wrap, #write_what_into
Constructor Details
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
|
# File 'lib/bioroebe/genbank/genbank_flat_file_format_generator.rb', line 34
def initialize(
i = nil,
run_already = true
)
reset
set_input(i)
case run_already when :do_not_run_yet
run_already = false
end
if block_given?
yielded = yield
if yielded.is_a? Hash
if yielded.has_key? :sequence_id
set_id(yielded.delete(:sequence_id))
end
elsif yielded.is_a? Symbol
case yielded
when :be_quiet
@be_verbose = false
end
end
end
run if run_already
end
|
Class Method Details
.[](i = '') ⇒ Object
267
268
269
|
# File 'lib/bioroebe/genbank/genbank_flat_file_format_generator.rb', line 267
def self.[](i = '')
new(i)
end
|
Instance Method Details
#add(i) ⇒ Object
153
154
155
|
# File 'lib/bioroebe/genbank/genbank_flat_file_format_generator.rb', line 153
def add(i)
@string << i
end
|
#add_required_content ⇒ Object
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
|
# File 'lib/bioroebe/genbank/genbank_flat_file_format_generator.rb', line 201
def add_required_content
add 'LOCUS '+name_of_the_locus?+' '+n_nucleotides?.to_s+' bp '+chromosome_form?+' '+return_current_date+'
DEFINITION No definition line found.
ACCESSION '+name_of_the_locus?+'
VERSION
KEYWORDS .
SOURCE Unknown.
ORGANISM Unknown.
Unclassified.
FEATURES Location/Qualifiers
source 1..'+n_nucleotides?.to_s+'
BASE COUNT '+n_adenines?.to_s+' a '+n_cytosines?.to_s+' c '+n_guanines?.to_s+' g '+n_thymines?.to_s+' t
ORIGIN
'+
return_chunked_numbered_and_properly_spaced_sequence+
'//
'
end
|
#
This will be linear or circular chromosome.
#
172
173
174
|
# File 'lib/bioroebe/genbank/genbank_flat_file_format_generator.rb', line 172
def chromosome_form?
'linear'
end
|
223
224
225
|
# File 'lib/bioroebe/genbank/genbank_flat_file_format_generator.rb', line 223
def input?
@input
end
|
#n_adenines? ⇒ Boolean
125
126
127
|
# File 'lib/bioroebe/genbank/genbank_flat_file_format_generator.rb', line 125
def n_adenines?
@input.count('a')
end
|
#n_cytosines? ⇒ Boolean
132
133
134
|
# File 'lib/bioroebe/genbank/genbank_flat_file_format_generator.rb', line 132
def n_cytosines?
@input.count('c')
end
|
#n_guanines? ⇒ Boolean
146
147
148
|
# File 'lib/bioroebe/genbank/genbank_flat_file_format_generator.rb', line 146
def n_guanines?
@input.count('g')
end
|
#n_nucleotides? ⇒ Boolean
98
99
100
|
# File 'lib/bioroebe/genbank/genbank_flat_file_format_generator.rb', line 98
def n_nucleotides?
@input.size
end
|
#n_thymines? ⇒ Boolean
139
140
141
|
# File 'lib/bioroebe/genbank/genbank_flat_file_format_generator.rb', line 139
def n_thymines?
@input.count('t')
end
|
#name_of_the_locus? ⇒ Boolean
Also known as:
sequence_id?, id?
231
232
233
|
# File 'lib/bioroebe/genbank/genbank_flat_file_format_generator.rb', line 231
def name_of_the_locus?
@name_of_the_locus
end
|
#reset ⇒ Object
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
|
# File 'lib/bioroebe/genbank/genbank_flat_file_format_generator.rb', line 78
def reset
super()
@be_verbose = true
@shall_we_downcase = true
@string = ''.dup set_name_of_the_locus
end
|
#return_chunked_numbered_and_properly_spaced_sequence(i = dna_sequence?
) ⇒ Object
#
return_chunked_numbered_and_properly_spaced_sequence
This method will display the nucleotides via a proper chunk.
#
250
251
252
253
254
|
# File 'lib/bioroebe/genbank/genbank_flat_file_format_generator.rb', line 250
def return_chunked_numbered_and_properly_spaced_sequence(
i = dna_sequence?
)
::Bioroebe.return_chunked_display(i)
end
|
#return_current_date ⇒ Object
160
161
162
163
164
165
|
# File 'lib/bioroebe/genbank/genbank_flat_file_format_generator.rb', line 160
def return_current_date
day = ::Time.now.strftime('%d')
year = ::Time.now.strftime('%Y')
month = ::Time.now.strftime('%B').upcase "#{day}-#{month}-#{year}"
end
|
#return_nucleotide_sequence_as_ten_nucleotides_chunks ⇒ Object
#
return_nucleotide_sequence_as_ten_nucleotides_chunks
This will return the input sequence in the form of chunks.
#
#run ⇒ Object
259
260
261
262
|
# File 'lib/bioroebe/genbank/genbank_flat_file_format_generator.rb', line 259
def run
add_required_content
show_main_string
end
|
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
|
# File 'lib/bioroebe/genbank/genbank_flat_file_format_generator.rb', line 105
def set_input(
i = '',
shall_we_downcase = @shall_we_downcase
)
i = i.first if i.is_a? Array
i = i.to_s.dup.strip
if i and File.file?(i)
i = File.readlines(i)
i.shift if i.first.start_with?('>')
i = i.join("\n")
end
if shall_we_downcase
i.downcase! end
@input = i
end
|
#set_name_of_the_locus(i = DEFAULT_NAME_OF_THE_LOCUS) ⇒ Object
Also known as:
use_this_as_id=, set_id
#
set_name_of_the_locus
#
193
194
195
|
# File 'lib/bioroebe/genbank/genbank_flat_file_format_generator.rb', line 193
def set_name_of_the_locus(i = DEFAULT_NAME_OF_THE_LOCUS)
@name_of_the_locus = i
end
|
#show_main_string ⇒ Object
179
180
181
|
# File 'lib/bioroebe/genbank/genbank_flat_file_format_generator.rb', line 179
def show_main_string
e @string if @be_verbose
end
|
#string? ⇒ Boolean
186
187
188
|
# File 'lib/bioroebe/genbank/genbank_flat_file_format_generator.rb', line 186
def string?
@string
end
|