diff --git a/html_docs/Tobacco exposure associated with oral microbiome anaerobiosis in the New York City Health and Nutrition Examination Study (NYC HANES) II.html b/html_docs/Tobacco exposure associated with oral microbiome anaerobiosis in the New York City Health and Nutrition Examination Study (NYC HANES) II.html index 21e068d..a645bf1 100644 --- a/html_docs/Tobacco exposure associated with oral microbiome anaerobiosis in the New York City Health and Nutrition Examination Study (NYC HANES) II.html +++ b/html_docs/Tobacco exposure associated with oral microbiome anaerobiosis in the New York City Health and Nutrition Examination Study (NYC HANES) II.html @@ -1,5 +1,5 @@ - +
@@ -8,7 +8,7 @@ - +aovSMOKINGSTATUS <- aov(Shannon ~ smokingstatus, alphadiv)
+summary(aovSMOKINGSTATUS)
## Df Sum Sq Mean Sq F value Pr(>F)
## smokingstatus 4 0.09 0.02162 0.168 0.954
## Residuals 254 32.62 0.12841
+aovSMOKINGSTATUS <- aov(Observed ~ smokingstatus, alphadiv)
+summary(aovSMOKINGSTATUS)
## Df Sum Sq Mean Sq F value Pr(>F)
## smokingstatus 4 34597 8649 2.12 0.0788 .
## Residuals 254 1036314 4080
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
+aovSMOKINGSTATUS <- aov(Chao1 ~ smokingstatus, alphadiv)
+summary(aovSMOKINGSTATUS)
## Df Sum Sq Mean Sq F value Pr(>F)
## smokingstatus 4 74507 18627 1.33 0.259
## Residuals 254 3556471 14002
ggplot(metadata, aes(smokingstatus, COTININE, fill = smokingstatus)) +
+ stat_boxplot() +
+ scale_fill_manual(values = scale_palette) +
+ theme_bw() +
+ scale_x_discrete(labels = c("Never\nsmokers","Cigarette\nsmokers", "Former\nsmokers","Alternative\nsmokers","Secondhand\nsmoke")) +
+ xlab('Reported smoking status') +
+ ylab('Serum Cotinine (ng/ml)') +
+ guides(fill = FALSE) +
+ theme(strip.background = element_rect(colour = "transparent", fill = "transparent"),
+ strip.text.y = element_text(angle = 180),
+ axis.text = element_text(size = 12),
+ axis.title = element_text(size = 12),
+ legend.text = element_text(size=12),
+ legend.title = element_text(size=12),
+ legend.position = 'bottom')
Never smoker vs Cigarette | -0.0509071 | +0.0505876 | 0.001 | ||
Cigarette vs Former smoker | -0.0428646 | +0.0424802 | 0.001 | ||
Cigarette vs Alternative smoker | -0.0308923 | -0.001 | +Cigarette vs Secondhand | +0.0349217 | +0.004 |
Cigarette vs Secondhand | -0.0342012 | -0.010 | +Cigarette vs Alternative smoker | +0.0290550 | +0.008 |
Never smoker vs Secondhand | -0.0255269 | -0.079 | +0.0230414 | +0.104 | |
Never smoker vs Former smoker | -0.0174312 | -0.214 | +0.0186827 | +0.160 | |
Former smoker vs Alternative smoker | -0.0143694 | -0.267 | +0.0143434 | +0.279 | |
Alternative smoker vs Secondhand | -0.0118004 | -0.361 | +Former smoker vs Secondhand | +0.0129641 | +0.327 |
Former smoker vs Secondhand | -0.0131722 | -0.375 | +Alternative smoker vs Secondhand | +0.0091159 | +0.477 |
Never smoker vs Alternative smoker | -0.0088171 | -0.544 | +0.0089463 | +0.510 |
A function for merging smoking and cotinine edgeR results:
+mergeResults <- function(obj.smoking, obj.cotinine) {
+ intersect.filters <-
+ intersect(rownames(obj.smoking), rownames(obj.cotinine))
+ intersect.filters <- sort(intersect.filters)
+ obj.smoking <- obj.smoking[intersect.filters, ]
+ obj.cotinine <- obj.cotinine[intersect.filters, ]
+ stopifnot(all.equal(rownames(obj.smoking), rownames(obj.cotinine)))
+ ##
+ res <-
+ data.frame(
+ logFC_smoking = obj.smoking$table$logFC,
+ logFC_cotinine = obj.cotinine$table$logFC,
+ FDR_smoking = obj.smoking$table$FDR,
+ 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)
+}
And a plotting function:
+plotSmokingcotinineComparison <-
+ function(obj.smoking,
+ obj.cotinine,
+ labtext = "Crude",
+ FDRcutoff = 1) {
+ dataset <- mergeResults(obj.smoking, obj.cotinine)
+ dataset <- dataset[dataset$FDR_smoking < FDRcutoff,]
+ corr.result <- with(dataset,
+ cor.test(logFC_smoking, logFC_cotinine))
+ p <- ggplot(dataset) +
+ theme_bw() +
+ xlab(paste(labtext, "Smokers vs. Non-smokers")) +
+ ylab(paste(labtext, "Cotinine Levels (ng/ml)")) +
+ geom_text(aes(1,-0.3, label = sprintf(
+ "p-value: %s\ncor: %s \nFDR<0.05: %s",
+ signif(corr.result$p.value, 2),
+ signif(corr.result$estimate, 2),
+ sum(dataset$FDR_smoking < 0.05)
+ )), size = 5) +
+ geom_point(aes(logFC_smoking, logFC_cotinine, color = FDR_smoking <= 0.05),
+ size = 3) +
+ scale_colour_manual(values = setNames(c('black', 'grey'), c(TRUE, FALSE)), guide =
+ FALSE) +
+ geom_smooth(
+ aes(logFC_smoking, logFC_cotinine),
+ method = lm,
+ se = FALSE,
+ color = "red"
+ ) +
+ theme(
+ axis.text = element_text(
+ hjust = 0,
+ vjust = 0.5,
+ size = 13
+ ),
+ strip.text = element_text(size = 13),
+ axis.title = element_text(size = 15)
+ )
+ return(p)
+ }
Two thresholds for serum cotinine:
+NYC_HANES.secondhand.original <- subset_samples(NYC_HANES, smokingstatus %in% c("Secondhand"))
+NYC_HANES.secondhand.strict <- subset_samples(NYC_HANES.secondhand.original, COTININE < 10)
+sort(sample_data(NYC_HANES.secondhand.original)$COTININE)
## [1] 1.0022 1.0394 1.0418 1.0715 1.0915 1.2015 1.2282 1.2718 1.3822
## [10] 1.3822 1.4094 1.5315 1.6918 2.0094 2.5994 2.6759 2.8020 2.9394
## [19] 2.9720 3.0459 3.1082 3.1722 3.4715 3.8394 4.3418 4.5294 4.5394
## [28] 4.7522 5.7220 6.3118 7.1315 7.7382 9.1118 9.6415 10.2922 10.6920
## [37] 10.7915 13.7894
+summary(sample_data(NYC_HANES.secondhand.original)$COTININE > 10)
## Mode FALSE TRUE
## logical 34 4
Number of OTUs with FDR < 0.05 and total that passed non-specific screens in both analysis:
+summary(edger.smoker_secondhand_crude$FDR_smoking < 0.05)
## Mode FALSE TRUE
## logical 93 28
+# note that the different total number for strict cotinine cutoff is
+# due to non-specific filtering in edgeR
+summary(edger.smoker_secondhand_crude.strict$FDR_smoking < 0.05)
## Mode FALSE TRUE
## logical 87 27
+corarray <- array(dim=c(2, 2, 2), dimnames=list(secondhand=c("cot14", "cot10"),
+ counfounding=c("crude", "adjusted"),
+ FDRcutoff=c("no", "yes")))
+parray <- array(dim=c(2, 2, 2), dimnames=list(secondhand=c("cot14", "cot10"),
+ counfounding=c("crude", "adjusted"),
+ FDRcutoff=c("no", "yes")))
Correlation between crude smoking and cotinine coefficients, all OTUs:
+corr <- with(edger.smoker_secondhand_crude,
+ cor.test(logFC_smoking, logFC_cotinine))
+parray["cot14", "crude", "no"] <- corr$p.value
+corarray["cot14", "crude", "no"] <- corr$estimate
Strict definition of second-hand smoke:
+corr <- with(edger.smoker_secondhand_crude.strict,
+ cor.test(logFC_smoking, logFC_cotinine))
+parray["cot10", "crude", "no"] <- corr$p.value
+corarray["cot10", "crude", "no"] <- corr$estimate
Correlation between crude smoking and cotinine coefficients, FDR < 0.05 in smoking:
-All OTUs, black for FDR < 0.05 on smoking coefficients, grey for FDR >= 0.05 -
-Repeat, using the strict definition of second-hand smokers (cotinine < 10) -
+corr <- with(filter(edger.smoker_secondhand_crude, FDR_smoking < 0.05),
+ cor.test(logFC_smoking, logFC_cotinine))
+corarray["cot10", "crude", "yes"] <- corr$p.value
+parray["cot10", "crude", "yes"] <- corr$estimate
+All OTUs, black for FDR < 0.05 on smoking coefficients, grey for FDR >= 0.05
+p <-
+ plotSmokingcotinineComparison(dasmoking.crude,
+ dacot.crude,
+ labtext = "Crude",
+ FDR = 1)
+p
+
+Repeat, using the strict definition of second-hand smokers (cotinine < 10)
+p <-
+ plotSmokingcotinineComparison(dasmoking.crude,
+ dacot.crude.strict,
+ labtext = "Crude",
+ FDR = 1)
+p
+
Number of differentially abundant OTUs, and total
+nrow(edger.smoker_secondhand_adjusted)
## [1] 121
+summary(edger.smoker_secondhand_adjusted$logFC_smoking < 0.05)
## Mode FALSE TRUE
## logical 63 58
+summary(edger.smoker_secondhand_adjusted$logFC_cotinine < 0.05)
## Mode FALSE TRUE
## logical 38 83
Correlation between adjusted smoking and cotinine coefficients, all OTUs:
+corr <- with(edger.smoker_secondhand_adjusted,
+ cor.test(logFC_smoking, logFC_cotinine))
+parray["cot14", "adjusted", "no"] <- corr$p.value
+corarray["cot14", "adjusted", "no"] <- corr$estimate
As above, using strict serum cotinine cutoff (<10)
+corr <- with(edger.smoker_secondhand_adjusted.strict,
+ cor.test(logFC_smoking, logFC_cotinine))
+parray["cot10", "adjusted", "no"] <- corr$p.value
+corarray["cot10", "adjusted", "no"] <- corr$estimate
Correlation between adjusted smoking and cotinine coefficients, FDR < 0.05 in smoking:
+with(filter(edger.smoker_secondhand_adjusted, FDR_smoking < 0.05),
+ cor.test(logFC_smoking, logFC_cotinine))
##
## Pearson's product-moment correlation
##
@@ -1438,7 +1569,10 @@ 6.3.4 Adjusted Secondhand vs Adju
## sample estimates:
## cor
## 0.6789709
+parray["cot14", "adjusted", "yes"] <- corr$p.value
+corarray["cot14", "adjusted", "yes"] <- corr$estimate
Sensitivity analysis:
+round(corarray, 2)
## , , FDRcutoff = no
##
## counfounding
@@ -1452,6 +1586,7 @@ 6.3.4 Adjusted Secondhand vs Adju
## secondhand crude adjusted
## cot14 NA 0.34
## cot10 0 NA
+signif(parray, 1)
## , , FDRcutoff = no
##
## counfounding
@@ -1465,12 +1600,36 @@ 6.3.4 Adjusted Secondhand vs Adju
## secondhand crude adjusted
## cot14 NA 3e-04
## cot10 0.6 NA
+p <-
+ plotSmokingcotinineComparison(
+ obj.smoking = dasmoking.adjusted,
+ obj.cotinine = dacot.adjusted,
+ labtext = "Adjusted",
+ FDRcutoff = 1
+ )
+p
-Repeat, using the strict definition of second-hand smokers (cotinine < 10) -
+Repeat, using the strict definition of second-hand smokers (cotinine < 10)
+p <-
+ plotSmokingcotinineComparison(
+ obj.smoking = dasmoking.adjusted,
+ obj.cotinine = dacot.adjusted.strict,
+ labtext = "Adjusted",
+ FDRcutoff = 1
+ )
+p
+
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")
sessionInfo()
## R version 4.3.0 (2023-04-21)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Pop!_OS 22.04 LTS
diff --git a/html_docs/Tobacco exposure associated with oral microbiome anaerobiosis in the New York City Health and Nutrition Examination Study (NYC HANES) II.pdf b/html_docs/Tobacco exposure associated with oral microbiome anaerobiosis in the New York City Health and Nutrition Examination Study (NYC HANES) II.pdf
index bdbf1f7..55774af 100644
Binary files a/html_docs/Tobacco exposure associated with oral microbiome anaerobiosis in the New York City Health and Nutrition Examination Study (NYC HANES) II.pdf and b/html_docs/Tobacco exposure associated with oral microbiome anaerobiosis in the New York City Health and Nutrition Examination Study (NYC HANES) II.pdf differ