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
)

Arguments

trees

AntibodyForests object/list of AntibodyForests objects - the resulting sequence similarity or minimum spanning tree networks from the AntibodyForests function.

GEX.object

Seurat object/ VGM[[2]] for the inferred AntibodyForests networks (must include all cells available in the AntibodyForests object).

node.features

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).

cell.graph.type

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.

recluster.cells

boolean - whether to recluster the resulting cell graphs or keep the already existing Seurat cluster definitions.

recluster.resolution

numeric - recluster resolution for the Louvain algorithm if recluster.cells is TRUE.

snn.threshold

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).

keep.largest.cc

boolean - whether to keep only the largest connected component in the cell graphs or keep all singletons/doubletons/etc., as well.

parallel

boolean - whether to execute the heterogeneous graph building algorithm in parallel or not. Requires the 'parallel' R package.

Value

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.

Examples

if (FALSE) {
AntibodyForests_heterogeneous(trees, GEX.object = VGM[[2]], cell.graph.type = 'snn')
}