utils.vcfr2genlight.polyploid: Utility function to convert polyploid vcfR object as genlight

View source: R/utils.vcfr2genlight.polyploid.R

utils.vcfr2genlight.polyploidR Documentation

Utility function to convert polyploid vcfR object as genlight

Description

WARNING: UTILITY SCRIPTS ARE FOR INTERNAL USE ONLY AND SHOULD NOT BE USED BY END USERS AS THEIR USE OUT OF CONTEXT COULD LEAD TO UNPREDICTABLE OUTCOMES.

Usage

utils.vcfr2genlight.polyploid(x, n.cores = 1, mode2 = "genotype")

Arguments

x

Name of the vcfR object [defined in function gl.read.vcf].

n.cores

Number of cores [default 1]

mode2

genotype: all heterozygous sites will be coded as 1 regardless ploidy level, dosage: sites will be codes as copy number of alternate allele [default 'genotype'].

Details

This function uses parameters from gl.read.vcf for conversion The ploidy of each individual is derived from the allele count (arity) of its genotype calls. Half-missing calls (e.g. 0/., ./1) are treated as missing data (NA) in both modes. Please carefully check the data if "dosage" mode is used. (codes were modified from 'vcfR2genlight' in vcfR packge to convert polyploid data)

Value

genlight object

Author(s)

Custodian: Ching Ching Lau – Post to https://groups.google.com/d/forum/dartr

References

  • Knaus, B. J., & Grunwald, N. J. (2017). vcfr: a package to manipulate and visualize variant call format data in R. Molecular ecology resources, 17(1), 44-53.

  • Knaus, B. J., Grunwald, N. J., Anderson, E. C., Winter, D. J., Kamvar, Z. N., & Tabima, J. F. (2023). Package 'vcfR'. vcfR

See Also

Other utilities: gl.He(), gl.Ho(), gl.alf(), utils.allelic.richness(), utils.basic.stats(), utils.check.datatype(), utils.collapse.matrix(), utils.dart2genlight(), utils.dist.binary(), utils.fbm.amat(), utils.fbm.blocks(), utils.fbm.colblocks(), utils.fbm.colwise(), utils.fbm.copy(), utils.fbm.count.mean(), utils.fbm.decode(), utils.fbm.grm(), utils.fbm.has(), utils.fbm.new(), utils.fbm.pair.counts(), utils.fbm.reader(), utils.fbm.rowwise(), utils.fbm.tempfile(), utils.flag.start(), utils.het.pop(), utils.history.call(), utils.is.fixed(), utils.jackknife(), utils.n.var.invariant(), utils.plot.save(), utils.read.fasta(), utils.read.ped(), utils.recalc.avgpic(), utils.recalc.callrate(), utils.recalc.freqhets(), utils.recalc.freqhomref(), utils.recalc.freqhomsnp(), utils.recalc.maf(), utils.reset.flags(), utils.transpose(), utils.vcf.depth()

Examples

## Not run: 
datatype <- utils.vcfr2genlight.polyploid(x=vcfr, mode2="genotype")

## End(Not run)

dartR.base documentation built on Nov. 18, 2026, 9:06 a.m.