Description Usage Arguments Value See Also Examples
Performs PCA on Hi-C contact map as described in Liebermann-Aiden et al 2009. More specifically it runs following routines on dense matrix:
removes unmappable regions (all zeros rows and columns)
divides each diagonal of every cell by its corresponding mean of cells on diagonal
converts matrix from 2. into PCC matrix
performs PCA on such matrix
fills in unmappable regions into PCA object vector/matrix components
1 |
dense.mtx |
numeric matrix - Hi-C contact map |
... |
optional arguments passed to |
PCA object returned by prcomp
function.
prcomp
for how is PCA performed, Lieberman-Aiden E. et al., 2009 "Comprehensive mapping of long-range interactions reveals folding principles of the human genome." for compartment detection in Hi-C contact maps.
1 2 3 4 5 6 7 8 9 10 11 | # load Hi-C contact maps from npz file
# get sample npz file name
mtx.fname <- system.file("extdata", "MSC-HindIII-1_40kb-raw.npz", package = "DIADEM", mustWork = TRUE)
mtx.sparse.list <- read_npz(mtx.fname, sparse.format = TRUE)
# get matrix for selected chromosome
mtx <- mtx.sparse.list[["18"]]
# do PCA
pca <- do_pca(mtx)
print(pca)
# it is also possible to visualize results
pairs(pca)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.