<jupyter_start><jupyter_text>Metabolite P/LET T2<jupyter_code>unique(sample_data(physeq)$Category)
unique(sample_data(physeq)$Week)

#Remove cecum and time 0
physeq.pt = subset_samples(physeq, Week != 'cecum.T5' & Week != '0' & Week != '1'& Week != '3'& Week != '4'& Week != '5')
unique(sample_data(physeq.pt)$Category)
unique(sample_data(physeq.pt)$Week)

# Remove Co-P and placebo
physeq.pt.pl = subset_samples(physeq.pt, Category != 'Co-L' & Category != 'Co-P')
unique(sample_data(physeq.pt.pl)$Category)
unique(sample_data(physeq.pt.pl)$Week)
diagdds = phyloseq_to_deseq2(physeq.pt.pl, ~ Category)
diagdds$Category = relevel(diagdds$Category, ref = "Letrozole")
# calculate geometric means prior to estimate size factors
gm_mean = function(x, na.rm=TRUE){
  exp(sum(log(x[x > 0]), na.rm=na.rm) / length(x))
}
geoMeans = apply(counts(diagdds), 1, gm_mean)
diagdds = estimateSizeFactors(diagdds, geoMeans = geoMeans)
diagdds = DESeq(diagdds, fitType="local")
res = results(diagdds)
res = res[order(res$padj, na.last=NA), ]
sigtab = res
lower = -15
upper = 15
sigtab= subset(res, log2FoldChange < lower | log2FoldChange > upper)
sigtab = cbind(as(sigtab, "data.frame"), as(tax_table(physeq.pt.pl)[rownames(sigtab), ], "matrix"))
sigtab = sigtab[order(-abs(sigtab$log2FoldChange)),]
library("ggplot2")
pdf('Known_no_BA_T2_PvsL_DESEQ2.pdf', width=11, height=10)
theme_set(theme_bw())
sigtabgen = subset(sigtab, !is.na(Genus))
# Phylum order
x = tapply(sigtabgen$log2FoldChange, sigtabgen$Phylum, function(x) max(x))
sigtabgen$Phylum = factor(as.character(sigtabgen$Phylum), levels=names(x))
# Genus order
x = tapply(sigtabgen$log2FoldChange, sigtabgen$Genus, function(x) max(x))
sigtabgen$Genus = factor(as.character(sigtabgen$Genus), levels=names(x))
ggplot(sigtabgen, aes(y=Genus, x=log2FoldChange)) + 
  geom_vline(xintercept = 0.0, color = "gray", size = 0.5) +
  geom_point(size=4) + scale_x_continuous(minor_breaks=NULL) + coord_fixed(ratio=3) +
  theme(text= element_text(size=20),axis.text.x = element_text(angle = -90, hjust = 0, vjust=0.5),legend.position = 'none')
           
dev.off()<jupyter_output>Warning message in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, :
“conversion failure on '3β -Hydroxy-5-cholestenoic acid' in 'mbcsToSbcs': dot substituted for <ce>”Warning message in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, :
“conversion failure on '3β -Hydroxy-5-cholestenoic acid' in 'mbcsToSbcs': dot substituted for <b2>”Warning message in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, :
“conversion failure on '3β -Hydroxy-5-cholestenoic acid' in 'mbcsToSbcs': dot substituted for <ce>”Warning message in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, :
“conversion failure on '3β -Hydroxy-5-cholestenoic acid' in 'mbcsToSbcs': dot substituted for <b2>”Warning message in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, :
“conversion failure on '3β -Hydroxy-5-cholestenoic acid' in 'mbcsToSbcs': dot substituted for <ce>”Warning message in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, :
“conversion f[...]<jupyter_text>Metabolite Co-L/LET T2<jupyter_code>unique(sample_data(physeq)$Category)
unique(sample_data(physeq)$Week)

#Remove cecum and time 0
physeq.pt = subset_samples(physeq, Week != 'cecum.T5' & Week != '0' & Week != '1'& Week != '3'& Week != '4'& Week != '5')
unique(sample_data(physeq.pt)$Category)
unique(sample_data(physeq.pt)$Week)

# Remove Co-P and placebo
physeq.pt.pl = subset_samples(physeq.pt, Category != 'Placebo' & Category != 'Co-P')
unique(sample_data(physeq.pt.pl)$Category)
unique(sample_data(physeq.pt.pl)$Week)
diagdds = phyloseq_to_deseq2(physeq.pt.pl, ~ Category)
diagdds$Category = relevel(diagdds$Category, ref = "Letrozole")
# calculate geometric means prior to estimate size factors
gm_mean = function(x, na.rm=TRUE){
  exp(sum(log(x[x > 0]), na.rm=na.rm) / length(x))
}
geoMeans = apply(counts(diagdds), 1, gm_mean)
diagdds = estimateSizeFactors(diagdds, geoMeans = geoMeans)
diagdds = DESeq(diagdds, fitType="local")
res = results(diagdds)
res = res[order(res$padj, na.last=NA), ]
sigtab = res
lower = -15
upper = 15
sigtab= subset(res, log2FoldChange < lower | log2FoldChange > upper)
sigtab = cbind(as(sigtab, "data.frame"), as(tax_table(physeq.pt.pl)[rownames(sigtab), ], "matrix"))
sigtab = sigtab[order(-abs(sigtab$log2FoldChange)),]
library("ggplot2")
pdf('Known_no_BA_T2_CoLvsL_DESEQ2.pdf', width=11, height=10)
theme_set(theme_bw())
sigtabgen = subset(sigtab, !is.na(Genus))
# Phylum order
x = tapply(sigtabgen$log2FoldChange, sigtabgen$Phylum, function(x) max(x))
sigtabgen$Phylum = factor(as.character(sigtabgen$Phylum), levels=names(x))
# Genus order
x = tapply(sigtabgen$log2FoldChange, sigtabgen$Genus, function(x) max(x))
sigtabgen$Genus = factor(as.character(sigtabgen$Genus), levels=names(x))
ggplot(sigtabgen, aes(y=Genus, x=log2FoldChange)) + 
  geom_vline(xintercept = 0.0, color = "gray", size = 0.5) +
  geom_point(size=4) + scale_x_continuous(minor_breaks=NULL) + coord_fixed(ratio=3) +
  theme(text= element_text(size=20),axis.text.x = element_text(angle = -90, hjust = 0, vjust=0.5),legend.position = 'none')
           
dev.off()<jupyter_output>converting counts to integer mode
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not an warning or error]
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not an warning or error]
using pre-existing size factors
estimating dispersions
gene-wise dispersion estimates
mean-dispersion relationship
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [T[...]<jupyter_text>Metabolite P/LET T5<jupyter_code>unique(sample_data(physeq)$Category)
unique(sample_data(physeq)$Week)

#Remove cecum and time 0
physeq.pt = subset_samples(physeq, Week != 'cecum.T5' & Week != '0' & Week != '1'& Week != '3'& Week != '4'& Week != '2')
unique(sample_data(physeq.pt)$Category)
unique(sample_data(physeq.pt)$Week)

# Remove Co-P and placebo
physeq.pt.pl = subset_samples(physeq.pt, Category != 'Co-L' & Category != 'Co-P')
unique(sample_data(physeq.pt.pl)$Category)
unique(sample_data(physeq.pt.pl)$Week)
diagdds = phyloseq_to_deseq2(physeq.pt.pl, ~ Category)
diagdds$Category = relevel(diagdds$Category, ref = "Letrozole")
# calculate geometric means prior to estimate size factors
gm_mean = function(x, na.rm=TRUE){
  exp(sum(log(x[x > 0]), na.rm=na.rm) / length(x))
}
geoMeans = apply(counts(diagdds), 1, gm_mean)
diagdds = estimateSizeFactors(diagdds, geoMeans = geoMeans)
diagdds = DESeq(diagdds, fitType="local")
res = results(diagdds)
res = res[order(res$padj, na.last=NA), ]
sigtab = res
lower = -15
upper = 15
sigtab= subset(res, log2FoldChange < lower | log2FoldChange > upper)
sigtab = cbind(as(sigtab, "data.frame"), as(tax_table(physeq.pt.pl)[rownames(sigtab), ], "matrix"))
sigtab = sigtab[order(-abs(sigtab$log2FoldChange)),]
library("ggplot2")
pdf('Known_no_BA_T5_PvsL_DESEQ2.pdf', width=11, height=10)
theme_set(theme_bw())
sigtabgen = subset(sigtab, !is.na(Genus))
# Phylum order
x = tapply(sigtabgen$log2FoldChange, sigtabgen$Phylum, function(x) max(x))
sigtabgen$Phylum = factor(as.character(sigtabgen$Phylum), levels=names(x))
# Genus order
x = tapply(sigtabgen$log2FoldChange, sigtabgen$Genus, function(x) max(x))
sigtabgen$Genus = factor(as.character(sigtabgen$Genus), levels=names(x))
ggplot(sigtabgen, aes(y=Genus, x=log2FoldChange)) + 
  geom_vline(xintercept = 0.0, color = "gray", size = 0.5) +
  geom_point(size=4) + scale_x_continuous(minor_breaks=NULL) + coord_fixed(ratio=3) +
  theme(text= element_text(size=20),axis.text.x = element_text(angle = -90, hjust = 0, vjust=0.5),legend.position = 'none')
           
dev.off()<jupyter_output>converting counts to integer mode
using pre-existing size factors
estimating dispersions
gene-wise dispersion estimates
mean-dispersion relationship
final dispersion estimates
fitting model and testing
-- replacing outliers and refitting for 44 genes
-- DESeq argument 'minReplicatesForReplace' = 7 
-- original counts are preserved in counts(dds)
estimating dispersions
fitting model and testing
Warning message in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, :
“conversion failure on 'Methyl γ -linolenate' in 'mbcsToSbcs': dot substituted for <ce>”Warning message in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, :
“conversion failure on 'Methyl γ -linolenate' in 'mbcsToSbcs': dot substituted for <b3>”Warning message in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, :
“conversion failure on 'Methyl γ -linolenate' in 'mbcsToSbcs': dot substituted for <ce>”Warning message in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, :
“conversion[...]<jupyter_text>Metabolite CoL/LET T5<jupyter_code>unique(sample_data(physeq)$Category)
unique(sample_data(physeq)$Week)

#Remove cecum and time 0
physeq.pt = subset_samples(physeq, Week != 'cecum.T5' & Week != '0' & Week != '1'& Week != '3'& Week != '4'& Week != '2')
unique(sample_data(physeq.pt)$Category)
unique(sample_data(physeq.pt)$Week)

# Remove Co-P and placebo
physeq.pt.pl = subset_samples(physeq.pt, Category != 'Placebo' & Category != 'Co-P')
unique(sample_data(physeq.pt.pl)$Category)
unique(sample_data(physeq.pt.pl)$Week)
diagdds = phyloseq_to_deseq2(physeq.pt.pl, ~ Category)
diagdds$Category = relevel(diagdds$Category, ref = "Letrozole")
# calculate geometric means prior to estimate size factors
gm_mean = function(x, na.rm=TRUE){
  exp(sum(log(x[x > 0]), na.rm=na.rm) / length(x))
}
geoMeans = apply(counts(diagdds), 1, gm_mean)
diagdds = estimateSizeFactors(diagdds, geoMeans = geoMeans)
diagdds = DESeq(diagdds, fitType="local")
res = results(diagdds)
res = res[order(res$padj, na.last=NA), ]
sigtab = res
lower = -15
upper = 15
sigtab= subset(res, log2FoldChange < lower | log2FoldChange > upper)
sigtab = cbind(as(sigtab, "data.frame"), as(tax_table(physeq.pt.pl)[rownames(sigtab), ], "matrix"))
sigtab = sigtab[order(-abs(sigtab$log2FoldChange)),]
library("ggplot2")
pdf('Known_no_BA_T5_CoLvsL_DESEQ2.pdf', width=11, height=10)
theme_set(theme_bw())
sigtabgen = subset(sigtab, !is.na(Genus))
# Phylum order
x = tapply(sigtabgen$log2FoldChange, sigtabgen$Phylum, function(x) max(x))
sigtabgen$Phylum = factor(as.character(sigtabgen$Phylum), levels=names(x))
# Genus order
x = tapply(sigtabgen$log2FoldChange, sigtabgen$Genus, function(x) max(x))
sigtabgen$Genus = factor(as.character(sigtabgen$Genus), levels=names(x))
ggplot(sigtabgen, aes(y=Genus, x=log2FoldChange)) + 
  geom_vline(xintercept = 0.0, color = "gray", size = 0.5) +
  geom_point(size=4) + scale_x_continuous(minor_breaks=NULL) + coord_fixed(ratio=1.5) +
  theme(text= element_text(size=20),axis.text.x = element_text(angle = -90, hjust = 0, vjust=0.5),legend.position = 'none')
           
dev.off()<jupyter_output>converting counts to integer mode
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not an warning or error]
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not an warning or error]
using pre-existing size factors
estimating dispersions
gene-wise dispersion estimates
mean-dispersion relationship
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [T[...]
{'fraction_non_alphanumeric': 0.14453376205787782, 'fraction_numerical': 0.01454983922829582, 'mean_word_length': 6.207995365005794, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '411374', 'license': 'MIT', 'n_tokens_mistral': 4733, 'n_tokens_neox': 4556, 'n_words': 1070, 'path': 'DESEQ2/Metabolites_No_BA/log2fold_metabolites.ipynb', 'repo_name': 'bryansho/PCOS_WGS_16S_metabolome', 'size': '12440'}