# hicCompartmentalization¶

Rearrange the average interaction frequencies using the first PC values to represent the global compartmentalization signal. To our knowledge this has been first introduced and implemented by Wibke Schwarzer et al. 2017 (Nature. 2017 Nov 2; 551(7678): 51–56)

$ hicCompartmentalization –obsexp_matrices obsExpMatrix.h5 –pca pc1.bedgraph -o global_signal.png

```
usage: hicCompartmentalization --obsexp_matrices OBSEXP_MATRICES
[OBSEXP_MATRICES ...] --pca PCA
--outputFileName OUTPUTFILENAME
[--quantile QUANTILE] [--outliers OUTLIERS]
[--outputMatrix OUTPUTMATRIX]
[--offset OFFSET [OFFSET ...]] [-h] [--version]
```

## Required arguments¶

`--obsexp_matrices, -m`HiCExplorer matrices in h5/cool format.

`--pca`a PCA vector as a bedgraph file with no header. In case of several matrices with different conditions, ie. controltreatment, the PCA of control can be used. Note that only one PCA can be provided.

`--outputFileName, -o`Plot to represent the polarization of A/B compartments.

## Optional arguments¶

`--quantile, -q`number of quantiles. (Default: 30).

Default: 30

`--outliers`precentage of outlier to remove. (Default: 0).

Default: 0

`--outputMatrix`output .npz file includes all the generated matrices

`--offset`set nan for the distances mentioned as offset from main diagonal, only positive values are accepted! Example: if –offset 0, then values of main diagonal will set to nan and if –offset 0 1 then on top of the main diagonal, +1 and -1 diagonal values are also set to nan.

`--version`show program’s version number and exit

## PCA to compute the global compartmentalization signal¶

To our knowledge this method has been first introduced by Wibke Schwarzer et al. 2017 (Nature. 2017 Nov 2; 551(7678): 51–56). In this method, a global (genome-wide) strength for compartmentalization is computed as (AA + BB) / (AB + BA) after rearranging the bins of obs/exp based on their corresponding pc1 values. For this purpose, first pc1 values are reordered incrementally, then the same order of bins is used to rearrange the bins in obs/exp matrix.

```
$ _hicCompartmentalization --obsexp_matrices obsExpMatrix.h5 --pca pc1.bedgraph
-o global_signal.png
```