Code Monkey home page Code Monkey logo

blast_online's People

Contributors

cairijun avatar hm-fannie avatar richardtsai avatar

Watchers

 avatar  avatar  avatar

blast_online's Issues

表格输出结果

/result/<task_id>在输出结果时会尝试把结果转换成表格(二维列表)。格式如下:

[
    ["query id", "subject id", "% identity", "alignment length", "mismatches", "gap opens", "q. start", "q. end", "s. start", "s. end", "evalue", "bit score"], 
    ["lcl|FJ881694.1_cdsid_ACO57213.1", "BBa_S04192", "100.00", "2652", "0", "0", "1", "2652", "1238", "3889", "0.0", "5257"], 
    ["lcl|FJ881694.1_cdsid_ACO57213.1", "BBa_S04186", "100.00", "2652", "0", "0", "1", "2652", "227", "2878", "0.0", "5257"], 
    ["lcl|FJ881694.1_cdsid_ACO57213.1", "BBa_S03938", "100.00", "2652", "0", "0", "1", "2652", "16", "2667", "0.0", "5257"]
]

如果没有字段名信息(tabular without comment),字段名全部设置成空字符串。

如果转换失败,则原样输出。

部署步骤

依赖:Redis、Python、Blast、pip_requirements.txt中的Python包。

config.py中配置如下:
CELERY_BROKER: Celery队列后端地址,默认为本地Redis服务器
BLAST_DEFAULT_KWARGS: Blast的默认参数
BLAST_DB_DIR: Blast数据库路径
BLAST_INPUT_DIR: Blast输入文件路径
BLAST_OUTPUT_DIR: Blast输出文件路径
POLL_STATUS_RETRIES: 每次长轮询请求状态查询次数

配置完成后运行run_server.py

新数据库

添加如下数据库:

  • 2013_Distribution
  • 2014_Distribution
  • All_Parts_in_Catalog
  • In_Stock
  • In_Stock_or_Pending
  • Pending

HTTP接口定义

  • GET / 首页

  • POST /query 提交查询

    参数:

    Key Description Example
    program 程序名称 blastn
    evalue E-value 1000
    outfmt 输出格式 pairwise
    database 数据库名称 Biobrick
    input 输入 -

    返回JSON:

    Key Description Example
    errno 错误码,0为成功 0
    err_msg 错误信息 "Success"
    task_id 任务ID "065fb64cd42911e3a14510604b805805"
  • POST /query/upload 上传文件查询

    multipart/form-data格式,参数与POST /query一样,只是input字段换成上传的文件。返回不变。

  • GET /status/<task_id> 查询当前状态(非阻塞)

    返回JSON:

    Key Description Example
    errno 错误码,0为成功 0
    err_msg 错误信息 "Success"
    status 当前状态 "finished"
    msg 错误详细信息(failed状态才有) "Wrong format"

    状态取值:

    Status Description
    nonexistent 任务不存在
    queuing 排队中
    working 运算中
    finished 完成
    failed 失败
  • GET /status/<task_id>/poll 查询当前状态(Long-polling)

    返回值与GET /status/<task_id>一样,但是这个为Long-polling接口。此接口在以下情况下返回:

    Event Behavior
    任务不存在 返回nonexistent
    超时 返回超时时的任务状态
    任务完成或失败 返回finished或failed
    任务状态改变 返回最新的状态
  • GET /result/<task_id> 获取结果

    返回JSON:

    Key Description Example
    errno 错误码,0为成功 0
    err_msg 错误信息 "Success"
    result 结果 -
  • GET /result/download/<task_id> 下载结果

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.