R/RcppExports.R

# This file was generated by Rcpp::compileAttributes
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

#' Integrating empirical bayesian prior function
#' by Monte Carlo integration
#'
#' @title int_eprior
#' @param sx standard data matrix
#' @param ghat estimated gamma values
#' @param dhat estimated delta values
#' @return list
#'         g.star
#'         d.star
#' @author Xin Zhou \url{xinchoubiology@@gmail.com}
int_eprior <- function(sx, ghat, dhat) {
    .Call('Rcppsva_int_eprior', PACKAGE = 'Rcppsva', sx, ghat, dhat)
}

#' SVD calculation for X=UΣV, use XtX=VtΣV to calculate the right eigen vector
#' @title arma_eigen
#' @param M input matrix = XtX
#' @return v eigen vector
#' @export
#' @author Xin Zhou \url{xinchoubiology@@gmail.com}
arma_eigen <- function(M) {
    .Call('Rcppsva_arma_eigen', PACKAGE = 'Rcppsva', M)
}

#' Linear regression on covariate of interest when comparing with other covariates
#' @title beta_regress
#' @param M m x n expression matrix; Each row represents probes and each col means samples
#' @param pv n x B design matrix; Each col means phenotype of interest, and if B >=2, 
#'        means we have B-1 permutations on covariates of interest
#' @param svs n x (p-1) design matrix; Each row represent samples and each col means parameters
#' @param full full output or coefficient only
#' @export
#' @author Xin Zhou
beta_regress <- function(M, pv, svs, full = 0L) {
    .Call('Rcppsva_beta_regress', PACKAGE = 'Rcppsva', M, pv, svs, full)
}

#' Bootstrap testing on regression model for covariate of interested
#' 
#' @title bootstrap_regress
#' @description Dimitris[Bootstrap hypothesis testing in regression models] 
#' @param M m x n expression matrix; Each row represents probes and each col means samples
#' @param mod n x p design matrix; 
#' @param modn n x (p-1) null design matrix - covariate of interest;
#' @param B n x B matrix; Bootstrap iterations index matrix
#' @export
#' @author Xin Zhou
bootstrap_regress <- function(M, mod, modn, B) {
    .Call('Rcppsva_bootstrap_regress', PACKAGE = 'Rcppsva', M, mod, modn, B)
}

#' Parallel Computing measurement matrix for different linkage type : single linkage
#' @title single_linkage
#' @param M correlation matrix
#' @return Matrix
#' @export
single_linkage <- function(M) {
    .Call('Rcppsva_single_linkage', PACKAGE = 'Rcppsva', M)
}

#' Parallel Computing measurement matrix for different linkage type : complete linkage
#' @title complete_linkage
#' @param M correlation matrix
#' @return Matrix
#' @export
complete_linkage <- function(M) {
    .Call('Rcppsva_complete_linkage', PACKAGE = 'Rcppsva', M)
}

#' Parallel Computing measurement matrix for different linkage type : average linkages
#' @title average_linkage
#' @param M correlation matrix
#' @return Matrix
#' @export
average_linkage <- function(M) {
    .Call('Rcppsva_average_linkage', PACKAGE = 'Rcppsva', M)
}

#' Parallel clique merge by indicator matrix by prefix-product
#' 
#' @title clique_merge
#' @param M Indicator Square Matrix
#' @return index NumericVector
#' @export
clique_merge <- function(M) {
    .Call('Rcppsva_clique_merge', PACKAGE = 'Rcppsva', M)
}

#' Defined linkage kinds in hierachical cluster
#' @title linkage_kinds
#' @return linkage_type character vector for linkage definition
#' @export
linkage_kinds <- function() {
    .Call('Rcppsva_linkage_kinds', PACKAGE = 'Rcppsva')
}

#' Defined distance kinds for beta value matrix calculation
#' @title distance_kinds
#' @return distance_type character vector for distance definition
#' @export
distance_kinds <- function() {
    .Call('Rcppsva_distance_kinds', PACKAGE = 'Rcppsva')
}

#' Give an order of Matrix by row | column
#' @title rankm
#' @param M matrix for calculation rank
#' @param byrow  TRUE(FALSE; By column)
#' @return ranked_matrix matrix represented by each (row/col) order
#' @export
rankm <- function(M, byrow) {
    .Call('Rcppsva_rankm', PACKAGE = 'Rcppsva', M, byrow)
}
xinchoubiology/Rcppsva documentation built on May 4, 2019, 1:06 p.m.