R/AntibodyForests_heterogeneous.R
AntibodyForests_heterogeneous.Rd
Creates a bipartite network from a Seurat object and an already inferred AntibodyForests sequence similarity/ minimum spanning tree network.
AntibodyForests_heterogeneous(
trees,
GEX.object,
node.features,
cell.graph.type,
recluster.cells,
recluster.resolution,
snn.threshold,
keep.largest.cc,
parallel
)
AntibodyForests object/list of AntibodyForests objects - the resulting sequence similarity or minimum spanning tree networks from the AntibodyForests function.
Seurat object/ VGM[[2]] for the inferred AntibodyForests networks (must include all cells available in the AntibodyForests object).
vector of strings - gene names in the Seurat object to be added as igraph vertex attributes in the resulting heterogeneous networks (will add gene expression per gene).
string - graph algorithm for building the cell-cell/ nearest-neighbour graphs, as done by the Seurat::FindNeighbors() function. 'knn' for the K nearest-neighbour graphs, 'snn' for the shared nearest-neighbour graphs.
boolean - whether to recluster the resulting cell graphs or keep the already existing Seurat cluster definitions.
numeric - recluster resolution for the Louvain algorithm if recluster.cells is TRUE.
numeric - SNN edge weight threshold to further prune edges in the cell graphs (increased value = sparser cell graphs). Defaults to 1/15 (as done in the Seurat::FindNeighbors function).
boolean - whether to keep only the largest connected component in the cell graphs or keep all singletons/doubletons/etc., as well.
boolean - whether to execute the heterogeneous graph building algorithm in parallel or not. Requires the 'parallel' R package.
nested list of AntibodyForests objects for each clonotype and each sample/timepoint or a single AntibodyForests object, with a new added object slot for the heterogeneous graph.
if (FALSE) {
AntibodyForests_heterogeneous(trees, GEX.object = VGM[[2]], cell.graph.type = 'snn')
}