批量下载AlphaFold结构

AlphaFold是谷歌DeepMind开发的最先进的人工智能系统,能够以前所未有的准确性和速度计算预测蛋白质结构。我们与EMBL的欧洲生物信息学研究所(EMBL-EBI)合作,发布了AlphaFold的2亿多个蛋白质结构预测,这些预测可供全球科学界免费公开使用。其中包括科学上已知的几乎所有编目蛋白质,这些蛋白质有可能将人类对生物学的理解提高几个数量级。

AlphaFold预测的结构可以从AlphaFold Protein Structure Database  和 UniProt 搜索下载,也可以通过python脚本批量下载。

批量下载脚本

import os
import requests

def download_af_structure(uniprot_ids, outdir):
    os.makedirs(outdir, exist_ok=True)
    for uniprot_id in uniprot_ids:   
        url = f"https://alphafold.ebi.ac.uk/files/AF-{uniprot_id}-F1-model_v4.pdb"
        outpath = os.path.join(outdir, f"{uniprot_id}.pdb")
    
        # 如果文件已存在,跳过下载
        if os.path.exists(outpath):
            print(f"Already exists: {uniprot_id}")
            continue

        r = requests.get(url)
        if r.status_code == 200:
            with open(outpath, "wb") as f:
                f.write(r.content)
            print(f"Downloaded: {uniprot_id}")
        else:      
            print(f"Not found: {uniprot_id}")


uniprot_ids = set(["A0A815KT75","A0A6P4Z083"])
download_af_structure(uniprot_ids, "test_output_dir")
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值