
    DUf"                        d dl Z d dlmZ 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d	           ej        d
d	           ej        d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)metavarfasta
FASTA_PATHenzymeENZYMEz--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.)typer   c                 4   t          j        | d          } t          |                                           }t	          j        |          rbt          j        t	          j        |d                    }|                    t          j        t	          j        |d                               n|g}t          j	        |g|R  }t          j
        ||          }	|M|	                    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 )ab  
    Generate fragment-delimited genomic bins.

    Output a genome segmentation of restriction fragments as a BED file.

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

    FASTA_PATH : Genome assembly FASTA file or folder containing FASTA files
    (uncompressed).

    ENZYME : Name of restriction enzyme

    T)	all_namesz*.faz*.fastaNchromidr   wr   	
F)seplineterminatorindexheader)r   read_chromsizeslistkeysopisdirglobjoinextend
load_fastadigestgroupbycumcountintsysstdoutopento_csvflush)r   r   r   outr    rel_idschroms	filepathsfasta_recordsfragsfs              N/var/www/html/software/conda/lib/python3.11/site-packages/cooler/cli/digest.pyr*   r*      s   H %jDAAAJ*//##$$F 
x IbgeV4455	275)#<#<==>>>>G	OF7Y777M Kv..EmmG,,5577dw<<1$KKK1KKK {JcNN 
ac
4E$ 	 	
 	
 	
 
LLTuLMMMGGIIIII    )r&   os.pathpathr$   r.   click r   r   _utilr   commandargumentoptionChoicer*    r;   r:   <module>rF      s          



              & & & & & & &7888...(+++gt"DEEE	=   	sCj	!	!
6	   Q- -    FE ,+ /. 98 *- - -r;   