
    DUfS                        d dl Z d dlZddlmZ ddlmZ ddlmZ  ej                     ej        de	d	           ej        d
e
d	           ej        ddd           ej        dddddd           ej        dd ej        ddg          d           ed          d                                                                                     ZdS )    N   )util   )cli)exit_on_broken_pipe
chromsizesCHROMSIZES_PATH)typemetavarbinsizeBINSIZEz--outz-oz Output file (defaults to stdout))helpz--headerz-Hz2Print the header of column names as the first row.TF)r   is_flagdefaultshow_defaultz	--rel-idsz-i01ziInclude a column of relative bin IDs for each chromosome. Choose whether to report them as 0- or 1-based.)r
   r   c                    t          j        | d          } t          j        | |          }|O|                    dd                                          |d<   t          |          dk    r|dxx         dz  cc<   |t          j        }nt          |d          }|r"|d	d	         	                    |d
ddd           |	                    |d
ddd           |
                                 dS )a  
    Generate fixed-width genomic bins.

    Output a genome segmentation at a fixed resolution as a BED file.

    CHROMSIZES_PATH : UCSC-like chromsizes file, with chromosomes in desired
    order.

    BINSIZE : Resolution (bin size) in base pairs <int>.

    T)	all_namesNchrom)observedidr   wr   	
F)seplineterminatorindexheader)r   read_chromsizesbinnifygroupbycumcountintsysstdoutopento_csvflush)r   r   outr   rel_idsbinsfs          P/var/www/html/software/conda/lib/python3.11/site-packages/cooler/cli/makebins.pymakebinsr/   
   s    @ %jDAAAJ<
G,,D\\'D\99BBDDT
w<<1JJJ!OJJJ {JcNN 
QqS	4E$ 	 	
 	
 	
 	KKtDeKLLLGGIIIII    )r%   click r   r   _utilr   commandargumentstrr$   optionChoicer/    r0   r.   <module>r:      sb   



              & & & & & & 30ABBB	Y777gt"DEEE	=   	sCj	!	!
6	   Q     FE 87 CB (  r0   