gunz_cm.metrics.ren.third_parties.hicrep package
Submodules
gunz_cm.metrics.ren.third_parties.hicrep.hicrep module
Module.
Examples
- gunz_cm.metrics.ren.third_parties.hicrep.hicrep.hicrepSCC(cool1: Cooler, cool2: Cooler, h: int, dBPMax: int, bDownSample: bool, chrNames: list = None, excludeChr: set = None)[source]
Compute hicrep score between two input Cooler contact matrices
- Args:
cool1: cooler.api.Cooler Input Cooler contact matrix 1 cool2: cooler.api.Cooler Input Cooler contact matrix 2 h: int Half-size of the mean filter used to smooth the input matrics dBPMax int Only include contacts that are at most this genomic distance (bp) away bDownSample: bool Down sample the input with more contacts to the same number of contacts as in the other input chrNames: list List of chromosome names whose SCC to compute. Default to None, which means all chromosomes in the genome are used to compute SCC excludeChr: set Set of chromosome names to exclude from SCC computation. Default to None.
- Returns:
float scc scores for each chromosome
Examples
- gunz_cm.metrics.ren.third_parties.hicrep.hicrep.sccByDiag(m1: coo_matrix, m2: coo_matrix, nDiags: int)[source]
- Compute diagonal-wise hicrep SCC score for the two input matrices up to
nDiags diagonals
- Args:
m1 (sp.coo_matrix): input contact matrix 1 m2 (sp.coo_matrix): input contact matrix 2 nDiags (int): compute SCC scores for diagonals whose index is in the range of [1, nDiags)
Returns: float hicrep SCC scores
Examples
- gunz_cm.metrics.ren.third_parties.hicrep.hicrep.sccOfDiag(diag1: ndarray, diag2: ndarray)[source]
- Get the correlation coefficient and weight of two input
diagonal arrays
- Args:
diag1: np.ndarray input array 1 diag2: np.ndarray input array 2
- Returns:
tuple of 2 floats, the Pearson’s correlation rho and weight
Examples
gunz_cm.metrics.ren.third_parties.hicrep.utils module
Module.
Examples
- gunz_cm.metrics.ren.third_parties.hicrep.utils.cool2pixels(cool: Cooler)[source]
Return the contact matrix in ‘pixels’ format
Examples
- gunz_cm.metrics.ren.third_parties.hicrep.utils.coolerInfo(cool: Cooler, k: str)[source]
Retrieve metadata from Cooler file
Examples
- gunz_cm.metrics.ren.third_parties.hicrep.utils.getSubCoo(pixels: RangeSelector2D, bins: RangeSelector1D, regionStr: str)[source]
Fetch a region from Cooler contact matrix and return it as a coo_matrix
Examples
- gunz_cm.metrics.ren.third_parties.hicrep.utils.meanFilterSparse(a: coo_matrix, h: int)[source]
Apply a mean filter to an input sparse matrix
Examples
- gunz_cm.metrics.ren.third_parties.hicrep.utils.pixels2Coo(df: DataFrame, bins: DataFrame)[source]
Convert Cooler’s contact matrix in ‘pixels’ DataFrame to scipy coo_matrix
Examples
- gunz_cm.metrics.ren.third_parties.hicrep.utils.readMcool(fmcool: str, binSize: int)[source]
Read from a mcool or cool file and return the Cooler object
Examples
- gunz_cm.metrics.ren.third_parties.hicrep.utils.resample(m: coo_matrix, size: int)[source]
Resample with replacement the input matrix to sum to the given size
Examples
- gunz_cm.metrics.ren.third_parties.hicrep.utils.trimDiags(a: coo_matrix, iDiagMax: int, bKeepMain: bool)[source]
Remove diagonal elements whose diagonal index is >= iDiagMax or is == 0
Examples