Description Usage Arguments Details Value
Calculates the coefficient of variation (CV) of each row in the supplied data table.
1 | calculate_cvs(data, max_zeros)
|
data |
A data frame, containing expression values for each gene as rows, and expression values for the cells as columns. |
max_zeros |
A double indicating the maximum proportion of zero expression values allowed per row. |
Before CV computation, the function modifies the raw data in two ways:
First, it replaces all negative values in the data frame for zeros, as negative expression values are systematic artifacts caused when genes have very low expression, and can interfere in CV calculation.
Then, it removes all rows that have a proportion of zeros above the specified threshold. These will be considered highly disrupted by systematic noise. Removing them prevents division by zero when calculating CVs, which could lead to CV = 0 and to having missing values in the correlation vectors.
The value of this argument must be 0 > max_zeros > 1.
The data provided must contain gene names as a column in the first position, as output by the
read_tsv
function in the dplyr
package, and an cell names as column names.
These names will be assigned as the rownames of the output data frame.
In the output, mean, standard deviation and CV are incorporated as new columns in the data
frame, named mean
, sd
and CV
.
A data frame, containing the filtered data and the mean, standard deviation and cv values for each row.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.