o
    RÅ€g   ã                   @   sx   d Z zddlmZ ddlmZ W n ey"   ddlmZ edƒd‚w ddlmZ dd	l	m
Z
 d
d„ ZG dd„ dƒZdS )z7Support for loading 3D structures stored in MMTF files.é    )Úfetch)Úparse)ÚMissingPythonDependencyErrorz?Install mmtf to use Bio.PDB.mmtf (e.g. pip install mmtf-python)N)ÚStructureDecoderé   )ÚMMTFIOc                 C   s   t ƒ }|  |¡ |j ¡ S )zReturn structure from decoder.)r   Úpass_data_onÚstructure_builderÚget_structure)ÚdecoderÚstructure_decoder© r   úI/var/www/html/myenv/lib/python3.10/site-packages/Bio/PDB/mmtf/__init__.pyÚget_from_decoded   s   

r   c                   @   s(   e Zd ZdZedd„ ƒZedd„ ƒZdS )Ú
MMTFParserz<Class to get a Biopython structure from a URL or a filename.c                 C   ó   t | ƒ}t|ƒS )z~Get a structure from a URL - given a PDB id.

        :param pdb_id: the input PDB id
        :return: the structure

        )r   r   )Úpdb_idr   r   r   r   Úget_structure_from_url!   ó   z!MMTFParser.get_structure_from_urlc                 C   r   )zˆGet a structure from a file - given a file path.

        :param file_path: the input file path
        :return: the structure

        )r   r   )Ú	file_pathr   r   r   r   r
   ,   r   zMMTFParser.get_structureN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ústaticmethodr   r
   r   r   r   r   r      s    

r   )r   Úmmtfr   r   ÚImportErrorÚBior   ÚBio.PDB.mmtf.DefaultParserr   Úmmtfior   r   r   r   r   r   r   Ú<module>   s    ÿþý