listFilterValues: List or search the options available for a specified filter.

View source: R/utilityFunctions.R

listFilterOptionsR Documentation

List or search the options available for a specified filter.

Description

Some filters have a predefined list of values that can be used to search them. These functions give access to this list of options for a named filter, so you can check in the case where your biomaRt query is not finding anything.

Usage

    listFilterOptions(mart, filter)
    searchFilterOptions(mart, filter, pattern)

Arguments

mart

object of class Mart created using the useMart, or useEnsembl functions

filter

The name of the filter whose options should be listed or searched. You can list available filters via listFilters

pattern

Character vector defining the regular expression (regex) to be used for the search. If left blank the default is to use ".*" which will match everything.

Author(s)

Mike Smith

See Also

listFilters

Examples


if(interactive()){

    ## Use the Ensembl human genes dataset
    ensembl <- useEnsembl(biomart = "ensembl", dataset = "hsapiens_gene_ensembl")

    ## we can search for the name of a filter we're interested in e.g. 'phenotype'
    ## we need to use the name of the filter in the next function
    searchFilters(ensembl, pattern = "phenotype")
    
    ## list all the options available to the 'phenotype_source' filter
    listFilterOptions(mart = ensembl, filter = "phenotype_source")
    
    ## search the 'phenotype_description' filter for the term 'crohn'
    searchFilterOptions(mart = ensembl, 
                       filter = "phenotype_description", 
                       pattern = "crohn")
}


grimbough/biomaRt documentation built on Aug. 7, 2024, 8:56 p.m.