Description Usage Arguments Value Warning Author(s) See Also Examples
Identifies variants observed (uniquely) in at least one sample of a given group.
1 2 3 | ## S4 method for signature 'ExpandedVCF'
variantsInSamples(
vcf, samples = 1:ncol(vcf), unique = FALSE)
|
vcf |
|
samples |
|
unique |
If |
An named integer
vector of indices indicating the name and index of
variants that are (uniquely) observed in at least one non-reference genotype
in the given group of samples.
A warning
message is issued if genotypes are not fully defined in the
TVTBparam
.
Kevin Rue-Albrecht
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | # Example data ----
# VCF file
vcfFile <- system.file("extdata", "moderate.vcf", package = "TVTB")
# Phenotype file
phenoFile <- system.file("extdata", "moderate_pheno.txt", package = "TVTB")
phenotypes <- S4Vectors::DataFrame(
read.table(file = phenoFile, header = TRUE, row.names = 1))
# TVTB parameters
tparam <- TVTBparam(Genotypes("0|0", c("0|1", "1|0"), "1|1"))
# Pre-process variants
vcf <- VariantAnnotation::readVcf(
vcfFile, param = tparam, colData = phenotypes)
vcf <- VariantAnnotation::expand(vcf, row.names = TRUE)
# Example usage ----
variantsInSamples(
vcf,
which(SummarizedExperiment::colData(vcf)[,"super_pop"] == "EUR"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.