Description Usage Arguments Value Examples
View source: R/fit_non_linear.R
Fit a non-linear trend (currently optimized for LOESS)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
df_feature_batch |
data frame containing response variable e.g. samples in order and explanatory variable e.g. measurement for a specific feature (peptide) in a specific batch |
measure_col |
if |
order_col |
column in |
feature_id |
the name of the feature, required for warnings |
batch_id |
the name of the batch, required for warnings |
fit_func |
function to use for the fit, e.g. |
optimize_span |
logical, whether to specify span or optimize it (specific entirely for LOESS regression) |
no_fit_imputed |
(logical) whether to fit the imputed (requant) values |
qual_col |
column to color point by certain value denoted
by |
qual_value |
value in |
min_measurements |
the absolute threshold to filter |
... |
additional parameters to be passed to the fitting function |
vector of fitted response values
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | test_peptide = example_proteome$peptide_group_label[1]
selected_peptide = example_proteome$peptide_group_label == test_peptide
df_selected = example_proteome[selected_peptide,]
selected_batch = example_sample_annotation$MS_batch == 'Batch_1'
batch_selected_df = example_sample_annotation[selected_batch,]
df_for_test = merge(df_selected, batch_selected_df, by = 'FullRunName')
fit_values = fit_nonlinear(df_for_test)
#for the case where are two many missing values, no curve is fit
selected_batch = example_sample_annotation$MS_batch == 'Batch_2'
batch_selected_df = example_sample_annotation[selected_batch,]
df_for_test = merge(df_selected, batch_selected_df, by = 'FullRunName')
fit_values = fit_nonlinear(df_for_test)
missing_values = df_for_test[['m_score']] == 2
all(fit_values[!is.na(fit_values)] == df_for_test[['Intensity']][!missing_values])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.