load_deeptoolsmatrix3: load_deeptoolsmatrix3

Description Usage Arguments Details Value Examples

View source: R/deeptools_funs.R

Description

Loads a deeptools v3 matrix file.

Usage

1
2
3
4
5
6
7
load_deeptoolsmatrix3(
  fname,
  na.omit = TRUE,
  na.fill = 0,
  as.matrix = FALSE,
  as.S3 = FALSE
)

Arguments

fname

the file to load.

na.fill

Fills NAs with this value zero. Default is 0.

as.matrix

Return matrix as matrix (default is FALSE, ie returns tidy data.frame instead)

as.S3

Return S3 class metagene object, see details for more info

Details

Loads a gzipped deeptools matrix file and collects this in a tidy data.frame. If as.matrix is true, the header information is added as attribute. as.S3 returns a metagene object, with slots: $header, $regions, $samples, $groups and $matrices. Where $header contains the header information as a named vector. Matrices is a list of matrices where each matrix is specific to 1 sample and 1 group. $samples are the samplenames for each matrix. $groups are the groups for each matrix.

Value

An object of class deeptools_matrix with provided means and covariances computed as 1/alpha.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
 fname <- system.file("extdata", "deeptools3_matrix.gz", package = "RMetaTools")
 df <- load_deeptoolsmatrix3(fname)
 head(df)
 df_withNAas0 <- load_deeptoolsmatrix3(fname, na.fill=0)
 head(df_withNAas0)
 s3obj <- load_deeptoolsmatrix3(fname, na.fill=0, as.S3=TRUE)
 head(s3obj$regions)
 lapply(s3obj$matrices, head)
 s3obj$samples
 s3obj$groups
 lapply(s3obj$rel_pos, head)

manschmi/RMetaTools documentation built on Dec. 14, 2021, 4:33 a.m.