gbsrVCF2GDS | R Documentation |
This function converts a variant call data in the VCF format. The current implementation only accepts biallelic single nucleotide polymorphisms. Please filter out variants which are insertions and deletions or multiallelic. You may use "bcftools" or "vcftools" for filtering.
gbsrVCF2GDS(
vcf_fn,
out_fn,
gt = "GT",
info.import = NULL,
fmt.import = NULL,
force = FALSE,
verbose = TRUE
)
vcf_fn |
A string to indicate path to an input VCF file. |
out_fn |
A string to indicate path to an output GDS file. |
gt |
the ID for genotypic data in the FORMAT column; "GT" by default, VCFv4.0. |
info.import |
characters, the variable name(s) in the INFO field for
import; or NULL for all variables. If you specify |
fmt.import |
characters, the variable name(s) in the FORMAT field for
import; or NULL for all variables. If you specify |
force |
A logical value to overwrite a GDS file even if the file specified in "out_fn" exists. |
verbose |
if TRUE, show information. |
gbsrVCF2GDS converts a VCF file to a GDS file.
The data structure of the GDS file created via this functions is same with
those created by seqVCF2GDS()
of SeqArray
.
The output GDS file path.
# Create a GDS file from a sample VCF file.
vcf_fn <- system.file("extdata", "sample.vcf", package = "GBScleanR")
gds_fn <- tempfile("sample", fileext = ".gds")
gbsrVCF2GDS(vcf_fn = vcf_fn, out_fn = gds_fn, force = TRUE)
# Load data in the GDS file and instantiate a `GbsrGenotypeData` object.
gds <- loadGDS(gds_fn)
# Close the connection to the GDS file.
closeGDS(gds)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.