gbsrGDS2VCF | R Documentation |
Write out a VCF file with raw, filtered, or corrected genotype data stored in a GDS file. The output VCF file contains the GT, AD, and DP fields.
gbsrGDS2VCF(
object,
out_fn,
node = "raw",
info.export = NULL,
fmt.export = NULL,
parents = TRUE,
...
)
## S4 method for signature 'GbsrGenotypeData'
gbsrGDS2VCF(object, out_fn, node, info.export, fmt.export, parents)
object |
A GbsrGenotypeData object. |
out_fn |
A string to specify the path to an output VCF file. |
node |
Either one of "raw" or "cor" to output raw genotype data or corrected genotype data, respectively. |
info.export |
characters, the variable name(s) in the INFO node for
export; or NULL for all variables. If you specify |
fmt.export |
characters, the variable name(s) in the FORMAT node for
import; or NULL for all variables. If you specify |
parents |
A logical value to specify whether parental samples should be included in an output VCF file or not. |
... |
Unused. |
Create a VCF file at location specified by out_fn.
The connection to the GDS file of the input GbsrGenotypeData object will be
automatically closed for internal file handling in this function. Please use
reopenGDS()
to open the connection again. If you use loadGDS()
, summary
statistics and filtering information will be discarded.
The path to the VCF file.
# Load data in the GDS file and instantiate a [GbsrGenotypeData] object.
gds_fn <- system.file("extdata", "sample.gds", package = "GBScleanR")
gds <- loadGDS(gds_fn)
# Create a VCF file with data from the GDS file
# connected to the [GbsrGenotypeData] oobject.
out_fn <- tempfile("sample_out", fileext = ".vcf.gz")
# gbsrGDS2VCF(gds, out_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.