summix_calc: summix_calc

View source: R/summix.R

summix_calcR Documentation

summix_calc

Description

Helper function for estimating mixture proportions of reference groups from large (N SNPs>10,000) genetic AF data, using slsqp to solve for least square difference

Usage

summix_calc(data, reference, observed, pi.start = NA)

Arguments

data

A dataframe of the observed and reference allele frequencies for N genetic variants. See data formatting document at https://github.com/hendriau/Summix for more information.

reference

A character vector of the column names for the reference groups.

observed

A character value that is the column name for the observed group.

pi.start

Length K numeric vector of the starting guess for the reference group proportions. If not specified, this defaults to 1/K where K is the number of reference groups.

Value

data frame with the following columns

objective: least square value at solution

iterations: number of iterations for SLSQP algorithm

time: time in seconds of SLSQP algorithm

filtered: number of SNPs not used in estimation due to missing values

K columns of mixture proportions of reference groups input into the function


hendriau/Summix documentation built on April 25, 2024, 2:41 p.m.