The filter value, e.g., for GeneidFilter the id of the gene
for which the data should be retrieved. For character values (all
filters except SeqstartFilter and SeqendFilter) also a
character vector of values is allowed. Allowed values for
SeqstrandFilter are: "+", "-", "1" or
"-1".
For GRangeFilter this has to be a GRanges object.
condition
The condition to be used in the comparison. For character values
"=", "in" and "like" are allowed, for numeric values
(SeqstartFilter and SeqendFilter) "=",
">", ">=", "<" and "<=". Note that for
"like"value should be a SQL pattern
(e.g. "ENS%").
For GRangesFilter, "within" and "overlapping"
are allowed. See below for details.
feature
For SeqstartFilter and SeqendFilter: the chromosomal
position of which features should be used in the filter (either
"gene", "transcript" or "exon").
For GRangesFilter: the submitted value is overwritten
internally depending on the called method, i.e. calling genes
will set feature to "gene", transcripts to "tx"
and exons to "exon".
Details
EntrezidFilter
Filter results based on the NCBI Entrezgene ID of the genes.
GeneidFilter
Filter results based on Ensembl gene IDs.
GenenameFilter
Filter results based on gene names (gene symbols).
GenebiotypeFilter
Filter results based on the biotype of the genes. For a complete
list of available gene biotypes use the
listGenebiotypes method.
GRangesFilter
Allows to fetch features within or overlapping the specified genomic
region(s)/range(s). This filter takes a GRanges object as input
and, if condition="within" (the default) will restrict
results to features (genes, transcripts or exons) that are
completely within the region. Alternatively, by specifying
condition="overlapping" it will return all features that
are partially overlapping with the region, i.e. which start
coordinate is smaller than the end coordinate of the region and
which end coordinate is larger than the start coordinate of the
region. Thus, genes and transcripts that have an intron
overlapping the region will also be returned.
Note: if the specified GRanges object defines multiple
region, all features within (or overlapping) any of these regions
are returned.
See GRangesFilter for more details.
TxidFilter
Filter results based on the Ensembl transcript IDs.
TxbiotypeFilter
Filter results based on the biotype of the transcripts. For a
complete list of available transcript biotypes use the
listTxbiotypes method.
ExonidFilter
Filter based on the Ensembl exon ID.
ExonrankFilter
Filter results based on exon ranks (indices) of exons within
transcripts.
SeqnameFilter
Filter results based on the name of the sequence the features are
encoded.
SeqstrandFilter
Filter results based on the strand on which the features are encoded.
SeqstartFilter
Filter results based on the (chromosomal) start coordinate of the
features (exons, genes or transcripts).
SeqendFilter
Filter results based on the (chromosomal) end coordinates.
Value
Depending on the function called an instance of:
EntrezidFilter,
GeneidFilter,
GenenameFilter,
GenebiotypeFilter,
GRangesFilter,
TxidFilter,
TxbiotypeFilter,
ExonidFilter,
ExonrankFilter,
SeqnameFilter,
SeqstrandFilter,
SeqstartFilter,
SeqendFilter
## create a filter that could be used to retrieve all informations for
## the respective gene.
Gif <- GeneidFilter("ENSG00000012817")
Gif
## returns the where where of the SQL querys
where(Gif)
## create a filter for a chromosomal end position of a gene
Sef <- SeqendFilter(100000, condition="<", "gene")
Sef
## To find genes within a certain chromosomal position filters should be
## combined:
Ssf <- SeqstartFilter(10000, condition=">", "gene")
Snf <- SeqnameFilter("2")
## combine the filters
Filter <- list(Ssf, Sef, Snf)
Filter
## generate the where SQL call for these filters:
where(Filter)
## Create a GRangesFilter
GRangesFilter(GRanges("X", IRanges(123, 5454)))
## Create a GRangesFilter with multiple ranges
grf <- GRangesFilter(GRanges(c("X", "Y"),
IRanges(start=c(123, 900),
end=c(5454, 910))))
## Evaluate the "where" SQL where that would be applied.
where(grf)
## Change the "condition" of the filter and evaluate the
## where condition again.
condition(grf) <- "overlapping"
where(grf)
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(ensembldb)
Loading required package: BiocGenerics
Loading required package: parallel
Attaching package: 'BiocGenerics'
The following objects are masked from 'package:parallel':
clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
clusterExport, clusterMap, parApply, parCapply, parLapply,
parLapplyLB, parRapply, parSapply, parSapplyLB
The following objects are masked from 'package:stats':
IQR, mad, xtabs
The following objects are masked from 'package:base':
Filter, Find, Map, Position, Reduce, anyDuplicated, append,
as.data.frame, cbind, colnames, do.call, duplicated, eval, evalq,
get, grep, grepl, intersect, is.unsorted, lapply, lengths, mapply,
match, mget, order, paste, pmax, pmax.int, pmin, pmin.int, rank,
rbind, rownames, sapply, setdiff, sort, table, tapply, union,
unique, unsplit
Loading required package: GenomicRanges
Loading required package: S4Vectors
Loading required package: stats4
Attaching package: 'S4Vectors'
The following objects are masked from 'package:base':
colMeans, colSums, expand.grid, rowMeans, rowSums
Loading required package: IRanges
Loading required package: GenomeInfoDb
Loading required package: GenomicFeatures
Loading required package: AnnotationDbi
Loading required package: Biobase
Welcome to Bioconductor
Vignettes contain introductory material; view with
'browseVignettes()'. To cite Bioconductor, see
'citation("Biobase")', and for packages 'citation("pkgname")'.
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/ensembldb/SeqendFilter.Rd_%03d_medium.png", width=480, height=480)
> ### Name: SeqendFilter
> ### Title: Constructor functions for filter objects
> ### Aliases: EntrezidFilter GeneidFilter GenenameFilter GenebiotypeFilter
> ### TxidFilter TxbiotypeFilter ExonidFilter ExonrankFilter SeqnameFilter
> ### SeqstrandFilter SeqstartFilter SeqendFilter GRangesFilter
> ### Keywords: data
>
> ### ** Examples
>
>
> ## create a filter that could be used to retrieve all informations for
> ## the respective gene.
> Gif <- GeneidFilter("ENSG00000012817")
> Gif
| GeneidFilter
| condition: =
| value: ENSG00000012817
> ## returns the where where of the SQL querys
> where(Gif)
[1] "gene_id = 'ENSG00000012817'"
>
> ## create a filter for a chromosomal end position of a gene
> Sef <- SeqendFilter(100000, condition="<", "gene")
> Sef
| SeqendFilter
| condition: <
| value: 1e+05
>
> ## To find genes within a certain chromosomal position filters should be
> ## combined:
> Ssf <- SeqstartFilter(10000, condition=">", "gene")
> Snf <- SeqnameFilter("2")
> ## combine the filters
> Filter <- list(Ssf, Sef, Snf)
>
> Filter
[[1]]
| SeqstartFilter
| condition: >
| value: 10000
[[2]]
| SeqendFilter
| condition: <
| value: 1e+05
[[3]]
| SeqnameFilter
| condition: =
| value: 2
>
> ## generate the where SQL call for these filters:
> where(Filter)
[1] " where gene_seq_start > 10000 and gene_seq_end < 1e+05 and seq_name = '2'"
>
>
> ## Create a GRangesFilter
> GRangesFilter(GRanges("X", IRanges(123, 5454)))
| GRangesFilter
| region:
| + start: 123
| + end: 5454
| + seqname: X
| + strand: *
| condition: within
>
> ## Create a GRangesFilter with multiple ranges
> grf <- GRangesFilter(GRanges(c("X", "Y"),
+ IRanges(start=c(123, 900),
+ end=c(5454, 910))))
> ## Evaluate the "where" SQL where that would be applied.
> where(grf)
[1] "(gene_seq_start >= 123 and gene_seq_end <= 5454 and seq_name == 'X') or (gene_seq_start >= 900 and gene_seq_end <= 910 and seq_name == 'Y')"
> ## Change the "condition" of the filter and evaluate the
> ## where condition again.
> condition(grf) <- "overlapping"
> where(grf)
[1] "(gene_seq_start <= 5454 and gene_seq_end >= 123 and seq_name = 'X') or (gene_seq_start <= 910 and gene_seq_end >= 900 and seq_name = 'Y')"
>
>
>
>
>
>
> dev.off()
null device
1
>