This allows the user to query the FacileDataSet as if it were a wide pData data.frame of all its covariates.

# S3 method for FacileDataSet
filter_samples(
  x,
  ...,
  samples. = samples(x),
  custom_key = Sys.getenv("USER"),
  with_covariates = FALSE
)

Arguments

x

A FacileDataSet

...

NSE claused to use in dplyr::filter() expressions

Value

a sample-descriptor data.frame that includes the dataset,sample_id pairs that match the virtual filter(covaries, ...) clause executed here.

Details

This feature is only really meant to be used interactively, and with extreme caution ... programatically specifying the covariates, for instance, does not work right now.

TODO: Implement using tidyeval

See also

Examples

fds <- exampleFacileDataSet() # To identify all samples that are of "CMS3" or "CMS4" subtype( # stored in the "subtype_crc_cms" covariate: crc.34 <- filter_samples(fds, subtype_crc_cms %in% c("CMS3", "CMS4")) eav.query <- fds %>% fetch_sample_covariates(covariates = "subtype_crc_cms") %>% filter(value %in% c("CMS3", "CMS4")) %>% collect() setequal(crc.34$sample_id, eav.query$sample_id)
#> [1] TRUE
# You can keep filtering a filtered dataset crc.34.male <- filter_samples(crc.34, sex == "m")