Description Usage Arguments Details Note Examples
View source: R/knn_imputation.r
K-NN imputation adopted to LC-MS proteomics data. The main reason for missing data in LC-MS datasets is low abundance of the protein/peptides. Therefore this K-NN imputation algorithm explicitely relies on this assumption.
1 | knn_imputation(x, K = 10, show.diagnostics = F)
|
x |
MSnSet or ExpressionSet object |
K |
number of nearest neighbors |
show.diagnostics |
logical indicating if to plot the results of imputation for each feature |
The algorithm. For each row in the exprs matrix, that contain missing values, perform the following steps:
impute missing values with the lowest values in the row (feature)
find K features (with no missing values) with highest Spearman correlation
scale the K-neighbors, so that median intensity ratio is 1
impute missing values with mean value of scaled K-neighbors
The algorithm assumes that the data is not log-transformed. Thus, if the data is log-transform - exponentiate.
1 2 3 4 5 | suppressPackageStartupMessages(library("MSnbase"))
data(naset)
image(naset[1:50,])
x <- knn_imputation(naset)
image(x[1:50,])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.