diff --git a/.yardoc/checksums b/.yardoc/checksums index 2868505..733e89f 100644 --- a/.yardoc/checksums +++ b/.yardoc/checksums @@ -1,4 +1,4 @@ -lib/classyfire_api.rb 4e5cc4102771d77c67759b9298ae685f0cb612cd +lib/classyfire_api.rb 3449cdc9aef5fb255b1fdc933f7d7653bb1fa960 lib/query_resource.rb 645cfb1688a5c44e67e5227fc0e9a77589731f24 lib/entity_resource.rb 6c50b4be6a5eb13b44d7080b19c7033b7a37c7cf lib/sequence_resource.rb d8c5007781d50d0bc13cbe360b617e2937a19428 diff --git a/.yardoc/objects/root.dat b/.yardoc/objects/root.dat index cf147b6..45e47d8 100644 Binary files a/.yardoc/objects/root.dat and b/.yardoc/objects/root.dat differ diff --git a/doc/ClassyFireAPI.html b/doc/ClassyFireAPI.html index fb1207f..5ba7df4 100644 --- a/doc/ClassyFireAPI.html +++ b/doc/ClassyFireAPI.html @@ -327,7 +327,7 @@ of a given size.
Submits a ClassyFire query, which should be returned in a specific format.
+Submits a ClassyFire query in a JSON format.
-61 62 63 64 @@ -494,10 +493,11 @@ specified format. 77 78 79 -80+80 +81
# File 'lib/classyfire_api.rb', line 61 +# File 'lib/classyfire_api.rb', line 62 def ClassyFireAPI.get_entity_classification(inchikey,format="json") inchikey_id = inchikey.to_s.gsub('InChIKey=','') @@ -608,7 +608,6 @@ specified format.-36 37 38 39 @@ -626,10 +625,11 @@ specified format. 51 52 53 -54+54 +55
# File 'lib/classyfire_api.rb', line 36 +# File 'lib/classyfire_api.rb', line 37 def ClassyFireAPI.get_query(query_id,format="json") begin @@ -739,7 +739,6 @@ specified format.-87 88 89 90 @@ -753,10 +752,11 @@ specified format. 98 99 100 -101+101 +102
# File 'lib/classyfire_api.rb', line 87 +# File 'lib/classyfire_api.rb', line 88 def ClassyFireAPI.get_sequence_classification(fingerprint,format="json") begin @@ -842,17 +842,17 @@ specified format.-128 129 130 131 132 133 134 -135+135 +136
# File 'lib/classyfire_api.rb', line 128 +# File 'lib/classyfire_api.rb', line 129 def ClassyFireAPI.query_status(query_id) begin @@ -932,8 +932,6 @@ retrieve the strutcure's classification from ClassyFire.-309 -310 311 312 313 @@ -994,10 +992,12 @@ retrieve the strutcure's classification from ClassyFire. 368 369 370 -371+371 +372 +373
# File 'lib/classyfire_api.rb', line 309 +# File 'lib/classyfire_api.rb', line 311 def ClassyFireAPI.retrieve_classification(input,output) absolute_path = File.(input) @@ -1133,8 +1133,6 @@ format.-378 -379 380 381 382 @@ -1186,10 +1184,12 @@ format. 428 429 430 -431+431 +432 +433
# File 'lib/classyfire_api.rb', line 378 +# File 'lib/classyfire_api.rb', line 380 def ClassyFireAPI.retrieve_entities_json(input,output) absolute_path = File.(input) @@ -1316,8 +1316,6 @@ format.-440 -441 442 443 444 @@ -1375,10 +1373,12 @@ format. 496 497 498 -499+499 +500 +501
# File 'lib/classyfire_api.rb', line 440 +# File 'lib/classyfire_api.rb', line 442 def ClassyFireAPI.retrieve_entities_sdf(input,output) absolute_path = File.(input) @@ -1509,8 +1509,6 @@ slice_length [Integer] The maximum number of entries for each query input-227 -228 229 230 231 @@ -1518,10 +1516,12 @@ slice_length [Integer] The maximum number of entries for each query input 233 234 235 -236+236 +237 +238
# File 'lib/classyfire_api.rb', line 227 +# File 'lib/classyfire_api.rb', line 229 def ClassyFireAPI.submit_queries_from_directory(folder,slice_length,type="STRUCTURE") if File.directory?(folder) @@ -1550,7 +1550,7 @@ slice_length [Integer] The maximum number of entries for each query input-Submits a ClassyFire query, which should be returned in a specific format.
+Submits a ClassyFire query in a JSON format.
if there is an error.
@@ -1589,6 +1589,24 @@ slice_length [Integer] The maximum number of entries for each query input —+ + + +the input of the query.
++ + type + + + (String) + + + (defaults to: 'STRUCTURE') + + + — + @@ -1620,7 +1638,6 @@ slice_length [Integer] The maximum number of entries for each query input+the type of the query.
-13 14 15 16 @@ -1635,10 +1652,11 @@ slice_length [Integer] The maximum number of entries for each query input 25 26 27 -28+28 +29
# File 'lib/classyfire_api.rb', line 13 +# File 'lib/classyfire_api.rb', line 14 def ClassyFireAPI.submit_query(label,input, type='STRUCTURE') begin @@ -1722,7 +1740,6 @@ framgments from the index 'start'.-150 151 152 153 @@ -1784,10 +1801,12 @@ framgments from the index 'start'. 209 210 211 -212+212 +213 +214
# File 'lib/classyfire_api.rb', line 150 +# File 'lib/classyfire_api.rb', line 151 def ClassyFireAPI.submit_query_input_in_chunks(input_file,slice_length, start, type='STRUCTURE') @start_time = Time.now @@ -1802,7 +1821,7 @@ framgments from the index 'start'. if sline.length == 1 input <<"#{sline[0]}" elsif sline.length >= 2 - input <<"#{sline[0]}\t#{sline[2]}" + input <<"#{sline[0]}\t#{sline[1]}" end end @@ -1817,15 +1836,17 @@ framgments from the index 'start'. while i < initial_nr_of_jobs title = File.basename(absolute_path).split(".")[0] + "_yannick" + "_part_#{i}" - begin - puts "submitting #{title}" - q = submit_query(title,subdivised_groups[i-1].join("\n"),type) - query_ids << JSON.parse(q)['id'] - rescue Exception => e - puts e. - puts e.backtrace.inspect + if i <= subdivised_groups.length + begin + puts "submitting #{title}" + q = submit_query(title,subdivised_groups[i-1].join("\n"),type) + query_ids << JSON.parse(q)['id'] + rescue Exception => e + puts e. + puts e.backtrace.inspect + end + i = i + 1 end - i = i + 1 end puts "Going to sleep at #{Time.now - @start_time} for #{sleeping_time} s." @@ -1844,7 +1865,6 @@ framgments from the index 'start'. puts e. puts e.backtrace.inspect end - end i = k puts "Going to sleep at #{Time.now - @start_time} for #{sleeping_time} s." @@ -1950,8 +1970,6 @@ text. is fragmented into n part of #slice_length entries each).-252 -253 254 255 256 @@ -2000,10 +2018,12 @@ text. is fragmented into n part of #slice_length entries each). 299 300 301 -302+302 +303 +304
# File 'lib/classyfire_api.rb', line 252 +# File 'lib/classyfire_api.rb', line 254 def ClassyFireAPI.submit_random_subset_of_query_input_in_chunks(tab_separated_input_file,size, type='STRUCTURE') @start_time = Time.now @@ -2066,7 +2086,7 @@ text. is fragmented into n part of #slice_length entries each). diff --git a/doc/EntityResource.html b/doc/EntityResource.html index 751e75d..a5202f3 100644 --- a/doc/EntityResource.html +++ b/doc/EntityResource.html @@ -114,7 +114,7 @@ diff --git a/doc/QueryResource.html b/doc/QueryResource.html index 0bad01d..6538bb0 100644 --- a/doc/QueryResource.html +++ b/doc/QueryResource.html @@ -183,7 +183,7 @@ diff --git a/doc/SequenceResource.html b/doc/SequenceResource.html index 25cf179..c1c1a8e 100644 --- a/doc/SequenceResource.html +++ b/doc/SequenceResource.html @@ -114,7 +114,7 @@ diff --git a/doc/_index.html b/doc/_index.html index 75f45b6..64f3f27 100644 --- a/doc/_index.html +++ b/doc/_index.html @@ -140,7 +140,7 @@ diff --git a/doc/file.README.html b/doc/file.README.html index e3f7fc1..c669d32 100644 --- a/doc/file.README.html +++ b/doc/file.README.html @@ -236,7 +236,7 @@ XML format. diff --git a/doc/index.html b/doc/index.html index e3f7fc1..c669d32 100644 --- a/doc/index.html +++ b/doc/index.html @@ -236,7 +236,7 @@ XML format. diff --git a/doc/top-level-namespace.html b/doc/top-level-namespace.html index 6cb613a..5468c69 100644 --- a/doc/top-level-namespace.html +++ b/doc/top-level-namespace.html @@ -105,7 +105,7 @@ diff --git a/lib/classyfire_api.rb b/lib/classyfire_api.rb index 7c5e780..2c16c24 100644 --- a/lib/classyfire_api.rb +++ b/lib/classyfire_api.rb @@ -4,10 +4,11 @@ require 'csv' module ClassyFireAPI URL = 'http://classyfire.wishartlab.com' - # Submits a ClassyFire query, which should be returned in a specific format. + # Submits a ClassyFire query in a JSON format. # # @param label [String] the label of the query. - # @param input[String] the input of the query. + # @param input [String] the input of the query. + # @param type [String] the type of the query. # @return [Hash] A Ruby Hash with the id (and other attributes) of the Query or nil # if there is an error. def ClassyFireAPI.submit_query(label,input, type='STRUCTURE') @@ -160,7 +161,7 @@ module ClassyFireAPI if sline.length == 1 input <<"#{sline[0]}" elsif sline.length >= 2 - input <<"#{sline[0]}\t#{sline[2]}" + input <<"#{sline[0]}\t#{sline[1]}" end end