get_distance_matrix: Get the pair-wise distance matrix for an assay

Description Usage Arguments Details Value See Also Examples

View source: R/scMethrix_clustering.R

Description

Get the pair-wise distance matrix for an assay

Usage

1
2
3
4
5
6
7
get_distance_matrix(
  scm,
  assay = "score",
  type = c("pearson", "spearman", "kendall", "euclidean", "manhattan", "canberra",
    "binary", "minkowski"),
  verbose = TRUE
)

Arguments

scm

scMethrix; Input scMethrix object

assay

string; The assay to use. Default is 'score'

type

string; The type of distance metric to use. Available options are "pearson", "spearman", "tau", "euclidean", "manhattan", "canberra", "binary", "minkowski". An aribitrary distance function can also be used, so long as the input takes just the specified matrix.

verbose

boolean; flag to output messages or not

Details

Utilizes mainly the bioDist package to determine various distance metrics to be used for later clustering.

Value

matrix; the distance matrix

See Also

https://www.rdocumentation.org/packages/stats/versions/3.6.2/topics/dist

https://www.bioconductor.org/packages//2.7/bioc/html/bioDist.html

Examples

1
2
3
4
5
6
7
8
data('scMethrix_data')
scMethrix_data <- impute_regions(scMethrix_data) 
get_distance_matrix(scMethrix_data,assay = "impute") 

# For an arbitrary distance function
library(bioDist)
fun <- bioDist::spearman.dist
get_distance_matrix(scMethrix_data,assay = "impute",type = bioDist::spearman.dist)

CompEpigen/scMethrix documentation built on Nov. 6, 2021, 3:09 p.m.