CID.GetDistMat: Computes distance matrix from edge list

Description Usage Arguments Value Examples

View source: R/helper_functions.R

Description

CID.GetDistMat returns the distance matrix (i.e., adjacency matrix, second-degree adjacency matrix, ..., etc.) from an edge list. Here, edges is the edge list, and n is the order of the connetions.

Usage

1
CID.GetDistMat(edges, n = 4)

Arguments

edges

a data frame with two columns; V1 and V2, specifying the cell-cell edge list for the network

n

maximum network distance to subtend (n neighbors)

Value

adjacency matrices for distances < n

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
# Loads edges
file.dir = "https://kleintools.hms.harvard.edu/tools/client_datasets/"
file = "CITESEQ_EXPLORATORY_CITESEQ_5K_PBMCS/FullDataset_v1_protein/edges.csv"
download.file(paste0(file.dir, file, "?raw=true"), destfile = "edges.csv")

# data.dir is your path to the "edges.csv" file
edges = CID.LoadEdges(data.dir = ".")

# get distance matrix (adjacency matrices with up to fourth-order connections) from edge list
distance_matrices = CID.GetDistMat(edges)

## End(Not run)

SignacX documentation built on Nov. 18, 2021, 5:07 p.m.