<jupyter_start><jupyter_text>Do not use pvalue graphs, use Log2fold ones  T5 PvL (Top 10) Log2fold<jupyter_code>sigtab = read.csv("T5_filtered_greater_00001_PvL_deseq.csv", row.names = 1)
sigtab = as.data.frame.matrix(sigtab)
row_sigtab = lapply(rownames(sigtab), function(x) {substring(x, 3)})
rownames(sigtab) = row_sigtab
sigtab
# lower = min(sigtab$log2FoldChange) * .7
# upper = max(sigtab$log2FoldChange) * .7
# threshold = subset(sigtab, sigtab$log2FoldChange > upper | sigtab$log2FoldChange < lower)
# threshold
# threshold = threshold[-c(4),]
# threshold
rank_order = order(abs(sigtab$log2FoldChange), sigtab$log2FoldChange, decreasing = TRUE)
sigtab = sigtab[rank_order,]
sigtab
x = 0
unwant = "uncultured"
threshold = data.frame()

for (i in row.names(sigtab)){
    if (grepl(unwant, i) == FALSE){
        threshold = rbind(threshold, sigtab[c(i),])
        x = x +1
    }
    if (x == 10){
        break
    }
}

threshold
pdf('T5_WSG_PvsL_top10log_DESEQ.pdf', width=6, height=8)
theme_set(theme_bw())
ggplot(threshold, aes(y=factor(row.names(threshold),levels= rev(levels(factor(row.names(threshold))))), x=threshold$log2FoldChange)) + 
  geom_vline(xintercept = 0.0, color = "gray", size = 0.5) +
  geom_point(size=4) + 
  ggtitle("WGS P/L T5 (Top 10 Log2fold)") +
  xlab("log2FoldChange") +
  ylab("Bacterial Species") + 
  scale_x_continuous(minor_breaks=NULL) + coord_fixed(ratio=.5) +
  theme(text= element_text(size=10), axis.text.x = element_text(angle = -90, hjust = 0, vjust=0.5),
        legend.position = 'none', plot.title = element_text(hjust = 0.5), axis.text=element_text(size=12))
dev.off()<jupyter_output><empty_output><jupyter_text>T5 PvL (Top 10) pvalue<jupyter_code>sigtab = read.csv("T5_filtered_greater_00001_PvL_deseq.csv", row.names = 1)
sigtab = as.data.frame.matrix(sigtab)
row_sigtab = lapply(rownames(sigtab), function(x) {substring(x, 3)})
rownames(sigtab) = row_sigtab
sigtab
rank_order = order(sigtab$pvalue,sigtab$pvalue,decreasing = FALSE)
sigtab = sigtab[rank_order,]
sigtab
x = 0
unwant = "uncultured"
threshold = data.frame()

for (i in row.names(sigtab)){
    if (grepl(unwant, i) == FALSE){
        threshold = rbind(threshold, sigtab[c(i),])
        x = x +1
    }
    if (x == 10){
        break
    }
}

threshold
pdf('T5_WSG_PvsL_top10pvalue_DESEQ.pdf', width=11, height=10)
theme_set(theme_bw())
ggplot(threshold, aes(y=row.names(threshold), x=threshold$log2FoldChange)) + 
  geom_vline(xintercept = 0.0, color = "gray", size = 0.5) +
  geom_point(size=6) + 
  ggtitle("WSG P/L T5 (Top 10 P-value)") +
  xlab("log2FoldChange") +
  ylab("Bacterial Species") + 
  theme(text= element_text(size=10), axis.text.x = element_text(angle = -90, hjust = 0, vjust=0.5),
        legend.position = 'none', plot.title = element_text(hjust = 0.5), axis.text=element_text(size=12))
dev.off()<jupyter_output><empty_output><jupyter_text>T5 CoLvL (top 10) Log2fold<jupyter_code>sigtab = read.csv("T5_filtered_greater_00001_CoLvL_deseq.csv", row.names = 1)
sigtab = as.data.frame.matrix(sigtab)
row_sigtab = lapply(rownames(sigtab), function(x) {substring(x, 3)})
rownames(sigtab) = row_sigtab
sigtab
# lower = min(sigtab$log2FoldChange) * .7
# upper = max(sigtab$log2FoldChange) * .7
# threshold = subset(sigtab, sigtab$log2FoldChange > upper | sigtab$log2FoldChange < lower)
# threshold
# threshold = threshold[-c(4),]
# threshold
rank_order = order(abs(sigtab$log2FoldChange), sigtab$log2FoldChange, decreasing = TRUE)
sigtab = sigtab[rank_order,]
sigtab
x = 0
unwant = "uncultured"
threshold = data.frame()

for (i in row.names(sigtab)){
    if (grepl(unwant, i) == FALSE){
        threshold = rbind(threshold, sigtab[c(i),])
        x = x +1
    }
    if (x == 10){
        break
    }
}

threshold
pdf('T5_WSG_CoLvsL_top10log_DESEQ.pdf', width=6, height=8)
theme_set(theme_bw())
ggplot(threshold, aes(y=factor(row.names(threshold),levels= rev(levels(factor(row.names(threshold))))), x=threshold$log2FoldChange)) + 
  geom_vline(xintercept = 0.0, color = "gray", size = 0.5) +
  geom_point(size=4) + 
  ggtitle("WGS CoL/L T5 (Top 10 Log2fold)") +
  xlab("log2FoldChange") +
  ylab("Bacterial Species") + 
  scale_x_continuous(minor_breaks=NULL) + coord_fixed(ratio=.23) +
  theme(text= element_text(size=10), axis.text.x = element_text(angle = -90, hjust = 0, vjust=0.5),
        legend.position = 'none', plot.title = element_text(hjust = 0.5), axis.text=element_text(size=12))
dev.off()<jupyter_output><empty_output><jupyter_text>T5 CoLvL (top 10) Pvalue<jupyter_code>sigtab = read.csv("T5_filtered_greater_00001_CoLvL_deseq.csv", row.names = 1)
sigtab = as.data.frame.matrix(sigtab)
row_sigtab = lapply(rownames(sigtab), function(x) {substring(x, 3)})
rownames(sigtab) = row_sigtab
sigtab
rank_order = order(sigtab$pvalue,sigtab$pvalue,decreasing = FALSE)
sigtab = sigtab[rank_order,]
sigtab
x = 0
unwant = "uncultured"
threshold = data.frame()

for (i in row.names(sigtab)){
    if (grepl(unwant, i) == FALSE){
        threshold = rbind(threshold, sigtab[c(i),])
        x = x +1
    }
    if (x == 10){
        break
    }
}

threshold
pdf('T5_WSG_CoLvsL_top10pvalue_DESEQ.pdf', width=11, height=10)
theme_set(theme_bw())
ggplot(threshold, aes(y=row.names(threshold), x=threshold$log2FoldChange)) + 
  geom_vline(xintercept = 0.0, color = "gray", size = 0.5) +
  geom_point(size=6) + 
  ggtitle("WGS CoL/L T5 (Top 10 p-value)") +
  xlab("log2FoldChange") +
  ylab("Bacterial Species") + 
  theme(text= element_text(size=10), axis.text.x = element_text(angle = -90, hjust = 0, vjust=0.5),
        legend.position = 'none', plot.title = element_text(hjust = 0.5), axis.text=element_text(size=12))
dev.off()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1585988382327055, 'fraction_numerical': 0.03414891744411195, 'mean_word_length': 5.136069114470843, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, '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': '164987', 'license': 'MIT', 'n_tokens_mistral': 2403, 'n_tokens_neox': 2263, 'n_words': 395, 'path': 'DESEQ2/WGS/T5/T5_filtered_log2fold_graph.ipynb', 'repo_name': 'bryansho/PCOS_WGS_16S_metabolome', 'size': '5681'}