Skip to content

Commit

Permalink
February 6, 2023 - Reordered/Added Supp. Figs
Browse files Browse the repository at this point in the history
Minor additions, mainly reordering current figures to match the manuscript as well as the addition of a new supplemental figure (Now called Supplemental_Figure_1.pdf) which details the distribution of time to sample for each diveristy group. Also, Figure 6 (Adobe Illustrator version aka Figure_6_AI.pdf) was slightly changed to now show the confusion matrices below the figures.
  • Loading branch information
nickdylla committed Feb 6, 2023
1 parent 033e88e commit 0452460
Show file tree
Hide file tree
Showing 42 changed files with 19,856 additions and 19,875 deletions.
Binary file modified .DS_Store
Binary file not shown.
Binary file modified Data/LT_Modeling.RData
Binary file not shown.
64 changes: 31 additions & 33 deletions Microbiome_Liver_Transplant_Manuscript.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ output:
toc_float: true
toc_depth: 3
code_folding: hide
bibliography: references.bib
editor_options:
chunk_output_type: console
header-includes:
Expand Down Expand Up @@ -3478,20 +3477,20 @@ text(
cex = 1.05, adj = 0)
```

### Supplemental Figure 2A + 2B: Plot Loadings for Diversity Groups
```{r, supplemental-figure-2-splsda-diversity-groups, fig.dim = c(14, 10), message=FALSE, warning=FALSE}
### Supplemental Figure 3A + 3B: Plot Loadings for Diversity Groups
```{r, supplemental-figure-3-splsda-diversity-groups, fig.dim = c(14, 10), message=FALSE, warning=FALSE}
# Take absolute value to make diversity group loadings plot narrower
diversity_train_splsda_final$loadings$X <- abs(diversity_train_splsda_final$loadings$X)
# Combine Supplemental Figures 2A + 2B
# Combine Supplemental Figures 3A + 3B
{pdf(file = "./Results/Supplemental_Figure_2.pdf",
{pdf(file = "./Results/Supplemental_Figure_3.pdf",
height = 8,
width = 11)
par(mfrow = c(1,3))
# Supplmental Figure 2A
# Supplmental Figure 3A
plotLoadings(
diversity_train_splsda_final,
contrib = 'max',
Expand All @@ -3504,7 +3503,7 @@ plotLoadings(
ndisplay = 50
)
# Supplmental Figure 2B
# Supplmental Figure 3B
plotLoadings(
diversity_train_splsda_final,
contrib = 'max',
Expand All @@ -3521,7 +3520,7 @@ invisible(dev.off())
par(mfrow = c(1,3))
# Supplmental Figure 2A
# Supplmental Figure 3A
plotLoadings(
diversity_train_splsda_final,
contrib = 'max',
Expand All @@ -3534,7 +3533,7 @@ plotLoadings(
ndisplay = 50
)
# Supplmental Figure 2B
# Supplmental Figure 3B
plotLoadings(
diversity_train_splsda_final,
contrib = 'max',
Expand All @@ -3547,20 +3546,20 @@ plotLoadings(
)
```

### Supplemental Figure 3A + 3B: Plot Loadings for Any Bacterial Infection
```{r, supplemental-figure-3-splsda-any-infection, fig.dim = c(14, 10), message=FALSE, warning=FALSE}
### Supplemental Figure 4A + 4B: Plot Loadings for Any Bacterial Infection
```{r, supplemental-figure-4-splsda-any-infection, fig.dim = c(14, 10), message=FALSE, warning=FALSE}
# Take absolute value to make diversity group loadings plot narrower
infx_train_splsda_final$loadings$X <- abs(infx_train_splsda_final$loadings$X)
# Combine Supplemental Figures 2A + 2B
# Combine Supplemental Figures 4A + 4B
{pdf(file = "./Results/Supplemental_Figure_3.pdf",
{pdf(file = "./Results/Supplemental_Figure_4.pdf",
height = 8,
width = 11)
par(mfrow = c(1,3))
# Supplmental Figure 3A
# Supplmental Figure 4A
plotLoadings(
infx_train_splsda_final,
contrib = 'max',
Expand All @@ -3573,7 +3572,7 @@ plotLoadings(
ndisplay = 50
)
# Supplmental Figure 3B
# Supplmental Figure 4B
plotLoadings(
infx_train_splsda_final,
contrib = 'max',
Expand All @@ -3589,7 +3588,7 @@ invisible(dev.off())}
par(mfrow = c(1,3))
# Supplmental Figure 3A
# Supplmental Figure 4A
plotLoadings(
infx_train_splsda_final,
contrib = 'max',
Expand All @@ -3602,7 +3601,7 @@ plotLoadings(
ndisplay = 50
)
# Supplmental Figure 3B
# Supplmental Figure 4B
plotLoadings(
infx_train_splsda_final,
contrib = 'max',
Expand All @@ -3617,8 +3616,8 @@ plotLoadings(
```

## Clinical Tables
### Supplemental Figure 1: Flow Diagram
```{r, supplemental-figure-1-flow-diagram, warning=FALSE, message=FALSE, fig.dim = c(12, 8)}
### Supplemental Figure 2: Flow Diagram
```{r, supplemental-figure-2-flow-diagram, warning=FALSE, message=FALSE, fig.dim = c(12, 8)}
flow_chart <-
flow_exclusions(
incl_counts = c(158, 130, 107, 25),
Expand All @@ -3633,7 +3632,7 @@ flow_chart
flow_chart %>%
export_svg() %>%
charToRaw() %>%
rsvg_pdf("./Results/Supplemental_Figure_1.pdf")
rsvg_pdf("./Results/Supplemental_Figure_2.pdf")
```

### Demographics
Expand Down Expand Up @@ -3999,7 +3998,7 @@ ecoc_infx_confusion_cnfs <- ecoc_infx_confusion_cnfs %>%
specificity = round(ecoc_infx_confusion_cnfs[2,3]/(ecoc_infx_confusion_cnfs[2,3] + ecoc_infx_confusion_cnfs[2,2]), 3),
odds_ratio = round((ecoc_infx_confusion_cnfs[1,2]/ecoc_infx_confusion_cnfs[1,3])/(ecoc_infx_confusion_cnfs[2,2]/ecoc_infx_confusion_cnfs[2,3]), 3))
write.csv(ecoc_infx_confusion_cnfs, "./Results/Supplemental_Table_2.csv", row.names = FALSE)
write.csv(ecoc_infx_confusion_cnfs, "./Results/Supplemental_Table_2A.csv", row.names = FALSE)
ebac_infx_confusion <- expan_infx_stats %>%
Expand All @@ -4023,10 +4022,10 @@ ebac_infx_confusion_cnfs <- ebac_infx_confusion_cnfs %>%
specificity = round(ebac_infx_confusion_cnfs[2,3]/(ebac_infx_confusion_cnfs[2,3] + ebac_infx_confusion_cnfs[2,2]), 3),
odds_ratio = round((ebac_infx_confusion_cnfs[1,2]/ebac_infx_confusion_cnfs[1,3])/(ebac_infx_confusion_cnfs[2,2]/ebac_infx_confusion_cnfs[2,3]), 3))
write.csv(ebac_infx_confusion_cnfs, "./Results/Supplemental_Table_3.csv", row.names = FALSE)
write.csv(ebac_infx_confusion_cnfs, "./Results/Supplemental_Table_2B.csv", row.names = FALSE)
```

### Supplemental Figure 4: Fecal Sample Collected from Transplant
### Supplemental Figure 1: Fecal Sample Collected from Transplant
```{r, sample-relative-to-transplant,warning=FALSE, message=FALSE, fig.dim = c(12, 8)}
sample_days <-
metaphlan_df_sumry %>%
Expand Down Expand Up @@ -4067,9 +4066,9 @@ sample_days %>%
geom_text(label = "Transplant Date = Day 0", x = -4, y = 12.5, color="orangered") +
theme_bw()+
theme(
panel.grid = element_blank(),
axis.text = element_text(color = "black", size = 12),
axis.title = element_text(color = "black", size = 14),
panel.grid = eb(),
axis.text = et(color = "black", size = 12),
axis.title = et(color = "black", size = 14),
legend.position = "none"
) +
scale_x_continuous(breaks = seq(-7, 30, 5),
Expand All @@ -4092,11 +4091,11 @@ ggplot(., aes(x = sample_days_from_transplant, y = diversity_group, fill = diver
) +
theme_bw() +
theme(
panel.grid = element_blank(),
axis.text.x = element_text(color = "black", size = 12),
axis.text.y = element_text(color = "black", size = 12),
axis.ticks.y = element_blank(),
axis.title = element_text(color = "black", size = 14),
panel.grid = eb(),
axis.text.x = et(color = "black", size = 12),
axis.text.y = et(color = "black", size = 12),
axis.ticks.y = eb(),
axis.title = et(color = "black", size = 14),
legend.position = "none"
) +
scale_x_continuous(breaks = seq(-7, 30, 5),
Expand All @@ -4105,7 +4104,7 @@ ggplot(., aes(x = sample_days_from_transplant, y = diversity_group, fill = diver
ylab("Diversity Groups\n") +
xlab("\nDays to Sample")
pdf(file = "./Results/Supplemental_Figure_4.pdf", height = 10, width = 12, onefile = F)
pdf(file = "./Results/Supplemental_Figure_1.pdf", height = 10, width = 12, onefile = F)
gg.stack(sample_days_histogram,
sample_days_boxplot)
Expand All @@ -4116,7 +4115,6 @@ gg.stack(sample_days_histogram,
sample_days_boxplot)
```


### Save Data Image
```{r save image, message=FALSE, warning=FALSE}
save.image(file = "./Data/LT_Modeling.RData")
Expand Down
125 changes: 63 additions & 62 deletions Microbiome_Liver_Transplant_Manuscript.html

Large diffs are not rendered by default.

Binary file modified Results/Figure_1.pdf
Binary file not shown.
Binary file modified Results/Figure_1A.pdf
Binary file not shown.
Binary file modified Results/Figure_1B.pdf
Binary file not shown.
Binary file modified Results/Figure_1C.pdf
Binary file not shown.
Binary file modified Results/Figure_1D.pdf
Binary file not shown.
Binary file modified Results/Figure_1E.pdf
Binary file not shown.
Binary file modified Results/Figure_1F.pdf
Binary file not shown.
Binary file modified Results/Figure_1G.pdf
Binary file not shown.
Binary file modified Results/Figure_1H.pdf
Binary file not shown.
Binary file modified Results/Figure_1I.pdf
Binary file not shown.
Binary file modified Results/Figure_1J.pdf
Binary file not shown.
Binary file modified Results/Figure_2.pdf
Binary file not shown.
Binary file modified Results/Figure_3.pdf
Binary file not shown.
Binary file modified Results/Figure_4A.pdf
Binary file not shown.
Binary file modified Results/Figure_4B.pdf
Binary file not shown.
Binary file modified Results/Figure_4C.pdf
Binary file not shown.
Binary file modified Results/Figure_5A.pdf
Binary file not shown.
Binary file modified Results/Figure_5B.pdf
Binary file not shown.
Binary file modified Results/Figure_6.pdf
Binary file not shown.
Binary file modified Results/Figure_6A.pdf
Binary file not shown.
Binary file modified Results/Figure_6B.pdf
Binary file not shown.
7,997 changes: 3,988 additions & 4,009 deletions Results/Figure_6_AI.ai

Large diffs are not rendered by default.

Binary file modified Results/Figure_6_AI.pdf
Binary file not shown.
Binary file modified Results/Supplemental_Figure_1.pdf
Binary file not shown.
8,316 changes: 4,343 additions & 3,973 deletions Results/Supplemental_Figure_1_AI.ai

Large diffs are not rendered by default.

Binary file modified Results/Supplemental_Figure_1_AI.pdf
Binary file not shown.
Binary file modified Results/Supplemental_Figure_2.pdf
Binary file not shown.
7,711 changes: 3,842 additions & 3,869 deletions Results/Supplemental_Figure_2_AI.ai

Large diffs are not rendered by default.

Binary file modified Results/Supplemental_Figure_2_AI.pdf
Binary file not shown.
Binary file modified Results/Supplemental_Figure_3.pdf
Binary file not shown.
7,062 changes: 3,480 additions & 3,582 deletions Results/Supplemental_Figure_3_AI.ai

Large diffs are not rendered by default.

Binary file modified Results/Supplemental_Figure_3_AI.pdf
Binary file not shown.
Binary file modified Results/Supplemental_Figure_4.pdf
Binary file not shown.
8,453 changes: 4,106 additions & 4,347 deletions Results/Supplemental_Figure_4_AI.ai

Large diffs are not rendered by default.

Binary file modified Results/Supplemental_Figure_4_AI.pdf
Binary file not shown.
File renamed without changes.
3 changes: 3 additions & 0 deletions Results/Supplemental_Table_2B.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"Enterobacterales","Greater.Than.Cutpoint","Less.Than.Cutpoint","sensitivity","specificity","odds_ratio"
"Infection",8,0,1,0.798,Inf
"No Infection",21,83,1,0.798,Inf
Binary file modified Results/enterococcus_expansion_boxplot.pdf
Binary file not shown.

0 comments on commit 0452460

Please sign in to comment.