Skip to contents

Assign communities to interactions

Usage

assignCommunities(
  loops,
  scores,
  clusterType = "leiden",
  leidenResolution = 0.1,
  pruneUnder
)

Arguments

loops

GInteractions object of interactions to include in the network

scores

a numeric vector of scores to use as edge weights, if `loops` contains a column named 'score', this column will be used

clusterType

character vector of length 1 containing a keyword for the clustering algorithm to use. Must be one of "fast_greedy", "walktrap", "leiden", "infomap", "label_prop", or "edge_betweenness"

leidenResolution

numeric between 0 and 1, higher resolutions lead to more smaller communities, while lower resolutions lead to fewer larger communities. See `resolution_parameter` in `igraph::cluster_leiden`

pruneUnder

numeric, added loops with scores less than this value will be removed

Value

GInteractions object with community metadata

Examples

hicFile <- "inst/extdata/GM12878_chr22.hic"

mergedLoops <- mergeAnchors(GM12878_10KbLoops, 1)
connections <- connectLoopAnchors(mergedLoops, 1e6)
scores <- scoreInteractions(connections, hicFile, mergedLoops)
#> Error in fgSize + bgGap: non-numeric argument to binary operator

assignCommunities(interactions(scores))
#> Error in interactions(scores): could not find function "interactions"