genotypeStrings: Enumerate Strings for Representing All Genotypes in GT Field

Description Usage Arguments Value Author(s) See Also Examples

View source: R/utilities.R

Description

For any given ploidy and number of alleles, the VCF specification indicates the order in which genotypes should be listed in the GP, GL, and PL fields. This functions generates strings representing genotypes in that order, formatted for the GT field of a VCF.

Usage

1
genotypeStrings(ploidy, n_alleles, sep = "/")

Arguments

ploidy

An integer indicating the ploidy.

n_alleles

An integer indicating the number of alleles, including the reference allele.

sep

A character for separating alleles within genotype strings.

Value

Using the default sep value, a character vector containing unphased genotypes formatted for the GT field in a VCF file, in the order indicated in the VCF specification for the GL field.

Author(s)

Lindsay V. Clark

See Also

enumerateGenotypes

Examples

1
2
3
4
5
# diploid with one reference and one alternative allele
genotypeStrings(2, 2)

# tetraploid with one reference and two alternative alleles 
genotypeStrings(4, 3)

ploidyverse/ploidyverseClasses documentation built on May 25, 2019, 2:21 p.m.