o
    Nrf                     @   s   d dl ZddlmZ g dZdd Zdd Zd	d
 Zdd Zeej	j
ddejddfddZ
eej	jddejddfddZeej	jdddZeej	jdddZdS )    N   )cbbi)info
chromsizeszoomsfetch_intervalsfetchstackupc                    s    fdd}|S )Nc                    s    j | _ | S N)__doc__)targetoriginal Q/var/www/html/software/conda/envs/catlas/lib/python3.10/site-packages/bbi/_bbi.pywrapper	   s   zdocumented_by.<locals>.wrapperr   )r   r   r   r   r   documented_by   s   r   c                 C   4   t | }|jW  d   S 1 sw   Y  dS )a	  
    Fetch the chromosome list of a bbi file. Returns an ordered dictionary of
    chromosome names mapped to their sizes in bp.

    Parameters
    ----------
    inFile : str
        Path to BigWig or BigBed file.

    Returns
    -------
    dict[str, int]

    N)r   openr   inFilefr   r   r   r         $r   c                 C   r   )a  
    Fetch the zoom levels of a bbi file. Returns a list of "reduction levels",
    i.e. the number of bases per summary item, i.e. the bin size.

    Parameters
    ----------
    inFile : str
        Path to BigWig or BigBed file.

    Returns
    -------
    list[int]

    N)r   r   r   r   r   r   r   r   #   r   r   c                 C   r   )z
    Returns a dict of information about the bbi file.

    Parameters
    ----------
    inFile : str
        Path to BigWig or BigBed file.

    Returns
    -------
    dict

    N)r   r   r   r   r   r   r   r   6   s   $r   g        meanFc	           
      C   F   t | }	|	||||||||W  d    S 1 sw   Y  d S r
   )r   r   r   )
r   chromstartendbinsmissingoobsummaryexactr   r   r   r   r   H      $r   c	           
      C   r   r
   )r   r   r	   )
r   ZchromsZstartsZendsr   r    r!   r"   r#   r   r   r   r   r	   X   r$   r	   Tc                 C   >   t | }|||||W  d    S 1 sw   Y  d S r
   )r   r   r   )r   r   r   r   iteratorr   r   r   r   r   h      $r   c                 C   r%   r
   )r   r   fetch_summaries)r   r   r   r   Zzoomr   r   r   r   r(   n   r'   r(   )T)r   )numpynp r   __all__r   r   r   r   ZBBIFiler   nanr	   r   r(   r   r   r   r   <module>   s2    



