Skip to content

Commit

Permalink
Write supplemental file
Browse files Browse the repository at this point in the history
  • Loading branch information
lwaldron committed Feb 13, 2019
1 parent a18ac6d commit 1939de1
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions vignettes/smoking.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ editor_options:
chunk_output_type: console
---

```{r, include=FALSE}
```{r setup, include=FALSE}
knitr::opts_chunk$set(
cache = TRUE,
echo = FALSE,
Expand All @@ -27,7 +27,7 @@ knitr::opts_chunk$set(
)
```

```{r setup, include=FALSE}
```{r loading, include=FALSE}
suppressPackageStartupMessages({
library(nychanesmicrobiome)
library(dplyr)
Expand Down Expand Up @@ -135,7 +135,7 @@ alphadiv.melted <-
reshape2::melt(alphadiv, id.vars = c("smokingstatus"))
```

```{r Alpha diversity boxplots, echo=FALSE, fig.width=6}
```{r Alpha diversity boxplots, echo=FALSE}
ggplot(alphadiv.melted, aes(smokingstatus,value)) +
geom_boxplot(aes(fill=smokingstatus))+
facet_grid(variable ~., scales = "free", switch = 'y') +
Expand Down Expand Up @@ -977,6 +977,7 @@ mergeResults <- function(obj.smoking, obj.cotinine) {
FDR_cotinine = obj.cotinine$table$FDR,
OTU = rownames(obj.smoking$table)
)
res <- cbind(res, obj.smoking[, c("Phylum", "Class", "Order", "Family", "Genus", "Species")])
return(res)
}
```
Expand Down Expand Up @@ -1208,6 +1209,19 @@ p <-
p
```

### Write supplemental file

```{r}
stopifnot(all.equal(rownames(edger.smoker_secondhand_adjusted),
rownames(edger.smoker_secondhand_crude)))
crude <- edger.smoker_secondhand_crude[, 1:4]
adjusted <- edger.smoker_secondhand_adjusted[, 1:4]
colnames(crude) <- paste0(colnames(crude), "_crude")
colnames(adjusted) <- paste0(colnames(adjusted), "_adjusted")
sfile <- cbind(edger.smoker_secondhand_crude[, -1:-4], crude, adjusted)
readr::write_excel_csv(sfile, path="SupplementalFile1.csv")
```


### Alternative smokers vs Never smoker: crude
```{r edgeR_alternative, echo=FALSE, fig.width=6.5}
Expand Down

0 comments on commit 1939de1

Please sign in to comment.