Calculates delta (\(\Delta\)) and delta prime (\(\Delta'\)), the fraction of amplicon frequencies and amplicons, respectively, with a false discovery rate below a certain threshold \(\theta\) as a measure of discordance between two amplicon data sets A and B.
discordance.delta(x, names = NULL, theta = 0.05, corrected = TRUE,
printToTex = FALSE, directory = NULL, file.name = NULL)
A list of amplicon duo data frames as returned by the ampliconduo
function.
Optional. Vector or list of characters specifying the sample/amplicon pair names. By default
names are taken from the element names of x
.
Optional. Numeric, threshold for the false discovery rate. Default value is 0.05.
Optional. Logical, indicates whether the p-value from Fisher's exact test (FALSE) or the adjusted p-value (TRUE), here called q, is used for calculation of \(\Delta\) and \(\Delta'\).
Optional. Logical, if TRUE
writes a file with the resulting table in Tex format. Default is FALSE
.
Optional. If printToTex
is TRUE
, the output file will be saved in the specified directory.
Optional. If printToTex
is TRUE
, the output file will have the name file.name
.
Data frame with three columns. The first column contains the sample/amplicon pair names. Second and third column harbor the corresponding \(\Delta\) and \(\Delta'\) values, respectively.
Calculates \(\Delta\) and \(\Delta'\), the fraction of frequencies of amplicons and amplicons, respectively, with false discovery rate below a certain threshold \(\theta\) as a measure of discordance between two amplicon data sets A and B with occurence \(r_{(iAS)}\) of amplicon i in amplicon set A of sample S (the ampliconduo data frame). \(\Delta\) and \(\Delta'\) are defined as follows:
$$ \Delta_{S\theta} = \frac{\sum_{i=1}^{n_S}(r_{iAS}+r_{iBS})\delta(q_{iS}<\theta)}{\sum_{i=1}^{n_S}(r_{iAS}+r_{iBS})}\\ $$
$$ \Delta'_{S\theta} = \frac{\sum_{i=1}^{n_S}\delta(q_{iS}<\theta)}{n_S},\\ $$
$$ \mathrm{with\;} \delta(q_{iS}<\theta) = \left\{ \begin{array}{cc} 1 & \mathrm{\;for\;} q_{iS} < \theta\\ 0 & \mathrm{\;for\;} q_{iS} \ge \theta \end{array} \right. $$
for number \(n_S\) of amplicons detected in sample/ampliconduo S. \(\Delta_{S\theta}\) and \(\Delta'_{S\theta}\) are located between 0 (no discordance, i.e. no statistically significant deviations between experimental branches) and 1 (complete discordance).
x
is the return value of a ampliconduo
call.
ampliconduo
, generates the expected data format for x
xtable
, used to convert the returned data frame into a Latex
table.
# NOT RUN {
## load example ampliconduo data frame
data(amplicons)
## calculate the discordance between amplicon data sets of an ampliconduo data frame
dd.a <- discordance.delta(amplicons)
dd.b <- discordance.delta(amplicons, theta = 0.1)
# }
Run the code above in your browser using DataLab