Learn R Programming

R453Plus1Toolbox (version 1.22.0)

annotateVariants: Adds genomic information to variants

Description

This method annotates given genomic variants (mutations). Annotation includes affected genes, exons and codons. Resulting amino acid changes are returned as well as dbSNP identifiers, if the mutation is already known. All information is fetched from Ensembl via biomaRt using the datasets hsapiens_gene_ensembl and hsapiens_snp.

Usage

annotateVariants(object, bsGenome)

Arguments

object
A data frame storing variants or an instance of AVASet/MapperSet or a data frame (see details).
bsGenome
An object of class BSGenome giving the genome to be used as reference sequence to calculate amino acid changes. This argument is only applicable when object is of type MapperSet. Default is ‘BSgenome.Hsapiens.UCSC.hg19’. Note that the genome should fit to the Ensembl annotation.

Value

AnnotatedVariants. Affected genes, transcripts and exon as well as known SNPs are stored in a list-like structure. See the documentation of class AnnotatedVariants-class for details.

Details

If a data frame is given, the following columns must be present:
start
genomic start position in the current Ensembl genome
end
genomic end position in the current Ensembl genome
chromosome
chromosome in ensembl notation (i.e. "1", "2", ..., "Y")
strand
"+" or "-" relative to the nucleotide bases given below
seqRef
reference sequence
seqMut
sequence of the observed variant
The rownames of the data frame are used as mutations' names (IDs). See examples for a properly defined data drame.

See Also

AnnotatedVariants-class, AVASet-class, MapperSet-class, htmlReport

Examples

Run this code
variants = data.frame(
    start=c(106157528, 106154991,106156184),
    end=c(106157528, 106154994,106156185),
    chromosome=c("4", "4", "4"),
    strand=c("+", "+", "+"),
    seqRef=c("A", "ATAG", "---"),
    seqMut=c("G", "----", "ATA"),
    seqSur=c("TACAGAA", "TTTATAGATA", "AGC---TCC"),
    stringsAsFactors=FALSE)
rownames(variants) = c("snp", "del", "ins")
## Not run: annotateVariants(variants)

Run the code above in your browser using DataLab