impute | R Documentation |
impute
is calculating imputation values for missing data depending on the selected
method.
impute(
data,
sample,
grouping,
intensity_log2,
condition,
comparison = comparison,
missingness = missingness,
noise = NULL,
method = "ludovic",
skip_log2_transform_error = FALSE,
retain_columns = NULL
)
data |
a data frame that is ideally the output from the |
sample |
a character column in the |
grouping |
a character column in the |
intensity_log2 |
a numeric column in the |
condition |
a character or numeric column in the |
comparison |
a character column in the |
missingness |
a character column in the |
noise |
a numeric column in the |
method |
a character value that specifies the method to be used for imputation. For
|
skip_log2_transform_error |
a logical value that determines if a check is performed to validate that input values are log2 transformed. If input values are > 40 the test is failed and an error is returned. |
retain_columns |
a vector that indicates columns that should be retained from the input
data frame. Default is not retaining additional columns |
A data frame that contains an imputed_intensity
and imputed
column in
addition to the required input columns. The imputed
column indicates if a value was
imputed. The imputed_intensity
column contains imputed intensity values for previously
missing intensities.
set.seed(123) # Makes example reproducible
# Create example data
data <- create_synthetic_data(
n_proteins = 10,
frac_change = 0.5,
n_replicates = 4,
n_conditions = 2,
method = "effect_random",
additional_metadata = FALSE
)
head(data, n = 24)
# Assign missingness information
data_missing <- assign_missingness(
data,
sample = sample,
condition = condition,
grouping = peptide,
intensity = peptide_intensity_missing,
ref_condition = "all",
retain_columns = c(protein, peptide_intensity)
)
head(data_missing, n = 24)
# Perform imputation
data_imputed <- impute(
data_missing,
sample = sample,
grouping = peptide,
intensity_log2 = peptide_intensity_missing,
condition = condition,
comparison = comparison,
missingness = missingness,
method = "ludovic",
retain_columns = c(protein, peptide_intensity)
)
head(data_imputed, n = 24)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.