View source: R/method_adjust_confounder.R
adjust_confounder | R Documentation |
This function adjusts for confounders in the expression data of a mass_dataset
object.
The function takes a list of confounders from the sample_info
data and performs a
linear regression adjustment on the expression data for each specified confounder.
adjust_confounder(object, confounder_name_list)
object |
A |
confounder_name_list |
A character vector specifying the names of the confounders
to adjust for. These names should be columns in the |
This function performs a linear model regression for each feature in the expression data
against the specified confounders from the sample information. The residuals of the model
are used as the adjusted expression data. If any NA values are present in the confounders
or if the confounder names are not found in the sample_info
, the function will stop
and return an error.
A modified mass_dataset
object with adjusted expression data where confounders
have been accounted for.
The function will stop if confounder_name_list
is empty.
The function will stop if any of the confounder names in confounder_name_list
are not present in the sample_info
.
The function will stop if any NA values are present in the specified confounders.
## Not run:
# Assuming `mass_object` is a valid mass_dataset object and `confounders` is a vector
# of column names from the sample_info slot.
adjusted_object <- adjust_confounder(object = mass_object, confounder_name_list = confounders)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.