reorder_clusters_manual: reorder_clusters_manual

View source: R/functions_clusteringKmeans.R

reorder_clusters_manualR Documentation

reorder_clusters_manual

Description

Manually applies a new order (top to bottom) for cluster using the result of ssvSignalClustering.

Usage

reorder_clusters_manual(
  clust_dt,
  manual_order,
  row_ = "id",
  cluster_ = "cluster_id",
  reapply_cluster_names = TRUE
)

Arguments

clust_dt

data.table output from ssvSignalClustering

manual_order

New order for clusters Does not need to include all clusters. Any colors not included will be at the bottom in their original order.

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".

reapply_cluster_names

If TRUE, clusters will be renamed according to new order instead of their original names. Default is TRUE.

Value

data.table as output from ssvSignalClustering

Examples

data(CTCF_in_10a_profiles_dt)
clust_dt = ssvSignalClustering(CTCF_in_10a_profiles_dt, nclust = 3)
new_dt = reorder_clusters_manual(clust_dt = clust_dt, manual_order = 2)
cowplot::plot_grid(
    ssvSignalHeatmap(clust_dt),
    ssvSignalHeatmap(new_dt)
)

jrboyd/seqsetvis documentation built on Oct. 15, 2024, 11:28 p.m.