collate_clusters: Collate sequence IDs from an existing clustering according to...

View source: R/seqArchR_auxiliary_functionsI.R

collate_clustersR Documentation

Collate sequence IDs from an existing clustering according to a new, given clustering of the existing clusters

Description

Collate sequences original divided across n clusters into a new set of m clusters. These 'm' clusters obtained by clustering the original 'n' clusters. Assume a collection of 100 sequences across seven existing clusters. These seven clusters are collated to obtain three resulting clusters. Collating 100 sequences distributed across the seven clusters into the resulting three clusters can be achieved with collate clusters.

Usage

collate_clusters(to_clust, orig_clust)

Arguments

to_clust

A list giving clustering of factors. In other words this is the clustering of clusters of sequences given in 'orig_clust'

orig_clust

A list of sequence IDs in existing clusters

Value

A list with sequence IDs collated by the specified clustering

Examples




set.seed(123)
n <- 7; nn <- 100
orig_clust_labels <- ceiling(n * runif(nn))
orig_clust <- seqArchR::get_seqs_clust_list(orig_clust_labels)

to_clust <- list(c(1,4), c(2,3,5), c(6,7))

collate_clusters(to_clust = to_clust, orig_clust = orig_clust)


snikumbh/seqArchR documentation built on March 11, 2024, 7:06 p.m.