Mega2VCF | R Documentation |
Generate a VCF file from the specified Mega2 SQLite database. The file is named "prefix".vcf If the markers argument is.null(), the entire envir$markers set is used, otherwise markers argument MUST be rows of the markers (envir$markers) data frame. In addition, several other files are generated to hold additional database information: "prefix".fam, "prefix".freq, "prefix".map, "prefix".phe, and "prefix".pen, which contain the pedigree, allele frequency, marker genetic and physical map position, member phenotype and phenotype penetrance data.
Mega2VCF(
prefix,
markers = NULL,
mapno = 0,
alleleOrder = "default",
envir = ENV
)
prefix |
prefix of output files including the VCF file (see Description section above). This prefix can include a path. |
markers |
markers selected to be in the VCF output file |
mapno |
specify which map index to use for genetic distances. The function |
alleleOrder |
how to order alleles in VCF file. 'default' is Mega2order, 'minor' is minor allele freq first, 'major' is major allele freq first, and 'name' is ascending ascii character order of allele name. |
envir |
'environment' containing SQLite database and other globals |
None
This code in this package illustrates how to extract the various kinds of data in the Mega2 data frames to use for further processing. Some of the data internal representations are a bit quirky but the code "explains" it all.
db = system.file("exdata", "seqsimm.db", package="Mega2R")
ENV = read.Mega2DB(db)
vcfdir = file.path(where_mega2rtutorial_data(), "vcfr")
if (!dir.exists(vcfdir)) dir.create(vcfdir)
vcffile = file.path(where_mega2rtutorial_data(), "vcfr", "vcf.01")
Mega2VCF(vcffile, ENV$markers[ENV$markers$chromosome == 1, ][1:10,], envir = ENV)
list.files(vcfdir)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.