HiCDOCDataSet {treediff}R Documentation

Create a HiCDOCDataSet object from a set of files

Description

This function creates a count matrix from a set of files in different formats, such as tabular, cooler, juicer or HiC-Pro. It returns a list of interaction matrices.

Usage

HiCDOCDataSet(files, format, binsize = NULL, chromosomes, index = NULL)

Arguments

files

A character vector of file paths.

format

A character vector of file formats corresponding to the files in file. Supported formats are "tabular", "cooler", "juicer", and "HiC-Pro".

binsize

An integer representing the bin size to use for cooler and juicer formats. Ignored for tabular and HiC-Pro formats.

chromosomes

A character vector specifying the chromosomes to include in the output.

index

A character vector of file paths to the index files required for HiC-Pro format. Ignored for other formats.

Value

A list containing the following objects:

HiCDOCDataSet

A list of interaction matrices of the HiCDOCDataSet class of the HiCDOC package, one for each file

indexData

A data frame of index data for each interaction in the matrices.

index_mat_chr

A data frame containing the name of the matrices and the corresponding chromosome.

Examples

## Not run: 
replicates <- 1:2
cond <- "90"
all_begins <- interaction(expand.grid(replicates, cond), sep = "-")
all_begins <- as.character(all_begins)

nb_chr <- 2
chromosomes <- 1:nb_chr
all_mat_chr <- lapply(chromosomes, function(chr) {
  all_mat <- lapply(all_begins, function(ab) {
    mat_file <- paste0("Rep", ab, "-chr", chr, "_200000.bed")
  })
  all_mat <- unlist(all_mat)
})
index <- system.file("extdata", "index.200000.longest18chr.abs.bed",
                     package = "treediff")
format <- rep("HiC-Pro", length(replicates) * length(cond) * nb_chr)
binsize <- 200000
files <- system.file("extdata", unlist(all_mat_chr), package = "treediff")
HiCDOCDataSet(files, format, binsize, chromosomes, index)

## End(Not run)


[Package treediff version 0.2.1 Index]