variantsInSamples-methods | R Documentation |
Identifies variants observed (uniquely) in at least one sample of a given group.
## 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
VCF
and TVTBparam
.
# 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.