Module: EcfClassify::Zenodo
- Defined in:
- lib/ecf_classify/zenodo.rb
Constant Summary collapse
- PATH =
""- RECORD_URL =
'https://zenodo.org/record/3672544/'- FILES =
{ :general => "ecf_general_model.hmm", :sigma3 => "Sigma70_r3.hmm", :sigma2_4 => "Sigma70_r2_r4.hmm", :groups => "all_ecf_groups.hmm", :subgroups => "all_ecf_subgroups.hmm", :groups_statistics => "groups_statistics.txt", :subgroups_statistics => "subgroups_statistics.txt", }
- STATUS_FILE =
"status.txt"
Class Method Summary collapse
- .check ⇒ Object
-
.download ⇒ Object
downloads the current dataset.
- .file ⇒ Object
- .path(name) ⇒ Object
-
.status ⇒ Object
get the status of the download.
Class Method Details
.check ⇒ Object
49 50 51 |
# File 'lib/ecf_classify/zenodo.rb', line 49 def self.check end |
.download ⇒ Object
downloads the current dataset
returns
true if everything is ok
23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/ecf_classify/zenodo.rb', line 23 def self.download perma_record = 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 ⇒ Object
53 54 55 |
# File 'lib/ecf_classify/zenodo.rb', line 53 def self.file end |
.path(name) ⇒ Object
57 58 59 |
# File 'lib/ecf_classify/zenodo.rb', line 57 def self.path(name) File.('../../../data/' + (FILES[name] || name.to_s) , __FILE__) end |
.status ⇒ Object
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
41 42 43 44 45 46 47 |
# 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 |