R/RcppExports.R

Defines functions strat_otherPopERRORsP strat_ERRORsP ssGP sP otherPopERRORssGP otherPopERRORsP falseNeg_ERRORsP ERRORssGP ERRORsP

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

#' estimatign error rates for parent - offspring pair vs unrelated
#' Monte Carlo used for estimating false negative
#' Importance sampling Monte Carlo used for estimating false positive
#' @param baselineParams Dirichlet parameters for allele frequencies
#' @param unsampledPopParams Dirichlet parameters for allele frequencies
#' @param missingParams Beta parameters for missing genotypes (failure to genotype rate)
#' @param genotypeKey list of matrix for each locus, col1 is genotype, col2 is allele 1, col3 is allele 2
#' @param genotypeErrorRates list of matrix for each locus, rows are actual genotype, columns are observed,
#'   values are probability
#' @param llrToTest Vector of llr's to test as threshold values
#' @param N number of samples to take
#' @keywords internal
#' @noRd
#' @export
ERRORsP <- function(baselineParams, unsampledPopParams, missingParams, genotypeKey, genotypeErrorRates, llrToTest, N, seed) {
    .Call(`_gRandma_ERRORsP`, baselineParams, unsampledPopParams, missingParams, genotypeKey, genotypeErrorRates, llrToTest, N, seed)
}

#' estimatign error rates for single-sided grandparent pair vs unrelated
#' Monte Carlo used for estimating false negative
#' Importance sampling Monte Carlo used for estimating false positive
#' @param baselineParams Dirichlet parameters for allele frequencies
#' @param unsampledPopParams Dirichlet parameters for allele frequencies
#' @param missingParams Beta parameters for missing genotypes (failure to genotype rate)
#' @param genotypeKey list of matrix for each locus, col1 is genotype, col2 is allele 1, col3 is allele 2
#' @param genotypeErrorRates list of matrix for each locus, rows are actual genotype, columns are observed,
#'   values are probability
#' @param llrToTest Vector of llr's to test as threshold values
#' @param N number of samples to take
#' @keywords internal
#' @noRd
#' @export
ERRORssGP <- function(baselineParams, unsampledPopParams, missingParams, genotypeKey, genotypeErrorRates, llrToTest, N, seed) {
    .Call(`_gRandma_ERRORssGP`, baselineParams, unsampledPopParams, missingParams, genotypeKey, genotypeErrorRates, llrToTest, N, seed)
}

#' estimatign error rates for parent - offspring pair vs unrelated
#' Monte Carlo used for estimating false negative
#' @param baselineParams Dirichlet parameters for allele frequencies
#' @param unsampledPopParams Dirichlet parameters for allele frequencies
#' @param missingParams Beta parameters for missing genotypes (failure to genotype rate)
#' @param genotypeKey list of matrix for each locus, col1 is genotype, col2 is allele 1, col3 is allele 2
#' @param genotypeErrorRates list of matrix for each locus, rows are actual genotype, columns are observed,
#'   values are probability
#' @param llrToTest Vector of llr's to test as threshold values
#' @param N number of samples to take
#' @keywords internal
#' @noRd
#' @export
falseNeg_ERRORsP <- function(baselineParams, unsampledPopParams, missingParams, genotypeKey, genotypeErrorRates, llrToTest, N, seed) {
    .Call(`_gRandma_falseNeg_ERRORsP`, baselineParams, unsampledPopParams, missingParams, genotypeKey, genotypeErrorRates, llrToTest, N, seed)
}

#' estimating false positive error rates for single-sided grandparent pair vs unrelated
#' with individuls from one population being assigned to a different population
#' Importance sampling Monte Carlo used for estimating false positive
#' 
#' 
#' This version uses trios from the current "baseline" pop as the importance sampling distribution
#' 
#' @param baselineParams Dirichlet parameters for allele frequencies
#' @param unsampledPopParams Dirichlet parameters for allele frequencies
#' @param missingParams Beta parameters for missing genotypes (failure to genotype rate)
#' @param genotypeKey list of matrix for each locus, col1 is genotype, col2 is allele 1, col3 is allele 2
#' @param genotypeErrorRates list of matrix for each locus, rows are actual genotype, columns are observed,
#'   values are probability
#' @param llrToTest Vector of llr's to test as threshold values
#' @param N number of samples to take
#' @param skipBaseline added unsampled pops to skip as baseline
#' @keywords internal
#' @noRd
#' @export
otherPopERRORsP <- function(baselineParams, unsampledPopParams, missingParams, genotypeKey, genotypeErrorRates, llrToTest, N, seed, skipBaseline) {
    .Call(`_gRandma_otherPopERRORsP`, baselineParams, unsampledPopParams, missingParams, genotypeKey, genotypeErrorRates, llrToTest, N, seed, skipBaseline)
}

#' estimating false positive error rates for single-sided grandparent pair vs unrelated
#' with individuls from one population being assigned to a different population
#' Importance sampling Monte Carlo used for estimating false positive
#' 
#' 
#' This version uses trios from the current "baseline" pop as the importance sampling distribution
#' 
#' @param baselineParams Dirichlet parameters for allele frequencies
#' @param unsampledPopParams Dirichlet parameters for allele frequencies
#' @param missingParams Beta parameters for missing genotypes (failure to genotype rate)
#' @param genotypeKey list of matrix for each locus, col1 is genotype, col2 is allele 1, col3 is allele 2
#' @param genotypeErrorRates list of matrix for each locus, rows are actual genotype, columns are observed,
#'   values are probability
#' @param llrToTest Vector of llr's to test as threshold values
#' @param N number of samples to take
#' @param skipBaseline added unsampled pops to skip as baseline
#' @keywords internal
#' @noRd
#' @export
otherPopERRORssGP <- function(baselineParams, unsampledPopParams, missingParams, genotypeKey, genotypeErrorRates, llrToTest, N, seed, skipBaseline) {
    .Call(`_gRandma_otherPopERRORssGP`, baselineParams, unsampledPopParams, missingParams, genotypeKey, genotypeErrorRates, llrToTest, N, seed, skipBaseline)
}

#' calculating llr of parent - offspring pair vs unrelated
#' returning a matrix of descendent, grandparentPopulation, grandparent1, grandparent2, llr
#' @param baseline baseline individuals, col1 is pop, col2 is id, cols 3... are genotypes
#' @param mixture mixture individulas col1 is id, cols 2... are genotypes
#' @param baselineParams Dirichlet parameters for allele frequencies
#' @param unsampledPopParams Dirichlet parameters for allele frequencies
#' @param genotypeKey list of matrix for each locus, col1 is genotype, col2 is allele 1, col3 is allele 2
#' @param genotypeErrorRates list of matrix for each locus, rows are actual genotype, columns are observed,
#'   values are probability
#' @param saveLLR the minimum LLR to include the output in the results (only used if filterLLR is true)
#' @param MIexcludeProb the maximum probability of exclusion for a true grandparent pair due to 
#'   Mendelian incompatibilities
#' @param filterLLR true to filter results based on saveLLR, false to not
#' @keywords internal
#' @noRd
#' @export
sP <- function(baseline, mixture, baselineParams, unsampledPopParams, genotypeKey, genotypeErrorRates, saveLLR, MIexcludeProb, filterLLR) {
    .Call(`_gRandma_sP`, baseline, mixture, baselineParams, unsampledPopParams, genotypeKey, genotypeErrorRates, saveLLR, MIexcludeProb, filterLLR)
}

#' calculating llr of single-sided grandparent pair vs unrelated
#' returning a matrix of descendent, grandparentPopulation, grandparent1, grandparent2, llr
#' @param baseline baseline individuals, col1 is pop, col2 is id, cols 3... are genotypes
#' @param mixture mixture individulas col1 is id, cols 2... are genotypes
#' @param crossRecords col1 is pop, col2 is id 1, col3 is id2
#' @param baselineParams Dirichlet parameters for allele frequencies
#' @param unsampledPopParams Dirichlet parameters for allele frequencies
#' @param genotypeKey list of matrix for each locus, col1 is genotype, col2 is allele 1, col3 is allele 2
#' @param genotypeErrorRates list of matrix for each locus, rows are actual genotype, columns are observed,
#'   values are probability
#' @param saveLLR the minimum LLR to include the output in the results (only used if filterLLR is true)
#' @param MIexcludeProb the maximum probability of exclusion for a true grandparent pair due to 
#'   Mendelian incompatibilities
#' @param filterLLR true to filter results based on saveLLR, false to not
#' @keywords internal
#' @noRd
#' @export
ssGP <- function(baseline, mixture, crossRecords, baselineParams, unsampledPopParams, genotypeKey, genotypeErrorRates, saveLLR, MIexcludeProb, filterLLR) {
    .Call(`_gRandma_ssGP`, baseline, mixture, crossRecords, baselineParams, unsampledPopParams, genotypeKey, genotypeErrorRates, saveLLR, MIexcludeProb, filterLLR)
}

#' estimatign error rates for parent - offspring pair vs unrelated
#' Monte Carlo used for estimating false negative
#' Importance sampling Monte Carlo used for estimating false positive
#' @param baselineParams Dirichlet parameters for allele frequencies
#' @param unsampledPopParams Dirichlet parameters for allele frequencies
#' @param missingParams Beta parameters for missing genotypes (failure to genotype rate)
#' @param genotypeKey list of matrix for each locus, col1 is genotype, col2 is allele 1, col3 is allele 2
#' @param genotypeErrorRates list of matrix for each locus, rows are actual genotype, columns are observed,
#'   values are probability
#' @param llrToTest Vector of llr's to test as threshold values
#' @param N number of samples to take
#' @param trueRel an integer indicating the true relationship to simulate: 0 = unrelated, 1 = aunt,
#'   2 = half aunt, 3 = cousin of parent
#' @keywords internal
#' @noRd
#' @export
strat_ERRORsP <- function(baselineParams, unsampledPopParams, missingParams, genotypeKey, genotypeErrorRates, llrToTest, itersPerMI, seed, trueRel) {
    .Call(`_gRandma_strat_ERRORsP`, baselineParams, unsampledPopParams, missingParams, genotypeKey, genotypeErrorRates, llrToTest, itersPerMI, seed, trueRel)
}

#' estimating false positive error rates for single-sided grandparent pair vs unrelated
#' with individuls from one population being assigned to a different population
#' Stratified sampling Monte Carlo used for estimating false positive 
#' 
#' 
#' This version uses trios from the current "baseline" pop as the importance sampling distribution
#' 
#' @param baselineParams Dirichlet parameters for allele frequencies
#' @param unsampledPopParams Dirichlet parameters for allele frequencies
#' @param missingParams Beta parameters for missing genotypes (failure to genotype rate)
#' @param genotypeKey list of matrix for each locus, col1 is genotype, col2 is allele 1, col3 is allele 2
#' @param genotypeErrorRates list of matrix for each locus, rows are actual genotype, columns are observed,
#'   values are probability
#' @param llrToTest Vector of llr's to test as threshold values
#' @param N number of samples to take
#' @param skipBaseline added unsampled pops to skip as baseline
#' @keywords internal
#' @noRd
#' @export
strat_otherPopERRORsP <- function(baselineParams, unsampledPopParams, missingParams, genotypeKey, genotypeErrorRates, llrToTest, itersPerMI, seed, skipBaseline) {
    .Call(`_gRandma_strat_otherPopERRORsP`, baselineParams, unsampledPopParams, missingParams, genotypeKey, genotypeErrorRates, llrToTest, itersPerMI, seed, skipBaseline)
}
delomast/gRandma documentation built on March 14, 2020, 7:46 p.m.