用python的requests模块,匹配uniprot中的蛋白序列

用python的requests模块,匹配uniprot中的蛋白序列,第1张

用python的requests模块,匹配uniprot中的蛋白序列
import pandas as pd
import requests
file='E:/jiaqiwork/11gcd.txt'
for line in open(file,'r'):
    lines=line.strip('n')
    params={"query":line,"format":"fasta"}
    print(params)
    response = requests.get("http://www.uniprot.org/uniprot/", params=params)
    print(response.text)
    mydb=open("E:/jiaqiwork/out.fasta",'a')
    c=str(response.text)
    mydb.write(c)
    mydb.close()
    pass

代码的基础思想是用requests调用uniprot网站的API

# import requests
# params = {"query": "P00750", "format": "fasta", "include": "yes"}
# response = requests.get("http://www.uniprot.org/uniprot/", params=params)
# print (response.text)

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5711738.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-17
下一篇 2022-12-17

发表评论

登录后才能评论

评论列表(0条)

保存