Learn R Programming

dartR.base (version 1.0.5)

utils.vcfr2genlight.polyploid: 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 = mode)

Value

genlight object

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 [defined in function gl.read.vcf].

Author

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

Details

This function uses parameters from gl.read.vcf for conversion Note also that this function checks to see if there are input of mode, missing input of mode will issued the user with a error. "Dosage" mode of this function assign ploidy levels as maximum copy number of alternate alleles. Please carefully check the data if "dosage" mode is used. (codes were modified from 'vcfR2genlight' in vcfR packge to convert polyploid data)

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.alf(), utils.check.datatype(), utils.collapse.matrix(), utils.dart2genlight(), utils.dist.binary(), utils.flag.start(), utils.hamming(), utils.het.pop(), utils.impute, 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()

Examples

Run this code
if (FALSE) {
datatype <- utils.vcfr2genlight.polyploid(x=vcfr, mode2="genotype")
}

Run the code above in your browser using DataLab