Apply a modified noisyR counts pipeline printing a plot
Source:R/preprocessExpressionMatrix.R
noisyr_counts_with_plot.Rd
This function is identical to the noisyr::noisyr_counts function, with the addition of the option to print a line plot of the similarity against expression for all samples.
Usage
noisyr_counts_with_plot(
expression.matrix,
n.elements.per.window = NULL,
optimise.window.length.logical = FALSE,
similarity.threshold = 0.25,
method.chosen = "Boxplot-IQR",
...,
output.plot = FALSE
)
Arguments
- expression.matrix
the expression matrix; rows correspond to genes and columns correspond to samples
- n.elements.per.window
number of elements to have in a window passed to calculate_expression_similarity_counts(); default 10% of the number of rows
- optimise.window.length.logical
whether to call optimise_window_length to try and optimise the value of n.elements.per.window
- similarity.threshold, method.chosen
parameters passed on to
calculate_noise_threshold
; they can be single values or vectors; if they are vectors optimal values are computed by callingcalculate_noise_threshold_method_statistics
and minimising the coefficient of variation across samples; all possible values for method.chosen can be viewed byget_methods_calculate_noise_threshold
- ...
optional arguments passed on to
noisyr::noisyr_counts()
- output.plot
whether to create an expression-similarity plot for the noise analysis (printed to the console); default is FALSE
Examples
expression.matrix <- as.matrix(read.csv(
system.file("extdata", "expression_matrix.csv", package = "bulkAnalyseR"),
row.names = 1
))[1:10, 1:4]
expression.matrix.denoised <- noisyr_counts_with_plot(expression.matrix)
#> >>> noisyR counts approach pipeline <<<
#> The input matrix has 10 rows and 4 cols
#> number of genes: 10
#> number of samples: 4
#> Calculating the number of elements per window
#> the number of elements per window is 1
#> the step size is 1
#> the selected similarity metric is correlation_pearson
#> Working with sample 1
#> Working with sample 2
#> Working with sample 3
#> Working with sample 4
#> Similarity calculation produced too many NAs, returning zero...
#> Denoising expression matrix...
#> removing noisy genes
#> adjusting matrix
#> >>> Done! <<<