Description Usage Arguments Value Note Author(s) See Also Examples
These functions provide the mechanism for retrieval and processing of variants. The assumption is that the data retrieved has essentially been limited to
variants of interest. Further filtering of text labels from the genotyping procedure is provided by information specified in the priorDbParams
class.
1 2 | get.sample.variants(sample.id.list, db.con, param.obj)
filter.variant.annots(var.dta, filter.list, var.id.col, filter.sep, collapse.col="filter", ignore.cols="variant_qual_id")
|
sample.id.list |
A list with three elements: 'recon' is the human readable name, 'ind' is the database index value and 'num.pats' is the number of samples in the database. |
db.con |
An object inherited from |
param.obj |
A |
var.dta |
A |
filter.list |
A list containing the names of the filters to be applied. Each list element should contain a vector with filter labels. |
var.id.col |
The column of var.dta uniquely identifying variants (and potentially alleles) for a given sample. |
filter.sep |
The character used to seperate filter values as specified in |
collapse.col |
The column to be collapsed if necessary, (e.g. the filter column). |
ignore.cols |
The columns redundant with the collapse.col that should be removed as well (e.g. an autoincremented DB index). NULL if none are present. |
returns a list containing two elements:
The filtered data.frame
containing the variant results.
The core or summary ID used for this function
returns a data.frame
containing the remaining elements of var.dta
after filtering
filter.variant.annots
will likely never be called directly by the user, instead it will be called according to the variantFilter
class by get.sample.variants
.
Daniel Bottomly
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | if (require(RSQLite) && require(HitWalkerData))
{
set.seed(123)
data(params)
db.con <- dbConnect("SQLite", hitwalker.db.path())
graph.obj <- loadGraph(graph.file.path(), examp.prior.param)
sample.id.list <- reconcile.sample.name("08-00102", db.con, examp.prior.param)
raw.vars <- dbGetQuery(db.con, HitWalker:::testVariantQuery(sample.id.list, examp.prior.param))
filter.values <- getFilterValues(examp.prior.param)
filt.list <- strsplit(names(filter.values)[filter.values == "SNV;INDEL"], getFilterSep(examp.prior.param))
pat.var.id <- patVarID(examp.prior.param)
filt.vars <- filter.variant.annots(var.dta=raw.vars, filter.list=filt.list, var.id.col=pat.var.id, filter.sep=";", collapse.col="filter", ignore.cols="variant_qual_id")
nrow(raw.vars)##286
nrow(filt.vars)##206
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.