Skip to content

Commit

Permalink
Update empirical cumulative plots
Browse files Browse the repository at this point in the history
  • Loading branch information
kiepczi committed Jul 20, 2024
1 parent f8b5cc7 commit e0d7ba9
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 11 deletions.
Binary file modified supplementary_files/supplementary_file_1/Fig_2.pdf
Binary file not shown.
48 changes: 38 additions & 10 deletions supplementary_files/supplementary_file_1/generate_figures.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,19 @@ p<-ggplot(df, aes(x=number_of_cluster_members, group=theresholds_id, col=theresh
scale_color_manual(values=c("#022857", "#223e92", "#1576bb", "#458ccc", "#6aa6da", "#96c0e6", "#9acfe6", "#9ddceb", "#355E3B", "#152238", "#087E16", "#168E25", "#2CAC3C", "#43C152", "#5CD16A", "#7DE089", "#AFFAB8", "#D9D608", "#E8E62B",'#FFFF8F', "#F7F469"), name='Clustering \nThreshold (%)') +
scale_x_continuous(breaks = seq(0, 3600, 200), name ="Cluster Size") +
coord_cartesian(ylim = c(.98, 1)) +
stat_ecdf(geom = "step", pad = FALSE) + ylab("Proportion") +
stat_ecdf(geom = "step", pad = FALSE, size = 1.5) + ylab("Proportion") +
theme()+
guides(color = guide_legend(ncol = 1, title.position = "top", title.hjust = 1, title.vjust = 1,
label.position = "right", label.hjust = 1, label.vjust = 1)) +
theme(legend.position = c(0.95, 0.05), legend.justification = c(1, 0), legend.box.just = "right")
theme(legend.text = element_text(size = 20),
legend.title = element_text(size = 20),
legend.position = c(0.95, 0.05),
legend.justification = c(1, 0),
legend.box.just = "right",
axis.title.x = element_text(size = 20), # Adjust x-axis label size
axis.title.y = element_text(size = 20), # Adjust y-axis label size
axis.text.x = element_text(size = 15), # Adjust x-axis tick label size
axis.text.y = element_text(size = 15)) # Adjust y-axis tick label size
plot(p)
dev.off()

Expand All @@ -36,38 +44,58 @@ p<-ggplot(df, aes(x=unique_number_of_cluster_members, group=theresholds_id, col=
scale_color_manual(values=c("#022857", "#223e92", "#1576bb", "#458ccc", "#6aa6da", "#96c0e6", "#9acfe6", "#9ddceb", "#355E3B", "#152238", "#087E16", "#168E25", "#2CAC3C", "#43C152", "#5CD16A", "#7DE089", "#AFFAB8", "#D9D608", "#E8E62B",'#FFFF8F', "#F7F469"), name='Clustering \nThreshold (%)') +
xlim(0,100) + xlab("Unique taxID") +
coord_cartesian(ylim = c(.98, 1)) +
stat_ecdf(geom = "step", pad = FALSE) + ylab("Proportion") +
stat_ecdf(geom = "step", pad = FALSE, size = 1.5) + ylab("Proportion") +
theme()+
guides(color = guide_legend(ncol = 1, title.position = "top", title.hjust = 1, title.vjust = 1,
label.position = "right", label.hjust = 1, label.vjust = 1)) +
theme(legend.position = c(0.95, 0.05), legend.justification = c(1, 0), legend.box.just = "right")
theme(legend.text = element_text(size = 20),
legend.title = element_text(size = 20),
legend.position = c(0.95, 0.05),
legend.justification = c(1, 0),
legend.box.just = "right",
axis.title.x = element_text(size = 20), # Adjust x-axis label size
axis.title.y = element_text(size = 20), # Adjust y-axis label size
axis.text.x = element_text(size = 20), # Adjust x-axis tick label size
axis.text.y = element_text(size = 20)) # Adjust y-axis tick label size
plot(p)
dev.off()


#Generate Figure 2. Number of unique taxID in clusters vs proportion of all clusters

# Generate Figure 2. Number of unique taxID in clusters vs proportion of all clusters
data2 <- df[df$theresholds_id %in% c('100%', '99.5%', '99%', '98.5%', '98%'), ]

data2$theresholds_id <- factor(data2$theresholds_id, levels=c('100%', '99.5%', '99%', '98.5%', '98%'))

pdf(file='Fig_2.pdf', width=12, height=8)
p <- ggplot(data2, aes(x=unique_number_of_cluster_members, group=theresholds_id, col=theresholds_id)) +
stat_ecdf(geom = "step", pad=FALSE) +
p <- ggplot(data2, aes(x=unique_number_of_cluster_members, group=theresholds_id, col=theresholds_id, linetype=theresholds_id)) +
stat_ecdf(geom = "step", pad=FALSE, size = 1.5) + # Make lines thicker by setting size
xlim(0, 100) + xlab("Unique taxID") +
coord_cartesian(ylim = c(.98, 1)) +
stat_ecdf(geom = "step", pad = FALSE) + ylab("Proportion") +
ylab("Proportion") +
theme() +
scale_color_manual(name='Clustering \nThreshold (%)',
values=c('#F7F469', '#5CD16A', '#075711', '#6aa6da', '#152238')) +
values=c('#F0E442', '#009E73', '#56B4E9', '#E69F00', '#152238')) +
scale_linetype_manual(name='Clustering \nThreshold (%)',
values=c('solid', 'solid', 'solid', 'solid', 'solid')) + # Specify line types
guides(color = guide_legend(ncol = 1, title.position = "top", title.hjust = 1, title.vjust = 1,
label.position = "right", label.hjust = 1, label.vjust = 1)) +
theme(legend.position = c(0.95, 0.05), legend.justification = c(1, 0), legend.box.just = "right")
theme(legend.text = element_text(size = 30),
legend.title = element_text(size = 32),
legend.position = c(0.95, 0.05),
legend.justification = c(1, 0),
legend.box.just = "right",
axis.title.x = element_text(size = 20), # Adjust x-axis label size
axis.title.y = element_text(size = 20), # Adjust y-axis label size
axis.text.x = element_text(size = 20), # Adjust x-axis tick label size
axis.text.y = element_text(size = 20)) # Adjust y-axis tick label size

plot(p)
dev.off()




#Generate Supplementary Figure 26. Total number of 16S rRNA copies per genome vs Total number of unique 16S rRNA copies per genome
data <- read.csv("genome_16S_info.csv") #Loading data

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,10 @@ p <- ggplottree(tree, df, cols=c('representative_disperions'),
geom_strip('Streptomyces_sp.__1__Streptomyces_bingchengensis__1__Streptomyces_bingchenggensis__1__id001604', 'Streptoalloteichus_tenebrarius__COLLAPSED__id002124', barsize=0, color='black', label="Clade 1", fontsize=10, angle=-60, offset.text =-0.05, hjust=0.5) +
geom_strip('no_species_info_id001602', 'Streptomyces_variabilis__COLLAPSED__id001045', barsize=2, color='white', label="", fontsize=10, angle=40, offset.text =-0.05, hjust=0.5) +
geom_strip('Streptomyces_stelliscabiei__12__Streptomyces_sp.__11__Streptomyces_scabiei__6__id004463', 'no_species_info_id004839', barsize=2, color='white', label="", fontsize=10, offset.text =-0.05, hjust=-0.5) +
geom_strip('Streptomyces_sp.__1__Streptomyces_bingchengensis__1__Streptomyces_bingchenggensis__1__id001604', 'Streptoalloteichus_tenebrarius__COLLAPSED__id002124', barsize=2, color='white', label="", fontsize=10, angle=-60, offset.text =-0.05, hjust=0.5)
geom_strip('Streptomyces_sp.__1__Streptomyces_bingchengensis__1__Streptomyces_bingchenggensis__1__id001604', 'Streptoalloteichus_tenebrarius__COLLAPSED__id002124', barsize=2, color='white', label="", fontsize=10, angle=-60, offset.text =-0.05, hjust=0.5)+
theme(legend.text = element_text(size = 40), # Adjust legend text size
legend.title = element_text(size = 42), # Adjust legend title size
legend.position = c(0.2, 0.5)) # Move legend to the left

plot(p)
dev.off()
Expand Down
Binary file modified supplementary_files/supplementary_file_7.pdf
Binary file not shown.
Binary file modified supplementary_files/supplementary_file_8.pdf
Binary file not shown.

0 comments on commit e0d7ba9

Please sign in to comment.