-
Notifications
You must be signed in to change notification settings - Fork 1
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
前后端交互接口定义 #1
Comments
非常好! |
更新后的数据结构定义:
{
"circuits": [
{/* A circuit object */},
{/* A circuit object */},
{/* A circuit object */},
],
"relationships": [
{
"from": "58d44e82aa1c4ca0bf3983583fedc556",
"to": "c5820968a77f4c278093a048fe60e28a",
"type": "promote",
},
{
"from": "02d32d2742a2494f98a641b3c535d0fe",
"to": "418d4ad9ebf04655a4815799af23a915",
"type": "repress",
}
]
} 基本元件会根据需要添加其他字段用于对元件进行更详细的描述。 |
改动:
{
"id": 1,
"type": "XXX",
"name": "Input XXX",
//以下字段仅在Circuit或Device中存在
"eid": "c5820968a77f4c278093a048fe60e28a",
}
{
"id": 1,
"type": "logic",
"name": "And Gate XXX",
"truth_table": "FFFT",
"intermedia": ["XXX", "YYY"],
//以下两个字段在Circuit或Device中能被替换
/* 如果不存在逻辑门,比如只有一个input,那么以下就只会得到promoter和output。*/
"inputparts": [
[
{/* An promoter biobrick */},
{/* An RBS biobrick */},
{/* An output biobrick */}
{/* An terminator biobrick */}
],
[
{/* An promoter biobrick */},
{/* An RBS biobrick */},
{/* An output biobrick */}
{/* An terminator biobrick */}
],
],
"outputpart":
[
{/* An promoter biobrick */},
{/* An RBS biobrick */},
{/* An output biobrick */}
{/* An terminator biobrick */}
],
//以下字段仅在Circuit或Device中存在
"eid": "c5820968a77f4c278093a048fe60e28a",
} 一个circuit可能会有多个不同的logic,output直接存在logic里
{
"inputs": [
[/*a biobrick array*/], /*其实就是存input和receptor*/
[/*a biobrick array*/],
],
"logics": [
{/* An logic object */},
{/* An logic object */},
{/* An logic object */}
]
} 增加type为terminator的Biobrick |
感觉把inputparts中的promoters移到inputs中会比较好: {
"inputs": [
[
{/* An input object */},
{/* A receptor object */},
{/* A promoter object */},
{/* A promoter object */}
],
[
/* ... */
]
],
"logics": [
{/* A logic object */},
{/* A logic object */}
]
} 因为inputparts中的promoters不是logic的一部分,不是存储在数据库中的,移出来后logic可以使用数据库中取出来的数据,不用再去修改了 另外,circuit实现方案的响应格式如下: {
"inputs": [/* ... */],
"logics": [
[{/* Option 1 for output 1 */}, {/* Option 2 for output 2 */}],
[{/* Option 1 for output 2 */}],
[{/* Option 1 for output 3 */}, {/* Option 2 for output 3 */}, {/* Option 3 for output 3 */}]
]
} |
此外,考虑到存在多个输出的Logic, |
circuit的promoter的放置按照原来 @LiuXiangyu 的方案 terminator需要用户选择,circuit实现方案的请求格式如下: {
"inputs": [
{"id": 1, "receptor_id": 1, "promoter_id": 3},
{"id": 2, "receptor_id": 2, "promoter_id": 4},
],
"outputs": [
{"id": 1, "terminator_id": 1},
{"id": 2, "terminator_id": 1},
],
"truth_table": [/* 略 */]
} |
{
"inputs": [
{"id": 1, "receptor_id": 1, "promoter_id": 3},
{"id": 2, "receptor_id": 2, "promoter_id": 4},
],
"outputs": [1, 2], /*用户不用选择terminator,还是改成id的数组*/
"truth_table": [/* 略 */]
} |
GET
/biobrick/<type>
<type>
可取值input
、output
、receptor
、promoter
,获取某种元件的列表。返回格式:GET
/biobrick/<type>?id=XXX
根据ID获取某个元件的信息。返回格式:
GET
/biobrick/suggest/promoters?input_id=XXX
根据Input推荐Promoter。返回格式:
GET
/biobrick/suggest/receptors?input_id=XXX&promoter_id=YYY
根据Input和Promoter推荐Receptor。返回格式:
POST
/circuit/schemes
根据真值表设计通路。(目前的算法实现只能处理完整的真值表)
请求格式:
响应格式:
每个元件用
eid
来唯一标识。其他的还在设计,尽快写~
The text was updated successfully, but these errors were encountered: