# This plot is redundant - same as (0,1) priorplot_ani_dist(d_p95_full, phenotype ='spiked', contigs =top_hits(full_zib_95_eb, alpha =0.05)$Contig_name, show_points = T, plot_type ='box')
Found 1 tophits for spikedTRUE at alpha = 0.05 using holm
Warning: Removed 153 rows containing non-finite outside the scale range
(`stat_boxplot()`).
Still no FP as expected. However, eBayes priors were unnecessary for this case. Larger datasets tend to work okay with either weak or strong prior options. Faster to use and maybe more stable.
Small sample test
This is where ebp priors shine! Here we sample and take 16 spiked vs. 17 non spiked.
Subset data and prepare for simulations
Show code
sample_sz =33# hack to convert to functionn1 <-floor(sample_sz *0.5) # Let's do a half splitn2 <- sample_sz - n1set.seed(1988)meta_subset <-bind_rows( meta_data %>%filter(spiked ==TRUE) %>%slice_sample(n = n1), meta_data %>%filter(spiked ==FALSE) %>%slice_sample(n = n2))d_subset = d_p95[, meta_subset$run_accession]d_subset <-filter_by_presence(d_subset, min_nonzero =ceiling(max(sample_sz*0.1, 2)))
! # Invaild edge matrix for <phylo>. A <tbl_df> is returned.
! # Invaild edge matrix for <phylo>. A <tbl_df> is returned.
! # Invaild edge matrix for <phylo>. A <tbl_df> is returned.
! # Invaild edge matrix for <phylo>. A <tbl_df> is returned.
! # Invaild edge matrix for <phylo>. A <tbl_df> is returned.
! # Invaild edge matrix for <phylo>. A <tbl_df> is returned.
! # Invaild edge matrix for <phylo>. A <tbl_df> is returned.
! # Invaild edge matrix for <phylo>. A <tbl_df> is returned.
! # Invaild edge matrix for <phylo>. A <tbl_df> is returned.
! # Invaild edge matrix for <phylo>. A <tbl_df> is returned.
! # Invaild edge matrix for <phylo>. A <tbl_df> is returned.
! # Invaild edge matrix for <phylo>. A <tbl_df> is returned.
Found 15 tophits for spikedTRUE at alpha = 0.05 using holm
Warning: Removed 398 rows containing non-finite outside the scale range
(`stat_boxplot()`).
Compare the two priors
Show code
# At a strong multiple testing correction, both priors pick the same edge cases, but in a different orderall(top_hits(fit_zib_s, alpha =0.05)$Contig_name %in%top_hits(fit_zib_w, alpha =0.05)$Contig_name)
Found 15 tophits for spikedTRUE at alpha = 0.05 using holm
Found 15 tophits for spikedTRUE at alpha = 0.05 using holm
Found 15 tophits for spikedTRUE at alpha = 0.05 using holm
Found 15 tophits for spikedTRUE at alpha = 0.05 using holm
Show code
# But if we relax the multple correction method to BH, the weak prior has more false positives than the strong priorlength(top_hits(fit_zib_w, alpha =0.05, method ='BH')$Contig_name)
Found 28 tophits for spikedTRUE at alpha = 0.05 using BH
! # Invaild edge matrix for <phylo>. A <tbl_df> is returned.
! # Invaild edge matrix for <phylo>. A <tbl_df> is returned.
! # Invaild edge matrix for <phylo>. A <tbl_df> is returned.
! # Invaild edge matrix for <phylo>. A <tbl_df> is returned.
! # Invaild edge matrix for <phylo>. A <tbl_df> is returned.
! # Invaild edge matrix for <phylo>. A <tbl_df> is returned.
Show code
# We only have the ZI signal for E. coli now! # valid caseplot_ani_dist(d_subset, phenotype ='spiked', contigs =top_hits(fit_zib_eb, alpha =0.05)$Contig_name, show_points = T, plot_type ='box')
Found 1 tophits for spikedTRUE at alpha = 0.05 using holm
Warning: Removed 16 rows containing non-finite outside the scale range
(`stat_boxplot()`).