更新时间:2024-02-07 GMT+08:00
分享

查询分子生成任务

功能介绍

通过分子生成任务ID查询分子生成任务状态及结果。

URI

GET /v1/{project_id}/task/generation/{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

GenerationTaskData object

分子生成任务的请求体

result

GenerationResult object

分子生成任务的返回结果

表4 GenerationTaskData

参数

参数类型

描述

num_trials

Integer

生成分子数量

strong_constraints

Array of MoleculeConstraint objects

强约束集合

weak_constraints

Array of MoleculeConstraint objects

弱约束集合

num_expected

Integer

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

initial_dataset

Array of strings

初始化分子集合

binding_site

BindingSite object

结合位点

custom_props

Array of CustomProp objects

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

表5 GenerationResult

参数

参数类型

描述

name

String

任务名

最小长度:1

最大长度:128

num_rounds

Integer

总生成轮数

num_expected

Integer

期望条目数

num_strong_constraints

Integer

强约束数量

num_weak_constraints

Integer

弱约束数量

prop_names

Array of strings

分子ADMET属性名列表

result

Array of GenerationResultItem objects

分子生成结果条目

initial_dataset_size

Integer

初始化数据集的分子条目数

strong_constraints

Array of MoleculeConstraint objects

强约束集合

weak_constraints

Array of MoleculeConstraint objects

弱约束集合

binding_site

BindingSite object

结合位点

custom_props

Array of CustomProp objects

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

表6 GenerationResultItem

参数

参数类型

描述

smiles

String

分子SMILES表达式

props

Array of objects

分子ADMET属性值列表

num_fulfilled_weak_constraints

Integer

分子所满足的弱约束数量

score

Number

分子的打分

表7 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

表8 StructureConstraintParams

参数

参数类型

描述

structs

Array of strings

子结构SMILES

exclusive

Boolean

是否排除子结构

operator

String

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

缺省值:or

枚举值:

  • or

  • and

表9 BindingSite

参数

参数类型

描述

protein

String

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

最小长度:1

最大长度:10000000

bounding_box

BoundingBox object

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

表10 BoundingBox

参数

参数类型

描述

center

Array of numbers

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

size

Array of numbers

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

最小值:1.7

最大值:500

表11 CustomProp

参数

参数类型

描述

id

String

自定义属性的ID(API侧)

最小长度:1

最大长度:64

prop_definition

PropDefinition object

属性定义的元信息

表12 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

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

表13 ValueRange

参数

参数类型

描述

lower

Number

值域下限

lower_inclusive

Boolean

是否包含值域下限

upper

Number

值域上限

upper_inclusive

Boolean

是否包含值域上限

请求示例

查询一个分子生成任务

GET https://{endpoint}/v1/{project_id}/task/generation/{task_id}

响应示例

状态码: 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" ],
    "result" : [ {
      "smiles" : "c1ccccc1",
      "num_fulfilled_weak_constraints" : 3,
      "score" : 0.388029,
      "props" : [ "C6H6", "base", 0, 0.128335, 0.65, 0.88 ]
    }, {
      "smiles" : "C1CCCCC1",
      "num_fulfilled_weak_constraints" : 2,
      "score" : 0.304194,
      "props" : [ "C6H12", "base", 0, 0.163034, 0.65, 0.88 ]
    } ],
    "initial_dataset_size" : 2,
    "weak_constraints" : [ {
      "name" : "mw",
      "type" : "range",
      "range" : [ 100, 600 ]
    }, {
      "name" : "nhet",
      "type" : "range",
      "range" : [ 0, 15 ]
    }, {
      "name" : "fsp3",
      "type" : "range",
      "range" : [ 0.07317, 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" : null
  }
}

状态码

状态码

描述

200

分子生成任务查询成功响应

404

分子生成任务ID不存在

错误码

请参见错误码

分享:

    相关文档

    相关产品