R/RcppExports.R

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

#' An internal helper function to check that each row of a numeric matrix is 
#' sorted in strictly increasing order
#' 
#' @param A A numeric matrix
#' 
#' @return TRUE if each row is sorted in strictly increasing order, FALSE otherwise
#' 
#' @details 
#' .allRowsSortedCpp is adapted from http://stackoverflow.com/a/7601857.
#' Strict inequalities are required in order to avoid m-tuples with repeated 
#' positions (https://github.com/PeteHaitch/cometh/issues/8).
#' 
#' @keywords internal
#' 
.allRowsSortedCpp <- function(A) {
    .Call('cometh_allRowsSortedCpp', PACKAGE = 'cometh', A)
}

#' An internal helper function used in finding duplicate m-tuples.
#'
#' The m-tuple should have already been converted to an integer representation,
#' namely an integer vector for the chromosome, an integer vector 
#' for the strand and an integer matrix for the  positions.
#' 
#' @param a An integer vector of length n. An integer representation of the 
#' chromosome of each m-tuple.
#' @param b An integer vector of length n. An integer representation of the 
#' strand of each m-tuple.
#' @param C An integer matrix with n rows. Each row represents the positions 
#' of an m-tuple.
#' 
#' @return A logical vector. TRUE if the corresponding row of \code{x} is a 
#' potential duplicate and FALSE otherwise. 
#' \emph{NOTE:} TRUE does not mean that it is a duplicate, merely that it is a 
#' candidate. Further checking is required of these candidates, e.g. using the 
#' \code{\link[base]{duplicated.array}} method.
#' 
.candidateDuplicateMTuplesCpp <- function(a, b, C) {
    .Call('cometh_candidateDuplicateMTuplesCpp', PACKAGE = 'cometh', a, b, C)
}

#' An internal function used to compare m-tuples.
#' 
#' @details 
#' The m-tuple should have already been converted to an integer representation,
#' namely an integer vector for the difference in chromosome, an integer vector 
#' for the difference in strand and an integer matrix for the difference in 
#' positions.
#' 
#' @param a An integer vector of length n. An integer representation of the difference in chromosomes of each m-tuple.
#' @param b An integer vector of length n. An integer representation of the difference in strand of each m-tuple.
#' @param C An integer matrix with n rows. Each row represents the difference in positions of each m-tuple. 
#' 
#' 
#' @return An integer vector where each element is the comparison of a pair
#' of m-tuples.
#' If the first m-tuple in the pair is "<" than the second m-tuple then the
#' return value for that element is < 0, if the first m-tuple in the pair is 
#' "==" the second m-tuple then the return value is 0, and if the first
#' m-tuple is ">" that the second m-tuple then the return value is > 0.
#' 
#' @keywords internal
#'
#' 
.compareMTuplesCpp <- function(a, b, C) {
    .Call('cometh_compareMTuplesCpp', PACKAGE = 'cometh', a, b, C)
}

.makeAutoCorVP <- function(s, ipd) {
    .Call('cometh_makeAutoCorVP', PACKAGE = 'cometh', s, ipd)
}

#' An internal function to compute differences for each row in a matrix.
#' 
#' @param A An integer \eqn{N \times K} matrix.
#' 
#' @keywords internal
#'
#' @return An integer \eqn{N \times (K - 1)} matrix.
#' 
#' @note This function silently coerces numeric matrices to integer matrices
#' and does integer subtraction. \emph{This will give unexpected results but
#' it's not a problem for me since I only use it on integer matrices.}
.rowDiffsCpp <- function(A) {
    .Call('cometh_rowDiffsCpp', PACKAGE = 'cometh', A)
}

#' An internal helper function used in finding duplicate rows of an integer 
#' matrix.
#' 
#' @details
#' Not actually used in cometh package but written during development of 
#' mTuplesHashCpp.
#' 
#' @param x An integer matrix.
#' 
#' @return A logical vector. TRUE if the corresponding row of \code{x} is a 
#' potential duplicate and FALSE otherwise. 
#' \emph{NOTE:} TRUE does not mean that it is a duplicate, merely that it could be.
#' Further checking is required of elements with TRUE, e.g. using the 
#' \code{\link[base]{duplicated.array}} method.
#' 
#' @keywords internal
#' 
#' 
.rowSumsHashInternalCpp <- function(x) {
    .Call('cometh_rowSumsHashInternalCpp', PACKAGE = 'cometh', x)
}
PeteHaitch/cometh documentation built on May 8, 2019, 1:32 a.m.