Source code for bioverse.adapters.alpha_fold

from ..adapter import Adapter
from ..data import Assets, Split
from ..processors import PdbProcessor
from ..utilities import batched, config, download, glob_delete


[docs] class AlphaFoldAdapter(Adapter): """Download protein structures from the AlphaFold Protein Structure Database."""
[docs] @classmethod def download(cls, name="swissprot_pdb", version="v4"): path = config.raw_path / "AlphaFoldDB" / version / name base_url = "https://ftp.ebi.ac.uk/pub/databases/alphafold/latest/" download(f"{base_url}/{name}_{version}.tar", path) glob_delete(str(path / "*.cif.gz")) # remove double files, keep .pdb return batched(PdbProcessor.process(path)), Split(), Assets({})