module EcfClassify::Zenodo
Constants
- FILES
- PATH
- RECORD_URL
- STATUS_FILE
Public Class Methods
check()
click to toggle source
# File lib/ecf_classify/zenodo.rb, line 49 def self.check end
download()
click to toggle source
downloads the current dataset
returns
true if everything is ok
# File lib/ecf_classify/zenodo.rb, line 23 def self.download perma_record = URI.open(RECORD_URL) FILES.each do |key,file| download = open(perma_record.base_uri.to_s + "/files/" + file) IO.copy_stream(download, path(key)) if(file.split(".").last == "hmm") EcfClassify::HMMER.hmmpress(path(key)) end end open(path(STATUS_FILE),"w"){ |f| f.puts perma_record.base_uri.to_s } true end
file()
click to toggle source
# File lib/ecf_classify/zenodo.rb, line 53 def self.file end
path(name)
click to toggle source
# File lib/ecf_classify/zenodo.rb, line 57 def self.path(name) File.expand_path('../../../data/' + (FILES[name] || name.to_s) , __FILE__) end
status()
click to toggle source
get the status of the download
returns the current doi if the dataset is complete returns nil if the data is not there or incomplete
# File lib/ecf_classify/zenodo.rb, line 41 def self.status if File.exists? path(STATUS_FILE) return File.read(path(STATUS_FILE)) else return nil end end