Skip to content

Commit

Permalink
Add Figure S10.
Browse files Browse the repository at this point in the history
  • Loading branch information
FrederickHuangLin committed Mar 13, 2020
1 parent 215e287 commit 982cf08
Show file tree
Hide file tree
Showing 42 changed files with 1,177 additions and 767 deletions.
430 changes: 215 additions & 215 deletions .Rhistory

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .Rproj.user/E94C3793/pcs/files-pane.pper
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"path" : "~/Box Sync/0. Dissertation Research/1st Paper/Manuscript/Tables and Figures/scripts",
"path" : "~/Box Sync/0. Dissertation Research/1st paper/manuscript/Tables and Figures/scripts",
"sortOrder" : [
{
"ascending" : true,
Expand Down
2 changes: 1 addition & 1 deletion .Rproj.user/E94C3793/pcs/source-pane.pper
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"activeTab" : -1
"activeTab" : 0
}
4 changes: 2 additions & 2 deletions .Rproj.user/E94C3793/pcs/windowlayoutstate.pper
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"left" : {
"panelheight" : 685,
"splitterpos" : 286,
"topwindowstate" : "HIDE",
"splitterpos" : 285,
"topwindowstate" : "NORMAL",
"windowheight" : 723
},
"right" : {
Expand Down
5 changes: 3 additions & 2 deletions .Rproj.user/E94C3793/rmd-outputs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
~/Box Sync/0. Dissertation Research/1st Paper/Manuscript/Tables and Figures/scripts/figure_s6_s7_table_s4_s5.html
~/Box Sync/0. Dissertation Research/1st paper/manuscript/Tables and Figures/scripts/figure_4_s3_s4.html
~/Box Sync/0. Dissertation Research/1st Paper/Manuscript/Tables and Figures/scripts/figure_s9_table_s6.html
~/Box Sync/0. Dissertation Research/1st Paper/Manuscript/Tables and Figures/scripts/figure_s5.html

~/Box Sync/0. Dissertation Research/1st Paper/Manuscript/Tables and Figures/scripts/figure_s9_table_s6.html





3 changes: 3 additions & 0 deletions data/sim_poi_gam/large/fdr_power_ancom_bc_bh.csv

Large diffs are not rendered by default.

Binary file modified figures/Figure 3.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified figures/Figure 3.pdf
Binary file not shown.
Binary file modified figures/Figure 4.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified figures/Figure 4.pdf
Binary file not shown.
Binary file modified figures/Figure 4a.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified figures/Figure 4a.pdf
Binary file not shown.
Binary file modified figures/Figure 4b.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified figures/Figure 4b.pdf
Binary file not shown.
Binary file modified figures/Figure S1.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified figures/Figure S1.pdf
Binary file not shown.
Binary file added figures/Figure S10.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added figures/Figure S10.pdf
Binary file not shown.
Binary file added figures/Figure S10a.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added figures/Figure S10a.pdf
Binary file not shown.
Binary file added figures/Figure S10b.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added figures/Figure S10b.pdf
Binary file not shown.
Binary file modified figures/Figure S2.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified figures/Figure S2.pdf
Binary file not shown.
Binary file modified figures/Figure S3.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified figures/Figure S3.pdf
Binary file not shown.
Binary file modified figures/Figure S3a.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified figures/Figure S3a.pdf
Binary file not shown.
Binary file modified figures/Figure S3b.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified figures/Figure S3b.pdf
Binary file not shown.
Binary file modified figures/Figure S4.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified figures/Figure S4.pdf
Binary file not shown.
Binary file modified figures/Figure S4a.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified figures/Figure S4a.pdf
Binary file not shown.
Binary file modified figures/Figure S4b.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified figures/Figure S4b.pdf
Binary file not shown.
Binary file modified figures/Figure S8.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified figures/Figure S8.pdf
Binary file not shown.
6 changes: 3 additions & 3 deletions scripts/figure_3_s1_s2_s8.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ p=ggplot(p.df, aes(x=method, y=value, color=method))+
label=norm.var$label,
values = gg_color_hue(8))+
scale_shape_manual(name=NULL, values=c(1, 17))+
labs(x="", y="Centered Deviance")+
labs(x="", y="Residual")+
theme_bw()+
theme(panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
Expand Down Expand Up @@ -282,7 +282,7 @@ p=ggplot(p.df, aes(x=method, y=value, color=method))+
label=norm.var$label,
values = gg_color_hue(8))+
scale_shape_manual(name=NULL, values=c(1, 17))+
labs(x="", y="Centered Deviance")+
labs(x="", y="Residual")+
theme_bw()+
theme(panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
Expand Down Expand Up @@ -417,7 +417,7 @@ p=ggplot(p.df, aes(x=method, y=value, color=method))+
label=norm.var$label,
values = gg_color_hue(8))+
scale_shape_manual(name=NULL, values=c(1, 17))+
labs(x="", y="Centered Deviance")+
labs(x="", y="Residual")+
theme_bw()+
theme(panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
Expand Down
335 changes: 177 additions & 158 deletions scripts/figure_3_s1_s2_s8.html

Large diffs are not rendered by default.

107 changes: 107 additions & 0 deletions scripts/figure_4_s3_s4.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -962,6 +962,113 @@ ggsave("../figures/Figure S4.pdf", width=6.25, height=9, units='in')
ggsave("../figures/Figure S4.jpeg", width=6.25, height=9, units='in', dpi = 300)
```

# 5. FDR and Power with the Presence of Large Variable Sampling Fractions Using BH Procedure

```{r, message=FALSE, warning=FALSE, comment=NA}
## Read in original data
dat.ancom_bc=read_csv("../data/sim_poi_gam/large/fdr_power_ancom_bc_bh.csv")
dat.ancom=read_csv("../data/sim_poi_gam/large/fdr_power_ancom_large.csv")
dat.deseq2=read_csv("../data/sim_poi_gam/large/fdr_power_deseq2_large.csv")
dat.edger=read_csv("../data/sim_poi_gam/large/fdr_power_edger_large.csv")
dat.zilg=read_csv("../data/sim_poi_gam/large/fdr_power_zilg_large.csv")
dat.zig=read_csv("../data/sim_poi_gam/large/fdr_power_zig_large.csv")
dat.wilcox_un=read_csv("../data/sim_poi_gam/large/fdr_power_wilcox_un_large.csv")
dat.wilcox_tss=read_csv("../data/sim_poi_gam/large/fdr_power_wilcox_tss_large.csv")
## Reshaping data
simpattern=distinct(simparams, n.taxa, n.samp.grp1, n.samp.grp2, prop.diff)
data_summary = function(eval_data, method){
FDR=tapply(as.numeric(eval_data[1, ]),
rep(seq(nrow(simpattern)), each=iterNum), function(x) mean(x, na.rm = T))
FDRSD=tapply(as.numeric(eval_data[1, ]),
rep(seq(nrow(simpattern)), each=iterNum), function(x) sd(x, na.rm = T))
power=tapply(as.numeric(eval_data[2, ]),
rep(seq(nrow(simpattern)), each=iterNum), function(x) mean(x, na.rm = T))
powerSD=tapply(as.numeric(eval_data[2, ]),
rep(seq(nrow(simpattern)), each=iterNum), function(x) sd(x, na.rm = T))
data_sum = data.frame(FDR, FDRSD, power, powerSD, simpattern, method)
data_sum = data_sum%>%unite(n.samp.grp, n.samp.grp1, n.samp.grp2, sep = ", ")
return(data_sum)
}
eval.dat.list = list(dat.ancom_bc, dat.ancom, dat.deseq2, dat.edger,
dat.zilg, dat.zig, dat.wilcox_un, dat.wilcox_tss)
method.list = list("ANCOM-BC", "ANCOM", "DESeq2", "edgeR", "ZILG", "ZIG", "Wilcoxon", "Wilcoxon + TSS")
dat.fig.list = vector(mode = "list", length = length(eval.dat.list))
for (i in 1:length(eval.dat.list)) {
dat.fig.list[[i]] = data_summary(eval.dat.list[[i]], method.list[[i]])
}
## Merge data
dat.fig=Reduce('rbind', dat.fig.list)
dat.fig$n.samp.grp=factor(dat.fig$n.samp.grp)
levels(dat.fig$n.samp.grp)=c("n = 20/30", "n = 50/50")
dat.fig$method=factor(dat.fig$method)
dat.fig$prop.diff=factor(dat.fig$prop.diff)
dat.fig%>%datatable()%>%formatRound(columns=c("FDR", "FDRSD", "power", "powerSD"), digits=3)
```

## 5.1 Fig. S10a

```{r, message=FALSE, warning=FALSE, comment=NA}
p1=ggplot(dat.fig, aes(x=prop.diff, y=FDR, fill=method)) +
geom_hline(yintercept=0.05, linetype="solid", color="black", size = 0.2)+
geom_hline(yintercept=0.05+sqrt(0.05*0.95/100), linetype="dashed", color="black", size = 0.2)+
scale_y_continuous(breaks = c(0.05, seq(0.2, 1, 0.2)), limits = c(0, 0.8))+
coord_flip()+facet_grid(.~n.samp.grp)+
geom_bar(stat="identity", position=position_dodge())+
labs(x="Proportion of Differentially Abundant Taxa", y="", fill=NULL, title="FDR")+
scale_fill_brewer(palette="Dark2")+
theme_bw()+
theme(panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
plot.title=element_text(hjust = 0.5),
strip.background = element_rect(fill="white"),
legend.position = "bottom")+
guides(fill=guide_legend(nrow=2, byrow=TRUE))
ggarrange(p1, labels = "a")
ggsave("../figures/Figure S10a.pdf", width=6.25, height=5, units='in')
ggsave("../figures/Figure S10a.jpeg", width=6.25, height=5, units='in', dpi = 300)
```

## 5.2 Fig. S10b

```{r, message=FALSE, warning=FALSE, comment=NA}
p2=ggplot(dat.fig, aes(x=prop.diff, y=power, fill=method)) +
scale_y_continuous(breaks = seq(0.2, 1, 0.2), limits = c(0, 1))+
coord_flip()+facet_grid(.~n.samp.grp)+
geom_bar(stat="identity", position=position_dodge())+
labs(x="Proportion of Differentially Abundant Taxa", y="", fill=NULL, title="Power")+
scale_fill_brewer(palette="Dark2")+
theme_bw()+
theme(panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
strip.background = element_rect(fill="white"),
plot.title=element_text(hjust = 0.5),
legend.position = "bottom")+
guides(fill=guide_legend(nrow=2, byrow=TRUE))
ggarrange(p2, labels = "b")
ggsave("../figures/Figure S10b.pdf", width=6.25, height=5, units='in')
ggsave("../figures/Figure S10b.jpeg", width=6.25, height=5, units='in', dpi = 300)
```

## 5.3 Fig. S10

```{r, message=FALSE, warning=FALSE, comment=NA, fig.height=10}
p = ggarrange(p1 + labs(x=NULL), p2 + labs(x=NULL),
labels = c("a", "b"),
ncol = 1, nrow = 2,
common.legend = TRUE, legend="bottom")
annotate_figure(p, left = text_grob("Proportion of Differentially Abundant Taxa", rot = 90))
ggsave("../figures/Figure S10.pdf", width=6.25, height=9, units='in')
ggsave("../figures/Figure S10.jpeg", width=6.25, height=9, units='in', dpi = 300)
```


# Session information

```{r, message=FALSE, warning=FALSE, comment=NA}
Expand Down
Loading

0 comments on commit 982cf08

Please sign in to comment.