R/NSE-filter-samples.R
filter_samples.FacileDataSet.Rd
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 )
x | A |
---|---|
... | NSE claused to use in |
a sample-descriptor data.frame
that includes the dataset,sample_id
pairs that match the virtual filter(covaries, ...)
clause executed here.
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
Other API:
fetch_assay_score.FacileDataSet()
,
fetch_custom_sample_covariates.FacileDataSet()
,
fetch_sample_covariates()
,
fetch_sample_statistics.FacileDataSet()
,
fetch_samples.FacileDataSet()
,
filter_features.FacileDataSet()
,
organism.FacileDataSet()
,
samples.FacileDataSet()
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")