Class: Unipept::Commands::Pept2prot

Inherits:
ApiRunner show all
Defined in:
lib/commands/unipept/pept2prot.rb

Instance Attribute Summary

Attributes inherited from ApiRunner

#configuration, #url, #user_agent

Instance Method Summary collapse

Methods inherited from ApiRunner

#batch_iterator, #batch_size, #concurrent_requests, #construct_request_body, #formatter, #host, #input_iterator, #output_writer, #queue_size, #run, #save_error, #selected_fields

Constructor Details

#initialize(args, opts, cmd) ⇒ Pept2prot

Returns a new instance of Pept2prot.



5
6
7
8
9
10
11
12
# File 'lib/commands/unipept/pept2prot.rb', line 5

def initialize(args, opts, cmd)
  if args[:meganize]
    args[:all] = true
    args[:select] = ['peptide,refseq_protein_ids']
    args[:format] = 'blast'
  end
  super
end

Instance Method Details

#default_batch_sizeObject



18
19
20
21
22
23
24
# File 'lib/commands/unipept/pept2prot.rb', line 18

def default_batch_size
  if options[:all]
    5
  else
    10
  end
end

#required_fieldsObject



14
15
16
# File 'lib/commands/unipept/pept2prot.rb', line 14

def required_fields
  ['peptide']
end