labimotion 1.4.0.rc11 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/labimotion/apis/converter_api.rb +10 -6
- data/lib/labimotion/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0d5a4e5bede72cabd2f16bd75fbf033750939bbcb7cce96a4290382ddfd1026e
|
4
|
+
data.tar.gz: 86575f263c012a3c68a554d015ee94865ec145e31f62bcd7809d13c87837f13b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4954307a55b22171b0ac8cffd598cb4d976116ce3c802a2a0f89c58098e888fb5f06e7c26ac5fab312170ab20b18967f07f6a6ecbbfde67af0b3a59f2f5f64b0
|
7
|
+
data.tar.gz: 7042d287f388a5cd7e2b40c98092e61a60352e7eb7f9da9900c1fee1b5e0b4a4223deae5ba8bfe109940e4d429c053e10a5f3aef84ca0c4453ba339ab2d7dd25
|
@@ -39,24 +39,28 @@ module Labimotion
|
|
39
39
|
helpers do
|
40
40
|
def convert_structure(molfile)
|
41
41
|
molecule_viewer = Matrice.molecule_viewer
|
42
|
-
if molecule_viewer.blank? || molecule_viewer[:
|
42
|
+
if molecule_viewer.blank? || molecule_viewer[:chembox_api].blank?
|
43
43
|
{ molfile: molfile }
|
44
44
|
else
|
45
45
|
options = { timeout: 10, body: { mol: molfile }.to_json, headers: { 'Content-Type' => 'application/json' } }
|
46
|
-
response = HTTParty.post(molecule_viewer[:
|
47
|
-
response.code == 200
|
46
|
+
response = HTTParty.post("#{molecule_viewer[:chembox_api]}/core/rdkit/v1/structure", options)
|
47
|
+
if response.code == 200
|
48
|
+
{ molfile: (response.parsed_response && response.parsed_response['molfile']) || molfile }
|
49
|
+
else
|
50
|
+
{ molfile: molfile }
|
51
|
+
end
|
48
52
|
end
|
49
53
|
end
|
50
54
|
end
|
51
55
|
desc 'convert molfile to 3d'
|
52
56
|
params do
|
53
|
-
requires :
|
57
|
+
requires :mol, type: String, desc: 'Molecule molfile'
|
54
58
|
end
|
55
59
|
post do
|
56
|
-
convert_structure(params[:
|
60
|
+
convert_structure(params[:mol])
|
57
61
|
rescue StandardError => e
|
58
62
|
# return { msg: { level: 'error', message: e } }
|
59
|
-
{ molfile: params[:
|
63
|
+
{ molfile: params[:mol], msg: { level: 'error', message: e } }
|
60
64
|
end
|
61
65
|
end
|
62
66
|
|
data/lib/labimotion/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: labimotion
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.0
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chia-Lin Lin
|
@@ -123,9 +123,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
123
123
|
version: '0'
|
124
124
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
125
125
|
requirements:
|
126
|
-
- - "
|
126
|
+
- - ">="
|
127
127
|
- !ruby/object:Gem::Version
|
128
|
-
version:
|
128
|
+
version: '0'
|
129
129
|
requirements: []
|
130
130
|
rubygems_version: 3.1.6
|
131
131
|
signing_key:
|