trackc.tl.extractCisContact#

trackc.tl.extractCisContact(clr: Cooler | str, region: str, extend: int = 0, balance: bool = False) array[source]#

Extract cis contact matrix from the cool or mcool format Hi-C matrix.

Parameters:
  • clr (cooler.Cooler | str) –

    cool format Hi-C matrix (open2c/cooler) or cool file path

    cooler.Cooler e.g. GM12878=cooler.Cooler(‘./GM12878.chr18.mcool::/resolutions/50000’)

    str e.g. ‘GM12878.chr18.mcool::/resolutions/50000’ or ‘GM12878.chr18.cool’

  • region (str) – The subset matrix row genome regions eg. "chr6:1000000-2000000" or chr6

  • extend (int) – contact map extend to start and end position

  • balance (bool) – The 'balance' parameters of coolMat.matrix(balance=False).fetch('chr6:119940450-123940450')

  • Returns

  • --------

  • matrix (contact) – matrix start with top-left

Example

>>> import trackc as tc
>>> import cooler
>>> mat1 = tc.tl.extractCisContact(clr='GM12878.chr18.mcool::/resolutions/50000', region="18:45000000-78077248")
>>> GM12878 = cooler.Cooler('./GM12878.chr18.mcool::/resolutions/50000')
>>> mat2 = tc.tl.extractCisContact(clr=GM12878, region="18:45000000-78077248")
>>> print(mat2.shape)