Learn R Programming

GenomicDataCommons (version 1.3.4)

filtering: Manipulating GDCQuery filters

Description

Manipulating GDCQuery filters

The filter is simply a safe accessor for the filter element in GDCQuery objects.

The get_filter is simply a safe accessor for the filter element in GDCQuery objects.

Usage

filter(x, expr)

# S3 method for GDCQuery filter(x, expr)

get_filter(x)

# S3 method for GDCQuery get_filter(x)

Arguments

x

the object on which to set the filter list member

expr

a filter expression in the form of the right hand side of a formula, where bare names (without quotes) are allowed if they are available fields associated with the GDCQuery object, x

Value

A GDCQuery object with the filter field replaced by specified filter expression

Examples

Run this code
# NOT RUN {
# make a GDCQuery object to start
#
# Projects
#
pQuery = projects()

# check for the default fields
# so that we can use one of them to build a filter
default_fields(pQuery)
pQuery = filter(pQuery,~ project_id == 'TCGA-LUAC')
get_filter(pQuery)

#
# Files
#
fQuery = files()
default_fields(fQuery)

fQuery = filter(fQuery,~ data_format == 'VCF')
get_filter(fQuery)

fQuery = filter(fQuery,~ data_format == 'VCF'
                & experimental_strategy == 'WXS'
                & type == 'simple_somatic_mutation')

# Use str() to get a cleaner picture
str(get_filter(fQuery))
# }

Run the code above in your browser using DataLab