R/seqArchR_auxiliary_functionsI.R
collate_clusters.Rd
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.
collate_clusters(to_clust, orig_clust)
A list giving clustering of factors. In other words this is the clustering of clusters of sequences given in `orig_clust`
A list of sequence IDs in existing clusters
A list with sequence IDs collated by the specified clustering
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)
#> [[1]]
#> [1] 6 15 18 35 41 46 51 54 57 62 74 80 85 91 98 7 9 10 12
#> [20] 27 36 48 52 55 66 70 75 86 99 100
#>
#> [[2]]
#> [1] 17 30 38 40 45 47 49 56 64 76 81 90 96 1 3 19 29 39 42 43 44 60 63 77 79
#> [26] 83 93 95 13 14 22 23 25 26 28 33 61 72 73 78 82 92 94
#>
#> [[3]]
#> [1] 2 34 37 53 58 65 67 68 69 71 84 97 4 5 8 11 16 20 21 24 31 32 50 59 87
#> [26] 88 89
#>