Cluster average methylation of multiple tracks

gpatterns.cluster_avg_meth(avgs, K, verbose = FALSE,
  clust_order_func = partial(mean, na.rm = T), clust_columns = FALSE,
  column_k = NULL, ret_hclust = FALSE, tidy = TRUE,
  intra_clust_order = TRUE)

Arguments

avgs
avgs pre-computed intervals set with average methylation, output of gpatterns.get_avg_meth.
K
number of clusters for kmeans++
verbose
display kmeans++ messages
clust_order_func
order clusters by clust_order_func [default: mean]
clust_columns
cluster the columns (samples) using hclust
column_k
cut the hclust of the columns and return an additional 'samp_clust' column with the column cluster
ret_hclust
return a list with avgs (the clustering result) and hc (the hclust object)
tidy
is the input tidy
intra_clust_order
order within each cluster using hclust (otherwise, the order would be by genomic position)

Value

if tidy: data frame with the following fields:

  • 'chrom'
  • 'start'
  • 'end'
  • 'ord'order of intervals within the cluster
  • 'samp'sample id
  • 'samp_clust'id of the column cluster (hclust cutree)
  • 'clust'cluster id
  • 'original columns'original columns of avgs (meth,unmeth,avg,cov)

if not tidy: data frame with the following fields:

  • 'chrom'
  • 'start'
  • 'end'
  • 'ord'order of intervals within the cluster
  • 'samp_clust'id of the column cluster (hclust cutree)
  • 'clust'cluster id
  • 'original columns'original columns of avgs