getCriticalN | R Documentation |
countBug counts the frequency of the most commonly identified bug in a simulated signature. getCriticalN performs a Monte Carlo simulation to estimate the number of times the most frequent taxon is expected to be observed in a list of signatures
getCriticalN(relevant.sigs, siglengths, alpha = 0.05, nsim = 1000)
relevant.sigs |
a list of signatures that form the "background" from which taxa for simulated signatures will be drawn. These are used to estimate how frequently taxa occur |
siglengths |
The sizes of signatures found in a set of related studies. Simulated signatures will match these in number and size. |
alpha |
Probability at which a critical threshold will be calculated (default: 0.05) |
nsim |
Number of simulations (default: 1000) |
E.g. for alpha = 0.05, we expect only a 5
The 1 - alpha quantile of Monte Carlo simulated values for the maximum number of times any taxon is identified.
full.dat <- bugsigdbr::importBugSigDB()
my.dat <- full.dat[full.dat$Curator == "Mst Afroza Parvin", ]
relevant.dat <- full.dat[full.dat$`Body site` %in% my.dat$`Body site`, ]
relevant.sigs <- bugsigdbr::getSignatures(my.dat)
my.sigs.increased <- relevant.sigs[grep("UP", names(relevant.sigs))]
(my.siglengths <- sapply(my.sigs.increased, length))
getCriticalN(relevant.sigs, my.siglengths)
# Compare to observed
frequencySigs(my.sigs.increased)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.