Sha256: eeaa360abed0c0b16c974c285161382dbef66e175c722c017e8cf62ebefe095d

Contents?: true

Size: 492 Bytes

Versions: 5

Compression:

Stored size: 492 Bytes

Contents

require_relative 'api_runner'

module Unipept::Commands
  class Pept2prot < ApiRunner
    def download_xml(result)
      if options[:xml]
        FileUtils.mkdir_p(options[:xml])
        result.first.each do |prot|
          File.open(options[:xml] + "/#{prot['uniprot_id']}.xml", "wb") do |f|
            f.write Typhoeus.get("http://www.uniprot.org/uniprot/#{prot['uniprot_id']}.xml").response_body
          end
        end
      end
    end

    def batch_size
      10
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
unipept-0.7.1 lib/unipept/commands/pept2prot.rb
unipept-0.7.0 lib/unipept/commands/pept2prot.rb
unipept-0.6.4 lib/unipept/commands/pept2prot.rb
unipept-0.6.2 lib/unipept/commands/pept2prot.rb
unipept-0.6.1 lib/unipept/commands/pept2prot.rb