calculate_window_size: A function to automatically calculate a preferred window size...

View source: R/calculate_window_size.R

calculate_window_sizeR Documentation

A function to automatically calculate a preferred window size for phasing

Description

This function given the number of gametes (gametes), coverage (coverage), genotyping error rate (se), and average recombination rate (avgr), as well as the number of hetSNPs in the data, is used to automatically calculate a preferred window size for phasing. This is accomplished by using the predict function and a pre-trained beta regression model betaregmodel_20220718. The user can call this function themselves outside of rhapsodi's main steps, or the user can specify they would rather rhapsodi calculate a window size based on the input data characteristics.

Usage

calculate_window_size(ngam, cov, nsnp, ger, avgr)

Arguments

ngam

an integer; number of gametes in the dataset; this should be the number of columns in the input dataframe (excluding the positions column)

cov

a numeric; sequencing depth of coverage applicable to the data

nsnp

an integer; number of hetSNPs in the dataset; this should be the number of rows in the input dataframe (after filtering to include hetSNPs only)

ger

a numeric; genotyping error rate applicable to data

avgr

a numeric; average recombination rate

Value

window_size an integer; the preferred window size for accurate phasing given the data characteristics


mccoy-lab/rhapsodi documentation built on July 27, 2022, 3:56 a.m.