get_cumulative_frequencies: obtain cumulative allele frequency of rare lof and functional...

Description Usage Arguments Value Examples

View source: R/cumulative_frequency.R

Description

obtain cumulative allele frequency of rare lof and functional variants

Usage

1
get_cumulative_frequencies(vars, threshold = 0.01)

Arguments

vars

dataframe of variants (one row per allele), which includes the number of times that allele was observed within the population, as well as the total number of alleles in the population. Alternatively, this can be a list of dataframe, each for a different population

threshold

minor allele frequency (MAF) threshold, we exclude variants with MAF values above or equal to this threshold. This needs to be matched to the thresh9old used during identification of the biallelically inherited genotypes.

Value

a list of loss of function cumulative frequency, functional cumulative frequency and synonymous cumulative frequency. Alternatively, if the function was prvoided with a list of dataframe, return a list of frequency lists, named as per the input list.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
vars = read.table(header = TRUE, text = "
    CHROM  POS  REF  ALT  AC  AN    CQ
    1      1    A    G    1   1000  missense_variant
    1      2    G    C    1   1000  stop_gained
    1      3    T    A    1   1000  stop_lost
    1      4    G    T    1   1000  synonymous_variant")
get_cumulative_frequencies(vars)

vars2 = read.table(header = TRUE, text = "
    CHROM  POS  REF  ALT  AC  AN    CQ
    1      1    A    G    1   1000  missense_variant
    1      2    G    C    1   1000  stop_gained
    1      3    T    A    1   1000  stop_lost
    1      4    G    T    1   1000  synonymous_variant")
var_list = list("first"=vars, "second"=vars2)
get_cumulative_frequencies(var_list)

threshold = 0.005
get_cumulative_frequencies(var_list, threshold)

jeremymcrae/recessiveStats documentation built on May 19, 2019, 5:08 a.m.