o
    tf]                     @  s   d dl mZ d dlZd dlZd dlZd dlZd dlmZ ddlm	Z	 ddl
mZ g dZejd ZG d	d
 d
ZeG dd dZd$d%ddZd&ddZed'ddZed'ddZed'ddZed'ddZed'd d!Zed'd"d#ZdS )(    )annotationsN)	dataclass   )	TrackType)track)LocalTilesetRemoteTilesetremotebigwigmultiveccoolerhitilebed2ddb)vectorr   matrixc                   @  s<   e Zd Z	ddddZedddZdddZdddZdS )r   NdatatypeDataTypetiles9typing.Callable[[typing.Sequence[str]], list[typing.Any]]infotyping.Callable[[], typing.Any]uidstrname
str | Nonec                 C  s"   || _ || _|| _|| _|| _d S N)r   _tiles_info_uidr   )selfr   r   r   r   r    r    Y/var/www/html/software/conda/envs/catlas/lib/python3.10/site-packages/higlass/tilesets.py__init__   s
   
zLocalTileset.__init__returnc                 C  s   | j S r   )r   r   r    r    r!   r   )   s   zLocalTileset.uidtile_idstyping.Sequence[str]list[typing.Any]c                 C  s
   |  |S r   )r   )r   r%   r    r    r!   r   -   s   
zLocalTileset.tiles
typing.Anyc                 C  s   |   S r   )r   r$   r    r    r!   r   0   s   zLocalTileset.infor   )
r   r   r   r   r   r   r   r   r   r   )r#   r   )r%   r&   r#   r'   )r#   r(   )__name__
__module____qualname__r"   propertyr   r   r   r    r    r    r!   r      s    
r   c                   @  s4   e Zd ZU ded< ded< dZded< dd	d
ZdS )r   r   r   serverNr   r   type_r   c                 K  s4   t d|| j| jd|}| jr|j| jdd |S )N)r.   r-   Z
tilesetUidT)r   Zinplacer    )r   r-   r   r   opts)r   r.   kwargstr    r    r!   r   :   s   zRemoteTileset.track)r.   r   )r)   r*   r+   __annotations__r   r   r    r    r    r!   r   4   s
   
 r   https://higlass.io/api/v1r   r   r-   c                 K  s   t | |fi |S r   )r   )r   r-   r0   r    r    r!   r	   F   s   r	   fn)typing.Callable[[str, str], LocalTileset]c                   s   dd fdd}|S )	Nfilepathr   r   
None | strc                   s6   |d u rt |  }tt|  } | |S r   )pathlibPathabsolutehashlibmd5r   encode	hexdigest)r6   r   abspathr4   r    r!   wrapperM   s   
z6hash_absolute_filepath_as_default_uid.<locals>.wrapperr   )r6   r   r   r7   r    )r4   rA   r    r@   r!   %hash_absolute_filepath_as_default_uidJ   s   rB   r6   c                 C  L   z
ddl m}m} W n ty   tdw tdt|| t|| |dS Nr   r   tileset_info>You must have `clodius` installed to use "vector" data-server.r   r   r   r   r   )Zclodius.tiles.bigwigr   rF   ImportErrorr   	functoolspartialr6   r   r   rF   r    r    r!   r
   V      

r
   c                 C  rC   rD   )Zclodius.tiles.beddbr   rF   rI   r   rJ   rK   rL   r    r    r!   beddbg   rM   rN   c                 C  rC   )Nr   rE   z@You must have `clodius` installed to use "multivec" data-server.r   rH   )Zclodius.tiles.multivecr   rF   rI   r   rJ   rK   rL   r    r    r!   r   x   rM   r   c                 C  rC   )Nr   rE   z>You must have `clodius` installed to use "matrix" data-server.r   rH   )Zclodius.tiles.coolerr   rF   rI   r   rJ   rK   rL   r    r    r!   r      rM   r   c                 C  rC   rD   )Zclodius.tiles.hitiler   rF   rI   r   rJ   rK   rL   r    r    r!   r      rM   r   c                 C  rC   )Nr   rE   rG   z2d-rectangle-domainsrH   )Zclodius.tiles.bed2ddbr   rF   rI   r   rJ   rK   rL   r    r    r!   r      rM   r   )r3   )r   r   r-   r   )r4   r5   )r6   r   r   r   )
__future__r   rJ   r;   r8   typingdataclassesr   _utilsr   apir   __all__Literalr   r   r   r	   rB   r
   rN   r   r   r   r   r    r    r    r!   <module>   s6    

