View source: R/functions_clusteringKmeans.R
copy_clust_info | R Documentation |
copy_clust_info
copy_clust_info(target, to_copy, row_ = "id", cluster_ = "cluster_id")
target |
A data.table or GRanges returned from ssvFetch*, the target to which cluster info will be added. |
to_copy |
A data.table or GRanges returned from ssvSignalClustering, from which to copy cluster if. |
row_ |
variable name mapped to row, likely id or gene name for ngs data. Default is "id" and works with ssvFetch* output. |
cluster_ |
variable name to use for cluster info. Default is "cluster_id". |
data.table or GRanges (whichever target is) containing row order and cluster assignment derived from to_copy. Suitable for ssvSignalHeatmap and related functions.
data(CTCF_in_10a_narrowPeak_grs)
data(CTCF_in_10a_overlaps_gr)
data(CTCF_in_10a_profiles_dt)
#this takes cluster info from signal and applies to peak hits to
#create a heatmap of peak hits clustered by signal.
clust_dt1 = ssvSignalClustering(CTCF_in_10a_profiles_dt)
peak_hit_gr = ssvFetchGRanges(
CTCF_in_10a_narrowPeak_grs,
qgr = CTCF_in_10a_overlaps_gr
)
peak_hit_gr.clust = copy_clust_info(peak_hit_gr, clust_dt1)
peak_hit_gr.clust$hit = peak_hit_gr.clust$y > 0
ssvSignalHeatmap(peak_hit_gr.clust, fill_ = "hit") +
scale_fill_manual(values = c("FALSE" = "gray90", "TRUE" = "black"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.