CalcFreqGt: A function to count occurences of genotypes in a genotype...

Description Usage Arguments Value See Also Examples

Description

A function to count occurences of genotypes in a genotype matrix.

Usage

1
2
3
CalcFreqGt(gt, genotypic = TRUE, allelic = FALSE, absolute = TRUE,
  percentage = FALSE, totals = TRUE, backup.path = NULL,
  min.freq.gt = NULL, min.freq.al = NULL)

Arguments

gt

The genotype matrix to analyse

genotypic

If TRUE (default), include frequencies of genotypes in the result

allelic

If TRUE, include frequencies of alles in the result, default set to FALSE

absolute

If TRUE (default), occurences will be shown instead of relative frequencies

percentage

If TRUE and absolute is FALSE, show the relative frequencies in percentage. Default is FALSE.

totals

If TRUE (default), returned vector will include totals.

backup.path

Optional. Path to the CSV backup file the result must be saved to.

min.freq.gt

Optional. Minimal value of relative frequency for each genotype in a variant of gt. Variants which does not fulfill this condition will be omitted. Default is NULL (disabled).

min.freq.al

Optional. Minimal value of relative frequency for each allele in a variant of gt. Variants which does not fulfill this condition will be omitted. Default is NULL (disabled).

Value

A data frame of frequencies. Each row is a variant and each column is a calculated frequency. Column names depend on provided parameters. Typical column names would be "count_gt_HomoREF" (absolute frequency of homo REF genotype) or "freq_al_ALT" (relative frequency of ALT alleles). Column names ending with "MissVal" concern samples with missing values for this variant. Column names ending with "Total" concern all samples for this variant, including the ones with missing data.

See Also

CalcFreqVariant which this function bind

Examples

1
2
3
4
5
6
7
8
## Not run: 
CalcFreqGt(genotype)
CalcFreqGt(genotype, genotypic = FALSE, allelic = TRUE)
CalcFreqGt(genotype, absolute = FALSE, percentage = TRUE)
CalcFreqGt(genotype, backup.path = "example.csv")
CalcFreqGt(genotype, totals= FALSE, min.freq.al = 0.15)

## End(Not run)

laurentlab-mpipz/rsurvival documentation built on May 29, 2019, 9:14 a.m.