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)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)