selective_measuring | R Documentation |
The function adjust_frm()
is used to modify existing FastRet models based on changes in chromatographic conditions. It requires a set of molecules with measured retention times on both the original and new column. This function selects a sensible subset of molecules from the original dataset for re-measurement. The selection process includes:
Generating chemical descriptors from the SMILES strings of the molecules. These are the features used by train_frm()
and adjust_frm()
.
Standardizing chemical descriptors to have zero mean and unit variance.
Training a Ridge Regression model with the standardized chemical descriptors as features and the retention times as the target variable.
Scaling the chemical descriptors by coefficients of the Ridge Regression model.
Applying PAM clustering on the entire dataset, which includes the scaled chemical descriptors and the retention times.
Returning the clustering results, which include the cluster assignments, the medoid indicators, and the raw data.
selective_measuring(raw_data, k_cluster = 25, verbose = 1)
raw_data |
The raw data to be processed. Must be a dataframe with columns NAME, RT and SMILES. |
k_cluster |
The number of clusters for PAM clustering. |
verbose |
The level of verbosity. |
A list containing the following elements:
clustering
: a data frame with raw data, cluster assignments, and medoid indicators
clobj
: the PAM clustering object
coefs
: the coefficients from the Ridge Regression model
model
: the Ridge Regression model
df
: the preprocessed data
dfz
: the standardized features
dfzb
: the features scaled by coefficients of the Ridge Regression model
x <- selective_measuring(RP[1:50, ], k = 5, verbose = 0)
# For the sake of a short runtime, only the first 50 rows of the RP dataset
# were used in this example. In practice, you should always use the entire
# dataset to find the optimal subset for re-measurement.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.