View source: R/add_1D_features.R
add_1D_features | R Documentation |
Adds 1D features to the gi_list instance. If any bin on gi_list overlaps with multiple feature records, feature values are aggregated for the bin according to the vector valued function agg (e.g., sum, mean)
add_1D_features(gi_list, df, chrs = NULL, features = NULL, agg = mean)
gi_list |
List of |
df |
DataFrame with columns named 'chr', and'start' and features to be added with their respective names. |
chrs |
a subset of chromosomes' e.g.,
c('chr21','chr22'). Defaults to all chromosomes
specified in the data frame |
features |
features to be added. Needs to be a subset of
|
agg |
any vector valued function with one data argument:
defaults to |
a gi_list instance with 1D features stored in regions metadata handle
of each list element (e.g., gi_list[[1]]@regions@elementMetadata
)
in the instance
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.