Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

design部分接口 #3

Open
cairijun opened this issue Oct 10, 2014 · 1 comment
Open

design部分接口 #3

cairijun opened this issue Oct 10, 2014 · 1 comment

Comments

@cairijun
Copy link
Member

  • POST /circuit/schemes

    根据真值表设计通路

    请求:

    {
      "inputs": [
        { "receptor_id": 1, "id": 1, "promoter_id": 17 }, 
        { "receptor_id": 3, "id": 2, "promoter_id": 23 }
      ], 
      "truth_table": [
        { "inputs": [ true, true ], "outputs": [ true, true ] }, 
        { "inputs": [ false, true ], "outputs": [ false, true ] }, 
        { "inputs": [ true, false ], "outputs": [ false, true ] }, 
        { "inputs": [ false, false ], "outputs": [ false, false ] }
      ], 
      "outputs": [ 2, 4 ]
    }

    响应:

    {
      "inputs": [
        [{/* input */}, {/* receptor */}],
        [{/* input */}, {/* receptor */}]
      ],
      "logics": [
        [{/* candidate for output 1 */}, {/* candidate for output 1 */}],
        [{/* candidate for output 2 */}, {/* candidate for output 2 */}]
      ]
    }
  • POST /circuit/details

    在拖放模式下,根据用户选择的基本结构生成详细信息

    请求:

    {
      "inputs": [
        { "receptor_id": 12, "id": 8, "promoter_id": 1 }, 
        { "receptor_id": 13, "id": 9, "promoter_id": 17 }
      ], 
      "logics": [ 23, 21 ], 
      "outputs": [ 1, 2 ]
    }

    响应:(与上面接口类似)

    {
      "inputs": [
        [{/* input */}, {/* receptor */}],
        [{/* input */}, {/* receptor */}]
      ],
      "logics": [
        {/* logic for output 1 */},
        {/* logic for output 2 */}
      ]
    }
  • 注意

    1. 在input中有一个字段relationship指定该input-receptor-promoter组之间的关系。
      "PROMOTE"表示input和receptor结合对promoter起促进作用
      "REPRESS"表示input和receptor结合对promoter起抑制作用
      "BIREPRESS"表示input解除receptor对promoter的抑制作用
    2. logic中inputpart的数量不一定与输入数量相等,outputpart的数量不一定与输出数量相等,不同类型的logic有不同的结构
    3. eid字段原本设计来是为了方便表示通路间的调控关系,但是现在不需要了,后面可能会取消eid字段

更多例子请见相关单元测试。

@cairijun
Copy link
Member Author

POST /circuit/details的返回值增加一个字段dna_export,是一个字符串,表示导出DNA的结果。
前端可以用HTML的download属性实现下载功能。
详见 http://stackoverflow.com/questions/2897619/using-html5-javascript-to-generate-and-save-a-file 中第二个和第三个回答
后端有需要修改的地方在github上说一下

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant