Class: MiGA::Cli::Action::Doctor
- Inherits:
-
MiGA::Cli::Action
- Object
- MiGA
- MiGA::Cli::Action
- MiGA::Cli::Action::Doctor
- Includes:
- Base, Databases, Distances, Operations
- Defined in:
- lib/miga/cli/action/doctor.rb
Defined Under Namespace
Modules: Base, Databases, Distances, Operations
Constant Summary collapse
- @@OPERATIONS =
{ status: ['status', 'Update metadata status of all datasets'], db: ['databases', 'Check integrity of database files'], bidir: ['bidirectional', 'Check distances are bidirectional'], dist: ['distances', 'Check distance summary tables'], files: ['files', 'Check for outdated files'], cds: ['cds', 'Check for gzipped genes and proteins'], ess: ['essential-genes', 'Check for outdated essential genes'], mts: ['mytaxa-scan', 'Check for unarchived MyTaxa scan'], start: ['start', 'Check for lingering .start files'], tax: ['taxonomy', 'Check for taxonomy consistency (not yet implemented)'] }
Constants included from MiGA
MiGA::CITATION, VERSION, VERSION_DATE, VERSION_NAME
Instance Attribute Summary
Attributes inherited from MiGA::Cli::Action
Class Method Summary collapse
-
.OPERATIONS ⇒ Object
All supported operations.
Instance Method Summary collapse
Methods included from Operations
#check_cds, #check_ess, #check_files, #check_mts, #check_start, #check_status, #check_tax
Methods included from Distances
#check_bidir, #check_db, #check_dist, #merge_bidir_tmp, #partial_bidir_tmp
Methods included from Databases
#check_sqlite3_database, #each_database_file
Methods included from Base
#check_dist_eval, #check_dist_fix, #check_dist_recompute, #outdated_fastaai_ess, #read_bidirectional, #run_cmd, #save_bidirectional, #saved_targets
Methods inherited from MiGA::Cli::Action
#complete, #empty_action, #initialize, #launch, load, #name
Methods inherited from MiGA
CITATION, CITATION_ARRAY, DEBUG, DEBUG_OFF, DEBUG_ON, DEBUG_TRACE_OFF, DEBUG_TRACE_ON, FULL_VERSION, LONG_VERSION, VERSION, VERSION_DATE, #advance, debug?, debug_trace?, initialized?, #like_io?, #num_suffix, rc_path, #result_files_exist?, #say
Methods included from MiGA::Common::Path
Methods included from MiGA::Common::Format
#clean_fasta_file, #seqs_length, #tabulate
Methods included from MiGA::Common::Net
#download_file_ftp, #known_hosts, #remote_connection
Methods included from MiGA::Common::SystemCall
Constructor Details
This class inherits a constructor from MiGA::Cli::Action
Class Method Details
.OPERATIONS ⇒ Object
All supported operations
63 64 65 |
# File 'lib/miga/cli/action/doctor.rb', line 63 def OPERATIONS @@OPERATIONS end |
Instance Method Details
#parse_cli ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/miga/cli/action/doctor.rb', line 14 def parse_cli cli.defaults = { threads: 1 } cli.defaults = Hash[@@OPERATIONS.keys.map { |i| [i, true] }] cli.parse do |opt| operation_n = Hash[@@OPERATIONS.map { |k, v| [v[0], k] }] cli.opt_object(opt, [:project]) opt.on( '--ignore TASK1,TASK2', Array, 'Do not perform the task(s) listed. Available tasks are:', * @@OPERATIONS.values.map { |v| "~ #{v[0]}: #{v[1]}" } ) { |v| v.map { |i| cli[operation_n[i]] = false } } opt.on( '--only TASK', 'Perform only the specified task (see --ignore)' ) do |v| op_k = @@OPERATIONS.find { |_, i| i[0] == v.downcase }.first @@OPERATIONS.each_key { |i| cli[i] = false } cli[op_k] = true end opt.on( '-t', '--threads INT', Integer, "Concurrent threads to use. By default: #{cli[:threads]}" ) { |v| cli[:threads] = v } end end |
#perform ⇒ Object
40 41 42 43 44 45 |
# File 'lib/miga/cli/action/doctor.rb', line 40 def perform p = cli.load_project @@OPERATIONS.keys.each do |k| send("check_#{k}", cli) if cli[k] end end |