Skip to content

前后端交互接口定义 #1

@cairijun

Description

@cairijun
  • GET /biobrick/<type>

    <type>可取值inputoutputreceptorpromoter,获取某种元件的列表。返回格式:

{
  "result": [
    {"type": "input", "name": "Input XXX", "id": 1234},
    {"type": "input", "name": "Input YYY", "id": 5687},
    ...]
}
  • GET /biobrick/<type>?id=XXX

    根据ID获取某个元件的信息。返回格式:

{
  "result": {"type": "input", "name": "Input XXX", "id": 1234}
}
  • GET /biobrick/suggest/promoters?input_id=XXX

    根据Input推荐Promoter。返回格式:

{
  "result": [
    {"type": "promoter", "name": "Input XXX", "id": 1234},
    {"type": "promoter", "name": "Input YYY", "id": 5687},
    ...]
}
  • GET /biobrick/suggest/receptors?input_id=XXX&promoter_id=YYY

    根据Input和Promoter推荐Receptor。返回格式:

{
  "result": [
    {"type": "receptor", "name": "Input XXX", "id": 1234},
    {"type": "receptor", "name": "Input YYY", "id": 5687},
    ...]
}
  • POST /circuit/schemes

    根据真值表设计通路。(目前的算法实现只能处理完整的真值表
    请求格式:

{
  //限制输入最多为两个
  "inputs": [
    {"id": 1, "promoter_ids": [1], "receptor_id": 1},
    {"id": 2, "promoter_ids": [1], "receptor_id": 1}
  ],
  //限制输出最多为三个
  "outputs": [1, 2, 3],
  "truth_table": [
    {"inputs": [true, true], "outputs": [true, true, false]},
    {"inputs": [true, false], "outputs": [false, true, false]},
    {"inputs": [false, true], "outputs": [true, false, false]},
    {"inputs": [false, false], "outputs": [false, true, true]}
  ]
}

响应格式:

{
  "inputs": [
    {
      "eid": "c5820968a77f4c278093a048fe60e28a",
      "type": "input", "id": 1, "name": "Input 1", 
      "promoters": [
        {"type": "promoter", "eid": "02d32d2742a2494f98a641b3c535d0fe",
        "name": "Promoter 1", "id": 1}
      ], 
      "receptor": {
        "type": "receptor", "eid": "418d4ad9ebf04655a4815799af23a915",
        "name": "Receptor 1", "id": 1
      }
    },
    {
      //input 2...
    }
  ], 
  "schemes": [
    {
      "outputs": [
        "51f0549840b54342bcaa4789e6a20239", 
        "b8d861b45b054c20a88a71f3b2be9e5c", 
        "5c0647b146174d36adfc278c365fa046"
      ], 
      "logic_gates": [
        {
          "id": 4, "name": "Not 1", "logic": "NOT", 
          "eid": "abab5341130042cca9ecadcba0156570", 
          "inputs": [
            "51f0549840b54342bcaa4789e6a20239"
          ], 
        }, 
        {
          "id": 3, "name": "Or 1", "logic": "OR", 
          "eid": "58d44e82aa1c4ca0bf3983583fedc556", 
          "inputs": [
            "c5820968a77f4c278093a048fe60e28a", 
            "51f0549840b54342bcaa4789e6a20239"
          ], 
        }, 
        {
          //其他逻辑门
        }
      ]
    }, 
    {
      //其他方案
    }
  ]
}

每个元件用eid来唯一标识。

其他的还在设计,尽快写~

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions