context('html_translate_significance_thresholds')
test_that('FDR thresholds',{
res = html_translate_significance_thresholds(fc = 2.5,
fc_dir = 'positive',
sig_type = 'fdr',
fdr_thresh = 0.1,
pval_thresh = 0.05)
expect_equal(res$sig, list(sig = "FDR≤0.1", insig = "FDR>0.1", sig_type = 'FDR', sig_value = 0.1))
expect_equal(res$fc, list(sig = "log<sub>2</sub>FC≥ 2.5", insig = "log<sub>2</sub>FC< 2.5"))
})
test_that('p-value thresholds',{
res = html_translate_significance_thresholds(fc = 2.5,
fc_dir = 'positive',
sig_type = 'pvalue',
fdr_thresh = 0.1,
pval_thresh = 0.05)
expect_equal(res$sig, list(sig = "<i>P</i>-value≤0.05", insig = "<i>P</i>-value>0.05", sig_type = "<i>P</i>-value", sig_value = 0.05))
expect_equal(res$fc, list(sig = "log<sub>2</sub>FC≥ 2.5", insig = "log<sub>2</sub>FC< 2.5"))
})
test_that('fc dir negative',{
res = html_translate_significance_thresholds(fc = 2.5,
fc_dir = 'negative',
sig_type = 'pvalue',
fdr_thresh = 0.1,
pval_thresh = 0.05)
expect_equal(res$sig, list(sig = "<i>P</i>-value≤0.05", insig = "<i>P</i>-value>0.05", sig_type = "<i>P</i>-value", sig_value = 0.05))
expect_equal(res$fc, list(sig = "log<sub>2</sub>FC< -2.5", insig = "log<sub>2</sub>FC≥ -2.5"))
})
test_that('fc dir is both',{
res = html_translate_significance_thresholds(fc = 2.5,
fc_dir = 'both',
sig_type = 'pvalue',
fdr_thresh = 0.1,
pval_thresh = 0.05)
expect_equal(res$sig, list(sig = "<i>P</i>-value≤0.05", insig = "<i>P</i>-value>0.05", sig_type = "<i>P</i>-value", sig_value = 0.05))
expect_equal(res$fc, list(sig = "|log<sub>2</sub>FC|≥ 2.5", insig = "|log<sub>2</sub>FC|< 2.5"))
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.