View source: R/calculate_difference.R
calculate_difference | R Documentation |
Calculate splicing diversity changes between two conditions.
calculate_difference( x, samples, control, method = "mean", test = "wilcoxon", randomizations = 100, pcorr = "BH", assayno = 1, verbose = FALSE, ... )
x |
A |
samples |
A vector of length one, specifying the column name of the
|
control |
Name of the control sample category, defined in the
|
method |
Method to use for calculating the average splicing diversity
value in a condition. Can be |
test |
Method to use for p-value calculation: use |
randomizations |
Number of random shuffles, used for the label shuffling test (default = 100). |
pcorr |
P-value correction method applied to the Wilcoxon rank sum test
or label shuffling test results, as defined in the |
assayno |
An integer value. In case of multiple assays in a
|
verbose |
If |
... |
Further arguments to be passed on for other methods. |
The function calculates diversity changes between two sample
conditions. It uses the output of the diversity calculation function, which
is a SummarizedExperiment
object of splicing diversity values.
Additionally, it can use a data.frame
as input, where the first column
contains gene names, and all additional columns contain splicing diversity
values for each sample. A vector of sample conditions also serves as input,
used for aggregating the samples by condition.
It calculates the mean or median of the splicing diversity data per sample condition, the difference of these values and the log2 fold change of the two conditions. Furthermore, the user can select a statistical method to calculate the significance of the changes. The p-values and adjusted p-values are calculated using a Wilcoxon sum rank test or label shuffling test.
The function will exclude genes of low sample size from the significance calculation, depending on which statistical test is applied.
A data.frame
with the mean or median values of splicing
diversity across sample categories and all samples, log2(fold change) of
the two different conditions, raw and corrected p-values.
# data.frame with splicing diversity values x <- data.frame(Genes = letters[seq_len(10)], matrix(runif(80), ncol = 8)) # sample categories samples <- c(rep('Healthy', 4), rep('Pathogenic', 4)) # To calculate the difference of splicing diversity changes between the # 'Healthy' and 'Pathogenic' condition together with the significance values, # using mean and Wilcoxon rank sum test, use: calculate_difference(x, samples, control = 'Healthy', method = 'mean', test = 'wilcoxon')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.