R/RcppExports.R

Defines functions kinship_fam_sparse_cpp indexes_chr_pos indexes_chr geno_fam_cpp draw_allele close_relatives_sparse_cpp

Documented in indexes_chr

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

close_relatives_sparse_cpp <- function(kinship, cutoff) {
    .Call(`_simfam_close_relatives_sparse_cpp`, kinship, cutoff)
}

draw_allele <- function(x) {
    .Call(`_simfam_draw_allele`, x)
}

geno_fam_cpp <- function(X_in, i_founder_in, i_founder_out, i_child, i_pat, i_mat) {
    .Call(`_simfam_geno_fam_cpp`, X_in, i_founder_in, i_founder_out, i_child, i_pat, i_mat)
}

#' Extract last index of every chromosome in a vector of chromosomes
#'
#' This function tests that chromosomes appear in their numerical order (dies with an error otherwise), and returns the last index of each chromosome.
#' 
#' @param chrs Vector of integer chromosomes as it appears in a `bim` table.
#' 
#' @return Vector of end indexes per chromosome.
#' The numerical value of the chromosome is its index in this vector.
#' Chromosomes that were not observed have `NA` values as their end indexes.
#'
#' @examples
#' # the end of chr1 is at index 4, for chr2 it's 7, and for chr3 it's 9
#' indexes_chr( c(1,1,1,1,2,2,2,3,3) )
#'
#' @export
indexes_chr <- function(chrs) {
    .Call(`_simfam_indexes_chr`, chrs)
}

indexes_chr_pos <- function(pos, chr_start, chr_end, pos_start, pos_end) {
    .Call(`_simfam_indexes_chr_pos`, pos, chr_start, chr_end, pos_start, pos_end)
}

kinship_fam_sparse_cpp <- function(kinship, pars1_R, pars2_R, ids_new_R) {
    .Call(`_simfam_kinship_fam_sparse_cpp`, kinship, pars1_R, pars2_R, ids_new_R)
}
OchoaLab/simfam documentation built on Jan. 11, 2025, 12:23 a.m.