Generate perturbated expression from the original expression based on k-NN (k-nearest neighbor) data.

perturbate_knn(expression, strength = 1)

Arguments

expression

The original expression. The rows and columns correspond to samples and features. The expression is normalized count of features.

strength

How much perturbated. 0.0 is weak. 1.0 is strong.

Value

A perturbated expression as a matrix. The matrix's expression values are perturbated from the original expression values. The shape of the matrix is the same as the original expression. The dimension names of the matrix are also the same as the original expression.

Note

This is an API for advanced users. This API may be changed.