cheminee 0.1.23 → 0.1.26
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +4 -4
- data/README.md +9 -6
- data/docs/ConvertedMolBlock.md +20 -0
- data/docs/DefaultApi.md +142 -4
- data/lib/cheminee/api/default_api.rb +148 -2
- data/lib/cheminee/models/converted_mol_block.rb +223 -0
- data/lib/cheminee/version.rb +1 -1
- data/lib/cheminee.rb +1 -0
- data/pkg/cheminee-0.1.26.gem +0 -0
- data/spec/models/converted_mol_block_spec.rb +42 -0
- metadata +7 -3
- data/pkg/cheminee-0.1.23.gem +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 58791881af044dbb1fb6d9d511a4ade941623aaeb4e9ec718edf508cda045370
|
4
|
+
data.tar.gz: 2c0017ca4c2600ad932c90149a70962b9bb3600f2ac2fa57be9636cda3b8c976
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d76f84e912592914527e25757823cd0d939a2b4896d6e56217383a128ce416ffef897c28499b08fb7509c256a8eb6b9843305e10db8b24c58525252b371dae91
|
7
|
+
data.tar.gz: f03b1375bede3e36e32609989c7fcd318b5a4abc9e6a7fffd4ae87ae5ab5b911bde82a5680bfbaa8c7cad8fe1f998553ccab1555920a07f13e3c7ed20afb69a3
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
cheminee (0.1.
|
4
|
+
cheminee (0.1.26)
|
5
5
|
typhoeus (~> 1.0, >= 1.0.1)
|
6
6
|
|
7
7
|
GEM
|
@@ -16,8 +16,8 @@ GEM
|
|
16
16
|
ffi (1.17.0-x86_64-linux-gnu)
|
17
17
|
jaro_winkler (1.5.6)
|
18
18
|
method_source (1.1.0)
|
19
|
-
parallel (1.
|
20
|
-
parser (3.3.4.
|
19
|
+
parallel (1.26.1)
|
20
|
+
parser (3.3.4.2)
|
21
21
|
ast (~> 2.4.1)
|
22
22
|
racc
|
23
23
|
pry (0.14.2)
|
@@ -28,7 +28,7 @@ GEM
|
|
28
28
|
pry (>= 0.13, < 0.15)
|
29
29
|
psych (5.1.2)
|
30
30
|
stringio
|
31
|
-
racc (1.8.
|
31
|
+
racc (1.8.1)
|
32
32
|
rainbow (3.1.1)
|
33
33
|
rake (13.0.6)
|
34
34
|
rspec (3.13.0)
|
data/README.md
CHANGED
@@ -7,7 +7,7 @@ Cheminée: The Chemical Structure Search Engine
|
|
7
7
|
This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
8
8
|
|
9
9
|
- API version: 1.0
|
10
|
-
- Package version: 0.1.
|
10
|
+
- Package version: 0.1.26
|
11
11
|
- Generator version: 7.8.0-SNAPSHOT
|
12
12
|
- Build package: org.openapitools.codegen.languages.RubyClientCodegen
|
13
13
|
For more information, please visit [https://github.com/rdkit-rs/cheminee](https://github.com/rdkit-rs/cheminee)
|
@@ -25,16 +25,16 @@ gem build cheminee.gemspec
|
|
25
25
|
Then either install the gem locally:
|
26
26
|
|
27
27
|
```shell
|
28
|
-
gem install ./cheminee-0.1.
|
28
|
+
gem install ./cheminee-0.1.26.gem
|
29
29
|
```
|
30
30
|
|
31
|
-
(for development, run `gem install --dev ./cheminee-0.1.
|
31
|
+
(for development, run `gem install --dev ./cheminee-0.1.26.gem` to install the development dependencies)
|
32
32
|
|
33
33
|
or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
|
34
34
|
|
35
35
|
Finally add this to the Gemfile:
|
36
36
|
|
37
|
-
gem 'cheminee', '~> 0.1.
|
37
|
+
gem 'cheminee', '~> 0.1.26'
|
38
38
|
|
39
39
|
### Install from Git
|
40
40
|
|
@@ -63,7 +63,7 @@ sanitize = 'sanitize_example' # String |
|
|
63
63
|
mol_block = [Cheminee::MolBlock.new({mol_block: 'mol_block_example'})] # Array<MolBlock> |
|
64
64
|
|
65
65
|
begin
|
66
|
-
#
|
66
|
+
#Convert a list of SMILES to molblocks
|
67
67
|
result = api_instance.v1_convert_mol_block_to_smiles_post(sanitize, mol_block)
|
68
68
|
p result
|
69
69
|
rescue Cheminee::ApiError => e
|
@@ -78,7 +78,8 @@ All URIs are relative to *http://localhost:4001/api*
|
|
78
78
|
|
79
79
|
Class | Method | HTTP request | Description
|
80
80
|
------------ | ------------- | ------------- | -------------
|
81
|
-
*Cheminee::DefaultApi* | [**v1_convert_mol_block_to_smiles_post**](docs/DefaultApi.md#v1_convert_mol_block_to_smiles_post) | **POST** /v1/convert/mol_block_to_smiles |
|
81
|
+
*Cheminee::DefaultApi* | [**v1_convert_mol_block_to_smiles_post**](docs/DefaultApi.md#v1_convert_mol_block_to_smiles_post) | **POST** /v1/convert/mol_block_to_smiles | Convert a list of SMILES to molblocks
|
82
|
+
*Cheminee::DefaultApi* | [**v1_convert_smiles_to_mol_block_post**](docs/DefaultApi.md#v1_convert_smiles_to_mol_block_post) | **POST** /v1/convert/smiles_to_mol_block | Convert a list of molblocks to SMILES
|
82
83
|
*Cheminee::DefaultApi* | [**v1_indexes_get**](docs/DefaultApi.md#v1_indexes_get) | **GET** /v1/indexes | List indexes
|
83
84
|
*Cheminee::DefaultApi* | [**v1_indexes_index_bulk_delete_delete**](docs/DefaultApi.md#v1_indexes_index_bulk_delete_delete) | **DELETE** /v1/indexes/{index}/bulk_delete | Delete a list of smiles (after standardization) from an index
|
84
85
|
*Cheminee::DefaultApi* | [**v1_indexes_index_bulk_index_post**](docs/DefaultApi.md#v1_indexes_index_bulk_index_post) | **POST** /v1/indexes/{index}/bulk_index | Index a list of SMILES and associated, free-form JSON attributes which are indexed and searchable
|
@@ -88,6 +89,7 @@ Class | Method | HTTP request | Description
|
|
88
89
|
*Cheminee::DefaultApi* | [**v1_indexes_index_search_basic_get**](docs/DefaultApi.md#v1_indexes_index_search_basic_get) | **GET** /v1/indexes/{index}/search/basic | Perform basic query search against index
|
89
90
|
*Cheminee::DefaultApi* | [**v1_indexes_index_search_identity_get**](docs/DefaultApi.md#v1_indexes_index_search_identity_get) | **GET** /v1/indexes/{index}/search/identity | Perform identity search (i.e. exact match) against index
|
90
91
|
*Cheminee::DefaultApi* | [**v1_indexes_index_search_substructure_get**](docs/DefaultApi.md#v1_indexes_index_search_substructure_get) | **GET** /v1/indexes/{index}/search/substructure | Perform substructure search against index
|
92
|
+
*Cheminee::DefaultApi* | [**v1_indexes_index_search_superstructure_get**](docs/DefaultApi.md#v1_indexes_index_search_superstructure_get) | **GET** /v1/indexes/{index}/search/superstructure | Perform superstructure search against index
|
91
93
|
*Cheminee::DefaultApi* | [**v1_schemas_get**](docs/DefaultApi.md#v1_schemas_get) | **GET** /v1/schemas | List schemas available for creating indexes
|
92
94
|
*Cheminee::DefaultApi* | [**v1_standardize_post**](docs/DefaultApi.md#v1_standardize_post) | **POST** /v1/standardize | Pass a list of SMILES through fragment_parent, uncharger, and canonicalization routines
|
93
95
|
|
@@ -96,6 +98,7 @@ Class | Method | HTTP request | Description
|
|
96
98
|
|
97
99
|
- [Cheminee::BulkRequest](docs/BulkRequest.md)
|
98
100
|
- [Cheminee::BulkRequestDoc](docs/BulkRequestDoc.md)
|
101
|
+
- [Cheminee::ConvertedMolBlock](docs/ConvertedMolBlock.md)
|
99
102
|
- [Cheminee::ConvertedSmiles](docs/ConvertedSmiles.md)
|
100
103
|
- [Cheminee::CreateIndexError](docs/CreateIndexError.md)
|
101
104
|
- [Cheminee::DeleteIndexBulkResponseError](docs/DeleteIndexBulkResponseError.md)
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# Cheminee::ConvertedMolBlock
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **mol_block** | **String** | | [optional] |
|
8
|
+
| **error** | **String** | | [optional] |
|
9
|
+
|
10
|
+
## Example
|
11
|
+
|
12
|
+
```ruby
|
13
|
+
require 'cheminee'
|
14
|
+
|
15
|
+
instance = Cheminee::ConvertedMolBlock.new(
|
16
|
+
mol_block: null,
|
17
|
+
error: null
|
18
|
+
)
|
19
|
+
```
|
20
|
+
|
data/docs/DefaultApi.md
CHANGED
@@ -4,7 +4,8 @@ All URIs are relative to *http://localhost:4001/api*
|
|
4
4
|
|
5
5
|
| Method | HTTP request | Description |
|
6
6
|
| ------ | ------------ | ----------- |
|
7
|
-
| [**v1_convert_mol_block_to_smiles_post**](DefaultApi.md#v1_convert_mol_block_to_smiles_post) | **POST** /v1/convert/mol_block_to_smiles |
|
7
|
+
| [**v1_convert_mol_block_to_smiles_post**](DefaultApi.md#v1_convert_mol_block_to_smiles_post) | **POST** /v1/convert/mol_block_to_smiles | Convert a list of SMILES to molblocks |
|
8
|
+
| [**v1_convert_smiles_to_mol_block_post**](DefaultApi.md#v1_convert_smiles_to_mol_block_post) | **POST** /v1/convert/smiles_to_mol_block | Convert a list of molblocks to SMILES |
|
8
9
|
| [**v1_indexes_get**](DefaultApi.md#v1_indexes_get) | **GET** /v1/indexes | List indexes |
|
9
10
|
| [**v1_indexes_index_bulk_delete_delete**](DefaultApi.md#v1_indexes_index_bulk_delete_delete) | **DELETE** /v1/indexes/{index}/bulk_delete | Delete a list of smiles (after standardization) from an index |
|
10
11
|
| [**v1_indexes_index_bulk_index_post**](DefaultApi.md#v1_indexes_index_bulk_index_post) | **POST** /v1/indexes/{index}/bulk_index | Index a list of SMILES and associated, free-form JSON attributes which are indexed and searchable |
|
@@ -14,6 +15,7 @@ All URIs are relative to *http://localhost:4001/api*
|
|
14
15
|
| [**v1_indexes_index_search_basic_get**](DefaultApi.md#v1_indexes_index_search_basic_get) | **GET** /v1/indexes/{index}/search/basic | Perform basic query search against index |
|
15
16
|
| [**v1_indexes_index_search_identity_get**](DefaultApi.md#v1_indexes_index_search_identity_get) | **GET** /v1/indexes/{index}/search/identity | Perform identity search (i.e. exact match) against index |
|
16
17
|
| [**v1_indexes_index_search_substructure_get**](DefaultApi.md#v1_indexes_index_search_substructure_get) | **GET** /v1/indexes/{index}/search/substructure | Perform substructure search against index |
|
18
|
+
| [**v1_indexes_index_search_superstructure_get**](DefaultApi.md#v1_indexes_index_search_superstructure_get) | **GET** /v1/indexes/{index}/search/superstructure | Perform superstructure search against index |
|
17
19
|
| [**v1_schemas_get**](DefaultApi.md#v1_schemas_get) | **GET** /v1/schemas | List schemas available for creating indexes |
|
18
20
|
| [**v1_standardize_post**](DefaultApi.md#v1_standardize_post) | **POST** /v1/standardize | Pass a list of SMILES through fragment_parent, uncharger, and canonicalization routines |
|
19
21
|
|
@@ -22,7 +24,7 @@ All URIs are relative to *http://localhost:4001/api*
|
|
22
24
|
|
23
25
|
> <Array<ConvertedSmiles>> v1_convert_mol_block_to_smiles_post(sanitize, mol_block)
|
24
26
|
|
25
|
-
|
27
|
+
Convert a list of SMILES to molblocks
|
26
28
|
|
27
29
|
### Examples
|
28
30
|
|
@@ -35,7 +37,7 @@ sanitize = 'sanitize_example' # String |
|
|
35
37
|
mol_block = [Cheminee::MolBlock.new({mol_block: 'mol_block_example'})] # Array<MolBlock> |
|
36
38
|
|
37
39
|
begin
|
38
|
-
#
|
40
|
+
# Convert a list of SMILES to molblocks
|
39
41
|
result = api_instance.v1_convert_mol_block_to_smiles_post(sanitize, mol_block)
|
40
42
|
p result
|
41
43
|
rescue Cheminee::ApiError => e
|
@@ -51,7 +53,7 @@ This returns an Array which contains the response data, status code and headers.
|
|
51
53
|
|
52
54
|
```ruby
|
53
55
|
begin
|
54
|
-
#
|
56
|
+
# Convert a list of SMILES to molblocks
|
55
57
|
data, status_code, headers = api_instance.v1_convert_mol_block_to_smiles_post_with_http_info(sanitize, mol_block)
|
56
58
|
p status_code # => 2xx
|
57
59
|
p headers # => { ... }
|
@@ -82,6 +84,68 @@ No authorization required
|
|
82
84
|
- **Accept**: application/json; charset=utf-8
|
83
85
|
|
84
86
|
|
87
|
+
## v1_convert_smiles_to_mol_block_post
|
88
|
+
|
89
|
+
> <Array<ConvertedMolBlock>> v1_convert_smiles_to_mol_block_post(smiles)
|
90
|
+
|
91
|
+
Convert a list of molblocks to SMILES
|
92
|
+
|
93
|
+
### Examples
|
94
|
+
|
95
|
+
```ruby
|
96
|
+
require 'time'
|
97
|
+
require 'cheminee'
|
98
|
+
|
99
|
+
api_instance = Cheminee::DefaultApi.new
|
100
|
+
smiles = [Cheminee::Smiles.new({smiles: 'smiles_example'})] # Array<Smiles> |
|
101
|
+
|
102
|
+
begin
|
103
|
+
# Convert a list of molblocks to SMILES
|
104
|
+
result = api_instance.v1_convert_smiles_to_mol_block_post(smiles)
|
105
|
+
p result
|
106
|
+
rescue Cheminee::ApiError => e
|
107
|
+
puts "Error when calling DefaultApi->v1_convert_smiles_to_mol_block_post: #{e}"
|
108
|
+
end
|
109
|
+
```
|
110
|
+
|
111
|
+
#### Using the v1_convert_smiles_to_mol_block_post_with_http_info variant
|
112
|
+
|
113
|
+
This returns an Array which contains the response data, status code and headers.
|
114
|
+
|
115
|
+
> <Array(<Array<ConvertedMolBlock>>, Integer, Hash)> v1_convert_smiles_to_mol_block_post_with_http_info(smiles)
|
116
|
+
|
117
|
+
```ruby
|
118
|
+
begin
|
119
|
+
# Convert a list of molblocks to SMILES
|
120
|
+
data, status_code, headers = api_instance.v1_convert_smiles_to_mol_block_post_with_http_info(smiles)
|
121
|
+
p status_code # => 2xx
|
122
|
+
p headers # => { ... }
|
123
|
+
p data # => <Array<ConvertedMolBlock>>
|
124
|
+
rescue Cheminee::ApiError => e
|
125
|
+
puts "Error when calling DefaultApi->v1_convert_smiles_to_mol_block_post_with_http_info: #{e}"
|
126
|
+
end
|
127
|
+
```
|
128
|
+
|
129
|
+
### Parameters
|
130
|
+
|
131
|
+
| Name | Type | Description | Notes |
|
132
|
+
| ---- | ---- | ----------- | ----- |
|
133
|
+
| **smiles** | [**Array<Smiles>**](Smiles.md) | | |
|
134
|
+
|
135
|
+
### Return type
|
136
|
+
|
137
|
+
[**Array<ConvertedMolBlock>**](ConvertedMolBlock.md)
|
138
|
+
|
139
|
+
### Authorization
|
140
|
+
|
141
|
+
No authorization required
|
142
|
+
|
143
|
+
### HTTP request headers
|
144
|
+
|
145
|
+
- **Content-Type**: application/json; charset=utf-8
|
146
|
+
- **Accept**: application/json; charset=utf-8
|
147
|
+
|
148
|
+
|
85
149
|
## v1_indexes_get
|
86
150
|
|
87
151
|
> <Array<IndexMeta>> v1_indexes_get
|
@@ -673,6 +737,80 @@ No authorization required
|
|
673
737
|
- **Accept**: application/json; charset=utf-8
|
674
738
|
|
675
739
|
|
740
|
+
## v1_indexes_index_search_superstructure_get
|
741
|
+
|
742
|
+
> <Array<StructureSearchHit>> v1_indexes_index_search_superstructure_get(index, smiles, opts)
|
743
|
+
|
744
|
+
Perform superstructure search against index
|
745
|
+
|
746
|
+
### Examples
|
747
|
+
|
748
|
+
```ruby
|
749
|
+
require 'time'
|
750
|
+
require 'cheminee'
|
751
|
+
|
752
|
+
api_instance = Cheminee::DefaultApi.new
|
753
|
+
index = 'index_example' # String |
|
754
|
+
smiles = 'smiles_example' # String |
|
755
|
+
opts = {
|
756
|
+
result_limit: 56, # Integer |
|
757
|
+
tautomer_limit: 56, # Integer |
|
758
|
+
extra_query: 'extra_query_example', # String |
|
759
|
+
use_scaffolds: 'use_scaffolds_example' # String |
|
760
|
+
}
|
761
|
+
|
762
|
+
begin
|
763
|
+
# Perform superstructure search against index
|
764
|
+
result = api_instance.v1_indexes_index_search_superstructure_get(index, smiles, opts)
|
765
|
+
p result
|
766
|
+
rescue Cheminee::ApiError => e
|
767
|
+
puts "Error when calling DefaultApi->v1_indexes_index_search_superstructure_get: #{e}"
|
768
|
+
end
|
769
|
+
```
|
770
|
+
|
771
|
+
#### Using the v1_indexes_index_search_superstructure_get_with_http_info variant
|
772
|
+
|
773
|
+
This returns an Array which contains the response data, status code and headers.
|
774
|
+
|
775
|
+
> <Array(<Array<StructureSearchHit>>, Integer, Hash)> v1_indexes_index_search_superstructure_get_with_http_info(index, smiles, opts)
|
776
|
+
|
777
|
+
```ruby
|
778
|
+
begin
|
779
|
+
# Perform superstructure search against index
|
780
|
+
data, status_code, headers = api_instance.v1_indexes_index_search_superstructure_get_with_http_info(index, smiles, opts)
|
781
|
+
p status_code # => 2xx
|
782
|
+
p headers # => { ... }
|
783
|
+
p data # => <Array<StructureSearchHit>>
|
784
|
+
rescue Cheminee::ApiError => e
|
785
|
+
puts "Error when calling DefaultApi->v1_indexes_index_search_superstructure_get_with_http_info: #{e}"
|
786
|
+
end
|
787
|
+
```
|
788
|
+
|
789
|
+
### Parameters
|
790
|
+
|
791
|
+
| Name | Type | Description | Notes |
|
792
|
+
| ---- | ---- | ----------- | ----- |
|
793
|
+
| **index** | **String** | | |
|
794
|
+
| **smiles** | **String** | | |
|
795
|
+
| **result_limit** | **Integer** | | [optional] |
|
796
|
+
| **tautomer_limit** | **Integer** | | [optional] |
|
797
|
+
| **extra_query** | **String** | | [optional] |
|
798
|
+
| **use_scaffolds** | **String** | | [optional] |
|
799
|
+
|
800
|
+
### Return type
|
801
|
+
|
802
|
+
[**Array<StructureSearchHit>**](StructureSearchHit.md)
|
803
|
+
|
804
|
+
### Authorization
|
805
|
+
|
806
|
+
No authorization required
|
807
|
+
|
808
|
+
### HTTP request headers
|
809
|
+
|
810
|
+
- **Content-Type**: Not defined
|
811
|
+
- **Accept**: application/json; charset=utf-8
|
812
|
+
|
813
|
+
|
676
814
|
## v1_schemas_get
|
677
815
|
|
678
816
|
> <Array<Schema>> v1_schemas_get
|
@@ -19,7 +19,7 @@ module Cheminee
|
|
19
19
|
def initialize(api_client = ApiClient.default)
|
20
20
|
@api_client = api_client
|
21
21
|
end
|
22
|
-
#
|
22
|
+
# Convert a list of SMILES to molblocks
|
23
23
|
# @param sanitize [String]
|
24
24
|
# @param mol_block [Array<MolBlock>]
|
25
25
|
# @param [Hash] opts the optional parameters
|
@@ -29,7 +29,7 @@ module Cheminee
|
|
29
29
|
data
|
30
30
|
end
|
31
31
|
|
32
|
-
#
|
32
|
+
# Convert a list of SMILES to molblocks
|
33
33
|
# @param sanitize [String]
|
34
34
|
# @param mol_block [Array<MolBlock>]
|
35
35
|
# @param [Hash] opts the optional parameters
|
@@ -92,6 +92,72 @@ module Cheminee
|
|
92
92
|
return data, status_code, headers
|
93
93
|
end
|
94
94
|
|
95
|
+
# Convert a list of molblocks to SMILES
|
96
|
+
# @param smiles [Array<Smiles>]
|
97
|
+
# @param [Hash] opts the optional parameters
|
98
|
+
# @return [Array<ConvertedMolBlock>]
|
99
|
+
def v1_convert_smiles_to_mol_block_post(smiles, opts = {})
|
100
|
+
data, _status_code, _headers = v1_convert_smiles_to_mol_block_post_with_http_info(smiles, opts)
|
101
|
+
data
|
102
|
+
end
|
103
|
+
|
104
|
+
# Convert a list of molblocks to SMILES
|
105
|
+
# @param smiles [Array<Smiles>]
|
106
|
+
# @param [Hash] opts the optional parameters
|
107
|
+
# @return [Array<(Array<ConvertedMolBlock>, Integer, Hash)>] Array<ConvertedMolBlock> data, response status code and response headers
|
108
|
+
def v1_convert_smiles_to_mol_block_post_with_http_info(smiles, opts = {})
|
109
|
+
if @api_client.config.debugging
|
110
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.v1_convert_smiles_to_mol_block_post ...'
|
111
|
+
end
|
112
|
+
# verify the required parameter 'smiles' is set
|
113
|
+
if @api_client.config.client_side_validation && smiles.nil?
|
114
|
+
fail ArgumentError, "Missing the required parameter 'smiles' when calling DefaultApi.v1_convert_smiles_to_mol_block_post"
|
115
|
+
end
|
116
|
+
# resource path
|
117
|
+
local_var_path = '/v1/convert/smiles_to_mol_block'
|
118
|
+
|
119
|
+
# query parameters
|
120
|
+
query_params = opts[:query_params] || {}
|
121
|
+
|
122
|
+
# header parameters
|
123
|
+
header_params = opts[:header_params] || {}
|
124
|
+
# HTTP header 'Accept' (if needed)
|
125
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json; charset=utf-8']) unless header_params['Accept']
|
126
|
+
# HTTP header 'Content-Type'
|
127
|
+
content_type = @api_client.select_header_content_type(['application/json; charset=utf-8'])
|
128
|
+
if !content_type.nil?
|
129
|
+
header_params['Content-Type'] = content_type
|
130
|
+
end
|
131
|
+
|
132
|
+
# form parameters
|
133
|
+
form_params = opts[:form_params] || {}
|
134
|
+
|
135
|
+
# http body (model)
|
136
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(smiles)
|
137
|
+
|
138
|
+
# return_type
|
139
|
+
return_type = opts[:debug_return_type] || 'Array<ConvertedMolBlock>'
|
140
|
+
|
141
|
+
# auth_names
|
142
|
+
auth_names = opts[:debug_auth_names] || []
|
143
|
+
|
144
|
+
new_options = opts.merge(
|
145
|
+
:operation => :"DefaultApi.v1_convert_smiles_to_mol_block_post",
|
146
|
+
:header_params => header_params,
|
147
|
+
:query_params => query_params,
|
148
|
+
:form_params => form_params,
|
149
|
+
:body => post_body,
|
150
|
+
:auth_names => auth_names,
|
151
|
+
:return_type => return_type
|
152
|
+
)
|
153
|
+
|
154
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
155
|
+
if @api_client.config.debugging
|
156
|
+
@api_client.config.logger.debug "API called: DefaultApi#v1_convert_smiles_to_mol_block_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
157
|
+
end
|
158
|
+
return data, status_code, headers
|
159
|
+
end
|
160
|
+
|
95
161
|
# List indexes
|
96
162
|
# @param [Hash] opts the optional parameters
|
97
163
|
# @return [Array<IndexMeta>]
|
@@ -709,6 +775,86 @@ module Cheminee
|
|
709
775
|
return data, status_code, headers
|
710
776
|
end
|
711
777
|
|
778
|
+
# Perform superstructure search against index
|
779
|
+
# @param index [String]
|
780
|
+
# @param smiles [String]
|
781
|
+
# @param [Hash] opts the optional parameters
|
782
|
+
# @option opts [Integer] :result_limit
|
783
|
+
# @option opts [Integer] :tautomer_limit
|
784
|
+
# @option opts [String] :extra_query
|
785
|
+
# @option opts [String] :use_scaffolds
|
786
|
+
# @return [Array<StructureSearchHit>]
|
787
|
+
def v1_indexes_index_search_superstructure_get(index, smiles, opts = {})
|
788
|
+
data, _status_code, _headers = v1_indexes_index_search_superstructure_get_with_http_info(index, smiles, opts)
|
789
|
+
data
|
790
|
+
end
|
791
|
+
|
792
|
+
# Perform superstructure search against index
|
793
|
+
# @param index [String]
|
794
|
+
# @param smiles [String]
|
795
|
+
# @param [Hash] opts the optional parameters
|
796
|
+
# @option opts [Integer] :result_limit
|
797
|
+
# @option opts [Integer] :tautomer_limit
|
798
|
+
# @option opts [String] :extra_query
|
799
|
+
# @option opts [String] :use_scaffolds
|
800
|
+
# @return [Array<(Array<StructureSearchHit>, Integer, Hash)>] Array<StructureSearchHit> data, response status code and response headers
|
801
|
+
def v1_indexes_index_search_superstructure_get_with_http_info(index, smiles, opts = {})
|
802
|
+
if @api_client.config.debugging
|
803
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.v1_indexes_index_search_superstructure_get ...'
|
804
|
+
end
|
805
|
+
# verify the required parameter 'index' is set
|
806
|
+
if @api_client.config.client_side_validation && index.nil?
|
807
|
+
fail ArgumentError, "Missing the required parameter 'index' when calling DefaultApi.v1_indexes_index_search_superstructure_get"
|
808
|
+
end
|
809
|
+
# verify the required parameter 'smiles' is set
|
810
|
+
if @api_client.config.client_side_validation && smiles.nil?
|
811
|
+
fail ArgumentError, "Missing the required parameter 'smiles' when calling DefaultApi.v1_indexes_index_search_superstructure_get"
|
812
|
+
end
|
813
|
+
# resource path
|
814
|
+
local_var_path = '/v1/indexes/{index}/search/superstructure'.sub('{' + 'index' + '}', CGI.escape(index.to_s))
|
815
|
+
|
816
|
+
# query parameters
|
817
|
+
query_params = opts[:query_params] || {}
|
818
|
+
query_params[:'smiles'] = smiles
|
819
|
+
query_params[:'result_limit'] = opts[:'result_limit'] if !opts[:'result_limit'].nil?
|
820
|
+
query_params[:'tautomer_limit'] = opts[:'tautomer_limit'] if !opts[:'tautomer_limit'].nil?
|
821
|
+
query_params[:'extra_query'] = opts[:'extra_query'] if !opts[:'extra_query'].nil?
|
822
|
+
query_params[:'use_scaffolds'] = opts[:'use_scaffolds'] if !opts[:'use_scaffolds'].nil?
|
823
|
+
|
824
|
+
# header parameters
|
825
|
+
header_params = opts[:header_params] || {}
|
826
|
+
# HTTP header 'Accept' (if needed)
|
827
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json; charset=utf-8']) unless header_params['Accept']
|
828
|
+
|
829
|
+
# form parameters
|
830
|
+
form_params = opts[:form_params] || {}
|
831
|
+
|
832
|
+
# http body (model)
|
833
|
+
post_body = opts[:debug_body]
|
834
|
+
|
835
|
+
# return_type
|
836
|
+
return_type = opts[:debug_return_type] || 'Array<StructureSearchHit>'
|
837
|
+
|
838
|
+
# auth_names
|
839
|
+
auth_names = opts[:debug_auth_names] || []
|
840
|
+
|
841
|
+
new_options = opts.merge(
|
842
|
+
:operation => :"DefaultApi.v1_indexes_index_search_superstructure_get",
|
843
|
+
:header_params => header_params,
|
844
|
+
:query_params => query_params,
|
845
|
+
:form_params => form_params,
|
846
|
+
:body => post_body,
|
847
|
+
:auth_names => auth_names,
|
848
|
+
:return_type => return_type
|
849
|
+
)
|
850
|
+
|
851
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
852
|
+
if @api_client.config.debugging
|
853
|
+
@api_client.config.logger.debug "API called: DefaultApi#v1_indexes_index_search_superstructure_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
854
|
+
end
|
855
|
+
return data, status_code, headers
|
856
|
+
end
|
857
|
+
|
712
858
|
# List schemas available for creating indexes
|
713
859
|
# @param [Hash] opts the optional parameters
|
714
860
|
# @return [Array<Schema>]
|
@@ -0,0 +1,223 @@
|
|
1
|
+
=begin
|
2
|
+
#Cheminée
|
3
|
+
|
4
|
+
#Cheminée: The Chemical Structure Search Engine
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
Generator version: 7.8.0-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module Cheminee
|
17
|
+
class ConvertedMolBlock
|
18
|
+
attr_accessor :mol_block
|
19
|
+
|
20
|
+
attr_accessor :error
|
21
|
+
|
22
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
23
|
+
def self.attribute_map
|
24
|
+
{
|
25
|
+
:'mol_block' => :'mol_block',
|
26
|
+
:'error' => :'error'
|
27
|
+
}
|
28
|
+
end
|
29
|
+
|
30
|
+
# Returns all the JSON keys this model knows about
|
31
|
+
def self.acceptable_attributes
|
32
|
+
attribute_map.values
|
33
|
+
end
|
34
|
+
|
35
|
+
# Attribute type mapping.
|
36
|
+
def self.openapi_types
|
37
|
+
{
|
38
|
+
:'mol_block' => :'String',
|
39
|
+
:'error' => :'String'
|
40
|
+
}
|
41
|
+
end
|
42
|
+
|
43
|
+
# List of attributes with nullable: true
|
44
|
+
def self.openapi_nullable
|
45
|
+
Set.new([
|
46
|
+
])
|
47
|
+
end
|
48
|
+
|
49
|
+
# Initializes the object
|
50
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
51
|
+
def initialize(attributes = {})
|
52
|
+
if (!attributes.is_a?(Hash))
|
53
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Cheminee::ConvertedMolBlock` initialize method"
|
54
|
+
end
|
55
|
+
|
56
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
57
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
58
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
59
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Cheminee::ConvertedMolBlock`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
60
|
+
end
|
61
|
+
h[k.to_sym] = v
|
62
|
+
}
|
63
|
+
|
64
|
+
if attributes.key?(:'mol_block')
|
65
|
+
self.mol_block = attributes[:'mol_block']
|
66
|
+
end
|
67
|
+
|
68
|
+
if attributes.key?(:'error')
|
69
|
+
self.error = attributes[:'error']
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
74
|
+
# @return Array for valid properties with the reasons
|
75
|
+
def list_invalid_properties
|
76
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
77
|
+
invalid_properties = Array.new
|
78
|
+
invalid_properties
|
79
|
+
end
|
80
|
+
|
81
|
+
# Check to see if the all the properties in the model are valid
|
82
|
+
# @return true if the model is valid
|
83
|
+
def valid?
|
84
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
85
|
+
true
|
86
|
+
end
|
87
|
+
|
88
|
+
# Checks equality by comparing each attribute.
|
89
|
+
# @param [Object] Object to be compared
|
90
|
+
def ==(o)
|
91
|
+
return true if self.equal?(o)
|
92
|
+
self.class == o.class &&
|
93
|
+
mol_block == o.mol_block &&
|
94
|
+
error == o.error
|
95
|
+
end
|
96
|
+
|
97
|
+
# @see the `==` method
|
98
|
+
# @param [Object] Object to be compared
|
99
|
+
def eql?(o)
|
100
|
+
self == o
|
101
|
+
end
|
102
|
+
|
103
|
+
# Calculates hash code according to all attributes.
|
104
|
+
# @return [Integer] Hash code
|
105
|
+
def hash
|
106
|
+
[mol_block, error].hash
|
107
|
+
end
|
108
|
+
|
109
|
+
# Builds the object from hash
|
110
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
111
|
+
# @return [Object] Returns the model itself
|
112
|
+
def self.build_from_hash(attributes)
|
113
|
+
return nil unless attributes.is_a?(Hash)
|
114
|
+
attributes = attributes.transform_keys(&:to_sym)
|
115
|
+
transformed_hash = {}
|
116
|
+
openapi_types.each_pair do |key, type|
|
117
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
118
|
+
transformed_hash["#{key}"] = nil
|
119
|
+
elsif type =~ /\AArray<(.*)>/i
|
120
|
+
# check to ensure the input is an array given that the attribute
|
121
|
+
# is documented as an array but the input is not
|
122
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
123
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
124
|
+
end
|
125
|
+
elsif !attributes[attribute_map[key]].nil?
|
126
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
127
|
+
end
|
128
|
+
end
|
129
|
+
new(transformed_hash)
|
130
|
+
end
|
131
|
+
|
132
|
+
# Deserializes the data based on type
|
133
|
+
# @param string type Data type
|
134
|
+
# @param string value Value to be deserialized
|
135
|
+
# @return [Object] Deserialized data
|
136
|
+
def self._deserialize(type, value)
|
137
|
+
case type.to_sym
|
138
|
+
when :Time
|
139
|
+
Time.parse(value)
|
140
|
+
when :Date
|
141
|
+
Date.parse(value)
|
142
|
+
when :String
|
143
|
+
value.to_s
|
144
|
+
when :Integer
|
145
|
+
value.to_i
|
146
|
+
when :Float
|
147
|
+
value.to_f
|
148
|
+
when :Boolean
|
149
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
150
|
+
true
|
151
|
+
else
|
152
|
+
false
|
153
|
+
end
|
154
|
+
when :Object
|
155
|
+
# generic object (usually a Hash), return directly
|
156
|
+
value
|
157
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
158
|
+
inner_type = Regexp.last_match[:inner_type]
|
159
|
+
value.map { |v| _deserialize(inner_type, v) }
|
160
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
161
|
+
k_type = Regexp.last_match[:k_type]
|
162
|
+
v_type = Regexp.last_match[:v_type]
|
163
|
+
{}.tap do |hash|
|
164
|
+
value.each do |k, v|
|
165
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
166
|
+
end
|
167
|
+
end
|
168
|
+
else # model
|
169
|
+
# models (e.g. Pet) or oneOf
|
170
|
+
klass = Cheminee.const_get(type)
|
171
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
172
|
+
end
|
173
|
+
end
|
174
|
+
|
175
|
+
# Returns the string representation of the object
|
176
|
+
# @return [String] String presentation of the object
|
177
|
+
def to_s
|
178
|
+
to_hash.to_s
|
179
|
+
end
|
180
|
+
|
181
|
+
# to_body is an alias to to_hash (backward compatibility)
|
182
|
+
# @return [Hash] Returns the object in the form of hash
|
183
|
+
def to_body
|
184
|
+
to_hash
|
185
|
+
end
|
186
|
+
|
187
|
+
# Returns the object in the form of hash
|
188
|
+
# @return [Hash] Returns the object in the form of hash
|
189
|
+
def to_hash
|
190
|
+
hash = {}
|
191
|
+
self.class.attribute_map.each_pair do |attr, param|
|
192
|
+
value = self.send(attr)
|
193
|
+
if value.nil?
|
194
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
195
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
196
|
+
end
|
197
|
+
|
198
|
+
hash[param] = _to_hash(value)
|
199
|
+
end
|
200
|
+
hash
|
201
|
+
end
|
202
|
+
|
203
|
+
# Outputs non-array value in the form of hash
|
204
|
+
# For object, use to_hash. Otherwise, just return the value
|
205
|
+
# @param [Object] value Any valid value
|
206
|
+
# @return [Hash] Returns the value in the form of hash
|
207
|
+
def _to_hash(value)
|
208
|
+
if value.is_a?(Array)
|
209
|
+
value.compact.map { |v| _to_hash(v) }
|
210
|
+
elsif value.is_a?(Hash)
|
211
|
+
{}.tap do |hash|
|
212
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
213
|
+
end
|
214
|
+
elsif value.respond_to? :to_hash
|
215
|
+
value.to_hash
|
216
|
+
else
|
217
|
+
value
|
218
|
+
end
|
219
|
+
end
|
220
|
+
|
221
|
+
end
|
222
|
+
|
223
|
+
end
|
data/lib/cheminee/version.rb
CHANGED
data/lib/cheminee.rb
CHANGED
@@ -19,6 +19,7 @@ require 'cheminee/configuration'
|
|
19
19
|
# Models
|
20
20
|
require 'cheminee/models/bulk_request'
|
21
21
|
require 'cheminee/models/bulk_request_doc'
|
22
|
+
require 'cheminee/models/converted_mol_block'
|
22
23
|
require 'cheminee/models/converted_smiles'
|
23
24
|
require 'cheminee/models/create_index_error'
|
24
25
|
require 'cheminee/models/delete_index_bulk_response_error'
|
Binary file
|
@@ -0,0 +1,42 @@
|
|
1
|
+
=begin
|
2
|
+
#Cheminée
|
3
|
+
|
4
|
+
#Cheminée: The Chemical Structure Search Engine
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
Generator version: 7.8.0-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
require 'date'
|
16
|
+
|
17
|
+
# Unit tests for Cheminee::ConvertedMolBlock
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
19
|
+
# Please update as you see appropriate
|
20
|
+
describe Cheminee::ConvertedMolBlock do
|
21
|
+
let(:instance) { Cheminee::ConvertedMolBlock.new }
|
22
|
+
|
23
|
+
describe 'test an instance of ConvertedMolBlock' do
|
24
|
+
it 'should create an instance of ConvertedMolBlock' do
|
25
|
+
# uncomment below to test the instance creation
|
26
|
+
#expect(instance).to be_instance_of(Cheminee::ConvertedMolBlock)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
describe 'test attribute "mol_block"' do
|
31
|
+
it 'should work' do
|
32
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
describe 'test attribute "error"' do
|
37
|
+
it 'should work' do
|
38
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cheminee
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.26
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Xavier Lange
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-08-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|
@@ -64,6 +64,7 @@ files:
|
|
64
64
|
- cheminee.gemspec
|
65
65
|
- docs/BulkRequest.md
|
66
66
|
- docs/BulkRequestDoc.md
|
67
|
+
- docs/ConvertedMolBlock.md
|
67
68
|
- docs/ConvertedSmiles.md
|
68
69
|
- docs/CreateIndexError.md
|
69
70
|
- docs/DefaultApi.md
|
@@ -97,6 +98,7 @@ files:
|
|
97
98
|
- lib/cheminee/configuration.rb
|
98
99
|
- lib/cheminee/models/bulk_request.rb
|
99
100
|
- lib/cheminee/models/bulk_request_doc.rb
|
101
|
+
- lib/cheminee/models/converted_mol_block.rb
|
100
102
|
- lib/cheminee/models/converted_smiles.rb
|
101
103
|
- lib/cheminee/models/create_index_error.rb
|
102
104
|
- lib/cheminee/models/delete_index_bulk_response_error.rb
|
@@ -124,12 +126,13 @@ files:
|
|
124
126
|
- lib/cheminee/version.rb
|
125
127
|
- openapi-generator-config.json
|
126
128
|
- openapi.json
|
127
|
-
- pkg/cheminee-0.1.
|
129
|
+
- pkg/cheminee-0.1.26.gem
|
128
130
|
- spec/api/default_api_spec.rb
|
129
131
|
- spec/api_client_spec.rb
|
130
132
|
- spec/configuration_spec.rb
|
131
133
|
- spec/models/bulk_request_doc_spec.rb
|
132
134
|
- spec/models/bulk_request_spec.rb
|
135
|
+
- spec/models/converted_mol_block_spec.rb
|
133
136
|
- spec/models/converted_smiles_spec.rb
|
134
137
|
- spec/models/create_index_error_spec.rb
|
135
138
|
- spec/models/delete_index_bulk_response_error_spec.rb
|
@@ -202,6 +205,7 @@ test_files:
|
|
202
205
|
- spec/models/schema_spec.rb
|
203
206
|
- spec/models/smile_spec.rb
|
204
207
|
- spec/models/create_index_error_spec.rb
|
208
|
+
- spec/models/converted_mol_block_spec.rb
|
205
209
|
- spec/models/delete_index_bulk_response_ok_status_spec.rb
|
206
210
|
- spec/models/substructure_search_hit_spec.rb
|
207
211
|
- spec/models/mol_block_spec.rb
|
data/pkg/cheminee-0.1.23.gem
DELETED
Binary file
|