spRing: spRing Execute the spRing algorithm

Description Usage Arguments Value References Examples

View source: R/spring.R

Description

spRing takes a matrix of samples X features and computes a per-sample distance vector before selecting the k nearest neighbors. This is done iteratively in Rcpp to minimize the memory footprint while optimizing speed. Force directed layout is implemented from igraphs layout_with_drl function. If either/both knngraph or igraph is TRUE, this function will return an S3 object (list) with the coordinates and either/both of these objects. Otherwise, a two dimensional vector specifying the coordinates will be returned.

Usage

1
spRing(x, k = 10, method = "pearson", knngraph = FALSE, igraph = FALSE)

Arguments

x

Data matrix

k

= 10

method

= "pearson" The distance metric for the data.

knngraph

= FALSE Return knn graph generated by the data?

igraph

= FALSE Return igraph network associated with knn graph?

Value

One or more outputs. See above

References

Adapted from https://github.com/caleblareau, based on Weinreb et. al. \ Bioinformatics, Volume 34, Issue 7, 01 April 2018, Pages 1246–1248.

Examples

1
2
3
x <- matrix(rnorm(100), nrow = 20) # 20 samples
coords <- spRing(x, k = 2, method = "euclidean")
# plot(coords)

scfurl/m3addon documentation built on Aug. 9, 2021, 5:30 p.m.