Class: SequenceLogo::CLI
- Inherits:
-
Object
- Object
- SequenceLogo::CLI
- Defined in:
- lib/sequence_logo/cli.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ CLI
constructor
A new instance of CLI.
- #parse_options!(argv) ⇒ Object
- #parser ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ CLI
Returns a new instance of CLI.
8 9 10 |
# File 'lib/sequence_logo/cli.rb', line 8 def initialize( = {}) @options = .dup end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
7 8 9 |
# File 'lib/sequence_logo/cli.rb', line 7 def @options end |
Instance Method Details
#parse_options!(argv) ⇒ Object
11 12 13 14 |
# File 'lib/sequence_logo/cli.rb', line 11 def (argv) parser.parse!(argv) end |
#parser ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/sequence_logo/cli.rb', line 15 def parser @parser ||= OptionParser.new do |opts| opts.version = ::SequenceLogo::VERSION opts.on('-x', '--x-unit X_UNIT', 'Single letter width') do |v| [:x_unit] = v.to_i end opts.on('-y', '--y-unit Y_UNIT', 'Base letter height') do |v| [:y_unit] = v.to_i end opts.on('--icd-mode MODE', 'Calculation mode: discrete or weblogo', 'Weblogo is assumed if word count not given') do |v| [:icd_mode] = v.to_sym raise ArgumentError, 'icd-mode can be either discrete or weblogo' unless [:discrete, :weblogo].include?([:icd_mode]) end opts.on('--[no-]threshold-lines', 'Draw threshold lines') do |v| [:threshold_lines] = v end opts.on('--scheme SCHEME', 'Specify folder with nucleotide images') do |v| [:scheme] = v end end end |