Class: Rafflesia::Molecules
- Inherits:
-
Object
- Object
- Rafflesia::Molecules
- Defined in:
- lib/rafflesia/molecules.rb
Instance Method Summary collapse
-
#describe(smiles:, backend: nil, request_options: {}) ⇒ Rafflesia::EnvelopeMoleculeDescribeData
POST /v1/molecules/describe.
-
#fingerprintsCompute(backend: nil, molecule_id: nil, smiles: nil, request_options: {}) ⇒ Rafflesia::EnvelopeMoleculeFingerprintsData
POST /v1/molecules/fingerprints/compute.
-
#import(path:, source_id: nil, request_options: {}) ⇒ Rafflesia::EnvelopeMoleculeImportData
POST /v1/molecules/import.
-
#initialize(client) ⇒ Molecules
constructor
A new instance of Molecules.
-
#inspect(molecule_id:, request_options: {}) ⇒ Rafflesia::EnvelopeMoleculeInspectData
POST /v1/molecules/inspect.
-
#normalize(backend: nil, molecule_id: nil, smiles: nil, request_options: {}) ⇒ Rafflesia::EnvelopeMoleculeNormalizeData
POST /v1/molecules/normalize.
-
#search(query:, backend: nil, db: nil, max_hits: nil, request_options: {}) ⇒ Rafflesia::EnvelopeMoleculeSearchData
POST /v1/molecules/search.
Constructor Details
#initialize(client) ⇒ Molecules
Returns a new instance of Molecules.
9 10 11 |
# File 'lib/rafflesia/molecules.rb', line 9 def initialize(client) @client = client end |
Instance Method Details
#describe(smiles:, backend: nil, request_options: {}) ⇒ Rafflesia::EnvelopeMoleculeDescribeData
POST /v1/molecules/describe
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/rafflesia/molecules.rb', line 18 def describe( smiles:, backend: nil, request_options: {} ) body = { 'backend' => backend, 'smiles' => smiles }.compact response = @client.request( method: :post, path: '/v1/molecules/describe', auth: true, body: body, request_options: ) result = Rafflesia::EnvelopeMoleculeDescribeData.new(response.body) result.last_response = Rafflesia::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"]) result end |
#fingerprintsCompute(backend: nil, molecule_id: nil, smiles: nil, request_options: {}) ⇒ Rafflesia::EnvelopeMoleculeFingerprintsData
POST /v1/molecules/fingerprints/compute
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/rafflesia/molecules.rb', line 45 def fingerprintsCompute( backend: nil, molecule_id: nil, smiles: nil, request_options: {} ) body = { 'backend' => backend, 'molecule_id' => molecule_id, 'smiles' => smiles }.compact response = @client.request( method: :post, path: '/v1/molecules/fingerprints/compute', auth: true, body: body, request_options: ) result = Rafflesia::EnvelopeMoleculeFingerprintsData.new(response.body) result.last_response = Rafflesia::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"]) result end |
#import(path:, source_id: nil, request_options: {}) ⇒ Rafflesia::EnvelopeMoleculeImportData
POST /v1/molecules/import
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/rafflesia/molecules.rb', line 73 def import( path:, source_id: nil, request_options: {} ) body = { 'path' => path, 'source_id' => source_id }.compact response = @client.request( method: :post, path: '/v1/molecules/import', auth: true, body: body, request_options: ) result = Rafflesia::EnvelopeMoleculeImportData.new(response.body) result.last_response = Rafflesia::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"]) result end |
#inspect(molecule_id:, request_options: {}) ⇒ Rafflesia::EnvelopeMoleculeInspectData
POST /v1/molecules/inspect
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
# File 'lib/rafflesia/molecules.rb', line 98 def inspect( molecule_id:, request_options: {} ) body = { 'molecule_id' => molecule_id } response = @client.request( method: :post, path: '/v1/molecules/inspect', auth: true, body: body, request_options: ) result = Rafflesia::EnvelopeMoleculeInspectData.new(response.body) result.last_response = Rafflesia::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"]) result end |
#normalize(backend: nil, molecule_id: nil, smiles: nil, request_options: {}) ⇒ Rafflesia::EnvelopeMoleculeNormalizeData
POST /v1/molecules/normalize
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
# File 'lib/rafflesia/molecules.rb', line 123 def normalize( backend: nil, molecule_id: nil, smiles: nil, request_options: {} ) body = { 'backend' => backend, 'molecule_id' => molecule_id, 'smiles' => smiles }.compact response = @client.request( method: :post, path: '/v1/molecules/normalize', auth: true, body: body, request_options: ) result = Rafflesia::EnvelopeMoleculeNormalizeData.new(response.body) result.last_response = Rafflesia::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"]) result end |
#search(query:, backend: nil, db: nil, max_hits: nil, request_options: {}) ⇒ Rafflesia::EnvelopeMoleculeSearchData
POST /v1/molecules/search
153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 |
# File 'lib/rafflesia/molecules.rb', line 153 def search( query:, backend: nil, db: nil, max_hits: nil, request_options: {} ) body = { 'backend' => backend, 'db' => db, 'max_hits' => max_hits, 'query' => query }.compact response = @client.request( method: :post, path: '/v1/molecules/search', auth: true, body: body, request_options: ) result = Rafflesia::EnvelopeMoleculeSearchData.new(response.body) result.last_response = Rafflesia::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"]) result end |