R/RcppExports.R

Defines functions .writeWindowsToTempFileCPP calcAndCountDist

Documented in calcAndCountDist

# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

#' @title Count frequency of differences between values in integer vectors.
#'
#' @description Given two ascendingly sorted integer vectors \code{query} and \code{reference}, calculate
#'   and count the differences between their elements that are greater than zero
#'   and less than \code{maxd}. The number of observed distances \code{d} are reported in \code{cnt[d]},
#'   and \code{maxd} corresponds to the \code{length(cnt)}. The function is
#'   called by \code{\link{calcPhasogram}}, which provides a higher level, more
#'   conventient interface.
#'
#' @author Michael Stadler
#'
#' @param query first \code{integer} vector.
#' @param reference second \code{integer} vector. Distances are calculated from each element
#'   in \code{query} to each greater element in \code{reference}.
#' @param cnt \code{NumericVector} to store the result in. The length of \code{cnt} defines
#'   the maximal distance that will be included in the analysis, and new counts
#'   will be added to the values of \code{cnt}.
#'
#' @return \code{numeric} vector \code{cnt}, where \code{cnt[d]} correspond to
#'   the number of observed distances \code{d}.
#'
#' @export
calcAndCountDist <- function(query, reference, cnt) {
    .Call('_swissknife_calcAndCountDist', PACKAGE = 'swissknife', query, reference, cnt)
}

.writeWindowsToTempFileCPP <- function(chr, w, fname) {
    .Call('_swissknife_writeWindowsToTempFileCPP', PACKAGE = 'swissknife', chr, w, fname)
}
fmicompbio/swissknife documentation built on June 11, 2025, 4:17 p.m.