# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
#' Column gradient for the loss function based on Pearson correlation distance (faster Rcpp version)
#'
#' @description A specific implementation of column gradient to be used in the main coordinate gradient descent algorithm scBatchCpp
#' @param c The original p*n batch effect data with n subjects and p RNA-seq measurements.
#' @param d The n*n distance matrix obtained by QuantNorm.
#' @param w An initial n*n weight matrix to conduct linear transformation. Default to be identity matrix if not specified.
#' @param core Pre-calculated component from main algorithm in order to save computation time.
#' @param idx Random selected columns input from the main algorithm.
#' @author Teng Fei. Email: tfei@emory.edu
#' @export
derif <- function(c, w, d, core, idx) {
.Call(`_scBatch_derif`, c, w, d, core, idx)
}
#' Correct RNA-seq count matrix subject to batch effects by sample distance matrix correction (faster Rcpp version)
#'
#' @description Use gradient descent algorithm to correct count matrix by linear transformation based on known sample matrix correction.
#' @param c The original p*n batch effect data with n subjects and p RNA-seq measurements.
#' @param d The n*n distance matrix obtained by QuantNorm.
#' @param w An initial n*n weight matrix to conduct linear transformation. An usual choice is the identity matrix if not specified.
#' @param m Number of groups to be divided for coordinate gradient descent. 1 < m <= n.
#' @param max Maximum number of the iteration if the tolerance is not reached.
#' @param step Step size of the gradient descent algorithm.
#' @param tol Stopping criteria of the algorithm. The algorithm stops if the step size is smaller than tol.
#' @param derif Function to compute gradient of the loss function. For Pearson distance, use scBatch::derif.
#' @param verbose Whether output the loss function after each iteration.
#' @return Returns the corrected count matrix.
#' @author Teng Fei. Email: tfei@emory.edu
#' @references Fei and Yu (2020). scBatch: batch-effect correction of RNA-seq data through sample distance matrix adjustment. Bioinformatics, 36(10), 3115-3123. <https://doi.org/10.1093/bioinformatics/btaa097>
#' @export
scBatchCpp <- function(c, w, d, m, max, step, tol, derif, verbose) {
.Call(`_scBatch_scBatchCpp`, c, w, d, m, max, step, tol, derif, verbose)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.