更新时间:2023-04-27 GMT+08:00
分享

查询分子优化任务

功能介绍

通过分子优化任务ID查询分子优化任务状态及结果。

URI

GET /v1/{project_id}/task/optimization/{task_id}

表1 路径参数

参数

是否必选

参数类型

描述

project_id

String

华为云项目id

task_id

String

分子优化任务ID

请求参数

表2 请求Header参数

参数

是否必选

参数类型

描述

X-Auth-Token

String

用户 token

响应参数

状态码: 200

表3 响应Body参数

参数

参数类型

描述

status

String

异步任务的状态:等待中、运行中、已完成、失败

枚举值:

  • waiting
  • running
  • finished
  • failed

task_data

OptimizationTaskData object

分子优化任务的请求体

result

OptimizationResult object

分子优化任务的返回结果

表4 OptimizationTaskData

参数

参数类型

描述

smiles

String

分子SMILES表达式

num_trials

Integer

生成分子数量

strong_constraints

Array of MoleculeConstraint objects

强约束集合

weak_constraints

Array of MoleculeConstraint objects

弱约束集合

num_expected

Integer

期望最大返回条目数(排序后取Top)

binding_site

BindingSite object

结合位点

custom_props

Array of CustomProp objects

用户已开启的自定义属性集合

表5 OptimizationResult

参数

参数类型

描述

name

String

任务名

最小长度:1

最大长度:128

smiles

String

分子SMILES表达式

num_rounds

Integer

总生成轮数

num_trials_per_round

Integer

每轮生成数量

num_expected

Integer

期望条目数

num_strong_constraints

Integer

强约束数量

num_weak_constraints

Integer

弱约束数量

prop_names

Array of strings

分子ADMET属性名列表

original

PlainMoleculeItem object

先导小分子的ADMET属性

result

Array of OptimizationResultItem objects

分子优化结果条目

strong_constraints

Array of MoleculeConstraint objects

强约束集合

weak_constraints

Array of MoleculeConstraint objects

弱约束集合

binding_site

BindingSite object

结合位点

custom_props

Array of CustomProp objects

用户已开启的自定义属性集合

表6 PlainMoleculeItem

参数

参数类型

描述

smiles

String

分子SMILES表达式

props

Array of objects

分子ADMET属性值列表

表7 OptimizationResultItem

参数

参数类型

描述

smiles

String

分子SMILES表达式

props

Array of objects

分子ADMET属性值列表

similarity

Number

分子与初始分子的相似度

num_fulfilled_weak_constraints

Integer

分子所满足的弱约束数量

score

Number

分子的打分

表8 MoleculeConstraint

参数

参数类型

描述

name

String

属性名称

type

String

属性约束类型

枚举值:

  • bool
  • range
  • struct
  • minimize
  • maximize

bool

Boolean

属性约束类型bool的参数

range

Array of numbers

属性约束类型range的参数

struct

StructureConstraintParams object

结构约束参数

quantiles

Array of numbers

属性约束类型minimize和maximize的参数

最小值:0.0

最大值:1.0

表9 StructureConstraintParams

参数

参数类型

描述

structs

Array of strings

子结构SMILES

exclusive

Boolean

是否排除子结构

operator

String

多个子结构之间的逻辑关系

缺省值:or

枚举值:

  • or
  • and
表10 BindingSite

参数

参数类型

描述

protein

String

蛋白质3D结构,使用gzip压缩然后转base64格式

最小长度:1

最大长度:10000000

bounding_box

BoundingBox object

结合口袋,包含口袋中心位置和尺寸大小

表11 BoundingBox

参数

参数类型

描述

center

Array of numbers

口袋中心坐标; x, y, z轴的坐标

size

Array of numbers

口袋尺寸大小; x, y, z轴的大小

最小值:1.7

最大值:500

表12 CustomProp

参数

参数类型

描述

id

String

自定义属性的ID(API侧)

最小长度:1

最大长度:64

prop_definition

PropDefinition object

属性定义的元信息

表13 PropDefinition

参数

参数类型

描述

id

String

属性业务侧ID

最小长度:1

最大长度:128

name

String

属性名称

最小长度:1

最大长度:32

type

String

属性类型

枚举值:

  • binary
  • numerical

description

String

属性具体描述信息

最小长度:0

最大长度:256

value_range

ValueRange object

属性有效值域区间

optimal_range

ValueRange object

属性最优值域区间

warning_range

ValueRange object

属性欠佳值域区间

style

String

模型参数呈现类型

枚举值:

  • number
  • probability

confidential_interval

Boolean

模型推理是否呈现置信区间

表14 ValueRange

参数

参数类型

描述

lower

Number

值域下限

lower_inclusive

Boolean

是否包含值域下限

upper

Number

值域上限

upper_inclusive

Boolean

是否包含值域上限

请求示例

响应示例

状态码: 200

分子优化任务查询成功响应

{
  "status" : "finished",
  "result" : {
    "name" : "87ba6b54-2288-4a5d-90a2-3db01c22a9d2",
    "num_rounds" : 10,
    "num_expected" : 1000,
    "num_strong_constraints" : 0,
    "num_weak_constraints" : 5,
    "custom_props" : [ {
      "id" : "3b2dce64-c244-11ed-acf5-0255ac100017",
      "prop_definition" : {
        "id" : "c4c07032d1934671a0dfe3bd10416eea",
        "name" : "custom_prop_name",
        "type" : "numerical",
        "description" : "custom_prop_description"
      }
    } ],
    "prop_names" : [ "formula", "ab", "acute_toxicity_rule", "bace", "3b2dce64-c244-11ed-acf5-0255ac100017", "3b2dce64-c244-11ed-acf5-0255ac100017_std" ],
    "original" : {
      "smiles" : "c1ccccc1",
      "props" : [ "C6H6", "base", 0, 0.128335, 0.43, 0.28 ]
    },
    "result" : [ {
      "smiles" : "c1ccccc1",
      "num_fulfilled_weak_constraints" : 3,
      "similarity" : 0.8,
      "score" : 0.388029,
      "props" : [ "C6H6", "base", 0, 0.128335, 0.43, 0.28 ]
    }, {
      "smiles" : "C1CCCCC1",
      "num_fulfilled_weak_constraints" : 2,
      "similarity" : 0.6,
      "score" : 0.304194,
      "props" : [ "C6H12", "base", 0, 0.163034, 0.43, 0.28 ]
    } ],
    "weak_constraints" : [ {
      "name" : "mw",
      "type" : "range",
      "range" : [ 100, 600 ]
    }, {
      "name" : "nhet",
      "type" : "range",
      "range" : [ 0, 15 ]
    }, {
      "name" : "fsp3",
      "type" : "range",
      "range" : [ 0.07317073170731707, null ]
    }, {
      "name" : "qedmean",
      "type" : "maximize"
    }, {
      "name" : "sascore",
      "type" : "minimize",
      "quantiles" : [ 0.1, 0.9 ]
    } ],
    "strong_constraints" : [ {
      "name" : "mw",
      "type" : "range",
      "range" : [ 100, 600 ]
    } ],
    "binding_site" : {
      "protein" : "H4sIAK8LamMC/3MM8fdVAANDBQU/IOUY7KfgqKBgYgEVNdAzMDACMfRMTAwUFIyN9EwsDUFcAyDPQA+mDgz8AHV0WkpOAAAA",
      "bounding_box" : {
        "center" : [ 1.3, 23.4, -14.5 ],
        "size" : [ 10.0, 10.0, 10.0 ]
      }
    }
  }
}

状态码

状态码

描述

200

分子优化任务查询成功响应

404

分子优化任务ID不存在

错误码

请参见错误码

分享:

    相关文档

    相关产品