Learn R Programming

PopPsiSeqR (version 1.0.0)

freqShifter: Frequency Shift Calculator

Description

This function accepts a GRanges object containing allele frequencies from two parental populations and an offspring population. It then polarizes each variant site and calculates how the offspring has shifted from equilibrium.

Usage

freqShifter(freqbed_in)

Value

per-site PopPsiSeq frequency shifts

Arguments

freqbed_in

in goes the file containing the grouped frequency measurements (extended bed format)

polarization of alleles

At each variant site, either the selected parent or the backcrossed parent might have the alternate allele at a higher frequency than the other (sites in which they have the same allele frequency are not informative and are assumed to have been filtered out). To regularize the data, each site was independently polarized, which is to say, the alternate and reference alleles were reassigned ad hoc to make the selected parent population have the higher frequency.

putting the offspring in context

At each site, the offspring's allele frequency is compared to the hypothetical equilibrium frequency expected by simply averaging the parents' frequencies. This is reported as the mean_oriented_shift; also reported is the distance to fixation in each direction (max_oriented_shift, min_oriented_shift), and the difference between parental allele frequencies (AF_difference)

Examples

Run this code
# \donttest{
merged_frequencies.filename <- system.file("extdata",
"merged_frequencies.example_data.tbl", package = "PopPsiSeqR")
frequencies.bg <- import.freqtbl(merged_frequencies.filename)
frequency_shifts.bg <- freqShifter(frequencies.bg)
# }

Run the code above in your browser using DataLab