scMetric: scMetric: metric learning and visualization for scRNA-seq...

Description Usage Arguments Value Examples

View source: R/scMetric.R

Description

Apply a weakly supervised metric learning algorithm ITML to scRNA-seq data. Users give very few training samples to tell expected angle they would use to analyze the data, and the function learns the metric automatically for downstream clustering and visualization.

Usage

1
2
scMetric(X, label = NULL, constraints = NULL, num_constraints = 100,
  thresh = 0.01, max_iters = 1e+05, draw_tSNE = FALSE)

Arguments

X

a scRNA-seq expression matrix, cells for rows and genes for columns.

label

a vector. Specify which group cells belong to, corresponding to rows in X. If NULL(default), constraints should not be NULL.

constraints

a N by 3 matrix, weak supervision information. N stands for total number of cell pairs. The first 2 columns specify two cells. The 3rd column is a value specifying whether corresponding two cells in the first two columns are similar, 1 for similar and -1 for dissimilar. If NULL(default), label cannot be NULL and num_constraints pairs will be chosen randomly according to label for metric learning. Cells that have the same label are similar. Otherwise, they are dissimilar.

num_constraints

total number of similar and dissimilar pairs that are used. No larger than N. If constraints is not NULL, first num_constraints rows of constraints will be used. Default: 100

thresh

threshold that decides when metric learning iteration stops. Default: 0.01

max_iters

max iterations of metric learning. Default: 100000

draw_tSNE

boolean. Default: FALSE. Specify whether to draw tSNE plot or not

Value

List containing four outputs:

Examples

1
2
data(testData)
res <- scMetric(counts, label = label1, num_constraints = 50, thresh = 0.1, draw_tSNE = TRUE)

chenwenchang/scMetric documentation built on July 20, 2020, 4:08 p.m.