View source: R/expand_1D_features.R
expand_1D_features | R Documentation |
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.
expand_1D_features(gi_list, chrs = NULL, features = NULL, agg = transform.vec)
gi_list |
List of |
chrs |
a subset of chromosomes' e.g., c('chr21','chr22'). Defaults
to all chromosomes in the |
features |
features to be added. Defaults to all 1D features in
elements of |
agg |
any vector valued function with two data arguments:
defaults to |
a gi_list element with 2D features stored in metadata handle
(i.e., mcols(gi)
).
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.