openbabel

This commit is contained in:
djoumbou 2016-11-21 00:11:35 -07:00
parent 7b532839d9
commit 0bb37b1178
1 changed files with 9 additions and 9 deletions

View File

@ -1,7 +1,7 @@
require 'JSON'
require 'csv'
require 'rest-client'
require 'openbabel'
# require 'openbabel'
# require 'node_resource.rb'
module ClassyFireAPI
@ -167,7 +167,7 @@ module ClassyFireAPI
#ID\tSMILES (OR INCHI, OR VALID IUPAC NAME)
input <<"#{sline[0]}\t#{sline[1]}"
end
input <<"#{sline[0]}"
# input <<"#{sline[0]}"
end
query_ids = []
@ -184,16 +184,16 @@ module ClassyFireAPI
if i <= subdivised_groups.length
puts "\n\n\n\n---------------------- -----------"
# begin
begin
puts "submitting #{title}"
puts subdivised_groups[i-1].join("\n")
# puts subdivised_groups[i-1].join("\n")
q = submit_query(title,subdivised_groups[i-1].join("\n"),type)
# puts q
query_ids << JSON.parse(q)['id']
# rescue Exception => e
# puts e.message
# puts e.backtrace.inspect
# end
rescue Exception => e
puts e.message
puts e.backtrace.inspect
end
i = i + 1
else
break
@ -241,7 +241,7 @@ module ClassyFireAPI
if File.directory?(folder)
Dir.foreach(folder) do |filename|
puts "Filename: #{filename}"
ClassyFireAPI.submit_query_input_in_chunks(folder+"/"+filename,slice_length, type) unless filename == "." || filename == ".." || filename == ".DS_Store"
ClassyFireAPI.submit_query_input_in_chunks(folder+"/"+filename,slice_length, type) unless filename[0] == "." || File.directory?(filenmae)
end
else
$stderr.puts "#{folder} is not a folder."