imputedDosage {SeqVarTools} | R Documentation |
Get matrix of imputed dosage values from a GDS object
## S4 method for signature 'SeqVarGDSClass' imputedDosage(gdsobj, dosage.field="DS", use.names=TRUE)
gdsobj |
A |
dosage.field |
The name of the dosage field in the GDS object (will be prepended with |
use.names |
A logical indicating whether to assign sample and variant IDs as dimnames of the resulting matrix. |
Reads dosage from the dosage-specific field in the GDS object, rather than counting alleles from called genotypes.
Only one dosage value per variant is allowed; the method will return an error if multiple dosages are present for a single variant.
A numeric matrix of dosage values with dimensions [sample,variant].
Stephanie Gogarten
# convert VCF to GDS keeping dosage field vcffile <- system.file("extdata", "gl_chr1.vcf", package="SeqVarTools") gdsfile <- tempfile() seqVCF2GDS(vcffile, gdsfile, fmt.import="DS", storage.option="ZIP_RA", verbose=FALSE) gds <- seqOpen(gdsfile) dos <- imputedDosage(gds) head(dos) seqClose(gds) unlink(gdsfile)