chebi_resolution.py 文件源码

python
阅读 48 收藏 0 点赞 0 评论 0

项目:IBRel 作者: lasigeBioTM 项目源码 文件源码
def find_chebi_term2(term):
    if _platform == "linux" or _platform == "linux2":
        # linux
        cp = "{0}/florchebi.jar:{0}/mysql-connector-java-5.1.24-bin.jar:{0}/Tokenizer.jar".format(florchebi_path)
    elif _platform == "win32":
        # "Windows..."
        cp = "{0}/florchebi.jar;{0}/mysql-connector-java-5.1.24-bin.jar;{0}/Tokenizer.jar".format(florchebi_path)
    florcall = ["java", "-cp", cp, "xldb.flor.match.FlorTextChebi3star", db.escape_string(term),
                "children", "true", "mychebi201301", "false", "false", "chebi", stoplist, "1"]
    # print ' '.join(florcall)
    flor = Popen(florcall, stdout=PIPE)
    florresult, error = flor.communicate()
    chebires = florresult.strip().split('\t')
    # print "chebires: ", chebires
    if len(chebires) == 3:
        return (chebires[0], chebires[1], float(chebires[2]))
    else:
        return ('0', 'null', 0.0)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号