mnn_opt: Search for the optimal parameters for MNN

Description Usage Arguments Value Examples

View source: R/optimize_functions.R

Description

This function is used for searching for the optimal parameters used in MNN. The goal is find parameters that maximize the average of p-values from the neighbor_test function.

Usage

1
2
3
mnn_opt(data_ref, data_in, k_range = c(16:25), sigma_range = c(0.01,
  1), dim = 3, dist_scale_in = 10, tol_er = 0.001, ncore = 10,
  fast = FALSE)

Arguments

data_ref

Single cell data from one data type as the reference for matching (e.g., scATAC-seq data).

data_in

Single cell data from another data type as the input for matching (e.g., scRNA-seq data).

k_range

Searching space for k, the number of mutual nearest neighbor in MNN.

sigma_range

Searching space for sigma, the bandwidth of the Gaussian smoothing kernel used to compute the correction vector.

dim

Number of dimension used for matching the single cells. For example, the number of principal components.

dist_scale_in

Scale used to define the radius of the region for testing.

tol_er

The desired accuracy in function optimize.

ncore

Number of CPU cores used for parallel processing. Use ncore = 1 to run the function without parallel processing.

fast

A flag indicates whether or not to use a fast neighbor_test.

Value

k_opt

The optimal value for k.

sigma_opt

The optimal value for sigma.

max_obj

The average p-value based on the optimal parameters.

Examples

1
2
3
4
## Not run: 
result_opt <- mnn_opt(data_ref,data_in,k_range=c(16:25),sigma_range=c(0.01,1),dim=3,dist_scale_in=10,tol_er=0.001,ncore=10)

## End(Not run)

WeiqiangZhou/SINTER documentation built on Sept. 11, 2019, 8:03 a.m.