1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
//! Implementation of the SuperCell approach from Bilous, et al., BMC
//! Bioinform., 2022
use crate*;
use cratewalktrap_sparse_graph;
use crateknn_to_sparse_graph;
///////////////
// SuperCell //
///////////////
/// Structure for the SuperCell parameters
///
/// ### Fields
///
/// **SuperCell params**
///
/// * `walk_length` - Walk length for the Walktrap algorithm
/// * `graining_factor` - Graining level of data (proportion of number of single
/// cells in the initial dataset to the number of metacells in the final
/// dataset)
/// * `linkage_dist` - Which type of distance metric to use for the linkage.
///
/// **General kNN params**
///
/// * `knn_params` - All of the kNN parameters
/// SuperCell algorithm
///
/// ### Params
///
/// * `knn_mat` - The kNN matrix
/// * `walk_length` - Walk length for the Walktrap algorithm
/// * `no_meta_cells` - Number of communities, i.e., metacells to identify
/// * `linkage_dist` - The distance metric to use for the linkage.
/// * `verbose` - Controls the verbosity of the function
///
/// ### Returns
///
/// Membership of included cells to MetaCells.