Brick_get_entire_matrix: Return an entire matrix for provided chromosome pair for a...

View source: R/Brick_functions.R

Brick_get_entire_matrixR Documentation

Return an entire matrix for provided chromosome pair for a resolution.

Description

Brick_get_entire_matrix will return the entire matrix for the entire chromosome pair provided an object of class BrickContainer, and values for chr1, chr2 and resolution values.

Usage

Brick_get_entire_matrix(Brick, chr1, chr2, resolution)

Arguments

Brick

Required. A string specifying the path to the Brick store created with Create_many_Brick.

chr1

Required. A character vector of length 1 specifying the chromosome corresponding to the rows of the matrix

chr2

Required. A character vector of length 1 specifying the chromosome corresponding to the columns of the matrix

resolution

Optional. Default NA When an object of class BrickContainer is provided, resolution defines the resolution on which the function is executed

Value

Returns an object of class matrix with dimensions corresponding to chr1 binned length by chr2 binned length.

Examples

Bintable.path <- system.file(file.path("extdata", "Bintable_100kb.bins"), 
package = "HiCBricks")

out_dir <- file.path(tempdir(), "get_vector_val_test")
if(!file.exists(out_dir)){
    dir.create(out_dir)
}

My_BrickContainer <- Create_many_Bricks(BinTable = Bintable.path, 
    bin_delim = " ", output_directory = out_dir, file_prefix = "Test",
    experiment_name = "Vignette Test", resolution = 100000,
    remove_existing = TRUE)

Matrix_file <- system.file(file.path("extdata", 
"Sexton2012_yaffetanay_CisTrans_100000_corrected_chr2L.txt.gz"), 
package = "HiCBricks")

Brick_load_matrix(Brick = My_BrickContainer, chr1 = "chr2L", 
chr2 = "chr2L", matrix_file = Matrix_file, delim = " ", 
remove_prior = TRUE, resolution = 100000)

Entire_matrix <- Brick_get_entire_matrix(Brick = My_BrickContainer, 
chr1 = "chr2L", chr2 = "chr2L", resolution = 100000)


koustav-pal/HiCBlocks documentation built on Oct. 29, 2022, 8:17 a.m.