expand_1D_features: expand_1D_features

View source: R/expand_1D_features.R

expand_1D_featuresR Documentation

expand_1D_features

Description

Expands 1D features on the regions metadata handle of each list element (e.g., gi_list[[1]]@regions@elementMetadata) to the to 2D metadata e.g., mcols(gi_list[[1]])). Two feature values corresponding to each anchor is summarized as a score using a vector valued function agg that takes two vector valued arguments of the same size and outputs a vector of the same size as the input vectors. This defaults to the transform.vec function outlined in (Carty et al., 2017). For efficient use of memory, using add/expand 1D features (see ?add_1D_features and expand_1D_features) in sequence is recommended instead of using add_2D_features directly for each chromosome.

Usage

expand_1D_features(gi_list, chrs = NULL, features = NULL, agg = transform.vec)

Arguments

gi_list

List of GenomicInteractions objects where each object named with chromosomes contains intra-chromosomal interaction information (see ?gi_list_validate for a detailed explanation of valid gi_list instances).

chrs

a subset of chromosomes' e.g., c('chr21','chr22'). Defaults to all chromosomes in the gi_list instance.

features

features to be added. Defaults to all 1D features in elements of gi_list[[1]]@regions@elementMetadata

agg

any vector valued function with two data arguments: defaults to transform.vec described in HiC-DC (Carty et al., 2017).

Value

a gi_list element with 2D features stored in metadata handle (i.e., mcols(gi)).

Examples

df<-data.frame(chr='chr9',start=seq(1e6,10e6,1e6),end=seq(2e6,11e6,1e6))
gi_list<-generate_df_gi_list(df)
feats<-data.frame(chr='chr9',start=seq(1e6,10e6,1e6),gc=runif(10))
gi_list<-add_1D_features(gi_list,feats)
gi_list<-expand_1D_features(gi_list)

mervesa/HiCDCPlus documentation built on June 8, 2022, 3:43 a.m.