R/RcppExports.R

Defines functions get_genolik_extended_c get_genolik_c glpow filt1_hap filt1_dip anctract_c anclik_c ancfreq_merge ancfreq_c anccall_c_test anccall_c_ori anccall_c_int anccall_hap_c anccall_c_nozero_int anccall_c_nozero anccall_c

Documented in anccall_c anccall_c_int anccall_c_nozero anccall_c_nozero_int anccall_c_ori anccall_c_test anccall_hap_c ancfreq_c ancfreq_merge anclik_c anctract_c filt1_dip filt1_hap get_genolik_c get_genolik_extended_c glpow

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

#' @title anccall_c: Generating ancestry call along the chromosome
#'
#' @param deltaf The cut-off for minimum delta f between two reference populations
#' @param window Size of the sliding window
#' @param SMAX The number of all snp sites
#' @param anclikdir the dir to anclik file
#' @param output the dir of the output ancfreq file
anccall_c <- function(deltaf, window, SMAX, anclikdir, output, chrom, indiv, mode, n, round1, round2, round3, zero_value) {
    invisible(.Call(`_rLCLAE_anccall_c`, deltaf, window, SMAX, anclikdir, output, chrom, indiv, mode, n, round1, round2, round3, zero_value))
}

#' @title anccall_c_nozero: Generating ancestry call along the chromosome
#'
#' @param deltaf The cut-off for minimum delta f between two reference populations
#' @param window Size of the sliding window
#' @param SMAX The number of all snp sites
#' @param anclikdir the dir to anclik file
#' @param output the dir of the output ancfreq file
anccall_c_nozero <- function(deltaf, window, SMAX, anclikdir, output, chrom, indiv, mode, n) {
    invisible(.Call(`_rLCLAE_anccall_c_nozero`, deltaf, window, SMAX, anclikdir, output, chrom, indiv, mode, n))
}

#' @title anccall_c_nozero_int: Generating ancestry call along the chromosome
#'
#' @param deltaf The cut-off for minimum delta f between two reference populations
#' @param window Size of the sliding window
#' @param SMAX The number of all snp sites
#' @param anclikdir the dir to anclik file
#' @param int1 output intermediate file 1 call
#' @param int2 output intermediate file 2 after 1st smoothing
#' @param output the dir of the output anccall file
anccall_c_nozero_int <- function(deltaf, window, SMAX, anclikdir, int1, int2, output, chrom, indiv, mode, n) {
    invisible(.Call(`_rLCLAE_anccall_c_nozero_int`, deltaf, window, SMAX, anclikdir, int1, int2, output, chrom, indiv, mode, n))
}

#' @title anccall_c: Generating ancestry call along the chromosome
#'
#' @param deltaf The cut-off for minimum delta f between two reference populations
#' @param window Size of the sliding window
#' @param SMAX The number of all snp sites
#' @param anclikdir the dir to anclik file
#' @param output the dir of the output ancfreq file
anccall_hap_c <- function(deltaf, window, SMAX, anclikdir, output, chrom, indiv, mode, n, round1, round2, round3, zero_value) {
    invisible(.Call(`_rLCLAE_anccall_hap_c`, deltaf, window, SMAX, anclikdir, output, chrom, indiv, mode, n, round1, round2, round3, zero_value))
}

#' @title anccall_c_int: Generating ancestry call along the chromosome
#'
#' @param deltaf The cut-off for minimum delta f between two reference populations
#' @param window Size of the sliding window
#' @param SMAX The number of all snp sites
#' @param anclikdir the dir to anclik file
#' @param int1 output intermediate file 1 call
#' @param int2 output intermediate file 2 after 1st smoothing
#' @param output the dir of the output anccall file
anccall_c_int <- function(deltaf, window, SMAX, anclikdir, int1, int2, output, chrom, indiv, mode, n, round1, round2, round3, zero_value) {
    invisible(.Call(`_rLCLAE_anccall_c_int`, deltaf, window, SMAX, anclikdir, int1, int2, output, chrom, indiv, mode, n, round1, round2, round3, zero_value))
}

#' @title anccall_c_ori: Generating ancestry call along the chromosome
#'
#' @param deltaf The cut-off for minimum delta f between two reference populations
#' @param window Size of the sliding window
#' @param SMAX The number of all snp sites
#' @param anclikdir the dir to anclik file
#' @param output the dir of the output anccall file
anccall_c_ori <- function(deltaf, window, SMAX, anclikdir, output, chrom, indiv, mode, n) {
    invisible(.Call(`_rLCLAE_anccall_c_ori`, deltaf, window, SMAX, anclikdir, output, chrom, indiv, mode, n))
}

#' @title anccall_c: Generating ancestry call along the chromosome
#'
#' @param deltaf The cut-off for minimum delta f between two reference populations
#' @param window Size of the sliding window
#' @param SMAX The number of all snp sites
#' @param anclikdir the dir to anclik file
#' @param output the dir of the output ancfreq file
anccall_c_test <- function(deltaf, window, SMAX, anclikdir, output, chrom, indiv, mode, n) {
    invisible(.Call(`_rLCLAE_anccall_c_test`, deltaf, window, SMAX, anclikdir, output, chrom, indiv, mode, n))
}

#' @title ancfreq_c
#' @description Calculating the allele frequency in two different ancestral population
#'
#' @param n an integer, the number of individuals contain in the input
#' @param type 1 or 2, specifying diploid/haploid data.
#' @param n_pop1 number of individual for ref pop 1
#' @param n_pop2 number of individual for ref pop 2
#' @param pop1 a numeric vector of index for reference population 1, sep = ' '
#' @param pop2 a numeric vector of index for reference population 2, sep = ' '
#' @param input the dir of the input genolik file
#' @param output the dir of the output ancfreq file
ancfreq_c <- function(n, type, pop1, n_pop1, n_pop2, pop2, input, output) {
    invisible(.Call(`_rLCLAE_ancfreq_c`, n, type, pop1, n_pop1, n_pop2, pop2, input, output))
}

#' ancfreq_merge: Merging haploid & dipoid dataset
#'
#' @param hapfreq The dir to file containing ancfreq for haploid data
#' @param dipfreq The dir to file containing ancfreq for diploid data
#' @param type An integer, 0-intersection 1-keep all haploid snp 2-keep all diploid snp 3-union
#' @param outputdir The output dir
ancfreq_merge <- function(hapfreq, dipfreq, outputdir, type) {
    invisible(.Call(`_rLCLAE_ancfreq_merge`, hapfreq, dipfreq, outputdir, type))
}

#' anclik_c: Calculating the ancestral likelihood of a test individual
#'
#' @param sum an integer, the number of individuals contain in the input
#' @param type 1 or 2, specifying diploid/haploid data.
#' @param testid the individual to be estimate
#' @param genolik the dir to genolik file
#' @param ancfreq the dir to ancfreq file
#' @param output the dir of the output ancfreq file
anclik_c <- function(sum, type, testid, genolik, ancfreq, output) {
    invisible(.Call(`_rLCLAE_anclik_c`, sum, type, testid, genolik, ancfreq, output))
}

#' @title anctract_c: Generating ancestry tract from call.
#'
#' @param chrlen Length of the chromosome
#' @param excludelen length to be excluded
#' @param input input file dir
#' @param output output file dir
anctract_c <- function(chrlen, excludelen, input, output) {
    invisible(.Call(`_rLCLAE_anctract_c`, chrlen, excludelen, input, output))
}

#' filt1_dip: transforming the phred score to relative genotype likelihood
#'
#' @param n an integer, the number of individuals contain in the vcf
#' @param skip an integer, lines to skip
#' @param dur an ingerger, lines for current chromosome
#' @param input a string, the dir to cleaned vcf file
#' @param output a string, the dir to the output file
filt1_dip <- function(n, skip, dur, input, output) {
    invisible(.Call(`_rLCLAE_filt1_dip`, n, skip, dur, input, output))
}

#' filt1_hap: transforming the phred score to relative genotype likelihood
#'
#' @param n an integer, the number of individuals contain in the vcf
#' @param skip an integer, lines to skip
#' @param dur an ingerger, lines for current chromosome
#' @param input a string, the dir to cleaned vcf file
#' @param output a string, the dir to the output file
filt1_hap <- function(n, skip, dur, input, output) {
    invisible(.Call(`_rLCLAE_filt1_hap`, n, skip, dur, input, output))
}

#' GL=10^(-pl)
#'
#' @param x A single double.
glpow <- function(x) {
    .Call(`_rLCLAE_glpow`, x)
}

#' get_genolik_c: Get genolik directly from vcf
#'
#' @param input_file a string, the dir to cleaned vcf file
#' @param output_file a string, the dir to the output file
get_genolik_c <- function(input_file, output_file) {
    invisible(.Call(`_rLCLAE_get_genolik_c`, input_file, output_file))
}

#' get_genolik_extended_c: Get genolik directly from vcf
#'
#' @param input_file a string, the dir to cleaned vcf file
#' @param output_file a string, the dir to the output file
get_genolik_extended_c <- function(input_file, output_file, format_type) {
    invisible(.Call(`_rLCLAE_get_genolik_extended_c`, input_file, output_file, format_type))
}
lycium0605/rLCLAE documentation built on Aug. 28, 2024, 11:35 p.m.