uploadAnno.Rd
Function to upload variant annotation data into gdb. Assignment of VAR_id is performed automatically through mapping to the var table, but can be skipped using the skipRemap option. Indexing of the imported table based on VAR_id is also automated but can also be skipped, this could be desirable if it is intended to concatenate many separately generated gdb as otherwise intermediate indexes are generated unecessarily.
uploadAnno(
object,
name,
value,
sep = "\t",
skipRemap = FALSE,
skipIndexes = FALSE,
ignoreAlleles = FALSE,
keepUnmapped = FALSE,
mapRef = "var",
verbose = TRUE
)
A gdb
object.
Name to assign to annotation table.
Input variant annotation table. Can be a data frame object or a path to a text file.
Field delimiter (only used if value is a text file). Defaults to \\t
.
Flag indicating whether to skip mapping of records to VAR_id using CHROM,POS,REF,ALT. Defaults to FALSE
.
Flag indicating whether to skip indexing of imported table. Defaults to FALSE
.
Flag indicating whether to consider REF and ALT allele during mapping of records to VAR_id or just CHROM,POS. Defaults to FALSE
.
Flag indicating whether to keep records which cannot be mapped to the gdb. Defaults to FALSE
.
Name of lookup table for VAR_id assignment. Defaults to "var".
Should the method be verbose? Defaults to TRUE
.
library(rvatData)
gdb <- create_example_gdb()
# from data.frame
varinfo <- read.table(rvat_example("rvatData.varinfo"), header = TRUE)
uploadAnno(object = gdb, name = "varInfo", value = varinfo)
#> Loading table 'varInfo' from interactive R session'
#> 17 fields detected (CHROM,POS,ID,REF,ALT,QUAL,FILTER,AC,AN,AF,gene_name,HighImpact,ModerateImpact,Synonymous,CADDphred,PolyPhen,SIFT)
#> [1] 1
# similarly, an annotation table can be imported directly from file
filepath <- rvat_example("rvatData.varinfo")
uploadAnno(object = gdb, name = "varInfo2", value = filepath)
#> Loading table 'varInfo2' from '/Users/phop2/Library/R/x86_64/4.4/library/rvatData/extdata/rvatData.varinfo'
#> 17 fields detected (CHROM,POS,ID,REF,ALT,QUAL,FILTER,AC,AN,AF,gene_name,HighImpact,ModerateImpact,Synonymous,CADDphred,PolyPhen,SIFT)
#> [1] 1
# if the annotation table already includes a 'VAR_id' field
# the `skipRemap` parameter can be set to TRUE to skip mapping based on
# CHROM,POS,REF,ALT.
anno <- mapVariants(gdb,
ranges = data.frame(CHROM = "chr21", start = 31659666, end = 31668931, gene_name = "SOD1"),
verbose = FALSE)
uploadAnno(object = gdb, name = "gene", value = anno, skipRemap = TRUE)
#> Loading table 'gene' from interactive R session'
#> 2 fields detected (VAR_id,gene_name)
#> [1] 1