sample-covariates: Appends covariate columns to a query result

fetch_sample_covariatesR Documentation

Appends covariate columns to a query result

Description

Note that this function will force the collection of x

Usage

fetch_sample_covariates(
  x,
  covariates = NULL,
  samples = NULL,
  custom_key = Sys.getenv("USER"),
  with_source = FALSE,
  ...
)

with_sample_covariates(
  x,
  covariates = NULL,
  na.rm = FALSE,
  custom_key = Sys.getenv("USER"),
  .fds = NULL,
  ...
)

## S3 method for class 'FacileDataSet'
fetch_sample_covariates(
  x,
  covariates = NULL,
  samples = NULL,
  custom_key = Sys.getenv("USER"),
  with_source = FALSE,
  ...
)

## S3 method for class 'facile_frame'
fetch_sample_covariates(
  x,
  covariates = NULL,
  samples = NULL,
  custom_key = Sys.getenv("USER"),
  with_source = FALSE,
  ...
)

Arguments

x

a FacileDataSet connection

covariates

character vector of covariate names

samples

a samples descriptor tbl_*

custom_key

The key to use to fetch more custom annotations over the given samples

na.rm

if TRUE, filters outgoing result such that only rows with nonNA values for the covariates specified here will be returned. Default: FALSE. Note that this will not check columns not specified in covariates for NA-ness.

.fds

A FacileDataSet object

Value

The facile x object, annotated with the specified covariates.

rows from the sample_covariate table

See Also

Other FacileInterface: facet_frame.FacileDataSet(), fetch_assay_score(), fetch_sample_statistics(), samples()

Other API: fetch_assay_score.FacileDataSet(), fetch_custom_sample_covariates.FacileDataSet(), fetch_sample_statistics.FacileDataSet(), fetch_samples.FacileDataSet(), filter_features.FacileDataSet(), filter_samples.FacileDataSet(), organism.FacileDataSet(), samples.FacileDataSet()

Other FacileInterface: facet_frame.FacileDataSet(), fetch_assay_score(), fetch_sample_statistics(), samples()

Other API: fetch_assay_score.FacileDataSet(), fetch_custom_sample_covariates.FacileDataSet(), fetch_sample_statistics.FacileDataSet(), fetch_samples.FacileDataSet(), filter_features.FacileDataSet(), filter_samples.FacileDataSet(), organism.FacileDataSet(), samples.FacileDataSet()

Other API: fetch_assay_score.FacileDataSet(), fetch_custom_sample_covariates.FacileDataSet(), fetch_sample_statistics.FacileDataSet(), fetch_samples.FacileDataSet(), filter_features.FacileDataSet(), filter_samples.FacileDataSet(), organism.FacileDataSet(), samples.FacileDataSet()

Examples

# Retrieves a long EAV table of covariates
long_covs <- an_fds() |> 
  fetch_sample_covariates(c("cell_abbrev", "sex", "condition"))
lc2 <- some_samples() |> 
  fetch_sample_covariates(c("cell_abbrev", "sex", "condition"))
wide_covs <- some_samples() |> 
  with_sample_covariates(c("cell_abbrev", "sex", "condition"))

facilebio/FacileData documentation built on Feb. 23, 2024, 9:14 a.m.