pre_pipeline_data_check: Pre-flight checks

Description Usage Arguments

View source: R/check_data_pre_pipeline.R

Description

Check datasets and print pre-run statistics prior to deployment.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
pre_pipeline_data_check(
  dependent_variables,
  independent_variables,
  primary_variable,
  constant_adjusters = NULL,
  fdr_method = "BY",
  fdr_cutoff = 0.05,
  max_vibration_num = 10000,
  max_vars_in_model = 20,
  proportion_cutoff = 1,
  meta_analysis = FALSE,
  model_type = "glm",
  family = gaussian(),
  ids = NULL,
  strata = NULL,
  weights = NULL,
  nest = NULL
)

Arguments

dependent_variables

A tibble containing the information for your dependent variables (e.g. bacteria relative abundance, age). The columns should correspond to different variables, and the rows should correspond to different units, such as individuals (e.g. individual1, individual2, etc). If passing multiple datasets, pass a named list of the same length and in the same order as the independent_variables parameter. If running from the command line, pass the path (or comma separated paths) to .rds files containing the data, one per dataset.

independent_variables

A tibble containing the information for your independent variables (e.g. bacteria relative abundance, age). The columns should correspond to different variables, and the rows should correspond to different units, (e.g. individual1, individual2, etc). If passing multiple datasets, pass a named list of the same length and in the same order as the dependent_variables parameter. If running from the command line, pass the path (or comma separated paths) to .rds files containing the data, one per dataset.

primary_variable

The column name from the independent_variables tibble containing the key variable you want to associate with disease in your first round of modeling (prior to vibration). For example, if you are interested fundamentally identifying how well age can predict height, you would make this value a string referring to whatever column in said dataframe refers to "age."

constant_adjusters

A character vector (or just one string) corresponding to column names in your dataset to include in every vibration. (default = NULL)

fdr_method

Your choice of method for adjusting p-values. Options are BY (default), BH, or bonferroni. Adjustment is computed for all initial, single variable, associations across all dependent features.

fdr_cutoff

Cutoff for an FDR significant association. All features with adjusted p-values initially under this value will be selected for vibrations. (default = 0.05). Setting a stringent FDR cutoff is mostly relevant when you are using a large number of dependent variables (eg >50) and want to filter those with weak initial associations.

max_vibration_num

Maximum number of vibrations allowed for a single dependent variable. Setting this will also reduce runtime by reducing the number of models fit. (default = 10,000)

max_vars_in_model

Maximum number of variables allowed in a single fit in vibrations. In case an individual has many hundreds of metadata features, this prevents models from being fit with excessive numbers of variables. Modifying this parameter will change runtime for large datasets. For example, just computing all possible models for 100 variables is extremely slow. (default = 20)

proportion_cutoff

Float between 0 and 1. Filter out dependent features that are this proportion of zeros or more (default = 1, so no filtering will be done.)

meta_analysis

TRUE/FALSE – indicates if computing meta-analysis across multiple datasets. Set to TRUE by default if the pipeline detects multiple datasets. Setting this variable to TRUE but providing one dataset will throw an error.

model_type

Specifies regression type – "glm", "survey", or "negative_binomial". Survey regression will require additional parameters (at least weight, nest, strata, and ids). Any model family (e.g. gaussian()), or any other parameter can be passed as the family argument to this function.

family

GLM family (default = gaussian()). For help see help(glm) or help(family).

ids

Name of column in dataframe specifying cluster ids from largest level to smallest level. Only relevant for survey data. (Default = NULL).

strata

Name of column in dataframe with strata. Relevant for survey data. (Default = NULL).

weights

Name of column containing sampling weights.

nest

If TRUE, relabel cluster ids to enforce nesting within strata.


chiragjp/quantvoe documentation built on Oct. 11, 2021, 1:46 a.m.